diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 2b19135..99e8cac 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -82,7 +82,6 @@ function commonsProcess(showLoading, httpReqCallback) { let { statusCode, data } = httpData; // 避免混淆重新命名 let bodyData = data; - console.log('bodyData',bodyData) if (statusCode == 500) { isShowErrorToast = true; @@ -106,6 +105,9 @@ function commonsProcess(showLoading, httpReqCallback) { if (bodyData.code == 501) { return Promise.reject(bodyData); // 跳转到catch函数 } + if (data.code == 200 && data.data === null) { + return Promise.resolve(true); + } return Promise.resolve(bodyData.data); }) .catch((res) => { diff --git a/pages/choose-table/choose-table.vue b/pages/choose-table/choose-table.vue index 0090b97..3acd005 100644 --- a/pages/choose-table/choose-table.vue +++ b/pages/choose-table/choose-table.vue @@ -210,10 +210,33 @@ onLoad(async (opt) => { Object.assign(option, opt); console.log(option); }); -onShow(async() => { +onShow(async () => { await getArea(); 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, + }); + } + }, + }); +} \ No newline at end of file + diff --git a/stores/account.js b/stores/account.js index fdbf33c..23e8df5 100644 --- a/stores/account.js +++ b/stores/account.js @@ -16,7 +16,11 @@ export const useAccountStore = defineStore("account", { loginType: "", }; }, - getters: {}, + getters: { + isPayAfter(state){ + return state.shopInfo.registerType==='after'?true:false + } + }, actions: { //获取员工信息 async getShopStaffInfo() { diff --git a/stores/cart.js b/stores/cart.js index 0eff5c5..1e3a040 100644 --- a/stores/cart.js +++ b/stores/cart.js @@ -195,6 +195,8 @@ export const useCartStore = defineStore("cart", { return false; } + console.log("socket收到消息", msg); + switch (msg.operate_type) { case "pad_init": this.cartList = msg.data; @@ -206,6 +208,8 @@ export const useCartStore = defineStore("cart", { cartControls(cartItem, "add"); break; case "pad_edit": + break; + case "bulk_edit": this.sendMessage({ operate_type: "init", @@ -216,6 +220,8 @@ export const useCartStore = defineStore("cart", { getCart(); break; case "pad_del": + break; + case "del": cartItem = getNowCart(msg.data, $goods, pageData.user); cartControls(cartItem, "del"); @@ -269,6 +275,7 @@ export const useCartStore = defineStore("cart", { * @returns 历史订单数据 */ async getOrder() { + console.log("获取历史订单数据"); const res = await orderApi.getOrderById({ orderId: this.order.id }); if (res) { this.setOrder(res); @@ -289,7 +296,6 @@ export const useCartStore = defineStore("cart", { ); return pre; }, []); - }, }, unistorage: true, // 开启后对 state 的数据读写都将持久化