浏览代码

优惠券分享

zhengjinyi 1 年之前
父节点
当前提交
c7f9188163

+ 12 - 1
pages/goods/goods-instrument.vue

@@ -124,7 +124,18 @@
 			}else{
 				this.isScrollTop = false
 			}	
-		},
+		},
+        onShareAppMessage(res) {
+        	//分享转发
+        	if (res.from === 'button') {
+        		// 来自页面内转发按钮
+        	}
+        	return {
+        		title: `${this.linkTitle}`,
+        		path: `/pages/goods/goods-instrument?linkId=${this.linkId}&title=${this.linkTitle}`,
+        		imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
+        	}
+        },
 		onShow() {
 
 		}

+ 12 - 1
pages/h5/activity/activity-list.vue

@@ -122,7 +122,18 @@
 			this.listQuery.pageNum = 1
 			this.GetPromotionsrList()
 			uni.stopPullDownRefresh()
-		},
+		},
+        onShareAppMessage(res) {
+        	//分享转发
+        	if (res.from === 'button') {
+        		// 来自页面内转发按钮
+        	}
+        	return {
+        		title: '最近优惠~',
+        		path: 'pages/h5/activity/activity-list',
+        		imageUrl: 'https://static.caimei365.com/app/img/bg/min-banner.jpg'
+        	}
+        },
 		onShow() {
 			this.GetPromotionsrList()
 		}

+ 7 - 6
pages/seller/cart/coupon.vue

@@ -43,8 +43,7 @@
                                         class="icon-used-btn receive" :data-coupon="coupon">
                                         分享购买
                                     </button>
-                                    <button v-else open-type="share" class="icon-used-btn share"
-                                        :data-coupon="coupon">
+                                    <button v-else open-type="share" class="icon-used-btn share" :data-coupon="coupon">
                                         分享领取
                                     </button>
                                 </view>
@@ -83,7 +82,7 @@
                     pageNum: 1,
                     pageSize: 10
                 },
-                shareUserId:'',
+                shareUserId: '',
                 coupinList: [],
                 skeletonShow: true,
                 nomoreText: '上拉显示更多',
@@ -201,9 +200,10 @@
                     `${coupon.moneyCouponPrice}抵${coupon.couponAmount},限时优惠券等您抢购~` :
                     COUPON_TEXT_MAP[randomIndex]
                 return {
-                    title: shareTitle,
+                    title: coupon.shareCouponTopic ? `${coupon.shareCouponTopic}` : shareTitle,
                     path: `pages/user/coupon/coupon-details?couponId=${coupon.couponId}&shareUserId=${this.shareUserId}`,
-                    imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
+                    imageUrl: coupon.shareCouponImage ? `${coupon.shareCouponImage}` :
+                        'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
                 }
             }
         },
@@ -362,8 +362,9 @@
                                     background-image: linear-gradient(270deg, #f94b4b 0%, #feb673 100%);
                                     color: #ffffff;
                                 }
+
                                 &.share {
-                                    background-image:linear-gradient(315deg,#6772FF 0,#00F9E5 100%);
+                                    background-image: linear-gradient(315deg, #6772FF 0, #00F9E5 100%);
                                     color: #ffffff;
                                 }
                             }

+ 5 - 5
pages/user/coupon/coupon-collection.vue

@@ -416,7 +416,7 @@ export default {
 			if (e.index == 1) {
 				this.$api.navigateTo('/pages/login/apply')
 			}
-			this.modal = false
+			this.modal = false 
 		},
 		navigator(url) {
 			this.$api.navigateTo(url)
@@ -431,9 +431,9 @@ export default {
                 `${coupon.moneyCouponPrice}抵${coupon.couponAmount},限时优惠券等您抢购~` :
                 COUPON_TEXT_MAP[randomIndex]
             return {
-                title: shareTitle,
+                title: coupon.shareCouponTopic ? `${coupon.shareCouponTopic}` : shareTitle,
                 path: `pages/user/coupon/coupon-details?couponId=${coupon.couponId}&shareUserId=${this.listQuery.userId}`,
-                imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
+                imageUrl: coupon.shareCouponImage ? `${coupon.shareCouponImage}` : 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
             }
         }
     },
@@ -522,7 +522,7 @@ page {
                 text-align: center;
                 position: absolute;
                 right: 0;
-                top: 0;
+                bottom: 0;
                 box-sizing: border-box;
                 display: block;
                 background: transparent;
@@ -582,7 +582,7 @@ page {
 						width: 100%;
 						height: 100%;
 						box-sizing: border-box;
-						padding-top: 48rpx;
+						padding-top: 28rpx;
 						.icon-used-text {
 							width: 100%;
 							text-align: center;

+ 13 - 8
pages/user/coupon/coupon-details.vue

@@ -151,11 +151,13 @@
             async WeChatCouponRecord(coupon) {
                 try {
                     const userInfo = await this.$api.getStorage()
-                    const data = await this.PayService.WeChatCouponRecord({ userId: userInfo.userId,
-                        couponId: coupon.couponId })
+                    const data = await this.PayService.WeChatCouponRecord({
+                        userId: userInfo.userId,
+                        couponId: coupon.couponId
+                    })
                     this.MiniWxPayFor(data.data.couponRecordId)
                 } catch (error) {
-                   this.$util.msg(error.msg, 2000)
+                    this.$util.msg(error.msg, 2000)
                 }
             },
             // 购买优惠券支付
@@ -207,14 +209,17 @@
         },
         onShareAppMessage(res) {
             //分享优惠券
-            if (res.from === 'button') {
+            if (res.from === 'button') { 
                 // 来自页面内转发按钮
             }
-            const randomIndex = Math.floor(Math.random() * COUPON_TEXT_MAP.length);
+            const coupon = this.coupon
+            const randomIndex = Math.floor(Math.random() * COUPON_TEXT_MAP.length)
+            const shareTitle = coupon.moneyCouponFlag === 1 ?
+                `${coupon.moneyCouponPrice}抵${coupon.couponAmount},限时优惠券等您抢购~` : COUPON_TEXT_MAP[randomIndex]
             return {
-                title: COUPON_TEXT_MAP[randomIndex],
-                path: `pages/user/coupon/coupon-details?couponId=${this.param.couponId}&shareUserId=${this.param.shareUserId}`,
-                imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
+                title: coupon.shareCouponTopic ? `${coupon.shareCouponTopic}` : shareTitle,
+                path: `pages/user/coupon/coupon-details?couponId=${coupon.couponId}&shareUserId=${this.param.shareUserId}`,
+                imageUrl: coupon.shareCouponImage ? `${coupon.shareCouponImage}` : 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
             }
         },
         onHide() {

+ 4 - 4
pages/user/coupon/coupon.vue

@@ -318,9 +318,9 @@ export default {
                 `${coupon.moneyCouponPrice}抵${coupon.couponAmount},限时优惠券等您抢购~` :
                 COUPON_TEXT_MAP[randomIndex]
             return {
-                title: shareTitle,
+                title: coupon.shareCouponTopic ? `${coupon.shareCouponTopic}` : shareTitle,
                 path: `pages/user/coupon/coupon-details?couponId=${coupon.couponId}&shareUserId=${this.listQuery.userId}`,
-                imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
+                imageUrl: coupon.shareCouponImage ? `${coupon.shareCouponImage}` : 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
             }
         }
     },
@@ -433,7 +433,7 @@ page {
                 text-align: center;
                 position: absolute;
                 right: 0;
-                top: 0;
+                bottom: 0;
                 box-sizing: border-box;
                 display: block;
                 background: transparent;
@@ -500,7 +500,7 @@ page {
 						width: 100%;
 						height: 100%;
 						box-sizing: border-box;
-						padding-top: 57rpx;
+						padding-top: 28rpx;
 						.icon-used-btn {
 							width: 128rpx;
 							height: 48rpx;