feat: 修改配置文件和页面逻辑,优化门店信息获取功能

This commit is contained in:
mkm 2024-08-16 09:00:46 +08:00
parent d7255d9690
commit 3dd2ed5777
3 changed files with 33 additions and 23 deletions

View File

@ -17,7 +17,7 @@ switch (env) {
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
case 'local':
BASE_URL = 'http://192.168.1.7:8545';
BASE_URL = 'http://192.168.1.22:8545';
WSS_URL = 'wss://ceshi-multi-store.lihaink.cn/pull'
break;
default:

View File

@ -316,17 +316,17 @@
for (let key in data) {
STORE_INFO[key] = data[key]
}
}
} else {
getStoreInfo().then(res => {
uni.setStorageSync("STORE_INFO", JSON.stringify(res.data));
let data = res.data;
for (let key in data) {
STORE_INFO[key] = data[key]
}
})
}
getgoodClassList(0);
getGoodList();
})
}
@ -334,7 +334,8 @@
onShareAppMessage(() => {
let shareStr = '?id=' + STORE_INFO.id;
if (vipList.includes(userStore.userInfo.user_ship)) {
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo.share_name)
shareStr = shareStr + '&spread_uid=' + userStore.userInfo.id + '&real_name=' + (userStore.userInfo
.share_name)
}
let shareInfo = {
// title: (userStore.userInfo.real_name || userStore.userInfo.nickname) + '',
@ -699,12 +700,11 @@
store_id: ''
});
const getShareInfo = () => {
if (uni.getStorageSync('SHARE_INFO')) {
shareInfo.value = (uni.getStorageSync('SHARE_INFO'))
}
}
getShareInfo()
// const getShareInfo = () => {
// if (uni.getStorageSync('SHARE_INFO')) {
// shareInfo.value = (uni.getStorageSync('SHARE_INFO'))
// }
// }
onLoad(async (opt) => {
console.log('opt', opt)
@ -726,6 +726,8 @@
shareInfo.value.store_id = opt.id;
uni.setStorageSync('SHARE_INFO', shareInfo.value);
}
} else {
uni.removeStorageSync('SHARE_INFO')
}
getStoreInfoFn()

View File

@ -117,6 +117,8 @@
<up-skeleton :loading="true" :animate="true"></up-skeleton>
</view>
</view>
<up-alert v-if="timeContent!=''" type = "error" :description = "timeContent"></up-alert>
</view>
<view class="m-card order-remark">
@ -207,6 +209,7 @@
</view>
</view>
<up-modal :show="timeShow" :content='timeContent' @confirm="timeShow=false"></up-modal>
<addressPopup ref="addressRef" :show="showAddress" :list="addressList" @close="showAddress = false"
@change="changeAddress" />
@ -277,7 +280,8 @@
const reservation_time = ref('')
const is_storage = ref(0)
const LocationShow = ref(false)
const timeShow=ref(false)
const timeContent=ref('')
const formData = ref({
remark: ""
})
@ -419,6 +423,10 @@
cartList.value = res.data.cart_list;
orderInfo.value = res.data.order;
shop_Info.value = res.data.shopInfo || {}
if(res.data.alert!=''){
timeShow.value=true
timeContent.value=res.data.alert
}
checkInventoryApi({
cart_id: cartStore.cartList,
store_id: store_id || res.data.shopInfo.id