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