From 4d1b99c033d27af5a83d8df7da5568dc3dcfbfc7 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 25 二月 2026 11:41:13 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/article-details/article-details.vue |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/mini-program/pages/article-details/article-details.vue b/mini-program/pages/article-details/article-details.vue
index 31fe3b0..58b608f 100644
--- a/mini-program/pages/article-details/article-details.vue
+++ b/mini-program/pages/article-details/article-details.vue
@@ -7,7 +7,7 @@
 		</view>
 		<view class="xian"></view>
 		<view class="pl">
-			<view class="pl-title">璇勮 {{info.commentCount || 0}}</view>
+			<view class="pl-title">璇勮 {{total}}</view>
 			<view class="pl-wu" v-if="commentList.length === 0">
 				<image src="/static/images/default_nocomment@2x.png" mode="widthFix"></image>
 			</view>
@@ -71,7 +71,7 @@
 							</view>
 						</view>
 					</view>
-					<view class="pl-more" v-if="item.childern.length > 0" @click.stop="more(item)">灞曞紑{{item.replyCount - 1}}鏉″洖澶�</view>
+					<view class="pl-more" v-if="item.childern.length < item.replyCount" @click.stop="more(index)">灞曞紑{{item.replyCount - item.childern.length}}鏉″洖澶�</view>
 				</view>
 			</view>
 		</view>
@@ -142,6 +142,7 @@
 				info: null,
 				content: '',
 				commentList: [],
+				total: 0,
 				page: 1,
 				next: true,
 				value: '',
@@ -249,19 +250,34 @@
 				this.show1 = false
 			},
 			// 灞曞紑璇勮
-			more(item) {
+			more(index) {
 				this.$u.api.findActivityReplyCommentDTOPage({
 					capacity: 10,
-					page: 1,
+					page: this.commentList[index].page,
 					model: {
 						type: 1,
-						commentId: item.id
+						commentId: this.commentList[index].id
 					}
 				}).then(res => {
 					if (res.code === 200) {
-						console.log(res)
+						this.commentList[index].page++
+						this.commentList[index].childern = this.uniqueById([
+							...this.commentList[index].childern,
+							...res.data.records
+						])
 					}
 				})
+			},
+			// 鏁扮粍鍘婚噸
+			uniqueById(arr) {
+				const map = new Map();
+				return arr.filter(item => {
+					if (!map.has(item.id)) {
+						map.set(item.id, true);
+						return true;
+					}
+					return false;
+				});
 			},
 			// 璇勮
 			sendComment() {
@@ -309,8 +325,10 @@
 					}
 				}).then(res => {
 					if (res.code === 200) {
+						this.total = res.data.total
 						res.data.records.forEach(item => {
 							item.createDate = dateConversion(item.createDate)
+							item.page = 1
 							item.childern = []
 							if (item.activityReplyCommentDTO) {
 								item.activityReplyCommentDTO.createDate = dateConversion(item.activityReplyCommentDTO.createDate)

--
Gitblit v1.9.3