bug修复

This commit is contained in:
Waiting 2024-06-03 17:49:46 +08:00
parent 3945b36b0a
commit 4d7f73aedf
4 changed files with 24 additions and 6 deletions

View File

@ -107,6 +107,15 @@ export default {
}, 500);
}
}
//
if(options?.query.couponsId) {
setTimeout(() => {
uni.reLaunch({
url: 'pages/common/groupbuy/index?id=' + options?.query.couponsId
});
}, 500);
}
}
logger.info(`App Launch options ${env}: { companyId: `, getCompanyId() + ', storeId: ' + getRegisterStoreId() + ' }');

View File

@ -174,12 +174,18 @@ onLoad(async (e: any) => {
if(isLogin()) {
await uni.showLoading();
groupBuyBean.value = await getGroupBuyDetail(e.id);
groupBuyBean.value.goods.price = groupBuyBean.value.price;
bannerList.value = JSON.parse(groupBuyBean.value.content).filter((item: any) => item.type === 2).map((item: any) => item.images);
countdown();
await fetchRecommendList();
await fetchBuyRecordList();
// setCompanyId('1512403904150138881');
// groupBuyBean.value = await getGroupBuyDetail('1740922051118063618');
if(groupBuyBean.value) {
groupBuyBean.value.goods.price = groupBuyBean.value.price;
bannerList.value = JSON.parse(groupBuyBean.value.content).filter((item: any) => item.type === 2).map((item: any) => item.images);
countdown();
await fetchRecommendList();
await fetchBuyRecordList();
}
uni.hideLoading();
} else {
goPath('/pages/common/login/index');
}
});

View File

@ -95,7 +95,7 @@ const useUserStore = defineStore('user', {
getApp().globalData?.logger.info('login result: ', res);
setToken(res.token);
setSessionKey(res.sessionKey);
setOpenId(res.maOpenId)
setOpenId(res.maOpenId);
await this.setUserInfo(res.user);
// }
resolve(res);
@ -148,6 +148,7 @@ const useUserStore = defineStore('user', {
if(this.userInfo) {
this.userInfo.userDiscount = this.getUserDiscount;
await setCompanyId(this.userInfo.companyId);
getApp().globalData!.companyId = this.userInfo.companyId;
} else {
await clearToken();
}
@ -157,6 +158,7 @@ const useUserStore = defineStore('user', {
setCompanyInfo(partial: Partial<any>) {
this.companyInfo = partial as any;
getApp().globalData!.companyId = this.companyInfo.id;
},
setDeliveryAddress(partial: Partial<any>) {

View File

@ -41,6 +41,7 @@ function getCompanyId() {
function setCompanyId(companyId: string) {
uni.setStorageSync(CompanyIdKey, companyId);
getApp().globalData!.companyId = companyId;
}
function getReferrerUserId() {