passport.back-mobile.js
2.58 KB
webpackJsonp([25],{0:function(e,t,n){n(30)},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(),s=setTimeout(function(){"block"===i.css("display")&&i.hide()},a))}var i,s,o=n(1);!function(){var e='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(e),i=o("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(s)})}(),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 s(e){return e.length>=6&&e.length<=20}function o(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}$/,d={"+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:d,bindEyesEvt:a,bindClearEvt:i,pwdValidate:s,selectCssHack:o}},30:function(e,t,n){var a=n(1),i=a("#phone-num"),s=a("#country-select"),o=a("#area-code"),c=a("#btn-next"),r=n(5),u=n(2),d=a.trim,l=u.show;r.selectCssHack(a("#country-select")),r.bindClearEvt(),i.bind("input",function(){""===d(i.val())?c.addClass("disable"):c.removeClass("disable")}),s.change(function(){o.text(s.val())}),c.on("touchstart",function(){var e=d(i.val()),t=d(s.val());c.hasClass("disable")||(t&&e&&r.phoneRegx[t].test(e)?a.ajax({url:"/passport/back/sendcode",type:"POST",data:{areaCode:t.replace("+",""),phoneNum:e},success:function(e){200===e.code?location.href=e.data:l(e.message)}}):l(t?"手机号格式不正确,请重新输入":"出错了,请重新刷新页面"))})}});