From 686d4442f542cb10a16ec25a3736de7bc5e4f0d6 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sun, 27 Sep 2026 03:15:06 +0800 Subject: [PATCH] =?UTF-8?q?feat(packaging):=20=E5=85=8D=E9=AA=8C=E6=94=B9?= =?UTF-8?q?=E3=80=8C=E5=8D=95=E5=87=BB=E5=BC=B9=E7=AA=97=20+=20=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E7=9B=B4=E6=89=A7=E8=A1=8C=E3=80=8D=EF=BC=8C=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E7=9C=9F=E6=9C=BA=E9=9A=BE=E6=91=81=E7=9A=84=E9=95=BF?= =?UTF-8?q?=E6=8C=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 现场取证:longpress-免验 事件正常到达且能执行(两次成功把 0/2 推到 2/2),痛点是长按需摁住不动 - 单击商品行弹「免验确认」窗(关闭 / 免验);右键(含右键菜单键)直接免验不弹窗 - 抽出 verifyBlockReason(已核实 / 无数量)与 doVerifyItem(弹窗与右键共用),不再按 packStarted / groupVerifyCompleted 整单拦截 - 诊点:免验-open(附整单状态快照)/ 免验-execute(source=dialog|contextmenu)/ 免验-blocked(原因) - 商品图 @click.stop,避免点图误弹免验窗;提示文案改「单击/右键商品行免验」;renderjs 统一为 #ifndef APP-PLUS 包裹 --- src/pages/packaging/index.vue | 801 +++++++++++++++++++--------------- 1 file changed, 437 insertions(+), 364 deletions(-) diff --git a/src/pages/packaging/index.vue b/src/pages/packaging/index.vue index 6009662..691eb9f 100644 --- a/src/pages/packaging/index.vue +++ b/src/pages/packaging/index.vue @@ -90,7 +90,7 @@ class="pack-order-type" :class="isGroupOrder ? 'pack-order-type--group' : 'pack-order-type--single'" >{{ isGroupOrder ? '团单' : '散单' }} - 长按/右键商品行免验 + 单击/右键商品行免验 已扫 {{ scannedKindCount }}/{{ totalKindCount }} 种 共{{ detailList.length }}项 @@ -103,8 +103,8 @@ :key="index" class="pack-detail-row" :class="{ 'pack-detail-row--scanned': isGroupOrder && isItemScanned(item) }" - @longpress="!groupVerifyDone && handleLongPressProduct(item)" - @contextmenu.prevent="!groupVerifyDone && handleLongPressProduct(item)" + @click="handleDetailRowClick(item)" + @contextmenu.prevent="handleVerifyItemDirect(item)" > {{ index + 1 }} @@ -114,7 +114,7 @@ class="pack-item-img" :src="item.image" mode="aspectFit" - @click="previewItemImage(item)" + @click.stop="previewItemImage(item)" /> - {{ item.imageCount }} @@ -144,7 +144,7 @@ - + 今日打包 @@ -315,6 +315,23 @@ + + + + + 免验确认 + × + + + 将「{{ verifyConfirmItem?.name || verifyConfirmItem?.barcode || '-' }}」标记为已核实(免验)? + + + + + + + + @@ -478,6 +495,9 @@ export default { // ---- 打包订单类型 / 无条码复核 ---- isSandan: null, cancelVerifyPopupOpen: false, + // 免验确认弹窗(单击商品行触发;右键直接免验不走这里) + verifyConfirmVisible: false, + verifyConfirmItem: null, idleLogoutTimer: null, idleLoggingOut: false, // ---- 打包流程(预检/上报/完成)---- @@ -588,7 +608,7 @@ export default { groupVerifyCompleted() { return this.totalKindCount > 0 && this.groupVerifiedCount >= this.totalKindCount }, - // 核实已完成或已开始打包:商品行右键/长按免验事件移除 + // 行级拦截已取消(单击/右键都只看这一行);保留它仅供诊断日志显示当时状态 groupVerifyDone() { return this.groupVerifyCompleted || this.packStarted }, @@ -886,6 +906,13 @@ export default { }) this.precheckPassed = true this.packStarted = true + // 留痕:这条一旦出现,说明是「服务端有进行中的任务」把 packStarted 置为 true 的 + // (开发库没有进行中任务,所以只会在生产包上复现"长按免验被拦") + diagNote('pack-restore-task', { + packMode: order?.pack_mode ?? wave?.pack_mode ?? '', + wave: this.currentWaveNo, + items: this.detailList.length, + }) // 恢复进行中的大团购打包时长闸门倒计时(若服务端随任务下发倒计时字段) const restoreWait = Number( this.pickInfoField(order, {}, ['pack_wait_seconds', 'packWaitSeconds']) || @@ -1126,20 +1153,78 @@ export default { const scanned = Number(item?.scannedQty) || 0 return qty > 0 && scanned >= qty }, - handleLongPressProduct(item) { - if (!item || !this.isGroupOrder || this.groupVerifyDone) { + // 单击商品行:弹免验确认窗(关闭 / 免验) + // 2026-09-26:长按在真机上"非常难摁"(要挟住不动),改成单击弹窗 + 右键直执行 + handleDetailRowClick(item) { + if (!item || !this.isGroupOrder) { return } + const reason = this.verifyBlockReason(item) + if (reason) { + diagNote('免验-blocked', { reason, source: 'click', item: item?.name || item?.barcode || '' }) + uni.showToast({ title: reason, icon: 'none' }) + return + } + diagNote('免验-open', { + source: 'click', + item: item?.name || item?.barcode || '', + // 保留整单状态快照,便于事后判读(不再用它拦截) + done: this.groupVerifyDone, + completed: this.groupVerifyCompleted, + packStarted: this.packStarted, + verified: `${this.scannedKindCount}/${this.totalKindCount}`, + }) + this.verifyConfirmItem = item + this.verifyConfirmVisible = true + }, + closeVerifyConfirm() { + this.verifyConfirmVisible = false + this.verifyConfirmItem = null + }, + confirmVerifyItem() { + const item = this.verifyConfirmItem + this.verifyConfirmVisible = false + this.verifyConfirmItem = null + this.doVerifyItem(item, 'dialog') + }, + // 右键(含电脑右键菜单键):不弹窗,直接免验 + handleVerifyItemDirect(item) { + if (!item || !this.isGroupOrder) { + return + } + const reason = this.verifyBlockReason(item) + if (reason) { + diagNote('免验-blocked', { reason, source: 'contextmenu', item: item?.name || item?.barcode || '' }) + uni.showToast({ title: reason, icon: 'none' }) + return + } + this.doVerifyItem(item, 'contextmenu') + }, + // 不能免验的原因文案('' = 可以免验):单击弹窗与右键直执行共用 + verifyBlockReason(item) { if (this.isItemScanned(item)) { - uni.showToast({ title: '该商品已核实', icon: 'none' }) + return '该商品已核实' + } + if ((Number(item?.qty) || 0) <= 0) { + return '该商品无数量,无法免验' + } + return '' + }, + // 免验执行(单击确认窗与右键共用) + doVerifyItem(item, source) { + if (!item) { return } const total = Number(item.qty) || 0 if (total <= 0) { - uni.showToast({ title: '该商品无数量,无法免验', icon: 'none' }) return } - // 长按免验:直接标记为已核实(标绿),无需扫码 + diagNote('免验-execute', { + source, + item: item.name || item.barcode || '', + qty: total, + }) + // 直接标记为已核实(标绿),无需扫码 item.scannedQty = total this.addScanRecord(`免验:${item.name || item.barcode || ''}`) this.speak('免验通过') @@ -3439,6 +3524,7 @@ export default {