feat:添加埋点,createPage 重构

This commit is contained in:
R524809
2025-12-09 17:33:58 +08:00
parent e193369478
commit 2c32235568
10 changed files with 1249 additions and 1279 deletions
+5 -5
View File
@@ -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);
}
},
});