提交
This commit is contained in:
parent
a39aa6e059
commit
9f17c5478c
@ -61,6 +61,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import IMService from '@/static/imservice.js'
|
||||||
import identifying from '@/components/logininput/identifying'
|
import identifying from '@/components/logininput/identifying'
|
||||||
import {
|
import {
|
||||||
mapMutations
|
mapMutations
|
||||||
@ -107,6 +108,8 @@
|
|||||||
let pages = getCurrentPages();
|
let pages = getCurrentPages();
|
||||||
let prePage = pages[pages.length - 2];
|
let prePage = pages[pages.length - 2];
|
||||||
this.temp_url = prePage.route;
|
this.temp_url = prePage.route;
|
||||||
|
console.log(this.imService.lianjie)
|
||||||
|
this.imService.disconnect()
|
||||||
// console.log(this.temp_url);
|
// console.log(this.temp_url);
|
||||||
},
|
},
|
||||||
// 切断正常返回
|
// 切断正常返回
|
||||||
@ -181,6 +184,12 @@
|
|||||||
me.loginIn(res.data.token); //存储一个字符传值
|
me.loginIn(res.data.token); //存储一个字符传值
|
||||||
// 缓存用户的信息
|
// 缓存用户的信息
|
||||||
uni.setStorageSync('user_info',res.data);
|
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) {
|
if (res.data.member.has_labels) {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/index/index'
|
url: '/pages/index/index'
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
import {
|
import {
|
||||||
mapMutations
|
mapMutations
|
||||||
} from 'vuex';
|
} from 'vuex';
|
||||||
|
import IMService from '@/static/imservice.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -88,7 +89,12 @@
|
|||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loginOut() {
|
async loginOut() {
|
||||||
|
let im = this.imService
|
||||||
|
await im.disconnect()
|
||||||
|
im.lianjie = false
|
||||||
|
im = new IMService();
|
||||||
|
console.log(im.lianjie)
|
||||||
this.logout();
|
this.logout();
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: "../../pageA/login/login",
|
url: "../../pageA/login/login",
|
||||||
|
@ -267,27 +267,19 @@
|
|||||||
indexad,
|
indexad,
|
||||||
darenItem
|
darenItem
|
||||||
},
|
},
|
||||||
onShow() {
|
async onShow() {
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
if (this.page != 1) {
|
if (this.page != 1) {
|
||||||
}
|
}
|
||||||
// if (this.hasLogin) {
|
console.log(this.imService.lianjie,this.imService.status)
|
||||||
// this.isNewmembervoucher();
|
if(!this.imService.status && this.$store.state.hasLogin && !this.imService.lianjie){
|
||||||
// }
|
|
||||||
},
|
|
||||||
async onLoad(){
|
|
||||||
this.articleList = [];
|
|
||||||
this.getArticlelist();
|
|
||||||
this.getSwiper();
|
|
||||||
// 优惠券
|
|
||||||
if(this.$store.state.hasLogin){
|
|
||||||
this.isNewmembervoucher();
|
this.isNewmembervoucher();
|
||||||
const user = uni.getStorageSync('user_info');
|
const user = uni.getStorageSync('user_info');
|
||||||
// console.log(user)
|
// console.log(user)
|
||||||
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
this.imService.login(user.member.member_id,user.member.member_nickname,user.member.member_avatar)
|
||||||
await this.imService.connectIM()
|
await this.imService.connectIM()
|
||||||
|
|
||||||
}else{
|
}else if(!this.imService.status && !this.imService.lianjie){
|
||||||
await this.$u.api.getDefaultAvatar().then((res)=>{
|
await this.$u.api.getDefaultAvatar().then((res)=>{
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.setStorageSync("morenimg",res.data.avatar)
|
uni.setStorageSync("morenimg",res.data.avatar)
|
||||||
@ -298,16 +290,57 @@
|
|||||||
await this.imService.connectIM()
|
await this.imService.connectIM()
|
||||||
|
|
||||||
}
|
}
|
||||||
console.log("1212")
|
if(!this.imService.status && !this.imService.lianjie){
|
||||||
let that = this
|
console.log("1212")
|
||||||
setTimeout(function(){
|
this.imService.lianjie = true
|
||||||
that.imService.disconnect()
|
let that = this
|
||||||
console.log("guanbi")
|
setTimeout(function(){
|
||||||
},1000)
|
that.imService.disconnect()
|
||||||
setTimeout(function(){
|
console.log("guanbi")
|
||||||
console.log("lianjie")
|
},1000)
|
||||||
that.imService.connectIM()
|
setTimeout(function(){
|
||||||
},2000)
|
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() {
|
onPullDownRefresh() {
|
||||||
this.page = 1;
|
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
|
* @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';
|
import restApi from './restapi';
|
||||||
|
|
||||||
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
|
function Friend(uuid, name, avatar,time = "", text = "",date = "",unReadMessage = 0) {
|
||||||
@ -38,6 +39,7 @@ function IMService() {
|
|||||||
appkey:'BC-453aa755c4ea48148abefc55a86df283'
|
appkey:'BC-453aa755c4ea48148abefc55a86df283'
|
||||||
});
|
});
|
||||||
this.status = false
|
this.status = false
|
||||||
|
this.lianjie = false
|
||||||
//当前“我”
|
//当前“我”
|
||||||
this.currentUser = null;
|
this.currentUser = null;
|
||||||
//我的好友
|
//我的好友
|
||||||
|
Loading…
Reference in New Issue
Block a user