feat: 英文字母描红开发
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { defaultPrintConfig } from '../../config/config';
|
||||
|
||||
Page({
|
||||
data: {
|
||||
printConfig: defaultPrintConfig,
|
||||
enableDebug: false,
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
const printConfig = getApp().getPrintConfig() || defaultPrintConfig;
|
||||
const enableDebug = wx.getStorageSync('enableDebug') || false;
|
||||
this.setData({ printConfig, enableDebug });
|
||||
},
|
||||
|
||||
onChangeHeader(e: WechatMiniprogram.CustomEvent) {
|
||||
const header = e.detail.value as PrintHeader;
|
||||
this.setData({ printConfig: { ...this.data.printConfig, header } });
|
||||
},
|
||||
|
||||
onClickHeaderSetting(e: WechatMiniprogram.CustomEvent) {
|
||||
const header = e.currentTarget.dataset.name as PrintHeader;
|
||||
this.setData({ printConfig: { ...this.data.printConfig, header } });
|
||||
},
|
||||
|
||||
onAppNameChange(e: WechatMiniprogram.CustomEvent) {
|
||||
const appName = e.detail + '';
|
||||
this.setData({ printConfig: { ...this.data.printConfig, appName } });
|
||||
},
|
||||
|
||||
onConfirm() {
|
||||
getApp().setPrintConfig(this.data.printConfig);
|
||||
const enableDebug = this.data.enableDebug;
|
||||
wx.setStorageSync('enableDebug', enableDebug);
|
||||
wx.setEnableDebug({ enableDebug });
|
||||
wx.navigateBack();
|
||||
},
|
||||
|
||||
/** 真机调试线上包 */
|
||||
toggleDebug() {
|
||||
const enableDebug = !this.data.enableDebug;
|
||||
this.setData({ enableDebug });
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user