游侠客旅游网

正在加载验证码...

').appendTo("body");//提示信息框; msgobj.find("a.Validform_close").click(function () { msgobj.hide(); msghidden = true; if (errorobj) { errorobj.focus().addClass("Validform_error"); } return false; }).focus(function () { this.blur(); }); $(window).bind("scroll resize", function () { !msghidden && setCenter(msgobj, 400); }); }; //公用方法显示&关闭信息提示框; $.Showmsg = function (msg) { creatMsgbox(); Validform.util.showmsg.call(win, msg, 1, {}); }; $.Hidemsg = function () { msgobj.hide(); msghidden = true; }; })(jQuery, window); var regex = /^1[3456789]{1}\d{9}$/; var regeEmail = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/ if (window.name == 'indexlogin') { // 新人礼包登录注册 captchaObj.onReady(function () { }).onSuccess(function () { var mobile = $('input[name="logonId"]'); var number = '' $.post(ajaxVerifyCheck, {'mobile': mobile.val()}, function (json) { if (json.status == 1) { number = json.number; var tipPopup = $('.tip__popup__box') var result = captchaObj.getValidate(); if (!result) { tipPopup.fadeIn().find('span').text('请完成验证码操作!') setTimeout(function () { tipPopup.fadeOut() }, 2000) return false; } var mobile = $('input[name="logonId"]').val() var challenge = result.geetest_challenge; var validate = result.geetest_validate; var seccode = result.geetest_seccode; var params = { 'mobile': mobile, 'type': "autologin", 'geetest_challenge': challenge, 'geetest_validate': validate, 'geetest_seccode': seccode, 'number': number }; $.post(ajaxsms, params, function (json) { if (json.status == 1) { tipPopup.fadeIn().find('span').text('验证码已发送至 ' + mobile); setTimeout(function () { tipPopup.fadeOut() }, 2000); var time = 90, timeId; timeId = window.setInterval(function () { if (time -1 ? !1 : !0) $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text(html); } else { /*var objtip=o.obj.find('#msgdemo'); cssctl(objtip, o.type); objtip.text(msg);*/ } }, datatype: { //判断是否阅读 'read': function (gets, obj, curform, regxp) { if (gets.indexOf('on') == -1) return !1; }, 'password': function (gets, obj, curform, regxp) { var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/; if (!reg.test(gets)) return !1; } }, usePlugin: { passwordstrength: { minLen: 6, maxLen: 20 } }, beforeSubmit: function (curform) { $('.u-btn-reg').css('pointer-events', 'none'); //在验证成功后,表单提交前执行的函数,curform参数是当前表单对象。 //这里明确return false的话表单将不会提交; var p = $('#regFormStep1 #password').val(); for (var a = /[-/:;()$&@“.,?!’\[\]{}#%^*+=_\\|~€£¥•.,?!’\w]/, s = 0; s €£¥•.,?!’\w]{6,20}/; // if(!reg.test(p)) { // } var result = captchaObj.getValidate() if (!result) { $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text('请完成验证码操作'); $('.u-btn-reg').css('pointer-events', 'inherit'); return false; } }, callback: function (data) { if (data.status == 1) { $("#activation-exolain").text(data.msg); if (data.userGioData) { gio('setUserId', data.userGioData.Uid); gio('track', 'RegisterSuccess') gio('track', 'LoginSuccess', {'loginfrom': 'register'}) gio('people.set', { Sex: data.userGioData.Sex, Province: data.userGioData.Province, City: data.userGioData.City, Birth: data.userGioData.Birth, Occupation: data.userGioData.Occupation, Revenue: data.userGioData.Revenue, Education: data.userGioData.Education, Birthday: data.userGioData.Birthday, channel: data.userGioData.channel, CommunityLv: data.userGioData.CommunityLv, PaymentLv: data.userGioData.PaymentLv, RegisterChannel: data.userGioData.RegisterChannel, UserCategory: data.userGioData.UserCategory, }) } setTimeout(function () { window.location.href = data.referer; }, 500); } else { $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text(data.msg); $('.u-btn-reg').css('pointer-events', 'inherit'); captchaObj.reset(); } } }).addRule([ { ele: '#logonId', datatype: /^1[3456789]{1}\d{9}$/, nullmsg: '请输入手机号码', errormsg: '手机号码格式不正确', // ajaxurl: AJAX.check }, { ele: '#authcode', datatype: 'n6-6', nullmsg: '请填写短信验证码', errormsg: '短信码格式错误', }, { ele: '#password', datatype: '*6-20', nullmsg: '请填写密码', errormsg: '密码范围在6~20位之间的英文字母、数字和英文输入状态下的符号' }, { ele: '#read', datatype: 'read', nullmsg: '同意协议才能注册', sucmsg: '' }, ]); } else if (window.name == 'email') { // 邮箱注册 $('#regFormStep2').Validform({ btnSubmit: "#submit2", ignoreHidden: false, dragonfly: false, tipSweep: true, showAllError: false, postonce: false, ajaxPost: true, tiptype: function (msg, o, cssctl) { if (!o.obj.is('form')) { var objtip = o.obj.siblings('.u-form-explain'), html = !$.trim(msg) && o.obj.attr('name').indexOf('read') == -1 ? '' : msg; // cssctl(objtip, o.type); o.obj.is('#logonId') && (window.activation = objtip.attr('class').indexOf('Validform_wrong') > -1 ? !1 : !0) $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text(html); } else { /*var objtip=o.obj.find('#msgdemo'); cssctl(objtip, o.type); objtip.text(msg);*/ } }, datatype: { //判断是否阅读 'read': function (gets, obj, curform, regxp) { if (gets.indexOf('on') == -1) return !1; }, 'password': function (gets, obj, curform, regxp) { var reg = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/; if (!reg.test(gets)) return !1; } }, usePlugin: { passwordstrength: { minLen: 6, maxLen: 20 } }, beforeSubmit: function (curform) { $('.u-btn-reg').css('pointer-events', 'none'); //在验证成功后,表单提交前执行的函数,curform参数是当前表单对象。 //这里明确return false的话表单将不会提交; var p = $('#regFormStep2 #logonpwd').val(); var reg = /[-/:;()$&@“.,?!’\[\]{}#%^*+=_\\|~€£¥•.,?!’\w]{6,20}/; if (!reg.test(p)) { $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text('密码范围在6~20位之间的英文字母、数字和英文输入状态下的符号'); $('.u-btn-reg').css('pointer-events', 'inherit'); return false; } var result = captchaObj.getValidate() if (!result) { $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text('请完成验证码操作'); $('.u-btn-reg').css('pointer-events', 'inherit'); return false; } }, callback: function (data) { console.log(data) if (data.status == 1) { $("#activation-exolain").text(data.msg); // 数据埋点 if (data.userGioData) { gio('setUserId', data.userGioData.Uid); gio('track', 'RegisterSuccess') gio('track', 'LoginSuccess', {'loginfrom': 'register'}) gio('people.set', { Sex: data.userGioData.Sex, Province: data.userGioData.Province, City: data.userGioData.City, Birth: data.userGioData.Birth, Occupation: data.userGioData.Occupation, Revenue: data.userGioData.Revenue, Education: data.userGioData.Education, Birthday: data.userGioData.Birthday, channel: data.userGioData.channel, CommunityLv: data.userGioData.CommunityLv, PaymentLv: data.userGioData.PaymentLv, RegisterChannel: data.userGioData.RegisterChannel, UserCategory: data.userGioData.UserCategory, }) } setTimeout(function () { window.location.href = data.referer; }, 500); } else { $("#activation-exolain").attr("class", "u-form-explain Validform_checktip Validform_wrong"); $("#activation-exolain").text(data.msg); $('.u-btn-reg').css('pointer-events', 'inherit'); captchaObj.reset(); } } }).addRule([ { ele: '#logonId', datatype: 'e', nullmsg: '请输入邮箱地址', errormsg: '邮箱格式不正确', // ajaxurl: AJAX.check }, { ele: '#authcode', datatype: 'n6-6', nullmsg: '请填写邮箱验证码', errormsg: '邮箱验证码格式错误', }, { ele: '#logonpwd', datatype: '*6-20', nullmsg: '请填写密码', errormsg: '密码范围在6~20位之间的英文字母、数字和英文输入状态下的符号' }, { ele: '#read', datatype: 'read', nullmsg: '同意协议才能注册', sucmsg: '' }, ]); } if (window.name == 'password') { // 忘记密码手机找回 $('#forgetFormStep1').ajaxForm({ dataType: 'json', beforeSubmit: function (formData, jqForm, options) { $('.iptbtn').css('pointer-events', 'none'); // 函数节流 var e = $('#forgetFormStep1 #error-box'), auth = $('#forgetFormStep1 #authcode'), mobile = $('#forgetFormStep1 input[name="logonId"]'); if (!mobile.val()) { e.removeClass('ui-form-hide').html('请输入手机号码'); auth.focus(); $('.iptbtn').css('pointer-events', 'inherit'); return false } if (!regex.test(mobile.val())) { e.removeClass('ui-form-hide').text('手机号码格式不正确'); $('.iptbtn').css('pointer-events', 'inherit'); return false; } if (!auth.val()) { e.removeClass('ui-form-hide').html('请输入短信验证码'); auth.focus(); $('.iptbtn').css('pointer-events', 'inherit'); return false } var result = captchaObj.getValidate(); if (!result) { e.removeClass('ui-form-hide').html('请完成验证码操作'); $('.iptbtn').css('pointer-events', 'inherit'); return false; } }, success: function (data) { if (data.success) { window.location.href = data.refer; } else { $('#error-box').removeClass('ui-form-hide').text(data.msg); $('.iptbtn').css('pointer-events', 'inherit'); captchaObj.reset(); } } }); } else if (window.name == 'email_reset') { // 忘记密码邮箱找回 $('#forgetFormStep1-email').ajaxForm({ dataType: 'json', beforeSubmit: function (formData, jqForm, options) { $('.iptbtn').css('pointer-events', 'none'); var e = $('#forgetFormStep1-email #error-box'), email = $('#forgetFormStep1-email #logonId'), auth = $('#forgetFormStep1-email #authcode'); e.addClass('ui-form-hide').html(''); if (!email.val()) { e.removeClass('ui-form-hide').html('请输入邮箱账号'); l.focus(); $('.iptbtn').css('pointer-events', 'inherit'); return false } if (!regeEmail.test(email.val())) { e.removeClass('ui-form-hide').text('邮箱格式不正确'); $('.iptbtn').css('pointer-events', 'inherit'); return false; } if (!auth.val()) { e.removeClass('ui-form-hide').html('请输入邮箱验证码'); auth.focus(); $('.iptbtn').css('pointer-events', 'inherit'); return false } var result = captchaObj.getValidate(); if (!result) { e.removeClass('ui-form-hide').html('请完成验证码操作'); $('.iptbtn').css('pointer-events', 'inherit'); return false; } }, success: function (data) { if (data.success) { location.href = data.refer; } else { $('#error-box').removeClass('ui-form-hide').text(data.msg); $('.iptbtn').css('pointer-events', 'inherit'); captchaObj.reset(); } try { $('head').append(data.msg); } catch (e) { console.log(e) } } }); } if (window.name == 'oauth') { // 第三方信息登记 $('#oauthForm').ajaxForm({ dataType: 'json', beforeSubmit: function (formData, jqForm, options) { $('.submit').css('pointer-events', 'none'); // 函数节流 var e = $('#error-box'), auth = $('#oauthForm #authcode').val(), p = $('#password').val(); mobile = $('input[name="mobile"]').val(); if (!mobile) { e.removeClass('ui-form-hide').html('请输入手机号码'); $('.submit').css('pointer-events', 'inherit'); return false } if (!regex.test(mobile)) { e.removeClass('ui-form-hide').text('手机号码格式不正确'); $('.submit').css('pointer-events', 'inherit'); return false; } if (!auth) { e.removeClass('ui-form-hide').html('请输入短信验证码'); // auth.focus(); $('.submit').css('pointer-events', 'inherit'); return false } if (!p) { e.removeClass('ui-form-hide').html('请输入密码'); $('.submit').css('pointer-events', 'inherit'); return false } var a = /[-/:;()$&@“.,?!’\[\]{}#%^*+=_\\|~€£¥•.,?!’\w]{6,20}/ if (!a.test(p)) { e.removeClass('ui-form-hide').html('密码范围在6~20位之间的英文字母、数字和英文输入状态下的符号'); $('.submit').css('pointer-events', 'inherit'); return false; } var result = captchaObj.getValidate(); if (!result) { e.removeClass('ui-form-hide').html('请完成验证码操作'); $('.submit').css('pointer-events', 'inherit'); return false; } }, success: function (data) { if (data.status == 1 || data.status == -4) { if(data.status == 1) { if (data.userGioData) { gio('setUserId', data.userGioData.Uid); gio('track', 'RegisterSuccess') gio('track', 'LoginSuccess', {'loginfrom': 'register'}) gio('people.set', { Sex: data.userGioData.Sex, Province: data.userGioData.Province, City: data.userGioData.City, Birth: data.userGioData.Birth, Occupation: data.userGioData.Occupation, Revenue: data.userGioData.Revenue, Education: data.userGioData.Education, Birthday: data.userGioData.Birthday, channel: data.userGioData.channel, CommunityLv: data.userGioData.CommunityLv, PaymentLv: data.userGioData.PaymentLv, RegisterChannel: data.userGioData.RegisterChannel, UserCategory: data.userGioData.UserCategory, }) } } location.href = data.referer; } else { $('#error-box').removeClass('ui-form-hide').text(data.msg); $('.submit').css('pointer-events', 'inherit'); captchaObj.reset(); } try { $('head').append(data.msg); } catch (e) { console.log(e) } } }); } if (window.name == 'oauthLogin') { $('#oauthloginForm').ajaxForm({ dataType: 'json', beforeSubmit: function (formData, jqForm, options) { $('.submit').css('pointer-events', 'none'); // 函数节流 var e = $('#error-box'), p = $('#password'); l = $('input[name="logonId"]'); e.addClass('ui-form-hide').html(''); if (!l.val()) { e.removeClass('ui-form-hide').html('请输入帐户名'); l.focus(); $('.submit').css('pointer-events', 'inherit'); // 函数节流 return false } if (!regex.test(l.val()) && !regeEmail.test(l.val())) { e.removeClass('ui-form-hide').html('手机号码或邮箱格式不正确'); l.focus(); $('.submit').css('pointer-events', 'inherit'); // 函数节流 return false } if (!p.val()) { e.removeClass('ui-form-hide').html('请输入登录密码'); p.focus(); $('.submit').css('pointer-events', 'inherit'); // 函数节流 return false } var result = captchaObj.getValidate() if (!result) { e.removeClass('ui-form-hide').html('请完成验证码操作'); $('.submit').css('pointer-events', 'inherit'); // 函数节流 return false; } }, success: function (data) { if (data.status == 1 || data.status == -4) { // 数据埋点 if(data.status == 1) { if (data.userGioData) { gio('setUserId', data.userGioData.Uid); gio('track', 'RegisterSuccess') gio('track', 'LoginSuccess', {'loginfrom': 'register'}) gio('people.set', { Sex: data.userGioData.Sex, Province: data.userGioData.Province, City: data.userGioData.City, Birth: data.userGioData.Birth, Occupation: data.userGioData.Occupation, Revenue: data.userGioData.Revenue, Education: data.userGioData.Education, Birthday: data.userGioData.Birthday, channel: data.userGioData.channel, CommunityLv: data.userGioData.CommunityLv, PaymentLv: data.userGioData.PaymentLv, RegisterChannel: data.userGioData.RegisterChannel, UserCategory: data.userGioData.UserCategory, }) } } location.href = data.referer; } else { $('#error-box').removeClass('ui-form-hide').text(data.msg); $('.submit').css('pointer-events', 'inherit'); captchaObj.reset(); } try { $('head').append(data.result); } catch (e) { console.log(e) } } }); } } catch (error) { console.log(error); window.location.reload(); } }; $.ajax({ url: url + "?t=" + (new Date()).getTime(), type: "get", dataType: "json", success: function (data) { initGeetest({ gt: data.gt, challenge: data.challenge, product: "bind", offline: !data.success, new_captcha: data.new_captcha, lang: 'zh-cn', http: 'https' + '://', }, handlerEmbed); } }); }; (function () { geetest('https://www.youxiake.com/api/geetest/init'); })();

更多内容请跳转到 原文阅读全文