|
@@ -151,11 +151,13 @@
|
|
async WeChatCouponRecord(coupon) {
|
|
async WeChatCouponRecord(coupon) {
|
|
try {
|
|
try {
|
|
const userInfo = await this.$api.getStorage()
|
|
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)
|
|
this.MiniWxPayFor(data.data.couponRecordId)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
- this.$util.msg(error.msg, 2000)
|
|
|
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
// 购买优惠券支付
|
|
// 购买优惠券支付
|
|
@@ -207,14 +209,17 @@
|
|
},
|
|
},
|
|
onShareAppMessage(res) {
|
|
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 {
|
|
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() {
|
|
onHide() {
|