<template>
|
<div class="login_page">
|
<headers :mess="loginWay" />
|
<div class="img_mess">
|
<div class="logo_content animated fadeInRight">
|
<img :src="Logo" alt />
|
</div>
|
</div>
|
<div class="logins_content">
|
<div class="login_title animated slideInDown">
|
<span>{{ '邮箱登录' }}</span>
|
</div>
|
<div class="login_forms">
|
<div class="top_forms">
|
<div class="user_name">
|
<input type="text" :placeholder="placeholder" v-model="userName" />
|
</div>
|
<div class="password">
|
<input type="password" placeholder="登录密码" v-model="userPassword" @input="handleInput()" />
|
</div>
|
</div>
|
<div class="bottom_btns">
|
<div class="top_btn" @click="loginIN" :class="btnClass ? 'on' : 'off'">
|
<span>{{ '安全登录' }}</span>
|
</div>
|
<div class="mes">
|
<span>{{ '没有账户?' }}</span>
|
<span @click="$router.push('/NewRegister')" style="color: rgb(54,124,248);">{{ '注册>' }}</span>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import { Toast } from 'mint-ui'
|
import headers from "./components/header.vue";
|
import Logo from "@/assets/img/LOGO2.png";
|
import * as api from '@/axios/api';
|
|
export default {
|
name: "newLogin",
|
data() {
|
return {
|
loginWay: "手机号登录",
|
currentLoginMode: "email",
|
placeholder: "电子邮箱",
|
Logo,
|
userPassword: "",
|
userName: "",
|
btnClass: false
|
};
|
},
|
components: {
|
headers
|
},
|
methods: {
|
handleInput() {
|
if (this.userPassword !== "" && this.userName !== '') {
|
this.btnClass = true;
|
} else {
|
this.btnClass = false;
|
}
|
},
|
async loginIN () {
|
let opts = {
|
phone: this.userName,
|
userPwd: this.userPassword
|
}
|
|
let data = await api.login(opts)
|
if (data.status === 0) {
|
this.$store.state.userInfo.phone = this.userName
|
this.$store.state.userInfo.token = data.data.token
|
|
window.localStorage.clear()
|
window.localStorage.setItem("USERTOKEN",data.data.token);
|
this.$router.push('/home')
|
} else {
|
Toast(data.msg)
|
}
|
|
},
|
},
|
beforeDestroy() {},
|
created() {}
|
};
|
</script>
|
|
<style scoped lang="less">
|
.login_page {
|
width: 100%;
|
height: 100%;
|
overflow: hidden;
|
overflow-y: auto;
|
}
|
.logins_content {
|
width: 100%;
|
height: 9.7436rem;
|
margin-top: 0.4359rem;
|
padding: 0 0.2564rem;
|
.login_title {
|
width: 100%;
|
height: 2.0513rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
font-size: 0.6923rem;
|
color: #fff;
|
}
|
.login_forms {
|
width: 100%;
|
height: 7.9231rem;
|
.top_forms {
|
width: 100%;
|
height: 4.5128rem;
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
.user_name,
|
.password {
|
width: 100%;
|
height: 35%;
|
background: #1e1e1e;
|
border-radius: 0.3564rem;
|
> input {
|
width: 100%;
|
height: 100%;
|
padding-left: 0.3564rem;
|
font-size: 0.4615rem;
|
}
|
}
|
}
|
.bottom_btns {
|
width: 100%;
|
height: 3.3333rem;
|
display: flex;
|
flex-wrap: wrap;
|
align-items: center;
|
margin-top: 0.5128rem;
|
.top_btn {
|
width: 100%;
|
height: 40%;
|
border-radius: 0.3564rem;
|
background: rgb(131, 174, 243);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
font-size: 0.5128rem;
|
}
|
.top_btn.on {
|
background: rgb(0, 71, 187);
|
}
|
.mes {
|
width: 100%;
|
height: 40%;
|
display: flex;
|
justify-content: flex-end;
|
align-items: center;
|
font-size: 0.3846rem;
|
}
|
}
|
}
|
}
|
.img_mess {
|
width: 100%;
|
height: 4.0513rem;
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
.logo_content {
|
width: 3rem;
|
height: 3.5769rem;
|
> img {
|
width: 100%;
|
height: 100%;
|
}
|
}
|
}
|
</style>
|