Commit 788d50ad by 李嘉林

进入二级页面返回首页总重新渲染问题

parent d385bc3e
......@@ -15,10 +15,12 @@ export default {
console.log(extConfig, "-----------extConfig");
if (JSON.stringify(extConfig) == "{}") {
let shopItem = {
// development: { mixid: "IR8rkL", "shopid": 3813}, //道可测试1
// development: { mixid: "iLntd3", "shopid": 3814}, //道可测试2
// development: { mixid: "ssa", "shopid": 2342}, //五粮液uat
development: { mixid: "antgood", "shopid": 67},
// production: { "mixid":"SWQ", "shopid": 1641 }, // 麦贝思
production: { "mixid":"qiyeCT", "shopid": 1045 }, // 道可
// production: { "mixid":"SWQ", "shopid": 1641 }, // 麦贝思
// production: { "mixid":"metasense_doctors", "shopid": 1238 }, // 册为医护端
// production: { "mixid":"3QqsFT", "shopid": 1337 },
// production: { "mixid":"notSHOWROOM", "shopid": 1274 }, // 诸色
......@@ -74,14 +76,11 @@ export default {
// 商城配置
await this.shopConfiguration()
setTimeout(() => {
let mpApp = getApp();
console.log(mpApp, "this.mpApp");
mpApp.getShopInfo = this.getShopInfo
mpApp.getThemePage = this.getThemePage
setTimeout(() => {
},300)
},
......
......@@ -235,6 +235,7 @@ export default {
h5Params: {}, //params
fromPage: "",
customBgOpacity: true, // 沉浸式风格
reloadPage: false, // 切换门店进入首页重新获取相关配置
};
},
components:{
......@@ -319,7 +320,8 @@ export default {
// }
// };
},
onReady(){
onReady() {
console.log(new Date().getTime(),'load-----home-onReady')
// 上报首页打开时间
if (wx.canIUse('reportPerformance')) {
const performance = wx.getPerformance()
......@@ -353,19 +355,30 @@ export default {
this.firstOpenPage = false;
},
onLoad(options) {
if(this.$options) {
Object.assign(this.$data, this.$options.data());
}
console.log(new Date().getTime(),'load-----home-onLoad')
console.log(options,this.firstOpenPage,'---------home----options')
log.info(options, '---------home----options')
let h5Params = options && options.params ? JSON.parse(decodeURIComponent(options.params)) : {};
this.h5Params = h5Params;
console.log(h5Params,'--h5Params')
if (Object.keys(h5Params).length>0 && h5Params.offlineShopCode) {
if (Object.keys(h5Params).length > 0 && h5Params.offlineShopCode) {
console.log("设置切换的门店", h5Params.offlineShopCode, getStoreInfo().offlineShopCode);
// 判断是否等于缓存门店,非缓存门店重新设置并初始化
if (h5Params.offlineShopCode != getStoreInfo().offlineShopCode) {
// 存储h5url门店信息
setStoreInfo({
offlineShopCode:h5Params.offlineShopCode,
offlineShopName:h5Params.offlineShopName,
});
this.reloadPage = true;
}
} else {
this.reloadPage = false;
}
console.log(this.reloadPage,'-reloadPage1')
//进页面存储需要绑定的信息
if(options.userId||options.spokesmanRelId) {
wx.setStorage({
......@@ -415,9 +428,6 @@ export default {
})
});
}
if(this.$options) {
Object.assign(this.$data, this.$options.data());
}
if (options.from && options.from == "logout") {
//来自用户登出
wx.removeStorage({
......@@ -502,11 +512,14 @@ export default {
})
},
onShow() {
console.log(new Date().getTime(),'load-----home-onShow')
this.pageLoading = false;
console.log(this.reloadPage,'-reloadPage2')
if (this.reloadPage) {
this.refreshInit();
console.log(new Date().getTime(),'load-----home-onShow')
this.reloadPage = false;
}
// 设置显示条件
console.log(new Date().getTime(),'--------on--------------show')
log.info('--------on--------------show')
//分销隔流
if(this.toHomePage) {
......@@ -589,6 +602,7 @@ export default {
// this.pageLoading = false;
},
toUpdate() {
console.log("toUpdate");
// 切换门店重新加载
this.getThemeList();
},
......@@ -1073,6 +1087,7 @@ export default {
this.birthGifts = res;
},
async getThemeList() {
console.log("getThemeList")
this.pageLoading = true;
await app.getThemePage(this.$store.state.extConfig);
setTimeout(() => {
......@@ -1163,7 +1178,8 @@ export default {
onShareTimeline(res) {
log.info(res,'-----onShareTimeline')
},
onPullDownRefresh(){
onPullDownRefresh() {
console.log("onPullDownRefresh");
this.refreshInit();
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment