|
@@ -54,13 +54,23 @@
|
|
|
</view>
|
|
|
<view class="list-cell-btn">
|
|
|
<view class="icon-used">
|
|
|
- <template v-if="coupon.moneyCouponFlag == 0">
|
|
|
- <view class="icon-used-text">1000采美豆</view>
|
|
|
- <view class="icon-used-btn buy" @click="toDeductCoupon(coupon)"
|
|
|
- >抵扣</view
|
|
|
- >
|
|
|
+ <template v-if="coupon.couponPayWay == 2">
|
|
|
+ <template v-if="coupon.couponBtnType == 0">
|
|
|
+ <view class="icon-used-text">{{ coupon.moneyCouponPrice }}采美豆</view>
|
|
|
+ <view class="icon-used-btn buy" @click="toDeductCoupon(coupon)"
|
|
|
+ >抵扣</view
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <view
|
|
|
+ class="icon-used-btn make"
|
|
|
+ v-if="coupon.couponBtnType == 1"
|
|
|
+ @click="toUseCoupon(coupon)"
|
|
|
+ >去使用</view
|
|
|
+ >
|
|
|
+ </template>
|
|
|
</template>
|
|
|
- <template v-else-if="coupon.moneyCouponFlag == 1">
|
|
|
+ <template v-else-if="coupon.couponPayWay == 1">
|
|
|
<view class="icon-used-text">购买</view>
|
|
|
<view class="icon-used-btn buy" @click="toPayCoupon(coupon)"
|
|
|
>¥{{ coupon.moneyCouponPrice }}</view
|
|
@@ -344,11 +354,28 @@ export default {
|
|
|
this.$util.msg('您的身份暂不支持领取优惠券', 2000)
|
|
|
return
|
|
|
}
|
|
|
- this.createCouponRecord(coupon)
|
|
|
+ this.WeChatPayCouponBeans(coupon)
|
|
|
} else {
|
|
|
this.$api.navigateTo('/pages/login/login')
|
|
|
}
|
|
|
},
|
|
|
+ WeChatPayCouponBeans(coupon){
|
|
|
+ // 采美豆抵扣优惠券
|
|
|
+ this.PayService.WeChatPayCouponBeans({
|
|
|
+ source: 1, //领取渠道 1 小程序 2 网站
|
|
|
+ userId: this.listQuery.userId,
|
|
|
+ couponId: coupon.couponId
|
|
|
+ })
|
|
|
+ .then(response => {
|
|
|
+ this.$util.msg('抵扣成功', 1500)
|
|
|
+ setTimeout(() => {
|
|
|
+ coupon.couponBtnType = 1
|
|
|
+ }, 1500)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
|
+ })
|
|
|
+ },
|
|
|
toPayCoupon(coupon) {
|
|
|
// 点击购买优惠券,友盟埋点收集购买优惠券
|
|
|
if (process.env.NODE_ENV != 'development') {
|