passport.back-new-password.js 2.65 KB
webpackJsonp([24],{0:function(e,t,a){a(31)},2:function(e,t,a){function n(e,t){var a,n;"undefined"!=typeof e&&(a=e.toString(),n=t&&t>0?t:2e3,i.text(a).show(),o=setTimeout(function(){"block"===i.css("display")&&i.hide()},n))}var i,o,s=a(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=n},5:function(e,t,a){function n(e){var t,a=c(".has-eye");e&&"open"===e.status?a.append('<div class="eye"></div>'):a.append('<div class="eye close"></div>'),t=a.children(".eye"),t.on("touchstart",function(e){var t=c(this),a=t.siblings(".pwd");e.preventDefault(),t.toggleClass("close"),t.hasClass("close")?a.attr("type","password"):a.attr("type","text"),a.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 a=e.siblings(".input");a.val("").trigger("input").focus(),t.preventDefault()}),t.children(".input").bind("input",function(){var e=c(this),t=e.siblings(".clear-input"),a=d(e.val());""===a?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 a=navigator.userAgent;a.match(/uc/i)&&a.match(/android/i)?e.change(function(){t()}):e.removeClass("in-android-uc")}var c=a(1),d=c.trim,r=/^([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:r,phoneRegx:l,bindEyesEvt:n,bindClearEvt:i,pwdValidate:o,selectCssHack:s}},31:function(e,t,a){var n=a(1),i=n("#pwd"),o=n("#btn-ok"),s=a(5),c=a(2),d=n.trim,r=c.show,l=n("#phone-num");s.bindEyesEvt({status:"open"}),i.bind("input",function(){""===d(i.val())?o.addClass("disable"):o.removeClass("disable")}),o.on("touchstart",function(){var e,t,a=d(i.val()),c=!0;o.hasClass("disable")||(e={password:a},0===l.length&&(c=!1),c?(n.extend(e,{phoneNum:l.val(),areaCode:n("#area-code").val(),token:n("#token").val()}),t="/passport/back/passwordByMobile"):(n.extend(e,{code:n("#email-code").val()}),t="/passport/back/passwordByEmail"),s.pwdValidate(a)?n.ajax({type:"POST",url:t,data:e,success:function(e){200===e.code?(r("密码修改成功"),setTimeout(function(){location.href=e.data},1e3)):r(e.message)}}):r("密码6-20位,请重新输入"))})}});