Commit 9fb8188b authored by chenqikuai's avatar chenqikuai

1

parent 0dc5db95
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<SlideValidator <SlideValidator
v-if=" v-if="
accountType !== undefined && accountType !== eAccountType.NULL &&
loginWay !== undefined && loginWay !== eLoginWay.NULL &&
accountType !== eAccountType.NO_REG accountType !== eAccountType.NO_REG
" "
:key="randomNum" :key="randomNum"
...@@ -78,7 +78,9 @@ ...@@ -78,7 +78,9 @@
/> />
</transition> </transition>
<transition name="fade" mode="out-in"> <transition name="fade" mode="out-in">
<div v-if="accountType !== undefined && loginWay !== undefined"> <div
v-if="accountType !== eAccountType.NULL && loginWay !== eLoginWay.NULL"
>
<div> <div>
<div v-if="accountType === eAccountType.NO_REG"> <div v-if="accountType === eAccountType.NO_REG">
<LoginButton <LoginButton
...@@ -124,7 +126,7 @@ ...@@ -124,7 +126,7 @@
<script lang='ts'> <script lang='ts'>
import Input from "@/components/common/Input/index.vue"; import Input from "@/components/common/Input/index.vue";
import CodeInput from "./components/CodeInput/index.vue"; import CodeInput from "./components/CodeInput/index.vue";
import { RadioGroup, Radio, Overlay, Dialog } from "vant"; import { Overlay, Dialog } from "vant";
import Vue, { PropType } from "vue"; import Vue, { PropType } from "vue";
import { import {
eAccountType, eAccountType,
...@@ -144,11 +146,14 @@ import Check from "@/components/common/Check/index.vue"; ...@@ -144,11 +146,14 @@ import Check from "@/components/common/Check/index.vue";
import PhoneInput from "./components/PhoneInput/index.vue"; import PhoneInput from "./components/PhoneInput/index.vue";
import SlideValidator from "@/components/common/SlideValidator/index.vue"; import SlideValidator from "@/components/common/SlideValidator/index.vue";
const notCheckedIcon = require("@/assets/icons/not_checked.png"); import notCheckedIcon from "@/assets/icons/not_checked.png";
const checkedIcon = require("@/assets/icons/checked.png"); import checkedIcon from "@/assets/icons/checked.png";
import LoginSerivce from "./LoginService"; import LoginSerivce from "./LoginService";
const accountType = eAccountType.NULL;
const loginWay = eLoginWay.NULL;
export default Vue.extend({ export default Vue.extend({
props: { props: {
title: { title: {
...@@ -181,8 +186,6 @@ export default Vue.extend({ ...@@ -181,8 +186,6 @@ export default Vue.extend({
}, },
components: { components: {
Input, Input,
RadioGroup,
Radio,
CodeInput, CodeInput,
LoginButton, LoginButton,
Overlay, Overlay,
...@@ -200,8 +203,8 @@ export default Vue.extend({ ...@@ -200,8 +203,8 @@ export default Vue.extend({
pwdConfig, pwdConfig,
eAccountType, eAccountType,
eLoginWay, eLoginWay,
accountType: <undefined | eAccountType>undefined, accountType: accountType,
loginWay: <undefined | eLoginWay>undefined, loginWay: loginWay,
checkStatus: false, checkStatus: false,
phone: "", phone: "",
code: "", code: "",
...@@ -238,14 +241,16 @@ export default Vue.extend({ ...@@ -238,14 +241,16 @@ export default Vue.extend({
handlePwdChange(v: string) { handlePwdChange(v: string) {
this.pwd = v; this.pwd = v;
}, },
async handleClickRegister(e: MouseEvent) { async handleClickRegister() {
if (this.getRegisterDisableStatus) return; if (this.getRegisterDisableStatus) return;
const { phone, code } = this; const { phone, code } = this;
// 调用注册接口 // 调用注册接口
this.loading = true; this.loading = true;
try { try {
const regResult = await this.registerFunc(phone, code); await this.registerFunc(phone, code);
} catch (err) {} } catch (err) {
console.log(err);
}
this.loading = false; this.loading = false;
}, },
async handleClickLogin() { async handleClickLogin() {
...@@ -266,7 +271,9 @@ export default Vue.extend({ ...@@ -266,7 +271,9 @@ export default Vue.extend({
// 调用登录接口 // 调用登录接口
await this.loginByCodeFunc(phone, code); await this.loginByCodeFunc(phone, code);
} }
} catch (err) {} } catch (err) {
console.log(err);
}
this.loading = false; this.loading = false;
this.randomNum = Math.random(); this.randomNum = Math.random();
this.slideConfirmed = false; this.slideConfirmed = false;
...@@ -346,7 +353,7 @@ export default Vue.extend({ ...@@ -346,7 +353,7 @@ export default Vue.extend({
}, },
}, },
watch: { watch: {
phone(newV: string, oldV: string) { phone(newV: string) {
if (newV.length === phoneConfig.maxLen) { if (newV.length === phoneConfig.maxLen) {
// 调用方法,获取该手机号的账户信息 // 调用方法,获取该手机号的账户信息
this.accountStatusCheckFunc(newV).then((result) => { this.accountStatusCheckFunc(newV).then((result) => {
...@@ -354,7 +361,7 @@ export default Vue.extend({ ...@@ -354,7 +361,7 @@ export default Vue.extend({
this.loginWay = eLoginWay.CODE; this.loginWay = eLoginWay.CODE;
}); });
} else { } else {
this.loginWay = undefined; this.loginWay = eLoginWay.NULL;
} }
}, },
}, },
......
export enum eAccountType { export enum eAccountType {
NULL,
NO_REG, // 账号没注册 NO_REG, // 账号没注册
REG_NOPD, // 账号已注册 为设置密码 REG_NOPD, // 账号已注册 为设置密码
REG_PDSET, // 账号已注册 已设置密码 REG_PDSET, // 账号已注册 已设置密码
} }
export enum eLoginWay { export enum eLoginWay {
NULL,
PWD, // 密码 PWD, // 密码
CODE // 验证码 CODE // 验证码
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment