From 1cbab3f2483a31f54a937a5f44fdaa54e72d9aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=92?= Date: Mon, 3 Nov 2025 20:02:57 +0800 Subject: [PATCH] 1 --- src/views/system/giftcoupon/batch.vue | 41 +++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/views/system/giftcoupon/batch.vue b/src/views/system/giftcoupon/batch.vue index 51c3728..5de93cd 100644 --- a/src/views/system/giftcoupon/batch.vue +++ b/src/views/system/giftcoupon/batch.vue @@ -54,11 +54,23 @@ - - - -
默认20张
-
+ + + +
@@ -192,16 +204,14 @@ export default { materialUrl: '', skuName: '', owner: 'g', - amount: 1.0, // 默认1元 - quantity: 1, // 默认每个礼金数量为1 - batchSize: 20, // 默认批量创建20张 + amount: 1.8, // 默认1元 + quantity: 12, // 默认每个礼金数量为1 queryResult: null // 保存查询到的商品信息 }, rules: { materialUrl: [{ required: true, message: '请输入商品链接或SKU', trigger: 'blur' }], amount: [{ required: true, message: '请输入礼金金额', trigger: 'blur' }], - quantity: [{ required: true, message: '请输入礼金数量', trigger: 'blur' }], - batchSize: [{ required: true, message: '请输入批量创建数量', trigger: 'blur' }] + quantity: [{ required: true, message: '请输入礼金数量', trigger: 'blur' }] }, queryLoading: false, processing: false, @@ -313,7 +323,7 @@ export default { } if (this.detectedUrls.length === 0) { - this.$modal.msgWarning('文本中未找到URL,无需替换') + this.$modal.msgWarning('文本中未找到URL,无需替换。请在文本框中输入包含京东商品链接的内容。') return } @@ -325,10 +335,10 @@ export default { // 确认操作 try { await this.$confirm( - `检测到 ${this.detectedUrls.length} 个URL,将批量创建 ${this.detectedUrls.length} 张 ${this.form.amount} 元礼金券并替换URL。是否继续?`, - '确认操作', + `检测到 ${this.detectedUrls.length} 个商品URL,将批量创建 ${this.detectedUrls.length} 张 ${this.form.amount} 元礼金券并自动替换文本中的URL为包含礼金的推广链接。是否继续?`, + '确认批量创建', { - confirmButtonText: '确定', + confirmButtonText: '确定创建', cancelButtonText: '取消', type: 'warning' } @@ -346,11 +356,12 @@ export default { try { // 构建请求参数 + // 注意:batchSize 会自动根据文本中解析出的URL数量设置 const params = { content: this.content, amount: this.form.amount, quantity: this.form.quantity, - batchSize: this.detectedUrls.length, // 根据检测到的URL数量自动设置 + // batchSize 会在后端根据content中解析出的URL数量自动计算,这里不需要传 owner: this.form.owner || 'g', skuName: this.form.skuName || '' }