passport.bind-password.js 2.71 KB
webpackJsonp([23],{0:function(e,t,n){n(34)},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(),o=setTimeout(function(){"block"===i.css("display")&&i.hide()},a))}var i,o,s=n(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=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 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 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,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}$/};e.exports={emailRegx:d,phoneRegx:u,bindEyesEvt:a,bindClearEvt:i,pwdValidate:o,selectCssHack:s}},34:function(e,t,n){function a(e){i.ajax({url:"/passport/bind/bindMobile",type:"post",data:{areaCode:v.replace("+",""),phoneNum:h,openId:p,sourceType:l,password:e,code:f},success:function(e){200===e.code?(r.show("登录成功"),setTimeout(function(){location.href=e.data.refer},2e3)):r.show(e.message)},error:function(){r.show("登录失败,请重试!")}})}var i=n(1),o=i("#pwd"),s=i("#btn-sure"),c=n(5),r=n(2),d=i.trim,u=r.show,l=i("#sourceType").val(),p=i("#openId").val(),h=i("#phone-num").val(),v=i("#area-code").val().replace("+",""),f=i("#code").val();c.bindEyesEvt({status:"open"}),o.bind("input",function(){""===d(o.val())?s.addClass("disable"):s.removeClass("disable")}),s.on("touchstart",function(){var e=d(o.val());s.hasClass("disable")||(c.pwdValidate(e)===!1?u("密码6-20位,请重新输入"):a(e))})}});