...
|
...
|
@@ -288,6 +288,8 @@ |
|
|
})
|
|
|
},
|
|
|
onShow() {
|
|
|
this.notReadNumber = 0
|
|
|
this.getSysNoReadNum()
|
|
|
this.landList = []
|
|
|
uni.getLocation({
|
|
|
type: 'wgs84',
|
...
|
...
|
@@ -534,51 +536,18 @@ |
|
|
index++
|
|
|
}
|
|
|
})
|
|
|
_this.landList = landArr
|
|
|
_this.covers = coverArr
|
|
|
console.log('地图视野发生变化了',coverArr)
|
|
|
setTimeout(()=>{
|
|
|
_this.landList = landArr
|
|
|
_this.covers = coverArr
|
|
|
},200)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
/* 检查登录即时通讯 */
|
|
|
checkLoginTencent(){
|
|
|
if(!this.isLogin || !this.isSDKReady){
|
|
|
let userID = this.userinfo.id.toString()
|
|
|
let userSig = this.userinfo.user_sign
|
|
|
let userInfo = {
|
|
|
user: this.userinfo.nickname,
|
|
|
userId:this.userinfo.id,
|
|
|
img:this.userinfo.avatar,
|
|
|
userSig:this.userinfo.user_sign
|
|
|
}
|
|
|
//登录腾讯IM及时通讯
|
|
|
let promise = this.tim.login({
|
|
|
userID: userID,
|
|
|
userSig: userSig
|
|
|
});
|
|
|
promise.then((res) => {
|
|
|
console.warn('腾讯云即时通讯登录成功', res);
|
|
|
|
|
|
//登录成功后 更新登录状态
|
|
|
this.$store.commit("toggleIsLogin", true);
|
|
|
//自己平台的用户基础信息
|
|
|
uni.setStorageSync('userInfo', JSON.stringify(userInfo))
|
|
|
//tim 返回的用户信息
|
|
|
uni.setStorageSync('userTIMInfo', JSON.stringify(res.data))
|
|
|
//获取未读消息数量
|
|
|
this.getNoReadNum()
|
|
|
}).catch((err) => {
|
|
|
// 登录失败的相关信息
|
|
|
console.warn('腾讯云即时通讯登录报错', err);
|
|
|
});
|
|
|
}else{
|
|
|
this.getNoReadNum()
|
|
|
}
|
|
|
},
|
|
|
//获取未读消息数量
|
|
|
getNoReadNum(){
|
|
|
//获取系统未读消息数量
|
|
|
getSysNoReadNum(){
|
|
|
uni.request({
|
|
|
url:apiUrl+'/system_notice/notReadNumber',
|
|
|
method:'POST',
|
...
|
...
|
@@ -587,31 +556,10 @@ |
|
|
'token': uni.getStorageSync('token')
|
|
|
},
|
|
|
success: (notReadRes) => {
|
|
|
// 拉取会话列表
|
|
|
if (this.isSDKReady) {
|
|
|
// 拉取会话列表
|
|
|
let promise = this.tim.getConversationList();
|
|
|
promise.then((converRes) => {
|
|
|
let unReadCount = 0
|
|
|
let conversationList = converRes.data.conversationList; // 会话列表,用该列表覆盖原有的会话列表
|
|
|
if (conversationList.length) {
|
|
|
//将返回的会话列表拼接上 用户的基本资料
|
|
|
conversationList.forEach(item=>{
|
|
|
unReadCount = unReadCount + item.unreadCount
|
|
|
})
|
|
|
}
|
|
|
this.notReadNumber = notReadRes.data.data + unReadCount
|
|
|
}).catch((err) => {
|
|
|
this.notReadNumber = notReadRes.data.data
|
|
|
console.warn('getConversationList error:', err); // 获取会话列表失败的相关信息
|
|
|
});
|
|
|
}else{
|
|
|
this.notReadNumber = notReadRes.data.data
|
|
|
}
|
|
|
this.notReadNumber = this.notReadNumber + notReadRes.data.data
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//点击标记点
|
|
|
markertap(e){
|
|
|
let landArr = this.landList
|
...
|
...
|
|