Commit 1a764fe1 by 程默

上报性能数据

parent 27241d6a
...@@ -8,13 +8,14 @@ export default { ...@@ -8,13 +8,14 @@ export default {
let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {}; let extConfig = wx.getExtConfigSync ? wx.getExtConfigSync() : {};
console.log(extConfig, "-----------extConfig"); console.log(extConfig, "-----------extConfig");
if ( if (
process.env.NODE_ENV == "development" || process.env.NODE_ENV == "production" ||
JSON.stringify(extConfig) == "{}" JSON.stringify(extConfig) == "{}"
) { ) {
// extConfig = { mixid: "jordan", shopid: 471 }; // extConfig = { mixid: "jordan", shopid: 471 };
extConfig = { mixid: "antgood", shopid: 67 }; extConfig = { "mixid":"xyyx",
"shopid":133 };
} }
console.log("1444444444", extConfig.mixid); console.log("1444444444", extConfig);
this.$store.commit("setExtConfig", extConfig.mixid); this.$store.commit("setExtConfig", extConfig.mixid);
this.$store.commit('setExtConfigInfo',extConfig) this.$store.commit('setExtConfigInfo',extConfig)
// 调用API从本地缓存中获取数据 // 调用API从本地缓存中获取数据
...@@ -163,6 +164,8 @@ export default { ...@@ -163,6 +164,8 @@ export default {
return item.componentName == "底部导航"; return item.componentName == "底部导航";
})[0]; })[0];
// 显示条件(未处理)
footerVal.componentData.list=footerVal.componentData.list.filter(item=>item.visible==undefined || item.visible==1) || [];
this.mpApp.globalData.footerVal = footerVal; this.mpApp.globalData.footerVal = footerVal;
// app中异步数据回调 底部栏数据 // app中异步数据回调 底部栏数据
if (mpApp.footerCallBack) { if (mpApp.footerCallBack) {
......
...@@ -172,6 +172,17 @@ export default { ...@@ -172,6 +172,17 @@ export default {
// } // }
// }; // };
}, },
onReady(){
// 上报首页打开时间
if (wx.canIUse('reportPerformance')) {
const performance = wx.getPerformance()
const observer = performance.createObserver((entryList) => {
let getEntries=entryList.getEntries()
wx.reportPerformance(2001, getEntries[0]['duration'])
})
observer.observe({ entryTypes: ['render', 'script'] })
}
},
onLoad(options) { onLoad(options) {
let location=JSON.parse(wx.getStorageSync('location') || '{}') let location=JSON.parse(wx.getStorageSync('location') || '{}')
......
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