|
|
|
|
@ -54,6 +54,10 @@
|
|
|
|
|
<uni-popup ref="message" type="message">
|
|
|
|
|
<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
|
|
|
|
|
</uni-popup>
|
|
|
|
|
|
|
|
|
|
<!-- 是否登录 -->
|
|
|
|
|
<openlogin ref="loginId" @getPhoneNumber="getPhoneNumber"></openlogin>
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -61,11 +65,16 @@
|
|
|
|
|
import { mapState, mapActions, mapGetters } from 'vuex'
|
|
|
|
|
import dateTime from '@/common/dateTime.js'
|
|
|
|
|
import {myCache,logindo,clearBadgeNumber} from "../../utils/utils";
|
|
|
|
|
import openlogin from "../components/openlogin.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
openlogin
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
loadStatus: 'loadmore',
|
|
|
|
|
userid:"",
|
|
|
|
|
activeSwipeId:-1,
|
|
|
|
|
options: [
|
|
|
|
|
{
|
|
|
|
|
@ -106,9 +115,20 @@ export default {
|
|
|
|
|
onShow() {
|
|
|
|
|
//判断登录,跳转去登录
|
|
|
|
|
// logindo();
|
|
|
|
|
console.log("this.chats列表.......",this.chats)
|
|
|
|
|
this.loadStatus = 'nomore'
|
|
|
|
|
this.setBadge(this.unreadCount)
|
|
|
|
|
// console.log("this.chats列表.......",this.chats)
|
|
|
|
|
var user = myCache('user');
|
|
|
|
|
this.userid = user.userid? user.userid:'';
|
|
|
|
|
if(this.userid==""||this.userid=="0"){
|
|
|
|
|
}
|
|
|
|
|
else{
|
|
|
|
|
this.loadStatus = 'nomore'
|
|
|
|
|
this.setBadge(this.unreadCount)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
if(this.userid==""||this.userid=="0"){
|
|
|
|
|
this.$refs.loginId.open();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onPullDownRefresh() {
|
|
|
|
|
// 下拉刷新仅刷新角标,数据由全局WebSocket维护
|
|
|
|
|
@ -120,6 +140,11 @@ export default {
|
|
|
|
|
methods: {
|
|
|
|
|
...mapActions('chatStore', ['removeChat', 'moveTop','loadFriend']),
|
|
|
|
|
|
|
|
|
|
getPhoneNumber(e){
|
|
|
|
|
if(e.userid){
|
|
|
|
|
this.userid = e.userid
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 设置底部角标
|
|
|
|
|
setBadge(count) {
|
|
|
|
|
myCache("massageCount",count);
|
|
|
|
|
|