|
|
@@ -107,7 +107,6 @@
|
|
|
<script setup>
|
|
|
import { onLoad } from "@dcloudio/uni-app";
|
|
|
import { ref, computed } from "vue";
|
|
|
-import { go } from "@/utils/utils.js";
|
|
|
import { getFileUrl } from "@/utils/file.js";
|
|
|
import { GetOrderInfo } from "@/api/dining.js";
|
|
|
|
|
|
@@ -119,6 +118,7 @@ const detailOrderId = ref('');
|
|
|
const orderDetail = ref({
|
|
|
storeName: '',
|
|
|
storeAddress: '',
|
|
|
+ storeId: '',
|
|
|
orderNo: '',
|
|
|
tableId: '', // 桌号ID,用于跳转加餐
|
|
|
tableNo: '', // 桌号展示(tableNumber)
|
|
|
@@ -197,6 +197,7 @@ function applyOrderData(data) {
|
|
|
orderDetail.value = {
|
|
|
storeName: store?.storeName ?? raw?.storeName ?? '',
|
|
|
storeAddress: store?.storeAddress ?? store?.address ?? raw?.storeAddress ?? raw?.address ?? '',
|
|
|
+ storeId: store?.storeId ?? store?.id ?? raw?.storeId ?? raw?.store_id ?? '',
|
|
|
orderNo: raw?.orderNo ?? raw?.orderId ?? '',
|
|
|
tableId: raw?.tableId ?? raw?.tableNumber ?? '', // 加餐跳转用
|
|
|
tableNo: raw?.tableNumber ?? raw?.tableNo ?? raw?.tableName ?? '',
|
|
|
@@ -221,12 +222,18 @@ function applyOrderData(data) {
|
|
|
|
|
|
// 去加餐:跳转点餐页,携带桌号与就餐人数
|
|
|
const handleConfirmOrder = () => {
|
|
|
- const tableid = orderDetail.value?.tableId || orderDetail.value?.tableNo || '';
|
|
|
+ const tableid = uni.getStorageSync('currentTableId');
|
|
|
const diners = orderDetail.value?.dinerCount ?? '';
|
|
|
+ const storeId = orderDetail.value?.storeId ?? '';
|
|
|
+ if (!tableid) {
|
|
|
+ uni.showToast({ title: '订单缺少桌号信息,无法加餐', icon: 'none' });
|
|
|
+ return;
|
|
|
+ }
|
|
|
const q = [];
|
|
|
- if (tableid !== '') q.push(`tableid=${encodeURIComponent(String(tableid))}`);
|
|
|
- if (diners !== '') q.push(`diners=${encodeURIComponent(String(diners))}`);
|
|
|
- go(q.length ? `/pages/orderFood/index?${q.join('&')}` : '/pages/orderFood/index');
|
|
|
+ q.push(`tableid=${encodeURIComponent(String(tableid))}`);
|
|
|
+ if (diners !== '' && diners != null) q.push(`diners=${encodeURIComponent(String(diners))}`);
|
|
|
+ if (storeId !== '' && storeId != null) q.push(`storeId=${encodeURIComponent(String(storeId))}`);
|
|
|
+ uni.navigateTo({ url: `/pages/orderFood/index?${q.join('&')}` });
|
|
|
};
|
|
|
|
|
|
// 去结算:跳转确认订单页,携带订单ID、订单号、桌号、就餐人数、订单金额(用于调起支付)
|
|
|
@@ -246,7 +253,7 @@ const handleConfirmPay = () => {
|
|
|
if (diners !== '') q.push(`diners=${encodeURIComponent(String(diners))}`);
|
|
|
if (totalAmount !== '' && totalAmount != null) q.push(`totalAmount=${encodeURIComponent(String(totalAmount))}`);
|
|
|
if (remark !== '') q.push(`remark=${encodeURIComponent(remark)}`);
|
|
|
- go(q.length ? `/pages/checkout/index?${q.join('&')}` : '/pages/checkout/index');
|
|
|
+ uni.navigateTo({ url: q.length ? `/pages/checkout/index?${q.join('&')}` : '/pages/checkout/index' });
|
|
|
};
|
|
|
|
|
|
onLoad(async (e) => {
|