From 6f3b0a246767c9d960dd35a38043e57db67154f3 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 3 Feb 2026 15:27:02 +0800 Subject: [PATCH] 1 --- src/views/system/comment/index.vue | 34 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/views/system/comment/index.vue b/src/views/system/comment/index.vue index 5c066f2..2d865f2 100644 --- a/src/views/system/comment/index.vue +++ b/src/views/system/comment/index.vue @@ -314,6 +314,19 @@ /> + + + @@ -393,7 +406,8 @@ export default { imageList: [], // 获取评论 loading jdFetchLoading: false, - tbFetchLoading: false + tbFetchLoading: false, + statFetchLoading: false } }, computed: { @@ -467,6 +481,24 @@ export default { ...this.jdQueryParams }, `jd_comment_${new Date().getTime()}.xlsx`) }, + /** 统计信息表格:仅京东商品可点击,用该行商品ID 调用获取评论 */ + handleStatFetchComments(row) { + if (row.source !== '京东评论') return + const productId = (row.productId || '').toString().trim() + if (!productId) { + this.$modal.msgWarning('商品ID为空') + return + } + this.statFetchLoading = true + fetchComments(productId).then(() => { + this.$modal.msgSuccess('获取评论请求已发送') + this.getStatistics() + }).catch(e => { + this.$modal.msgError(e && (e.message || e.msg) || '获取评论失败') + }).finally(() => { + this.statFetchLoading = false + }) + }, /** 京东:调用获取评论接口,使用商品ID(SKU) 作为 product_id */ handleJdFetchComments() { const productId = (this.jdQueryParams.productId || '').toString().trim()