下单详情

This commit is contained in:
wwz
2025-03-06 18:48:38 +08:00
parent 56799f41f6
commit 70edc6756d
20 changed files with 4477 additions and 319 deletions

View File

@@ -10,9 +10,8 @@ import {
} from 'vue';
export const useCartStore = defineStore('cart', () => {
const shopInfo = uni.cache.get('shopInfo')
const shopInfo = null
const dinersNum = uni.cache.get('dinersNum')
// 计算单个商品的打包费用(向下取整并保留两位小数)
const itemSinglePackFee = (item) => {
const fee = item.packFee * item.cartNumber;
@@ -44,9 +43,13 @@ export const useCartStore = defineStore('cart', () => {
const getTotalSeatcharge = () => computed(() => {
// 是否免除桌位费 0 否 1 是
let tableFeeTotals = 0
if (shopInfo.isTableFee == 0 && dinersNum) {
const tableFeeTotals = Math.ceil(parseFloat(dinersNum) * parseFloat(shopInfo
.tableFee) * 100) / 100;
try {
if (shopInfo.isTableFee == 0 && dinersNum) {
const tableFeeTotals = Math.ceil(parseFloat(dinersNum) * parseFloat(shopInfo
.tableFee) * 100) / 100;
}
} catch (error) {
//TODO handle the exception
}
return Math.floor(tableFeeTotals * 100) / 100 ? Math.floor(tableFeeTotals * 100) / 100 : 0;
});