@titaui/pc 1.10.83-beta.5 → 1.10.83-beta.8

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.
@@ -111,61 +111,45 @@ var WeChatBtn = function WeChatBtn(props) {
111
111
 
112
112
  var isWx = navigator.userAgent.match(/wxwork/);
113
113
  var isMac = navigator.userAgent.match(/Mac/);
114
- /**
114
+ /**
115
115
  * 点击企业微信图标这块稍许复杂 注释说明一下
116
- * 先判断有没有群 没群就新建群
116
+ * 先判断有没有群 没群就新建群
117
117
  * 有群就先调用加人的接口 人本身不在群的情况 成功加人就打开进入群聊
118
118
  * 人在群的情况 加人接口返回报错信息updateEnterpriseChat:fail_unsupported chat 则调用打开群接口
119
119
  * 群解散的情况 则弹窗提示 联系负责人手动加群
120
120
  * mac 不支持加人接口
121
- */
121
+ */
122
122
 
123
123
  var handleClickWechatBtn = function handleClickWechatBtn() {
124
- console.log("\u540E\u7AEF\u8FD4\u56DE\u6765\u7684id: ".concat(chatId));
125
-
126
124
  if (isWx) {
127
125
  //有群了,判断没在群就先进群再打开群
128
126
  if (chatId !== null && chatId !== 'chatId') {
129
- wx.invoke('updateEnterpriseChat', {
130
- chatId: chatId,
131
- userIdsToAdd: "".concat(loginUserOpenId)
127
+ wx.invoke('openExistedChatWithMsg', {
128
+ chatId: chatId
132
129
  }, function (res) {
133
- 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));
134
-
135
- if (res.err_msg === 'updateEnterpriseChat:ok') {
136
- wx.invoke('openExistedChatWithMsg', {
137
- chatId: chatId
138
- }, function (res) {
139
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
140
- console.log('打开群成功');
141
- }
142
- });
143
- } else if (res.err_msg === 'updateEnterpriseChat:fail_unsupported chat') {
144
- wx.invoke('openExistedChatWithMsg', {
145
- chatId: chatId
146
- }, function (res) {
147
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
148
- console.log('打开群成功');
149
- }
150
- });
151
- } else if (res.err_msg === 'updateEnterpriseChat:permission denied') {
130
+ if (res.err_msg === 'openExistedChatWithMsg:ok') {
131
+ console.log('打开群成功');
132
+ } else {
152
133
  if (isMac) {
153
- wx.invoke('openExistedChatWithMsg', {
154
- chatId: chatId
134
+ setMacWarnModalVisible(true);
135
+ } else {
136
+ wx.invoke('updateEnterpriseChat', {
137
+ chatId: chatId,
138
+ userIdsToAdd: loginUserOpenId
155
139
  }, function (res) {
156
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
140
+ console.log(chatId);
141
+
142
+ if (res.err_msg == 'updateEnterpriseChat:ok') {
157
143
  console.log('打开群成功');
158
144
  } else {
159
- setMacWarnModalVisible(true);
145
+ if (loginUserOpenId === principalUser.userId) {
146
+ setPrincipalUserModalVisible(true);
147
+ } else {
148
+ setMemberVisible(true);
149
+ }
160
150
  }
161
151
  });
162
152
  }
163
- } else {
164
- if (loginUserOpenId === principalUser.userId) {
165
- setPrincipalUserModalVisible(true);
166
- } else {
167
- setMemberVisible(true);
168
- }
169
153
  }
170
154
  });
171
155
  } else {
@@ -195,7 +179,6 @@ var WeChatBtn = function WeChatBtn(props) {
195
179
  }, function (res) {
196
180
  if (res.err_msg === 'createChatWithMsg:ok') {
197
181
  if (res.chatId) {
198
- console.log("\u521B\u5EFA\u7FA4\uFF0C\u4F20\u7ED9\u540E\u7AEF\u7684chatid:".concat(res.chatId));
199
182
  (0, _request.rpost)('v1')('chat/add', {
200
183
  objId: id,
201
184
  objType: objType,
@@ -317,7 +300,7 @@ var WeChatBtn = function WeChatBtn(props) {
317
300
  type: "title"
318
301
  }, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
319
302
  type: "content"
320
- }, "\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, {
303
+ }, "\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, {
321
304
  type: "button",
322
305
  onClick: closeprincipalUserModal
323
306
  }, "\u53D6\u6D88"), /*#__PURE__*/_react["default"].createElement(_dialogConfirm.SureButton, {
@@ -331,7 +314,7 @@ var WeChatBtn = function WeChatBtn(props) {
331
314
  type: "title"
332
315
  }, "\u8BF7\u6CE8\u610F"), /*#__PURE__*/_react["default"].createElement("span", {
333
316
  type: "content"
334
- }, "\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, {
317
+ }, "\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, {
335
318
  type: "button",
336
319
  onClick: handleMemberVisible
337
320
  }, "\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.5",
3
+ "version": "1.10.83-beta.8",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",