This commit is contained in:
2020-08-18 10:43:15 +08:00
parent a39aa6e059
commit 9f17c5478c
5 changed files with 77 additions and 25 deletions

View File

@@ -267,27 +267,19 @@
indexad,
darenItem
},
onShow() {
async onShow() {
this.page = 1;
if (this.page != 1) {
}
// if (this.hasLogin) {
// this.isNewmembervoucher();
// }
},
async onLoad(){
this.articleList = [];
this.getArticlelist();
this.getSwiper();
// 优惠券
if(this.$store.state.hasLogin){
}
console.log(this.imService.lianjie,this.imService.status)
if(!this.imService.status && this.$store.state.hasLogin && !this.imService.lianjie){
this.isNewmembervoucher();
const user = uni.getStorageSync('user_info');
// console.log(user)
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
await this.imService.connectIM()
}else{
}else if(!this.imService.status && !this.imService.lianjie){
await this.$u.api.getDefaultAvatar().then((res)=>{
console.log(res)
uni.setStorageSync("morenimg",res.data.avatar)
@@ -298,16 +290,57 @@
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()
},2000)
if(!this.imService.status && !this.imService.lianjie){
console.log("1212")
this.imService.lianjie = true
let that = this
setTimeout(function(){
that.imService.disconnect()
console.log("guanbi")
},1000)
setTimeout(function(){
console.log("lianjie")
that.imService.connectIM()
},2000)
}
// if (this.hasLogin) {
// this.isNewmembervoucher();
// }
},
async onLoad(){
this.articleList = [];
this.getArticlelist();
this.getSwiper();
// 优惠券
// if(this.$store.state.hasLogin){
// this.isNewmembervoucher();
// const user = uni.getStorageSync('user_info');
// // console.log(user)
// this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
// await this.imService.connectIM()
// }else{
// 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)
// 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()
// },2000)
},
onPullDownRefresh() {
this.page = 1;