Commit 914242cb authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix:登录注册相关页面

parent 596dcd9c
......@@ -15,6 +15,10 @@ const router = [
path: '/user/register',
component: '@/pages/user/register'
},
{
path: '/user/getBack',
component: '@/pages/user/getBack'
},
]
}
]
......
export default {
'@primary-color': '#00B37A',
// 公共padding变量
'@padding-lg': '24px',
'@padding-sm': '12px',
'@padding-xs': '8px',
'@padding-xss': '4px',
// 公共margin变量
'@margin-lg': '24px',
'@margin-md': '16px',
'@margin-sm': '12px',
'@margin-xs': '8px',
'@margin-xss': '4px',
}
......@@ -29,12 +29,14 @@
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
"prettier": "^1.19.1",
"qrcode": "^1.4.4",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"umi": "^3.2.0",
"yorkie": "^2.0.0"
},
"devDependencies": {
"@types/qrcode": "^1.3.4",
"chalk": "^4.1.0",
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",
......
......@@ -26,3 +26,10 @@ h1, h2, h3, h4, h5, h6 {
.center-margin;
width: 1024px;
}
// 通用 居中
.@{prefix}-center {
.make-center(block);
.make-center(text);
}
\ No newline at end of file
......@@ -47,3 +47,22 @@
top: 50%;
transform: translate(-50%, -50%);
}
// margin带上下边距居中
.make-center-space(@type: margin, @top: 0, @bottom: 0) {
.make-center(@type);
margin-top: @top;
margin-bottom: @bottom;
}
// position定位
.position-left-top(@left, @top) {
position: absolute;
left: @left;
top: @top;
}
.position-right-bottom(@right, @bottom) {
position: absolute;
right: @right;
bottom: @bottom;
}
\ No newline at end of file
......@@ -4,6 +4,8 @@ import UserHeader from './components/UserHeader';
import BaseFooter from './components/BaseFooter';
import { Row } from 'antd';
import Logo from '../../mockStatic/logo.png'
/**
* 登录、注册等用户界面布局
* @author xjm
......@@ -11,7 +13,7 @@ import { Row } from 'antd';
const UserLayouts:React.FC = (props) => {
return (
<div className={styles.lingxiBusinessUserLayout}>
<UserHeader/>
<UserHeader logo={Logo}/>
<div className={styles.lingxiBusinessUserBg}>
{ props.children }
<BaseFooter/>
......
......@@ -8,17 +8,13 @@ import {
import styles from '../index.less'
const LoginWrap: React.FC = () => {
<<<<<<< HEAD
const [validFrame, setValidFrame] = useState(false)
const [validButton, setValidButton] = useState(false)
const finish = (value) => {
=======
const isValied = true
const finish = (value: any) => {
>>>>>>> 3fcaf2ac8432e3e511d10c3073e59eb1aa99a368
const finish = (value:any) => {
console.log(value)
}
return (
<>
<p>{validFrame ? '当前手机号码:xxxxxxxxx' : '请使用平台账号登录'}</p>
......@@ -75,13 +71,11 @@ const LoginWrap: React.FC = () => {
<Button ghost type='primary' block size='large'>点击进行验证</Button>
</Form.Item>)
}
<Form.Item>
<Button type='primary' size='large' htmlType='submit' block>点击登录</Button>
</Form.Item>
</Form>
}
</>
)
......
......@@ -5,14 +5,26 @@ import {
LockOutlined,
ExclamationCircleFilled
} from '@ant-design/icons';
import QRCode from 'qrcode';
import styles from '../index.less'
const ScanLoginWrap: React.FC = () => {
const [qrCode, setQrCode] = useState('')
QRCode.toDataURL('数商云是知名云计算及数据服务提供商点播互动直播技术深度投入致力以数字化未来赋能各行业全面进入数据时代。').then((url:any) => {
setQrCode(url)
console.log(url)
})
.catch((err:any) => {
console.error(err)
})
return (
<div className={styles.scanLoginWrap}>
<h2>扫码登录</h2>
<div className={styles.qrCodeImage}>
<img src={qrCode} alt=""/>
</div>
</div>
)
}
......
import React, { useState } from 'react';
import styles from './index.less'
import globalStyles from '@/global/styles/global.less';
import cx from 'classnames';
import { Row, Col, Form, Input, Button } from 'antd';
import TextLink from '@/components/TextLink';
import {
ExclamationCircleFilled,
} from '@ant-design/icons';
import { Link, history } from 'umi'
const GetBack: React.FC = () => {
const [validButton, setValidButton] = useState(true)
const finish = (value: any) => {
console.log(value)
}
return (
<Row className={styles.getBackBox}>
<h2>找回密码</h2>
<div className={cx(styles.getBackForm, globalStyles.lingxiBusinessMarginContent)}>
<Form
onFinish={finish}
className={styles.formBox}
>
<Form.Item
name='phonemail'
rules={
[
{
required: true,
message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请输入正确的手机或邮箱</span></>
}
]
}
>
<Input placeholder='请输入您的邮箱/手机' size='large'/>
</Form.Item>
{ validButton && (<Form.Item
className={styles.loginVerBtn}
>
<Button ghost type='primary' block size='large'>点击进行验证</Button>
</Form.Item>)
}
<Form.Item>
<Row>
<Col span={15}>
<Form.Item
name="captcha"
noStyle
rules={[{ required: true, message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请输入验证码</span></> }]}
>
<Input size='large' placeholder='输入验证码' />
</Form.Item>
</Col>
<Col offset={1} span={8}>
<Button type='default' size='large'>获取验证码</Button>
</Col>
</Row>
</Form.Item>
<Form.Item
name='password'
rules={
[
{
required: true,
message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请设置你的新密码</span></>
}
]
}
>
<Input.Password placeholder='请设置你的新密码' size='large'/>
</Form.Item>
<Form.Item
name="confirm"
dependencies={['password']}
rules={[
{
required: true,
message: <><ExclamationCircleFilled style={{marginRight: 6}}/><span>请再次输入密码</span></>,
},
({ getFieldValue }) => ({
validator(rule, value) {
if (!value || getFieldValue('password') === value) {
return Promise.resolve();
}
return Promise.reject(<><ExclamationCircleFilled style={{marginRight: 6}}/><span>两次输入的密码不匹配</span></>);
},
}),
]}
>
<Input.Password placeholder='请再次输入密码' size='large'/>
</Form.Item>
<Form.Item>
<Button type='primary' size='large' htmlType='submit' block>提交</Button>
</Form.Item>
<Form.Item>
<Link to='/user/login' className={styles.back}>返回登录页</Link>
</Form.Item>
</Form>
</div>
</Row>
)
}
export default GetBack
......@@ -20,7 +20,15 @@
font-size: 32px;
margin-bottom: 32px;
}
& .qrcodeLogin{
.clickUsernameLogin{
position: absolute;
right: 8px;
top: 8px;
font-size:14px;
color:rgba(107,119,140,1);
}
.clickScanLogin{
.center-text();
position: absolute;
right: 8px;
top: 8px;
......@@ -32,25 +40,34 @@
background: url("../../../mockStatic/qr_code2.png") center center no-repeat;
}
}
& .scanTips{
display: flex;
.scanTips{
.make-center(flex);
font-size:12px;
color:rgba(107,119,140,1);
.scanIcon{
font-size: 30px;
margin-right: @margin-sm;
}
}
}
.loginDesc {
//background: #9f9;
background: url("../../../mockStatic/image_ad.png") center center no-repeat;
background-size: cover;
& .adBox{
.adBox{
color: @white;
text-align: center;
.make-center(text);
& h2{
color: @white;
margin-top: 20px;
height: 80px;
line-height: 80px;
font-size:32px;
letter-spacing:2px;
}
& p{
padding: 10px 60px;
text-indent: 2em;
}
}
}
......@@ -58,16 +75,34 @@
height: 64px;
background: #FAFBFC;
margin-top: 90px;
& a{
margin-left: 6px;
.make-center(text);
vertical-align: middle;
}
}
.loginVerBtn {
background: #EBF7F2;
}
.scanLoginWrap{
text-align: center;
.make-center(text);
&>h2{
color: #6B778C;
}
.qrCodeImage{
.make-center(text);
margin-top: 30px;
margin-bottom: 18px;
width: 224px;
height: 224px;
.make-center(margin);
&>img{
.make-center(block);
width: 100%;
height: 100%;
}
}
}
......@@ -75,10 +110,10 @@
// register
.register {
width: 100%;
// width: 100%;
&>h3 {
padding: 40px 0;
text-align: center;
.make-center(text);
font-size: 32px;
margin-bottom: 0;
}
......@@ -96,22 +131,23 @@
height: 72px;
background: #FAFBFC;
padding: 0 115px;
display: flex;
align-items: center;
.make-center(flexAlign);
}
.formBoxStep1 {
width: 320px;
.form-box {
width: 340px;
margin: 40px auto 0;
.make-center-space(margin, 40px, 0);
// .form-box {
// width: 340px;
// margin: 40px auto 0;
// }
}
.formBefore {
width: 54px;
line-height: 40px;
height: 40px;
text-align: center;
.make-center(text);
background: #F4F5F7;
color: #42526E;
border: 1px solid #DFE1E6;
......@@ -125,7 +161,7 @@
}
}
.continueButton{
display: block;
.make-center(block);
width: 320px;
height: 40px;
margin: 8px auto;
......@@ -133,7 +169,7 @@
.identityRadio{
display: flex;
flex-direction: column;
text-align: center;
.make-center(text);
& label{
width: 320px;
height: 48px;
......@@ -147,7 +183,7 @@
flex-wrap: wrap;
width: 320px;
margin: 0 auto;
text-align: center;
.make-center(text);
& label{
width: 148px;
height: 32px;
......@@ -161,8 +197,8 @@
.formBoxStep3{
width: 704px;
margin: 0px auto 0;
text-align: center;
margin: 0px auto;
.make-center(text);
& .description{
margin-bottom: 40px;
& p{
......@@ -177,7 +213,6 @@
font-size:14px;
color:rgba(107,119,140,1);
line-height:22px;
}
& h2{
font-size:24px;
......@@ -207,7 +242,7 @@
width: 148px;
margin-right: 24px;
margin-bottom: 16px;
text-align: center;
.make-center(text);
height: 32px;
line-height: 32px;
&:nth-child(2n) {
......@@ -217,7 +252,7 @@
.large {
width: 320px;
margin-bottom: 24px;
text-align: center;
.make-center(text);
height: 48px;
line-height: 48px;
}
......@@ -228,4 +263,31 @@
margin-right: auto;
display: block;
}
// get back password
.getBackBox {
&>h2 {
width: 100%;
.make-center(text);
height:120px;
line-height:120px;
font-size:24px;
font-weight:500;
color: #172B4D;
}
.getBackForm{
background-color: @white;
.formBox{
width: 320px;
.make-center-space(margin,40px,40px);
.back{
.make-center(block);
width: 100%;
.make-center(text);
color: #6B778C;
}
}
}
}
\ No newline at end of file
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
[x: string]: string | undefined;
'adBox': string;
'businessRadio': string;
'commonPanelTitle': string;
......
......@@ -8,41 +8,57 @@ import {
ExclamationCircleFilled,
ScanOutlined
} from '@ant-design/icons';
import { Link, history } from 'umi'
import LoginWrap from './components/loginWrap';
import ScanLoginWrap from './components/ScanLoginWrap';
// import leftPicture from '../../../mockStatic/image_ad.png'
import wechat from '../../../mockStatic/Wechat.png'
import qq from '../../../mockStatic/QQ.png'
import alipay from '../../../mockStatic/Alipay.png'
const User: React.FC = () => {
const [isScanQrCode,setIsScanQrCode] = useState(true)
const [isScanQrCode,setIsScanQrCode] = useState(false)
const handleGuideLogin = (param: boolean) => {
setIsScanQrCode(param)
}
const forgetPassword = () => {
history.push('/user/getBack')
console.log('找回密码')
}
return (
<Row className={cx(styles.loginWrap, globalStyles.lingxiBusinessContent1024)}>
<Col className={cx(styles.loginItem, styles.loginDesc)}>
<div className={styles.adBox}>
{/*<img src={leftPicture} alt="数商云"/>*/}
<h2>数商云,驱动全链数字化运营</h2>
<p>「数商云」,是一家领先的企业全链数字化运营服务 提供商。致力于通过大数据、云计算等新技术协助企业打造渠道端—营销端—数据端等全链 数字化运营体系,全面提升企业运营效益与智慧数字化商业转型</p>
<h2>欢迎来到数商云</h2>
<p>数商云是知名云计算及数据服务提供商,在海量文件存储、CDN 内容分发、视频点播、互动直播及大规模异构数据的智能分析与处理等技术深度投入,致力以数据科技驱动数字化未来,赋能各行业全面进入数据时代</p>
</div>
</Col>
<Col className={cx(styles.loginItem, styles.loginCtl)}>
<div className={styles.loginMain}>
<a className={styles.qrcodeLogin} />
<h2>欢迎您</h2>
{/*<a className={styles.guideLogin} />*/}
{/*{ isScanQrCode ? <></> : <h2>欢迎您</h2>}*/}
{ isScanQrCode ? (
<>
<a onClick={()=>handleGuideLogin(false)} className={styles.clickUsernameLogin}>使用账号密码登录</a>
<ScanLoginWrap/>
<div className={styles.scanTips}>
<ScanOutlined style={{width:28,height:28}} />
<ScanOutlined className={styles.scanIcon} />
<span>打开 App<br />扫一扫登录</span>
</div>
</>
) : (
<>
<ScanLoginWrap/>
<a onClick={()=>handleGuideLogin(true)} className={styles.clickScanLogin} />
<h2>欢迎您</h2>
<LoginWrap/>
<Row justify='end' style={{marginTop: 16}}>
<Space size={32}>
<TextLink>免费注册</TextLink>
<TextLink>忘记密码</TextLink>
<TextLink><Link to='/user/register' style={{color:'#6b778c'}}>免费注册</Link></TextLink>
<TextLink><a onClick={forgetPassword} style={{color:'#6b778c'}}>忘记密码</a></TextLink>
</Space>
</Row>
</>
......@@ -50,7 +66,11 @@ const User: React.FC = () => {
}
</div>
<Row className={styles.thirdLogin} align='middle' justify='center'>
<Col>其他方式登录</Col>
<Col>其他方式登录
<a title="微信登陆"><img src={wechat} alt="微信登录"/></a>
<a title="QQ登录"><img src={qq} alt="QQ登录"/></a>
<a title="支付宝登录"><img src={alipay} alt="支付宝登录"/></a>
</Col>
</Row>
</Col>
</Row>
......
......@@ -125,7 +125,7 @@ let timeChange: any; // 定时器
const UserRegistry = () => {
const [identityForm1] = Form.useForm();
const [licenseForm] = Form.useForm();
const [current, setCurrent] = useState(1.1)
const [current, setCurrent] = useState(0)
const handleOneSubmit = (values: any) => {
console.log(values, 'values')
......@@ -205,7 +205,7 @@ const UserRegistry = () => {
return (
<div className={cx(styles.register, globalStyles.lingxiBusinessContent1024)}>
<h3>欢迎您注册数商云账号</h3>
<div className={styles.registerBox}>
<div className={cx(styles.registerBox, globalStyles.lingxiBusinessMarginContent)}>
<Steps current={current} className={styles.stepWrap} size='small'>
{
stepList.map((v,i) => <Step title={v.title} key={v.key} onClick={() => {setCurrent(i)}}/>)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment