优惠券领取与使用优化
This commit is contained in:
1 parent
30b3464513
commit
91763cfe3c
2 files changed
+40
-30
No files matched your search
@@ -78,7 +78,9 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="right" @click.stop="" v-if="activeTabIndex == 1">
|
||||
<view class="use immediate-use" :round="true" @tap="receive(item, index)" >立即领取</view>
|
||||
<!-- <view class="use immediate-use" :round="true" @tap="receive(item, index)" >立即领取</view> -->
|
||||
<view class="use immediate-use" :round="true" v-if="item.isReceive == 0" @tap="receive(item, index)" >立即领取</view>
|
||||
<view v-else class="used immediate-use">已领取</view>
|
||||
</view>
|
||||
<view class="right" @click.stop="" v-if="activeTabIndex == 0">
|
||||
<view v-if="item.status == 0" class="use immediate-use" :round="true" @tap="useCouponWith(item)" >立即使用</view>
|
||||
@@ -266,6 +268,7 @@ const receive = async(coupon,index) => {
|
||||
type: 'success'
|
||||
});
|
||||
detailModalVisible.value = false
|
||||
getCoupons(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,10 +516,10 @@ page {
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 40rpx;
|
||||
//color: #ffffff!important;
|
||||
//background-color: $u-type-warning!important;
|
||||
color: #ffffff!important;
|
||||
background-color: $uv-info-dark!important;
|
||||
line-height: 40rpx;
|
||||
//color: rgb(117, 142, 165);
|
||||
color: rgb(117, 142, 165);
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -313,6 +313,9 @@ const amount = computed(() =>{
|
||||
if (main.mycoupon.hasOwnProperty('id')) {
|
||||
amount -= parseFloat(main.mycoupon.value);
|
||||
}
|
||||
if(amount < 0){
|
||||
amount = 0
|
||||
}
|
||||
return amount.toFixed(2);
|
||||
})
|
||||
|
||||
@@ -494,34 +497,37 @@ const submit = () => {
|
||||
}
|
||||
const pay = async() => {
|
||||
let that = this;
|
||||
// #ifdef MP-WEIXIN
|
||||
await new Promise(function(revolve) {
|
||||
//订阅号信息id
|
||||
let subscribeMss = ['KBtfY9G1IWCzC6q-ZKo-Q-MmdP7aaF79nx0XFcBf3h4'];
|
||||
// // #ifdef MP-WEIXIN
|
||||
// await new Promise(function(revolve) {
|
||||
// //订阅号信息id
|
||||
// let subscribeMss = ['KBtfY9G1IWCzC6q-ZKo-Q-MmdP7aaF79nx0XFcBf3h4'];
|
||||
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '为更好的促进您与商家的交流,小程序需要在您成交时向您发送消息',
|
||||
confirmText: "同意",
|
||||
cancelText: "拒绝",
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: subscribeMss,
|
||||
complete(res) {
|
||||
console.log(res)
|
||||
revolve(true)
|
||||
}
|
||||
});
|
||||
} else {
|
||||
revolve(true)
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
// wx.showModal({
|
||||
// title: '温馨提示',
|
||||
// content: '为更好的促进您与商家的交流,小程序需要在您成交时向您发送消息',
|
||||
// confirmText: "同意",
|
||||
// cancelText: "拒绝",
|
||||
// success: function(res) {
|
||||
// if (res.confirm) {
|
||||
// uni.requestSubscribeMessage({
|
||||
// tmplIds: subscribeMss,
|
||||
// complete(res) {
|
||||
// console.log(res)
|
||||
// revolve(true)
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// revolve(true)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// });
|
||||
|
||||
|
||||
// #endif
|
||||
if(amount.value == 0){
|
||||
payType.value = 'yue'
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
@@ -557,12 +563,13 @@ const pay = async() => {
|
||||
main.DEL_COUPON()
|
||||
if(amount.value == 0){
|
||||
uToast.value.show({
|
||||
message: '订单金额为0自动余额支付',
|
||||
message: '订单金额为0自动走余额支付',
|
||||
type: 'success'
|
||||
});
|
||||
balancePay(order);
|
||||
uni.hideLoading()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (payType.value == 'weixin') {
|
||||
// 微信支付
|
||||
|
||||
Reference in new issue
Block a user