فهرست منبع

添加朋友圈

achao 2 سال پیش
والد
کامیت
dee52be870
2فایلهای تغییر یافته به همراه67 افزوده شده و 31 حذف شده
  1. 10 10
      xiaochengxu/pages/circle/circle-item.vue
  2. 57 21
      xiaochengxu/pages/circle/friendSCirlce.vue

+ 10 - 10
xiaochengxu/pages/circle/circle-item.vue

@@ -68,30 +68,30 @@
 						<text class="thumbs-headers-img thumbs-headers-more" v-if="item.circleFriendsDetailList.length > 20">等</text>
 					</view>
 				</view>
-			<!-- 	<view class="comments" v-if="item.comments.records.length > 0">
+				<view class="comments" v-if="item.circleFriendsDetailList1&&item.circleFriendsDetailList1.length > 0">
 					<image class="image-comment comments-icon" src="../../static/comment.png"></image>
 					<view class="comments-headers">
-						<view class="comments-headers-item" v-for="(item3, index3) in item.comments.records" :key="index3">
+						<view class="comments-headers-item" v-for="(item3, index3) in item.circleFriendsDetailList1" :key="index3">
 							<view class="item-left">
-								<u-avatar :src="item3.userAvatar" shape="square" size="32" @click="onJump('/pages/friends/friendInfo?friendId=' + item3.userId)"></u-avatar>
+								<u-avatar :src="item3.head" shape="square" size="32"></u-avatar>
 							</view>
 							<view class="item-right">
 								<view class="item-right-name">
-									<text class="item-right-name-top">{{ item3.userName }}</text>
-									<text class="item-right-name-bottom">{{ item3.createTime }}</text>
+									<text class="item-right-name-top">{{ item3.nickname }}</text>
+									<text class="item-right-name-bottom">{{$u.timeFrom(new Date(item3.gmtCreate).getTime(),'yyyy年mm月dd日')}}</text>
 								</view>
 								<view class="comment-content">
-									<view class="comment-response" v-if="item3.comUserName">
+									<view class="comment-response" v-if="item3.commentName">
 										<text class="comment-response-txt">回复</text>
-										<text class="comment-response-name">{{ item3.comUserName }}</text>
+										<text class="comment-response-name">{{ item3.commentName }}</text>
 										<text class="comment-response-txt">:</text>
 									</view>
-									<text class="item-right-info" @click="doComment(item, item3, index)">{{ item3.comment }}</text>
+									<text class="item-right-info" @click="doComment(item, item3, index)">{{ item3.commentContent }}</text>
 								</view>
 							</view>
 						</view>
 					</view>
-				</view> -->
+				</view>
 			</view>
 			<u-line></u-line>
 		</view>
@@ -189,7 +189,7 @@ export default {
 			this.$emit('doThumb', item);
 		},
 
-		doComment(item, comment, index) {
+		doComment(item, comment, index) {debugger
 			item.index = index;
 			this.$emit('doComment', item, comment);
 		},

+ 57 - 21
xiaochengxu/pages/circle/friendSCirlce.vue

@@ -264,8 +264,11 @@
 				}
 			},
 
-			doComment(item, comment) {
+			doComment(item, comment) {debugger
 				this.selectedComment = comment;
+				if(!this.selectedComment){
+					this.selectedComment.id = ''
+				}
 				this.selectedCircle = item;
 				if (comment != null && comment.userId == this.userInfo.id) {
 					this.show2 = true;
@@ -277,27 +280,60 @@
 			},
 
 			async submitComment() {
-				if (!this.commentValue) {
-					uni.$u.toast('请输入内容');
-					return;
-				}
-				let params = {
-					comment: this.commentValue,
-					circleId: this.selectedCircle.id,
-					circleUserId: this.selectedCircle.userId
-				};
-				if (this.selectedComment) {
-					let tmp = {
-						pid: this.selectedComment.id,
-						comUserId: this.selectedComment.userId
-					};
-					params = uni.$u.deepMerge(params, tmp);
-				}
-				let res = await addComment(params);
-				if (res) {
-					uni.$u.toast('评论成功');
-					this.getCircleDetail(this.selectedCircle.id, this.selectedCircle.index);
+				debugger
+				// if (!this.commentValue) {
+				// 	uni.$u.toast('请输入内容');
+				// 	return;
+				// }
+				
+				this.formData = {
+					circleFriendsId: this.selectedCircle.id,
+					commonId: this.userInfo.id,
+					head: this.userInfo.head,
+					nickname: this.userInfo.nickname,
+					commentContent:this.commentValue,
+					commentId:this.selectedComment.id,
+					commentName:this.selectedComment.nickname,
 				}
+				
+				this.formData.interactionFlag = 2
+				this.$request.baseRequest('admin.unimall.circleFriendsDetail', 'add', {
+					circleFriendsDetail: JSON.stringify(this.formData)
+				}, failres => {
+					console.log('res+++++', failres.errmsg)
+					uni.showToast({
+						icon: "none",
+						title: failres.errmsg,
+						duration: 3000
+					});
+					uni.hideLoading()
+				}).then(async res => {
+					console.log(res)
+					uni.showToast({
+						icon: "success",
+						title: '评论成功!',
+						duration: 2000
+					});
+					this.loadData()
+				})
+				
+				// let params = {
+				// 	comment: this.commentValue,
+				// 	circleId: this.selectedCircle.id,
+				// 	circleUserId: this.selectedCircle.userId
+				// };
+				// if (this.selectedComment) {
+				// 	let tmp = {
+				// 		pid: this.selectedComment.id,
+				// 		comUserId: this.selectedComment.userId
+				// 	};
+				// 	params = uni.$u.deepMerge(params, tmp);
+				// }
+				// let res = await addComment(params);
+				// if (res) {
+				// 	uni.$u.toast('评论成功');
+				// 	this.getCircleDetail(this.selectedCircle.id, this.selectedCircle.index);
+				// }
 			},
 
 			sheetSelect(val) {