passport.password.js
2.5 KB
webpackJsonp([21],{0:function(t,e,a){a(39)},2:function(t,e,a){function n(t,e){var a,n;"undefined"!=typeof t&&(a=t.toString(),n=e&&e>0?e:2e3,i.text(a).show(),s=setTimeout(function(){"block"===i.css("display")&&i.hide()},n))}var i,s,o=a(1);!function(){var t='<div id="yoho-tip" class="yoho-tip"></div>';o(".yoho-page").append(t),i=o("#yoho-tip"),i.on("touchend",function(){i.hide(),clearTimeout(s)})}(),e.show=n},5:function(t,e,a){function n(t){var e,a=c(".has-eye");t&&"open"===t.status?a.append('<div class="eye"></div>'):a.append('<div class="eye close"></div>'),e=a.children(".eye"),e.on("touchstart",function(t){var e=c(this),a=e.siblings(".pwd");t.preventDefault(),e.toggleClass("close"),e.hasClass("close")?a.attr("type","password"):a.attr("type","text"),a.focus()})}function i(){var t,e=c(".has-clear");e.append('<div class="clear-input"></div>'),t=e.children(".clear-input"),t.on("touchstart",function(e){var a=t.siblings(".input");a.val("").trigger("input").focus(),e.preventDefault()}),e.children(".input").bind("input",function(){var t=c(this),e=t.siblings(".clear-input"),a=r(t.val());""===a?e.hide():e.show()})}function s(t){return t.length>=6&&t.length<=20}function o(t){function e(){var e=t.find("option:selected").text().length;switch(e){case 2:t.outerWidth(90);break;case 3:t.outerWidth(110);break;default:t.outerWidth(130)}}var a=navigator.userAgent;a.match(/uc/i)&&a.match(/android/i)?t.change(function(){e()}):t.removeClass("in-android-uc")}var c=a(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}$/,u={"+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}$/};t.exports={emailRegx:d,phoneRegx:u,bindEyesEvt:n,bindClearEvt:i,pwdValidate:s,selectCssHack:o}},39:function(t,e,a){var n=a(1),i=n("#pwd"),s=n("#btn-sure"),o=a(5),c=a(2),r=n.trim,d=c.show;o.bindEyesEvt({status:"open"}),i.bind("input",function(){""===r(i.val())?s.addClass("disable"):s.removeClass("disable")}),s.on("touchstart",function(){var t=r(i.val());s.hasClass("disable")||(o.pwdValidate(t)===!1?d("密码6-20位,请重新输入"):n.ajax({type:"POST",url:"/passport/reg/setpassword",data:{password:t,phoneNum:n("#phone-num").val(),areaCode:n("#area-code").val(),token:n("#token").val()},success:function(t){var e=t.data;200===t.code?(d("注册成功"),location.href=e.href):d(t.message)}}))})}});