Commit 9fb8188b authored by chenqikuai's avatar chenqikuai

1

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