passport.reg.js 2.62 KB
webpackJsonp([20],{0:function(e,t,n){n(40)},2:function(e,t,n){function a(e,t){var n,a;"undefined"!=typeof e&&(n=e.toString(),a=t&&t>0?t:2e3,i.text(n).show(),o=setTimeout(function(){"block"===i.css("display")&&i.hide()},a))}var i,o,s=n(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';s(".yoho-page").append(e),i=s("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(o)})}(),t.show=a},5:function(e,t,n){function a(e){var t,n=c(".has-eye");e&&"open"===e.status?n.append('<div class="eye"></div>'):n.append('<div class="eye close"></div>'),t=n.children(".eye"),t.on("touchstart",function(e){var t=c(this),n=t.siblings(".pwd");e.preventDefault(),t.toggleClass("close"),t.hasClass("close")?n.attr("type","password"):n.attr("type","text"),n.focus()})}function i(){var e,t=c(".has-clear");t.append('<div class="clear-input"></div>'),e=t.children(".clear-input"),e.on("touchstart",function(t){var n=e.siblings(".input");n.val("").trigger("input").focus(),t.preventDefault()}),t.children(".input").bind("input",function(){var e=c(this),t=e.siblings(".clear-input"),n=r(e.val());""===n?t.hide():t.show()})}function o(e){return e.length>=6&&e.length<=20}function s(e){function t(){var t=e.find("option:selected").text().length;switch(t){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var n=navigator.userAgent;n.match(/uc/i)&&n.match(/android/i)?e.change(function(){t()}):e.removeClass("in-android-uc")}var c=n(1),r=c.trim,u=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,l={"+86":/^1[35847]{1}[0-9]{9}$/,"+852":/^[965]{1}[0-9]{7}$/,"+853":/^[0-9]{8}$/,"+886":/^[0-9]{10}$/,"+65":/^[98]{1}[0-9]{7}$/,"+60":/^1[1234679]{1}[0-9]{8}$/,"+1":/^[0-9]{10}$/,"+82":/^01[0-9]{9}$/,"+44":/^7[789][0-9]{8}$/,"+81":/^0[9|8|7][0-9]{9}$/,"+61":/^[0-9]{11}$/};e.exports={emailRegx:u,phoneRegx:l,bindEyesEvt:a,bindClearEvt:i,pwdValidate:o,selectCssHack:s}},40:function(e,t,n){var a=n(1),i=a("#phone-num"),o=a("#country-select"),s=a("#area-code"),c=a("#btn-next"),r=n(5),u=n(2),l=a.trim,d=u.show,p=!1;r.selectCssHack(a("#country-select")),r.bindClearEvt(),i.bind("input",function(){""===l(i.val())?c.addClass("disable"):c.removeClass("disable")}),o.change(function(){s.text(o.val())}),c.on("touchstart",function(){var e=l(i.val()),t=o.val();if(!c.hasClass("disable"))return p?!1:void(r.phoneRegx[t].test(e)?(p=!0,a.ajax({url:"/passport/reg/verifymobile",type:"POST",data:{areaCode:t.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:(d(e.message),p=!1)},error:function(){d("出错了,请重试"),p=!1}})):d("手机号格式不正确,请重新输入"))})}});