去除部分调试打印,优化环境变量控制,修复再来一单只有一个商品时自动弹出图片预览问题,

This commit is contained in:
2025-12-24 13:42:00 +08:00
parent addb9f0e75
commit 0736726336
14 changed files with 136 additions and 65 deletions

View File

@@ -475,6 +475,9 @@
}
const showDiscount = computed(() => {
if(!props.listinfo.id||props.listinfo.status!='done'){
return false
}
const keys = ['productCouponDiscountAmount', 'otherCouponDiscountAmount',
'pointsDiscountAmount', 'discountActAmount', 'newCustomerDiscountAmount', 'vipDiscountAmount'
]
@@ -715,9 +718,15 @@
const newUserDiscount = ref(0);
const back_favorablelist = toRaw(favorablelist.value);
async function getConsumeDiscount() {
const consumeDiscountRes = await consumeDiscount({
shopId: uni.cache.get("shopId"),
});
let consumeDiscountRes =null
if(cartStore.consumeDiscount&&cartStore.newUserDiscount){
consumeDiscountRes=cartStore.consumeDiscount
}else{
consumeDiscountRes = await consumeDiscount({
shopId: uni.cache.get("shopId"),
});
}
if (!consumeDiscountRes) {
favorablelist.value = back_favorablelist.filter(
(v) => v.name != "新客立减"

View File

@@ -1032,7 +1032,17 @@
// 跳转到加菜页面
function toJiacai() {
console.log("跳转到加菜页面");
back();
const arr= getCurrentPages()
console.log(arr);
if(arr[arr.length-1]&&arr[arr.length-1].route=='pages/product/index'){
back();
}else{
uni.cache.set('tableCode',listinfo.tableCode)
uni.cache.set('shopId',listinfo.shopId)
uni.redirectTo({
url:'/pages/product/index?noJump=1'
})
}
}
const packfee = computed(() => {
return cartStore.orderCostSummary.packFee;
@@ -1068,6 +1078,8 @@
//支付成功后的处理
async function paySucessCallback() {
console.log("paySucessCallback");
uni.$emit('updateProductIndex')
cartStore.clearDiscount()
orderorderInfo(true);
cartsSocket.closeSocket();
showDrainage.value = true;