Browse Source

fix: 活动分享细节优化

Cooklalala 1 year ago
parent
commit
db911b9de9

+ 130 - 127
myPages/myActivity/module/mescrollUni-item.vue

@@ -1,29 +1,36 @@
 <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">
-
+  <!-- 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 :style="{filter:(item.isRefund == 1 ? 'grayscale(100%)':'') }">
+          <view class="justify-between">
+            <view class="title">
+              <text>{{ item.title }}</text>
+            </view>
+            <view v-if="item.isRefund == 1">
+              已退款
+            </view>
+          </view>
+          <view class="flex-row justify-start item">
+            <text>活动价格:</text>
+            <text class="price">{{ item.payAmount }}元</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>
         <view class="flex-row justify-center">
           <view class="detail" @click="goDetail(item)">活动详情></view>
@@ -32,129 +39,125 @@
 
     </view>
 
-	</mescroll-uni>
+  </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){
+  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
+        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)
+    }
 
-		/*下拉刷新的回调 */
-		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>

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

@@ -10,6 +10,8 @@
 .out1{
   background: #ffffff;
   padding: 0 32rpx;
+  display: flex;
+  justify-content: space-between;
 }
 .top{
   background: #ffffff;
@@ -147,3 +149,4 @@
 .activityValue{
   flex: 1;
 }
+

+ 57 - 16
myPages/myActivityDetail/myActivityDetail.vue

@@ -5,17 +5,19 @@
       <view class="out1">
         <view class="flex-col top">
           <view class="flex-row title">
-            <text>{{activity.title}}</text>
+            <text>{{ activity.title }}</text>
           </view>
           <view class="flex-row price">
-            <text>¥{{activity.salePrice}}</text>
+            <text>¥{{ activity.payAmount }}</text>
           </view>
-          <view class="flex-row justify-start" >
+          <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-if="activity.valid == 2">{{ activity.validBeginTime.substring(0, 10) }} 至
+                {{ activity.validEndTime.substring(0, 10) }}
+              </text>
               <text v-else>长期有效</text>
             </view>
           </view>
@@ -24,7 +26,7 @@
               <text>活动门店:</text>
             </view>
             <view class="activityValue">
-              <text>{{activity.useStoreDesc}}</text>
+              <text>{{ activity.useStoreDesc }}</text>
             </view>
           </view>
           <view class="flex-row">
@@ -32,15 +34,19 @@
               <text>活动描述:</text>
             </view>
             <view class="activityValue">
-              <text>{{activity.description}}</text>
+              <text>{{ activity.description }}</text>
             </view>
 
           </view>
         </view>
+        <view v-if="activity.canShare" class="flex-col top">
+          <button open-type="share" type="primary" plain="true" size="mini" class="pic_r3">
+            <text class="tit">分享活动</text>
+            <uni-icons color="#18bc37" type="redo-filled" size="14"></uni-icons>
+          </button>
+        </view>
       </view>
 
-
-
       <view class="out2" v-if="activity.couponList">
         <view class="flex-col ticket">
           <view class="flex-row justify-center title">
@@ -49,8 +55,8 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
             <view class="h-text flex-col justify-center ">
-              <text class="money" v-if="i.discountsType == 2">{{i.discount}}折</text>
-              <text class="money" v-else>{{i.discountsPrice}}</text>
+              <text class="money" v-if="i.discountsType == 2">{{ i.discount }}折</text>
+              <text class="money" v-else>{{ i.discountsPrice }}</text>
               <text class="desc">满{{ i.reachPrice }}可用</text>
             </view>
 
@@ -64,7 +70,7 @@
               <!--            </view>-->
 
               <view class="ticketMsg">
-                可用次数/总次数:{{i.degree}}/{{i.totalDegree}}
+                可用次数/总次数:{{ i.degree }}/{{ i.totalDegree }}
               </view>
               <view class="ticketMsg">
                 服务项目:{{ i.useServiceDesc }}
@@ -72,7 +78,7 @@
               <view class="ticketMsg">
                 <text v-if="i.validType == 1">领取后{{ i.effectiveDays }}天内有效</text>
                 <view v-else>
-                  <view>使用期限:{{i.startTime.substring(0,10)}} 至 {{i.endTime.substring(0,10)}} </view>
+                  <view>使用期限:{{ i.startTime.substring(0, 10) }} 至 {{ i.endTime.substring(0, 10) }}</view>
                 </view>
               </view>
             </view>
@@ -90,7 +96,7 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.equityList">
             <view class="h-text flex-col justify-center ">
-              <text class="money">{{i.faceValue}}</text>
+              <text class="money">{{ i.faceValue }}</text>
               <text class="desc">权益价</text>
             </view>
 
@@ -116,7 +122,7 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.rechargeList">
             <view class="h-text flex-col justify-center ">
-              <text class="money">{{i.reachPrice}}</text>
+              <text class="money">{{ i.reachPrice }}</text>
               <text class="desc">储值额度</text>
             </view>
 
@@ -135,13 +141,18 @@
 <script>
 
 export default {
-  components: {
-  },
+  components: {},
   data() {
     return {
       userInfo: {},
       activityOrderId: '',
       activity: {},
+      facePhotoUrl: '',
+    }
+  },
+  computed: {
+    isShareAgain() {
+      return false;
     }
   },
   onLoad(e) {
@@ -149,7 +160,36 @@ export default {
     this.activityOrderId = e.activityOrderId
     this.myActivityDetail()
   },
+  onShareAppMessage(e) {
+    //禁止二次转发--
+    uni.showShareMenu({
+      withShareTicket: this.isShareAgain
+    });
+    wx.updateShareMenu({
+      isPrivateMessage: this.isShareAgain,
+      withShareTicket: this.isShareAgain,
+      success(res) {
+        console.log('updateShareMenu: ', res);
+      },
+      fail() {
+      }
+    }); //禁止二次转发--end
+    console.log(this.activity)
+    let shareobj = {
+      title: this.activity.shareContext, //分享的标题
+      path: '/orderPages/activityDetail/activityDetail?activityId=' + this.activity.activityId + '&inviteUserId=' + this.userInfo.id, //好友点击分享之后跳转的页面
+      //imageUrl: "https://****.com/banner.jpg", //分享的图片  支持PNG及JPG。显示图片长宽比是 5:4。
+      imageUrl: this.facePhotoUrl, //内容图片
+    }
+    return shareobj //一定要返回对象
+  },
   methods: {
+    // 获取图片
+    getImgUrlByBannerOssId(items) {
+      this.$api.getImgUrlByOssId({ossId: items}).then(res => {
+        this.facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+      })
+    },
     myActivityDetail() {
       this.$api.myActivityDetail({
         activityOrderId: this.activityOrderId,
@@ -157,6 +197,7 @@ export default {
         console.log(res)
         this.activity = res.data.data
         this.$set(this.activity)
+        this.getImgUrlByBannerOssId(res.data.data.sharePicture)
       })
     },
 

+ 128 - 108
orderPages/activityDetail/activityDetail.vue

@@ -5,26 +5,32 @@
       <view class="out1">
         <view class="flex-col top">
           <view class="flex-row title">
-            <text>{{activity.title}}</text>
+            <text>{{ activity.title }}</text>
           </view>
           <view class="flex-row price">
-            <text>¥{{activity.salePrice}}</text>
+            <text v-if="isShare">¥{{ activity.sharePrice }}</text>
+            <text :style="{textDecorationLine:(isShare ?'line-through' :'none'),color:(isShare ? '#878787':''),  fontSize:(isShare ? '24rpx':'') }">
+              ¥{{ activity.salePrice }}
+            </text>
+
           </view>
-          <view class="flex-row" >
+          <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-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 ">
+            <view class="activityKey">
               <text>活动门店:</text>
             </view>
             <view class="activityValue">
-              <text>{{activity.partStoreName}}</text>
+              <text>{{ activity.partStoreName }}</text>
             </view>
           </view>
           <view class="flex-row">
@@ -32,27 +38,24 @@
               <text>活动描述:</text>
             </view>
             <view class="activityValue">
-              <text>{{activity.description}}</text>
+              <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="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">
@@ -61,8 +64,8 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.couponList">
             <view class="h-text flex-col justify-center ">
-              <text class="money" v-if="i.discountsType == 2">{{i.discount}}折</text>
-              <text class="money" v-else>{{i.discountsPrice}}</text>
+              <text class="money" v-if="i.discountsType == 2">{{ i.discount }}折</text>
+              <text class="money" v-else>{{ i.discountsPrice }}</text>
 
               <text class="desc">满{{ i.reachPrice }}可用</text>
             </view>
@@ -84,7 +87,7 @@
               <view class="ticketMsg">
                 <text v-if="i.validType == 1">领取后{{ i.effectiveDays }}天内有效</text>
                 <view v-else>
-                  <view>使用期限:{{i.startTime.substring(0,10)}} 至 {{i.endTime.substring(0,10)}} </view>
+                  <view>使用期限:{{ i.startTime.substring(0, 10) }} 至 {{ i.endTime.substring(0, 10) }}</view>
                 </view>
               </view>
 
@@ -97,15 +100,15 @@
           </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="out2" v-if="activity.equityList">
@@ -116,7 +119,7 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.equityList">
             <view class="h-text flex-col justify-center ">
-              <text class="money">{{i.faceValue}}</text>
+              <text class="money">{{ i.faceValue }}</text>
               <text class="desc">权益价</text>
             </view>
 
@@ -142,7 +145,7 @@
 
           <view class="flex-row ticketList" v-for="(i,index) in activity.rechargeList">
             <view class="h-text flex-col justify-center ">
-              <text class="money">{{i.reachPrice}}</text>
+              <text class="money">{{ i.reachPrice }}</text>
               <text class="desc">储值额度</text>
             </view>
 
@@ -156,61 +159,77 @@
       </view>
     </view>
 
-
-
-    <view class="flex-row justify-center inBtnView" >
+    <view class="flex-row justify-center inBtnView">
       <view class="inBtn" @click="beforeCommitOrder" 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"
+    <myPay ref="myPay" :selectBlPay="userInfo.balance *1 >= totalAmount *1" :balance="userInfo.balance"
+           :totalAmount="totalAmount" :lovePay="false" :blPay="false"
            :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
 
     <view>
-      <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false" :columns="serviceObjectList"
+      <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false"
+                :columns="serviceObjectList"
                 keyName="nickName" @cancel="show = false" @confirm="confirm"></u-picker>
     </view>
 
-
-
   </view>
 </template>
 
 <script>
 import myPay from '../../components/pay/pay';
+
 export default {
   components: {
     myPay
   },
   data() {
     return {
-      userInfo:{},
-      subOrderNo:'',
-      id:'',
-      storeId:'',
-      techNo:'',
-      activity:{},
-      requestStatus:false,
-      isActivityCheck:true, //是否参与过该活动
-      serviceObjectList:[],
+      userInfo: {},
+      subOrderNo: '',
+      id: '',
+      storeId: '',
+      userId: '',
+      techNo: '',
+      activity: {},
+      requestStatus: false,
+      isActivityCheck: true, //是否参与过该活动
+      serviceObjectList: [],
       show: false,
-      serviceObjectId:null
+      serviceObjectId: null,
+      isShare: false,
+    }
+  },
+
+  computed: {
+    totalAmount() {
+      if(this.isShare){
+        return this.activity.sharePrice
+      }else {
+        return this.activity.salePrice
+      }
     }
   },
   onLoad(e) {
-    console.log(e,'2222222222222')
-    if(e.id){
+    console.log(e)
+    if (e.id) {
       this.id = e.id
-      console.log('上一个页面传递过来的活动ID===>',this.id)
+      console.log('上一个页面传递过来的活动ID===>', this.id)
+    }
+    if (e.inviteUserId) {
+      console.log(e)
+      this.id = e.activityId
+      this.inviteUserId = e.inviteUserId
+      this.isShare = true
     }
-
     // 扫技师端携带的参数,已存在缓存中
     let promotionParam = uni.getStorageSync('promotionParam')
-    if (promotionParam){
-      console.log('获取到技师的二维码数据',promotionParam)
+    if (promotionParam) {
+      console.log('获取到技师的二维码数据', promotionParam)
       this.storeId = promotionParam.storeId
       this.techNo = promotionParam.techNo
-    }else {
+    } else {
       let storeParam = uni.getStorageSync('storeParam')
       // console.log('获取到门店的二维码数据',param)
       this.storeId = storeParam.storeId
@@ -225,22 +244,21 @@ export default {
       for (let i = 0; i < b.length; i++) {
         param[b[i].split('=')[0]] = b[i].split('=')[1]
       }
-      this.id= param.activityId
-      this.storeId= param.storeId
-      this.techNo= ''
-      console.log("扫店长端二维码进来的活动参数===》",param)
+      this.id = param.activityId
+      this.storeId = param.storeId
+      this.techNo = ''
+      console.log("扫店长端二维码进来的活动参数===》", param)
       uni.setStorageSync('storeParam', param)
       uni.removeStorageSync('promotionParam');
     }
 
+
     this.userInfo = uni.getStorageSync('userInfo')
     this.activityDetail()
     this.activityCheck()
     this.listServiceObject()
   },
   methods: {
-
-
     // 查询服务对像信息列表
     listServiceObject() {
       let serviceObjectList = []
@@ -256,15 +274,15 @@ export default {
     },
 
     //支付结果回调
-    payResult(e){
+    payResult(e) {
       console.log(e)
-      if(e.payResult){
+      if (e.payResult) {
         uni.showToast({
           duration: 2000,
           title: '支付成功!'
         });
         this.isActivityCheck = true
-      }else {
+      } else {
         uni.showToast({
           duration: 2000,
           title: '支付失败!',
@@ -275,19 +293,19 @@ export default {
     },
 
     //支付弹窗关闭回调
-    improperClose(){
+    improperClose() {
 
     },
 
-    beforeCommitOrder(){
-      if (this.activity.isAddServiceObject == 1){
+    beforeCommitOrder() {
+      if (this.activity.isAddServiceObject == 1) {
         this.show = true
-      }else {
+      } else {
         this.commitOrder()
       }
     },
 
-    confirm(e){
+    confirm(e) {
       console.log(e)
       this.serviceObjectId = e.value[0].id
       this.show = false
@@ -295,51 +313,52 @@ export default {
       this.commitOrder()
     },
 
-
     //提交订单
     commitOrder() {
       // if (this.subOrderNo){
       //   this.$refs.myPay.openPopup()
       // }else {
 
-        if (this.requestStatus) {
-          return;
+      if (this.requestStatus) {
+        return;
+      }
+      this.requestStatus = true
+      uni.showLoading({
+        title: '加载中'
+      });
+      this.$api.commonGeneralOrder({
+        orderType: 7,
+        serviceObjectId: this.serviceObjectId,
+        activityId: this.activity.id,
+        storeId: this.storeId,
+        inviteUserId: this.inviteUserId,
+        techNo: this.techNo
+      }).then(res => {
+        console.log('++++++++++++++++++订单提交+++++++++++', res)
+        uni.hideLoading();
+        this.subOrderNo = res.data.data.orderNo
+        if (this.activity.salePrice * 1 > 0) {
+          this.$refs.myPay.openPopup()
+        } else {
+          uni.showToast({
+            duration: 2000,
+            title: '活动参与成功!'
+          });
+          this.isActivityCheck = true
         }
-        this.requestStatus = true
-        uni.showLoading({
-          title: '加载中'
-        });
-        this.$api.commonGeneralOrder({
-          orderType: 7,
-          serviceObjectId:this.serviceObjectId,
-          activityId: this.activity.id,
-          storeId:this.storeId,
-          techNo:this.techNo
-        }).then(res => {
-          console.log('++++++++++++++++++订单提交+++++++++++', res)
-            uni.hideLoading();
-            this.subOrderNo = res.data.data.orderNo
-            if (this.activity.salePrice *1 > 0){
-              this.$refs.myPay.openPopup()
-            }else {
-              uni.showToast({
-                duration: 2000,
-                title: '活动参与成功!'
-              });
-              this.isActivityCheck = true
-            }
-          this.requestStatus = false
-        }).catch(err => {
-          this.requestStatus = false
-        })
+        this.requestStatus = false
+      }).catch(err => {
+        this.requestStatus = false
+      })
       // }
     },
 
 
-    activityDetail(){
+    activityDetail() {
+      console.log(this.id, '活动ID')
       this.$api.activityDetail({
-        id:this.id,
-      }).then(res=>{
+        id: this.id,
+      }).then(res => {
         console.log(res)
         this.activity = res.data.data
         this.$set(this.activity)
@@ -347,8 +366,8 @@ export default {
       })
     },
 
-    activityCheck(){
-      this.$api.activityCheck({activityId:this.id,}).then(res=>{
+    activityCheck() {
+      this.$api.activityCheck({activityId: this.id,}).then(res => {
         console.log(res)
         this.isActivityCheck = res.data.data
       })
@@ -363,4 +382,5 @@ export default {
 <style lang="scss" scoped>
 @import '/common/css/common.css';
 @import './index.rpx.scss';
+
 </style>