作者 xuqiang

提交

... ... @@ -37,8 +37,8 @@ export default {
//显示播放器并播放播放器
this.playState = !this.playState
}
},
mounted() {
}
/* mounted() {
//捕获侧滑菜单的遮盖行为,隐藏video
uni.$on('slideMenuShow',e=>{
console.log('捕获事件:'+e)
... ... @@ -47,7 +47,7 @@ export default {
this.playState = false
}
})
}
} */
};
</script>
<style>
... ...
... ... @@ -44,20 +44,6 @@ Vue.prototype.$request=function(url,data='',type = 1){
if(res.data.code==1){
reslove(res.data)
}
if(res.data.tcode == 2){
uni.setStorageSync('token',res.data.token)
uni.request({
url:this.apiUrl+url,
method:"POST",
header: {
'token': uni.getStorageSync('token')
},
data:data,
success:(res)=>{
reslove(res.data)
}
})
}
if(res.data.code == 401){
uni.setStorageSync("token",'')
uni.reLaunch({
... ...
... ... @@ -136,7 +136,7 @@
keyword:'',
type:'',//类型:1=最新(报名中)2=往期(报名结束)3=推荐
page:1,
per_page:15,
per_page:10,
sort:'0',//排序:0=最新,1=最热 默认为0
article_cate_id:'',
province:'',
... ...
... ... @@ -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
... ...
... ... @@ -7,8 +7,8 @@
</view>
<view class="newsNum" @click="newsClick">
<image style="width: 62rpx;height: 54rpx;" src="../../static/image/news.png" mode=""></image>
<view class="num" v-if="noReadNum != 0">
{{noReadNum}}
<view class="num" v-if="notReadNumber != 0">
{{notReadNumber}}
</view>
</view>
<view class="searchWrap">
... ... @@ -293,8 +293,6 @@
let unReadCount = 0
let conversationList = converRes.data.conversationList; // 会话列表,用该列表覆盖原有的会话列表
if (conversationList.length) {
//将返回的会话列表拼接上 用户的基本资料
console.log('4444444444444444',conversationList)
conversationList.forEach(item=>{
unReadCount = unReadCount + item.unreadCount
})
... ...