|
|
|
@ -11,53 +11,78 @@
|
|
|
|
|
</a-col> -->
|
|
|
|
|
<!-- <a-col :span="1" class="box-cen"></a-col> -->
|
|
|
|
|
<!-- 登录 -->
|
|
|
|
|
<a-col class="box-b" v-if="status === 1">
|
|
|
|
|
<a-tabs v-model="activeName" @change="tabsSwitch">
|
|
|
|
|
<!-- <a-tab-pane key="1" tab="密码登录">
|
|
|
|
|
<a-col class="box-b" v-if="status === 1">
|
|
|
|
|
<a-tabs v-model="activeName" @change="tabsSwitch">
|
|
|
|
|
<!-- <a-tab-pane key="1" tab="密码登录">
|
|
|
|
|
</a-tab-pane> -->
|
|
|
|
|
<a-tab-pane key="2" tab="验证码登录">
|
|
|
|
|
</a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
<div class="login-input" v-if="activeName==='1'">
|
|
|
|
|
<a-input placeholder="请输入手机号码"></a-input>
|
|
|
|
|
<a-input type="password" placeholder="请输入密码"></a-input>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12" style="margin-left:23px"><a-checkbox></a-checkbox> 三天之内免登陆</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-button type="primary" @click='login' style="width:90%;margin:30px">
|
|
|
|
|
登录
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-row style="margin-top:20px;margin-left:23px">
|
|
|
|
|
<a-col :span="14">
|
|
|
|
|
<a-checkbox></a-checkbox> 我已同意用户协议
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="10">
|
|
|
|
|
<span class="logintext" @click="status=3">忘记密码</span> <span class="logintext" @click="status=2">免费注册</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="login-input" v-else-if="activeName==='2'">
|
|
|
|
|
<a-input placeholder="请输入手机号码"></a-input>
|
|
|
|
|
<a-input type="password" placeholder="请输入验证码" style="width:60%"></a-input>
|
|
|
|
|
<a-button type="primary" @click='getCode'>获取验证码</a-button>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12" style="margin-left:23px"><a-checkbox></a-checkbox> 三天之内免登陆</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-button type="primary" @click='login' style="width:90%;margin:30px">
|
|
|
|
|
登录
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-row style="margin-top:20px;margin-left:23px">
|
|
|
|
|
<a-col :span="14">
|
|
|
|
|
<a-checkbox></a-checkbox> 我已同意用户协议
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="10">
|
|
|
|
|
<span class="logintext" @click="status=3">忘记密码</span> <span class="logintext" @click="status=2">免费注册</span>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
<a-tab-pane key="2" tab="验证码登录"> </a-tab-pane>
|
|
|
|
|
</a-tabs>
|
|
|
|
|
<div class="login-input" v-if="activeName === '1'">
|
|
|
|
|
<a-input placeholder="请输入手机号码"></a-input>
|
|
|
|
|
<a-input type="password" placeholder="请输入密码"></a-input>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12" style="margin-left: 23px"
|
|
|
|
|
><a-checkbox></a-checkbox> 三天之内免登陆</a-col
|
|
|
|
|
>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="login"
|
|
|
|
|
style="width: 90%; margin: 30px"
|
|
|
|
|
>
|
|
|
|
|
登录
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-row style="margin-top: 20px; margin-left: 23px">
|
|
|
|
|
<a-col :span="14">
|
|
|
|
|
<a-checkbox></a-checkbox> 我已同意用户协议
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="10">
|
|
|
|
|
<span class="logintext" @click="status = 3">忘记密码</span
|
|
|
|
|
> <span
|
|
|
|
|
class="logintext"
|
|
|
|
|
@click="status = 2"
|
|
|
|
|
>免费注册</span
|
|
|
|
|
>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="login-input" v-else-if="activeName === '2'">
|
|
|
|
|
<a-input placeholder="请输入手机号码" v-model="form.tel"></a-input>
|
|
|
|
|
<a-input
|
|
|
|
|
placeholder="请输入验证码"
|
|
|
|
|
v-model="form.code"
|
|
|
|
|
style="width: 60%"
|
|
|
|
|
></a-input>
|
|
|
|
|
<a-button type="primary" @click="getCode">获取验证码</a-button>
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="12" style="margin-left: 23px"
|
|
|
|
|
><a-checkbox></a-checkbox> 三天之内免登陆</a-col
|
|
|
|
|
>
|
|
|
|
|
</a-row>
|
|
|
|
|
<a-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="login"
|
|
|
|
|
style="width: 90%; margin: 30px"
|
|
|
|
|
>
|
|
|
|
|
登录
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-row style="margin-top: 20px; margin-left: 23px">
|
|
|
|
|
<a-col :span="14">
|
|
|
|
|
<a-checkbox></a-checkbox> 我已同意用户协议
|
|
|
|
|
</a-col>
|
|
|
|
|
<a-col :span="10">
|
|
|
|
|
<span class="logintext" @click="status = 3">忘记密码</span
|
|
|
|
|
> <span
|
|
|
|
|
class="logintext"
|
|
|
|
|
@click="status = 2"
|
|
|
|
|
>免费注册</span
|
|
|
|
|
>
|
|
|
|
|
</a-col>
|
|
|
|
|
</a-row>
|
|
|
|
|
</div>
|
|
|
|
|
</a-col>
|
|
|
|
|
<!-- 注册 -->
|
|
|
|
|
<a-col class="box-b" v-if="status === 2">
|
|
|
|
|
<a-col class="box-b" v-if="status === 2">
|
|
|
|
|
<div class="cardTitle">新建账号</div>
|
|
|
|
|
<a-form-model
|
|
|
|
|
ref="ruleForm"
|
|
|
|
@ -79,7 +104,7 @@
|
|
|
|
|
<a-row style="margin-top: 20px">
|
|
|
|
|
<a-col :span="16" style="margin-right: 10px">
|
|
|
|
|
<a-input
|
|
|
|
|
style="width:100%"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="form.verificationCode"
|
|
|
|
|
placeholder="请输入验证码"
|
|
|
|
|
/>
|
|
|
|
@ -92,23 +117,22 @@
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="设置密码" prop="psw">
|
|
|
|
|
<a-input placeholder="请输入密码"/>
|
|
|
|
|
<a-input placeholder="请输入密码" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="确认密码" prop="confirmPsw">
|
|
|
|
|
<a-input placeholder="请再次输入密码"/>
|
|
|
|
|
<a-input placeholder="请再次输入密码" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item>
|
|
|
|
|
<a-button type="primary" style="width:100%">
|
|
|
|
|
确定
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" style="width: 100%"> 确定 </a-button>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item>
|
|
|
|
|
<span>已有账号?</span><span class="logintext" @click="status=1">登录</span>
|
|
|
|
|
<span>已有账号?</span
|
|
|
|
|
><span class="logintext" @click="status = 1">登录</span>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</a-col>
|
|
|
|
|
<!-- 找回密码 -->
|
|
|
|
|
<a-col class="box-b" v-if="status === 3">
|
|
|
|
|
<a-col class="box-b" v-if="status === 3">
|
|
|
|
|
<div class="cardTitle">找回密码</div>
|
|
|
|
|
<a-form-model
|
|
|
|
|
ref="ruleForm"
|
|
|
|
@ -130,7 +154,7 @@
|
|
|
|
|
<a-row style="margin-top: 20px">
|
|
|
|
|
<a-col :span="16" style="margin-right: 10px">
|
|
|
|
|
<a-input
|
|
|
|
|
style="width:100%"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
v-model="form.verificationCode"
|
|
|
|
|
placeholder="请输入验证码"
|
|
|
|
|
/>
|
|
|
|
@ -143,18 +167,17 @@
|
|
|
|
|
</a-row>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="设置密码" prop="psw">
|
|
|
|
|
<a-input placeholder="请输入密码"/>
|
|
|
|
|
<a-input placeholder="请输入密码" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item label="确认密码" prop="confirmPsw">
|
|
|
|
|
<a-input placeholder="请再次输入密码"/>
|
|
|
|
|
<a-input placeholder="请再次输入密码" />
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item>
|
|
|
|
|
<a-button type="primary" style="width:100%">
|
|
|
|
|
确定
|
|
|
|
|
</a-button>
|
|
|
|
|
<a-button type="primary" style="width: 100%"> 确定 </a-button>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
<a-form-model-item>
|
|
|
|
|
<span>已有账号?</span><span class="logintext" @click="status=1">登录</span>
|
|
|
|
|
<span>已有账号?</span
|
|
|
|
|
><span class="logintext" @click="status = 1">登录</span>
|
|
|
|
|
</a-form-model-item>
|
|
|
|
|
</a-form-model>
|
|
|
|
|
</a-col>
|
|
|
|
@ -164,15 +187,16 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { loginTel,sendTelCode } from "../../api/login"
|
|
|
|
|
import { loginTel, sendTelCode } from "../../api/public/login";
|
|
|
|
|
export default {
|
|
|
|
|
name: "Login",
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
status: 1,
|
|
|
|
|
activeName:'2',
|
|
|
|
|
form:{
|
|
|
|
|
tel:''
|
|
|
|
|
activeName: "2",
|
|
|
|
|
form: {
|
|
|
|
|
tel: "",
|
|
|
|
|
code: "",
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
tel: [
|
|
|
|
@ -204,21 +228,38 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.keyupEnter();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async login() {
|
|
|
|
|
let res = await loginTel({
|
|
|
|
|
tel:'11',
|
|
|
|
|
code:'111111'
|
|
|
|
|
// 绑定enter事件
|
|
|
|
|
keyupEnter() {
|
|
|
|
|
document.onkeydown = (e) => {
|
|
|
|
|
if (e.keyCode === 13 && e.target.baseURI.match(/loginTel/)) {
|
|
|
|
|
//回车后执行搜索方法
|
|
|
|
|
this.login();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
login() {
|
|
|
|
|
loginTel(this.form).then(res=>{
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message.success(res.msg);
|
|
|
|
|
this.setToken(res.data);
|
|
|
|
|
this.$router.push("/");
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
console.log(res);
|
|
|
|
|
},
|
|
|
|
|
// 获取验证码
|
|
|
|
|
getCode(){
|
|
|
|
|
sendTelCode(this.form).then(res=>{
|
|
|
|
|
if(res){
|
|
|
|
|
this.$message.success(res.msg)
|
|
|
|
|
getCode() {
|
|
|
|
|
sendTelCode(this.form).then((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
// this.$message.success("取消成功");
|
|
|
|
|
this.$message.success(res.msg +' ' +res.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onSubmit() {
|
|
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
|
@ -234,18 +275,18 @@ export default {
|
|
|
|
|
resetForm() {
|
|
|
|
|
this.$refs.ruleForm.resetFields();
|
|
|
|
|
},
|
|
|
|
|
tabsSwitch(){
|
|
|
|
|
console.log(this.activeName);
|
|
|
|
|
}
|
|
|
|
|
tabsSwitch() {
|
|
|
|
|
console.log(this.activeName);
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.bg{
|
|
|
|
|
.bg {
|
|
|
|
|
background-image: url(../../assets/images/loginBg.png);
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-size:cover;
|
|
|
|
|
background-size: cover;
|
|
|
|
|
}
|
|
|
|
|
.logo-box {
|
|
|
|
|
text-align: left;
|
|
|
|
@ -261,8 +302,12 @@ export default {
|
|
|
|
|
margin-left: 42px;
|
|
|
|
|
margin-bottom: 13px;
|
|
|
|
|
}
|
|
|
|
|
.title{
|
|
|
|
|
font-size:28px;color:#333333;font-weight:500;margin-left: 20px;line-height: 93px;
|
|
|
|
|
.title {
|
|
|
|
|
font-size: 28px;
|
|
|
|
|
color: #333333;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
margin-left: 20px;
|
|
|
|
|
line-height: 93px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.login-box {
|
|
|
|
@ -282,31 +327,31 @@ export default {
|
|
|
|
|
.box-b {
|
|
|
|
|
height: 500px;
|
|
|
|
|
text-align: left;
|
|
|
|
|
padding:30px;
|
|
|
|
|
padding: 30px;
|
|
|
|
|
}
|
|
|
|
|
.cardTitle{
|
|
|
|
|
margin-left: -10px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
color: #000000;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
margin-bottom: 40px;
|
|
|
|
|
.cardTitle {
|
|
|
|
|
margin-left: -10px;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
color: #000000;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
margin-bottom: 40px;
|
|
|
|
|
}
|
|
|
|
|
.logintext{
|
|
|
|
|
color: #205FBD;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
.logintext {
|
|
|
|
|
color: #205fbd;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
/deep/.ant-form-item{
|
|
|
|
|
margin-top:-10px;
|
|
|
|
|
/deep/.ant-form-item {
|
|
|
|
|
margin-top: -10px;
|
|
|
|
|
}
|
|
|
|
|
.login-input{
|
|
|
|
|
.login-input {
|
|
|
|
|
text-align: left;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
/deep/.ant-input{
|
|
|
|
|
border: 0px;
|
|
|
|
|
border-bottom: 1px solid #f4eded;
|
|
|
|
|
border-radius:0 ;
|
|
|
|
|
width: 90%;
|
|
|
|
|
margin: 25px;
|
|
|
|
|
}
|
|
|
|
|
/deep/.ant-input {
|
|
|
|
|
border: 0px;
|
|
|
|
|
border-bottom: 1px solid #f4eded;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
width: 90%;
|
|
|
|
|
margin: 25px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|