feat(scan): 添加手机扫码功能支持

- 在 FabricOutScanBar 组件中添加手机扫码图标和事件处理
- 更新工作台页面的扫码逻辑以支持手机扫码回退
- 在销售拣货详情页添加手机扫码按钮和处理方法
- 重构扫码设置页面以支持扫码方式选择
- 添加手机扫码配置和判断逻辑到扫码配置模块
- 扩展扫码混入模块以支持手机扫码模式和设备检测
- 在多个业务页面中集成手机扫码功能和界面元素
- 更新扫码配置存储和读取逻辑以兼容新配置结构
This commit is contained in:
2026-06-23 17:08:17 +08:00
parent 084bb235f8
commit 36c0f9a3a0
12 changed files with 277 additions and 103 deletions
@@ -91,42 +91,35 @@ export default {
},
onShow() {
this.isPageActive = true;
// #ifdef APP-PLUS
if (this.canScan && this.isEditable) {
this.registerScanBroadcast((scanResult) => {
this.QRBarCode = scanResult.trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan());
});
}
// #endif
},
onHide() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onUnload() {
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
registerOrderScanBroadcast() {
// #ifdef APP-PLUS
this.registerScanBroadcast((scanResult) => {
this.QRBarCode = scanResult.trim().replace(/[\r\n]/g, '');
this.$nextTick(() => this.handleScan());
});
// #endif
},
syncCanScanFromStatus(status) {
const nextCanScan = this.isEditable && canScanAtStatus(status);
if (this.canScan && !nextCanScan) {
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
}
this.canScan = nextCanScan;
},