|
@@ -61,7 +61,6 @@
|
|
|
:key="index"
|
|
|
:id="coupon.couponId"
|
|
|
class="coupon-list"
|
|
|
- :class="coupon.useStatus == 1 ? 'none' : ''"
|
|
|
>
|
|
|
<view class="list-cell-tags">{{ coupon.couponType | TypeFormat }}</view>
|
|
|
<view class="list-cell-le">
|
|
@@ -86,7 +85,9 @@
|
|
|
<view class="icon-used-btn receive" v-if="coupon.getFlag == 0" @click="receiveCoupon(coupon)"
|
|
|
>立即领取</view
|
|
|
>
|
|
|
- <view class="icon-used-btn make" v-if="coupon.getFlag == 1">已领取</view>
|
|
|
+ <view class="icon-used-btn make" v-if="coupon.getFlag == 1" @click="toUseCoupon(coupon)"
|
|
|
+ >去使用</view
|
|
|
+ >
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -158,7 +159,7 @@
|
|
|
<view class="text-content">
|
|
|
<view class="text"
|
|
|
>确定使用<text class="text-p">{{ handelPayMsg.beans }}</text
|
|
|
- >个采美豆抵扣{{ handelPayMsg.month }}的采美超级会员吗?</view
|
|
|
+ >个采美豆抵扣{{ handelPayMsg.duration }}个月的采美超级会员吗?</view
|
|
|
>
|
|
|
</view>
|
|
|
<view class="text-button">
|
|
@@ -249,7 +250,7 @@ export default {
|
|
|
},
|
|
|
productCouponList: [],
|
|
|
productList: [],
|
|
|
- isReceiveLoading:false
|
|
|
+ isReceiveLoading: false
|
|
|
}
|
|
|
},
|
|
|
onLoad() {},
|
|
@@ -329,26 +330,28 @@ export default {
|
|
|
console.log('获取会员套餐异常~')
|
|
|
})
|
|
|
},
|
|
|
- receiveCoupon(coupon){// 点击优惠券领取按钮
|
|
|
- if(this.isReceiveLoading){return}
|
|
|
- this.ProductService.ReceiveCoupon(
|
|
|
- {
|
|
|
- userId:this.payParam.userId,
|
|
|
- couponId:coupon.couponId,
|
|
|
- source:2
|
|
|
- })
|
|
|
- .then(response =>{
|
|
|
- this.isReceiveLoading = true
|
|
|
- this.$util.msg('领取成功',1500,true,'success')
|
|
|
- setTimeout(()=>{
|
|
|
- coupon.getFlag = 1
|
|
|
- this.isReceiveLoading = false
|
|
|
- },1500)
|
|
|
- })
|
|
|
- .catch(error =>{
|
|
|
- this.$util.msg(error.msg,2000)
|
|
|
- this.isReceiveLoading = false
|
|
|
+ receiveCoupon(coupon) {
|
|
|
+ // 点击优惠券领取按钮
|
|
|
+ if (this.isReceiveLoading) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.ProductService.ReceiveCoupon({
|
|
|
+ userId: this.payParam.userId,
|
|
|
+ couponId: coupon.couponId,
|
|
|
+ source: 2
|
|
|
})
|
|
|
+ .then(response => {
|
|
|
+ this.isReceiveLoading = true
|
|
|
+ this.$util.msg('领取成功', 1500, true, 'success')
|
|
|
+ setTimeout(() => {
|
|
|
+ coupon.getFlag = 1
|
|
|
+ this.isReceiveLoading = false
|
|
|
+ }, 1500)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ this.$util.msg(error.msg, 2000)
|
|
|
+ this.isReceiveLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
hanldeShowBeans() {
|
|
|
// 显示采美豆抵扣开通超级会员弹窗
|
|
@@ -380,6 +383,38 @@ export default {
|
|
|
this.payParam.packageId = pay.packageId
|
|
|
this.handelPayMsg = pay
|
|
|
},
|
|
|
+ toUseCoupon(coupon) {
|
|
|
+ // 去使用跳转路径
|
|
|
+ console.log('coupon', coupon)
|
|
|
+ switch (coupon.couponType) {
|
|
|
+ case 0: // 活动券:跳转到商城首页 / 或者活动页(看是否指定了商品)
|
|
|
+ if (coupon.productType == 1) {
|
|
|
+ // 1 全商城通用 2 指定商品
|
|
|
+ this.$api.switchTabTo('/pages/tabBar/home/index')
|
|
|
+ } else {
|
|
|
+ this.$api.navigateTo('/pages/user/coupon/coupon-product?couponId=' + coupon.couponId)
|
|
|
+ }
|
|
|
+ break
|
|
|
+ case 1: // 品类券:跳转到产品 287 / 仪器页 286
|
|
|
+ let categoryId = 0
|
|
|
+ if (coupon.categoryType == 1) {
|
|
|
+ categoryId = 287
|
|
|
+ } else {
|
|
|
+ categoryId = 286
|
|
|
+ }
|
|
|
+ this.$api.navigateTo(`/pages/goods/good-floor?linkId=${coupon.categoryType == 1 ? 287 : 286}`)
|
|
|
+ break
|
|
|
+ case 2: // 用户专享券:跳转到商城首页
|
|
|
+ this.$api.switchTabTo('/pages/tabBar/home/index')
|
|
|
+ break
|
|
|
+ case 3: // 店铺券:跳转到店铺首页
|
|
|
+ this.$api.navigateTo('/pages/supplier/user/my-shop?shopId=' + coupon.shopId)
|
|
|
+ break
|
|
|
+ case 4: // 新用户券:跳转到商城首页
|
|
|
+ this.$api.switchTabTo('/pages/tabBar/home/index')
|
|
|
+ break
|
|
|
+ }
|
|
|
+ },
|
|
|
hanldPayUrl(url) {
|
|
|
// 跳转
|
|
|
this.$api.navigateTo(url)
|
|
@@ -643,10 +678,6 @@ page {
|
|
|
&:nth-child(2n) {
|
|
|
margin-right: 0;
|
|
|
}
|
|
|
- &.none {
|
|
|
- background: url(https://static.caimei365.com/app/img/icon/icon-member-coupon-none@2x.png);
|
|
|
- background-size: cover;
|
|
|
- }
|
|
|
.list-cell-tags {
|
|
|
display: inline-block;
|
|
|
padding: 0 10rpx;
|
|
@@ -718,7 +749,7 @@ page {
|
|
|
}
|
|
|
&.make {
|
|
|
padding: 30rpx 28rpx;
|
|
|
- color: #ffffff;
|
|
|
+ color: #55331d;
|
|
|
}
|
|
|
}
|
|
|
}
|