feat(display): PIN 改为 4 位,showPinMiddle4 → showPin

Made-with: Cursor
This commit is contained in:
stswangzhiping
2026-03-19 08:57:44 +08:00
parent ce7f9f028e
commit b4fa850445
2 changed files with 6 additions and 7 deletions

View File

@@ -109,13 +109,12 @@ class Display {
log.info('display', '显示屏 → 时间');
}
/** 未激活 + 连网 → 显示 PIN 码中间 4 位6 位 PIN 取第 25 位 */
showPinMiddle4(pin) {
const s = String(pin || '');
const mid4 = s.length >= 6 ? s.slice(1, 5) : s.padStart(4, '0').slice(-4);
/** 未激活 + 连网 → 显示 PIN 码4 位数字 */
showPin(pin) {
const s = String(pin || '').padStart(4, '0').slice(-4);
// #m2 模式支持数字4字符直接跟在模式号后无空格
this._write('#m2' + mid4);
log.info('display', `显示屏 → PIN 中间4位: ${mid4}`);
this._write('#m2' + s);
log.info('display', `显示屏 → PIN: ${s}`);
}
_write(val) {