2023-02-23
保存地址
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
<view class="demand">满{{ item.minPoint }} 减 {{ item.amount }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}"
|
||||
@click="acceptCoupon(item)">立即领取</view>
|
||||
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}" @click="acceptCoupon(item)">
|
||||
立即领取</view>
|
||||
<!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
|
||||
:url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
|
||||
</view>
|
||||
@@ -58,28 +58,42 @@
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
...mapState(['hasLogin','hasVip', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
async acceptCoupon(item) {
|
||||
if (this.hasLogin) {
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
this.clickSubMethod(item)
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
// console.log("data?????", data);
|
||||
// if (data) {
|
||||
// // this.$api.msg(data);
|
||||
// this.clickSubMethod(item)
|
||||
|
||||
// }
|
||||
uni.hideLoading();
|
||||
if(this.hasVip){
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
this.clickSubMethod(item)
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
// console.log("data?????", data);
|
||||
// if (data) {
|
||||
// // this.$api.msg(data);
|
||||
// this.clickSubMethod(item)
|
||||
|
||||
// }
|
||||
uni.hideLoading();
|
||||
}else{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您不属于惠农会员,暂不能领取此优惠券',
|
||||
showCancel:false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
|
||||
Reference in New Issue
Block a user