10
This commit is contained in:
@@ -10,25 +10,30 @@
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log("App Launch");
|
||||
this.checkUpdate();
|
||||
this.setGlobalIMlistener();
|
||||
this.tryLogin();
|
||||
// #ifdef H5
|
||||
console.error(
|
||||
`暂时不支持运行到 Web,如果需要移动端的 Web 项目,参考 [H5 demo](https://github.com/openimsdk/openim-h5-demo)`
|
||||
);
|
||||
return ;
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
console.error(`暂时不支持运行到小程序端`);
|
||||
// #endif
|
||||
this.checkUpdate();
|
||||
this.setGlobalIMlistener();
|
||||
this.tryLogin();
|
||||
},
|
||||
onShow: function() {
|
||||
console.log("App Show");
|
||||
// #ifdef APP
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), false);
|
||||
// #endif
|
||||
},
|
||||
onHide: function() {
|
||||
console.log("App Hide");
|
||||
// #ifdef APP
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), true);
|
||||
// #endif
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
@@ -269,25 +274,15 @@
|
||||
return;
|
||||
}
|
||||
let filterArr = [];
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
const chids = data.map((ch) => ch.conversationID);
|
||||
filterArr = this.storeConversationList.filter(
|
||||
(tc) => !chids.includes(tc.conversationID)
|
||||
);
|
||||
const idx = data.findIndex(
|
||||
(c) =>
|
||||
c.conversationID === this.storeCurrentConversation.conversationID
|
||||
);
|
||||
if (idx !== -1)
|
||||
this.$store.commit(
|
||||
"conversation/SET_CURRENT_CONVERSATION",
|
||||
data[idx]
|
||||
);
|
||||
filterArr = this.storeConversationList.filter((tc) => !chids.includes(tc.conversationID));
|
||||
const idx = data.findIndex((c) =>c.conversationID === this.storeCurrentConversation.conversationID);
|
||||
if (idx !== -1){
|
||||
this.$store.commit("conversation/SET_CURRENT_CONVERSATION",data[idx]);
|
||||
}
|
||||
const result = [...data, ...filterArr];
|
||||
this.$store.commit(
|
||||
"conversation/SET_CONVERSATION_LIST",
|
||||
conversationSort(result)
|
||||
);
|
||||
this.$store.commit("conversation/SET_CONVERSATION_LIST",conversationSort(result));
|
||||
};
|
||||
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnTotalUnreadMessageCountChanged,totalUnreadCountChangedHandler);
|
||||
@@ -308,13 +303,7 @@
|
||||
this.$store.dispatch("contact/getFriendList");
|
||||
this.$store.dispatch("circle/getFriendCircleInfo");
|
||||
uni.switchTab({
|
||||
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
||||
success() {
|
||||
|
||||
// uni.navigateTo({
|
||||
// url:'/pages/workbench/friend-circle/friend-circle'
|
||||
// })
|
||||
}
|
||||
url: "/pages/conversation/conversationList/index?isRedirect=true"
|
||||
});
|
||||
};
|
||||
getDbDir()
|
||||
|
||||
Reference in New Issue
Block a user