};
var timeout2;
var qrCodeId = null;
var checkScanStatus = function(interval, timeout){
if(qrCodeId){
$.post('/member/checkScanStatus',{qrCodeId:qrCodeId},function (resp) {
if(resp.state == 1100){
// window.location.href='/index';
window.location.reload()
}
else if(resp.state == 9999){
clearTimeout(timeout);
$('.scancode>img').attr('src', '/Public/pc/img/thdQrcodeLoginExpired.png');
$('.scancode').after('
刷新二维码
')
//$('.scantip').html('打开庭好的APP客户端
扫一扫登录');
return;
}
else{
if(resp.state == 1102){
if(!$('.scantip').hasClass('scaned')){
$('.scantip').html('扫描成功
请在"庭好的"APP中点击确认即可登录').addClass('scaned');
}
}
timeout = setTimeout(function(){
checkScanStatus(interval,timeout);
}, interval);
}
});
}
else{
timeout = setTimeout(function(){
checkScanStatus(interval,timeout);
}, interval);
}
}
checkScanStatus(1000, timeout2);
$('.ajaxFormSms .vcode-get').on('click', function(){
if(!!$(this).attr('disabled')){
return false;
}
var tel = $('#tel').val();
var that = this;
$.post('/member/sendSmsbd',{smsMobile:tel},function (resp) {
if(resp.state == 1100){
// console.log(resp);
// console.log(resp.state);
// console.log(resp.message);
BtnCount(that, 60, timeout);
}
else{
$(that).attr('disabled',false);
// console.log(resp);
// console.log(resp.state);
// console.log(resp.message);
$.alertMsg('alert1', resp.message, 2000, true, '.loginall_box');
}
});
})
$('.eye').on('click', function(){
if($(this).hasClass('closed')){
$(this).siblings('input[type=password]').attr('type', 'text');
$(this).removeClass('closed').addClass('open');
}
else{
$(this).siblings('input[type=text]').attr('type', 'password');
$(this).removeClass('open').addClass('closed');
}
});
$('.ajaxFormSms').ajaxForm({
dataType: 'json',
beforeSubmit: function () {
if(!$('.part_vcode').ValidateRules(true)){
return false;
}
},
success: function (result) {
if(result.state == '1100'){
// window.location.href=result.cityUrl;
window.location.reload();
}else{
$.alertMsg('alert1', result.message, 2000, true, '.loginall_box');
}
},
error: function () {
}
});
$('.ajaxFormPass').ajaxForm({
dataType: 'json',
beforeSubmit: function () {
if(!$('.part_psd').ValidateRules(true))
{
return false;
}
},
success: function (result) {
if(result.state == '1100'){
// window.location.href=result.cityUrl;
window.location.reload();
}else{
$.alertMsg('alert1', result.message, 2000, true, '.loginall_box');
}
},
error: function () {
}
});
//微信扫码登录
function weixinLogin() {
var obj = new WxLogin({
self_redirect:true,
id:"js-weixin-login",
appid: "wxc27d40bac058da1d",
scope: "snsapi_login",
redirect_uri: "https%3A%2F%2Fwww.thd99.com%2Fmember%2FwechatQrLoginCode",
state: "",
style: "black",
href: ""
});
}
})(jQuery, template);