问题修复

This commit is contained in:
2025-11-27 19:01:45 +08:00
parent 3bb09ef0b1
commit fd55c815d3
11 changed files with 83 additions and 42 deletions

View File

@@ -82,7 +82,6 @@ function commonsProcess(showLoading, httpReqCallback) {
let { statusCode, data } = httpData; let { statusCode, data } = httpData;
// 避免混淆重新命名 // 避免混淆重新命名
let bodyData = data; let bodyData = data;
console.log('bodyData',bodyData)
if (statusCode == 500) { if (statusCode == 500) {
isShowErrorToast = true; isShowErrorToast = true;
@@ -106,6 +105,9 @@ function commonsProcess(showLoading, httpReqCallback) {
if (bodyData.code == 501) { if (bodyData.code == 501) {
return Promise.reject(bodyData); // 跳转到catch函数 return Promise.reject(bodyData); // 跳转到catch函数
} }
if (data.code == 200 && data.data === null) {
return Promise.resolve(true);
}
return Promise.resolve(bodyData.data); return Promise.resolve(bodyData.data);
}) })
.catch((res) => { .catch((res) => {

View File

@@ -210,10 +210,33 @@ onLoad(async (opt) => {
Object.assign(option, opt); Object.assign(option, opt);
console.log(option); console.log(option);
}); });
onShow(async() => { onShow(async () => {
await getArea(); await getArea();
getTable(); getTable();
}); });
/**
* 扫码上传
*/
async function saomaDicanCan() {
uni.scanCode({
success: async (res) => {
console.log("条码类型:" + res.scanType);
console.log("条码内容:" + res.result);
const paramStr = url.split("?")[1];
const paramObj = {};
paramStr.split("&").forEach((item) => {
const [key, value] = item.split("=");
paramObj[key] = value;
});
if (paramObj.tableCode) {
go.to("PAGES_CREATE_ORDER", {
tableCode: paramObj.tableCode,
});
}
},
});
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -1,11 +1,10 @@
export const tableStatus = { export const tableStatus = {
unbound: { label: "未绑定", type: "#909090" }, // unbound: { label: "未绑定", type: "#909090" },
settled: { label: "待清台", type: "#FAAD14" }, settled: { label: "待清台", type: "#FAAD14" },
ordering: { label: "点餐中", type: "#FF4D4F" }, ordering: { label: "点餐中", type: "#FF4D4F" },
unsettled: { label: "未结账", type: "#DD3F41" }, unsettled: { label: "未结账", type: "#DD3F41" },
cleaning: { label: "清理中", type: "#909090" }, cleaning: { label: "清理中", type: "#909090" },
idle: { label: "空闲", type: "#3F9EFF" }, idle: { label: "空闲", type: "#3F9EFF" },
closed: { label: "关台", type: "#DDDDDD" }, closed: { label: "关台", type: "#DDDDDD" },
subscribe: { label: "预定", type: "#52C41A" }, subscribe: { label: "预定", type: "#52C41A" },
}; };

View File

@@ -293,9 +293,15 @@ const vdata = reactive({
loginType: "merchant", loginType: "merchant",
}, },
}); });
vdata.formData.merchantName = "19107220837";
vdata.formData.username = "19111112222";
vdata.formData.pwd = "123456";
vdata.formData.code = "666666";
// #ifdef H5 // #ifdef H5
vdata.formData.username = "xpc"; // vdata.formData.merchantName = "19191703856";
vdata.formData.pwd = "123"; // vdata.formData.username = "18888888888";
// vdata.formData.pwd = "123456";
// vdata.formData.code = "666666";
// #endif // #endif
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
// vdata.formData.username = '15699991111' // vdata.formData.username = '15699991111'
@@ -305,14 +311,9 @@ vdata.formData.pwd = "123";
function accountTypeChange(e) { function accountTypeChange(e) {
// #ifdef H5 // #ifdef H5
if (e == 1) { if (e == 1) {
vdata.formData.merchantName = "19191703856";
vdata.formData.username = "18888888888";
vdata.formData.pwd = "123456";
vdata.formData.code = "666666";
} else { } else {
} }
// #endif // #endif
} }
const getCode = async () => { const getCode = async () => {

View File

@@ -221,7 +221,7 @@
</view> </view>
<view class="u-m-l-20"> 返回 </view> <view class="u-m-l-20"> 返回 </view>
</view> </view>
<view class="u-flex"> <view class="u-flex" v-if="accountStore.isPayAfter">
<text class="color-333 u-m-r-20" <text class="color-333 u-m-r-20"
>上菜方式{{ returnServingStyleName(subStatus) }}</text >上菜方式{{ returnServingStyleName(subStatus) }}</text
> >
@@ -577,7 +577,7 @@ function getshopsInfo() {
async function workerConfirm() { async function workerConfirm() {
//debugger //debugger
// form.workerAccount=18888888888 form.workerAccount=accountStore.staffUserName
if (!form.workerAccount) { if (!form.workerAccount) {
return infoBox.showToast("请输入服务员账号"); return infoBox.showToast("请输入服务员账号");
} }

View File

@@ -284,8 +284,6 @@
ref="surcharge" ref="surcharge"
title="添加附加费" title="添加附加费"
></my-surcharge> ></my-surcharge>
<!-- 登录弹窗 -->
<my-login v-model="modal.login" @loginSuccess="loginSuccess"></my-login>
<!-- 称重 --> <!-- 称重 -->
<weigh-item <weigh-item
ref="refweighitem" ref="refweighitem"
@@ -310,8 +308,6 @@ import _ from "lodash";
import * as Api from "@/http/yskApi/Instead.js"; import * as Api from "@/http/yskApi/Instead.js";
import * as limitTimeDiscountApi from "@/http/yskApi/limitTimeDiscount.js"; import * as limitTimeDiscountApi from "@/http/yskApi/limitTimeDiscount.js";
import { import {
$table, $table,
$choseTable, $choseTable,
@@ -364,12 +360,11 @@ import { getNowCart } from "@/pagesCreateOrder/util.js";
import yskUtils from "@/lib/index"; import yskUtils from "@/lib/index";
provide("yskUtils", yskUtils); provide("yskUtils", yskUtils);
import {useAccountStore} from '@/stores/account' import { useAccountStore } from "@/stores/account";
const accountStore = useAccountStore() const accountStore = useAccountStore();
provide("accountStore", accountStore); provide("accountStore", accountStore);
import { import {
$productCategory, $productCategory,
$layoutpage, $layoutpage,
@@ -632,6 +627,9 @@ async function getHistoryOrderDetail() {
let res = await getHistoryOrder({ let res = await getHistoryOrder({
tableCode: data.table.tableCode, tableCode: data.table.tableCode,
}); });
if (!res.id) {
return;
}
data.orderInfo = res; data.orderInfo = res;
if (res) { if (res) {
data.historyOrder = Object.entries(data.orderInfo.detailMap).map( data.historyOrder = Object.entries(data.orderInfo.detailMap).map(
@@ -2040,7 +2038,7 @@ async function getTableDetail() {
tableCode: data.table.tableCode, tableCode: data.table.tableCode,
}); });
console.log(res, "getTableDetail"); console.log(res, "getTableDetail");
if(res){ if (res && res.tableCode) {
data.table = res; data.table = res;
} }
} }

View File

@@ -22,7 +22,7 @@
<text class="status gift" v-if="item.isGift"></text> <text class="status gift" v-if="item.isGift"></text>
<template v-if="item.subStatus"> <template v-if="item.subStatus">
<text <text
class="status " class="status"
:class="[ :class="[
returnSubStatusText(item) == '已超时' ? 'timeout' : '', returnSubStatusText(item) == '已超时' ? 'timeout' : '',
returnStatusClass(item), returnStatusClass(item),
@@ -32,21 +32,21 @@
</template> </template>
</view> </view>
</view> </view>
<view class="u-flex" style="gap: 54rpx"> <view class="u-flex text-center" style="gap: 54rpx;min-width: 348rpx;">
<text>{{ item.num }}</text> <text class="u-flex-1">{{ item.num }}</text>
<view class="u-flex u-relative"> <view class="u-flex u-flex-1 u-relative">
<text class="limit-price" v-if="showOldPrice"> <text class="limit-price" v-if="showOldPrice(item)">
{{ returnPrice(item) }} {{ returnPrice(item) }}
</text> </text>
<text <text
class="origin-price" class="origin-price"
:class="[showOldPrice ? 'old-price' : '']" :class="[showOldPrice(item) ? 'old-price' : '']"
>{{ item.price }}</text >{{ item.price }}</text
> >
</view> </view>
<text>{{ <text class="u-flex-1">{{
BigNumber(item.num).times(returnPrice(item)).toFixed(2) BigNumber(item.num).times(returnPrice(item)).toFixed(2)
}}</text> }}</text>
</view> </view>
@@ -66,7 +66,7 @@ function isSelected(item) {
} }
function showOldPrice(item) { function showOldPrice(item) {
return item.isTimeDiscount ||item.isGift || item.discountSaleAmount * 1 > 0; return item.isTimeDiscount || item.isGift || item.discountSaleAmount * 1 > 0;
} }
const nowTime = ref(new Date().getTime()); const nowTime = ref(new Date().getTime());
@@ -118,8 +118,8 @@ function returnPrice(data) {
if (data.discountSaleAmount * 1 > 0) { if (data.discountSaleAmount * 1 > 0) {
return data.discountSaleAmount; return data.discountSaleAmount;
} }
if(data.isGift){ if (data.isGift) {
return 0 return 0;
} }
return data.price; return data.price;
} }

View File

@@ -232,7 +232,8 @@ function toPay() {
orderId: cartStore.order.id, orderId: cartStore.order.id,
isNowPay: true, isNowPay: true,
dinnerType: cartStore.currentDinnerType, dinnerType: cartStore.currentDinnerType,
}); personCount: cartStore.personCount,
},'redirect');
} }
const areaList = ref([]); const areaList = ref([]);

View File

@@ -514,6 +514,11 @@ async function init() {
}); });
} }
pageData.seatNum = order.seatNum; pageData.seatNum = order.seatNum;
if (options.personCount) {
seatFeeConfig.personCount = options.personCount;
return;
}
seatFeeConfig.personCount = order.seatNum; seatFeeConfig.personCount = order.seatNum;
} }
@@ -915,7 +920,9 @@ function toQuan() {
go.to("PAGES_ORDER_QUAN", { go.to("PAGES_ORDER_QUAN", {
orderId: order.id, orderId: order.id,
shopUserId: pageData.user.id, shopUserId: pageData.user.id,
orderPrice: BigNumber(payPrice.value).plus(BigNumber(orderCostSummary.value.couponDeductionAmount)).decimalPlaces(2, BigNumber.ROUND_DOWN) orderPrice: BigNumber(payPrice.value)
.plus(BigNumber(orderCostSummary.value.couponDeductionAmount))
.decimalPlaces(2, BigNumber.ROUND_DOWN),
}); });
} }
@@ -923,10 +930,10 @@ function toQuan() {
* 判断是否可以修改金额 * 判断是否可以修改金额
*/ */
async function discountShow() { async function discountShow() {
const bol = await hasPermission("yun_xu_da_zhe"); // const bol = await hasPermission("yun_xu_da_zhe");
if (bol) { // if (bol) {
showModel("editMoney", true); showModel("editMoney", true);
} // }
} }
/** /**
@@ -1226,11 +1233,11 @@ async function pay(par) {
payStatus = ""; payStatus = "";
return false; return false;
} }
if (payRes ) { if (payRes) {
paySuccess(); paySuccess();
} else { } else {
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
}); });
} }
@@ -1509,4 +1516,4 @@ $position: calc($dotSize / (-2));
} }
} }
} }
</style> </style>

View File

@@ -16,7 +16,11 @@ export const useAccountStore = defineStore("account", {
loginType: "", loginType: "",
}; };
}, },
getters: {}, getters: {
isPayAfter(state){
return state.shopInfo.registerType==='after'?true:false
}
},
actions: { actions: {
//获取员工信息 //获取员工信息
async getShopStaffInfo() { async getShopStaffInfo() {

View File

@@ -195,6 +195,8 @@ export const useCartStore = defineStore("cart", {
return false; return false;
} }
console.log("socket收到消息", msg);
switch (msg.operate_type) { switch (msg.operate_type) {
case "pad_init": case "pad_init":
this.cartList = msg.data; this.cartList = msg.data;
@@ -206,6 +208,8 @@ export const useCartStore = defineStore("cart", {
cartControls(cartItem, "add"); cartControls(cartItem, "add");
break; break;
case "pad_edit": case "pad_edit":
break;
case "bulk_edit": case "bulk_edit":
this.sendMessage({ this.sendMessage({
operate_type: "init", operate_type: "init",
@@ -216,6 +220,8 @@ export const useCartStore = defineStore("cart", {
getCart(); getCart();
break; break;
case "pad_del": case "pad_del":
break;
case "del": case "del":
cartItem = getNowCart(msg.data, $goods, pageData.user); cartItem = getNowCart(msg.data, $goods, pageData.user);
cartControls(cartItem, "del"); cartControls(cartItem, "del");
@@ -269,6 +275,7 @@ export const useCartStore = defineStore("cart", {
* @returns 历史订单数据 * @returns 历史订单数据
*/ */
async getOrder() { async getOrder() {
console.log("获取历史订单数据");
const res = await orderApi.getOrderById({ orderId: this.order.id }); const res = await orderApi.getOrderById({ orderId: this.order.id });
if (res) { if (res) {
this.setOrder(res); this.setOrder(res);
@@ -289,7 +296,6 @@ export const useCartStore = defineStore("cart", {
); );
return pre; return pre;
}, []); }, []);
}, },
}, },
unistorage: true, // 开启后对 state 的数据读写都将持久化 unistorage: true, // 开启后对 state 的数据读写都将持久化