Jelajahi Sumber

feat:活动页面

zhanghui 1 tahun lalu
induk
melakukan
491fdbaf3c

+ 43 - 0
common/js/api.js

@@ -3,6 +3,49 @@ import request from '../js/request.js';
 
 export default {
 
+    //我的活动详情
+    myActivityDetail(data) {
+        return request({
+            url: '/business/wechat/activity/detail',
+            method: 'GET',
+            data: data
+        })
+    },
+
+    //我的活动
+    myActivity(data) {
+        return request({
+            url: '/business/wechat/myActivity',
+            method: 'GET',
+            data: data
+        })
+    },
+
+    //活动详情
+    activityCheck(data) {
+        return request({
+            url: '/business/wechat/activity/check?activityId='+ data.activityId,
+            method: 'GET'
+        })
+    },
+
+    //活动详情
+    activityDetail(data) {
+        return request({
+            url: '/business/wechat/activity/'+ data.id,
+            method: 'GET'
+        })
+    },
+
+    //活动列表
+    activityList(data) {
+        return request({
+            url: '/business/wechat/activity/list',
+            method: 'GET',
+            data: data
+        })
+    },
+
     //根据key获取系统配置
     getConfigKey(data) {
         return request({

+ 2 - 3
common/js/env.js

@@ -3,10 +3,9 @@
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn`
 // let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
 /** 测试环境 */
-let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
+// let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
 /** 开发环境*/
-// let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
-// let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
 // let baseUrl = `http://u2mu3zixu5wm.ngrok.xiaomiqiu123.top`
 // let baseUrl = `http://47.108.114.127:10888`
 

+ 4 - 0
myPages/myActivity/index.rpx.scss

@@ -0,0 +1,4 @@
+.page{
+  padding: 0 24rpx;
+  background: #f7f7f7;
+}

+ 31 - 0
myPages/myActivity/module/index.rpx.css

@@ -0,0 +1,31 @@
+.outView{
+    background: #FFFFFF;
+    border-radius: 15px;
+    padding: 20rpx;
+    margin-top: 20rpx;
+}
+
+.title{
+    font-size: 30rpx;
+    font-weight: bold;
+}
+.item{
+    margin-top: 20rpx;
+    font-size: 28rpx;
+    color: #999999;
+}
+.price{
+    color: #ed569f;
+}
+.detail{
+    margin-top: 20rpx;
+    width: 190rpx;
+    height: 50rpx;
+    border: 2rpx solid #f0f0f0;
+    border-radius: 30rpx;
+
+    font-size: 26rpx;
+    line-height: 50rpx;
+    text-align: center;
+    color: #999999;
+}

+ 163 - 0
myPages/myActivity/module/mescrollUni-item.vue

@@ -0,0 +1,163 @@
+<template>
+	<!--
+    swiper中的transfrom会使fixed失效,此时用height固定高度;
+    swiper中无法触发mescroll-mixins.js的onPageScroll和onReachBottom方法,只能用mescroll-uni,不能用mescroll-body
+    -->
+	<!-- ref动态生成: 字节跳动小程序编辑器不支持一个页面存在相同的ref (如不考虑字节跳动小程序可固定值为 ref="mescrollRef") -->
+	<!-- top的高度等于悬浮菜单tabs的高度 -->
+	<mescroll-uni :ref="'mescrollRef' + i" @init="mescrollInit" :height="height" :down="downOption" @down="downCallback"
+		:up="upOption" @up="upCallback" @emptyclick="emptyClick">
+
+
+
+    <view class="flex-col justify-start">
+
+      <view class="flex-col justify-start outView" v-for="(item,index) in list" :key="index">
+        <view class="title">
+          <text>{{item.title}}</text>
+        </view>
+        <view class="flex-row justify-start item">
+          <text>活动价格:</text>
+          <text class="price">{{item.salePrice}}元</text>
+        </view>
+        <view class="flex-row justify-start item" >
+          <text>活动时间:</text>
+          <text v-if="item.valid == 2">{{item.validBeginTime.slice(0,10)}} 至 {{item.validEndTime.slice(0,10)}}</text>
+          <text v-else>长期有效</text>
+        </view>
+        <view class="flex-row justify-center">
+          <view class="detail" @click="goDetail(item)">活动详情></view>
+        </view>
+      </view>
+
+    </view>
+
+	</mescroll-uni>
+</template>
+
+<script>
+import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
+import MescrollMoreItemMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mixins/mescroll-more-item.js"
+export default {
+	mixins: [MescrollMixin, MescrollMoreItemMixin], // 注意此处还需使用MescrollMoreItemMixin (必须写在MescrollMixin后面)
+	components: {
+	},
+
+	data() {
+		return {
+			showRemarkId:'',
+			downOption: {
+				auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
+			},
+			upOption: {
+				auto: false, // 不自动加载
+				// page: {
+				// 	num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
+				// 	size: 10 // 每页数据的数量
+				// },
+				noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
+				empty: {
+					icon: '/static/imageIcon/empty.png',
+					tip: '暂无内容', // 提示
+					// btnText: '去看看'
+				},
+				textNoMore: '没有更多了'
+			},
+			list: [],
+		}
+	},
+	props: {
+		i: Number, // 每个tab页的专属下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+		index: { // 当前tab的下标 (除了支付宝小程序必须在这里定义, 其他平台都可不用写, 因为已在MescrollMoreItemMixin定义)
+			type: Number,
+			default() {
+				return 0
+			}
+		},
+		dataTime: {
+			type: String,
+			default() {
+				return ''
+			}
+		},
+
+		tabs: { // 为了请求数据,演示用,可根据自己的项目判断是否要传
+			type: Array,
+			default() {
+				return []
+			}
+		},
+		height: [Number, String], // mescroll的高度
+
+	},
+	watch: {
+
+	},
+
+	created() {
+	},
+
+	methods: {
+
+    goDetail(e){
+      uni.navigateTo({
+        url:'/myPages/myActivityDetail/myActivityDetail?activityOrderId=' + e.id
+      })
+    },
+
+
+
+
+		/*下拉刷新的回调 */
+		downCallback() {
+			// 这里加载你想下拉刷新的数据, 比如刷新轮播数据
+			// loadSwiper();
+			// 下拉刷新的回调,默认重置上拉加载列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
+			this.mescroll.resetUpScroll()
+		},
+		/*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
+		upCallback(page) {
+
+			//联网加载数据
+			let httpData = {
+				pageNum: page.num,
+				pageSize: 10,
+			}
+			this.$api.myActivity(httpData).then((res) => {
+				//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+				this.mescroll.endSuccess(res.data.rows.length, res.data.rows.length === 10);
+				//设置列表数据
+				if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
+				this.list = this.list.concat(res.data.rows); //追加新数据
+				console.log(this.list)
+			}).catch((err) => {
+				//联网失败, 结束加载
+				this.mescroll.endErr();
+			})
+
+
+		},
+
+		//点击空布局按钮的回调
+		emptyClick() {
+			uni.showToast({
+				title: '点击了按钮,具体逻辑自行实现'
+			})
+		},
+		// 搜索
+		doSearch() {
+			this.list = []; // 先清空列表,显示加载进度
+			this.mescroll.resetUpScroll();
+		},
+
+		gotoUseCoupon(item){
+			console.log(item)
+		}
+
+	}
+}
+</script>
+<style>
+@import '/common/css/common.css';
+@import './index.rpx.css';
+</style>

+ 32 - 0
myPages/myActivity/myActivity.vue

@@ -0,0 +1,32 @@
+<template>
+  <view class="page">
+    <mescroll-item ref="MescrollItem" :i="0"  :index="0" :height="windowHeight">
+    </mescroll-item>
+  </view>
+</template>
+
+<script>
+
+import MescrollItem from "./module/mescrollUni-item.vue";
+export default {
+  components: {
+    MescrollItem
+  },
+
+  data() {
+    return {
+      windowHeight: '',
+    }
+  },
+  onLoad(e) {
+    let sysInfo = uni.getSystemInfoSync()
+    this.windowHeight = sysInfo.windowHeight + 'px'
+  },
+  methods: {}
+}
+</script>
+
+<style lang="scss" scoped>
+@import '/common/css/common.css';
+@import './index.rpx.scss';
+</style>

+ 150 - 0
myPages/myActivityDetail/index.rpx.scss

@@ -0,0 +1,150 @@
+.page{
+  height: 100vh;
+}
+.content{
+  display: flex;
+  flex: 1;
+  overflow: auto;
+}
+
+.out1{
+  background: #ffffff;
+  padding: 0 32rpx;
+}
+.top{
+  background: #ffffff;
+  padding: 20rpx 0;
+  font-size: 28rpx;
+  color: #999999;
+  line-height: 50rpx;
+  border-bottom: 2rpx solid #f1f1f1;
+}
+
+.top1{
+  background: #ffffff;
+  padding: 20rpx 0;
+  font-size: 28rpx;
+  color: #999999;
+  line-height: 50rpx;
+}
+
+.title{
+  font-size: 30rpx;
+  font-weight: bold;
+  color: #000000;
+}
+
+.price{
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #ed569f;
+}
+
+.out2{
+  background: #f7f7f7;
+  padding: 0 32rpx 30rpx 32rpx;
+}
+.ticket{
+  padding: 20rpx 0;
+}
+
+.ticketList{
+  width: 686rpx;
+  height: 188rpx;
+  margin-top: 24rpx;
+  background-image: url('/static/coupon/u210.png');
+  background-repeat: no-repeat;
+  background-size: cover;
+}
+.h-text{
+  width: 200rpx;
+  height: 188rpx;
+}
+.money{
+  height: 52rpx;
+  font-size: 36rpx;
+  font-family: DINAlternate-Bold, DINAlternate;
+  font-weight: bold;
+  color: #333333;
+  line-height: 52rpx;
+  text-align: center;
+}
+.desc{
+  height: 36rpx;
+  font-size: 20rpx;
+  font-weight: 400;
+  color: #333333;
+  line-height: 36rpx;
+  text-align: center;
+}
+.h-center-content{
+  width: 298rpx;
+  height: 188rpx;
+}
+
+.h-value{
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #333333;
+  line-height: 44rpx;
+  margin-top: 24rpx;
+  margin-left: 24rpx;
+}
+
+.ticketMsg{
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #999999;
+  line-height: 36rpx;
+  margin-left: 24rpx;
+}
+
+.h-right-content{
+  width: 188rpx;
+  height: 188rpx;
+}
+.btn{
+  width: 156rpx;
+  height: 64rpx;
+  background: #93D21A;
+  border-radius: 32rpx;
+
+  font-size: 24rpx;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 64rpx;
+  text-align: center;
+}
+
+.link{
+  background: #FFFFFF;
+  padding: 10rpx 24rpx;
+  margin-top: 20rpx;
+  line-height: 60rpx;
+  font-size: 28rpx;
+  color: #999999;
+}
+
+.inBtnView{
+  height: 150rpx;
+}
+
+.inBtn{
+  background: #FFE05C;
+  width: 686rpx;
+  height: 90rpx;
+  border-radius: 45rpx;
+  margin-top: 20rpx;
+  margin-bottom: 40rpx;
+
+  line-height: 90rpx;
+  text-align: center;
+  font-size: 30rpx;
+  font-weight: bold;
+}
+.activityKey{
+  width: 140rpx;
+}
+.activityValue{
+  flex: 1;
+}

+ 152 - 0
myPages/myActivityDetail/myActivityDetail.vue

@@ -0,0 +1,152 @@
+<template>
+  <view class="flex-col page">
+
+    <view class="flex-col content">
+      <view class="out1">
+        <view class="flex-col top">
+          <view class="flex-row title">
+            <text>{{activity.title}}</text>
+          </view>
+          <view class="flex-row price">
+            <text>¥{{activity.salePrice}}</text>
+          </view>
+          <view class="flex-row justify-start" >
+            <view class="activityKey ">
+              <text>活动时间:</text>
+            </view>
+            <view>
+              <text v-if="activity.valid == 2">{{activity.validBeginTime.substring(0,10)}} 至 {{activity.validEndTime.substring(0,10)}}</text>
+              <text v-else>长期有效</text>
+            </view>
+          </view>
+          <view class="flex-row justify-start">
+            <view class="activityKey">
+              <text>活动门店:</text>
+            </view>
+            <view class="activityValue">
+              <text>{{activity.useStoreDesc}}</text>
+            </view>
+          </view>
+          <view class="flex-row">
+            <view class="activityKey">
+              <text>活动描述:</text>
+            </view>
+            <view class="activityValue">
+              <text>{{activity.description}}</text>
+            </view>
+
+          </view>
+        </view>
+      </view>
+
+      <!--          <view class="out1">-->
+      <!--            <view class="flex-col top1">-->
+      <!--              <view class="flex-row justify-center title">-->
+      <!--                <text>退款策略(模块标题)</text>-->
+      <!--              </view>-->
+      <!--              <view class="flex-row">-->
+      <!--                <text>-->
+      <!--                  活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述-->
+      <!--                </text>-->
+      <!--              </view>-->
+      <!--            </view>-->
+      <!--          </view>-->
+
+
+      <view class="out2" v-if="activity.couponList">
+        <view class="flex-col ticket">
+          <view class="flex-row justify-center title">
+            <text>赠送优惠券</text>
+          </view>
+
+          <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
+            <view class="h-text flex-col justify-center ">
+              <text class="money">{{i.discountsPrice}}</text>
+              <text class="desc">满{{ i.reachPrice }}可用</text>
+            </view>
+
+            <view class="h-center-content flex-col justify-around">
+              <view class="h-value">
+                <text>{{ i.name }}</text>
+              </view>
+              <!--            <view class="ticketMsg">-->
+              <!--              使用平台:-->
+              <!--              <text>全平台</text>-->
+              <!--            </view>-->
+
+              <view class="ticketMsg">
+                可用次数/总次数:{{i.degree}}/{{i.totalDegree}}
+              </view>
+
+              <view class="ticketMsg">
+                到期时间:{{i.endTime.substring(0,10)}}
+              </view>
+              <!--            <view class="ticketMsg flex-row">-->
+              <!--              <text @click.stop="showRemark(item)">使用规则</text>-->
+              <!--              <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>-->
+              <!--              <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>-->
+              <!--            </view>-->
+            </view>
+
+          </view>
+        </view>
+
+        <!--              <view class="flex-row justify-between link">-->
+        <!--                <text>跳转一</text>-->
+        <!--                <u-icon  name="arrow-right" color="" size="12"></u-icon>-->
+        <!--              </view>-->
+
+        <!--              <view class="flex-row justify-between link">-->
+        <!--                <text>跳转一</text>-->
+        <!--                <u-icon name="arrow-right" color="" size="12"></u-icon>-->
+        <!--              </view>-->
+
+      </view>
+
+
+    </view>
+
+
+
+
+
+  </view>
+</template>
+
+<script>
+
+export default {
+  components: {
+  },
+  data() {
+    return {
+      userInfo: {},
+      activityOrderId: '',
+      activity: {},
+    }
+  },
+  onLoad(e) {
+    this.userInfo = uni.getStorageSync('userInfo')
+    this.activityOrderId = e.activityOrderId
+    this.myActivityDetail()
+  },
+  methods: {
+    myActivityDetail() {
+      this.$api.myActivityDetail({
+        activityOrderId: this.activityOrderId,
+      }).then(res => {
+        console.log(res)
+        this.activity = res.data.data
+        this.$set(this.activity)
+      })
+    },
+
+  }
+}
+</script>
+
+
+<style lang="scss" scoped>
+@import '/common/css/common.css';
+@import './index.rpx.scss';
+</style>

+ 192 - 74
orderPages/activityDetail/activityDetail.vue

@@ -1,106 +1,224 @@
 <template>
-  <view>
-    <view class="out1">
-      <view class="flex-col top">
-        <view class="flex-row title">
-          <text>活动名称</text>
-        </view>
-        <view class="flex-row price">
-          <text>¥98.00</text>
-        </view>
-        <view class="flex-row">
-          <text>活动时间:</text>
-          <text>2024年8月10日 至 2099年10月1日</text>
-        </view>
-        <view class="flex-row">
-          <text>是否退款:</text>
-          <text>是</text>
-        </view>
-        <view class="flex-row">
-          <text>
-            活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述
-          </text>
-        </view>
-      </view>
-    </view>
+  <view class="flex-col page">
 
-    <view class="out1">
-      <view class="flex-col top1">
-        <view class="flex-row justify-center title">
-          <text>退款策略(模块标题)</text>
-        </view>
-        <view class="flex-row">
-          <text>
-            活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述
-          </text>
+    <view class="flex-col content">
+      <view class="out1">
+        <view class="flex-col top">
+          <view class="flex-row title">
+            <text>{{activity.title}}</text>
+          </view>
+          <view class="flex-row price">
+            <text>¥{{activity.salePrice}}</text>
+          </view>
+          <view class="flex-row" >
+            <view class="activityKey ">
+              <text>活动时间:</text>
+            </view>
+            <view>
+              <text v-if="activity.valid == 2">{{activity.validBeginTime.substring(0,10)}} 至 {{activity.validEndTime.substring(0,10)}}</text>
+              <text v-else>长期有效</text>
+            </view>
+          </view>
+          <view class="flex-row">
+
+            <view class="activityKey ">
+              <text>活动门店:</text>
+            </view>
+            <view class="activityValue">
+              <text>{{activity.useStoreDesc}}</text>
+            </view>
+          </view>
+          <view class="flex-row">
+            <view class="activityKey ">
+              <text>活动描述:</text>
+            </view>
+            <view class="activityValue">
+              <text>{{activity.description}}</text>
+            </view>
+
+          </view>
         </view>
       </view>
-    </view>
 
+<!--          <view class="out1">-->
+<!--            <view class="flex-col top1">-->
+<!--              <view class="flex-row justify-center title">-->
+<!--                <text>退款策略(模块标题)</text>-->
+<!--              </view>-->
+<!--              <view class="flex-row">-->
+<!--                <text>-->
+<!--                  活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述活动描述-->
+<!--                </text>-->
+<!--              </view>-->
+<!--            </view>-->
+<!--          </view>-->
 
-    <view class="out2">
-      <view class="flex-col ticket">
-        <view class="flex-row justify-center title">
-          <text>赠送优惠券</text>
-        </view>
 
-        <view class="flex-row ticketList" v-for="(i,index) in 2">
-          <view class="h-text flex-col justify-center ">
-            <text class="money">什么券</text>
-            <text class="desc">满100可用</text>
+      <view class="out2" v-if="activity.couponList">
+        <view class="flex-col ticket">
+          <view class="flex-row justify-center title">
+            <text>赠送优惠券</text>
           </view>
 
-          <view class="h-center-content flex-col justify-around">
-            <view class="h-value">
-              <text>{{ item.name }}</text>
-            </view>
-            <view class="ticketMsg">
-              使用平台:
-              <text>全平台</text>
-            </view>
-            <view class="ticketMsg">
-              使用次数:99
+          <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
+            <view class="h-text flex-col justify-center ">
+              <text class="money">{{i.discountsPrice}}</text>
+              <text class="desc">满{{ i.reachPrice }}可用</text>
             </view>
-            <view class="ticketMsg">
-              领取后30天内有效
+
+            <view class="h-center-content flex-col justify-around">
+              <view class="h-value">
+                <text>{{ i.name }}</text>
+              </view>
+              <!--            <view class="ticketMsg">-->
+              <!--              使用平台:-->
+              <!--              <text>全平台</text>-->
+              <!--            </view>-->
+              <view class="ticketMsg">
+                使用次数:{{ i.degree }}
+              </view>
+              <view class="ticketMsg">
+                领取后{{ i.effectiveDays }}天内有效
+              </view>
+              <!--            <view class="ticketMsg flex-row">-->
+              <!--              <text @click.stop="showRemark(item)">使用规则</text>-->
+              <!--              <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>-->
+              <!--              <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>-->
+              <!--            </view>-->
             </view>
-<!--            <view class="ticketMsg flex-row">-->
-<!--              <text @click.stop="showRemark(item)">使用规则</text>-->
-<!--              <u-icon v-if="item.id == showRemarkId" name="arrow-down-fill" color="" size="12"></u-icon>-->
-<!--              <u-icon v-else name="play-right-fill" color="" size="12"></u-icon>-->
-<!--            </view>-->
-          </view>
 
-          <view class="h-right-content flex-col justify-center ">
-            <view class="btn">
-              <text>立即领取</text>
+            <view class="h-right-content flex-col justify-center ">
+              <!--            <view class="btn">-->
+              <!--              <text>立即领取</text>-->
+              <!--            </view>-->
             </view>
           </view>
         </view>
-      </view>
 
-      <view class="flex-row justify-between link">
-        <text>跳转一</text>
-        <u-icon  name="arrow-right" color="" size="12"></u-icon>
-      </view>
+<!--              <view class="flex-row justify-between link">-->
+<!--                <text>跳转一</text>-->
+<!--                <u-icon  name="arrow-right" color="" size="12"></u-icon>-->
+<!--              </view>-->
+
+<!--              <view class="flex-row justify-between link">-->
+<!--                <text>跳转一</text>-->
+<!--                <u-icon name="arrow-right" color="" size="12"></u-icon>-->
+<!--              </view>-->
 
-      <view class="flex-row justify-between link">
-        <text>跳转一</text>
-        <u-icon name="arrow-right" color="" size="12"></u-icon>
       </view>
 
+
     </view>
 
+    <view class="flex-row justify-center inBtnView" >
+      <view class="inBtn" @click="commitOrder" v-if="!isActivityCheck">立即参与</view>
+      <view class="inBtn" v-else>已参与</view>
+    </view>
+
+    <myPay ref="myPay" :selectBlPay="userInfo.balance *1 >= activity.salePrice *1" :balance="userInfo.balance" :totalAmount="activity.salePrice"  :lovePay="false" :blPay="false"
+           :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
+
 
   </view>
 </template>
 
 <script>
+import myPay from '../../components/pay/pay';
 export default {
+  components: {
+    myPay
+  },
   data() {
-    return {}
+    return {
+      userInfo:{},
+      subOrderNo:'',
+      id:'',
+      activity:{},
+      requestStatus:false,
+      isActivityCheck:true, //是否参与过该活动
+    }
+  },
+  onLoad(e) {
+    this.userInfo = uni.getStorageSync('userInfo')
+    this.id = e.id
+    console.log('上一个页面传递过来的活动ID',this.id)
+    this.activityDetail()
+    this.activityCheck()
   },
-  methods: {}
+  methods: {
+
+    //支付结果回调
+    payResult(e){
+      console.log(e)
+      if(e.payResult){
+        uni.showToast({
+          title: '支付成功!'
+        });
+        this.isActivityCheck = true
+      }else {
+        uni.showToast({
+          title: '支付失败!',
+          icon: 'error'
+        });
+      }
+
+    },
+
+    //支付弹窗关闭回调
+    improperClose(){
+
+    },
+
+
+    //提交订单
+    commitOrder() {
+      if (this.subOrderNo){
+        this.$refs.myPay.openPopup()
+      }else {
+
+        if (this.requestStatus) {
+          return;
+        }
+        this.requestStatus = true
+        uni.showLoading({
+          title: '加载中'
+        });
+        this.$api.commonGeneralOrder({
+          orderType: 7,
+          activityId: this.activity.id,
+        }).then(res => {
+          console.log('++++++++++++++++++订单提交+++++++++++', res)
+            uni.hideLoading();
+            this.subOrderNo = res.data.data.orderNo
+            this.$refs.myPay.openPopup()
+          this.requestStatus = false
+        }).catch(err => {
+          this.requestStatus = false
+        })
+      }
+    },
+
+
+    activityDetail(){
+      this.$api.activityDetail({
+        id:this.id,
+      }).then(res=>{
+        console.log(res)
+        this.activity = res.data.data
+        this.$set(this.activity)
+
+      })
+    },
+
+    activityCheck(){
+      this.$api.activityCheck({activityId:this.id,}).then(res=>{
+        console.log(res)
+        this.isActivityCheck = res.data.data
+      })
+    }
+
+
+  }
 }
 </script>
 

+ 34 - 0
orderPages/activityDetail/index.rpx.scss

@@ -1,3 +1,12 @@
+.page{
+  height: 100vh;
+}
+.content{
+  display: flex;
+  flex: 1;
+  overflow: auto;
+}
+
 .out1{
   background: #ffffff;
   padding: 0 32rpx;
@@ -114,4 +123,29 @@
   line-height: 60rpx;
   font-size: 28rpx;
   color: #999999;
+}
+
+.inBtnView{
+  height: 150rpx;
+}
+
+.inBtn{
+  background: #FFE05C;
+  width: 686rpx;
+  height: 90rpx;
+  border-radius: 45rpx;
+  margin-top: 20rpx;
+  margin-bottom: 40rpx;
+
+  line-height: 90rpx;
+  text-align: center;
+  font-size: 30rpx;
+  font-weight: bold;
+}
+
+.activityKey{
+  width: 140rpx;
+}
+.activityValue{
+  flex: 1;
 }

+ 19 - 20
orderPages/activityList/module/mescrollUni-item.vue

@@ -12,20 +12,21 @@
 
     <view class="flex-col justify-start">
 
-      <view class="flex-col justify-start outView" v-for="(i,index) in 10" :key="index">
+      <view class="flex-col justify-start outView" v-for="(item,index) in list" :key="index">
         <view class="title">
-          <text>活动名称活动名称活动名称活动名称活动名称</text>
+          <text>{{item.title}}</text>
         </view>
         <view class="flex-row justify-start item">
           <text>活动价格:</text>
-          <text class="price">98.22元</text>
+          <text class="price">{{item.salePrice}}元</text>
         </view>
         <view class="flex-row justify-start item">
           <text>活动时间:</text>
-          <text>2024年8月10日 至 2099年10月1日</text>
+          <text  v-if="item.valid == 2">{{item.validBeginTime.slice(0,10)}} 至 {{item.validEndTime.slice(0,10)}}</text>
+          <text v-else>长期有效</text>
         </view>
         <view class="flex-row justify-center">
-          <view class="detail" @click="goDetail">活动详情></view>
+          <view class="detail" @click="goDetail(item)">活动详情></view>
         </view>
       </view>
 
@@ -98,9 +99,9 @@ export default {
 
 	methods: {
 
-    goDetail(){
+    goDetail(e){
       uni.navigateTo({
-        url:'/orderPages/activityDetail/activityDetail'
+        url:'/orderPages/activityDetail/activityDetail?id=' + e.id
       })
     },
 
@@ -121,20 +122,18 @@ export default {
 			let httpData = {
 				pageNum: page.num,
 				pageSize: 10,
-				type: this.index
 			}
-      this.mescroll.endSuccess(0, false);
-			// this.$api.getMyCouponList(httpData).then((res) => {
-			// 	//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
-			// 	this.mescroll.endSuccess(res.data.rows.length, res.data.rows.length === 10);
-			// 	//设置列表数据
-			// 	if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
-			// 	this.list = this.list.concat(res.data.rows); //追加新数据
-			// 	console.log(this.list)
-			// }).catch((err) => {
-			// 	//联网失败, 结束加载
-			// 	this.mescroll.endErr();
-			// })
+			this.$api.activityList(httpData).then((res) => {
+				//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
+				this.mescroll.endSuccess(res.data.rows.length, res.data.rows.length === 10);
+				//设置列表数据
+				if (page.num === 1) this.list = []; //如果是第一页需手动制空列表
+				this.list = this.list.concat(res.data.rows); //追加新数据
+				console.log(this.list)
+			}).catch((err) => {
+				//联网失败, 结束加载
+				this.mescroll.endErr();
+			})
 
 
 		},

+ 8 - 2
orderPages/myCoupon/module/index.rpx.css

@@ -21,12 +21,18 @@
     height: 188rpx;
 }
 .h-center-content{
-    width: 298rpx;
+    width: 500rpx;
     height: 188rpx;
 }
+.quan{
+    position: relative;
+}
 .h-right-content{
-    width: 188rpx;
+    width: 160rpx;
     height: 188rpx;
+    position: absolute;
+    top: 0;
+    right: 0;
 }
 .money{
     height: 52rpx;

+ 2 - 2
orderPages/myCoupon/module/mescrollUni-item.vue

@@ -11,7 +11,7 @@
 		<view class="flex-row justify-center">
 			<view class="flex-col">
 				<view  class="flex-col" v-for="(item,index) in list" :key="index" >
-					<view class="flex-row justify-start" :class="item.state == '0'?'row-list':'listBackground'">
+					<view class="flex-row justify-start quan" :class="item.state == '0'?'row-list':'listBackground'">
 						<view class="h-text flex-col justify-center ">
 							<view class="money">
 								<text>{{item.discountsPrice}}</text>
@@ -45,7 +45,7 @@
 								<u-icon v-else name="play-right-fill" color="" size="12"></u-icon>
 							</view>
 						</view>
-						<view class="h-right-content flex-col justify-center ">
+						<view class="h-right-content flex-col justify-center">
 							<view v-if="item.state == 0" ></view>
 							<!--							<view @click="gotoUseCoupon(item)" v-if="item.state == 0" class="h-btn-value-use">立即使用</view>-->
 							<!-- <view @click="gotoReceiveCoupon()" v-else-if="index == 1" class="h-btn-value-receive">立即领取</view> -->

+ 5 - 1
orderPages/receiveCoupons/index.vue

@@ -32,7 +32,11 @@
               使用次数:{{ item.degree }}
             </view>
             <view class="title">
-              领取后{{ item.effectiveDays }}天内有效
+              <text v-if="item.validType == 1">领取后{{ item.effectiveDays }}天内有效</text>
+              <view v-else>
+                <view>使用期限:{{item.startTime.substring(0,10)}}  </view>
+                <view> 至 {{item.endTime.substring(0,10)}}</view>
+              </view>
             </view>
             <view class="title flex-row">
               <text @click.stop="showRemark(item)">使用规则</text>

+ 14 - 0
pages.json

@@ -372,6 +372,20 @@
 						"enablePullDownRefresh": false
 					}
 
+				},
+				{
+					"path" : "myActivity/myActivity",
+					"style" : 
+					{
+						"navigationBarTitleText" : "我的活动"
+					}
+				},
+				{
+					"path" : "myActivityDetail/myActivityDetail",
+					"style" : 
+					{
+						"navigationBarTitleText" : "活动详情"
+					}
 				}
 			]
 		},

+ 2 - 1
pages/my/index.vue

@@ -113,7 +113,8 @@ export default {
         {thumb: '/static/me/u826.png', title: '储值服务', rightText: '', to: '/myPages/recharge/index'},
         {thumb: '/static/me/u701.png', title: '交易记录', rightText: '', to: '/myPages/transactionRecord/index'},
         {thumb: '/static/me/u11.png', title: '会员须知', rightText: '', to: '/myPages/aboutOur/index'},
-        {thumb: '/static/me/familyCard_icon.png', title: '亲情卡', rightText: '', to: '/myPages/familyCard/index'}
+        {thumb: '/static/me/familyCard_icon.png', title: '亲情卡', rightText: '', to: '/myPages/familyCard/index'},
+        {thumb: '/static/me/hd.png', title: '我的活动', rightText: '', to: '/myPages/myActivity/myActivity'}
       ],
       group2: [
 

TEMPAT SAMPAH
static/me/hd.png