From dfbd59bb7af87d95f758ab8d8ffe34e200151e36 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期六, 28 二月 2026 15:15:49 +0800
Subject: [PATCH] 经销商管理

---
 mini-program/pages/article-details/article-details.vue |   99 +++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 82 insertions(+), 17 deletions(-)

diff --git a/mini-program/pages/article-details/article-details.vue b/mini-program/pages/article-details/article-details.vue
index b87b75a..dfca6ce 100644
--- a/mini-program/pages/article-details/article-details.vue
+++ b/mini-program/pages/article-details/article-details.vue
@@ -7,11 +7,11 @@
 		</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>
-			<view class="pl-item" v-for="(item, index) in commentList" :key="item.id" v-else @click="openTwo(item.id, item)">
+			<view class="pl-item" v-for="(item, index) in commentList" :key="item.id" v-else>
 				<view class="pl-item-tx">
 					<image :src="item.memberImgUrl" mode="widthFix"></image>
 				</view>
@@ -28,19 +28,30 @@
 						<view style="width: 132rpx; height: 0;"></view>
 					</view>
 					<view class="pl-item-info-data">
-						<view class="pl-item-info-data-time">{{$u.timeFormat(new Date(item.createDate).getTime())}}</view>
+						<view class="pl-item-info-data-time">{{item.createDate  }}</view>
 						<view class="pl-item-info-data-list">
-							<view class="pl-item-info-data-list-item" @click="sendChild(item.id, index)">
-								<image src="/static/icon/ic_reply2@2x.png" mode="widthFix"></image>
+							<view class="pl-item-info-data-list-item"  >
+								<button open-type="getPhoneNumber" style="border:none;" plain="true" @getphonenumber="getphonenumber" v-if="!userInfo ||!userInfo.id">
+									 <image  v-if="!userInfo ||!userInfo.id" src="/static/icon/ic_reply2@2x.png" mode="widthFix" ></image>
+								</button>
+								<image v-if="userInfo && userInfo.id" src="/static/icon/ic_reply2@2x.png" mode="widthFix"  @click="openTwo(item.id, item)"></image>
 							</view>
-							<view class="pl-item-info-data-list-item" @click.stop="dianzanpl(item)">
-								<image src="/static/icon/dianzan.png" mode="widthFix" v-if="!item.zanStatus || item.zanStatus == 0"></image>
-								<image src="/static/icon/detail_ic_zan_sel@2x.png" mode="widthFix" v-else></image>
-								<text :style="{color: (!item.zanStatus || item.zanStatus == 0) ? '#AAAAAA' : '#004096'}">{{item.zanCount}}</text>
+							<view class="pl-item-info-data-list-item" >
+								<template  v-if="userInfo && userInfo.id" >
+									<image src="/static/icon/dianzan.png" mode="widthFix" v-if="!item.zanStatus || item.zanStatus == 0"  @click.stop="dianzanpl(item)"></image>
+									<image src="/static/icon/detail_ic_zan_sel@2x.png" mode="widthFix" v-else  @click.stop="dianzanpl(item)"></image>
+									<text :style="{color: (!item.zanStatus || item.zanStatus == 0) ? '#AAAAAA' : '#004096'}"  @click.stop="dianzanpl(item)">{{item.zanCount}}</text>
+								</template>
+								<template  v-else>
+									<button open-type="getPhoneNumber" style="border:none;" plain="true" @getphonenumber="getphonenumber" v-if="!userInfo ||!userInfo.id">
+										<image src="/static/icon/dianzan.png" mode="widthFix"  ></image>
+										<text :style="{color: (!item.zanStatus || item.zanStatus == 0) ? '#AAAAAA' : '#004096'}"  >{{item.zanCount}}</text>
+									</button>
+								</template>
 							</view>
 						</view>
 					</view>
-					<view class="pl-item" style="border: none;" v-for="(child, a) in item.childern" :key="child.id" @click="openTwo(item.id, child)">
+					<view class="pl-item" style="border: none;" v-for="(child, a) in item.childern" :key="child.id" >
 						<view class="pl-item-tx">
 							<image :src="child.memberImgUrl" mode="widthFix"></image>
 						</view>
@@ -59,7 +70,7 @@
 							<view class="pl-item-info-data">
 								<view class="pl-item-info-data-time">{{child.createDate}}</view>
 								<view class="pl-item-info-data-list">
-									<view class="pl-item-info-data-list-item">
+									<view class="pl-item-info-data-list-item" @click="openTwo(item.id, child)">
 										<image src="/static/icon/ic_reply2@2x.png" mode="widthFix"></image>
 									</view>
 									<view class="pl-item-info-data-list-item" @click.stop="dianzanpl(child)">
@@ -71,7 +82,7 @@
 							</view>
 						</view>
 					</view>
-					<view class="pl-more" v-if="item.childern.length > 0">灞曞紑2鏉″洖澶�</view>
+					<view class="pl-more" v-if="item.childern&&item.childern.length < item.replyCount" @click.stop="moreReply(index)">灞曞紑{{item.replyCount - item.childern.length}}鏉″洖澶�</view>
 				</view>
 			</view>
 		</view>
@@ -132,7 +143,7 @@
 	import { dateConversion } from '@/utils/utils.js'
 	export default {
 		computed: {
-			...mapState(['userInfo', 'token'])
+			...mapState(['userInfo', 'token','recshopid','recuserid'])
 		},
 		data() {
 			return {
@@ -142,6 +153,7 @@
 				info: null,
 				content: '',
 				commentList: [],
+				total: 0,
 				page: 1,
 				next: true,
 				value: '',
@@ -164,6 +176,24 @@
 			}
 		},
 		methods: {
+			// 鎺堟潈鎵嬫満鍙�
+			getphonenumber(e) {
+				if (e.detail.errMsg === 'getPhoneNumber:ok') {
+					this.$u.api.wxPhone({
+						code: e.detail.code,
+						shopId:this.recshopid,
+						recId:this.recuserid,
+						openid: this.openid
+					}).then(res => {
+						if (res.code === 200) {
+							this.$store.commit('setUserInfo', res.data.member)
+							this.$store.commit('setToken', res.data.token)
+							 this.$store.commit('setRecShopId','')
+							 this.$store.commit('setRecUserId','')
+						}
+					})
+				}
+			},
 			// 鐐硅禐
 			dianzanpl(item) {
 				if (!item.zanStatus || item.zanStatus == 0) {
@@ -248,6 +278,36 @@
 				this.multifileList = []
 				this.show1 = false
 			},
+			// 灞曞紑璇勮
+			moreReply(index) {
+				this.$u.api.findActivityReplyCommentDTOPage({
+					capacity: 10,
+					page: this.commentList[index].page,
+					model: {
+						type: 1,
+						commentId: this.commentList[index].id
+					}
+				}).then(res => {
+					if (res.code === 200) {
+						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() {
 				if (!this.value && this.multifileList.length === 0) return uni.showToast({
@@ -258,7 +318,7 @@
 					activityId: this.info.id,
 					content: this.value,
 					multifileList: this.multifileList,
-					commentId: this.commentId,
+					// commentId: this.commentId,
 					replyId: this.item ? this.item.id : null
 				}).then(res => {
 					if (res.code === 200) {
@@ -268,15 +328,17 @@
 						if (this.commentId) {
 							this.commentList.forEach(item => {
 								if (item.id === this.commentId) {
-									item.commentList.childern.unshift(res.data)
+									item.childern = item.childern||[]
+									item.childern.unshift(res.data)
 								}
 							})
 						} else {
+							this.commentList = this.commentList||[]
 							this.commentList.unshift(res.data)
 						}
 						this.multifileList = []
 						this.value = ''
-						this.show1 = false
+						this.closePush()
 					}
 				})
 			},
@@ -294,8 +356,10 @@
 					}
 				}).then(res => {
 					if (res.code === 200) {
+						this.total = res.data.total
 						res.data.records.forEach(item => {
-							item.createDate = dateConversion(item.createDate)
+							// item.createDate = dateConversion(item.createDate)
+							item.page = 1
 							item.childern = []
 							if (item.activityReplyCommentDTO) {
 								item.activityReplyCommentDTO.createDate = dateConversion(item.activityReplyCommentDTO.createDate)
@@ -591,6 +655,7 @@
 						font-weight: 400;
 						font-size: 28rpx;
 						color: #333333;
+						word-break: break-word;
 						margin-top: 16rpx;
 					}
 					.pl-item-info-list {

--
Gitblit v1.9.3