passport.back-email.js 2.39 KB
webpackJsonp([26],{0:function(t,e,a){a(29)},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=l(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),l=c.trim,r=/^([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}$/};t.exports={emailRegx:r,phoneRegx:d,bindEyesEvt:n,bindClearEvt:i,pwdValidate:s,selectCssHack:o}},29:function(t,e,a){var n=a(1),i=n("#email"),s=n("#btn-sure"),o=a(5),c=a(2),l=n.trim,r=c.show;o.bindClearEvt(),i.bind("input",function(){""===l(i.val())?s.addClass("disable"):s.removeClass("disable")}),s.on("touchstart",function(){var t=l(i.val());s.hasClass("disable")||(o.emailRegx.test(t)?n.ajax({url:"/passport/back/sendemail",type:"POST",data:{email:t},success:function(t){console.log(t),200===t.code?location.href=t.data:r(t.message)}}):r("邮箱格式不正确,请重新输入"))})}});