Authored by huangyi

潮流顾问

@@ -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,36 +214,26 @@ @@ -214,36 +214,26 @@
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) { 217 + var urlParam = Consultant.queryString();
  218 + $('.consultant-add').click(function () {
  219 + trace_baidu('click', '点击微信客服绑定');
  220 + window.yo_sdk.getUid(function (uid) {
218 if (uid) { 221 if (uid) {
219 - let param =window.yo_sdk.getQueryObj(),appVersion;  
220 - let env = window.yo_sdk.env;  
221 - if(env === 'miniprogram'){ 222 + let appVersion = urlParam.app_version || Consultant.getCookie('app_version'), evn = window.yo_sdk.env;
  223 + if (evn === 'miniprogram') {
222 appVersion = '6.6.0' 224 appVersion = '6.6.0'
223 - }else{  
224 - appVersion = param.app_version || Consultant.getCookie('app_version')  
225 } 225 }
226 $.ajax({ 226 $.ajax({
227 method: 'post', 227 method: 'post',
228 url: 'https://action.yoho.cn/api/getWechatCs', 228 url: 'https://action.yoho.cn/api/getWechatCs',
229 data: { 229 data: {
230 - uid: param.uid || Consultant.getCookie('app_uid'),  
231 - sessionKey: param.session_key || Consultant.getCookie('app_session_key'), 230 + uid: urlParam.uid || Consultant.getCookie('app_uid'),
  231 + sessionKey: urlParam.session_key || Consultant.getCookie('app_session_key'),
232 appVersion: appVersion, 232 appVersion: appVersion,
233 - sessionType: param.client_type || Consultant.getCookie('app_client_type') 233 + sessionType: urlParam.client_type || Consultant.getCookie('app_client_type')
234 }, 234 },
235 success: function (result) { 235 success: function (result) {
236 text = result.data && result.data.wechatCode; 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', '点击微信客服绑定');  
246 - if (uid) {  
247 if (text) { 237 if (text) {
248 $('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴'); 238 $('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴');
249 var clipboard = new ClipboardJS('.consultant-add', { 239 var clipboard = new ClipboardJS('.consultant-add', {
@@ -264,6 +254,16 @@ @@ -264,6 +254,16 @@
264 $('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~'); 254 $('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~');
265 Consultant.dialog($dialogWrapper, text); 255 Consultant.dialog($dialogWrapper, text);
266 } 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.