优惠券相关更新

This commit is contained in:
GaoHao
2024-11-21 16:27:32 +08:00
parent 76a80729c8
commit 151562d5e6
10 changed files with 234 additions and 138 deletions

View File

@@ -13,7 +13,7 @@
</view>
</view>
<view class="containertop">
<view class="containertop" :class="{select: type == 'confirm_order_coupon' || type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product'}">
<view class="containertopbox">
<view class="containertopboxitem flex-start" v-for="(item,index) in list" :key="index">
<view class="containertopboxitemleft flex-colum"
@@ -69,7 +69,7 @@
</view>
</view>
<view class="btnBox" v-if="type == 'confirm_order_coupon' || type == 'confirm_order_product'">
<view class="btnBox" v-if="type == 'confirm_order_coupon' || type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product'">
<view class="btn" @click="cancelCoupon" >暂不使用券</view>
</view>
</view>
@@ -148,9 +148,9 @@
if (res.code == 0) {
console.log(res)
let list = [];
if ( this.type == 'confirm_order_coupon') {
if ( this.type == 'confirm_order_coupon' || this.type == 'orderInfo_coupon') {
list = res.data.filter(v => v.type == 1);
}else if ( this.type == 'confirm_order_product') {
}else if ( this.type == 'confirm_order_product' || this.type == 'orderInfo_product') {
list = res.data.filter(v => v.type == 2);
} else {
list = res.data;
@@ -166,6 +166,7 @@
* 去使用优惠券
*/
navigatorGo ( item ) {
uni.cache.set('shopId',item.shopId)
if ( this.type == 'confirm_order_coupon' || this.type == 'confirm_order_product' || this.type == 'orderInfo_coupon' || this.type == 'orderInfo_product' ) {
if ( item.type == 1 ) {
@@ -176,6 +177,13 @@
})
return;
}
if( this.payAmount < item.discountAmount) {
uni.showToast({
title: "当前订单金额不足抵扣金额",
icon: "none",
})
return;
}
uni.$emit('couponItem', JSON.stringify(item))
let selectCouponData = uni.cache.get('selectCouponData') || [];
let couponList = selectCouponData.filter(v => v.type == 1);
@@ -330,6 +338,7 @@
.towcontent {
padding: 0 28rpx;
border-top: 16rpx solid #f7f7f7;
.towcontentlistxitem {
width: 100%;
margin-top: 32rpx;
@@ -385,6 +394,7 @@
position: relative;
border-radius: 18rpx;
box-shadow: 0rpx 6rpx 12rpx 2rpx rgba(0, 0, 0, 0.16);
overflow: hidden;
.containertopboxitemleft {
position: relative;
width: 182rpx;
@@ -449,23 +459,22 @@
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx -13rpx 7rpx -6rpx rgba(0, 0, 0, 0.1);
box-shadow: inset 0rpx 1rpx 9rpx 21rpx rgba(0, 0, 0, 0.04);
z-index: 999;
}
.containertopboxitemleft::before {
content: '';
position: absolute;
bottom: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 0rpx 15rpx 1rpx rgba(0, 0, 0, 0.1);
z-index: 999;
}
.containertopboxitemleft::before {
content: '';
position: absolute;
bottom: -20rpx;
left: 166rpx;
background: #fff;
display: inline-block;
width: 40rpx;
height: 40rpx;
border-radius: 50%;
box-shadow: inset 0rpx 25rpx 15rpx -4rpx rgba(0, 0, 0, 0.1);
z-index: 999;
}
.containertopboxitemleft_vip{
background-color: #E1D4B2;
}
@@ -543,11 +552,15 @@
}
}
.select{
padding-bottom: 180rpx;
}
.btnBox{
width: 100%;
position: absolute;
position: fixed;
bottom: 0;
left: 0;
z-index: 999;
background-color: #fff;
padding: 30rpx 30rpx 50rpx 30rpx;
.btn{