登录和注册界面调整

This commit is contained in:
kerwincui
2022-05-31 16:55:33 +08:00
parent 1f9636ac96
commit 1cf1a60583
2 changed files with 111 additions and 84 deletions

View File

@@ -1,20 +1,47 @@
<template> <template>
<div class="login"> <div class="login">
<div style="width:520px;padding:20px;"> <div style="padding:20px;">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"> <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14">
<div class="login-top"> <div class="login-top hidden-sm-and-down">
<h1> <h1>
<a href="https://wumei.live/" target="_blank" style="color:#FFF;">物美智能</a> <a href="https://wumei.live/" target="_blank" style="color:#FFF;">物美智能</a>
- -
<a href="https://wumei.live/" target="_blank" style="color:#FFF;">开源生活物联网平台</a> <a href="https://wumei.live/" target="_blank" style="color:#FFF;">开源生活物联网平台</a>
</h1> </h1>
<h2><a href="https://wumei.live/" target="_blank" style="color:#FFF;">wumei smart</a> open source living iot platform</h2> <h2><a href="https://wumei.live/" target="_blank" style="color:#FFF;">wumei smart</a> open source living iot platform</h2>
<div style="max-width:330px;text-align:left;margin:0 auto;">
<div v-if="!bindAccount" style="padding:25px 0;">
<span style="color:#fff;margin-right:10px;">登录方式</span>
<el-button type="success" title="微信登录" size="mini" @click="authLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="wechat" /> 微信
</el-button>
<el-button type="danger" title="QQ登录" size="mini" @click="qqLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="qq" /> QQ
</el-button>
<el-button type="primary" title="支付宝登录" size="mini" @click="authLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="zhifubao" /> 支付宝
</el-button>
</div>
<div v-if="register">
<el-button style="padding:0px;">
<router-link :to='{path:"/register",query: this.$route.query }' style="color:#666;padding:12px 18px;display:flex;">注册账号
</router-link>
</el-button>
<el-button type="warning" style="padding:0px;">
<el-link href="https://wumei.live/" :underline="false" target="_blank" style="color:#fff;padding:12px 18px;">返回官网</el-link>
</el-button>
<el-button type="danger" style="padding:0px;">
<el-link href="https://wumei.live/doc" :underline="false" target="_blank" style="color:#fff;padding:12px 18px;">查看文档</el-link>
</el-button>
</div>
</div>
</div> </div>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"> <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" style="z-index:1000;margin:0 auto;"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title" v-if="!bindAccount">账号登录</h3> <h3 class="title" v-if="!bindAccount">账号登录</h3>
<h3 class="bindAccountTitle" v-else>绑定物美智能账户</h3> <h3 class="bindAccountTitle" v-else>绑定物美智能账户</h3>
<div style="font-size:16px;color:#eee;margin-bottom:10px;">演示账号wumei<span style="margin:0 10px;">123456</span></div> <div style="font-size:16px;color:#eee;margin-bottom:10px;">演示账号wumei<span style="margin:0 10px;">123456</span></div>
@@ -38,33 +65,14 @@
</el-form-item> </el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;color:#000;">记住密码</el-checkbox> <el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;color:#000;">记住密码</el-checkbox>
<el-form-item style="width:100%;"> <el-form-item style="width:100%;">
<el-button v-if="!bindAccount" :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin"> <el-button v-if="!bindAccount" :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
<el-button v-else :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleLogin"> <el-button v-else :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleLogin">
<span v-if="!loading">绑定</span> <span v-if="!loading">绑定</span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
<div style="margin-top:30px;" v-if="!bindAccount">
<div v-if="!bindAccount" style="float:left;">
<span style="color:#fff;margin-right:10px;">第三方登录</span>
<el-button type="success" circle title="微信登录" size="small" @click="authLogin">
<svg-icon icon-class="wechat" />
</el-button>
<el-button type="danger" circle title="QQ登录" size="small" @click="qqLogin">
<svg-icon icon-class="qq" />
</el-button>
<el-button type="primary" circle title="支付宝登录" size="small" @click="authLogin">
<svg-icon icon-class="zhifubao" />
</el-button>
</div>
<div style="float:right;" v-if="register">
<router-link style="color:#333;font-size:16px;" :to='{path:"/register",query: this.$route.query }'>立即注册>>
</router-link>
</div>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
@@ -79,6 +87,7 @@
</template> </template>
<script> <script>
import 'element-ui/lib/theme-chalk/display.css';
import { import {
getCodeImg, getCodeImg,
checkBindId, checkBindId,
@@ -266,20 +275,20 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.login { .login {
display: flex;
justify-content: center;
background: linear-gradient(303deg, #48c6ef 10%, #6f86d6 80%); background: linear-gradient(303deg, #48c6ef 10%, #6f86d6 80%);
height: 100%; height: 100%;
overflow: auto; overflow: auto;
padding-top: 150px;
} }
.title { .title {
margin: 0px auto 20px auto; margin: 0px auto 20px auto;
text-align: center; text-align: center;
color: #333; color: #333;
font-size: 30px; font-size: 24px;
} }
.bindAccountTitle { .bindAccountTitle {
@@ -292,25 +301,27 @@ export default {
.login-top { .login-top {
color: #fff; color: #fff;
text-align: center; text-align: center;
font-weight: bold; padding: 30px;
margin-bottom: 100px;
h1 { h1 {
font-size: 30px; font-size: 46px;
} }
h2 { h2 {
font-size: 21px; font-size: 26px;
margin-top: -12px; margin-top: -15px;
} }
} }
.login-form { .login-form {
box-shadow: 0 20px 20px 0 rgba(0, 0, 0, 0.1);
border-radius: 6px; border-radius: 6px;
background-color: rgba(250, 250, 250, 0.2); background-color: rgba(250, 250, 250, 0.2);
border: 1px solid #fff; border: 1px solid #fff;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
margin: 20px; margin:0 auto;
z-index: 1000;
max-width: 400px;
margin-bottom: 100px; margin-bottom: 100px;
.el-input { .el-input {
@@ -318,6 +329,7 @@ export default {
input { input {
height: 38px; height: 38px;
background-color: rgba(255, 255, 255, 0.9);
} }
} }

View File

@@ -1,19 +1,46 @@
<template> <template>
<div class="register"> <div class="register">
<div style="width:520px;padding:20px;"> <div style="padding:20px;">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"> <el-col :xs="24" :sm="24" :md="14" :lg="14" :xl="14">
<div class="login-top"> <div class="login-top hidden-sm-and-down">
<h1> <h1>
<a href="https://wumei.live/" target="_blank" style="color:#FFF;">物美智能</a> <a href="https://wumei.live/" target="_blank" style="color:#FFF;">物美智能</a>
- -
<a href="https://wumei.live/" target="_blank" style="color:#FFF;">开源生活物联网平台</a> <a href="https://wumei.live/" target="_blank" style="color:#FFF;">开源生活物联网平台</a>
</h1> </h1>
<h2><a href="https://wumei.live/" target="_blank" style="color:#FFF;">wumei smart</a> open source living iot platform</h2> <h2><a href="https://wumei.live/" target="_blank" style="color:#FFF;">wumei smart</a> open source living iot platform</h2>
<div style="max-width:330px;text-align:left;margin:0 auto;">
<div v-if="!bindAccount" style="padding:25px 0;">
<span style="color:#fff;margin-right:10px;">登录方式</span>
<el-button type="success" title="微信登录" size="mini" @click="authLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="wechat" /> 微信
</el-button>
<el-button type="danger" title="QQ登录" size="mini" @click="qqLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="qq" /> QQ
</el-button>
<el-button type="primary" title="支付宝登录" size="mini" @click="authLogin" style="border:1px solid #fff;" disabled>
<svg-icon icon-class="zhifubao" /> 支付宝
</el-button>
</div>
<div>
<el-button style="padding:0px;">
<router-link :to='{path:"/login",query: this.$route.query }' style="color:#666;padding:12px 18px;display:flex;">账号登录
</router-link>
</el-button>
<el-button type="warning" style="padding:0px;">
<el-link href="https://wumei.live/" :underline="false" target="_blank" style="color:#fff;padding:12px 18px;">返回官网</el-link>
</el-button>
<el-button type="danger" style="padding:0px;">
<el-link href="https://wumei.live/doc" :underline="false" target="_blank" style="color:#fff;padding:12px 18px;">查看文档</el-link>
</el-button>
</div>
</div>
</div> </div>
</el-col> </el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24"> <el-col :xs="24" :sm="24" :md="8" :lg="8" :xl="8">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form" style="z-index:1000"> <el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form" style="z-index:1000">
<h3 class="title" v-if="!bindAccount">注册账号</h3> <h3 class="title" v-if="!bindAccount">注册账号</h3>
<h3 class="title" v-else>注册绑定物美智能账户</h3> <h3 class="title" v-else>注册绑定物美智能账户</h3>
@@ -46,30 +73,14 @@
</div> </div>
</el-form-item> </el-form-item>
<el-form-item style="width:100%;"> <el-form-item style="width:100%;">
<el-button v-if="!bindAccount" :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleRegister"> <el-button v-if="!bindAccount" :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleRegister">
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
<el-button v-else :loading="loading" size="medium" type="primary" style="width:100%;" @click.native.prevent="handleRegister"> <el-button v-else :loading="loading" type="primary" style="width:100%;" @click.native.prevent="handleRegister">
<span v-if="!loading"> </span> <span v-if="!loading"> </span>
<span v-else> 中...</span> <span v-else> 中...</span>
</el-button> </el-button>
<div style="margin-top:30px;">
<div v-if="!bindAccount" style=" margin-bottom: 10px;text-align: center ;float:left;">
<span style="color:#fff;margin-right:10px;">第三方登录</span>
<el-button type="success" circle title="微信登录" size="small" @click="authLogin">
<svg-icon icon-class="wechat" />
</el-button>
<el-button type="danger" circle title="QQ登录" size="small" @click="qqLogin">
<svg-icon icon-class="qq" />
</el-button>
<el-button type="primary" circle title="支付宝登录" size="small" @click="authLogin">
<svg-icon icon-class="zhifubao" />
</el-button>
</div>
<router-link style="float:right;color:#333;font-size:16px;" :to='{path:"/login",query: this.$route.query }'>已有账户登录 >>
</router-link>
</div>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-col> </el-col>
@@ -84,6 +95,7 @@
</template> </template>
<script> <script>
import 'element-ui/lib/theme-chalk/display.css';
import { import {
getCodeImg, getCodeImg,
checkBindId, checkBindId,
@@ -263,51 +275,54 @@ export default {
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.register { .register {
display: flex;
justify-content: center;
height: 100%;
background: linear-gradient(303deg, #48c6ef 10%, #6f86d6 80%); background: linear-gradient(303deg, #48c6ef 10%, #6f86d6 80%);
} height: 100%;
overflow: auto;
.login-top { padding-top: 150px;
color: #fff;
text-align: center;
font-weight: bold;
margin-top: 20px;
margin-bottom:80px;
h1 {
font-size: 30px;
}
h2 {
font-size: 21px;
margin-top: -12px;
}
} }
.title { .title {
margin: 0px auto 30px auto; margin: 0px auto 20px auto;
text-align: center; text-align: center;
color: #333; color: #333;
font-size: 24px; font-size: 24px;
} }
.login-top {
color: #fff;
text-align: center;
padding: 30px;
h1 {
font-size: 46px;
}
h2 {
font-size: 26px;
margin-top: -15px;
}
}
.register-form { .register-form {
box-shadow: 0 20px 20px 0 rgba(0, 0, 0, 0.1);
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
background-color: rgba(250, 250, 250, 0.2); background-color: rgba(250, 250, 250, 0.2);
border: 1px solid #fff; border: 1px solid #fff;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
margin: 20px; margin:0 auto;
z-index: 1000;
max-width: 400px;
margin-bottom: 100px;
.el-input { .el-input {
height: 38px; height: 38px;
input { input {
height: 38px; height: 38px;
background-color: rgba(255, 255, 255, 0.9);
} }
} }