|
@@ -283,6 +283,8 @@ onLoad(async (options) => {
|
|
|
toLogin();
|
|
toLogin();
|
|
|
return; // 登录后页面会刷新,避免继续执行
|
|
return; // 登录后页面会刷新,避免继续执行
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if(appStore?.userInfo?.lastVisitedMerchantId){
|
|
|
|
|
+ merchantId.value = appStore?.userInfo?.lastVisitedMerchantId;
|
|
|
} else if (appStore?.userInfo?.merchant?.id) {
|
|
} else if (appStore?.userInfo?.merchant?.id) {
|
|
|
merchantId.value = appStore.userInfo.merchant.id;
|
|
merchantId.value = appStore.userInfo.merchant.id;
|
|
|
} else {
|
|
} else {
|
|
@@ -298,19 +300,24 @@ onLoad(async (options) => {
|
|
|
onShow(async () => {
|
|
onShow(async () => {
|
|
|
// 隐藏原生 tabBar,使用自定义 tabBar
|
|
// 隐藏原生 tabBar,使用自定义 tabBar
|
|
|
uni.hideTabBar();
|
|
uni.hideTabBar();
|
|
|
-
|
|
|
|
|
|
|
+ console.log('appStore.userInfo',appStore.userInfo)
|
|
|
const isLogin = appStore.isLogin;
|
|
const isLogin = appStore.isLogin;
|
|
|
if(isLogin){
|
|
if(isLogin){
|
|
|
rightsStore.getUserBenefits(appStore.userInfo?.userId);
|
|
rightsStore.getUserBenefits(appStore.userInfo?.userId);
|
|
|
getUserBenefits();
|
|
getUserBenefits();
|
|
|
}
|
|
}
|
|
|
if (appStore.merchantId && appStore.merchantId !== '') {
|
|
if (appStore.merchantId && appStore.merchantId !== '') {
|
|
|
|
|
+ console.log('111111111')
|
|
|
merchantId.value = appStore.merchantId;
|
|
merchantId.value = appStore.merchantId;
|
|
|
if (!isLogin) {
|
|
if (!isLogin) {
|
|
|
toLogin();
|
|
toLogin();
|
|
|
return; // 登录后页面会刷新,避免继续执行
|
|
return; // 登录后页面会刷新,避免继续执行
|
|
|
}
|
|
}
|
|
|
|
|
+ }else if(appStore?.userInfo?.lastVisitedMerchantId){
|
|
|
|
|
+ console.log('2222222222222222')
|
|
|
|
|
+ merchantId.value = appStore?.userInfo?.lastVisitedMerchantId;
|
|
|
} else if (appStore?.userInfo?.merchant?.id) {
|
|
} else if (appStore?.userInfo?.merchant?.id) {
|
|
|
|
|
+ console.log('333333333333333')
|
|
|
merchantId.value = appStore.userInfo.merchant.id;
|
|
merchantId.value = appStore.userInfo.merchant.id;
|
|
|
if(!merchantInfo.merchantName){
|
|
if(!merchantInfo.merchantName){
|
|
|
getSbmerchantInfoFn()
|
|
getSbmerchantInfoFn()
|
|
@@ -582,7 +589,7 @@ const toGoodsCate = (item) => {
|
|
|
uni.switchTab({url:`/pages/goods_cate/goods_cate`})
|
|
uni.switchTab({url:`/pages/goods_cate/goods_cate`})
|
|
|
}
|
|
}
|
|
|
const merchantNameShow = () => {
|
|
const merchantNameShow = () => {
|
|
|
- if(!appStore.userInfo ||((appStore.userInfo && !appStore.userInfo.merchant && !appStore.merchantId))){
|
|
|
|
|
|
|
+ if(!appStore.userInfo ||(appStore.userInfo && !appStore.userInfo.merchant && !appStore.merchantId && !appStore.userInfo.lastVisitedMerchantId)){
|
|
|
return true;
|
|
return true;
|
|
|
}else{
|
|
}else{
|
|
|
return false;
|
|
return false;
|