Explorar o código

修改bug

修改bug
Sean hai 3 meses
pai
achega
843a3969f6
Modificáronse 1 ficheiros con 43 adicións e 8 borrados
  1. 43 8
      src/views/chat/hall.vue

+ 43 - 8
src/views/chat/hall.vue

@@ -101,7 +101,7 @@
         <div :class="['UserNameBox', groupId ? 'ifNotice' : '']">
           <div class="userName">{{ messageTitle }}</div>
           <img src="@/assets/chat/fi_more.png" v-if="groupId!=''" @click="openGroupSystem" class="moreIcon">
-          <div class="groupNotice" v-if="groupId!=''&&groupProfile!=''">{{groupProfile}}</div>
+          <div class="groupNotice" v-if="groupId!=''&&groupProfile!=''" @click="groupProfileWindow=true">{{groupProfile}}</div>
           <div v-if="groupId==''">
             <div class="shareCardIcon" @click="openShareCard">
               <i class="el-icon-postcard"></i>
@@ -226,7 +226,7 @@
                 </div>
               </div>
               <!--名片 对方-->
-              <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==2">
+              <div class="otherUserMessage" v-if="item.action=='recieved'&&Number(item.msg_type)==4">
                 <div class="otherUserIcon">
                   <img :src="item.receiver_avatar" v-if="item.receiver_avatar!=null&&item.receiver_avatar!=''">
                   <img src="@/assets/chat/user/admin.png" v-else>
@@ -868,7 +868,7 @@
     <el-dialog :visible.sync="editGroupNoticeWindow" title="编辑群公告" :close-on-click-modal="false" width="420px">
       <div>
         <div>
-          <el-input type="textarea" resize="none" v-model="groupProfile" placeholder="请输入"></el-input>
+          <el-input type="textarea" resize="none" v-model="editGroupProfile" placeholder="请输入" rows="10" maxlength="500"></el-input>
         </div>
         <div class="footerButtonBox">
           <el-button type="info" @click="editGroupNoticeWindow=false">取消</el-button>
@@ -878,11 +878,24 @@
     </el-dialog>
     <!--群公告弹出框 end------------------------------------------------------------>
 
+    <!--查看群公告 start------------------------------------------------------------>
+    <el-dialog :visible.sync="groupProfileWindow" title="群公告详情" :close-on-click-modal="false" width="420px">
+      <div>
+        <div class="groupProfileBox">
+          {{groupProfile}}
+        </div>
+        <div class="footerButtonBox">
+          <el-button type="info" @click="groupProfileWindow=false">关闭</el-button>
+        </div>
+      </div>
+    </el-dialog>
+    <!--查看群公告 end------------------------------------------------------------>
+
     <!--群名称弹出框 start------------------------------------------------------------>
     <el-dialog :visible.sync="editGroupNameWindow" title="编辑群名称" :close-on-click-modal="false" width="420px">
       <div>
         <div>
-          <el-input type="textarea" resize="none" v-model="messageTitle" placeholder="请输入" maxlength="20"></el-input>
+          <el-input type="textarea" resize="none" v-model="editMessageTitle" placeholder="请输入" maxlength="20"></el-input>
         </div>
         <div class="footerButtonBox">
           <el-button type="info" @click="editGroupNameWindow=false">取消</el-button>
@@ -1201,7 +1214,10 @@ export default {
       myUserId:'',//我的用户id
       tableTitleName:'聊天列表',//左侧菜单标题
       messageTitle:'',//当前的聊天名称
+      editMessageTitle:'',//正在编辑的聊天名称  
       groupProfile:'',//当前的群公告
+      editGroupProfile:'',//正在编辑的群公告
+      groupProfileWindow:false,//群公告弹出框
       listTimeOut:null,//定时器
       addFriendWindowStatus:false,//添加好友弹出框
       addform:{
@@ -1737,10 +1753,13 @@ export default {
         console.log(res)
         this.groupInfo = res.data;
         this.creatorId = res.data.creator_id;
+        this.messageTitle = res.data.group_name;
+        this.editMessageTitle = res.data.group_name;
         if(res.data.profile==null){
           this.groupProfile = "暂无群公告"
         }else{
           this.groupProfile = res.data.profile;
+          this.editGroupProfile = res.data.profile;
         }
         
       }).catch(() => {
@@ -1799,7 +1818,7 @@ export default {
     editGroupName(){
       let data = {
         group_id:this.groupId,
-        group_name:this.messageTitle//群名称
+        group_name:this.editMessageTitle//群名称
       }
       this.$store.dispatch('chat/updateGroup',data).then(res=> {
         this.$message.success('成功修改群聊名称!');
@@ -1816,7 +1835,7 @@ export default {
     editGroupNotice(){
       let data = {
         group_id:this.groupId,
-        profile:this.groupProfile//群公告
+        profile:this.editGroupProfile//群公告
       }
       this.$store.dispatch('chat/updateGroup',data).then(res=> {
         this.editGroupNoticeWindow = false;
@@ -2105,8 +2124,13 @@ export default {
     },
     addMyFriend(){
       this.$store.dispatch('chat/addFriend',this.addform).then(res=> {
-        this.$message.success(res.data)
-        this.addFriendWindowStatus = false;
+        if(res.code=='200'){
+          this.$message.success("好友申请发送成功!")
+          this.addFriendWindowStatus = false;
+        }else{
+          //this.$message.error(res.data)
+          this.$message.error(res.message)
+        }
       })
     },
     //3.3 关闭右侧详情框
@@ -2693,6 +2717,7 @@ export default {
                 .userNameText {
                   font-size: 18px;
                   font-weight: bold;
+                  width:260px;
                 }
                 .userMessageNum {
                   font-size: 12px;
@@ -2807,6 +2832,7 @@ export default {
           white-space: nowrap;
           overflow: hidden;
           text-overflow: ellipsis;
+          cursor: pointer;
         }
         .shareCardIcon {
           font-size: 24px;
@@ -4057,6 +4083,15 @@ export default {
       }
     }
   }
+  .groupProfileBox {
+    font-size: 16px;
+    color: #333;
+    min-height: 100px;
+    max-height: 300px;
+    overflow-y: auto;
+    overflow-x: hidden;
+    word-wrap: break-word;
+  }
 
 
   //表单微调 start------------------------------------------------------------>*/