增加网络波动加载中,增加会员信息扫码充值
This commit is contained in:
@@ -32,7 +32,7 @@ export const useCartStore = defineStore('cart', () => {
|
||||
};
|
||||
|
||||
// 计算购物车商品总价格
|
||||
const getTotalTotalPrices = (matchedProducts, bwc = 2) => computed(() => {
|
||||
const getTotalTotalPrices = (matchedProducts) => computed(() => {
|
||||
if (!matchedProducts || !Array.isArray(matchedProducts)) {
|
||||
return 0;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ export const useCartStore = defineStore('cart', () => {
|
||||
let cart = matchedProducts.reduce((total, item) => {
|
||||
// 是否启用会员价 0否1是
|
||||
if (uni.cache.get('orderVIP').isVip == 1 && uni.cache.get('ordershopUserInfo')
|
||||
.isMemberPrice == 1 && bwc == 2) {
|
||||
.isMemberPrice == 1) {
|
||||
// memberPrice会员价
|
||||
return total + (parseFloat(item.memberPrice || item.price) * parseFloat(item
|
||||
.num - item
|
||||
@@ -52,9 +52,10 @@ export const useCartStore = defineStore('cart', () => {
|
||||
return total + (parseFloat(item.price) * parseFloat(item.num - item.returnNum));
|
||||
}
|
||||
}, 0);
|
||||
cart.toFixed(2)
|
||||
// 向上取整并保留两位小数
|
||||
let result = roundUpToTwoDecimals(cart, 'upward')
|
||||
return result;
|
||||
// let result = roundUpToTwoDecimals(cart, 'upward')
|
||||
return cart;
|
||||
});
|
||||
|
||||
// 计算商品卷所选择的总价格
|
||||
|
||||
@@ -150,10 +150,9 @@ export const productStore = defineStore('product', {
|
||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||
uni.pro.navigateTo('product/choosetable')
|
||||
} else {
|
||||
uni.pro.navigateTo(
|
||||
'product/index', {
|
||||
tableCode: tableCode,
|
||||
})
|
||||
uni.reLaunch({
|
||||
url: '/pages/product/index'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -188,9 +187,12 @@ export const productStore = defineStore('product', {
|
||||
if (uni.cache.get('shopInfo').isTableFee == 0) {
|
||||
uni.pro.navigateTo('product/choosetable')
|
||||
} else {
|
||||
uni.pro.navigateTo('product/index', {
|
||||
tableCode: uni.cache.get('tableCode'),
|
||||
})
|
||||
uni.reLaunch({
|
||||
url: '/pages/product/index'
|
||||
});
|
||||
// uni.pro.navigateTo('product/index', {
|
||||
// tableCode: uni.cache.get('tableCode'),
|
||||
// })
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user