增加打包费
This commit is contained in:
@@ -183,7 +183,7 @@
|
|||||||
<button class="tag" hover-class="hover-class"
|
<button class="tag" hover-class="hover-class"
|
||||||
@tap="toggleGoodsItemKey(item,index,'isGift')">{{item.isGift?'取消赠送':'赠送'}}</button>
|
@tap="toggleGoodsItemKey(item,index,'isGift')">{{item.isGift?'取消赠送':'赠送'}}</button>
|
||||||
</view>
|
</view>
|
||||||
<view class="u-flex u-m-r-20 u-m-b-20">
|
<view class="u-flex u-m-r-20 u-m-b-20" v-if="eatTypes.active!='takeout'">
|
||||||
<button class="tag" hover-class="hover-class"
|
<button class="tag" hover-class="hover-class"
|
||||||
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
|
@tap="toggleGoodsItemKey(item,index,'isPack')">{{item.isPack?'取消打包':'打包'}}</button>
|
||||||
</view>
|
</view>
|
||||||
@@ -200,16 +200,26 @@
|
|||||||
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<template v-if="eatTypes.active=='takeout'">
|
<view class="border-bottom">
|
||||||
</template>
|
<template v-if="$seatFee&&$seatFee.totalAmount">
|
||||||
<template v-else>
|
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
||||||
<view v-if="$seatFee&&$seatFee.totalAmount" class="u-flex u-row-between u-m-t-18 u-p-b-34 border-bottom">
|
<view>
|
||||||
<view>
|
<text >桌位费</text>
|
||||||
<text >桌位费</text>
|
</view>
|
||||||
|
<view>¥{{$seatFee.totalAmount||'0.00'}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view>¥{{$seatFee.totalAmount||'0.00'}}</view>
|
</template>
|
||||||
</view>
|
<template v-if="$packFee>0">
|
||||||
</template>
|
<view class="u-flex u-row-between u-m-t-18 u-p-b-34 ">
|
||||||
|
<view>
|
||||||
|
<text >打包费</text>
|
||||||
|
</view>
|
||||||
|
<view>¥{{$packFee||'0.00'}}</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<view class="u-flex u-row-right u-m-t-38">
|
<view class="u-flex u-row-right u-m-t-38">
|
||||||
<!-- <template v-if="$shop.registerType=='munchies'">
|
<!-- <template v-if="$shop.registerType=='munchies'">
|
||||||
@@ -363,6 +373,9 @@
|
|||||||
par[key] = !item[key]
|
par[key] = !item[key]
|
||||||
const res = await Api.addCart(par)
|
const res = await Api.addCart(par)
|
||||||
goods.list[index][key] = returnBoolean(res[key])
|
goods.list[index][key] = returnBoolean(res[key])
|
||||||
|
if(key=='isPack'){
|
||||||
|
getCart()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//等叫
|
//等叫
|
||||||
function toggleWait(item) {
|
function toggleWait(item) {
|
||||||
@@ -383,7 +396,12 @@
|
|||||||
],
|
],
|
||||||
active: 'dine-in'
|
active: 'dine-in'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const $packFee=computed(()=>{
|
||||||
|
return goods.list.reduce((prve,cur)=>{
|
||||||
|
return prve+cur.packFee
|
||||||
|
},0).toFixed(2)
|
||||||
|
})
|
||||||
|
|
||||||
function chooseUser() {
|
function chooseUser() {
|
||||||
go.to('PAGES_CHOOSE_USER')
|
go.to('PAGES_CHOOSE_USER')
|
||||||
@@ -460,12 +478,13 @@
|
|||||||
})
|
})
|
||||||
const goodsPrice = computed(() => {
|
const goodsPrice = computed(() => {
|
||||||
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
|
const tPrice=cur.salePrice * cur.number+cur.packFee*1
|
||||||
|
return prve +(cur.isGift?0:tPrice)
|
||||||
}, 0)
|
}, 0)
|
||||||
return (goodsTotalPrice|| 0).toFixed(2)
|
return (goodsTotalPrice|| 0).toFixed(2)
|
||||||
})
|
})
|
||||||
const allPrice = computed(() => {
|
const allPrice = computed(() => {
|
||||||
const n=goodsPrice.value*1 + (eatTypes.active=='takeout'?0:($seatFee.totalAmount || 0))
|
const n=goodsPrice.value*1 + $seatFee.totalAmount
|
||||||
return n.toFixed(2)
|
return n.toFixed(2)
|
||||||
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
// const goodsTotalPrice = goods.list.reduce((prve, cur) => {
|
||||||
// return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
|
// return prve + cur.salePrice * cur.number * (cur.isGift ? 0 : 1)
|
||||||
@@ -501,6 +520,8 @@
|
|||||||
if (seatFee && seatFee.totalNumber) {
|
if (seatFee && seatFee.totalNumber) {
|
||||||
userNumbers.defaultCateIndex = seatFee.totalNumber-1 || 0
|
userNumbers.defaultCateIndex = seatFee.totalNumber-1 || 0
|
||||||
Object.assign($seatFee, seatFee)
|
Object.assign($seatFee, seatFee)
|
||||||
|
}else{
|
||||||
|
$seatFee.totalAmount=0
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(goods.list);
|
console.log(goods.list);
|
||||||
|
|||||||
Reference in New Issue
Block a user