feat:完成自定义文字涂色卡
This commit is contained in:
+29
-3
@@ -1,7 +1,33 @@
|
||||
// app.ts
|
||||
App<IAppOption>({
|
||||
globalData: {},
|
||||
onLaunch() {
|
||||
|
||||
globalData: {
|
||||
env: 'release'
|
||||
},
|
||||
onLaunch() {
|
||||
const accountInfo = wx.getAccountInfoSync();
|
||||
const env = accountInfo.miniProgram.envVersion;
|
||||
this.globalData.env = env;
|
||||
if (env !== 'release') {
|
||||
const printHeader = wx.getStorageSync('printHeader') || 'wechat';
|
||||
this.globalData.printHeader = printHeader;
|
||||
}
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 小程序显示时的生命周期
|
||||
},
|
||||
|
||||
onHide() {
|
||||
// 小程序隐藏时的生命周期
|
||||
},
|
||||
|
||||
getPrintHeader(): PrintHeader {
|
||||
return this.globalData.printHeader || 'wechat';
|
||||
},
|
||||
|
||||
setPrintHeader(header: PrintHeader) {
|
||||
header = header || 'wechat';
|
||||
this.globalData.printHeader = header;
|
||||
wx.setStorageSync('printHeader', header);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user