@titaui/pc 1.10.83-beta.6 → 1.10.83-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,6 +19,8 @@ var _getLocale = require("../../utils/getLocale");
19
19
 
20
20
  var _request = require("../../utils/request");
21
21
 
22
+ var _bsGlobal = require("../../utils/bs-global");
23
+
22
24
  require("./index.css");
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -42,6 +44,7 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
42
44
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
43
45
 
44
46
  var preCls = 'titaui-wechat-btn';
47
+ var userId = (0, _bsGlobal.getUserInfo)().Id;
45
48
 
46
49
  var WeChatBtn = function WeChatBtn(props) {
47
50
  var id = props.id,
@@ -111,59 +114,51 @@ var WeChatBtn = function WeChatBtn(props) {
111
114
 
112
115
  var isWx = navigator.userAgent.match(/wxwork/);
113
116
  var isMac = navigator.userAgent.match(/Mac/);
114
- /**
117
+ /**
115
118
  * 点击企业微信图标这块稍许复杂 注释说明一下
116
- * 先判断有没有群 没群就新建群
119
+ * 先判断有没有群 没群就新建群
117
120
  * 有群就先调用加人的接口 人本身不在群的情况 成功加人就打开进入群聊
118
121
  * 人在群的情况 加人接口返回报错信息updateEnterpriseChat:fail_unsupported chat 则调用打开群接口
119
122
  * 群解散的情况 则弹窗提示 联系负责人手动加群
120
123
  * mac 不支持加人接口
121
- */
124
+ */
122
125
 
123
126
  var handleClickWechatBtn = function handleClickWechatBtn() {
124
127
  if (isWx) {
125
128
  //有群了,判断没在群就先进群再打开群
126
129
  if (chatId !== null && chatId !== 'chatId') {
127
- wx.invoke('updateEnterpriseChat', {
128
- chatId: chatId,
129
- userIdsToAdd: "".concat(loginUserOpenId, ";").concat(weChatGroupMember[0], ";").concat(weChatGroupMember[1])
130
+ wx.invoke('openExistedChatWithMsg', {
131
+ chatId: chatId
130
132
  }, function (res) {
131
- console.log("1.\u4EBA\u5728\u7FA4\uFF0C\u8C03\u7528\u52A0\u4EBA\u63A5\u53E3\u8FD4\u56DE\u4FE1\u606F\uFF1B2.\u4EBA\u4E0D\u5728\u7FA4\uFF0C\u8C03\u7528\u52A0\u4EBA\u63A5\u53E3\u8FD4\u56DE\u4FE1\u606F\uFF1B 3.\u7FA4\u89E3\u6563\u4E86\uFF0C\u8C03\u7528\u52A0\u4EBA\u63A5\u53E3\u8FD4\u56DE\u4FE1\u606F 4.mac\u8C03\u7528\u52A0\u4EBA\u63A5\u53E3\u8FD4\u56DE\u4FE1\u606F ".concat(res.err_msg));
132
-
133
- if (res.err_msg === 'updateEnterpriseChat:ok') {
134
- wx.invoke('openExistedChatWithMsg', {
135
- chatId: chatId
136
- }, function (res) {
137
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
138
- console.log('打开群成功');
139
- }
140
- });
141
- } else if (res.err_msg === 'updateEnterpriseChat:fail_unsupported chat') {
142
- wx.invoke('openExistedChatWithMsg', {
143
- chatId: chatId
144
- }, function (res) {
145
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
146
- console.log('打开群成功');
147
- }
148
- });
149
- } else if (res.err_msg === 'updateEnterpriseChat:permission denied') {
133
+ if (res.err_msg === 'openExistedChatWithMsg:ok') {
134
+ console.log('打开群成功');
135
+ } else {
150
136
  if (isMac) {
151
- wx.invoke('openExistedChatWithMsg', {
152
- chatId: chatId
137
+ setMacWarnModalVisible(true);
138
+ } else {
139
+ wx.invoke('updateEnterpriseChat', {
140
+ chatId: chatId,
141
+ userIdsToAdd: loginUserOpenId
153
142
  }, function (res) {
154
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
155
- console.log('打开群成功');
143
+ console.log(chatId);
144
+
145
+ if (res.err_msg == 'updateEnterpriseChat:ok') {
146
+ wx.invoke('openExistedChatWithMsg', {
147
+ chatId: chatId
148
+ }, function (res) {
149
+ if (res.err_msg == 'openExistedChatWithMsg:ok') {
150
+ console.log('打开群成功');
151
+ }
152
+ });
156
153
  } else {
157
- setMacWarnModalVisible(true);
154
+ if (userId === principalUser.userId) {
155
+ setPrincipalUserModalVisible(true);
156
+ } else {
157
+ setMemberVisible(true);
158
+ }
158
159
  }
159
160
  });
160
161
  }
161
- } else {
162
- if (loginUserOpenId === principalUser.userId) {
163
- setPrincipalUserModalVisible(true);
164
- } else {
165
- setMemberVisible(true);
166
- }
167
162
  }
168
163
  });
169
164
  } else {
@@ -314,7 +309,7 @@ var WeChatBtn = function WeChatBtn(props) {
314
309
  type: "title"
315
310
  }, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
316
311
  type: "content"
317
- }, "\u4F60\u5DF2\u9000\u7FA4\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002\u4F60\u4E5F\u53EF\u4EE5\u91CD\u65B0\u5EFA\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
312
+ }, "\u4F60\u4E0D\u5728\u7FA4\u91CC\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002\u4F60\u4E5F\u53EF\u4EE5\u91CD\u65B0\u5EFA\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.CancelButton, {
318
313
  type: "button",
319
314
  onClick: closeprincipalUserModal
320
315
  }, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
@@ -328,7 +323,7 @@ var WeChatBtn = function WeChatBtn(props) {
328
323
  type: "title"
329
324
  }, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
330
325
  type: "content"
331
- }, "\u4F60\u5DF2\u9000\u7FA4\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
326
+ }, "\u4F60\u4E0D\u5728\u7FA4\u91CC\u6216\u8BE5\u7FA4\u5DF2\u89E3\u6563\u3002\u53EF\u4EE5\u8054\u7CFB".concat(apply, "\u6210\u5458\u62C9\u4F60\u5165\u7FA4\u3002")), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
332
327
  type: "button",
333
328
  onClick: handleMemberVisible
334
329
  }, "\u6211\u77E5\u9053\u4E86")));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.83-beta.6",
3
+ "version": "1.10.83-beta.9",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",