diff --git a/src/pages/returns/index.vue b/src/pages/returns/index.vue index f191287..662506a 100644 --- a/src/pages/returns/index.vue +++ b/src/pages/returns/index.vue @@ -186,7 +186,7 @@ {{ o.name }} - {{ o.code }} + {{ o.barcode || o.code }} {{ o.spec }} @@ -219,7 +219,7 @@ class="rp-detail-img" :src="detailImage(row)" mode="aspectFit" - @click="previewRowImages(row)" + @click="openImageViewer(row)" /> — @@ -229,7 +229,7 @@ 拆包 {{ row.__unpack.name || '未识别商品' }} - {{ row.__unpack.code || row.barcode || '—' }} + {{ row.__unpack.barcode || row.__unpack.code || '—' }} {{ row.__unpack.spec }} @@ -284,7 +284,12 @@ - + 选择备注 @@ -298,7 +303,7 @@ @click="applyRemarkOption(opt)" > {{ opt }} - × + 移除 暂无备注选项,可在下方新增 @@ -346,6 +351,63 @@ + + + + + {{ confirmTitle }} + × + + + {{ confirmContent }} + + + + + + + + + + + + + {{ imageViewerError ? '图片加载失败' : '暂无图片' }} + + + + + + + + + + + {{ imageViewerIndex + 1 }}/{{ imageViewerUrls.length }} + 双击或双指缩放查看 + + 0 + ? { paddingBottom: `${this.remarkKeyboardHeight}px` } + : {} + }, }, created() { this.loadRemarkOptions() this.initCameraState() + this.bindKeyboardListener() }, onLoad() { // 页面数据不跨会话持久化:每次进入从空白开始 @@ -776,6 +885,10 @@ export default { this.clearScanTimers() this.stopPreviewStream() stopScanSelfHeal() + // 离开页面:关掉图片查看器并解除全局滚轮监听,避免回来后扫码被门禁挡住 + this.teardownImageViewer() + this.modalBusy = false + setScanPaused(false) }, onUnload() { this.pageActive = false @@ -784,6 +897,7 @@ export default { this.clearScanTimers() this.stopPreviewStream() stopScanSelfHeal() + this.teardownImageViewer() diagPersistNow() }, // keep-alive 内嵌模式(外壳菜单切换):页面级 onShow/onHide 不会触发, @@ -807,6 +921,9 @@ export default { this.clearScanTimers() this.stopPreviewStream() stopScanSelfHeal() + this.teardownImageViewer() + this.modalBusy = false + setScanPaused(false) }, // 嵌入模式(布局壳内组件):App 端无 keep-alive,activated/deactivated 不触发, // 需在 mounted/beforeUnmount 兜底注册/注销扫码捕获,避免退件页嵌入时无法扫码。 @@ -826,6 +943,8 @@ export default { // #endif }, beforeUnmount() { + this.teardownImageViewer() + this.unbindKeyboardListener() if (!this.embedded) { return } @@ -890,10 +1009,215 @@ export default { ) }, - previewRowImages(row) { - const urls = this.detailImages(row) + /** 打开商品图片查看器(点击明细商品图,支持多图翻页) */ + openImageViewer(row) { + const urls = (this.detailImages(row) || []) + .map((v) => String(v == null ? '' : v).trim()) + .filter((v) => v !== '') if (!urls.length) return - uni.previewImage({ current: urls[0], urls }) + this.imageViewerUrls = urls + this.imageViewerIndex = 0 + this.imageViewerError = false + this.resetImageViewerZoom() + this.imageViewerVisible = true + this.modalBusy = true + setScanPaused(true) + diagNote('image-viewer-open', { count: urls.length, src: urls[0] }) + }, + + /** 图片加载成功 */ + handleImageViewerLoad() { + this.imageViewerError = false + }, + + /** 图片加载失败(URL 无效 / 明文 http 被阻 / 网络异常) */ + handleImageViewerError() { + this.imageViewerError = true + diagNote('image-viewer-error', { src: this.imageViewerSrc }) + }, + + /** 关闭查看器(同时恢复扫码) */ + closeImageViewer() { + if (this._imageCloseTimer) { + clearTimeout(this._imageCloseTimer) + this._imageCloseTimer = null + } + this.imageViewerVisible = false + this.imageViewerUrls = [] + this.imageViewerIndex = 0 + this.resetImageViewerZoom() + this.modalBusy = false + setScanPaused(false) + // #ifdef APP-PLUS + this.scheduleScanFocus(220) + // #endif + }, + + /** 只做状态清理,不碰扫码/焦点(页面隐藏、组件卸载时用) */ + teardownImageViewer() { + if (this._imageCloseTimer) { + clearTimeout(this._imageCloseTimer) + this._imageCloseTimer = null + } + this.imageViewerVisible = false + this.imageViewerUrls = [] + this.imageViewerIndex = 0 + this.resetImageViewerZoom() + }, + + /** 复位缩放与拖动偏移 + 手势状态 */ + resetImageViewerZoom() { + this.imageViewerScale = 1 + this.imageViewerOffsetX = 0 + this.imageViewerOffsetY = 0 + this._imagePinchDistance = 0 + this._imagePinchStartScale = 1 + this._imagePanMoved = false + this._imageLastClickAt = 0 + }, + + /** 缩放范围限制:1 ~ 5 倍(与复核页一致) */ + clampImageViewerScale(value) { + return Math.min(5, Math.max(1, Number(value) || 1)) + }, + + /** 双击切换缩放(放大到 2.5 倍,或恢复 1 倍) */ + toggleImageViewerZoom() { + if (this.imageViewerScale > 1.01) { + this.resetImageViewerZoom() + } else { + this.imageViewerScale = 2.5 + } + }, + + /** 预览内切换图片(翻页后复位缩放与拖动);下标循环:最后一张下一张回到第一张 */ + showImageViewerAt(index) { + const list = this.imageViewerUrls || [] + const total = list.length + if (!total) return + const raw = Number(index) + const idx = Number.isFinite(raw) ? ((Math.trunc(raw) % total) + total) % total : 0 + this.imageViewerIndex = idx + this.imageViewerError = false + this.resetImageViewerZoom() + }, + + nextImageViewer() { + if ((this.imageViewerUrls || []).length <= 1) return + this.showImageViewerAt(this.imageViewerIndex + 1) + }, + + prevImageViewer() { + if ((this.imageViewerUrls || []).length <= 1) return + this.showImageViewerAt(this.imageViewerIndex - 1) + }, + + /** 两指间距 */ + getImageViewerTouchDistance(touches) { + if (!touches || touches.length < 2) return 0 + const dx = touches[0].clientX - touches[1].clientX + const dy = touches[0].clientY - touches[1].clientY + return Math.sqrt(dx * dx + dy * dy) + }, + + onImageViewerTouchStart(e) { + const touches = (e && e.touches) || [] + if (touches.length >= 2) { + this._imagePinchDistance = this.getImageViewerTouchDistance(touches) + this._imagePinchStartScale = this.imageViewerScale + return + } + if (touches.length === 1) { + this._imagePanStartX = touches[0].clientX + this._imagePanStartY = touches[0].clientY + this._imagePanStartOffsetX = this.imageViewerOffsetX + this._imagePanStartOffsetY = this.imageViewerOffsetY + this._imagePanMoved = false + } + }, + + onImageViewerTouchMove(e) { + const touches = (e && e.touches) || [] + if (touches.length >= 2 && this._imagePinchDistance > 0) { + const distance = this.getImageViewerTouchDistance(touches) + this.imageViewerScale = this.clampImageViewerScale( + this._imagePinchStartScale * (distance / this._imagePinchDistance) + ) + return + } + if (touches.length === 1 && this.imageViewerScale > 1.01) { + const deltaX = touches[0].clientX - this._imagePanStartX + const deltaY = touches[0].clientY - this._imagePanStartY + if (Math.abs(deltaX) > 3 || Math.abs(deltaY) > 3) { + this._imagePanMoved = true + } + this.imageViewerOffsetX = this._imagePanStartOffsetX + deltaX + this.imageViewerOffsetY = this._imagePanStartOffsetY + deltaY + } + }, + + onImageViewerTouchEnd() { + this._imagePinchDistance = 0 + this._imagePinchStartScale = 1 + }, + + /** H5:鼠标按住拖动(放大后查看局部;拖动不算点击,不会误关) */ + onImageViewerMouseDown(e) { + // #ifdef H5 + if (this.imageViewerScale <= 1.01 || !e) return + const startX = Number(e.clientX) + const startY = Number(e.clientY) + if (!Number.isFinite(startX) || !Number.isFinite(startY)) return + const ox = this.imageViewerOffsetX + const oy = this.imageViewerOffsetY + this._imagePanMoved = false + const move = (ev) => { + const dx = Number(ev.clientX) - startX + const dy = Number(ev.clientY) - startY + if (Math.abs(dx) > 3 || Math.abs(dy) > 3) this._imagePanMoved = true + this.imageViewerOffsetX = ox + dx + this.imageViewerOffsetY = oy + dy + } + const up = () => { + document.removeEventListener('mousemove', move) + document.removeEventListener('mouseup', up) + } + document.addEventListener('mousemove', move) + document.addEventListener('mouseup', up) + // #endif + }, + + /** 点击预览区:单击延时关闭(等双击判定),双击切换缩放 */ + onImageViewerStageClick() { + if (this._imagePanMoved) { + this._imagePanMoved = false + return + } + const now = Date.now() + if (now - this._imageLastClickAt < 400) { + if (this._imageCloseTimer) { + clearTimeout(this._imageCloseTimer) + this._imageCloseTimer = null + } + this._imageLastClickAt = 0 + this.toggleImageViewerZoom() + return + } + this._imageLastClickAt = now + this._imageCloseTimer = setTimeout(() => { + this._imageCloseTimer = null + this.closeImageViewer() + }, 400) + }, + + /** 桌面端滚轮缩放(与复核页一致:1.1 / 0.9 步进) */ + onImageViewerWheel(e) { + if (!e) return + if (e.cancelable && typeof e.preventDefault === 'function') e.preventDefault() + const delta = e.deltaY || 0 + if (!delta) return + const factor = delta > 0 ? 0.9 : 1.1 + this.imageViewerScale = this.clampImageViewerScale(this.imageViewerScale * factor) }, previewOrderImages(order) { @@ -902,24 +1226,43 @@ export default { uni.previewImage({ current: urls[0], urls }) }, - /** 确认弹窗(弹窗期间屏蔽扫码路由) */ + /** + * 确认弹窗(自定义,替代 uni.showModal:跨端样式一致、按钮文案/颜色可控) + * 弹窗期间 modalBusy + 暂停扫码,确认/取消后统一恢复 + */ confirmModal(title, content, confirmText, confirmColor, onConfirm) { + this.confirmTitle = title || '确认' + this.confirmContent = content || '' + this.confirmText = confirmText || '确定' + this.confirmColor = confirmColor || '#e6a23c' + this.confirmAction = typeof onConfirm === 'function' ? onConfirm : null + this.confirmVisible = true this.modalBusy = true - uni.showModal({ - title: title || '确认', - content: content || '', - confirmText: confirmText || '确定', - cancelText: '返回', - confirmColor: confirmColor || '#e6a23c', - success: (res) => { - if (res.confirm && typeof onConfirm === 'function') { - onConfirm() - } - }, - complete: () => { - this.modalBusy = false - }, - }) + setScanPaused(true) + }, + + /** 关闭确认弹窗并恢复扫码;返回待执行动作(仅确认时执行) */ + closeConfirm() { + const action = this.confirmAction + this.confirmVisible = false + this.confirmAction = null + this.modalBusy = false + setScanPaused(false) + // #ifdef APP-PLUS + this.scheduleScanFocus(220) + // #endif + return action + }, + + /** 取消(点遮罩 / × / 返回):不执行动作 */ + cancelConfirm() { + this.closeConfirm() + }, + + /** 确认:先关弹窗恢复扫码,再执行业务动作(动作内部自行维护 loading) */ + acceptConfirm() { + const action = this.closeConfirm() + if (action) action() }, // ==================== 扫码捕获 ==================== @@ -1543,8 +1886,10 @@ export default { const code = String(raw.item_code ?? raw.warehouse_item_code ?? '').trim() const name = String(raw.item_name ?? raw.warehouse_item_name ?? '').trim() const spec = String(raw.sku_property ?? raw.spec ?? '').trim() + // 条码:barcodes[0] / barcode / item_barcode → 商品编码(对照仍用 code,不受影响) + const barcode = getStockBarcode(raw) || String(raw.item_barcode ?? raw.bar_code ?? '').trim() || code const qty = Number(raw.quantity ?? raw.plan_qty ?? 0) - return { code, name: name || code, spec, qty: Number.isFinite(qty) ? qty : 0 } + return { code, barcode, name: name || code, spec, qty: Number.isFinite(qty) ? qty : 0 } }, /** 拆包明细行归一化(识别命中时商品信息挂在 stock / stockWarehouse 上) */ @@ -1568,8 +1913,12 @@ export default { (raw.stockWarehouse && raw.stockWarehouse.sku_property) ?? '' ).trim() + // 条码:明细自带的 barcode(扫码原码)优先 → stock.barcodes[0] 档案条码 → 商品编码 + // (code 仍保持 item_code,供原单对照/汇总匹配用,不能替换成条码) + const detailBarcode = String(raw.barcode ?? '').trim() + const barcode = detailBarcode || getStockBarcode(raw) || code const qty = Number(raw.quantity ?? 0) - return { code, name: name || code, spec, qty: Number.isFinite(qty) ? qty : 0 } + return { code, barcode, name: name || code, spec, qty: Number.isFinite(qty) ? qty : 0 } }, /** 订单商品按商品编码索引(同编码多行合并数量) */ @@ -1583,8 +1932,9 @@ export default { if (existed) { existed.qty += item.qty if (!existed.images.length) existed.images = images + if (!existed.barcode) existed.barcode = item.barcode } else { - map.set(item.code, { name: item.name, spec: item.spec, qty: item.qty, images }) + map.set(item.code, { barcode: item.barcode, name: item.name, spec: item.spec, qty: item.qty, images }) } } return map @@ -2214,6 +2564,27 @@ export default { return (row && row.__sourceRows && row.__sourceRows[0]) || row }, + /** APP:监听软键盘高度(备注弹窗按钮在底部,需避让) */ + bindKeyboardListener() { + // #ifdef APP-PLUS + if (typeof uni.onKeyboardHeightChange === 'function') { + uni.onKeyboardHeightChange(this.handleKeyboardHeightChange) + } + // #endif + }, + + unbindKeyboardListener() { + // #ifdef APP-PLUS + if (typeof uni.offKeyboardHeightChange === 'function') { + uni.offKeyboardHeightChange(this.handleKeyboardHeightChange) + } + // #endif + }, + + handleKeyboardHeightChange(res) { + this.remarkKeyboardHeight = Math.max(0, Number((res && res.height) || 0)) + }, + openRemarkPicker(row) { const target = this.resolveDetailRow(row) if (!target || !target.id || !this.isUnpacking()) return @@ -2799,8 +3170,12 @@ export default { } .rp-btn { + /* flex 垂直居中:真机 WebView 上靠 line-height 撑满高度会文字偏上(带 1px 边框时更明显) */ + display: flex; + align-items: center; + justify-content: center; height: 0.36rem; /* 控件 36px */ - line-height: 0.36rem; + line-height: 1.2; padding: 0 0.15rem; font-size: 0.18rem; color: var(--wms-white); @@ -2833,12 +3208,12 @@ export default { background: var(--wms-text-muted); color: var(--wms-white); border: 1px solid var(--wms-text-muted); - line-height: 0.31rem; + line-height: 1.2; } .rp-btn--mini { height: 0.36rem; /* 控件 36px */ - line-height: 0.36rem; + line-height: 1.2; padding: 0 0.15rem; font-size: 0.18rem; font-weight: 600; @@ -2850,13 +3225,13 @@ export default { background: var(--wms-danger); color: var(--wms-white); border: 1px solid var(--wms-danger); - line-height: 0.31rem; + line-height: 1.2; box-shadow: 0 0.02rem 0.05rem rgba(245, 108, 108, 0.25); } .rp-btn--mini.rp-btn--plain, .rp-btn--mini.rp-btn--danger-plain { - line-height: 0.31rem; + line-height: 1.2; } .rp-btn[disabled] { @@ -3234,27 +3609,27 @@ export default { .rp-origin-name { max-width: 100%; font-size: 0.17rem; + line-height: 0.24rem; color: var(--wms-text-strong); font-weight: 600; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + /* 不省略:超宽时折行完整显示 */ + word-break: break-all; } .rp-origin-code { + max-width: 100%; font-size: 0.15rem; + line-height: 0.2rem; color: var(--wms-text-tertiary); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + word-break: break-all; } .rp-origin-spec { + max-width: 100%; font-size: 0.15rem; + line-height: 0.2rem; color: var(--wms-text-muted); - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + word-break: break-all; } .rp-origin-stats { @@ -3321,13 +3696,16 @@ export default { flex: 0 0 auto; display: flex; align-items: center; + width: 100%; padding: 0.05rem 0.05rem; border-bottom: 1px solid var(--wms-border-light); box-sizing: border-box; + /* 兜底:任何列超宽都在行内裁掉,不会把右侧操作列(备注/移除)顶出容器 */ + overflow: hidden; } .rp-detail-row > * + * { - margin-left: 0.05rem; + margin-left: 0.04rem; } .rp-detail-row:last-child { @@ -3375,13 +3753,15 @@ export default { .rp-detail-sub { display: flex; - flex-wrap: nowrap; + /* 原 nowrap:一行放不下就只能省略;改为可换行,放不下时转到下一行继续完整显示 */ + flex-wrap: wrap; align-items: center; min-width: 0; } -.rp-detail-sub > * + * { - margin-left: 0.05rem; +/* 用 margin-right 而非 margin-left:换行后行首不会多缩进 5px */ +.rp-detail-sub > * { + margin-right: 0.05rem; } .rp-detail-sub-tag { @@ -3402,24 +3782,23 @@ export default { } .rp-detail-name { + /* 不 grow:宽屏时仍与条码/规格同一行完整显示;窄屏才收缩折行 */ flex: 0 1 auto; min-width: 0; font-size: 0.17rem; + line-height: 0.24rem; color: var(--wms-text-strong); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + /* 不省略:超宽时折行完整显示 */ + word-break: break-all; } .rp-detail-code { flex: 0 1 auto; min-width: 0; - max-width: 1.47rem; font-size: 0.15rem; + line-height: 0.2rem; color: var(--wms-text-tertiary); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + word-break: break-all; } .rp-detail-code--muted { @@ -3429,12 +3808,10 @@ export default { .rp-detail-spec { flex: 0 1 auto; min-width: 0; - max-width: 1.02rem; font-size: 0.15rem; + line-height: 0.2rem; color: var(--wms-text-muted); - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; + word-break: break-all; } .rp-detail-qty { @@ -3445,9 +3822,14 @@ export default { } .rp-detail-col--qty { + /* 定宽:数量从 1 变 1000 不再撑开本列(原 flex: 0 0 auto 会被内容撑宽,挤掉右侧操作列) */ + flex: 0 0 0.95rem; + width: 0.95rem; + min-width: 0; display: flex; flex-direction: column; align-items: center; + overflow: hidden; } .rp-detail-col--qty > * + * { @@ -3457,12 +3839,16 @@ export default { .rp-row-qty { display: flex; align-items: center; + width: 100%; + max-width: 100%; border: 1px solid var(--wms-border); border-radius: 0.03rem; + box-sizing: border-box; overflow: hidden; } .rp-qty-btn--small { + flex: 0 0 0.21rem; width: 0.21rem; height: 0.36rem; /* 控件 36px */ line-height: 0.36rem; @@ -3470,14 +3856,17 @@ export default { } .rp-qty-val--small { - min-width: 0.21rem; + flex: 1 1 auto; + min-width: 0; height: 0.36rem; /* 控件 36px */ line-height: 0.36rem; font-size: 0.17rem; + text-align: center; border-left: 1px solid var(--wms-border); border-right: 1px solid var(--wms-border); box-sizing: border-box; - padding: 0 0.04rem; + padding: 0 0.02rem; + overflow: hidden; } .rp-diff { @@ -3494,14 +3883,19 @@ export default { } .rp-detail-col--status { - width: 1.28rem; + flex: 0 0 0.6rem; + width: 0.6rem; + min-width: 0; display: flex; align-items: center; justify-content: center; + overflow: hidden; } .rp-detail-col--ops { - width: 3.2rem; + flex: 0 0 2.1rem; + width: 2.1rem; + min-width: 0; display: flex; align-items: center; justify-content: center; @@ -3556,6 +3950,13 @@ export default { justify-content: center; } +/* 选择备注弹窗:整体上移(输入框在弹窗底部);软键盘弹出时再由 remarkMaskStyle 让出键盘高度 */ +.rp-popup-mask--remark { + align-items: flex-start; + padding-top: 6vh; + box-sizing: border-box; +} + .rp-popup { background: var(--wms-card-bg); border-radius: 0.07rem; @@ -3587,6 +3988,234 @@ export default { padding: 0 0.05rem; } +/* 通用确认弹窗(替代 uni.showModal):层级压在浮动预览窗(2000)之上,避免被摄像头浮窗遮挡 */ +.rp-confirm-mask { + z-index: 3000; +} + +/* 字号/行高整体加大一档(与摄像头设置弹窗一致,操作员隔屏也好认) */ +.rp-confirm-popup { + width: 6.4rem; +} + +.rp-confirm-popup .rp-popup-head { + padding: 0.1rem 0.2rem; +} + +.rp-confirm-popup .rp-popup-title { + font-size: 0.25rem; + line-height: 0.36rem; +} + +.rp-confirm-popup .rp-popup-close { + font-size: 0.3rem; + line-height: 0.36rem; + padding: 0 0.05rem; +} + +.rp-confirm-body { + padding: 0.2rem 0.2rem 0.05rem; + max-height: 4.2rem; + overflow-y: auto; +} + +.rp-confirm-text { + font-size: 0.22rem; + line-height: 0.42rem; + color: var(--wms-text-strong); + word-break: break-all; + white-space: pre-wrap; +} + +.rp-confirm-actions { + display: flex; + justify-content: flex-end; + padding: 0.15rem 0.2rem; + border-top: 1px solid var(--wms-border-light); +} + +/* 底部按钮同步放大(flex 已负责垂直居中,line-height 固定 1.2 防止真机偏上) */ +.rp-confirm-actions > .rp-btn { + min-width: 1.4rem; + height: 0.45rem; + line-height: 1.2; + padding: 0 0.2rem; + font-size: 0.22rem; + border-radius: 0.07rem; + text-align: center; +} + +/* 按钮间距:显式相邻兄弟选择器(通配符 + / gap 在真机不可靠) */ +.rp-confirm-actions > .rp-btn + .rp-btn { + margin-left: 0.12rem; +} + +.rp-confirm-ok { + color: var(--wms-white); + border: 1px solid transparent; +} + +/* ==================== 商品图片查看器 ==================== */ +/* 与复核页一致:自绘全屏预览,双击/双指/滚轮缩放(1~5 倍),放大后可拖动,多图可左右翻页 */ +.rp-imgviewer-mask { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: rgba(0, 0, 0, 0.92); + z-index: 3500; + overflow: hidden; + /* 用 flex 撑开而不是靠子元素绝对定位:真机 WebView 上更可靠 */ + display: flex; + align-items: center; + justify-content: center; +} + +.rp-imgviewer-stage { + position: relative; + flex: 1; + align-self: stretch; + width: 100%; + height: 100%; + min-height: 0; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +} + +/* 绝对定位 + 百分比:不依赖 flex 子项的百分比高度解析(旧版 WebView 上更可靠) */ +.rp-imgviewer-img { + position: absolute; + top: 5%; + left: 5%; + width: 90%; + height: 90%; + display: block; + transform-origin: center center; + -webkit-user-drag: none; + user-select: none; +} + +/* H5:内部原生 img 不响应指针事件/原生拖拽,事件统一由 uni-image 根接收 */ +.rp-imgviewer-stage img { + pointer-events: none; + -webkit-user-drag: none; + user-select: none; +} + +/* 无图 / 加载失败提示 */ +.rp-imgviewer-error { + font-size: 0.22rem; + color: rgba(255, 255, 255, 0.75); +} + +/* 底部提示:双击或双指缩放查看 */ +.rp-imgviewer-hint { + position: absolute; + bottom: 0.5rem; + left: 50%; + transform: translateX(-50%); + padding: 0.05rem 0.15rem; + font-size: 0.22rem; + color: rgba(255, 255, 255, 0.75); + background: rgba(0, 0, 0, 0.4); + border-radius: 999px; + pointer-events: none; + white-space: nowrap; +} + +/* 右上角关闭:真机字体常缺 ✕ 字形,用 CSS 画两条对角线(白底半透明保证黑底上可见) */ +.rp-imgviewer-close { + position: absolute; + top: 0.3rem; + right: 0.3rem; + width: 0.6rem; + height: 0.6rem; + background: rgba(255, 255, 255, 0.18); + border: 1px solid rgba(255, 255, 255, 0.35); + border-radius: 50%; + z-index: 2; + cursor: pointer; +} + +.rp-imgviewer-close-icon { + position: absolute; + left: 50%; + top: 50%; + width: 0.24rem; + height: 0.02rem; + background: var(--wms-white); + transform: translate(-50%, -50%) rotate(45deg); +} + +.rp-imgviewer-close-icon::after { + content: ''; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + background: var(--wms-white); + transform: rotate(90deg); +} + +/* 左右翻页(多图时显示):同样用 CSS 画箭头,不依赖 ‹ › 字符 */ +.rp-imgviewer-prev, +.rp-imgviewer-next { + position: absolute; + top: 50%; + transform: translateY(-50%); + width: 0.6rem; + height: 0.6rem; + background: rgba(255, 255, 255, 0.18); + border: 1px solid rgba(255, 255, 255, 0.35); + border-radius: 50%; + z-index: 2; + cursor: pointer; +} + +.rp-imgviewer-prev { + left: 0.3rem; +} + +.rp-imgviewer-next { + right: 0.3rem; +} + +.rp-imgviewer-arrow { + position: absolute; + left: 50%; + top: 50%; + width: 0.16rem; + height: 0.16rem; + box-sizing: border-box; + border-left: 0.03rem solid var(--wms-white); + border-bottom: 0.03rem solid var(--wms-white); + transform: translate(-50%, -50%) rotate(45deg); +} + +.rp-imgviewer-arrow--next { + transform: translate(-50%, -50%) rotate(-135deg); +} + +/* 页码 1/3 */ +.rp-imgviewer-count { + position: absolute; + top: 0.3rem; + left: 50%; + transform: translateX(-50%); + padding: 0.05rem 0.15rem; + font-size: 0.2rem; + color: rgba(255, 255, 255, 0.9); + background: rgba(0, 0, 0, 0.4); + border-radius: 999px; + z-index: 2; + pointer-events: none; + white-space: nowrap; +} + .rp-remark-options { flex: 1; min-height: 0; @@ -3609,18 +4238,7 @@ export default { word-break: break-all; } -.rp-remark-option-remove { - flex: 0 0 auto; - margin-left: 0.05rem; - width: 0.2rem; - height: 0.2rem; - line-height: 0.18rem; - text-align: center; - font-size: 0.15rem; - color: var(--wms-danger); - border: 1px solid var(--wms-danger); - border-radius: 50%; -} +/* 备注项删除按钮样式统一在 .rp-remark-popup 作用域内定义(文字按钮) */ .rp-remark-add { display: flex; @@ -3647,6 +4265,86 @@ export default { background: var(--wms-card-bg); } +/* 选择备注弹窗:整体字号/控件加大一档(与摄像头设置弹窗一致,现场隔屏也能看清) */ +.rp-remark-popup .rp-popup-head { + padding: 0.1rem 0.2rem; +} + +.rp-remark-popup .rp-popup-title { + font-size: 0.25rem; + line-height: 0.36rem; +} + +.rp-remark-popup .rp-popup-close { + font-size: 0.3rem; + line-height: 0.36rem; + padding: 0 0.05rem; +} + +.rp-remark-popup .rp-remark-options { + max-height: 3.6rem; +} + +/* 选项行加高:触屏上整行可点(应用备注),行高不足容易点错到相邻项/删除键 */ +.rp-remark-popup .rp-remark-option { + padding: 0.1rem 0.2rem; + min-height: 0.6rem; + box-sizing: border-box; +} + +.rp-remark-popup .rp-remark-option-text { + font-size: 0.22rem; + line-height: 0.34rem; +} + +/* 选项删除改为「移除」文字按钮:触屏好点、含义比 × 图标更明确 */ +.rp-remark-popup .rp-remark-option-remove { + flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: center; + height: 0.4rem; + min-width: 0.9rem; + margin-left: 0.15rem; + padding: 0 0.15rem; + font-size: 0.2rem; + color: var(--wms-danger); + background: rgba(245, 108, 108, 0.1); + border: 1px solid var(--wms-danger); + border-radius: 0.07rem; + box-sizing: border-box; + cursor: pointer; +} + +.rp-remark-popup .rp-remark-option-remove:active { + background: rgba(245, 108, 108, 0.25); +} + +.rp-remark-popup .rp-empty { + font-size: 0.2rem; + padding: 0.2rem 0; +} + +.rp-remark-popup .rp-remark-add { + /* 输入框行与弹窗底部留出更大间隔(原 0.1rem 太贴底) */ + padding: 0.1rem 0.2rem 0.25rem; +} + +.rp-remark-popup .rp-remark-draft { + height: 0.45rem; + line-height: 0.45rem; + padding: 0 0.1rem; + font-size: 0.22rem; +} + +.rp-remark-popup .rp-remark-add > .rp-btn { + height: 0.45rem; + margin-left: 0.1rem; + padding: 0 0.2rem; + font-size: 0.22rem; + border-radius: 0.07rem; +} + /* 分页 */ .rp-pagination { @@ -3680,12 +4378,12 @@ export default { } .rp-camera-popup .rp-popup-title { - font-size: 0.24rem; + font-size: 0.25rem; line-height: 0.36rem; } .rp-camera-popup .rp-popup-close { - font-size: 0.28rem; + font-size: 0.3rem; line-height: 0.36rem; } @@ -3750,13 +4448,13 @@ export default { border-top: 1px solid var(--wms-border-light); } -/* 底部按钮同步放大(覆盖 .rp-btn / .rp-btn--plain 的行高) */ +/* 底部按钮同步放大(覆盖 .rp-btn 的行高:flex 居中,不靠 line-height 撑高) */ .rp-camera-actions > .rp-btn { height: 0.46rem; - line-height: 0.46rem; - padding: 0 0.24rem; + line-height: 1.2; + padding: 0 0.2rem; font-size: 0.22rem; - border-radius: 0.08rem; + border-radius: 0.07rem; } .rp-camera-actions > .rp-btn + .rp-btn { @@ -3791,6 +4489,11 @@ export default { user-select: none; } +/* 拖拽中给抓手反馈;全屏态不可拖拽(startDrag 直接 return),见下方 cursor: default */ +.rp-float-preview:not(.rp-float-preview--full) .rp-float-header:active { + cursor: grabbing; +} + .rp-float-title { flex: 1; min-width: 0; @@ -3806,6 +4509,8 @@ export default { flex-shrink: 0; display: flex; align-items: center; + /* 工具区不支持拖拽:必须覆盖 .rp-float-header 的 move 光标(H5 鼠标会继承) */ + cursor: default; } /* 按钮间距:普通态 10px;全屏(放大)态再加大,见下方 .rp-float-preview--full 规则 */ @@ -3831,6 +4536,7 @@ export default { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; + cursor: pointer; } /* 工具按钮:28×28 点击区(原 20×20 偏小),图标全部用 CSS 画,不依赖字体/emoji */ @@ -3845,6 +4551,8 @@ export default { background: var(--wms-card-bg); border: 1px solid var(--wms-border); border-radius: 5px; + /* 点击类控件:显式 pointer,避免继承 header 的 move 光标 */ + cursor: pointer; } .rp-float-btn:active { @@ -3913,6 +4621,8 @@ export default { .rp-float-preview--full .rp-float-header { height: 40px; padding: 0 10px; + /* 全屏态禁止拖拽(startDrag 直接 return),光标不应再提示可拖动 */ + cursor: default; } .rp-float-preview--full .rp-float-tools > * + * {