feat(订单复核): 共享条码弹窗、语音播报精简与 App 端 keep-alive 兼容

- 共享条码:扫码命中 has_shared_barcode 商品时弹「库内有相同商品」抽屉,
  列表展示图片/条码/规格/数量,点击卡片确认累加;关闭后同条码不再弹窗
- 商品图全屏预览:支持双击/双指/滚轮缩放(1~5倍)与拖动,图片加载失败占位
- 条码匹配重构:兼容单值及分号/逗号分隔多值条码,归一化去空白+大写后比对
- 语音播报精简:非必要 toast 加 silentVoice 静音;复核/包材绑定成功统一「发货成功」,
  补打成功「打印成功」;错误文案语音映射;命中商品播「数据一致(+复核要求)」
- 交互优化:查询结果默认选中第一行展示明细;含拦截单的团购波次播「有拦截订单」
- 样式:选中行深蓝高亮、打包要求值红字浅红底、工具栏间距改子项 margin(兼容老 WebView)、
  新增共享条码弹窗与图片预览样式
- App 端兼容:keep-alive 仅 H5 生效(App 端退化为普通动态组件避免页面叠层),
  退件页补 mounted/beforeUnmount 兜底注册/注销扫码捕获
This commit is contained in:
zm2000 2026-10-18 18:16:43 +08:00
parent c64c11b2ef
commit 76c7dc8271
3 changed files with 711 additions and 75 deletions

View File

@ -11,9 +11,16 @@
/>
<view class="layout-main">
<!-- keep-alive 仅 H5/Electron 支持(App 端不支持,缓存子组件视图不会被隐藏,
导致切换导航后多个页面内容叠在一起);App 端退化为普通动态组件,一次只渲染一个 -->
<!-- #ifdef H5 -->
<keep-alive v-if="activeViewComponent">
<component :is="activeViewComponent" :embedded="true" compact-top />
</keep-alive>
<!-- #endif -->
<!-- #ifndef H5 -->
<component v-if="activeViewComponent" :is="activeViewComponent" :embedded="true" compact-top />
<!-- #endif -->
<view v-else class="module-placeholder">
<text class="module-placeholder-title">{{ getActiveMenuTitle() || '请选择功能菜单' }}</text>
<text v-if="activeMenuPath" class="module-placeholder-desc">该菜单页面尚未配置({{ activeMenuPath }})</text>

File diff suppressed because it is too large Load Diff

View File

@ -780,6 +780,33 @@ export default {
this.stopPreviewStream()
stopScanSelfHeal()
},
// 嵌入模式(布局壳内组件):App 端无 keep-alive,activated/deactivated 不触发,
// 需在 mounted/beforeUnmount 兜底注册/注销扫码捕获,避免退件页嵌入时无法扫码。
mounted() {
if (!this.embedded) {
return
}
this.pageActive = true
diagBegin('returns')
diagNote('lifecycle', { hook: 'mounted' })
this.registerScanCapture()
this.resumePreviewIfNeeded()
startScanSelfHeal()
// #ifdef APP-PLUS
this.requestScanFocus()
// #endif
},
beforeUnmount() {
if (!this.embedded) {
return
}
this.pageActive = false
diagNote('lifecycle', { hook: 'beforeUnmount' })
this.unregisterScanCapture()
this.clearScanTimers()
this.stopPreviewStream()
stopScanSelfHeal()
},
methods: {
// ==================== 通用 ====================