From 4b62361f37195a56f62c17f55def389a59a2754c Mon Sep 17 00:00:00 2001 From: ShenQiLun <97694732@qq.com> Date: Mon, 29 Jun 2026 11:24:50 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=BE=85=E5=85=A5=E5=BA=93=E5=95=86?= =?UTF-8?q?=E5=93=81=E6=8C=81=E4=B9=85=E5=8C=96=E5=88=B0localStorage,?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=A1=B5=E9=9D=A2=E5=90=8E=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 41b9d1b..a53ee13 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -1297,6 +1297,13 @@ export default { // 页面显示时处理连拍返回的照片 onShow() { + // 恢复待入库商品列表 + var savedList = uni.getStorageSync('pendingProductList') || [] + if (savedList.length > 0) { + this.pendingProductList = savedList + this.pendingCount = savedList.length + } + if (this.capturedPhotoList && this.capturedPhotoList.length > 0) { var photos = this.capturedPhotoList var targetTab = this.capturedPhotoTab || 'no-isbn' @@ -2240,6 +2247,7 @@ export default { } this.pendingProductList.push(entry) this.pendingCount = this.pendingProductList.length + uni.setStorageSync('pendingProductList', this.pendingProductList) // 创建/追加波次 await this.appendWaveItem(warehouseData, productId, this.stock ?? '1', salePrice) if (this.pendingCount >= 200) { @@ -2400,11 +2408,12 @@ export default { stock: this.noIsbnStock ?? '1', warehouseData: this.noIsbnWarehouseData } - this.pendingProductList.push(entry) - this.pendingCount = this.pendingProductList.length - // 创建/追加波次 - await this.appendWaveItem(this.noIsbnWarehouseData, productId, this.noIsbnStock ?? '1', salePrice) - if (this.pendingCount >= 200) { + this.pendingProductList.push(entry) + this.pendingCount = this.pendingProductList.length + uni.setStorageSync('pendingProductList', this.pendingProductList) + // 创建/追加波次 + await this.appendWaveItem(this.noIsbnWarehouseData, productId, this.noIsbnStock ?? '1', salePrice) + if (this.pendingCount >= 200) { uni.showToast({ title: '本波次已满200件,请先提交入库', icon: 'none', duration: 2000 }) } } else { @@ -2702,6 +2711,7 @@ export default { this.marketData = { onSale: 0, old: 0, new: 0, sold: 0 } this.noIsbnProductList = [] this.noIsbnMarketData = { onSale: 0, old: 0, new: 0, sold: 0 } + uni.removeStorageSync('pendingProductList') uni.removeStorageSync('reuseWaveNo') uni.removeStorageSync('reuseWaveId') uni.removeStorageSync('reuseOrderId')