login.js 27.9 KB
webpackJsonp([3],{166:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o,r=g(n(134)),l=g(n(136)),u=g(n(130)),i=g(n(457)),s=g(n(81)),c=g(n(131)),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();n(135),n(137),n(129),n(458),n(82),n(132);var d=n(0),p=g(d),m=(n(13),g(n(5))),h=n(79),v=n(80),b=n(146);n(589);var y=g(n(36));function g(e){return e&&e.__esModule?e:{default:e}}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=(o=a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e,t){if("phone"==e)t.replace(/\s/g,"").length<11?n.setState(C({hasError:!0},e,t)):n.setState(C({hasError:!1},e,t));else if("password"==e){/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z_]{6,}$/.test(t)?n.setState(C({hasError_password:!1},e,t)):n.setState(C({hasError_password:!0},e,t))}else"password2"==e?t!=n.state.password?n.setState(C({hasError_password2:!0},e,t)):n.setState(C({hasError_password2:!1},e,t)):n.setState(C({},e,t))},n.getSms=function(){var e=n.state,t=e.phone;if(e.hasError)c.default.info("请输入正确的手机号码",1);else{var a=60;if(!n.codeInterval){var o=n.refs.codeBtn;o.innerText=a+"s后重新获取",n.codeInterval=setInterval(function(){if(!--a)return clearInterval(n.codeInterval),n.codeInterval=null,void(o.innerText="重新获取");o.innerText=a+"s后重新获取"},1e3),"/forgetPassword"==n.pathname?n.props.dispatch((0,b.resetPasswordSms)({phone:t},function(e){c.default.info(e.message,1)})):n.props.dispatch((0,b.getRegisterSms)({phone:t},function(e){c.default.info(e.message,1)}))}}},n.login=function(){var e=n.state,t=e.phone,a=e.password,o=e.code,r=e.hasError,l=e.hasError_password,u=e.hasError_password2;r?c.default.info("请输入正确的手机号码",1):l?c.default.info("请输入6位以上数字和字母组合的密码",1):u?c.default.info("两次输入密码不一致",1):""!=o?"/forgetPassword"==n.pathname?n.props.dispatch((0,b.resetPassword)({phone:t,password:y.default.md5(a),smsVerify:o},function(e){0==e.code&&setTimeout(function(){n.context.router.replace("/login")},300),c.default.info(e.message,1)})):n.props.dispatch((0,b.userResister)({phone:t,password:y.default.md5(a),smsVerify:o},function(e){0==e.code&&n.props.dispatch(userLogin({phone:t,password:y.default.md5(a)},function(e){0==e.code&&setTimeout(function(){n.context.router.replace("/home")},300)})),c.default.info(e.message,1)})):c.default.info("请输入手机验证码",1)},n.state={phone:"",password:""},n.codeInterval=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,d.Component),f(t,[{key:"componentWillMount",value:function(){var e=this.context.router.location.pathname;this.pathname=e,this.props.dispatch((0,v.changeNavbarTitle)("/forgetPassword"==this.pathname?"忘记密码":"注册"))}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){clearInterval(this.codeInterval),this.codeInterval=null}},{key:"render",value:function(){return p.default.createElement("div",{className:"login-content",style:{height:document.documentElement.clientHeight-90}},p.default.createElement("div",{className:"center"},p.default.createElement(s.default,{size:"lg"}),p.default.createElement(r.default,{size:"md"},p.default.createElement(u.default,null,p.default.createElement(i.default,{type:"text",placeholder:"输入手机号",error:this.state.hasError,onErrorClick:this.onErrorClick,onChange:this.onChange.bind(this,"phone"),value:this.state.phone},p.default.createElement("i",{className:"iconfont icon-phone"})),p.default.createElement(i.default,{type:"text",placeholder:"请输入验证码",onChange:this.onChange.bind(this,"code"),value:this.state.code},p.default.createElement("i",{className:"iconfont icon-code"}),p.default.createElement("span",{className:"code-btn",ref:"codeBtn",onClick:this.getSms},"获取验证码")),p.default.createElement(i.default,{type:"password",placeholder:"/forgetPassword"==this.pathname?"请输入新密码":"6位以上数字和字母组合",onChange:this.onChange.bind(this,"password"),value:this.state.password},p.default.createElement("i",{className:"iconfont icon-password"})),p.default.createElement(i.default,{type:"password",placeholder:"forgetPassword"==this.pathname?"请确认新密码":"再次确认密码",onChange:this.onChange.bind(this,"password2"),value:this.state.password2},p.default.createElement("i",{className:"iconfont icon-password"}))),p.default.createElement(l.default,{className:"btn",onClick:this.login},"/forgetPassword"==this.pathname?"确定":"注册"))))}}]),t}(),a.contextTypes={router:m.default.object.isRequired},o);t.default=(0,h.connect)(function(e){return{}})(k)},445:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o,r=g(n(134)),l=g(n(136)),u=g(n(130)),i=g(n(457)),s=g(n(131)),c=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();n(135),n(137),n(129),n(458),n(132);var f=n(0),d=g(f),p=(n(13),g(n(5))),m=n(79),h=n(80),v=n(146);n(589);var b=g(n(36)),y=n(14);function g(e){return e&&e.__esModule?e:{default:e}}var C=(o=a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e,t){n.setState(function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},e,t))},n.login=function(){var e=n.props.location.query.redirectUrl,t=n.state,a=t.phone,o=t.password;a.replace(/\s/g,"").length<11?s.default.info("请输入手机号",1):""!=o?n.props.dispatch((0,v.userLogin)({phone:a,password:b.default.md5(o)},function(t){0==t.code&&(e?encodeURI(e).includes("?")?location.href=encodeURI(e)+"&loginMbgRedirectToken="+y.storage.get("token"):location.href=encodeURI(e)+"?loginMbgRedirectToken="+y.storage.get("token"):setTimeout(function(){n.context.router.goBack()},300)),s.default.info(t.message,1)})):s.default.info("请输入登录密码",1)},n.state={phone:"",password:""},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,f.Component),c(t,[{key:"componentWillMount",value:function(){this.props.dispatch((0,h.changeNavbarTitle)("用户登录"))}},{key:"componentDidMount",value:function(){}},{key:"render",value:function(){var e=this;return d.default.createElement("div",{className:"login-content"},d.default.createElement("div",{className:"center"},d.default.createElement("div",{className:"header"},d.default.createElement("img",{src:n(481)})),d.default.createElement(r.default,{size:"md"},d.default.createElement(u.default,null,d.default.createElement(i.default,{type:"text",placeholder:"手机号",onChange:this.onChange.bind(this,"phone"),value:this.state.phone,clear:!0},d.default.createElement("i",{className:"iconfont icon-phone"})),d.default.createElement(i.default,{type:"password",placeholder:"登录密码",onChange:this.onChange.bind(this,"password"),value:this.state.password},d.default.createElement("i",{className:"iconfont icon-password"}))),d.default.createElement("div",{className:"bottom"},d.default.createElement("span",{className:"span",onClick:function(){setTimeout(function(){e.context.router.push("/forgetPassword")},300)}},"忘记密码")),d.default.createElement(l.default,{className:"btn",onClick:this.login},"登录"),d.default.createElement("div",{className:"login-express"},d.default.createElement("div",null,"登录说明:"),d.default.createElement("div",null,"1、新微商账号,请用新微商账号密码登录。"),d.default.createElement("div",null,"2、云购账号,请重置密码再登录。"),d.default.createElement("div",null,"注:若新微商账号与云购账号相同,请用新微商账号密码登录。")))))}}]),t}(),a.contextTypes={router:p.default.object.isRequired},o);t.default=(0,m.connect)(function(e){return{}})(C)},446:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o,r=g(n(134)),l=g(n(136)),u=g(n(130)),i=g(n(457)),s=g(n(81)),c=g(n(131)),f=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}();n(135),n(137),n(129),n(458),n(82),n(132);var d=n(0),p=g(d),m=(n(13),g(n(5))),h=n(79),v=n(80),b=n(146),y=g(n(36));function g(e){return e&&e.__esModule?e:{default:e}}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var k=(o=a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e,t){"phone"==e?t.replace(/\s/g,"").length<11?n.setState(C({hasError:!0},e,t)):n.setState(C({hasError:!1},e,t)):n.setState(C({},e,t))},n.getSms=function(){var e=n.state,t=e.phone;if(e.hasError)c.default.info("请输入正确的手机号码",1);else{var a=60;if(!n.codeInterval){var o=n.refs.codeBtn;o.innerText=a+"s后重新获取",n.codeInterval=setInterval(function(){if(!--a)return clearInterval(n.codeInterval),n.codeInterval=null,void(o.innerText="重新获取");o.innerText=a+"s后重新获取"},1e3),n.props.dispatch((0,b.getLoginSms)({phone:t},function(e){c.default.info(e.message,1)}))}}},n.login=function(){var e=n.state,t=e.phone,a=e.code;e.hasError?c.default.info("请输入正确的手机号码",1):""!=a?n.props.dispatch((0,b.quickLogin)({phone:t,smsVerify:a},function(e){0==e.code&&setTimeout(function(){n.context.router.goBack()},300),c.default.info(e.message,1)})):c.default.info("请输入手机验证码",1)},n.state={phone:"",password:""},n.codeInterval=null,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,d.Component),f(t,[{key:"componentWillMount",value:function(){this.props.dispatch((0,v.changeNavbarTitle)("快速登录"))}},{key:"componentDidMount",value:function(){}},{key:"componentWillUnmount",value:function(){clearInterval(this.codeInterval),this.codeInterval=null}},{key:"render",value:function(){return p.default.createElement("div",{className:"login-content",style:{height:document.documentElement.clientHeight-45*y.default.multiple}},p.default.createElement("div",{className:"center"},p.default.createElement(s.default,{size:"lg"}),p.default.createElement(r.default,{size:"md"},p.default.createElement(u.default,null,p.default.createElement(i.default,{type:"text",placeholder:"输入手机号",error:this.state.hasError,onErrorClick:this.onErrorClick,onChange:this.onChange.bind(this,"phone"),value:this.state.phone},p.default.createElement("i",{className:"iconfont icon-phone"})),p.default.createElement(i.default,{type:"text",placeholder:"请输入验证码",onChange:this.onChange.bind(this,"code"),value:this.state.code},p.default.createElement("i",{className:"iconfont icon-code"}),p.default.createElement("span",{className:"code-btn",ref:"codeBtn",onClick:this.getSms},"获取验证码"))),p.default.createElement(l.default,{style:{marginTop:"100px"},className:"btn",onClick:this.login},"登录"))))}}]),t}(),a.contextTypes={router:m.default.object.isRequired},o);t.default=(0,h.connect)(function(e){return{}})(k)},457:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=v(n(6)),o=v(n(12)),r=v(n(1)),l=v(n(4)),u=v(n(2)),i=v(n(3)),s=v(n(0)),c=v(n(5)),f=v(n(7)),d=v(n(483)),p=v(n(484)),m=n(460),h=v(n(37));function v(e){return e&&e.__esModule?e:{default:e}}var b=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&(n[a[o]]=e[a[o]])}return n};function y(){}function g(e){return void 0===e||null===e?"":e}var C=function(e){function t(e){(0,r.default)(this,t);var n=(0,u.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onInputChange=function(e){var t=e.target.value,a=n.props,o=a.onChange;switch(a.type){case"text":break;case"bankCard":t=t.replace(/\D/g,"").replace(/(....)(?=.)/g,"$1 ");break;case"phone":var r=(t=t.replace(/\D/g,"").substring(0,11)).length;r>3&&r<8?t=t.substr(0,3)+" "+t.substr(3):r>=8&&(t=t.substr(0,3)+" "+t.substr(3,4)+" "+t.substr(7));break;case"number":t=t.replace(/\D/g,"")}"value"in n.props?n.setState({value:n.props.value}):n.setState({value:t}),o&&o(t)},n.onInputFocus=function(e){n.debounceTimeout&&(clearTimeout(n.debounceTimeout),n.debounceTimeout=null),n.setState({focus:!0}),n.props.onFocus&&n.props.onFocus(e)},n.onInputBlur=function(e){n.inputRef&&(n.debounceTimeout=setTimeout(function(){document.activeElement!==n.inputRef.inputRef&&n.setState({focus:!1})},200)),n.props.onBlur&&n.props.onBlur(e)},n.onExtraClick=function(e){n.props.onExtraClick&&n.props.onExtraClick(e)},n.onErrorClick=function(e){n.props.onErrorClick&&n.props.onErrorClick(e)},n.clearInput=function(){"password"!==n.props.type&&n.props.updatePlaceholder&&n.setState({placeholder:n.props.value}),n.setState({value:""}),n.props.onChange&&n.props.onChange(""),n.focus()},n.focus=function(){n.inputRef.focus()},n.state={placeholder:e.placeholder,value:e.value||e.defaultValue||""},n}return(0,i.default)(t,e),(0,l.default)(t,[{key:"componentWillReceiveProps",value:function(e){"placeholder"in e&&!e.updatePlaceholder&&this.setState({placeholder:e.placeholder}),"value"in e&&this.setState({value:e.value})}},{key:"componentWillUnmount",value:function(){this.debounceTimeout&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=null)}},{key:"render",value:function(){var e,t,r=this,l=this.props,u=l.prefixCls,i=l.prefixListCls,c=l.editable,v=l.style,y=l.clear,C=l.children,k=l.error,E=l.className,_=l.extra,w=l.labelNumber,x=(l.onExtraClick,l.onErrorClick,l.updatePlaceholder,l.type),O=(l.locale,l.moneyKeyboardAlign),P=b(l,["prefixCls","prefixListCls","editable","style","clear","children","error","className","extra","labelNumber","onExtraClick","onErrorClick","updatePlaceholder","type","locale","moneyKeyboardAlign"]),I=P.defaultValue,N=P.name,j=P.disabled,L=P.maxLength,S=this.state.value,T=(0,m.getComponentLocale)(this.props,this.context,"InputItem",function(){return n(488)}).confirmLabel,B=this.state,K=B.placeholder,R=B.focus,M=(0,f.default)(i+"-item",u+"-item",i+"-item-middle",E,(e={},(0,o.default)(e,u+"-disabled",j),(0,o.default)(e,u+"-error",k),(0,o.default)(e,u+"-focus",R),(0,o.default)(e,u+"-android",R),e)),F=(0,f.default)(u+"-label",(t={},(0,o.default)(t,u+"-label-2",2===w),(0,o.default)(t,u+"-label-3",3===w),(0,o.default)(t,u+"-label-4",4===w),(0,o.default)(t,u+"-label-5",5===w),(0,o.default)(t,u+"-label-6",6===w),(0,o.default)(t,u+"-label-7",7===w),t)),D=u+"-control",z="text";"bankCard"===x||"phone"===x?z="tel":"password"===x?z="password":"digit"===x?z="number":"text"!==x&&"number"!==x&&(z=x);var U=void 0;"number"===x&&(U={pattern:"[0-9]*"});var W=void 0;return"digit"===x&&(W={className:"h5numInput"}),s.default.createElement("div",{className:M},s.default.createElement("div",{className:i+"-line"},C?s.default.createElement("div",{className:F},C):null,s.default.createElement("div",{className:D},"money"===x?s.default.createElement(p.default,{value:g(S),defaultValue:I,type:x,ref:function(e){return r.inputRef=e},maxLength:L,placeholder:K,onChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,disabled:j,editable:c,prefixCls:u,style:v,confirmLabel:T,moneyKeyboardAlign:O}):s.default.createElement(d.default,(0,a.default)({},U,P,W,{value:g(S),defaultValue:I,ref:function(e){return r.inputRef=e},style:v,type:z,maxLength:L,name:N,placeholder:K,onChange:this.onInputChange,onFocus:this.onInputFocus,onBlur:this.onInputBlur,readOnly:!c,disabled:j}))),y&&c&&!j&&S&&(""+S).length>0?s.default.createElement(h.default,{activeClassName:u+"-clear-active"},s.default.createElement("div",{className:u+"-clear",onClick:this.clearInput})):null,k?s.default.createElement("div",{className:u+"-error-extra",onClick:this.onErrorClick}):null,""!==_?s.default.createElement("div",{className:u+"-extra",onClick:this.onExtraClick},_):null))}}]),t}(s.default.Component);C.defaultProps={prefixCls:"am-input",prefixListCls:"am-list",type:"text",editable:!0,disabled:!1,placeholder:"",clear:!1,onChange:y,onBlur:y,onFocus:y,extra:"",onExtraClick:y,error:!1,onErrorClick:y,labelNumber:5,updatePlaceholder:!1,moneyKeyboardAlign:"right"},C.contextTypes={antLocale:c.default.object},t.default=C,e.exports=t.default},458:function(e,t,n){"use strict";n(11),n(129),n(489)},460:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a,o=n(6),r=(a=o)&&a.__esModule?a:{default:a};t.getComponentLocale=function(e,t,n,a){var o={};if(t&&t.antLocale&&t.antLocale[n])o=t.antLocale[n];else{var l=a();o=l.default||l}var u=(0,r.default)({},o);e.locale&&(u=(0,r.default)({},u,e.locale),e.locale.lang&&(u.lang=(0,r.default)({},o.lang,e.locale.lang)));return u},t.getLocaleCode=function(e){var t=e.antLocale&&e.antLocale.locale;if(e.antLocale&&e.antLocale.exist&&!t)return"zh-cn";return t}},481:function(e,t,n){e.exports=n.p+"images/3liQqzsSV1.jpg"},483:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=s(n(6)),o=s(n(1)),r=s(n(4)),l=s(n(2)),u=s(n(3)),i=s(n(0));function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&(n[a[o]]=e[a[o]])}return n},f=function(e){function t(){(0,o.default)(this,t);var e=(0,l.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onInputBlur=function(t){var n=t.target.value;e.props.onBlur&&e.props.onBlur(n)},e.onInputFocus=function(t){var n=t.target.value;e.props.onFocus&&e.props.onFocus(n)},e.focus=function(){e.inputRef.focus()},e}return(0,u.default)(t,e),(0,r.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=(t.onBlur,t.onFocus,c(t,["onBlur","onFocus"]));return i.default.createElement("input",(0,a.default)({ref:function(t){return e.inputRef=t},onBlur:this.onInputBlur,onFocus:this.onInputFocus},n))}}]),t}(i.default.Component);t.default=f,e.exports=t.default},484:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=p(n(1)),o=p(n(4)),r=p(n(2)),l=p(n(3)),u=p(n(0)),i=p(n(33)),s=p(n(7)),c=p(n(485)),f=p(n(486)),d=n(487);function p(e){return e&&e.__esModule?e:{default:e}}var m=!!i.default.createPortal,h=null,v=function(e){function t(e){(0,a.default)(this,t);var n=(0,r.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.onChange=function(e){"value"in n.props||n.setState({value:e.target.value}),n.props.onChange(e)},n.addBlurListener=function(){document.addEventListener("click",n.doBlur,!1)},n.removeBlurListener=function(){document.removeEventListener("click",n.doBlur,!1)},n.saveRef=function(e){m&&(h=e)},n.doBlur=function(e){var t=n.state.value;e.target!==n.inputRef&&n.onInputBlur(t)},n.unLinkInput=function(){h&&h.linkedInput&&h.linkedInput===n&&(h.linkedInput=null,(0,d.addClass)(h.antmKeyboard,n.props.keyboardPrefixCls+"-wrapper-hide")),n.removeBlurListener()},n.onInputBlur=function(e){n.state.focus&&(n.setState({focus:!1}),n.props.onBlur(e),setTimeout(function(){n.unLinkInput()},50))},n.onInputFocus=function(){var e=n.state.value;n.props.onFocus(e),n.setState({focus:!0},function(){h.linkedInput=n,(0,d.removeClass)(h.antmKeyboard,n.props.keyboardPrefixCls+"-wrapper-hide"),h.confirmDisabled=""===e,""===e?(0,d.addClass)(h.confirmKeyboardItem,n.props.keyboardPrefixCls+"-item-disabled"):(0,d.removeClass)(h.confirmKeyboardItem,n.props.keyboardPrefixCls+"-item-disabled")})},n.onKeyboardClick=function(e){var t=n.props.maxLength,a=n.state.value,o=n.onChange,r=void 0;"delete"===e?o({target:{value:r=a.substring(0,a.length-1)}}):"confirm"===e?(o({target:{value:r=a}}),n.onInputBlur(a)):"hide"===e?(r=a,n.onInputBlur(r)):o(void 0!==t&&+t>=0&&(a+e).length>t?{target:{value:r=(a+e).substr(0,t)}}:{target:{value:r=a+e}}),h.confirmDisabled=""===r,""===r?(0,d.addClass)(h.confirmKeyboardItem,n.props.keyboardPrefixCls+"-item-disabled"):(0,d.removeClass)(h.confirmKeyboardItem,n.props.keyboardPrefixCls+"-item-disabled")},n.onFakeInputClick=function(){n.focus()},n.focus=function(){n.removeBlurListener(),n.state.focus||n.onInputFocus(),setTimeout(function(){n.addBlurListener()},50)},n.state={focus:!1,value:e.value||""},n}return(0,l.default)(t,e),(0,o.default)(t,[{key:"componentWillReceiveProps",value:function(e){"value"in e&&this.setState({value:e.value})}},{key:"componentDidMount",value:function(){this.renderCustomKeyboard()}},{key:"componentWillUnmount",value:function(){this.state.focus&&this.props.onBlur(this.state.value),this.unLinkInput()}},{key:"getComponent",value:function(){var e=this.props,t=e.keyboardPrefixCls,n=e.confirmLabel;return u.default.createElement(c.default,{ref:this.saveRef,onClick:this.onKeyboardClick,preixCls:t,confirmLabel:n})}},{key:"getContainer",value:function(){var e=document.querySelector("#"+this.props.keyboardPrefixCls+"-container");return e||((e=document.createElement("div")).setAttribute("id",this.props.keyboardPrefixCls+"-container"),document.body.appendChild(e)),this.container=e,e}},{key:"renderCustomKeyboard",value:function(){m||h||(h=i.default.unstable_renderSubtreeIntoContainer(this,this.getComponent(),this.getContainer()))}},{key:"renderPortal",value:function(){var e=this;return m?u.default.createElement(f.default,{getContainer:function(){return e.getContainer()}},this.getComponent()):null}},{key:"render",value:function(){var e=this,t=this.props,n=t.placeholder,a=t.disabled,o=t.editable,r=t.moneyKeyboardAlign,l=this.state,i=l.focus,c=l.value,f=a||!o,d=(0,s.default)("fake-input",{focus:i,"fake-input-disabled":a}),p=(0,s.default)("fake-input-container",{"fake-input-container-left":"left"===r});return u.default.createElement("div",{className:p},""===c&&u.default.createElement("div",{className:"fake-input-placeholder"},n),u.default.createElement("div",{className:d,ref:function(t){return e.inputRef=t},onClick:f?function(){}:this.onFakeInputClick},c),this.renderPortal())}}]),t}(u.default.Component);v.defaultProps={onChange:function(){},onFocus:function(){},onBlur:function(){},placeholder:"",disabled:!1,editable:!0,prefixCls:"am-input",keyboardPrefixCls:"am-number-keyboard"},t.default=v,e.exports=t.default},485:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyboardItem=void 0;var a=f(n(6)),o=f(n(1)),r=f(n(4)),l=f(n(2)),u=f(n(3)),i=f(n(0)),s=f(n(7)),c=f(n(37));function f(e){return e&&e.__esModule?e:{default:e}}var d=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)t.indexOf(a[o])<0&&(n[a[o]]=e[a[o]])}return n},p=t.KeyboardItem=function(e){function t(){return(0,o.default)(this,t),(0,l.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return(0,u.default)(t,e),(0,r.default)(t,[{key:"render",value:function(){var e=this.props,t=e.prefixCls,n=e.onClick,o=e.className,r=(e.disabled,e.children),l=e.tdRef,u=d(e,["prefixCls","onClick","className","disabled","children","tdRef"]),f=r;"keyboard-delete"===o?f="delete":"keyboard-hide"===o?f="hide":"keyboard-confirm"===o&&(f="confirm");var p=(0,s.default)(t+"-item",o);return i.default.createElement(c.default,{activeClassName:t+"-item-active"},i.default.createElement("td",(0,a.default)({ref:l,onClick:function(e){n(e,f)},className:p},u),r))}}]),t}(i.default.Component);p.defaultProps={prefixCls:"am-number-keyboard",onClick:function(){},disabled:!1};var m=function(e){function t(){(0,o.default)(this,t);var e=(0,l.default)(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments));return e.onKeyboardClick=function(t,n){if(t.nativeEvent.stopImmediatePropagation(),"confirm"===n&&e.confirmDisabled)return null;e.linkedInput&&e.linkedInput.onKeyboardClick(n)},e.renderKeyboardItem=function(t,n){return i.default.createElement(p,{onClick:e.onKeyboardClick,key:"item-"+t+"-"+n},t)},e}return(0,u.default)(t,e),(0,r.default)(t,[{key:"render",value:function(){var e=this,t=this.props,n=t.prefixCls,a=t.confirmLabel,o=(0,s.default)(n+"-wrapper",n+"-wrapper-hide");return i.default.createElement("div",{className:o,ref:function(t){return e.antmKeyboard=t}},i.default.createElement("table",null,i.default.createElement("tbody",null,i.default.createElement("tr",null,["1","2","3"].map(function(t,n){return e.renderKeyboardItem(t,n)}),i.default.createElement(p,{className:"keyboard-delete",rowSpan:2,onClick:this.onKeyboardClick})),i.default.createElement("tr",null,["4","5","6"].map(function(t,n){return e.renderKeyboardItem(t,n)})),i.default.createElement("tr",null,["7","8","9"].map(function(t,n){return e.renderKeyboardItem(t,n)}),i.default.createElement(p,{className:"keyboard-confirm",rowSpan:2,onClick:this.onKeyboardClick,tdRef:function(t){return e.confirmKeyboardItem=t}},a)),i.default.createElement("tr",null,[".","0"].map(function(t,n){return e.renderKeyboardItem(t,n)}),i.default.createElement(p,{className:"keyboard-hide",onClick:this.onKeyboardClick})))))}}]),t}(i.default.Component);m.defaultProps={prefixCls:"am-number-keyboard"},t.default=m},486:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(n(1)),o=i(n(4)),r=i(n(2)),l=i(n(3)),u=i(n(0));function i(e){return e&&e.__esModule?e:{default:e}}var s=i(n(33)).default.createPortal,c=function(e){function t(e){(0,a.default)(this,t);var n=(0,r.default)(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._container=n.props.getContainer(),n}return(0,l.default)(t,e),(0,o.default)(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return this.props.children?s(this.props.children,this._container):null}}]),t}(u.default.Component);t.default=c,e.exports=t.default},487:function(e,t,n){"use strict";function a(e,t){return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}Object.defineProperty(t,"__esModule",{value:!0}),t.hasClass=a,t.addClass=function(e,t){e.classList?e.classList.add(t):a(e,t)||(e.className=e.className+" "+t)},t.removeClass=function(e,t){if(e.classList)e.classList.remove(t);else if(a(e,t)){var n=e.className;e.className=(" "+n+" ").replace(" "+t+" ","")}}},488:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={confirmLabel:"确定"},e.exports=t.default},489:function(e,t){},589:function(e,t){}});