Commit dd898592 authored by 崔佳豪's avatar 崔佳豪

Merge branch 'dev' into 'master'

Dev See merge request !11
parents 1fb93ebf 3cce7a6b
Pipeline #59662 passed with stages
...@@ -21,6 +21,7 @@ import JSZHLogin from './template/project/JSZH'; ...@@ -21,6 +21,7 @@ import JSZHLogin from './template/project/JSZH';
import ChengmaiLogin from './template/project/chengmai'; import ChengmaiLogin from './template/project/chengmai';
import HuhehaoteLogin from './template/project/huhehaote'; import HuhehaoteLogin from './template/project/huhehaote';
import XinganLogin from './template/project/xingan'; import XinganLogin from './template/project/xingan';
import ErlianhaoteLogin from './template/project/erlianhaote';
import { AppInitState } from '../../../render'; import { AppInitState } from '../../../render';
const LoginTemplate = { const LoginTemplate = {
'新春 - 智联.html': NewYear, '新春 - 智联.html': NewYear,
...@@ -38,6 +39,7 @@ const LoginTemplate = { ...@@ -38,6 +39,7 @@ const LoginTemplate = {
'项目 - 澄迈.html': ChengmaiLogin, '项目 - 澄迈.html': ChengmaiLogin,
'项目 - 呼和浩特.html': HuhehaoteLogin, '项目 - 呼和浩特.html': HuhehaoteLogin,
'项目 - 新干.html': XinganLogin, '项目 - 新干.html': XinganLogin,
'项目 - 二连浩特.html': ErlianhaoteLogin,
default: BaseLogin, default: BaseLogin,
}; };
/* eslint-disable */ /* eslint-disable */
......
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
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 } 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 defaultSetting from '../../../../../../../config/defaultSetting';
import LoginAction from '../../../login';
import styles from './index.less';
import Account from '../../../js/useAccount';
import { defaultApp } from '../../../../../../micro';
import QRCode from 'qrcode.react';
import leftLogo from './images/ls-logo.png'
import loginLogo from './images/二连浩特icon.png'
import classnames from 'classnames';
import moment from 'moment';
const renderQRCode = props => {
const qrcodes = props.qrcode.split('|') || [];
if (qrcodes.length > 0 && qrcodes[0]) {
let value = qrcodes[0].replace(/{ip}/gi, props.ip || window.location.host).split('=')[1];
return <QRCode value={value} />;
}
return <span>手持APP下载未配置</span>;
};
const Login = forwardRef((props, _ref) => {
const sliVerify = useRef();
const loginFormRef = useRef();
const formRef = useRef(null);
const [status, setStatus] = useState('normal');
const [autoLogin, setAutoLogin] = useState(false);
const [submitting, setSubmitting] = useState(false);
const [type, setType] = useState('Account');
const [visible, setVisible] = useState(false);
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 0:
weekDayName = '周日'
break
default:
weekDayName = ''
}
return weekDayName
}
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={styles.login}>
<div className={styles['inner-wrapper']}>
<div className={styles['left-imgbox']}></div>
<div className={styles['inner-center']}>
<div className={styles['welcome-title']}>
<img src={loginLogo}/>
</div>
<div className={classnames(styles['inner-bg'], styles['login-part'])} ref={loginFormRef}>
{renderPlatform()}
</div>
</div>
</div>
<div className={styles['login-header']}>
<div className={styles['left-title']}>
<img src={leftLogo}/>
</div>
<div 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>
</div>
<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));
.login {
width: 100%;
height: 100%;
background: url('./images/乐山登录背景.png') no-repeat center;
background-size: 100% 100%;
background-clip: border-box;
position: relative;
min-height: 7.0rem;
overflow: hidden;
display: flex;
justify-content: center;
align-items: center;
}
.login .inner-bg {
width: 78%;
// height: 100%;
margin: 13% 11% 25% 11%;
&>div {
width: 70%;
margin: 0 auto;
}
}
.inner-wrapper {
position: absolute;
top: 50%;
left: 50%;
width: 1100px;
height: 646px;
margin-left: -550px;
margin-top: -298px;
background: url('./images/二连浩特登陆框.png') no-repeat top;
background-size: 100% 100%;
display: flex;
align-items: flex-end;
}
.left-imgbox {
width: 682px;
height: 596px;
background: url('./images/二连浩特登陆界面配图-动态.gif') no-repeat center;
background-size: 100% 100%;
background-clip: border-box;
}
.img-wrapper {
width: 388px;
height: 134px;
background: url('./images/1.png') no-repeat center;
background-size: 100% 100%;
margin-bottom: 48px;
}
.login .inner-bg img[role="logo"] {
height: 40px;
}
.login .inner-bg .title {
font-size: 27px;
font-weight: bold;
color: rgba(255, 255, 255, 1);
letter-spacing: 2px;
}
@keyframes waving {
from {
top: 0;
}
to {
top: 10px;
}
}
@keyframes waving2 {
from {
left: 0;
}
to {
left: -9999px;
}
}
.form-control:focus {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: none;
box-shadow: none;
}
.inner-center {
width: 418px;
height: 596px;
border-radius: 0px 0px 15px 15px;
display: flex;
flex-flow: column;
align-items: center;
}
.welcome-title{
width: 100%;
height: 178px;
display: flex;
justify-content: center;
align-items: flex-end;
}
.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;
}
.APPCimg {
width: 138px;
height: 150px;
background: url('./images/3.png');
background-size: 100% 100%;
background-repeat: no-repeat;
display: none;
position: absolute;
top: 20px;
left: 50%;
transform: translateX(-50%);
padding: 23px 11px 12px;
span {
font-size: 12px;
opacity: 0.75;
}
}
.APPcodeBox:hover .APPCtext {
color: #1685FF;
}
.APPcodeBox:hover .APPCimg {
display: flex;
}
.APPCimg .codeCase {
text-align: center;
padding-top: 32px;
}
.login-header{
width: 100%;
position: absolute;
top: 20px;
padding: 0 32px;
display: flex;
justify-content: space-between;
align-items: center;
.left-title{
}
.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: #FFFFFF;
}
.curr-week-date{
margin-left: 10px;
.curr-week{
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
}
.curr-date{
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
}
}
}
}
:global{
.@{ant-prefix}src-pages-user-login-components-login-index-login {
.@{ant-prefix}src-pages-user-login-components-login-index-prefixIcon{
color: #00BDA0;
}
}
.@{ant-prefix}src-pages-user-login-components-login-index-login {
.@{ant-prefix}src-pages-user-login-components-login-index-submit{
background-color: #00BDA0;
border-color: #00BDA0;
border-radius: 20px;
}
}
.@{ant-prefix}-checkbox-checked::after{
border: 1px solid #00BDA0 !important;
}
.@{ant-prefix}-checkbox-checked {
.@{ant-prefix}-checkbox-inner {
background-color: #00BDA0 !important;
border-color: #00BDA0 !important;
}
}
.@{ant-prefix}-input-affix-wrapper:not(.@{ant-prefix}-input-affix-wrapper-disabled):hover{
border-color: #00BDA0 !important;
}
.@{ant-prefix}-checkbox-wrapper:hover
.@{ant-prefix}-checkbox-inner,
.@{ant-prefix}-checkbox:hover .@{ant-prefix}-checkbox-inner,
.@{ant-prefix}-checkbox-input:focus + .@{ant-prefix}-checkbox-inner {
border-color: #00BDA0 !important;
}
.@{ant-prefix}-btn-primary:hover, .@{ant-prefix}-btn-primary:focus{
background-color: #00BDA0 !important;
border-color: #00BDA0 !important;
}
}
\ No newline at end of file
This diff was suppressed by a .gitattributes entry.
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 React, { forwardRef, useEffect, useRef, useState } from 'react';
import { Modal } from 'antd'; import { Modal, Popover } from 'antd';
import { Helmet, HelmetProvider } from 'react-helmet-async'; import { Helmet, HelmetProvider } from 'react-helmet-async';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { useHistory, withRouter } from '@wisdom-utils/runtime'; import { useHistory, withRouter } from '@wisdom-utils/runtime';
...@@ -11,18 +11,18 @@ import styles from './index.less'; ...@@ -11,18 +11,18 @@ import styles from './index.less';
import Account from '../../../js/useAccount'; import Account from '../../../js/useAccount';
import { defaultApp } from '../../../../../../micro'; import { defaultApp } from '../../../../../../micro';
import logoPng from './images/7.png' import logoPng from './images/7.png'
import qrcodePng from './images/1.png'
import QRCode from 'qrcode.react'; import QRCode from 'qrcode.react';
import classnames from 'classnames'; import classnames from 'classnames';
import moment from 'moment'; import moment from 'moment';
const renderQRCode = props => { const PopOvercontent = () =>{
const qrcodes = props.qrcode.split('|') || []; const qrcodes = window.globalConfig && window.globalConfig.qrcode;
if (qrcodes.length > 0 && qrcodes[0]) { if (qrcodes) {
let value = qrcodes[0].replace(/{ip}/gi, props.ip || window.location.host).split('=')[1]; return <QRCode value={qrcodes}/>;
return <QRCode value={value} />;
} }
return <span>手持APP下载未配置</span>; return <span>手持APP下载未配置</span>;
}; }
const Login = forwardRef((props, _ref) => { const Login = forwardRef((props, _ref) => {
const sliVerify = useRef(); const sliVerify = useRef();
...@@ -163,6 +163,9 @@ const Login = forwardRef((props, _ref) => { ...@@ -163,6 +163,9 @@ const Login = forwardRef((props, _ref) => {
{renderPlatform()} {renderPlatform()}
</div> </div>
</div> </div>
<Popover content={PopOvercontent} title="扫码下载APP" trigger="click" overlayClassName={'popover-style'}>
<img src={qrcodePng} alt="APP" className={styles['qrcode-box']}/>
</Popover>
</div> </div>
<div className={styles['login-header']}> <div className={styles['login-header']}>
<div className={styles['left-title']}> <div className={styles['left-title']}>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
.login { .login {
width: 100%; width: 100%;
height: 100%; height: 100%;
background: url('./images/6.jpg') no-repeat center; background: url('./images/6.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
background-clip: border-box; background-clip: border-box;
position: relative; position: relative;
...@@ -79,14 +79,7 @@ ...@@ -79,14 +79,7 @@
.inner-center { .inner-center {
// width: 400px; position: relative;
// height: 400px;
// background-color: #ffffff;
// display: flex;
// flex-flow: column;
// align-items: center;
// border-radius: 0 10px 10px 0;
width: 482px; width: 482px;
height: 316px; height: 316px;
background: rgba(255,255,255,0.3); background: rgba(255,255,255,0.3);
...@@ -203,3 +196,25 @@ ...@@ -203,3 +196,25 @@
color: #F1F6FD; color: #F1F6FD;
text-align: center; text-align: center;
} }
.qrcode-box{
position: absolute;
bottom: 0;
right: -35px;
width: 35px;
height: 35px;
background: #FFFFFF;
opacity: 0.8;
cursor: pointer;
}
:global{
.@{ant-prefix}-popover-inner-content{
display: flex;
justify-content: center;
align-items: center;
}
.@{ant-prefix}-popover-title{
display: flex;
justify-content: center;
align-items: center;
}
}
\ 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