{"ast":null,"code":"import \"vant/es/popup/style\";\nimport _Popup from \"vant/es/popup\"; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport \"core-js/modules/es.array.push.js\";\nimport ExInput from \"@/components/ex-input\";\nimport Step from \"./step.vue\";\nimport Axios from \"@/API/login.js\";\nimport { mapActions, mapGetters } from \"vuex\";\nimport { GET_USERINFO } from \"@/store/const.store\";\nimport nationalityList from \"../authentication/components/nationalityList.vue\";\nimport Vcode from \"vue-puzzle-vcode\";\nimport img1 from \"../../assets/image/slider/1.png\";\nimport img2 from \"../../assets/image/slider/2.png\";\nimport { getStorage } from \"@/utils/utis\";\nexport default {\n props: {},\n components: {\n [_Popup.name]: _Popup,\n ExInput,\n Step,\n nationalityList,\n Vcode\n },\n data() {\n return {\n form: {\n phone: \"\",\n emig: \"\",\n name: \"\",\n code: \"\",\n username: \"\",\n password: \"\",\n repassword: \"\",\n invitCode: \"\"\n },\n show: false,\n msg: \"\",\n type: 3,\n // 1手机 2 邮箱 3账号\n agree: false,\n username: \"\",\n password: \"\",\n repassword: \"\",\n invitCode: \"\",\n //邀请码\n activeIndex: 1,\n typeText: \"password\",\n isArea: false,\n dialCode: 0,\n //电话号前缀\n icon: \"\",\n img1,\n img2\n };\n },\n mounted() {\n let usercode = getStorage(\"usercode\");\n if (usercode) {\n this.invitCode = usercode;\n }\n },\n computed: {\n ...mapGetters({\n theme: \"home/theme\"\n })\n },\n methods: {\n ...mapActions(\"user\", [GET_USERINFO]),\n getRegType(activeIndex, bFlag) {\n switch (activeIndex) {\n case 0:\n return bFlag ? this.$t(\"账号\") : this.$t(\"请输入账号\");\n case 1:\n return bFlag ? this.$t(\"邮箱\") : this.$t(\"请输入邮箱\");\n case 2:\n return bFlag ? this.$t(\"手机号\") : this.$t(\"请输入手机号\");\n }\n },\n onClose() {\n console.log(\"onClose\");\n },\n onSuccess() {\n console.log(\"onSuccess\");\n this.registerApi();\n this.show = false;\n },\n onFail() {\n this.msg = \"\";\n },\n onRefresh() {\n this.msg = \"\";\n },\n onSelectArea() {\n this.openBtn();\n },\n //打开国家列表底部弹窗\n openBtn() {\n this.$refs.controlChild.open();\n },\n //获取到当前选中国家的code值\n getName(params) {\n this.icon = params[1];\n this.dialCode = params[2];\n },\n agreeProt() {\n this.agree = !this.agree;\n },\n register() {\n // if (this.activeIndex == 0){\n // let match = this.username.search(/@/);\n // if (this.username == '' || match == -1) {\n // this.$toast(this.$t('请输入正确的邮箱地址'));\n // return\n // }\n // }else{\n // if (this.username == '' ) {\n // this.$toast(this.$t('请输入手机号'));\n // return\n // }\n // }\n switch (this.activeIndex) {\n case 0:\n {\n if (this.username == \"\") {\n this.$toast(this.$t(\"请输入账号\"));\n return;\n }\n if (this.username.length < 6 || this.username.length > 30) {\n this.$toast(this.$t(\"账号长度必须6-30位\"));\n return;\n }\n break;\n }\n case 1:\n {\n let match = this.username.search(/@/);\n if (this.username == \"\" || match == -1) {\n this.$toast(this.$t(\"请输入正确的邮箱地址\"));\n return;\n }\n break;\n }\n case 2:\n {\n if (this.username == \"\") {\n this.$toast(this.$t(\"请输入手机号\"));\n return;\n }\n break;\n }\n }\n if (this.password == \"\") {\n this.$toast(this.$t(\"请输入密码\"));\n return;\n }\n ``;\n if (this.password.length < 6) {\n this.$toast(this.$t(\"密码(6-12个字符)\"));\n return;\n }\n if (this.repassword !== this.password) {\n this.$toast(this.$t(\"密码不一致\"));\n return;\n }\n // if (this.invitCode == '') {\n // this.$toast(this.$t('请输入邀请码'));\n // return\n // }\n if (!this.agree) {\n this.$toast(this.$t(\"请同意服务条款\"));\n return;\n }\n this.show = true;\n },\n changeIndex(index) {\n this.activeIndex = index;\n switch (index) {\n case 0:\n case 1:\n {\n this.isArea = false;\n break;\n }\n case 2:\n {\n this.isArea = true;\n break;\n }\n }\n },\n registerApi() {\n switch (this.activeIndex) {\n case 0:\n {\n this.type = 3;\n break;\n }\n case 1:\n {\n this.type = 2;\n break;\n }\n case 2:\n {\n this.type = 1;\n break;\n }\n }\n Axios.registerUser({\n username: this.activeIndex == 0 || this.activeIndex == 1 ? this.username : `${this.username}`,\n password: this.password,\n re_password: this.repassword,\n type: this.type,\n usercode: this.invitCode\n }).then(res => {\n this.GET_USERINFO(res.data);\n if (this.activeIndex == 0 || this.activeIndex == 2) {\n this.$router.push(\"/setFond\");\n } else {\n this.$router.push({\n name: \"verify\",\n query: {\n type: this.activeIndex,\n account: this.activeIndex == 1 ? this.username : `${this.username}`\n }\n });\n }\n }).catch(error => {\n if (error.code === \"ECONNABORTED\") {\n this.$toast(this.$t(\"网络超时!\"));\n } else if (error.msg !== undefined) {\n this.$toast(this.$t(error.msg));\n }\n });\n }\n }\n};","map":{"version":3,"names":["ExInput","Step","Axios","mapActions","mapGetters","GET_USERINFO","nationalityList","Vcode","img1","img2","getStorage","props","components","_Popup","name","data","form","phone","emig","code","username","password","repassword","invitCode","show","msg","type","agree","activeIndex","typeText","isArea","dialCode","icon","mounted","usercode","computed","theme","methods","getRegType","bFlag","$t","onClose","console","log","onSuccess","registerApi","onFail","onRefresh","onSelectArea","openBtn","$refs","controlChild","open","getName","params","agreeProt","register","$toast","length","match","search","changeIndex","index","registerUser","re_password","then","res","$router","push","query","account","catch","error","undefined"],"sources":["src/page/register/index.vue"],"sourcesContent":["<template>\n <div class=\"register\">\n <div class=\"top\" @click=\"$router.go(-1)\">\n <img\n :src=\"require(`../../assets/theme/${theme}/image/Union.png`)\"\n alt=\"\"\n />\n </div>\n <Step :step=\"1\"></Step>\n <div class=\"title textColor\">{{ $t(\"注册\") }}</div>\n\n <ExInput :placeholderText=\"$t('请输入姓名')\" v-model=\"form.name\" />\n <ExInput :placeholderText=\"$t('请输入邮箱地址')\" v-model=\"password\" />\n <div class=\"code-box\">\n <div class=\"btn btnMain code-but\" @click=\"register\">\n {{ $t(\"获取验证码\") }}\n </div>\n\n <ExInput :placeholderText=\"$t('请输入验证码')\" v-model=\"password\" />\n </div>\n <ExInput :placeholderText=\"$t('请输入手机号码')\" v-model=\"password\" />\n <ExInput\n :placeholderText=\"$t('密码(6-12个字符)')\"\n v-model=\"password\"\n typeText=\"password\"\n />\n <ExInput\n :placeholderText=\"$t('请确认密码')\"\n v-model=\"repassword\"\n typeText=\"password\"\n />\n <ExInput\n :placeholderText=\"$t('请输入邀请码')\"\n v-model=\"invitCode\"\n :clearBtn=\"false\"\n />\n <div class=\"protocol textColor\">\n <i @click=\"agreeProt\">\n <img v-show=\"agree\" src=\"../../assets/image/login/prot2.png\" alt=\"\" />\n <img v-show=\"!agree\" src=\"../../assets/image/login/prot1.png\" alt=\"\" />\n </i>\n {{ $t(\"我已阅读并同意\")\n }}<span\n class=\"colorMain\"\n @click=\"$router.push('/TermsOfService?serviceTerm=1')\"\n >{{ $t(\"服务条款\") }}</span\n >\n </div>\n <div class=\"btn btnMain\" @click=\"register\">{{ $t(\"注册\") }}</div>\n <div class=\"noTips textColor\">\n {{ $t(\"已有账号\")\n }}<span class=\"colorMain\" @click=\"$router.push('/login')\">\n {{ $t(\"去登录\") }}</span\n >\n </div>\n <nationality-list\n ref=\"controlChild\"\n :title=\"$t('选择区域码')\"\n @getName=\"getName(arguments)\"\n ></nationality-list>\n\n <Vcode\n :imgs=\"[img1, img2]\"\n :show=\"show\"\n @success=\"onSuccess\"\n :canvasHeight=\"200\"\n @fail=\"onFail\"\n @close=\"show = false\"\n sliderText=\"\"\n :successText=\"$t('验证通过!')\"\n :failText=\"$t('验证失败,请重试')\"\n />\n\n <div>{{ msg }}</div>\n </div>\n</template>\n\n<script>\nimport { Popup } from \"vant\";\nimport ExInput from \"@/components/ex-input\";\nimport Step from \"./step.vue\";\nimport Axios from \"@/API/login.js\";\nimport { mapActions, mapGetters } from \"vuex\";\nimport { GET_USERINFO } from \"@/store/const.store\";\nimport nationalityList from \"../authentication/components/nationalityList.vue\";\nimport Vcode from \"vue-puzzle-vcode\";\nimport img1 from \"../../assets/image/slider/1.png\";\nimport img2 from \"../../assets/image/slider/2.png\";\nimport { getStorage } from \"@/utils/utis\";\nexport default {\n props: {},\n components: {\n [Popup.name]: Popup,\n ExInput,\n Step,\n nationalityList,\n Vcode,\n },\n data() {\n return {\n form: {\n phone: \"\",\n emig: \"\",\n name: \"\",\n code: \"\",\n username: \"\",\n password: \"\",\n repassword: \"\",\n invitCode: \"\",\n },\n show: false,\n msg: \"\",\n type: 3, // 1手机 2 邮箱 3账号\n agree: false,\n username: \"\",\n password: \"\",\n repassword: \"\",\n invitCode: \"\", //邀请码\n activeIndex: 1,\n typeText: \"password\",\n isArea: false,\n dialCode: 0, //电话号前缀\n icon: \"\",\n img1,\n img2,\n };\n },\n mounted() {\n let usercode = getStorage(\"usercode\");\n if (usercode) {\n this.invitCode = usercode;\n }\n },\n computed: {\n ...mapGetters({\n theme: \"home/theme\",\n }),\n },\n methods: {\n ...mapActions(\"user\", [GET_USERINFO]),\n getRegType(activeIndex, bFlag) {\n switch (activeIndex) {\n case 0:\n return bFlag ? this.$t(\"账号\") : this.$t(\"请输入账号\");\n case 1:\n return bFlag ? this.$t(\"邮箱\") : this.$t(\"请输入邮箱\");\n case 2:\n return bFlag ? this.$t(\"手机号\") : this.$t(\"请输入手机号\");\n }\n },\n onClose() {\n console.log(\"onClose\");\n },\n onSuccess() {\n console.log(\"onSuccess\");\n this.registerApi();\n this.show = false;\n },\n onFail() {\n this.msg = \"\";\n },\n onRefresh() {\n this.msg = \"\";\n },\n onSelectArea() {\n this.openBtn();\n },\n //打开国家列表底部弹窗\n openBtn() {\n this.$refs.controlChild.open();\n },\n //获取到当前选中国家的code值\n getName(params) {\n this.icon = params[1];\n this.dialCode = params[2];\n },\n agreeProt() {\n this.agree = !this.agree;\n },\n register() {\n // if (this.activeIndex == 0){\n // let match = this.username.search(/@/);\n // if (this.username == '' || match == -1) {\n // this.$toast(this.$t('请输入正确的邮箱地址'));\n // return\n // }\n // }else{\n // if (this.username == '' ) {\n // this.$toast(this.$t('请输入手机号'));\n // return\n // }\n // }\n switch (this.activeIndex) {\n case 0: {\n if (this.username == \"\") {\n this.$toast(this.$t(\"请输入账号\"));\n return;\n }\n if (this.username.length < 6 || this.username.length > 30) {\n this.$toast(this.$t(\"账号长度必须6-30位\"));\n return;\n }\n break;\n }\n case 1: {\n let match = this.username.search(/@/);\n if (this.username == \"\" || match == -1) {\n this.$toast(this.$t(\"请输入正确的邮箱地址\"));\n return;\n }\n break;\n }\n case 2: {\n if (this.username == \"\") {\n this.$toast(this.$t(\"请输入手机号\"));\n return;\n }\n break;\n }\n }\n if (this.password == \"\") {\n this.$toast(this.$t(\"请输入密码\"));\n return;\n }\n ``;\n\n if (this.password.length < 6) {\n this.$toast(this.$t(\"密码(6-12个字符)\"));\n return;\n }\n if (this.repassword !== this.password) {\n this.$toast(this.$t(\"密码不一致\"));\n return;\n }\n // if (this.invitCode == '') {\n // this.$toast(this.$t('请输入邀请码'));\n // return\n // }\n if (!this.agree) {\n this.$toast(this.$t(\"请同意服务条款\"));\n return;\n }\n this.show = true;\n },\n changeIndex(index) {\n this.activeIndex = index;\n switch (index) {\n case 0:\n case 1: {\n this.isArea = false;\n break;\n }\n case 2: {\n this.isArea = true;\n break;\n }\n }\n },\n registerApi() {\n switch (this.activeIndex) {\n case 0: {\n this.type = 3;\n break;\n }\n case 1: {\n this.type = 2;\n break;\n }\n case 2: {\n this.type = 1;\n break;\n }\n }\n Axios.registerUser({\n username:\n this.activeIndex == 0 || this.activeIndex == 1\n ? this.username\n : `${this.username}`,\n password: this.password,\n re_password: this.repassword,\n type: this.type,\n usercode: this.invitCode,\n })\n .then((res) => {\n this.GET_USERINFO(res.data);\n if (this.activeIndex == 0 || this.activeIndex == 2) {\n this.$router.push(\"/setFond\");\n } else {\n this.$router.push({\n name: \"verify\",\n query: {\n type: this.activeIndex,\n account:\n this.activeIndex == 1 ? this.username : `${this.username}`,\n },\n });\n }\n })\n .catch((error) => {\n if (error.code === \"ECONNABORTED\") {\n this.$toast(this.$t(\"网络超时!\"));\n } else if (error.msg !== undefined) {\n this.$toast(this.$t(error.msg));\n }\n });\n },\n },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.register {\n width: 100%;\n box-sizing: border-box;\n padding: 32px;\n font-size: 26px;\n}\n\n.top {\n padding-left: 18px;\n padding-top: 18px;\n\n img {\n width: 37px;\n height: 37px;\n }\n}\n\n.title {\n font-weight: 700;\n font-size: 52px;\n margin-top: 54px;\n margin-bottom: 66px;\n}\n\n.re-tab {\n margin-bottom: 44px;\n\n div {\n padding: 0 36px;\n height: 68px;\n line-height: 68px;\n text-align: center;\n border-radius: 8px;\n margin-right: 20px;\n }\n\n .active {\n @include themify() {\n background: themed(\"tab_background\");\n }\n\n @include themify() {\n color: themed(\"text_color\");\n }\n }\n}\n\n.forget {\n color: #1d91ff;\n font-size: 24px;\n line-height: 28px;\n}\n\n.btn {\n color: #fff;\n height: 88px;\n line-height: 88px;\n text-align: center;\n font-size: 32px;\n margin-top: 40px;\n border-radius: 10px;\n}\n\n.noTips {\n margin-top: 48px;\n}\n\n.protocol {\n display: flex;\n align-items: center;\n height: 30px;\n\n i {\n width: 30px;\n height: 30px;\n margin-right: 18px;\n\n img {\n width: 100%;\n height: 100%;\n }\n }\n}\n\n.code-box {\n width: 100%;\n display: flex;\n align-items: center;\n // justify-content: space-between;\n\n .code-but {\n width: 200px;\n font-size: 28px;\n text-align: center;\n background-color: #6ff;\n margin-right: 20px;\n }\n}\n::v-deep .inputCom {\n width: 100%;\n padding-bottom: 10px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+EA,OAAAA,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MAAA;YACA;UACA;MACA;IACA;IACAe,YAAA;MACA,aAAAjB,WAAA;QACA;UAAA;YACA,KAAAF,IAAA;YACA;UACA;QACA;UAAA;YACA,KAAAA,IAAA;YACA;UACA;QACA;UAAA;YACA,KAAAA,IAAA;YACA;UACA;MACA;MACAxB,KAAA,CAAA6D,YAAA;QACA3C,QAAA,EACA,KAAAQ,WAAA,cAAAA,WAAA,QACA,KAAAR,QAAA,GACA,QAAAA,QAAA;QACAC,QAAA,OAAAA,QAAA;QACA2C,WAAA,OAAA1C,UAAA;QACAI,IAAA,OAAAA,IAAA;QACAQ,QAAA,OAAAX;MACA,GACA0C,IAAA,CAAAC,GAAA;QACA,KAAA7D,YAAA,CAAA6D,GAAA,CAAAnD,IAAA;QACA,SAAAa,WAAA,cAAAA,WAAA;UACA,KAAAuC,OAAA,CAAAC,IAAA;QACA;UACA,KAAAD,OAAA,CAAAC,IAAA;YACAtD,IAAA;YACAuD,KAAA;cACA3C,IAAA,OAAAE,WAAA;cACA0C,OAAA,EACA,KAAA1C,WAAA,aAAAR,QAAA,WAAAA,QAAA;YACA;UACA;QACA;MACA,GACAmD,KAAA,CAAAC,KAAA;QACA,IAAAA,KAAA,CAAArD,IAAA;UACA,KAAAsC,MAAA,MAAAjB,EAAA;QACA,WAAAgC,KAAA,CAAA/C,GAAA,KAAAgD,SAAA;UACA,KAAAhB,MAAA,MAAAjB,EAAA,CAAAgC,KAAA,CAAA/C,GAAA;QACA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}
|