38.854c174b7648bcd51211.js 8.1 KB

12
  1. webpackJsonp([38],{"WE+G":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("fZjL"),o=a.n(i),s=a("TIfe"),n={name:"Reset",data:function(){return{makeCodeUrl:"",makeCodeShow:!1,makeCode:"",bagUrl:"",choose:[],phone:"",email:"",type:"1",countryCode:0,verification_code:"",showPopup:!1,codeList:[],countdown:this.$t("获取验证码"),countrySearch:"",commonData:{},canplay:!0}},computed:{},mounted:function(){var t="en";-1!=navigator.language.toLowerCase().indexOf("zh")&&(t="zh");var e=window.global.baseUrl,a=e[o()(e)[0]];for(var i in e)i==t&&(a=e[i]);this.bagUrl=a+"/attachment/images/login_bag.png",this.makeCodeUrl=a+"/api/v1/captcha/index",this.canplays(),this.handleCode(),this.commonData=Object(s.b)("commonData"),"1"==this.commonData.register_by_mobile?(this.choose=[{text:"手机",type:"1"},{text:"邮箱",type:"2"}],this.type=1):(this.type=2,this.choose=[{text:"邮箱",type:"2"}])},methods:{canplays:function(){this.canplay=!0},makeCodeShowPop:function(){var t=this.type,e=this.phone,a=this.email;if("1"==t){if(!/^[0-9]*$/.test(e))return this.$toast.fail(this.$t("请输入格式正确的手机号"))}else if("2"==t){if(!/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(a))return this.$toast.fail(this.$t("请输入格式正确的邮箱"))}this.makeCodeShow=!0,this.makeCodeClick()},makeCodeClick:function(){var t="en";-1!=navigator.language.toLowerCase().indexOf("zh")&&(t="zh");var e=window.global.baseUrl,a=e[o()(e)[0]];for(var i in e)i==t&&(a=e[i]);var s=a+"/api/v1/captcha/index",n=(new Date).getTime();this.makeCodeUrl=s+"?"+n},handleRegister:function(){var t=this,e=this.type,a=this.phone,i=this.email,o=this.countryCode,s=this.verification_code,n="";if("1"==e){if(!/^[0-9]*$/.test(a))return this.$toast.fail(this.$t("请输入格式正确的手机号"));n=a}else if("2"==e){if(!/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(i))return this.$toast.fail(this.$t("请输入格式正确的邮箱"));n=i}if(!s&&"1"==this.commonData.register_code)return this.$toast.fail(this.$t("请输入验证码"));if(n){var c={username:n,type:e,verification_code:s};"1"==this.type&&(c.country_code=o),this.$api.auth.verifyCode(c).then(function(e){e.data.is_valid?t.$router.push({name:"resetCode",query:c}):t.$toast(t.$t("验证码错误"))})}else this.$toast("The mandatory field cannot be empty")},handleCode:function(){var t=this;this.$api.auth.countryCode().then(function(e){t.countryCode=e.data.list[0].code,t.codeList=e.data.list})},searchCode:function(){var t=this;this.$api.auth.countryCode().then(function(e){if(t.countrySearch){var a=[];e.data.list.map(function(e){-1!=e.country_name.indexOf(t.countrySearch)&&a.push(e)}),t.codeList=a}else t.codeList=e.data.list})},checkCode:function(t){this.countryCode=t.code,this.showPopup=!1},handleVerificationCode:function(){var t=this;if(t.countdown==t.$t("获取验证码")){var e=60;t.countdown=e+"s";var a=setInterval(function(){--e>0?t.countdown=e+"s":(e=60,t.countdown=t.$t("获取验证码"),clearInterval(a))},1e3),i=this.type,o=this.phone,s=this.email,n=this.countryCode;if("1"==i&&!o)return this.$toast.fail(this.$t("请输入手机号"));if("2"==i&&!s)return this.$toast.fail(this.$t("请输入邮箱"));if("1"==i&&o){if(!/^[0-9]*$/.test(o))return this.$toast.fail(this.$t("请输入格式正确的手机号"))}else if("2"==i&&s){if(!/\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}/.test(s))return this.$toast.fail(this.$t("请输入格式正确的邮箱"))}var c={group:"h5",type:parseInt(i),username:"1"==i?o:s,country_code:"1"==i?n:"",captcha:1234};this.$api.auth.verificationCode(c).then(function(t){})}},handleReset:function(){this.phone="",this.email="",this.verification_code="",this.username=""}}},c={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"reset"},[a("div",{staticClass:"cont"},[a("div",{staticClass:"content"},[a("div",{staticClass:"content_text"},[a("img",{attrs:{src:t.commonData.logo,alt:""}}),t._v(" "),a("span",[t._v(t._s(t.commonData.app_name))])]),t._v(" "),a("div",{staticClass:"content_enter"},[a("p",{staticClass:"content_enter_b"}),t._v(" "),a("p",{staticClass:"content_enter_t"},[t._v(t._s(t.$t("找回密码")))]),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.type,expression:"type == '1'"}],staticClass:"input-item"},[a("div",{on:{click:function(e){t.showPopup=!0}}},[a("span",[t._v(t._s(t.countryCode))]),t._v(" "),a("van-icon",{attrs:{name:"arrow-down"}})],1),t._v(" "),a("div",{staticClass:"flex align-center margin-l15"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.phone,expression:"phone"}],attrs:{type:"text",placeholder:t.$t("请输入手机号")},domProps:{value:t.phone},on:{input:function(e){e.target.composing||(t.phone=e.target.value)}}})])]),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:"2"==t.type,expression:"type == '2'"}],staticClass:"input-item"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.email,expression:"email"}],attrs:{type:"text",placeholder:t.$t("请输入邮箱")},domProps:{value:t.email},on:{input:function(e){e.target.composing||(t.email=e.target.value)}}})]),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.commonData.register_code,expression:"commonData.register_code == '1'"}],staticClass:"input-item space-between"},[a("div",{staticClass:"flex"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.verification_code,expression:"verification_code"}],attrs:{type:"text",placeholder:t.$t("请输入验证码")},domProps:{value:t.verification_code},on:{input:function(e){e.target.composing||(t.verification_code=e.target.value)}}})]),t._v(" "),a("div",{staticClass:"code-btn radius-round",class:t.countdown!=t.$t("获取验证码")?"dis":"",on:{click:t.handleVerificationCode}},[t._v("\n "+t._s(t.countdown)+"\n ")])]),t._v(" "),a("div",{staticClass:"content_enter_btn",on:{click:t.handleRegister}},[t._v("\n "+t._s(t.$t("下一步"))+"\n ")])]),t._v(" "),a("van-popup",{staticClass:"code-popup",attrs:{position:"bottom",round:""},model:{value:t.showPopup,callback:function(e){t.showPopup=e},expression:"showPopup"}},[a("van-cell",{staticClass:"input-search"},[a("template",{attrs:{slot:"title"},slot:"title"},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.countrySearch,expression:"countrySearch"}],attrs:{type:"text",placeholder:"查询"},domProps:{value:t.countrySearch},on:{input:function(e){e.target.composing||(t.countrySearch=e.target.value)}}}),t._v(" "),a("i",{staticClass:"fa fa-search fa-lg",attrs:{"aria-hidden":"true"},on:{click:t.searchCode}})])],2),t._v(" "),a("div",{staticClass:"codeList"},t._l(t.codeList,function(e,i){return a("van-cell",{key:i,on:{click:function(a){t.checkCode(e)}}},[a("template",{attrs:{slot:"title"},slot:"title"},[a("div",{staticClass:"flex space-between",class:t.countryCode==e.code?"active":""},[a("span",[t._v(t._s(e.country_name))]),t._v(" "),a("span",[t._v(t._s(e.code))])])])],2)}))],1),t._v(" "),a("van-popup",{staticClass:"makeCode",attrs:{"close-on-click-overlay":!1},model:{value:t.makeCodeShow,callback:function(e){t.makeCodeShow=e},expression:"makeCodeShow"}},[a("p",{staticClass:"makeCode_title"},[t._v(t._s(t.$t("验证码")))]),t._v(" "),a("input",{directives:[{name:"model",rawName:"v-model",value:t.makeCode,expression:"makeCode"}],staticClass:"makeCode_in",attrs:{type:"text",maxlength:"8",placeholder:t.$t("请输入验证码")},domProps:{value:t.makeCode},on:{input:function(e){e.target.composing||(t.makeCode=e.target.value)}}}),t._v(" "),a("p",{staticClass:"makeCode_tips"},[t._v("\n "+t._s(t.$t("输入下方正确的图形验证后,获取邮箱验证码进行注册"))+"\n ")]),t._v(" "),a("div",{staticClass:"makeCode_code"},[a("img",{attrs:{src:t.makeCodeUrl,alt:""}}),t._v(" "),a("span",{on:{click:t.makeCodeClick}},[t._v(t._s(t.$t("换一张")))])]),t._v(" "),a("div",{staticClass:"makeCode_btn"},[a("span",{staticClass:"makeCode_btn_t",on:{click:t.handleVerificationCode}},[t._v(t._s(t.$t("提交")))])])])],1)])])},staticRenderFns:[]};var r=a("VU/8")(n,c,!1,function(t){a("bK93")},"data-v-fe03e416",null);e.default=r.exports},bK93:function(t,e){}});
  2. //# sourceMappingURL=38.854c174b7648bcd51211.js.map