浏览代码

Merge branch '7-28'

jwyu 2 年之前
父节点
当前提交
ad3835b23e
共有 1 个文件被更改,包括 30 次插入11 次删除
  1. 30 11
      src/components/QuestionComment.vue

+ 30 - 11
src/components/QuestionComment.vue

@@ -111,13 +111,17 @@ const publishMessageHandle = async() => {
 /* 删除留言 */
 const delCommentHandle = ({community_question_comment_id},index) => {
     const { commentInfo } = dataInfo.value
-    ElMessageBox.confirm(
-        "评论删除后不可恢复,确认删除吗?",
-        '提示',
-        {
-            type: 'warning',
-        }
-    ).then( async()=>{
+    ElMessageBox({
+        title:`温馨提醒`,
+        message:'评论删除后不可恢复,确认删除吗?',
+        center: true,
+        dangerouslyUseHTMLString: true,
+        confirmButtonText:'确定',
+        confirmButtonClass:'self-elmessage-confirm-btn',
+        showCancelButton:true,
+        cancelButtonText:'取消',
+        cancelButtonClass:'self-elmessage-cancel-btn'
+    }).then( async()=>{
         const { code } = await $api.apiDelComment({ community_question_comment_id });
         if( code !== 200 ) return
         
@@ -166,7 +170,6 @@ const delCommentHandle = ({community_question_comment_id},index) => {
                 type="textarea"
                 placeholder="发布一条友善的评论"
                 class="write-ipt"
-                @focus="checkNickHandle"
             />
             <div class="btn-bottom">
                 <el-button type="" link style="font-size: 16px;" @click="closeComment">取消发布</el-button>
@@ -188,9 +191,11 @@ const delCommentHandle = ({community_question_comment_id},index) => {
             </ul>
             <ul class="list-ul" v-if="dataInfo.commentInfo.commentList.length">
                 <li class="list-item" v-for="(item,index) in dataInfo.commentInfo.commentList" :key="item.community_question_comment_id">
-                    <div>
-                        <span style="color: #333">{{item.user_name}}:</span>
-                        {{item.content}}
+                    <div class="flex">
+                        <img class="avatar" :src="item.qa_avatar_url" alt="">
+                        <div>{{item.content}}</div>
+                        <!-- <span style="color: #333">{{item.user_name}}:</span>
+                        {{item.content}} -->
                     </div>
                     <div class="del" v-if="dataInfo.commentInfo.default_type===2" @click="delCommentHandle(item,index)">删除</div>
                 </li>
@@ -265,11 +270,25 @@ const delCommentHandle = ({community_question_comment_id},index) => {
             overflow-y: auto;
             .list-item {
                 margin-bottom: 20px;
+                .flex{
+                    .avatar{
+                        width: 28px;
+                        height: 28px;
+                        border-radius: 50%;
+                        flex-shrink: 0;
+                        margin-right: 10px;
+                        object-fit: cover;
+                    }
+                    div{
+                        flex: 1;
+                    }
+                }
             }
             .del {
                 color: #f00;
                 margin-top: 10px;
                 cursor: pointer;
+                margin-left: 38px;
             }
         }
     }