diff --git a/pages/order/confirm-order.vue b/pages/order/confirm-order.vue index f736501..55268c0 100644 --- a/pages/order/confirm-order.vue +++ b/pages/order/confirm-order.vue @@ -150,6 +150,7 @@ import { back } from "@/utils/uniapp.js"; + import * as limitTimeDiscountapi from '@/common/api/market/limitTimeDiscount.js'; import { onLoad, onUnload @@ -1096,6 +1097,8 @@ Object.assign(listinfo, res); getOrderInfoAfterCalcInit(res); } + + const limitTimeDiscountRes=ref(null) async function init(opt) { await storeuser.actionsproductqueryProduct(); @@ -1117,6 +1120,17 @@ if (res && typeof res == "object") { setOrder(res); } + }else{ + const limitRes = await limitTimeDiscountapi.getConfig({ + shopId: uni.cache.get('shopId') + }); + if (limitRes && typeof limitRes == 'object') { + limitTimeDiscountRes.value = limitRes; + + } else { + limitTimeDiscountRes.value = null; + + } } //获取店铺信息 const shopInfoRes = await APIusershopInfodetail({ diff --git a/pages/product/index.vue b/pages/product/index.vue index 1e676a3..0229075 100644 --- a/pages/product/index.vue +++ b/pages/product/index.vue @@ -606,7 +606,8 @@ import isBetween from 'dayjs/plugin/isBetween'; import { - APIshopUserInfo,APIusershopInfodetail + APIshopUserInfo, + APIusershopInfodetail } from "@/common/api/member.js"; dayjs.extend(isBetween); import { @@ -1535,10 +1536,10 @@ for (let cart of arr) { const findItem = cartStore.carts.find(v => v.id == cart.id) - if (findItem&&findItem.is_time_discount != cart.is_time_discount) { + if (findItem && findItem.is_time_discount != cart.is_time_discount) { result.push({ id: cart.id, - is_time_discount: findItem.is_time_discount + is_time_discount: findItem.is_time_discount }) } } @@ -1610,7 +1611,7 @@ shop_id: uni.cache.get('shopId'), time_dis_info: cartStore.limitTimeDiscount }; - + useSocket.sendMessage({ type: 'shopping', operate_type: 'time_discount_save', @@ -1683,7 +1684,6 @@ } if (Message.operate_type == 'time_discount_save') { cartStore.limitTimeDiscount = Message.data; - console.log('time_discount_save', cartStore.limitTimeDiscount); } //除去p 每次返回都回执消息 @@ -2183,6 +2183,17 @@ } else { await userStore.actionsproductqueryShop(newTableCode); await userStore.actionsproductqueryProduct(); + const res = await APIhistoryOrder({ + tableCode: uni.cache.get('tableCode') + }); + + if(res&&res.id){ + return uni.showModal({ + title:'提示', + content:'目标台桌使用中无法转桌', + showCancel:false + }) + } if (shopInfoRes.shopInfo.isTableFee === 1) { // 免桌位费,直接换桌 startUseTable(); @@ -2191,6 +2202,7 @@ tableInfo.value = uni.cache.get('shopTable'); showTableInfoPeopleNumPopup.value = true; } + } } catch (error) { console.log(error); @@ -2212,11 +2224,11 @@ const shopInfoRes = await APIusershopInfodetail({ shopId: uni.cache.get('shopId') }); - if(shopInfoRes&&shopInfoRes.shopInfo){ + if (shopInfoRes && shopInfoRes.shopInfo) { Object.assign(shopInfo, shopInfoRes.shopInfo); - uni.cache.set('shopInfo',shopInfoRes.shopInfo) + uni.cache.set('shopInfo', shopInfoRes.shopInfo) } - + if (userInfo && typeof userInfo === 'object') { shopUserInfo.value = userInfo diff --git a/stores/carts.js b/stores/carts.js index d32806f..00462cc 100644 --- a/stores/carts.js +++ b/stores/carts.js @@ -438,7 +438,6 @@ export const useCartsStore = defineStore("cart", () => { limitTimeDiscount.value = Message.data; } if (Message.operate_type == "time_discount_save") { - console.log("time_discount_save", Message.data); limitTimeDiscount.value = Message.data; }