|
@@ -387,7 +387,15 @@
|
|
<view class="list-cell-btn">
|
|
<view class="list-cell-btn">
|
|
<view class="icon-used">
|
|
<view class="icon-used">
|
|
<template v-if="coupon.couponBtnType == 0">
|
|
<template v-if="coupon.couponBtnType == 0">
|
|
- <template v-if="coupon.moneyCouponFlag == 1">
|
|
|
|
|
|
+ <template v-if="coupon.couponPayWay == 2">
|
|
|
|
+ <view class="icon-used-text">{{ coupon.moneyCouponPrice }}采美豆</view>
|
|
|
|
+ <view
|
|
|
|
+ class="icon-used-btn receive"
|
|
|
|
+ @click="toDeductCoupon(coupon)"
|
|
|
|
+ >抵扣</view
|
|
|
|
+ >
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else-if="coupon.couponPayWay == 1">
|
|
<view class="icon-used-text">购买</view>
|
|
<view class="icon-used-text">购买</view>
|
|
<view
|
|
<view
|
|
class="icon-used-btn receive"
|
|
class="icon-used-btn receive"
|
|
@@ -1477,7 +1485,7 @@ export default {
|
|
this.ProductService.ReceiveCoupon({
|
|
this.ProductService.ReceiveCoupon({
|
|
userId: this.couponParam.userId,
|
|
userId: this.couponParam.userId,
|
|
couponId: coupon.couponId,
|
|
couponId: coupon.couponId,
|
|
- source: 2
|
|
|
|
|
|
+ source: 1
|
|
})
|
|
})
|
|
.then(response => {
|
|
.then(response => {
|
|
this.$util.msg('领取成功', 1500, true, 'success')
|
|
this.$util.msg('领取成功', 1500, true, 'success')
|
|
@@ -1491,6 +1499,44 @@ export default {
|
|
this.$util.msg(error.msg, 2000)
|
|
this.$util.msg(error.msg, 2000)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ toDeductCoupon(coupon) {
|
|
|
|
+ // 点击采美豆抵扣优惠券
|
|
|
|
+ if (process.env.NODE_ENV != 'development') {
|
|
|
|
+ this.$uma.trackEvent('Um_Event_userCouponCollectionBuy', {
|
|
|
|
+ Um_Key_PageName: '领券中心',
|
|
|
|
+ Um_Key_EvenName: '抵扣优惠券',
|
|
|
|
+ Um_Key_CouponId: `${coupon.couponId}`,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if (this.hasLogin) {
|
|
|
|
+ if (this.userIdentity === 1 || this.userIdentity === 3) {
|
|
|
|
+ this.$util.msg('您的身份暂不支持领取优惠券', 2000)
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ this.WeChatPayCouponBeans(coupon)
|
|
|
|
+ } else {
|
|
|
|
+ this.$api.navigateTo('/pages/login/login')
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ WeChatPayCouponBeans(coupon){
|
|
|
|
+ // 采美豆抵扣优惠券
|
|
|
|
+ this.PayService.WeChatPayCouponBeans({
|
|
|
|
+ source: 1, //领取渠道 1 小程序 2 网站
|
|
|
|
+ userId: this.couponParam.userId,
|
|
|
|
+ couponId: coupon.couponId
|
|
|
|
+ })
|
|
|
|
+ .then(response => {
|
|
|
|
+ this.$util.msg('抵扣成功', 1500)
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.currentTab = 1
|
|
|
|
+ this.couponParam.status = 2
|
|
|
|
+ this.queryPopupCoupons()
|
|
|
|
+ }, 1500)
|
|
|
|
+ })
|
|
|
|
+ .catch(error => {
|
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
|
|
+ })
|
|
|
|
+ },
|
|
toPayCoupon(coupon){
|
|
toPayCoupon(coupon){
|
|
// 点击购买优惠券,友盟埋点收集购买优惠券
|
|
// 点击购买优惠券,友盟埋点收集购买优惠券
|
|
if (process.env.NODE_ENV != 'development') {
|
|
if (process.env.NODE_ENV != 'development') {
|