From 3be650b24e87e3192b412ef85044ea5aa919b8d2 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 17 Aug 2020 09:44:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=93=BE=E6=8E=A5=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index 5f13f56..6b77b27 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -273,7 +273,7 @@ import chatVue from '../../pageD/chat/chat.vue' // this.isNewmembervoucher(); // } }, - onLoad(){ + async onLoad(){ this.getSwiper(); // 优惠券 if(this.$store.state.hasLogin){ @@ -281,24 +281,28 @@ import chatVue from '../../pageD/chat/chat.vue' const user = uni.getStorageSync('user_info'); // console.log(user) this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar) - this.imService.connectIM() + await this.imService.connectIM() }else{ - this.$u.api.getDefaultAvatar().then((res)=>{ + await this.$u.api.getDefaultAvatar().then((res)=>{ console.log(res) uni.setStorageSync("morenimg",res.data.avatar) this.imService.login(new Date().getTime(),"123",res.data.avatar) - this.imService.connectIM() + console.log("用户信息") }) + console.log("链接") + await this.imService.connectIM() + } + console.log("1212") let that = this - setTimeout(function(){ - that.imService.disconnect() - // console.log("guanbi") - },1000) - setTimeout(function(){ - // console.log("lianjie") - that.imService.connectIM() + setTimeout(function(){ + that.imService.disconnect() + console.log("guanbi") + },1000) + setTimeout(function(){ + console.log("lianjie") + that.imService.connectIM() },2000) }, onPullDownRefresh() {