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

@ -23,7 +23,7 @@
<template #left>
<view class="store-info">
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
<!-- <text v-if=" vipList.includes(userStore.userInfo.user_ship) || shareInfo.store_id"
<!-- <text v-if=" vipList.includes(userStore.userInfo.user_ship) || shareInfo.store_id"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
<text v-if="vipList.includes(userStore.userInfo.user_ship)">
{{ (userStore.userInfo.real_name || userStore.userInfo.nickname) + '的个人门店' }}</text>
@ -32,7 +32,7 @@
</text> -->
<text v-if="shareInfo.uid"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
{{shareInfo.real_name}}
{{shareInfo.real_name}}
</text>
<text v-else
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{
@ -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]
}
})
}
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();
})
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) + '',
@ -655,7 +656,7 @@
}
const settleAccounts = () => {
if (+cartInfo.value.pay_price < 500 && userStore.userInfo.user_ship==0 ) return showOverlay.value = true;
if (+cartInfo.value.pay_price < 500 && userStore.userInfo.user_ship == 0) return showOverlay.value = true;
uni.navigateTo({
url: '/pagesOrder/settle/settle'
})
@ -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)
@ -720,12 +720,14 @@
store_id: where.value.store_id
});
//
if (opt.spread_uid) {
if (opt.spread_uid) {
shareInfo.value.uid = opt.spread_uid;
shareInfo.value.real_name = opt.real_name;
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