@titaui/pc 1.10.83-beta.7 → 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,57 +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
124
  if (isWx) {
125
125
  //有群了,判断没在群就先进群再打开群
126
126
  if (chatId !== null && chatId !== 'chatId') {
127
- wx.invoke('updateEnterpriseChat', {
128
- chatId: chatId,
129
- userIdsToAdd: "".concat(loginUserOpenId)
127
+ wx.invoke('openExistedChatWithMsg', {
128
+ chatId: chatId
130
129
  }, function (res) {
131
- if (res.err_msg === 'updateEnterpriseChat:ok') {
132
- wx.invoke('openExistedChatWithMsg', {
133
- chatId: chatId
134
- }, function (res) {
135
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
136
- console.log('打开群成功');
137
- }
138
- });
139
- } else if (res.err_msg === 'updateEnterpriseChat:fail_unsupported chat') {
140
- wx.invoke('openExistedChatWithMsg', {
141
- chatId: chatId
142
- }, function (res) {
143
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
144
- console.log('打开群成功');
145
- }
146
- });
147
- } else if (res.err_msg === 'updateEnterpriseChat:permission denied') {
130
+ if (res.err_msg === 'openExistedChatWithMsg:ok') {
131
+ console.log('打开群成功');
132
+ } else {
148
133
  if (isMac) {
149
- wx.invoke('openExistedChatWithMsg', {
150
- chatId: chatId
134
+ setMacWarnModalVisible(true);
135
+ } else {
136
+ wx.invoke('updateEnterpriseChat', {
137
+ chatId: chatId,
138
+ userIdsToAdd: loginUserOpenId
151
139
  }, function (res) {
152
- if (res.err_msg === 'openExistedChatWithMsg:ok') {
140
+ console.log(chatId);
141
+
142
+ if (res.err_msg == 'updateEnterpriseChat:ok') {
153
143
  console.log('打开群成功');
154
144
  } else {
155
- setMacWarnModalVisible(true);
145
+ if (loginUserOpenId === principalUser.userId) {
146
+ setPrincipalUserModalVisible(true);
147
+ } else {
148
+ setMemberVisible(true);
149
+ }
156
150
  }
157
151
  });
158
152
  }
159
- } else {
160
- if (loginUserOpenId === principalUser.userId) {
161
- setPrincipalUserModalVisible(true);
162
- } else {
163
- setMemberVisible(true);
164
- }
165
153
  }
166
154
  });
167
155
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titaui/pc",
3
- "version": "1.10.83-beta.7",
3
+ "version": "1.10.83-beta.8",
4
4
  "nameCN": "",
5
5
  "description": "",
6
6
  "main": "lib/index.js",