feat:添加埋点,createPage 重构
This commit is contained in:
+5
-5
@@ -2,19 +2,19 @@ import config from './config/config';
|
||||
|
||||
const defaultPrintConfig: PrintConfig = config.printHeader as PrintConfig;
|
||||
|
||||
|
||||
// app.ts
|
||||
App<IAppOption>({
|
||||
globalData: {
|
||||
env: 'release',
|
||||
printConfig: defaultPrintConfig
|
||||
printConfig: defaultPrintConfig,
|
||||
},
|
||||
onLaunch() {
|
||||
const accountInfo = wx.getAccountInfoSync();
|
||||
const env = accountInfo.miniProgram.envVersion || 'release';
|
||||
this.globalData.env = env;
|
||||
if (env !== 'release') {
|
||||
const printConfig = wx.getStorageSync('printConfig') || defaultPrintConfig;
|
||||
const printConfig =
|
||||
wx.getStorageSync('printConfig') || defaultPrintConfig;
|
||||
this.globalData.printConfig = printConfig;
|
||||
}
|
||||
},
|
||||
@@ -24,7 +24,7 @@ App<IAppOption>({
|
||||
},
|
||||
|
||||
onHide() {
|
||||
// 小程序隐藏时的生命周期
|
||||
// 小程序隐藏时的生命周期
|
||||
},
|
||||
|
||||
getPrintConfig(): PrintConfig {
|
||||
@@ -34,5 +34,5 @@ App<IAppOption>({
|
||||
setPrintConfig(config: PrintConfig) {
|
||||
this.globalData.printConfig = config;
|
||||
wx.setStorageSync('printConfig', config);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user