Bladeren bron

修改朋友圈评论后列表不显示、点赞评论后图片视频不显示

achao 2 jaren geleden
bovenliggende
commit
12427a7857

+ 2 - 3
xiaochengxu/pages/circle/addFriendCirlce.vue

@@ -62,7 +62,7 @@
 			this.formData.circleId = options.id
 		},
 		methods: {
-			getShowType(type){debugger
+			getShowType(type){
 			console.log("文件类型",type)
 				this.mediaType = type
 			},
@@ -70,7 +70,7 @@
 				// 把服务端返回的图片地址添加到list中与组件数据同步
 				this.fileList.push(reslut)
 			},
-			submit() {debugger
+			submit() {
 				this.formData.commonId = this.userInfo.id
 				this.formData.head = this.userInfo.head
 				this.formData.nickname = this.userInfo.nickname
@@ -100,7 +100,6 @@
 
 					uni.hideLoading()
 				}).then(res => {
-					debugger
 				})
 				uni.showToast({
 					icon: "success",

+ 11 - 5
xiaochengxu/pages/circle/circle-item.vue

@@ -9,8 +9,8 @@
 						<text class="info-name" @click="toDetail(item)">{{ item.nickname }}</text>
 						<text class="info-content" @click="toDetail(item)">{{ item.content }}</text>
 						<template v-if="item.mediaType == 1">
-							<u-album v-if="item.urlList && item.urlList.length > 0" :urls="item.urlList" multipleSize="90" space='10'></u-album>
-							<u-album v-else :urls="item.urlList"></u-album>
+							<u-album v-if="item.urlList && item.urlList.length > 1" :urls="item.urlList" multipleSize="90" space='10'></u-album>
+							<u-album v-else :urls="item.urlList" singleSize='150'></u-album>
 						</template>
 						<view v-else class="video">
 								<video v-show="isShowVideo"
@@ -55,7 +55,7 @@
 					</view>
 				</view>
 			</view>
-			<view class="thumb-comment" v-if="item.circleFriendsDetailList&&(item.circleFriendsDetailList.length > 0 || item.comments.circleFriendsDetailList.length > 0)">
+			<view class="thumb-comment" v-if="(item.circleFriendsDetailList&&item.circleFriendsDetailList.length > 0)||(item.circleFriendsDetailList1&&item.circleFriendsDetailList1.length > 0)">
 				<view class="thumbs" v-if="item.circleFriendsDetailList&&item.circleFriendsDetailList.length > 0">
 					<image class="image-love thumbs-icon" src="../../static/love.png"></image>
 					<view class="thumbs-headers">
@@ -138,7 +138,13 @@ export default {
 			}
 		}
 	},
-
+watch:{
+	list:{
+		handler:async function (newVal,oldVal){
+			this.list = newVal;
+		}
+	},
+},
 	computed: {
 		...mapState(['locateInformation'])
 	},
@@ -189,7 +195,7 @@ export default {
 			this.$emit('doThumb', item);
 		},
 
-		doComment(item, comment, index) {debugger
+		doComment(item, comment, index) {
 			item.index = index;
 			this.$emit('doComment', item, comment);
 		},

+ 28 - 14
xiaochengxu/pages/circle/friendSCirlce.vue

@@ -158,6 +158,7 @@
 						}
 					}
 					this.$nextTick(() => {
+						this.$forceUpdate();
 						that.mescroll.endBySize(curPageLen, totalPage)
 					});
 					uni.hideLoading()
@@ -238,7 +239,7 @@
 							title: '点赞成功!',
 							duration: 2000
 						});
-						this.loadData()
+						that.loadData()
 					})
 				} else {
 					this.$request.baseRequest('admin.unimall.circleFriendsDetail', 'cancelLike', {
@@ -259,15 +260,17 @@
 							title: '取消成功!',
 							duration: 2000
 						});
-						this.loadData()
+						that.loadData()
 					})
 				}
 			},
 
-			doComment(item, comment) {debugger
+			doComment(item, comment) {
 				this.selectedComment = comment;
 				if(!this.selectedComment){
-					this.selectedComment.id = ''
+					this.selectedComment = {
+						id:''
+					}
 				}
 				this.selectedCircle = item;
 				if (comment != null && comment.userId == this.userInfo.id) {
@@ -280,22 +283,32 @@
 			},
 
 			async submitComment() {
-				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,
+				if(this.selectedComment.id){
+					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,
+					}
+				}else{
+					this.formData = {
+						circleFriendsId: this.selectedCircle.id,
+						commonId: this.userInfo.id,
+						head: this.userInfo.head,
+						nickname: this.userInfo.nickname,
+						commentContent:this.commentValue,
+						commentName:this.selectedComment.nickname,
+					}
 				}
 				
+				
 				this.formData.interactionFlag = 2
 				this.$request.baseRequest('admin.unimall.circleFriendsDetail', 'add', {
 					circleFriendsDetail: JSON.stringify(this.formData)
@@ -314,6 +327,7 @@
 						title: '评论成功!',
 						duration: 2000
 					});
+					this.showInput =false
 					this.loadData()
 				})
 				

+ 26 - 22
xiaochengxu/uni_modules/uview-ui/components/u-album/u-album.vue

@@ -128,19 +128,20 @@ export default {
         // 将数组划分为二维数组
         showUrls() {
             const arr = []
-            this.urls.map((item, index) => {
-                // 限制最大展示数量
-                if (index + 1 <= this.maxCount) {
-                    // 计算该元素为第几个素组内
-                    const itemIndex = Math.floor(index / this.rowCount)
-                    // 判断对应的索引是否存在
-                    if (!arr[itemIndex]) {
-                        arr[itemIndex] = []
-                    }
-                    arr[itemIndex].push(item)
-                }
-            })
-            return arr
+				this.urls.map((item, index) => {
+				    // 限制最大展示数量
+				    if (index + 1 <= this.maxCount) {
+				        // 计算该元素为第几个素组内
+				        const itemIndex = Math.floor(index / this.rowCount)
+				        // 判断对应的索引是否存在
+				        if (!arr[itemIndex]) {
+				            arr[itemIndex] = []
+				        }
+				        arr[itemIndex].push(item)
+				    }
+				})
+				return arr
+          
         },
         imageWidth() {
             return uni.$u.addUnit(
@@ -156,15 +157,18 @@ export default {
         // 因为用户在某些特殊的情况下,需要让文字与相册的宽度相等,所以这里事件的形式对外发送
         albumWidth() {
             let width = 0
-            if (this.urls.length === 1) {
-                width = this.singleWidth
-            } else {
-                width =
-                    this.showUrls[0].length * this.multipleSize +
-                    this.space * (this.showUrls[0].length - 1)
-            }
-            this.$emit('albumWidth', width)
-            return width
+			if(this.showUrls.length!=0){
+				if (this.urls.length === 1) {
+				    width = this.singleWidth
+				} else {
+				    width =
+				        this.showUrls[0].length * this.multipleSize +
+				        this.space * (this.showUrls[0].length - 1)
+				}
+				this.$emit('albumWidth', width)
+				return width
+			}
+           
         }
     },
     methods: {