Răsfoiți Sursa

Merge branch '7-28'

jwyu 2 ani în urmă
părinte
comite
8240196453
2 a modificat fișierele cu 49 adăugiri și 11 ștergeri
  1. 17 3
      components/questionComment/questionComment.vue
  2. 32 8
      pages/question/question.vue

+ 17 - 3
components/questionComment/questionComment.vue

@@ -5,9 +5,12 @@
 		<!-- 第一条评论 -->
 		<view class="first-comment" v-if="data.comment">
 			<!-- <img :src="comment_img" alt="" class="icon"> -->
-			<view class="comment">
-				{{data.comment_user_name}}:
-				{{data.comment}}
+			<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>
 		</view>	
 			
@@ -89,6 +92,17 @@
 		.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 {

+ 32 - 8
pages/question/question.vue

@@ -161,9 +161,12 @@
 			   </view>
 				<scroll-view class="comment-list-cont" v-if="comment_obj.total" scroll-y>
                <view class="comment-list-item" v-for="(item,index) in commentList" :key="item.community_question_comment_id">
-                  <view class="comment">
-                     <text style="color: #333;">{{item.user_name}}:</text>
-                     {{item.content}}
+                  <view class="flex comment">
+						<image class="avatar" :src="item.qa_avatar_url" mode="aspectFill" lazy-load="true"/>
+						<view>{{item.content}}</view>
+						  
+                     <!-- <text style="color: #333;">{{item.user_name}}:</text>
+                     {{item.content}} -->
                   </view>
                   <view class="del" v-if="select_comment_type === 2"  @click="delCommentHandle(item,index)">删除该评论</view>
                </view>
@@ -181,7 +184,6 @@
                   :show-confirm-bar="false"
                   :cursor-spacing="20"
                   class="write-ipt"
-                  @focus="checkNickHandle"
                   @blur="setWritePosition(50)"
                />
 				  <view class="confirm-btn" @click="publishMessageHandle">发布</view>
@@ -436,8 +438,13 @@ export default {
          console.log(val)
          this.writeBottom = val < 50 ? 50 : val;
       },
+	  
       
       /* 校验昵称状态*/
+	  /**
+	   * 此方法不在调用(但是还是留着吧 万一哪天又要用呢)
+	   * 改版不用再校验是否设置过昵称,老板说要和报告不一样并且要好玩,所以改成随机生成的头像昵称(当然是后端去生成) 
+	   */
       async checkNickHandle(e) {
          this.setWritePosition(e.detail.height);
          
@@ -723,10 +730,27 @@ page {
       position: relative;
       padding: 30rpx 0;
       .comment-list-item {
-				margin-bottom: 30rpx;
-				padding: 0 24rpx;
-				.comment { color: #666; }
-				.del { color: #D80000;margin-top: 10rpx;width: 200rpx; }
+			margin-bottom: 30rpx;
+			padding: 0 24rpx;
+			.comment { 
+				color: #666; 
+				.avatar{
+					width: 56rpx;
+					height: 56rpx;
+					border-radius: 50%;
+					flex-shrink: 0;
+					margin-right: 20rpx;
+				}
+				view{
+					flex: 1;
+				}
+			}
+			.del { 
+				color: #D80000;
+				margin-top: 10rpx;
+				margin-left: 76rpx;
+				width: 200rpx; 
+			}
       }
    }
    .write-wrap {