diff --git a/template/uni-app/pages/users/user_get_coupon/index.vue b/template/uni-app/pages/users/user_get_coupon/index.vue
index cc465f978..2a98d7bd2 100644
--- a/template/uni-app/pages/users/user_get_coupon/index.vue
+++ b/template/uni-app/pages/users/user_get_coupon/index.vue
@@ -4,7 +4,8 @@
- {{ item.name }}
+ {{ item.name }}
+
@@ -15,7 +16,8 @@
{{$t(`¥`)}}{{item.coupon_price}}
{{$t(`满`)}} {{item.use_min_price}}
- {{$t(`元可用`)}}
+ {{$t(`元可用`)}}
+
{{$t(`无门槛券`)}}
@@ -35,12 +37,14 @@
{{$t(`领取后`)}} {{item.coupon_time}} {{$t(`天内可用`)}}
- {{ item.start_use_time ? item.start_use_time + '-' : '' }}{{ item.end_use_time }}
+ {{ item.start_use_time ? item.start_use_time + '-' : '' }}{{ item.end_use_time }}
+
{{$t(`已领取`)}}
- {{$t(`已领完`)}}
- {{$t(`立即领取`)}}
+ {{$t(`已领完`)}}
+
+ {{$t(`立即领取`)}}
@@ -117,7 +121,8 @@
count: 0
},
],
- count: 0
+ count: 0,
+ receiveLoading: false
};
},
computed: mapGetters(['isLogin']),
@@ -154,17 +159,21 @@
authColse: function(e) {
this.isShowAuth = e;
},
- getCoupon: function(id, index) {
+ getCoupon: function(id, item) {
+ if (this.receiveLoading) return
let that = this;
- let list = that.couponsList;
+ this.receiveLoading = true
//领取优惠券
- setCouponReceive(id).then(function(res) {
- list[index].is_use = list[index].is_use + 1;
- that.$set(that, 'couponsList', list);
+ setCouponReceive(id).then((res) => {
+ item.is_use += 1;
that.$util.Tips({
title: that.$t(`领取成功`)
});
+ setTimeout(e => {
+ that.receiveLoading = false
+ }, 500)
}).catch(error => {
+ that.receiveLoading = false
return that.$util.Tips({
title: error
});
@@ -228,15 +237,19 @@
color: #999999;
z-index: 9;
}
- .coupon-list .item .money .num{
- font-size: 48rpx;
- }
- .coupon-list .item .text .data{
- margin-top: 10rpx;
- }
- .coupon-list .item .text{
- padding-bottom: 12rpx;
+
+ .coupon-list .item .money .num {
+ font-size: 48rpx;
}
+
+ .coupon-list .item .text .data {
+ margin-top: 10rpx;
+ }
+
+ .coupon-list .item .text {
+ padding-bottom: 12rpx;
+ }
+
.nav .acea-row {
border-top: 5rpx solid transparent;
border-bottom: 5rpx solid transparent;