(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-47f9c953"],{"0790":function(e,t,s){"use strict";var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("van-nav-bar",{attrs:{title:e.title,"left-text":"","left-arrow":""},on:{"click-left":e.back}},[s("van-icon",{attrs:{slot:"left",name:e.backHome?"wap-home":"arrow-left"},slot:"left"})],1)},i=[],o={name:"NavBar",data:function(){return{backHome:!1}},props:{title:{type:String,required:!0,default:""}},created:function(){this.$util.sessionStorage.fetch("backHome")&&(this.backHome=!0)},mounted:function(){},methods:{back:function(){this.backHome?(this.$util.sessionStorage.remove("backHome"),this.$router.push("/")):window.history.length>1?window.history.go(-1):this.$router.push("/")}}},n=o,r=(s("ba46"),s("2877")),u=Object(r["a"])(n,a,i,!1,null,"530892b0",null);u.options.__file="NavBar.vue";t["a"]=u.exports},4039:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"set-nickname-wrap"},[s("nav-bar",{attrs:{title:""}}),e._m(0),e._m(1),s("div",{staticClass:"login"},[s("div",{staticClass:"flex align-c",class:{active:e.userNameFocus}},[s("input",{directives:[{name:"model",rawName:"v-model",value:e.userName,expression:"userName"}],attrs:{placeholder:"请输入昵称"},domProps:{value:e.userName},on:{focus:function(t){e.focus()},blur:function(t){e.blur()},input:function(t){t.target.composing||(e.userName=t.target.value)}}}),e.userName.length&&e.userNameFocus?s("i",{staticClass:"icon icon-shuruqingkong close",on:{click:function(t){e.clean("userName")}}}):e._e()])]),s("div",{staticClass:"protocol"},[e._v("注册即表示同意"),s("i",{on:{click:e.goAgreement}},[e._v("Hooli服务协议")])]),s("van-button",{staticClass:"btn",class:{disabled:e.disabled},attrs:{type:"default"},on:{click:e.registerHandle}},[e._v("完成注册")])],1)},i=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"tab"},[s("p",[e._v("设置昵称")])])},function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("p",{staticClass:"info"},[e._v("为了给您提供更好的服务，请设置昵称"),s("br"),e._v("2-20个字符，仅支持字母、数字和汉字")])}],o=(s("c5f6"),s("f751"),s("cadf"),s("551c"),s("097d"),s("0790")),n={name:"SetNickname",components:{NavBar:o["a"]},data:function(){return{loading:!1,userName:"",disabled:!0,lang:this.$store.state.langStr,userNameFocus:!1}},created:function(){var e=this.$store.state.areaCodeItem||this.$util.storage.fetch("areaCodeItem");e&&(this.areaCodeItem=e)},watch:{userName:function(e){e.length>1&&e.length<21?this.disabled=!1:this.disabled=!0}},mounted:function(){},methods:{focus:function(){this.userNameFocus=!0},blur:function(){this.userNameFocus=!1},registerHandle:function(){var e=this;if(!0!==this.disabled){this.disabled=!0;var t={},s=JSON.parse(this.$util.sessionStorage.fetch("distributor"));t.url=this.$apis.api_user_register,t.data={password:this.$util.aesDecrypt(this.$util.sessionStorage.fetch("password")),registerSource:"h5",sourceCode:"nature_mobile",userName:this.userName},s&&Object.assign(t.data,s);var a=this.$util.sessionStorage.fetch("registerItem");"mail"===a.key?t.data.email=a.value:(t.data.mobile=a.value,t.data.countryId=this.$store.state.areaCodeObj.id||this.$util.storage.fetch("areaCodeItem").id),this.$net.req(t,this).then(function(t){0===Number(t.code)?(e.$Toast("注册成功"),setTimeout(function(){e.$store.commit("setUserObj",t.data);var s=encodeURIComponent(JSON.stringify(t.data));e.$util.storage.save("loginUserInfo",s),e.$util.storage.save("userToken",t.data.token),e.$util.sessionStorage.remove("registerItem"),e.$util.sessionStorage.remove("sendType"),e.$util.sessionStorage.remove("distributor"),e.$util.sessionStorage.fetch("guide")?e.$router.push({path:"/"+e.lang+"/form"}):e.$router.push({path:"/"})},1500)):(e.$Toast(t.msg),e.disabled=!1)},function(t){e.disabled=!1,e.$Toast(t.msg)})}},clean:function(e){this[e]=""},goAgreement:function(){this.$router.push({path:"/common/service-agreement"})}}},r=n,u=(s("4d65"),s("2877")),c=Object(u["a"])(r,a,i,!1,null,"c0bae6ea",null);c.options.__file="setNickname.vue";t["default"]=c.exports},"4d65":function(e,t,s){"use strict";var a=s("ecfa"),i=s.n(a);i.a},"8d1f":function(e,t,s){},ba46:function(e,t,s){"use strict";var a=s("8d1f"),i=s.n(a);i.a},ecfa:function(e,t,s){}}]);
//# sourceMappingURL=chunk-47f9c953.f12c5ff9.js.map