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
@@ -31,6 +31,14 @@
</view>
<u-form-item label-width="150" label="条码资料:">
<input type="text" maxlength="-1" v-model="QRBarCode" style="width:200px;" @confirm="GoodsCheckBillDetailScan" />
<u-icon
v-if="usePhoneScanFallback"
name="scan"
size="44"
color="#2979ff"
style="margin-left: 8px;"
@click="handlePhoneScan"
/>
<checkbox-group @change="BarCodeDelChange">
<checkbox ref="checkBoxRef" :checked="BarCodeDelStatus">删除</checkbox>
</checkbox-group>
@@ -193,28 +201,20 @@
},
onUnload() {
// #ifdef APP-PLUS
this.isPageActive = false;
this.unregisterScanBroadcast();
// #endif
},
onHide() {
// 页面隐藏时
this.isPageActive = false;
// #ifdef APP-PLUS
this.unregisterScanBroadcast();
// #endif
},
onShow() {
// 页面显示时
this.isPageActive = true;
// #ifdef APP-PLUS
this.registerScanBroadcast((scanResult) => {
console.log("扫码结果:", scanResult);
// 处理扫描结果,按照原有逻辑
if(!this.StoreName){
this.showError('请先选择仓库');
return;
@@ -240,9 +240,11 @@
return;
}
});
// #endif
},
methods: {
handlePhoneScan() {
this.openPhoneScan();
},
// 添加通用错误提示方法
showError(message) {