main
DESKTOP-CJ7MIKJ\Maos 2 years ago
parent def24dff27
commit 022a3d9dfd

@ -4,7 +4,7 @@
<HeadPortrait :imgUrl="personInfo.headImg"></HeadPortrait> <HeadPortrait :imgUrl="personInfo.headImg"></HeadPortrait>
<div class="info-detail"> <div class="info-detail">
<div class="name">{{ personInfo.name }}</div> <div class="name">{{ personInfo.name }}</div>
<div class="detail">{{ personInfo.lastMsg }}</div> <div class="detail">{{ personInfo.detail }}</div>
</div> </div>
</div> </div>

@ -53,26 +53,16 @@ let chatMsg1002 = Mock.mock(
headImg: require("@/assets/img/head_portrait.jpg"), headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白", name: "大毛是小白",
time: "0912 AM", time: "0912 AM",
msg: " Same here! Been working project for the past 5 hours despite ofhaving so much to do", msg: " 在吗?",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1001", //uid uid: "1001", //uid
}, },
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1001",
},
{ {
headImg: require("@/assets/img/head_portrait1.jpg"), headImg: require("@/assets/img/head_portrait1.jpg"),
name: "大毛", name: "大毛",
time: "0912 AM", time: "0912 AM",
msg: " Same here! Been working project for the past 5 hours despite ofhaving so much to do", msg: " 怎么了?",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1002", //uid uid: "1002", //uid
}, },
@ -80,7 +70,7 @@ let chatMsg1002 = Mock.mock(
headImg: require("@/assets/img/head_portrait.jpg"), headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白", name: "大毛是小白",
time: "0912 AM", time: "0912 AM",
msg: "Same here! Been working project for the past 5 hours despite ofhaving so much to do", msg: "问你个问题",
chatType: 0, //信息类型0文字1图片, 2文件 chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001", uid: "1001",
}, },
@ -88,10 +78,21 @@ let chatMsg1002 = Mock.mock(
headImg: require("@/assets/img/head_portrait1.jpg"), headImg: require("@/assets/img/head_portrait1.jpg"),
name: "大毛", name: "大毛",
time: "0912 AM", time: "0912 AM",
msg: "to do", msg: "别问",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1002", //uid uid: "1002", //uid
}, },
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1001",
},
] ]
) )
let chatMsg1003 = Mock.mock( let chatMsg1003 = Mock.mock(
@ -100,7 +101,7 @@ let chatMsg1003 = Mock.mock(
headImg: require("@/assets/img/head_portrait.jpg"), headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白", name: "大毛是小白",
time: "0912 AM", time: "0912 AM",
msg: " 的武器的物权法润滑油它具有就该回家该方法回复观后感防护服哈和规范化发同意头发o", msg: "在干嘛呢",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1001", //uid uid: "1001", //uid
}, },
@ -119,7 +120,7 @@ let chatMsg1003 = Mock.mock(
headImg: require("@/assets/img/head_portrait2.jpg"), headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛", name: "小毛",
time: "0912 AM", time: "0912 AM",
msg: " 萨达萨达哇大所多谁打我的是否如果突然核桃油还要加㔿fhaving so much to do", msg: "吃饭",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1002", //uid uid: "1002", //uid
}, },
@ -127,7 +128,7 @@ let chatMsg1003 = Mock.mock(
headImg: require("@/assets/img/head_portrait.jpg"), headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白", name: "大毛是小白",
time: "0912 AM", time: "0912 AM",
msg: "盒饭光和热挺好的返回给都发给顿肉肉人工费大概人刮大风个的个", msg: "吃的什么饭",
chatType: 0, //信息类型0文字1图片, 2文件 chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001", uid: "1001",
}, },
@ -135,15 +136,23 @@ let chatMsg1003 = Mock.mock(
headImg: require("@/assets/img/head_portrait2.jpg"), headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛", name: "小毛",
time: "0912 AM", time: "0912 AM",
msg: "frfrgrgtreg gt g fdg dfg drrg f d", msg: "蛋炒饭",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1002", //uid uid: "1002", //uid
}, },
{
headImg: require("@/assets/img/head_portrait.jpg"),
name: "大毛是小白",
time: "0912 AM",
msg: "加蛋了吗?",
chatType: 0, //信息类型0文字1图片, 2文件
uid: "1001",
},
{ {
headImg: require("@/assets/img/head_portrait2.jpg"), headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛", name: "小毛",
time: "0912 AM", time: "0912 AM",
msg: "qwewqewrr hy jy ju juyj ", msg: "你说呢",
chatType: 0, //信息类型0文字1图片 chatType: 0, //信息类型0文字1图片
uid: "1002", //uid uid: "1002", //uid
}, },
@ -151,8 +160,11 @@ let chatMsg1003 = Mock.mock(
headImg: require("@/assets/img/head_portrait2.jpg"), headImg: require("@/assets/img/head_portrait2.jpg"),
name: "小毛", name: "小毛",
time: "0912 AM", time: "0912 AM",
msg: "dada dw ertgthy j uy", msg: require("@/assets/img/emoji/slightly-smiling-face.png"),
chatType: 0, //信息类型0文字1图片 chatType: 1, //信息类型0文字1图片
extend: {
imgType: 1, //(1表情2本地图片)
},
uid: "1002", //uid uid: "1002", //uid
}, },
] ]

@ -201,6 +201,7 @@ export default {
uid: "1001", //uid uid: "1001", //uid
}; };
this.sendMsg(chatMsg); this.sendMsg(chatMsg);
this.$emit('personCardSort', this.frinedInfo.id)
this.inputMsg = ""; this.inputMsg = "";
} else { } else {
this.$message({ this.$message({

@ -24,7 +24,10 @@
<div class="chatRight"> <div class="chatRight">
<!-- <router-view></router-view> --> <!-- <router-view></router-view> -->
<div v-if="showChatWindow"> <div v-if="showChatWindow">
<ChatWindow :frinedInfo="chatWindowInfo"></ChatWindow> <ChatWindow
:frinedInfo="chatWindowInfo"
@personCardSort="personCardSort"
></ChatWindow>
</div> </div>
<div class="showIcon" v-else> <div class="showIcon" v-else>
<span class="iconfont icon-snapchat"></span> <span class="iconfont icon-snapchat"></span>
@ -67,6 +70,20 @@ export default {
this.personInfo = info; this.personInfo = info;
this.pcCurrent = info.id; this.pcCurrent = info.id;
}, },
personCardSort(id) {
if (id !== this.personList[0].id) {
console.log(id);
let nowPersonInfo;
for (let i = 0; i < this.personList.length; i++) {
if (this.personList[i].id == id) {
nowPersonInfo = this.personList[i];
this.personList.splice(i, 1);
break;
}
}
this.personList.unshift(nowPersonInfo);
}
},
}, },
}; };
</script> </script>

Loading…
Cancel
Save