%PDF- %PDF-
| Direktori : /disk/www/wwwroot/test-lingceed.echineselearning.biz/js/.svn/text-base/ |
| Current File : /disk/www/wwwroot/test-lingceed.echineselearning.biz/js/.svn/text-base/float-contact.js.svn-base |
$(document).ready(function() {
// 请求数据地址
var requestAjaxUrl = 'https://www2.echineselearning.com/GetSalesmanInfoList.do';
if (window.location.host.indexOf('local') >= 0) {
requestAjaxUrl = 'http://local-ecl:8080/GetSalesmanInfoList.do';
}
if (window.location.host.indexOf('test-') >= 0) {
requestAjaxUrl = 'https://test-ecl.echineselearning.biz/GetSalesmanInfoList.do';
}
var erweimaImages = [];// 二维码数组
var erweimaIds = []; // wechatId数组
var erweimaMaxNum = 0; // 最大下标
var havaSalesman = false; // 是否成功拉取到数据
var erweimaRandnum = 0; // 当前下标
// 请求接口初始化参数
// $.ajax({
// type:"get",//必须是get请求
// url: requestAjaxUrl,
// dataType:"jsonp",//请求的数据类型
// success: function (result) {
// havaSalesman = result.havaSalesman;
// if(havaSalesman){
// erweimaImages = result.erweimas;
// erweimaIds = result.ids;
// erweimaMaxNum = result.erweimaMaxNum - 1;
// // 修改默认二维码与wechatId为数组第一个
// $('.js-float-contact > .js-float-contact-menu').find('.pic').attr('src',erweimaImages[erweimaRandnum]);
// $('.js-float-contact > .js-float-contact-menu').find('.wechatid').html(erweimaIds[erweimaRandnum]);
// }
// },
// error: function(errorMsg){
// console.log('访问失败');
// console.log(JSON.stringify(result));
// }
// });
if (/(iPhone|Android|iPad)/i.test(navigator.userAgent)) {
$('.js-float-contact > .js-float-contact-menu').click(function() {
var _$show = $(this).find('.js-float-contact-show');
if (_$show.hasClass('js-show')) {
_$show.hide();
_$show.removeClass('js-show');
} else {
// var _$picSrc = $(this).find('.pic').attr('src');
// if(typeof(_$picSrc) != "undefined" && havaSalesman){
// if(erweimaRandnum > erweimaMaxNum){
// erweimaRandnum = 0;
// }
// $(this).find('.pic').attr('src', erweimaImages[erweimaRandnum]);
// $(this).find('.wechatid').html(erweimaIds[erweimaRandnum]);
// erweimaRandnum ++;
// }
_$show.show();
_$show.addClass('js-show');
}
});
$('.js-float-contact > .js-float-contact-menu').hover(function() {
var _$show = $(this).find('.js-float-contact-show');
_$show.hide();
_$show.removeClass('js-show');
});
} else {
$('.js-float-contact > .js-float-contact-menu').hover(function() {
var _$show = $(this).find('.js-float-contact-show');
// var _$picSrc = $(this).find('.pic').attr('src');
// if(typeof(_$picSrc) != "undefined" && havaSalesman){
// if(erweimaRandnum > erweimaMaxNum){
// erweimaRandnum = 0;
// }
// $(this).find('.pic').attr('src', erweimaImages[erweimaRandnum]);
// $(this).find('.wechatid').html(erweimaIds[erweimaRandnum]);
// erweimaRandnum ++;
// }
_$show.show();
_$show.addClass('js-show');
}, function() {
var _$show = $(this).find('.js-float-contact-show');
_$show.hide();
_$show.removeClass('js-show');
});
}
});