修改了缩进
This commit is contained in:
parent
13dc309bb9
commit
d20986da78
@ -10,7 +10,7 @@
|
||||
<div v-if="stepnow == 1">
|
||||
<div class="nosign">
|
||||
已有账号?
|
||||
<span class="tosign"> 去登录 </span>
|
||||
<span class="tosign" @click="navto('/')"> 去登录 </span>
|
||||
</div>
|
||||
|
||||
<a-form :layout="formLayout">
|
||||
@ -21,13 +21,15 @@
|
||||
style="width: 50%"
|
||||
v-model:value="phone.quhao"
|
||||
>
|
||||
<a-select-option value="86">
|
||||
中国+0086
|
||||
</a-select-option>
|
||||
<a-select-option value="86"> 中国+0086 </a-select-option>
|
||||
<a-select-option value="Jiangsu"> Jiangsu </a-select-option>
|
||||
</a-select>
|
||||
<div class="line"></div>
|
||||
<a-input v-model:value="phone.phone" style="width: 50%" placeholder="请输入您的手机号" />
|
||||
<a-input
|
||||
v-model:value="phone.phone"
|
||||
style="width: 50%"
|
||||
placeholder="请输入您的手机号"
|
||||
/>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="验证码" class="form-item">
|
||||
@ -36,7 +38,11 @@
|
||||
点击获取验证码{{ time == 60 ? "" : "(" + time + ")" }}
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<a-input v-model:value="phone.code" style="width: 50%" placeholder="请输入您的验证码" />
|
||||
<a-input
|
||||
v-model:value="phone.code"
|
||||
style="width: 50%"
|
||||
placeholder="请输入您的验证码"
|
||||
/>
|
||||
</a-input-group>
|
||||
</a-form-item>
|
||||
<div class="submit" @click="next(2)">下一步</div>
|
||||
@ -57,7 +63,7 @@
|
||||
<div v-if="stepnow == 2">
|
||||
<div class="nosign">
|
||||
已有账号?
|
||||
<span class="tosign"> 去登录 </span>
|
||||
<span class="tosign" @click="navto('/')"> 去登录 </span>
|
||||
</div>
|
||||
<a-form :layout="formLayout">
|
||||
<div class="signform">
|
||||
@ -78,17 +84,38 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="姓名" class="form-item">
|
||||
<a-input class="shuru" placeholder="请输入您的姓名" v-model:value="userinfo.name" />
|
||||
<a-input
|
||||
class="shuru"
|
||||
placeholder="请输入您的姓名"
|
||||
v-model:value="userinfo.name"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="邮箱" class="form-item">
|
||||
<a-input class="shuru" placeholder="请输入您的邮箱" v-model:value="userinfo.emil" />
|
||||
<a-input
|
||||
class="shuru"
|
||||
placeholder="请输入您的邮箱"
|
||||
v-model:value="userinfo.emil"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="母语" class="form-item">
|
||||
<a-input class="shuru" placeholder="请输入您的母语" v-model:value="userinfo.muyu" />
|
||||
<a-input
|
||||
class="shuru"
|
||||
placeholder="请输入您的母语"
|
||||
v-model:value="userinfo.muyu"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="教授" class="form-item">
|
||||
<a-select v-model:value="userinfo.jiaoshou" class="getcode" style="color: #111;" placeholder="请选择您的教授">
|
||||
<a-select-option v-for="(item, index) in willsay" :key="index" :value="item.languageid" >
|
||||
<a-select
|
||||
v-model:value="userinfo.jiaoshou"
|
||||
class="getcode"
|
||||
style="color: #111"
|
||||
placeholder="请选择您的教授"
|
||||
>
|
||||
<a-select-option
|
||||
v-for="(item, index) in willsay"
|
||||
:key="index"
|
||||
:value="item.languageid"
|
||||
>
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@ -103,7 +130,9 @@
|
||||
<div v-if="stepnow == 3">
|
||||
<div class="nosign">您已完成注册</div>
|
||||
<img src="@/static/images/success.png" alt="" class="success" />
|
||||
<div class="ale" @click="navto()">恭喜您注册成功,点击跳转到我的档案页面</div>
|
||||
<div class="ale" @click="navto('/mine/archives')">
|
||||
恭喜您注册成功,点击跳转到我的档案页面
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="stepnow != 2 ? 'right' : 'right right1'">
|
||||
@ -139,9 +168,9 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, reactive, ref, toRaw } from "vue";
|
||||
import NavTop from "@/components/NavTop.vue";
|
||||
import { checksmscode, getwillsay, register, sendsms } from '@/api';
|
||||
import { message } from 'ant-design-vue';
|
||||
import router from '@/router';
|
||||
import { checksmscode, getwillsay, register, sendsms } from "@/api";
|
||||
import { message } from "ant-design-vue";
|
||||
import router from "@/router";
|
||||
|
||||
export default defineComponent({
|
||||
name: "Sign",
|
||||
@ -153,9 +182,9 @@ export default defineComponent({
|
||||
};
|
||||
const time = ref(60); //倒计时初始化
|
||||
const phone = ref({
|
||||
quhao:"86",
|
||||
quhao: "86",
|
||||
phone: "",
|
||||
code: ""
|
||||
code: "",
|
||||
});
|
||||
const userinfo = ref({
|
||||
pass: "",
|
||||
@ -163,12 +192,12 @@ export default defineComponent({
|
||||
name: "",
|
||||
emil: "",
|
||||
muyu: "",
|
||||
jiaoshou: ""
|
||||
})
|
||||
jiaoshou: "",
|
||||
});
|
||||
const willsay = ref<any>();
|
||||
getwillsay().then((res) => {
|
||||
willsay.value = res;
|
||||
})
|
||||
});
|
||||
/**
|
||||
* @param
|
||||
* 点击获取验证码 触发60S倒计时
|
||||
@ -179,9 +208,9 @@ export default defineComponent({
|
||||
if (lock) {
|
||||
return;
|
||||
}
|
||||
if(phone.value.phone == ""){
|
||||
if (phone.value.phone == "") {
|
||||
message.error("手机号不能为空");
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
lock = true;
|
||||
sendsms(phone.value.quhao + phone.value.phone, 0);
|
||||
@ -208,30 +237,30 @@ export default defineComponent({
|
||||
|
||||
const stepnow = ref(1); // 步骤条初始
|
||||
|
||||
function yanzheng(){
|
||||
if(userinfo.value.pass == ""){
|
||||
message.error("密码不能为空")
|
||||
return false
|
||||
function yanzheng() {
|
||||
if (userinfo.value.pass == "") {
|
||||
message.error("密码不能为空");
|
||||
return false;
|
||||
}
|
||||
if(userinfo.value.passtow == ""){
|
||||
message.error("密码不能为空")
|
||||
return false
|
||||
if (userinfo.value.passtow == "") {
|
||||
message.error("密码不能为空");
|
||||
return false;
|
||||
}
|
||||
if(userinfo.value.name == ""){
|
||||
message.error("姓名不能为空")
|
||||
return false
|
||||
if (userinfo.value.name == "") {
|
||||
message.error("姓名不能为空");
|
||||
return false;
|
||||
}
|
||||
if(userinfo.value.emil == ""){
|
||||
message.error("邮箱不能为空")
|
||||
return false
|
||||
if (userinfo.value.emil == "") {
|
||||
message.error("邮箱不能为空");
|
||||
return false;
|
||||
}
|
||||
if(userinfo.value.muyu == ""){
|
||||
message.error("母语不能为空")
|
||||
return false
|
||||
if (userinfo.value.muyu == "") {
|
||||
message.error("母语不能为空");
|
||||
return false;
|
||||
}
|
||||
if(userinfo.value.jiaoshou == ""){
|
||||
message.error("请选择教授语言")
|
||||
return false
|
||||
if (userinfo.value.jiaoshou == "") {
|
||||
message.error("请选择教授语言");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -240,37 +269,47 @@ export default defineComponent({
|
||||
* 步骤条跳到某一步
|
||||
*/
|
||||
|
||||
async function next (e: number) {
|
||||
switch (e) {
|
||||
case 2:{
|
||||
console.log(e)
|
||||
if(phone.value.phone == ""){
|
||||
message.error("手机号不能为空")
|
||||
return ;
|
||||
}else if(phone.value.code == ""){
|
||||
message.error("验证码不能为空")
|
||||
return ;
|
||||
async function next(e: number) {
|
||||
if (stepnow.value > e) {
|
||||
stepnow.value = e;
|
||||
return;
|
||||
}
|
||||
const res = await checksmscode(phone.value.quhao + phone.value.phone, phone.value.code);
|
||||
if(res){
|
||||
switch (e) {
|
||||
case 2: {
|
||||
console.log(e);
|
||||
if (phone.value.phone == "") {
|
||||
message.error("手机号不能为空");
|
||||
return;
|
||||
} else if (phone.value.code == "") {
|
||||
message.error("验证码不能为空");
|
||||
return;
|
||||
}
|
||||
const res = await checksmscode(
|
||||
phone.value.quhao + phone.value.phone,
|
||||
phone.value.code
|
||||
);
|
||||
if (res) {
|
||||
stepnow.value = e;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
console.log(userinfo.value)
|
||||
console.log(userinfo.value);
|
||||
const yz = yanzheng();
|
||||
if(yz){
|
||||
const res = await register({...toRaw(phone.value), ...toRaw(userinfo.value)});
|
||||
if(res){
|
||||
if (yz) {
|
||||
const res = await register({
|
||||
...toRaw(phone.value),
|
||||
...toRaw(userinfo.value),
|
||||
});
|
||||
if (res) {
|
||||
stepnow.value = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function navto(){
|
||||
router.push("/mine/archives");
|
||||
function navto(url: string) {
|
||||
router.push(url);
|
||||
}
|
||||
return {
|
||||
formLayout,
|
||||
@ -283,7 +322,7 @@ export default defineComponent({
|
||||
phone,
|
||||
userinfo,
|
||||
willsay,
|
||||
navto
|
||||
navto,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user