Showing
2 changed files
with
51 additions
and
51 deletions
@@ -161,11 +161,11 @@ | @@ -161,11 +161,11 @@ | ||
161 | </div> | 161 | </div> |
162 | </div> | 162 | </div> |
163 | </div> | 163 | </div> |
164 | -<script type="text/javascript" src="./jq.js"> | 164 | +<script type="text/javascript" src="./jq.js?r=1"> |
165 | </script> | 165 | </script> |
166 | -<script type="text/javascript" src="./clip.js"> | 166 | +<script type="text/javascript" src="./clip.js?r=1"> |
167 | </script> | 167 | </script> |
168 | -<script type="text/javascript" src="./sdk.js"> | 168 | +<script type="text/javascript" src="./sdk.js?r=1"> |
169 | </script> | 169 | </script> |
170 | <script type="text/javascript"> | 170 | <script type="text/javascript"> |
171 | var _hmt = _hmt || []; | 171 | var _hmt = _hmt || []; |
@@ -214,56 +214,56 @@ | @@ -214,56 +214,56 @@ | ||
214 | 214 | ||
215 | var $dialogWrapper = $('.dialog-wrapper'); | 215 | var $dialogWrapper = $('.dialog-wrapper'); |
216 | var text = ''; | 216 | var text = ''; |
217 | - window.yo_sdk.getUid().then(function (uid) { | ||
218 | - if (uid) { | ||
219 | - let param =window.yo_sdk.getQueryObj(),appVersion; | ||
220 | - let env = window.yo_sdk.env; | ||
221 | - if(env === 'miniprogram'){ | ||
222 | - appVersion = '6.6.0' | ||
223 | - }else{ | ||
224 | - appVersion = param.app_version || Consultant.getCookie('app_version') | ||
225 | - } | ||
226 | - $.ajax({ | ||
227 | - method: 'post', | ||
228 | - url: 'https://action.yoho.cn/api/getWechatCs', | ||
229 | - data: { | ||
230 | - uid: param.uid || Consultant.getCookie('app_uid'), | ||
231 | - sessionKey: param.session_key || Consultant.getCookie('app_session_key'), | ||
232 | - appVersion: appVersion, | ||
233 | - sessionType: param.client_type || Consultant.getCookie('app_client_type') | ||
234 | - }, | ||
235 | - success: function (result) { | ||
236 | - text = result.data && result.data.wechatCode; | ||
237 | - console.log(result, '======'); | ||
238 | - }, | ||
239 | - error: function (err) { | ||
240 | - console.log(err, '===-----'); | ||
241 | - } | ||
242 | - }); | ||
243 | - } | ||
244 | - $('.consultant-add').click(function () { | ||
245 | - trace_baidu('click', '点击微信客服绑定'); | 217 | + var urlParam = Consultant.queryString(); |
218 | + $('.consultant-add').click(function () { | ||
219 | + trace_baidu('click', '点击微信客服绑定'); | ||
220 | + window.yo_sdk.getUid(function (uid) { | ||
246 | if (uid) { | 221 | if (uid) { |
247 | - if (text) { | ||
248 | - $('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴'); | ||
249 | - var clipboard = new ClipboardJS('.consultant-add', { | ||
250 | - text: function (trigger) { | ||
251 | - return text; | ||
252 | - } | ||
253 | - }); | ||
254 | - clipboard.on('success', function (e) { | ||
255 | - e.clearSelection(); | ||
256 | - Consultant.dialog($dialogWrapper, text); | ||
257 | - }); | ||
258 | - | ||
259 | - clipboard.on('error', function (e) { | ||
260 | - console.error('Action:', e.action); | ||
261 | - console.error('Trigger:', e.trigger); | ||
262 | - }); | ||
263 | - } else { | ||
264 | - $('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~'); | ||
265 | - Consultant.dialog($dialogWrapper, text); | 222 | + let appVersion = urlParam.app_version || Consultant.getCookie('app_version'), evn = window.yo_sdk.env; |
223 | + if (evn === 'miniprogram') { | ||
224 | + appVersion = '6.6.0' | ||
266 | } | 225 | } |
226 | + $.ajax({ | ||
227 | + method: 'post', | ||
228 | + url: 'https://action.yoho.cn/api/getWechatCs', | ||
229 | + data: { | ||
230 | + uid: urlParam.uid || Consultant.getCookie('app_uid'), | ||
231 | + sessionKey: urlParam.session_key || Consultant.getCookie('app_session_key'), | ||
232 | + appVersion: appVersion, | ||
233 | + sessionType: urlParam.client_type || Consultant.getCookie('app_client_type') | ||
234 | + }, | ||
235 | + success: function (result) { | ||
236 | + text = result.data && result.data.wechatCode; | ||
237 | + if (text) { | ||
238 | + $('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴'); | ||
239 | + var clipboard = new ClipboardJS('.consultant-add', { | ||
240 | + text: function (trigger) { | ||
241 | + return text; | ||
242 | + } | ||
243 | + }); | ||
244 | + clipboard.on('success', function (e) { | ||
245 | + e.clearSelection(); | ||
246 | + Consultant.dialog($dialogWrapper, text); | ||
247 | + }); | ||
248 | + | ||
249 | + clipboard.on('error', function (e) { | ||
250 | + console.error('Action:', e.action); | ||
251 | + console.error('Trigger:', e.trigger); | ||
252 | + }); | ||
253 | + } else { | ||
254 | + $('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~'); | ||
255 | + Consultant.dialog($dialogWrapper, text); | ||
256 | + } | ||
257 | + }, | ||
258 | + error: function (err) { | ||
259 | + if (err.status === 401) { | ||
260 | + return window.yo_sdk.goLogin(); | ||
261 | + } else { | ||
262 | + $('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~'); | ||
263 | + Consultant.dialog($dialogWrapper, text); | ||
264 | + } | ||
265 | + } | ||
266 | + }); | ||
267 | } else { | 267 | } else { |
268 | window.yo_sdk.goLogin(); | 268 | window.yo_sdk.goLogin(); |
269 | } | 269 | } |
This diff could not be displayed because it is too large.
-
Please register or login to post a comment