|
@@ -455,5 +455,40 @@ Page({
|
|
|
} else {
|
|
|
return `${dateArr[0]}/${dateArr[1]}/${dateArr[2]}`;
|
|
|
}
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 扫一扫加入群聊
|
|
|
+ */
|
|
|
+ scanJoinGroup: function () {
|
|
|
+ wx.scanCode({
|
|
|
+ onlyFromCamera: true,
|
|
|
+ success: (res) => {
|
|
|
+ console.info('scanCode', res);
|
|
|
+ if (res.result) {
|
|
|
+ util.post({
|
|
|
+ url: '/api/easemob/addGroupUser',
|
|
|
+ data: {
|
|
|
+ chatgroupid: res.result,
|
|
|
+ usernames: [wx.getStorageSync('myUsername')]
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ wx.hideLoading();
|
|
|
+ console.info('addGroupUser', res);
|
|
|
+ if (res.data.code != 200) {
|
|
|
+ util.toast(res.data.msg);
|
|
|
+ } else {
|
|
|
+ util.toast(res.data.msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.info('scanCode', err);
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
+
|
|
|
})
|