下单详情
This commit is contained in:
@@ -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;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user