passport.code.js 3.58 KB
webpackJsonp([12],{0:function(e,a,t){t(38)},2:function(e,a,t){function n(e,a){var t,n;"undefined"!=typeof e&&(t=e.toString(),n=a&&a>0?a:2e3,o.text(t).show(),s=setTimeout(function(){"block"===o.css("display")&&o.hide()},n))}var o,s,i=t(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';i(".yoho-page").append(e),o=i("#yoho-tip"),o.on("touchend",function(){o.hide(),clearTimeout(s)})}(),a.show=n},5:function(e,a,t){function n(e){var a,t=c(".has-eye");e&&"open"===e.status?t.append('<div class="eye"></div>'):t.append('<div class="eye close"></div>'),a=t.children(".eye"),a.on("touchstart",function(e){var a=c(this),t=a.siblings(".pwd");e.preventDefault(),a.toggleClass("close"),a.hasClass("close")?t.attr("type","password"):t.attr("type","text"),t.focus()})}function o(){var e,a=c(".has-clear");a.append('<div class="clear-input"></div>'),e=a.children(".clear-input"),e.on("touchstart",function(a){var t=e.siblings(".input");t.val("").trigger("input").focus(),a.preventDefault()}),a.children(".input").bind("input",function(){var e=c(this),a=e.siblings(".clear-input"),t=r(e.val());""===t?a.hide():a.show()})}function s(e){return e.length>=6&&e.length<=20}function i(e){function a(){var a=e.find("option:selected").text().length;switch(a){case 2:e.outerWidth(90);break;case 3:e.outerWidth(110);break;default:e.outerWidth(130)}}var t=navigator.userAgent;t.match(/uc/i)&&t.match(/android/i)?e.change(function(){a()}):e.removeClass("in-android-uc")}var c=t(1),r=c.trim,d=/^([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:d,phoneRegx:l,bindEyesEvt:n,bindClearEvt:o,pwdValidate:s,selectCssHack:i}},14:function(e,a,t){var n=t(1);e.exports=function(e,a,o){function s(){n.ajax({url:a?"/passport/bind/bindMobile":"/passport/bind/relateMobile",type:"post",data:{areaCode:f.replace("+",""),phoneNum:v,openId:h,sourceType:p,nickname:u,password:"",code:m(r.val())},success:function(e){200===e.code?(g.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):g.show(e.message)},error:function(){g.show("登录失败,请重试!")}})}function i(){n.ajax({type:"POST",url:"/passport/"+C+"/verifycode",data:{phoneNum:v,areaCode:f,code:m(r.val()),token:n("#token").val()},success:function(e){200===e.code?location.href=e.data:y(e.message)}})}function c(){var e,a=59;e=setInterval(function(){0===a?(l.text("重新发送").removeClass("disable"),clearInterval(e)):l.text("重新发送 ("+a--+"秒)")},1e3)}var r=n("#captcha"),d=n("#btn-next"),l=n("#captcha-tip"),u=n("#nickname").val(),p=n("#sourceType").val(),h=n("#openId").val(),v=n("#phone-num").val(),f=n("#area-code").val().replace("+",""),b=t(5),g=t(2),m=n.trim,y=g.show,C=e?"reg":"back",w=parseInt(n("#isReg").val(),10);b.bindClearEvt(),r.bind("input",function(){""!==m(r.val())?d.removeClass("disable"):d.addClass("disable")}),l.on("touchstart",function(){l.hasClass("disable")||n.ajax({type:"POST",url:a||o?"/passport/bind/sendBindMsg":"/passport/"+C+"/sendcode",data:{phoneNum:v,areaCode:f},success:function(e){200===e.code?(l.text("重发验证码 (60秒)").addClass("disable"),c()):y(e.message)}})}),d.on("touchstart",function(){d.hasClass("disable")||(a||o?w?s():location.href="/passport/bind/password?phoneNum="+v+"&areaCode="+f+"&openId="+h+"&sourceType="+p+"&nickname="+u+"&code="+m(r.val()):i())}),c()}},38:function(e,a,t){t(14)(!0)}});