feat: 英文字母描红开发

This commit is contained in:
R524809
2026-04-03 15:21:04 +08:00
parent 206c44cf6d
commit 1ef6770810
37 changed files with 1812 additions and 179 deletions
+16
View File
@@ -0,0 +1,16 @@
{
"navigationBarTitleText": "Debug",
"navigationBarBackgroundColor": "#FFD719",
"homeButton": true,
"backgroundColor": "#F6F6F6",
"enablePullDownRefresh": false,
"usingComponents": {
"toy-button": "../../ui/button/button",
"van-radio": "@vant/weapp/radio/index",
"van-radio-group": "@vant/weapp/radio-group/index",
"van-cell": "@vant/weapp/cell/index",
"van-cell-group": "@vant/weapp/cell-group/index",
"van-switch": "@vant/weapp/switch/index",
"van-field": "@vant/weapp/field/index"
}
}
+31
View File
@@ -0,0 +1,31 @@
.debug-page {
min-height: 100vh;
padding: 20rpx;
background-color: #F6F6F6;
.debug-wrapper {
margin-top: 30rpx;
background-color: #fff;
border-radius: 20rpx;
overflow: hidden;
.centered-title {
text-align: center;
color: #666;
border-top: 0 none;
}
.debug-cell {
display: flex;
align-items: center;
justify-content: space-between;
}
}
.btn-area {
display: flex;
align-items: center;
justify-content: center;
margin-top: 40rpx;
}
}
+43
View File
@@ -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 });
},
});
+78
View File
@@ -0,0 +1,78 @@
<view class="debug-page">
<van-cell-group custom-class="debug-wrapper">
<van-cell
title="打印图片Header设置111"
size="large"
custom-class="centered-title" />
<van-radio-group
value="{{printConfig.header}}"
bind:change="onChangeHeader">
<van-cell
title="微信小程序头(wechat"
clickable
data-name="wechat"
bind:click="onClickHeaderSetting">
<van-radio slot="right-icon" name="wechat" />
</van-cell>
<van-cell
title="无Logo图片头(noLogo"
clickable
data-name="noLogoImage"
bind:click="onClickHeaderSetting">
<van-radio slot="right-icon" name="noLogoImage" />
</van-cell>
<van-cell
title="有Logo图片头(LogoImage"
clickable
data-name="LogoImage"
bind:click="onClickHeaderSetting">
<van-radio slot="right-icon" name="LogoImage" />
</van-cell>
<van-cell
title="最小Header头(minimal)(默认)"
clickable
data-name="minimal"
bind:click="onClickHeaderSetting"
border="{{ false }}">
<van-radio slot="right-icon" name="minimal" />
</van-cell>
</van-radio-group>
<van-field
label="appName"
value=""
placeholder="{{printConfig.appName}}"
bind:change="onAppNameChange" />
</van-cell-group>
<van-cell-group custom-class="debug-wrapper">
<van-cell
title="debug调整"
size="large"
custom-class="centered-title" />
<van-cell
custom-class="debug-cell"
title="真机调试线上包"
clickable
data-name="enableDebug"
border="{{ false }}"
bind:click="toggleDebug">
<van-switch
slot="right-icon"
name="enableDebug"
checked="{{enableDebug}}" />
</van-cell>
</van-cell-group>
<view class="btn-area">
<toy-button type="green" bind:click="onConfirm" width="360rpx">
确定
</toy-button>
</view>
<van-cell-group custom-class="debug-wrapper">
<van-cell
title="测试页面入口"
size="large"
custom-class="centered-title" />
</van-cell-group>
</view>