点餐页问题修复

This commit is contained in:
2026-01-22 15:02:06 +08:00
parent 94be2739af
commit 8810c218b3
4 changed files with 40 additions and 22 deletions

View File

@@ -817,11 +817,7 @@
// 分步取值 + 每层兜底,避免某一环不存在导致 undefined
const shopExtendShopTable = uni.cache.get('shopTable') || {}; // 兜底空对象
const shopExtendMap = shopExtendShopTable.shopExtendMap || {}; // 兜底空对象
// 最终声明:即使 shopinfo_bg 不存在,也兜底为空字符串/默认值
const shopExtend = ref(shopExtendMap.shopinfo_bg || '');
const shopExtend = ref('');
/**
* 通用数据合集 end
@@ -1765,8 +1761,11 @@
if (Message.operate_type == 'init') {
// cartStore.limitTimeDiscount = Message.time_dis_info;
cartInit(Message.data)
uni.hideLoading();
try {
uni.hideLoading();
} catch (error) {
//TODO handle the exception
}
isLoading.value = false;
if (!socketInitFinished) {
@@ -2509,11 +2508,16 @@
if (e.type) {
orderType.value = e.type;
}
await handleMixinOnLoad({
...e,
shopId: e.shopId || uni.cache.get('shopId')
})
const userInfo = userStore.userInfo
if(userStore.shopUserInfo.shopExtendList){
shopExtend.value=userStore.shopUserInfo.shopExtendList.find(v=>v.autoKey=='shopinfo_bg')||''
}
// //获取用户信息
// const userInfo = await APIshopUserInfo({
// shopId: uni.cache.get('shopId')
@@ -2523,11 +2527,13 @@
// shopId: uni.cache.get('shopId')
// });
Object.assign(shopInfo, userStore.shopInfo);
if (userInfo && typeof userInfo === 'object') {
shopUserInfo.value = userInfo
if (e.type == 'beforehand') {
uni.cache.set("tableCode", userStore.shopUserInfo.id);
options.initMessage.table_code = userStore.shopUserInfo.id
}
options.initMessage.shop_id = userStore.shopInfo.id
shopUserInfo.value = userStore.shopUserInfo
await productqueryProduct();
const extraInitPar = {}
@@ -2539,6 +2545,11 @@
const time_dis_info = await getLimitDiscount()
options.initMessage.time_dis_info = time_dis_info
console.log('options.initMessage', {
...options.initMessage,
...extraInitPar,
})
useSocket.connect({
...options.initMessage,
...extraInitPar,