提交
This commit is contained in:
parent
a39aa6e059
commit
9f17c5478c
@ -61,6 +61,7 @@
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import IMService from '@/static/imservice.js'
|
||||
import identifying from '@/components/logininput/identifying'
|
||||
import {
|
||||
mapMutations
|
||||
@ -107,6 +108,8 @@
|
||||
let pages = getCurrentPages();
|
||||
let prePage = pages[pages.length - 2];
|
||||
this.temp_url = prePage.route;
|
||||
console.log(this.imService.lianjie)
|
||||
this.imService.disconnect()
|
||||
// console.log(this.temp_url);
|
||||
},
|
||||
// 切断正常返回
|
||||
@ -181,6 +184,12 @@
|
||||
me.loginIn(res.data.token); //存储一个字符传值
|
||||
// 缓存用户的信息
|
||||
uni.setStorageSync('user_info',res.data);
|
||||
let im = this.imService
|
||||
im.status = false
|
||||
console.log(123)
|
||||
im.lianjie = false
|
||||
im = new IMService();
|
||||
console.log(im.lianjie)
|
||||
if (res.data.member.has_labels) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
|
@ -23,6 +23,7 @@
|
||||
import {
|
||||
mapMutations
|
||||
} from 'vuex';
|
||||
import IMService from '@/static/imservice.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -88,7 +89,12 @@
|
||||
url: url
|
||||
});
|
||||
},
|
||||
loginOut() {
|
||||
async loginOut() {
|
||||
let im = this.imService
|
||||
await im.disconnect()
|
||||
im.lianjie = false
|
||||
im = new IMService();
|
||||
console.log(im.lianjie)
|
||||
this.logout();
|
||||
uni.redirectTo({
|
||||
url: "../../pageA/login/login",
|
||||
|
@ -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;
|
||||
|
2
static/goeasy-im-1.1.1.js
Normal file
2
static/goeasy-im-1.1.1.js
Normal file
File diff suppressed because one or more lines are too long
@ -5,7 +5,8 @@
|
||||
* @Last Modified time: 2020-4-21 15:01:41
|
||||
*/
|
||||
|
||||
import GoEasyIM from './goeasy-im-1.0.9';
|
||||
// import GoEasyIM from './goeasy-im-1.0.9';
|
||||
import GoEasyIM from './goeasy-im-1.1.1';
|
||||
import restApi from './restapi';
|
||||
|
||||
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
|
||||
@ -38,6 +39,7 @@ function IMService() {
|
||||
appkey:'BC-453aa755c4ea48148abefc55a86df283'
|
||||
});
|
||||
this.status = false
|
||||
this.lianjie = false
|
||||
//当前“我”
|
||||
this.currentUser = null;
|
||||
//我的好友
|
||||
|
Loading…
Reference in New Issue
Block a user