最初版本 合并
This commit is contained in:
@@ -103,6 +103,7 @@ export default {
|
||||
// 账号登录1达人0商家
|
||||
if(this.state==1){
|
||||
this.$u.api.login({ member_name: this.zhanghaoA, member_password: this.mimaA }).then(res => {
|
||||
console.log(JSON.stringify(res))
|
||||
if (res.errCode != 0) {
|
||||
// 恢复按钮可点击状态
|
||||
this.clickstate=false
|
||||
@@ -122,6 +123,7 @@ export default {
|
||||
});
|
||||
}else{
|
||||
this.$u.api.shoplogin({ member_name: this.zhanghao, member_password: this.mima }).then(res => {
|
||||
console.log(JSON.stringify(res))
|
||||
if (res.errCode != 0) {
|
||||
// 恢复按钮可点击状态
|
||||
this.clickstate=false
|
||||
|
||||
@@ -271,7 +271,6 @@
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
const ChatRoomService =require('../../static/chatservice');
|
||||
export default {
|
||||
data: {
|
||||
fil: true,
|
||||
@@ -290,6 +289,33 @@
|
||||
chatRoomService:{},
|
||||
danmulist:[]
|
||||
},
|
||||
onLaunch: function() {
|
||||
console.log('App Launch');
|
||||
},
|
||||
onShow: function() {
|
||||
this.stop()
|
||||
this.startPreview()
|
||||
this.start()
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide');
|
||||
},
|
||||
//模拟onshow生命周期
|
||||
created() {
|
||||
//监听当前窗口显示
|
||||
currentWebview.addEventListener('show',e=>{
|
||||
console.log('search show');
|
||||
this.startPreview()
|
||||
this.start()
|
||||
})
|
||||
},
|
||||
|
||||
//摧毁之前的声明周期
|
||||
beforeDestroy() {
|
||||
//移除监听事件
|
||||
console.log(123)
|
||||
currentWebview.removeEventListener('show',e=>{})
|
||||
},
|
||||
onReady() {
|
||||
// 注意:需要在onReady中 或 onLoad 延时
|
||||
this.context = uni.createLivePusherContext("livePusher", this);
|
||||
@@ -306,6 +332,8 @@
|
||||
},
|
||||
|
||||
onLoad(a){
|
||||
console.log(getApp().globalData.im)
|
||||
|
||||
this.url = a.url.replace("*","&")
|
||||
let that = this
|
||||
const token = uni.getStorageSync('token');
|
||||
@@ -333,27 +361,17 @@
|
||||
console.log(res.data)
|
||||
that.info = res.data.data.memberInfo
|
||||
|
||||
console.log(uni.getStorageSync('userinfo'),123)
|
||||
//当前用户
|
||||
var currentUser = {
|
||||
id : res.data.data.memberInfo.member_id + "",
|
||||
nickname : res.data.data.memberInfo.member_nickname + "",
|
||||
avatar: res.data.data.memberInfo.member_avatar
|
||||
};
|
||||
|
||||
|
||||
var room = {
|
||||
id : a.id + "",
|
||||
name : a.id + ""
|
||||
};
|
||||
console.log(room)
|
||||
//构造chatRoomService
|
||||
that.chatRoomService = new ChatRoomService(room, currentUser);
|
||||
that.chatRoomService.initialWhenNewMessage(that.whenNewMessage);
|
||||
that.chatRoomService.connectGoEasyIM();
|
||||
//获取当前聊天室数据
|
||||
that.room = that.chatRoomService.room;
|
||||
|
||||
}
|
||||
})
|
||||
this.chatRoomService = getApp().globalData.im
|
||||
this.chatRoomService.subscribeGroupMessage(a.id)
|
||||
let shi = 0;
|
||||
let fen = 0;
|
||||
let miao = 0;
|
||||
|
||||
Reference in New Issue
Block a user