台桌订单增加显示餐位费,打包费

This commit is contained in:
2025-11-27 19:29:37 +08:00
parent 4ef95c9baa
commit 0c5ba4b092
4 changed files with 37 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
<view class="box u-font-32"> <view class="box u-font-32">
<view class="u-flex gap-30"> <view class="u-flex gap-30">
<text>开单时间</text> <text>开单时间</text>
<text class="color-666">2025/09/22 19:43</text> <text class="color-666" v-if="cartStore.order">{{ cartStore.order.createTime }}</text>
</view> </view>
<view class="u-flex gap-30 u-m-t-50"> <view class="u-flex gap-30 u-m-t-50">
<text>就餐人数</text> <text>就餐人数</text>

View File

@@ -32,7 +32,7 @@
</template> </template>
</view> </view>
</view> </view>
<view class="u-flex text-center" style="gap: 54rpx;min-width: 348rpx;"> <view class="u-flex text-center" style="gap: 54rpx; min-width: 348rpx">
<text class="u-flex-1">{{ item.num }}</text> <text class="u-flex-1">{{ item.num }}</text>
<view class="u-flex u-flex-1 u-relative"> <view class="u-flex u-flex-1 u-relative">
<text class="limit-price" v-if="showOldPrice(item)"> <text class="limit-price" v-if="showOldPrice(item)">
@@ -51,6 +51,37 @@
}}</text> }}</text>
</view> </view>
</view> </view>
<view class="item" v-if="cartStore.orderCostSummary.seatFee > 0">
<view class="u-flex">
<text>餐位费</text>
</view>
<view class="u-flex text-center" style="gap: 54rpx; min-width: 348rpx">
<text class="u-flex-1">{{ cartStore.personCount }}</text>
<view class="u-flex u-flex-1 u-relative">
<text class="origin-price">{{ cartStore.shopInfo.tableFee }}</text>
</view>
<text class="u-flex-1">
{{ cartStore.orderCostSummary.seatFee }}
</text>
</view>
</view>
<view class="item" v-if="cartStore.orderCostSummary.packFee > 0">
<view class="u-flex">
<text>打包费</text>
</view>
<view class="u-flex text-center" style="gap: 54rpx; min-width: 348rpx">
<text class="u-flex-1"></text>
<view class="u-flex u-flex-1 u-relative">
<text class="origin-price"></text>
</view>
<text class="u-flex-1">
{{ cartStore.packFee }}
</text>
</view>
</view>
</view> </view>
</view> </view>
</template> </template>

View File

@@ -135,6 +135,8 @@ const websocketUtil=inject("websocketUtil")
const cartStore = useCartStore(); const cartStore = useCartStore();
const accountStore = useAccountStore(); const accountStore = useAccountStore();
cartStore.shopInfo=accountStore.shopInfo;
websocketUtil.onMessage((data) => { websocketUtil.onMessage((data) => {
cartStore.onMessage(data); cartStore.onMessage(data);
}); });

View File

@@ -3,7 +3,6 @@ import { defineStore } from "pinia";
import yskUtils from "ysk-utils"; import yskUtils from "ysk-utils";
import { getNowCart } from "@/pagesCreateOrder/util.js"; import { getNowCart } from "@/pagesCreateOrder/util.js";
import * as orderApi from "@/http/api/order.js"; import * as orderApi from "@/http/api/order.js";
export function formatCartGoods(goods) { export function formatCartGoods(goods) {
return { return {
...goods, ...goods,
@@ -72,8 +71,9 @@ export const useCartStore = defineStore("cart", {
getters: { getters: {
//餐费费 //餐费费
seatFeeConfig: (state) => { seatFeeConfig: (state) => {
console.log(state.shopInfo);
return { return {
pricePerPerson: state.shopInfo.tableFee || 0, pricePerPerson: state.shopInfo.tableFee,
personCount: state.personCount, //就餐人数 personCount: state.personCount, //就餐人数
isEnabled: !state.shopInfo.isTableFee, isEnabled: !state.shopInfo.isTableFee,
}; };