From 247d582af862794392ff66175c18ef8373d856d4 Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Tue, 23 Jun 2026 16:52:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=97=A0ISBN=E4=B8=8A=E4=BC=A0=E6=97=B6?= =?UTF-8?q?=E4=B9=A6=E5=8F=B7=E8=AF=86=E5=88=AB=E4=B8=BA=E7=A9=BA=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E7=94=9F=E6=88=90678=E5=BC=80=E5=A4=B4=E7=9A=8413?= =?UTF-8?q?=E4=BD=8D=E9=9A=8F=E6=9C=BAISBN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 273f078..20a7e7f 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -2066,7 +2066,7 @@ export default { uni.showLoading({ title: '上传图片中...', mask: true }) try { const photoList = this.currentTab === 'isbn' ? this.photoList : this.noIsbnPhotoList - const typeDir = this.currentTab === 'isbn' ? (this.isbn || 'UnknownIsbn') : this.noIsbnIsbn || this.noIsbnUnifyIsbn || 'NoIsbn' + const typeDir = this.currentTab === 'isbn' ? (this.isbn || 'UnknownIsbn') : this.getNoIsbnIsbnValue() const imageUrls = await uploadImages(photoList, typeDir) console.log('【上传】MinIO图片URL列表:', imageUrls) @@ -2122,7 +2122,7 @@ export default { page_count: '0', word_count: '', book_format: '', - 'live_image[]': imageUrls.join(','), + 'live_image': imageUrls.join(','), timestamp: timestamp, sign_method: 'md5' } @@ -2170,7 +2170,7 @@ export default { // syncBook 成功后保存商品到 product 表,获取真实商品ID var syncData = respData.data || {} var bookInfoId = syncData.id || '' - var barcode = this.currentTab === 'isbn' ? (this.isbn || '') : (this.noIsbnIsbn || this.noIsbnUnifyIsbn || '') + var barcode = this.currentTab === 'isbn' ? (this.isbn || '') : this.getNoIsbnIsbnValue() var productName = this.currentTab === 'isbn' ? (this.bookName || '') : (this.noIsbnBookName || '') var appearanceValue = parseInt(this.currentTab === 'isbn' ? this.conditionValue : this.noIsbnConditionValue) || 0 var productPrice = this.currentTab === 'isbn' @@ -2254,7 +2254,7 @@ export default { client_id: 'psi', fid: '0', type: '4', - isbn: this.noIsbnIsbn || this.noIsbnUnifyIsbn || '', + isbn: this.getNoIsbnIsbnValue(), f_isbn: '0', book_name: this.noIsbnBookName || '', f_book_name: '', @@ -2266,7 +2266,7 @@ export default { page_count: '0', word_count: this.noIsbnWordCount || '', book_format: '', - 'live_image[]': imageUrls.join(','), + 'live_image': imageUrls.join(','), cat_id: JSON.stringify({ xian_yu_cat_id: '', kong_fu_zi_cat_id: (this.noIsbnCategoryPathText || '').replace(/ \/ /g, '/'), @@ -2320,7 +2320,7 @@ export default { // syncBook 成功后保存商品到 product 表,获取真实商品ID var syncData = respData.data || {} - var barcode = this.noIsbnIsbn || this.noIsbnUnifyIsbn || '' + var barcode = this.getNoIsbnIsbnValue() var productName = this.noIsbnBookName || '' var appearanceValue = parseInt(this.noIsbnConditionValue) || 0 var productPrice = this.noIsbnOriginalPrice ? String(Math.round(parseFloat(this.noIsbnOriginalPrice) * 100)) : '0' @@ -3352,6 +3352,17 @@ export default { } }, + // 无ISBN上传 - 获取ISBN值,为空时生成13位随机数(678开头) + getNoIsbnIsbnValue() { + if (this.noIsbnIsbn) return this.noIsbnIsbn + if (this.noIsbnUnifyIsbn) return this.noIsbnUnifyIsbn + var rand = '' + for (var i = 0; i < 10; i++) { + rand += Math.floor(Math.random() * 10) + } + return '678' + rand + }, + // 保存定价策略配置 savePriceConfig() { const cfg = {