From 0c4937816f21dc9dad1856f40bbb4811136224a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8D=92?= Date: Fri, 7 Nov 2025 15:52:34 +0800 Subject: [PATCH] 1 --- src/views/system/giftcoupon/batch.vue | 77 ++++++++++++++++++++------- 1 file changed, 58 insertions(+), 19 deletions(-) diff --git a/src/views/system/giftcoupon/batch.vue b/src/views/system/giftcoupon/batch.vue index 9a3324a..77200a9 100644 --- a/src/views/system/giftcoupon/batch.vue +++ b/src/views/system/giftcoupon/batch.vue @@ -155,18 +155,20 @@ @@ -175,23 +177,44 @@ - 文本内容 + + + 文本内容 + + 已检测到 {{ detectedUrls.length }} 个URL + + + +
+ + 已选择 {{ selectedProducts.length }} 个商品,现在请粘贴您的推广文案(包含京东链接) +
-
- - 系统会自动识别文本中的京东链接(包括 https://item.jd.com、u.jd.com 等格式),并批量创建对应数量的礼金券进行替换 +
+ + 直接粘贴完整文案即可!支持识别 https://item.jd.com、https://u.jd.com、u.jd.com 等所有京东链接格式
-
- 已识别URL数量: {{ detectedUrls.length }} - - 批量创建并替换 +
+ + 已识别URL数量: {{ detectedUrls.length }} + + + 批量创建并替换 ({{ detectedUrls.length }}个)
@@ -387,9 +410,18 @@ export default { // 默认全选所有商品 this.$nextTick(() => { this.selectAllProducts() + // 如果只有一个商品,自动滚动到文本输入区域 + if (products.length === 1) { + setTimeout(() => { + window.scrollTo({ top: document.body.scrollHeight, behavior: 'smooth' }) + }, 300) + } }) - this.$modal.msgSuccess(`查询成功,找到 ${products.length} 个商品,已默认全选`) + this.$modal.msgSuccess({ + message: `✅ 查询成功!找到 ${products.length} 个商品,已默认全选。现在请在下方"输入文本"框中粘贴您的推广文案。`, + duration: 5000 + }) } else { this.$modal.msgWarning('未找到商品信息,请检查链接是否正确') } @@ -699,11 +731,18 @@ export default { } }, + /** 文本框获得焦点 */ + handleTextareaFocus() { + if (this.selectedProducts.length === 0) { + this.$modal.msgWarning('请先查询商品并选择要推广的商品') + } + }, + /** 复制到剪贴板 */ copyToClipboard(text) { if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(text).then(() => { - this.$modal.msgSuccess('复制成功') + this.$modal.msgSuccess('✅ 复制成功!可以直接发送给用户了') }).catch(() => { this.fallbackCopyToClipboard(text) })