🎨 Style: 修改公共样式
This commit is contained in:
parent
78b6bce37f
commit
b5eb984535
BIN
front/public/img/login_bg.jpg
Normal file
BIN
front/public/img/login_bg.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 559 KiB |
40
front/src/layout/LoginLayout/index.jsx
Normal file
40
front/src/layout/LoginLayout/index.jsx
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from "react";
|
||||||
|
import styles from "./index.module.less";
|
||||||
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
|
export const LOGIN_TYPE = "login";
|
||||||
|
export const REGISTER_TYPE = "register";
|
||||||
|
export const RESET_PASSWORD_TYPE = "reset_password";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纯UI组件,使用单函数形式
|
||||||
|
* @param type 当前类别:上面的三个常亮
|
||||||
|
* @param children 子组件
|
||||||
|
*/
|
||||||
|
const LoginOrRegister = ({ type }) => {
|
||||||
|
console.log(type);
|
||||||
|
return (
|
||||||
|
<div className={styles.head}>
|
||||||
|
<Link to="/public/login" className={`${styles.item} ${type === LOGIN_TYPE ? styles.active : ""}`}>
|
||||||
|
登录
|
||||||
|
</Link>
|
||||||
|
<div className={styles.dot} />
|
||||||
|
<Link to="/public/register" className={`${styles.item} ${type === REGISTER_TYPE ? styles.active : ""}`}>
|
||||||
|
注册
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export function LoginLayout({ type, children }) {
|
||||||
|
return (
|
||||||
|
<div className={"fullScreen " + styles.main}>
|
||||||
|
<div className={styles.LOGO}>CR</div>
|
||||||
|
<div className={styles.content}>
|
||||||
|
{type === RESET_PASSWORD_TYPE ? <div>重置密码</div> : <LoginOrRegister type={type} />}
|
||||||
|
{children}
|
||||||
|
{type === RESET_PASSWORD_TYPE ? <Link to="/public/login">返回登录注册</Link> : null}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
58
front/src/layout/LoginLayout/index.module.less
Normal file
58
front/src/layout/LoginLayout/index.module.less
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
.main {
|
||||||
|
// background-image: url("/img/login_bg.jpg");
|
||||||
|
background-color: #f1f1f1;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-size: 100% 100%;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.LOGO {
|
||||||
|
position: absolute;
|
||||||
|
left: 5%;
|
||||||
|
top: 5%;
|
||||||
|
font-size: 4em;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1890ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
color: #969696 !important;
|
||||||
|
background: white;
|
||||||
|
padding: 2em;
|
||||||
|
|
||||||
|
.head {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 1.7em;
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 0.2em;
|
||||||
|
height: 0.2em;
|
||||||
|
margin: 0 1em;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #969696;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #969696 !important;
|
||||||
|
padding-bottom: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item.active {
|
||||||
|
border-bottom: 2px solid #1890ff;
|
||||||
|
padding-bottom: 0;
|
||||||
|
color: #1890ff !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item:hover {
|
||||||
|
border-bottom: 2px solid #1890ff;
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,6 +6,7 @@ import styles from "./index.module.less";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { changeLoginInfo, DATA_NAME } from "../../../redux/action/loginInfoAction";
|
import { changeLoginInfo, DATA_NAME } from "../../../redux/action/loginInfoAction";
|
||||||
import axios from "../../../util/httpUtil";
|
import axios from "../../../util/httpUtil";
|
||||||
|
import { LoginLayout, LOGIN_TYPE } from "../../../layout/LoginLayout";
|
||||||
|
|
||||||
function mapStateToProps(state) {
|
function mapStateToProps(state) {
|
||||||
return state[DATA_NAME];
|
return state[DATA_NAME];
|
||||||
@ -52,33 +53,12 @@ class Login extends Component {
|
|||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="fullScreen flex main-center across-center">
|
<LoginLayout type={LOGIN_TYPE}>
|
||||||
<div className={styles.main}>
|
<div className={styles.main}>
|
||||||
<div className={styles.top}>
|
<Input type="text" placeholder="输入邮箱" />
|
||||||
<IconFont type="icon-LC_icon_chat_fill" />
|
<Input type="text" placeholder="验证码" addonAfter={<span className={styles.getCode}>获取验证码</span>} />
|
||||||
<span>FIM</span>
|
|
||||||
</div>
|
|
||||||
<div className={styles.bottom}>
|
|
||||||
<div className={styles.inputArea}>
|
|
||||||
<IconFont type="icon-head" style={{ fontSize: "3em" }} />
|
|
||||||
{/* 用户名密码输入框 */}
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
<Input placeholder="用户名" onChange={this.usernameInput} />
|
|
||||||
注册账户
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<Input type="password" placeholder="密码" onChange={this.passwordInput} />
|
|
||||||
找回密码
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<Button type="primary" onClick={this.submit}>
|
|
||||||
登录
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</LoginLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,37 +1,21 @@
|
|||||||
.main {
|
.main {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 600px;
|
padding: 2em;
|
||||||
height: 400px;
|
width: 30em;
|
||||||
box-shadow: #ccc 0px 0px 20px;
|
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|
||||||
.top {
|
.getCode {
|
||||||
height: 50%;
|
cursor: pointer;
|
||||||
border-radius: 5px 5px 0 0;
|
|
||||||
background: #3d4fae;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: white;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom {
|
:global {
|
||||||
height: 50%;
|
.ant-input {
|
||||||
background: #ebf2f9;
|
border-top: 0;
|
||||||
border-radius: 0 0 5px 5px;
|
border-left: 0;
|
||||||
|
border-right: 0;
|
||||||
.inputArea {
|
border-bottom: 1px solid black !important;
|
||||||
padding: 0.2rem 0;
|
border-radius: 0;
|
||||||
display: flex;
|
margin-bottom: 1em;
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
:global {
|
|
||||||
.ant-input {
|
|
||||||
width: 20em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user