Commit 21f4c56c authored by 华国豪's avatar 华国豪 🙄

消息排序

parent 0bc25050
...@@ -649,10 +649,10 @@ export default { ...@@ -649,10 +649,10 @@ export default {
} }
}); });
} }
item.top = false; item.top = 0;
this.TOPSESSION.forEach(x => { this.TOPSESSION.forEach(x => {
if (item.id == x) { if (item.id == x) {
item.top = true; item.top = 1;
return false; return false;
} }
}); });
...@@ -698,8 +698,16 @@ export default { ...@@ -698,8 +698,16 @@ export default {
this.newMsgList = unreadList; this.newMsgList = unreadList;
this.sessionlistHis = sessionlistHis; this.sessionlistHis = sessionlistHis;
sessionlist.sort((a, b) => b.top - a.top) let topList = [],
return sessionlist; otherList = [];
sessionlist.map(x=>{
if (x.top) {
topList.push(x)
} else {
otherList.push(x)
}
})
return [...topList, ...otherList]
} }
// netState(){ // netState(){
// return this.$store.state.isNetError // return this.$store.state.isNetError
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment