Commit 0df0818d authored by 周宏民's avatar 周宏民

feat: 大足登录页

parent df7457e1
...@@ -143,6 +143,7 @@ ...@@ -143,6 +143,7 @@
"qiankun": "^2.4.6", "qiankun": "^2.4.6",
"qrcode.react": "^1.0.0", "qrcode.react": "^1.0.0",
"rc-cascader": "^2.3.2", "rc-cascader": "^2.3.2",
"rc-queue-anim": "^2.0.0",
"react": "17.0.2", "react": "17.0.2",
"react-activation": "^0.9.9", "react-activation": "^0.9.9",
"react-dom": "17.0.2", "react-dom": "17.0.2",
......
This diff was suppressed by a .gitattributes entry.
/* /*
* @Author: 634665781 634665781@qq.com * @Author: 634665781 634665781@qq.com
* @Date: 2022-07-08 14:28:01 * @Date: 2022-07-08 14:28:01
* @LastEditors: 634665781 634665781@qq.com * @LastEditors: Please set LastEditors
* @LastEditTime: 2022-09-05 17:38:26 * @LastEditTime: 2023-01-13 10:01:40
* @FilePath: \CivWeb\src\pages\user\login\index.js * @FilePath: \CivWeb\src\pages\user\login\index.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -24,6 +24,7 @@ import XinganLogin from './template/project/xingan'; ...@@ -24,6 +24,7 @@ import XinganLogin from './template/project/xingan';
import ErlianhaoteLogin from './template/project/erlianhaote'; import ErlianhaoteLogin from './template/project/erlianhaote';
import YixianLogin from './template/project/yixian'; import YixianLogin from './template/project/yixian';
import LixianLogin from './template/project/lixian'; import LixianLogin from './template/project/lixian';
import DazuLogin from './template/project/dazu';
import PanoramaLogin from './template/panorama'; import PanoramaLogin from './template/panorama';
import { AppInitState } from '../../../render'; import { AppInitState } from '../../../render';
const LoginTemplate = { const LoginTemplate = {
...@@ -45,6 +46,7 @@ const LoginTemplate = { ...@@ -45,6 +46,7 @@ const LoginTemplate = {
'项目 - 二连浩特.html': ErlianhaoteLogin, '项目 - 二连浩特.html': ErlianhaoteLogin,
'项目 - 易县.html': YixianLogin, '项目 - 易县.html': YixianLogin,
'项目 - 蠡县.html': LixianLogin, '项目 - 蠡县.html': LixianLogin,
'项目 - 大足.html': DazuLogin,
'全景图.html': PanoramaLogin, '全景图.html': PanoramaLogin,
default: BaseLogin, default: BaseLogin,
}; };
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
/*
* 功能名称: 大足登录页
* 功能路径:
* 功能参数:
*/
import React, { forwardRef, useEffect, useRef, useState } from 'react';
import { Modal, Popover } from 'antd';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect } from 'react-redux';
import { useHistory, withRouter } from '@wisdom-utils/runtime';
import { actionCreators } from '@/containers/App/store';
import classnames from 'classnames';
import moment from 'moment';
import QueueAnim from 'rc-queue-anim';
import defaultSetting from '../../../../../../../config/defaultSetting';
import LoginAction from '../../../login';
import styles from './index.less';
import Account from '../../../js/useAccount';
import { defaultApp } from '../../../../../../micro';
import logo from './images/logo.png';
import loginTitlePng from './images/text.png';
const Login = forwardRef((props, _ref) => {
const sliVerify = useRef();
const videoRef = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const [status, setStatus] = useState('normal');
const [show, setShow] = useState(false);
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [type, setType] = useState('Account');
const [visible, setVisible] = useState(false);
const [videoShow, setVideoShow] = useState(true);
const history = useHistory();
const [action, setAction] = useState(() => new LoginAction(Object.assign({}, props, { history }), setVisible, false));
const [dateObj, setDateObj] = useState({});
const handleSubmit = values => {
/* eslint-disable */
action &&
(type === 'Account'
? action.loginHandler(values.userName, values.password, null, autoLogin, sliVerify)
: type === 'Mobile'
? action.phoneLoginFormHandler(values.mobile, values.captcha)
: null);
setSubmitting(true);
props.updateCurrentIndex && props.updateCurrentIndex(-1);
};
useEffect(() => {
action &&
action.events.on('loginSuccess', event => {
setSubmitting(false);
props.updateCurrentIndex && props.updateCurrentIndex(0);
props.history.push(`/?client=${props.global.client}`);
// window.share.event.emit('triggerMicro', props.global);
// initMicroApps();
defaultApp();
});
action &&
action.events.on('loginError', event => {
setVisible(false);
setSubmitting(false);
});
action &&
action.events.on('loginVisible', status => {
setVisible(status);
});
return () => {
action && action.events && action.events.removeAllListeners('loginSuccess');
action && action.events && action.events.removeAllListeners('loginError');
action && action.events && action.events.removeAllListeners('loginVisible');
};
}, [props.loginMode]);
useEffect(() => {
setSubmitting(false);
}, [visible]);
const renderPlatform = () => {
const template = props.global.loginTemplate;
const params = {
fromRef: formRef,
type,
setType,
status,
submitting,
autoLogin,
setAutoLogin,
action,
onSubmit: handleSubmit,
loginMode: props.loginMode,
updateLoginMode: props.updateLoginMode,
welcome: null,
};
return <Account {...params} />;
};
/* eslint-disable */
const handleWeek = () => {
const weekOfDay = Number(moment().format('E'));
let weekDayName = '';
switch (weekOfDay) {
case 1:
weekDayName = '周一';
break;
case 2:
weekDayName = '周二';
break;
case 3:
weekDayName = '周三';
break;
case 4:
weekDayName = '周四';
break;
case 5:
weekDayName = '周五';
break;
case 6:
weekDayName = '周六';
break;
case 7:
weekDayName = '周日';
break;
default:
weekDayName = '';
}
return weekDayName;
};
const onShow = () => {
if (!show) {
setShow(true);
}
};
const onended = () => {
if (videoShow) {
setVideoShow(false);
}
if (!show) {
setShow(true);
}
};
useEffect(() => {
setTimeout(() => {
if (videoRef && videoRef.current) {
videoRef.current.addEventListener('ended', () => {
onended();
});
}
});
return () => {
videoRef.current && videoRef.current.removeEventListener('ended', () => {});
};
}, [videoRef]);
useEffect(() => {
return () => {};
}, [show]);
useEffect(() => {
const timer = setInterval(() => {
setDateObj({
curTime: moment().format('HH:mm:ss'),
week: handleWeek(),
date: moment().format('YYYY/MM/DD'),
});
}, 1000);
return () => {
clearInterval(timer);
};
}, []);
return (
<HelmetProvider>
<Helmet>
<title>{props.global.title || defaultSetting.title}</title>
<meta name="description" content={props.global.title || defaultSetting.title} />
</Helmet>
<div className={classnames(styles.dazulogin)} onClick={onShow}>
{show ? (
<>
<QueueAnim type="top">
<div key="outwrapper" className={styles.dazu_out_wrapper}>
<div className={styles.dazu_out_logo}>
<img src={logo} alt="logo" />
</div>
<div className={styles.dazu_out_title}>泽足水务</div>
</div>
</QueueAnim>
<QueueAnim type="scale" duration={1000}>
<div key={'innerwrapper'} className={classnames(styles['inner-wrapper'])}>
<div className={styles['inner-center']}>
<div className={styles['welcome-title']}>
<img src={loginTitlePng} alt="login-title" />
</div>
<div className={classnames(styles['inner-bg'], styles['login-part'])} ref={loginFormRef}>
{renderPlatform()}
</div>
</div>
</div>
</QueueAnim>
<div key="loginheader" className={classnames(styles['login-header'])}>
<QueueAnim type="left">
<div key="logintitle" className={styles['left-title']}>
<div>
<img src={logo} alt="logo" />
</div>
<div className={styles['cn-title']}>重庆泽足水务投资建设有限公司综合管理平台</div>
</div>
</QueueAnim>
<QueueAnim type="right">
<div key="logintime" className={styles['right-timebox']}>
<div className={styles['curr-time']}>{dateObj.curTime}</div>
<div className={styles['curr-week-date']}>
<div className={styles['curr-week']}>{dateObj.week}</div>
<div className={styles['curr-date']}>{dateObj.date}</div>
</div>
</div>
</QueueAnim>
</div>
</>
) : null}
{videoShow ? (
<video
src={require('@/assets/videos/dazu.mp4')}
className={styles.videLayer}
autoPlay="autoPlay"
muted
playsInline="playsinline"
ref={videoRef}
/>
) : null}
<Modal centered visible={visible} width={340} footer={null} closable={false} bodyStyle={{ padding: '15px' }}>
<div ref={sliVerify} />
</Modal>
</div>
</HelmetProvider>
);
});
const mapStateToProps = state => ({
global: state.getIn(['global', 'globalConfig']),
loginMode: state.getIn(['global', 'loginMode']),
});
const mapDispatchToProps = dispatch => ({
updateConfig(config) {
dispatch(actionCreators.getConfig(config));
},
createContext(data) {
dispatch(actionCreators.createContext(data));
},
updateLoginMode(mode) {
dispatch(actionCreators.changeLoginMode(mode));
},
updateCurrentIndex(index) {
dispatch(actionCreators.updateCurrentIndex(index));
},
});
export default connect(
mapStateToProps,
mapDispatchToProps,
)(withRouter(Login));
@font-face {
font-family: PingFang SC;
src: url('@/assets/fonts/PingFang.ttf');
}
.dazulogin {
width: 100%;
height: 100%;
background: radial-gradient(#fff 5%, rgba(162, 215, 245, 1) 100%);
position: relative;
min-height: 7.0rem;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
.caseHide {
display: none !important;
}
.videLayer {
width: 100vw;
height: 100vh;
position: absolute;
top: 0;
left: 0;
object-fit: fill;
}
.dazu_out_wrapper {
box-sizing: border-box;
width: 500px;
position: absolute;
top: 120px;
left: calc(50% - 250px);
display: flex;
justify-content: center;
align-items: center;
padding: 10px 0;
z-index: 50;
.dazu_out_title {
font-size: 72px;
font-family: PingFang SC;
font-weight: 800;
color: #265499;
line-height: 1;
margin-left: 20px;
}
}
.inner-bg {
width: 100%;
height: 100%;
&>div {
width: 80%;
margin: 10%;
}
}
.inner-wrapper {
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: 250px;
left: calc(50% - 240px);
z-index: 50;
}
.inner-bg .title {
font-size: 27px;
font-weight: bold;
color: rgba(255, 255, 255, 1);
letter-spacing: 2px;
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.inner-center {
position: relative;
width: 480px;
height: 380px;
background: rgba(255, 255, 255, 0.9);
border: 1px solid #FFFFFF;
box-shadow: 1px 1px 12px -3px #22222277;
border-radius: 8px 10px 10px 10px;
}
.welcome-title {
background: linear-gradient(0deg, rgba(9, 128, 238, 1) 0%, rgba(0, 182, 251, 1) 100%);
height: 100px;
border-radius: 8px 8px 0px 0px;
text-align: center;
line-height: 70px;
padding: 16px;
img {
width: 434px;
}
}
.formgroup2 {
display: flex;
align-items: center;
display: flex;
margin: 0px 5.5%;
margin-bottom: 10%;
align-items: center;
margin-bottom: 40px;
}
.APPcodeBox {
width: 100%;
display: flex;
flex-flow: column;
align-items: center;
cursor: pointer;
position: relative;
}
.APPCtext {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #000000;
line-height: 30px;
opacity: 0.75;
}
.login-header {
box-sizing: border-box;
width: 100%;
position: absolute;
top: 0;
left: 0;
height: 82px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 22px;
z-index: 50;
// border-bottom: 1px solid rgba(255, 255, 255, 0.12);
.left-title {
display: flex;
justify-content: flex-start;
align-items: center;
img {
width: 40px;
}
.cn-title {
font-size: 30px;
font-family: PingFang SC;
line-height: 1;
font-weight: 800;
color: #265499;
margin-left: 10px;
}
}
.right-timebox {
display: flex;
justify-content: center;
align-items: center;
height: 60px;
.curr-time {
width: 140px;
font-size: 36px;
font-family: Microsoft YaHei;
font-weight: 300;
color: #265499;
}
.curr-week-date {
margin-left: 10px;
.curr-week {
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #265499;
}
.curr-date {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #265499;
}
}
}
}
.copyright {
position: absolute;
bottom: 7%;
width: 100%;
margin: 0 auto;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #F1F6FD;
text-align: center;
}
.qrcode-box {
position: absolute;
bottom: 0;
right: -35px;
width: 35px;
height: 35px;
background: #FFFFFF;
opacity: 0.8;
cursor: pointer;
}
}
& :global {}
\ No newline at end of file
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