Browse Source

问答评论修改

jwyu 2 years ago
parent
commit
aba2724ef9
1 changed files with 29 additions and 17 deletions
  1. 29 17
      components/questionComment/questionComment.vue

+ 29 - 17
components/questionComment/questionComment.vue

@@ -3,14 +3,13 @@
 <template>
 <template>
 	<view class="question-comment-box">
 	<view class="question-comment-box">
 		<!-- 第一条评论 -->
 		<!-- 第一条评论 -->
-		<view class="first-comment" v-if="data.comment">
+		<view class="first-comment" v-if="data.comment_list.length>0">
 			<!-- <img :src="comment_img" alt="" class="icon"> -->
 			<!-- <img :src="comment_img" alt="" class="icon"> -->
-			<view class="flex comment">
-				<image class="avatar" :src="data.qa_avatar_url" mode="aspectFill" lazy-load="true"/>
-				<view>{{data.comment}}</view>
-				  
-				<!-- {{data.comment_user_name}}:
-				{{data.comment}} -->
+			<view class="comment">
+				<template v-for="(item,index) in data.comment_list">
+					<image class="avatar" :src="item.qa_avatar_url" mode="aspectFill" lazy-load="false" :key="index"/>
+					<text :key="index">{{item.comment}}</text>
+				</template>
 			</view>
 			</view>
 		</view>	
 		</view>	
 			
 			
@@ -87,22 +86,35 @@
    padding: 10rpx;
    padding: 10rpx;
 	.comment {
 	.comment {
 		color: #666;
 		color: #666;
-		display: flex;
-		flex-wrap: wrap;
-		.commenter {
-			color: #000;
-		}
+		font-size: 28rpx;
 		.avatar{
 		.avatar{
 			width: 56rpx;
 			width: 56rpx;
 			height: 56rpx;
 			height: 56rpx;
-			margin-right: 20rpx;
-			flex-shrink: 0;
 			border-radius: 50%;
 			border-radius: 50%;
+			margin-right: 14rpx;
+			vertical-align: middle;
 		}
 		}
-		view{
-			flex: 1;
-			position: relative;
+		text{
+			vertical-align: middle;
+			line-height: 56rpx;
+			margin-right: 20rpx;
 		}
 		}
+		// display: flex;
+		// flex-wrap: wrap;
+		// .commenter {
+		// 	color: #000;
+		// }
+		// .avatar{
+		// 	width: 56rpx;
+		// 	height: 56rpx;
+		// 	margin-right: 20rpx;
+		// 	flex-shrink: 0;
+		// 	border-radius: 50%;
+		// }
+		// view{
+		// 	flex: 1;
+		// 	position: relative;
+		// }
 	}
 	}
 }
 }
 .question-comment-wrapper {
 .question-comment-wrapper {