Authored by huangyi

潮流顾问

... ... @@ -161,11 +161,11 @@
</div>
</div>
</div>
<script type="text/javascript" src="./jq.js">
<script type="text/javascript" src="./jq.js?r=1">
</script>
<script type="text/javascript" src="./clip.js">
<script type="text/javascript" src="./clip.js?r=1">
</script>
<script type="text/javascript" src="./sdk.js">
<script type="text/javascript" src="./sdk.js?r=1">
</script>
<script type="text/javascript">
var _hmt = _hmt || [];
... ... @@ -214,36 +214,26 @@
var $dialogWrapper = $('.dialog-wrapper');
var text = '';
window.yo_sdk.getUid().then(function (uid) {
var urlParam = Consultant.queryString();
$('.consultant-add').click(function () {
trace_baidu('click', '点击微信客服绑定');
window.yo_sdk.getUid(function (uid) {
if (uid) {
let param =window.yo_sdk.getQueryObj(),appVersion;
let env = window.yo_sdk.env;
if(env === 'miniprogram'){
let appVersion = urlParam.app_version || Consultant.getCookie('app_version'), evn = window.yo_sdk.env;
if (evn === 'miniprogram') {
appVersion = '6.6.0'
}else{
appVersion = param.app_version || Consultant.getCookie('app_version')
}
$.ajax({
method: 'post',
url: 'https://action.yoho.cn/api/getWechatCs',
data: {
uid: param.uid || Consultant.getCookie('app_uid'),
sessionKey: param.session_key || Consultant.getCookie('app_session_key'),
uid: urlParam.uid || Consultant.getCookie('app_uid'),
sessionKey: urlParam.session_key || Consultant.getCookie('app_session_key'),
appVersion: appVersion,
sessionType: param.client_type || Consultant.getCookie('app_client_type')
sessionType: urlParam.client_type || Consultant.getCookie('app_client_type')
},
success: function (result) {
text = result.data && result.data.wechatCode;
console.log(result, '======');
},
error: function (err) {
console.log(err, '===-----');
}
});
}
$('.consultant-add').click(function () {
trace_baidu('click', '点击微信客服绑定');
if (uid) {
if (text) {
$('.dialog-content').html('微信号(' + text + ')已复制</br>请按步骤添加微信号:打开微信-通讯录-新的朋友-粘贴');
var clipboard = new ClipboardJS('.consultant-add', {
... ... @@ -264,6 +254,16 @@
$('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~');
Consultant.dialog($dialogWrapper, text);
}
},
error: function (err) {
if (err.status === 401) {
return window.yo_sdk.goLogin();
} else {
$('.dialog-content').html('当前添加用户过多,小哥哥小姐姐正在极速处理中,请稍后再来哦~');
Consultant.dialog($dialogWrapper, text);
}
}
});
} else {
window.yo_sdk.goLogin();
}
... ...
This diff could not be displayed because it is too large.