修复购物车价格问题,修复限时折扣显示问题

This commit is contained in:
2025-12-20 15:44:21 +08:00
parent e4e07f1bd1
commit 42cd0555f8

View File

@@ -49,15 +49,16 @@
<view class="panelfive_list">
<view class="panelfiveitem" @click="clickspecifications(item, index, index, '热销')"
v-for="(item, index) in shopProductList.hots" :key="index">
<!-- <view class="limitDiscount" v-if="showLimitDiscount(item)"
>限时折扣{{limitDiscountCountdown}}</view
> -->
<view class="relative">
<image @click.stop="getImgs(item)" class="panelfiveitemimage" :src="item.coverImg"
mode="aspectFill"></image>
<view class="limitDiscount" v-if="item.is_time_discount">
限时折扣{{ limitDiscountCountdown }}</view>
<view class="limitDiscount" v-if="showLimitDiscount(item)"
>限时折扣{{ limitDiscountCountdown }}</view
>
<!-- <view class="limitDiscount" v-if="item.is_time_discount">
限时折扣{{ limitDiscountCountdown }}</view> -->
<view class="stock_warning" v-if="item.isStock&&item.stockNumber<=10">
仅剩{{item.stockNumber}}</view>
</view>
@@ -203,8 +204,12 @@
<image class="goodsImg"
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/index/1.gif" mode=""
v-else :lazy-load="true"></image>
<view class="limitDiscount" v-if="item1.is_time_discount">
限时折扣{{ limitDiscountCountdown }}</view>
<view class="limitDiscount" v-if="showLimitDiscount(item1)"
>限时折扣{{ limitDiscountCountdown }}</view
>
<!-- <view class="limitDiscount" v-if="item1.is_time_discount">
限时折扣{{ limitDiscountCountdown }}</view> -->
<view class="stock_warning" v-if="item1.isStock&&item1.stockNumber<=10">
仅剩{{item1.stockNumber}}</view>
</view>
@@ -266,12 +271,11 @@
:shopUserInfo="shopUserInfo" :shopInfo="shopInfo"></GoodsPrice>
</view>
<text class="money_num" v-if="item1.unitName">/{{ item1.unitName }}</text>
<!-- <text class="old-price" v-if=" showLimitDiscount(item1)"
>¥{{ item1.salePrice }}</text
> -->
<text class="old-price"
v-if="item1.is_time_discount">¥{{ item1.salePrice }}</text>
v-if="showLimitDiscount(item1)">¥{{ item1.salePrice }}</text>
<!-- <text class="old-price"
v-if="item1.is_time_discount">¥{{ item1.salePrice }}</text> -->
<!-- <text v-if="item1.suitNum>1 && item1.type!= 'sku'"
style="font-size: 14rpx;">
「{{item1.suitNum}}{{item1.unitName}}起点」
@@ -1194,7 +1198,7 @@
memberPrice: specifications.item.memberPrice,
is_print: 1,
product_type: specifications.item.type,
is_time_discount: specifications.item.is_time_discount,
is_time_discount: showLimitDiscount(specifications.item)
});
// 清空套餐选中
selectedGroupSnap.value = [];
@@ -1214,7 +1218,7 @@
memberPrice: specifications.item.memberPrice,
is_print: 1,
product_type: specifications.item.type,
is_time_discount: specifications.item.is_time_discount,
is_time_discount: showLimitDiscount(specifications.item)
});
showShopsku.value = false;
@@ -1419,7 +1423,7 @@
number: await calculateValue(item.cartNumber, i, suitNum),
is_print: 1,
product_type: item.type,
is_time_discount: item.is_time_discount
is_time_discount: showLimitDiscount(item)
};
if (item.cartListId) {
sendMsg.id = item.cartListId;
@@ -1876,7 +1880,8 @@
}
});
}
if (limitTimeDiscountRes.value && limitTimeDiscountRes.value.id && item.is_time_discount ==
console.log('limitTimeDiscountRes',item)
if (limitTimeDiscountRes.value && limitTimeDiscountRes.value.id && item.cartListinfo.is_time_discount ==
1) {
//限时折扣
const price = limitUtils.returnPrice({
@@ -1886,6 +1891,7 @@
shopUserInfo: shopUserInfo.value,
idKey: 'id'
});
console.log('限时折扣',price)
return total + parseFloat(price) * parseFloat(item.cartNumber);
}
// 是否启用会员价 0否1是
@@ -2044,8 +2050,6 @@
product.cartNumber = 0;
product.isSaleTimeshow = await isProductAvailable(product.days, product
.startTime, product.endTime);
product.is_time_discount = showLimitDiscount(product) ? 1 : 0;
product.limitSalePrice = returnLimitPrice(product);
cartStore.setGoodsMap(product.id, product);
});
@@ -2053,8 +2057,6 @@
shopProductList.hots.forEach(async (i) => {
i.cartNumber = 0;
i.isSaleTimeshow = await isProductAvailable(i.days, i.startTime, i.endTime);
i.is_time_discount = showLimitDiscount(i) ? 1 : 0;
i.limitSalePrice = returnLimitPrice(i);
cartStore.setGoodsMap(i.id, i);
});
console.log('shopProductList', shopProductList);