|
@@ -20,13 +20,6 @@ Page({
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
- // console.info('userinfo', app.globalData.userInfo);
|
|
|
- // console.info('roleinfo', app.globalData.roleInfo);
|
|
|
- this.setData({
|
|
|
- username: app.globalData.userInfo.usernameShow,
|
|
|
- role_name: app.globalData.roleInfo.name,
|
|
|
- roleCode: app.globalData.roleInfo.code,
|
|
|
- });
|
|
|
let that = this;
|
|
|
if (!app.globalData.userInfo.usernameShow || !app.globalData.userInfo.nickName || !app.globalData.userInfo.headImgUrl) {
|
|
|
wx.showModal({
|
|
@@ -61,7 +54,8 @@ Page({
|
|
|
util.toast('拒绝授权将影响您的体验感');
|
|
|
that.setData({
|
|
|
username: '未知用户',
|
|
|
- role_name: app.globalData.roleInfo.name
|
|
|
+ role_name: app.globalData.roleInfo.name,
|
|
|
+ roleCode: app.globalData.roleInfo.code,
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -71,7 +65,50 @@ Page({
|
|
|
} else {
|
|
|
that.setData({
|
|
|
username: app.globalData.userInfo.usernameShow,
|
|
|
- role_name: app.globalData.roleInfo.name
|
|
|
+ role_name: app.globalData.roleInfo.name,
|
|
|
+ roleCode: app.globalData.roleInfo.code,
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 加入群聊
|
|
|
+ if (wx.getStorageSync('groupId')) {
|
|
|
+ let groupId = wx.getStorageSync('groupId');
|
|
|
+ util.post({
|
|
|
+ url: '/api/easemob/addGroupUser',
|
|
|
+ data: {
|
|
|
+ chatgroupid: groupId,
|
|
|
+ usernames: [wx.getStorageSync('myUsername')]
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ wx.hideLoading();
|
|
|
+ console.info('addGroupUser', res);
|
|
|
+ if (res.data.code != 200) {
|
|
|
+ util.toast(res.data.msg);
|
|
|
+ } else {
|
|
|
+ let datas = res.data.data;
|
|
|
+ if (datas && datas.error) {
|
|
|
+ if (datas.error == 'not_found') {
|
|
|
+ wx.showModal({
|
|
|
+ content: '您要加入的群聊不存在',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ } else if (datas.error == 'forbidden_op') {
|
|
|
+ wx.showModal({
|
|
|
+ content: '您已经在群聊中了,请不要重复加入',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ util.toast(datas.error);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ content: '群聊加入成功',
|
|
|
+ showCancel: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wx.removeStorageSync('groupId');
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -106,7 +143,7 @@ Page({
|
|
|
nextUnit: datas.receptionObject
|
|
|
});
|
|
|
} else {
|
|
|
- util.toast('暂无下一场会议');
|
|
|
+ // util.toast('暂无下一场会议');
|
|
|
}
|
|
|
}
|
|
|
}
|