Commit 1b70d867 authored by 杨思琦's avatar 杨思琦

fix: 更新过渡页样式

parent 2f71dc57
Pipeline #63385 passed with stages
...@@ -5,9 +5,7 @@ import { appService } from '@/api'; ...@@ -5,9 +5,7 @@ import { appService } from '@/api';
import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants'; import { SERVICE_INTERFACE_SUCCESS_CODE } from '@/constants';
import PandaBootPage from './panda'; import PandaBootPage from './panda';
const systemItemName = '引导页模板'; // 系统配置项名称
const system_item_name = '引导页模板'; // 系统配置项名称
const BootPageTemplate = { const BootPageTemplate = {
default: PandaBootPage, default: PandaBootPage,
...@@ -25,12 +23,12 @@ const BootPage = props => { ...@@ -25,12 +23,12 @@ const BootPage = props => {
useEffect(() => { useEffect(() => {
appService appService
.sysConfiguration({ .sysConfiguration({
moduleName: system_item_name, moduleName: systemItemName,
ignoreSite: true, ignoreSite: true,
}) })
.then(res => { .then(res => {
const { code, data } = res; const { code, data } = res;
if (code != SERVICE_INTERFACE_SUCCESS_CODE) { if (code !== SERVICE_INTERFACE_SUCCESS_CODE) {
notification.error({ message: '提示', duration: 3, description: '系统引导页配置错误' }); notification.error({ message: '提示', duration: 3, description: '系统引导页配置错误' });
setInfo({ first: false, loading: false, error: true }); setInfo({ first: false, loading: false, error: true });
return; return;
......
/* eslint-disable global-require */ /* eslint-disable global-require */
// 云平台引导页 // 云平台引导页
import React, { useCallback, useEffect, useMemo, useState } from 'react'; import React, { useCallback, useEffect, useMemo, useState, useRef } from 'react';
import { Space, Spin, Progress } from 'antd'; import { Space, Spin, Progress } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
...@@ -32,7 +32,10 @@ const industries = [ ...@@ -32,7 +32,10 @@ const industries = [
// let loginAction = null; // let loginAction = null;
const BootPage = props => { const BootPage = props => {
const dataRef = useRef();
const process = useRef();
const [Industries] = useState(props.global.userInfo.Industries); const [Industries] = useState(props.global.userInfo.Industries);
const [percentBottom, setPercentBottom] = useState(-40);
const [percentNum, setPercentNum] = useState(0); const [percentNum, setPercentNum] = useState(0);
const [currentType, setCurrentType] = useState(''); const [currentType, setCurrentType] = useState('');
// const [loadding, setLoadding] = useState(false); // const [loadding, setLoadding] = useState(false);
...@@ -40,26 +43,41 @@ const BootPage = props => { ...@@ -40,26 +43,41 @@ const BootPage = props => {
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
const [loginAction, setAction] = useState(() => new LoginAction(props)); const [loginAction, setAction] = useState(() => new LoginAction(props));
const [num] = useState(Industries.filter(item => !!industries.find(d => d.type === item)).length); const [num] = useState(Industries.filter(item => !!industries.find(d => d.type === item)).length);
// const history = useHistory(); // const history = useHistory();
useDocumentTitle( useDocumentTitle(
{ title: defaultSetting.title, id: '', pageName: '行业切换' }, { title: defaultSetting.title, id: '', pageName: '行业切换' },
props.global.title || defaultSetting.title, props.global.title || defaultSetting.title,
); );
useEffect(() => {
dataRef.current = percentNum;
}, [percentNum]);
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
const handlePage = (event, type, loginAction) => { const handlePage = (event, type, loginAction) => {
setPercentNum(Math.ceil(Math.random() * 50)); let count = 1;
setPercentBottom(-40 + Math.ceil(Math.random() * 8 * count));
setPercentNum(Math.ceil(Math.random() * 10));
setCurrentType(type); setCurrentType(type);
// //
// event.persist(); // event.persist();
// event.preventDefault(); // event.preventDefault();
process.current = setInterval(() => {
setTimeout(() => {
const perBottom = -40 + 8 * count + Math.ceil(Math.random() * 8);
const perNum = 10 * count + Math.ceil(Math.random() * 10);
if (perNum >= 80 || dataRef.current >= 80 || count === 10) {
return clearInterval(process.current);
}
setPercentBottom(perBottom);
setPercentNum(perNum);
count += 1;
}, 0);
}, 3000);
// 新增熊猫新产品引导页 // 新增熊猫新产品引导页
if (type === '熊猫新产品') { if (type === '熊猫新产品') {
setTimeout(() => { setTimeout(() => {
setPercentBottom(40);
setPercentNum(100); setPercentNum(100);
clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
props.history.push('/cloud/introduction/newproducts'); props.history.push('/cloud/introduction/newproducts');
// window.history.pushState('', null, `/cloud/introduction/newproducts`); // window.history.pushState('', null, `/cloud/introduction/newproducts`);
...@@ -95,8 +113,9 @@ const BootPage = props => { ...@@ -95,8 +113,9 @@ const BootPage = props => {
window.addEventListener('resize', handleResize); window.addEventListener('resize', handleResize);
const handleToggleIndustry = event => { const handleToggleIndustry = event => {
setPercentBottom(38);
setPercentNum(98); setPercentNum(98);
clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
}, 1000); }, 1000);
...@@ -117,8 +136,9 @@ const BootPage = props => { ...@@ -117,8 +136,9 @@ const BootPage = props => {
useEffect(() => { useEffect(() => {
window.share.event.on('visible', ret => { window.share.event.on('visible', ret => {
setTimeout(() => { setTimeout(() => {
setPercentBottom(40);
setPercentNum(100); setPercentNum(100);
clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
window.history.pushState(null, '', ret); window.history.pushState(null, '', ret);
}, 500); }, 500);
...@@ -196,14 +216,28 @@ const BootPage = props => { ...@@ -196,14 +216,28 @@ const BootPage = props => {
</div> </div>
</div> </div>
{currentType === item.type && ( {currentType === item.type && (
<Progress <div className={styles.bootProgress}>
style={{ width: '96%' }} <div className={styles.inner} style={{ bottom: percentBottom }}>
strokeColor={item.color} <svg
percent={percentNum} className={styles.wave}
status="active" xmlns="http://www.w3.org/2000/svg"
format={percent => <span style={{ color: '#fff' }}>{percent}%</span>} xmlnsXlink="http://www.w3.org/1999/xlink"
className={styles.bootProgress} viewBox="0 24 150 68"
/> preserveAspectRatio="none"
>
<defs>
<path
id="gentle-wave"
d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z"
/>
</defs>
<g className={styles.parallax}>
<use xlinkHref="#gentle-wave" x="50" y="0" fill={item.color} opacity="0.1" />
<use xlinkHref="#gentle-wave" x="50" y="-1" fill={item.color} opacity="0.2" />
</g>
</svg>
</div>
</div>
)} )}
</li> </li>
), ),
......
@import '~antd/es/style/themes/default.less'; @import '~antd/es/style/themes/default.less';
@-webkit-keyframes move {
0% {
-webkit-transform: translate(-90px,0%);
transform: translate(-90px,0%);
}
100% {
-webkit-transform: translate(85px,0%);
transform: translate(85px,0%);
}
}
@keyframes move {
0% {
-webkit-transform: translate(-90px,0%);
transform: translate(-90px,0%);
}
100% {
-webkit-transform: translate(85px,0%);
transform: translate(85px,0%);
}
}
.bootPage { .bootPage {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -71,7 +93,7 @@ ...@@ -71,7 +93,7 @@
} }
.bootProgress { .bootProgress {
transform: scale(1.1); transform: scale(1.1);
bottom: -14px; bottom: -10px;
} }
} }
.bootPageList { .bootPageList {
...@@ -176,7 +198,36 @@ ...@@ -176,7 +198,36 @@
.bootProgress { .bootProgress {
transition: all .2s ease-out; transition: all .2s ease-out;
position: absolute; position: absolute;
bottom: -5px; height: 80px;
margin: 0;
width: 100%;
border-radius: 0 0 14% 14%;
overflow: hidden;
bottom: 0px;
}
.bootProgress .inner{
transition: all .2s ease-out;
position: absolute;
height: 100%;
width: 100%;
bottom: 10%;
}
.bootProgress .wave {
display: block;
width: 100%;
height: 10em;
max-height: 100vh;
margin: 0;
}
.bootProgress .wave .parallax>use {
animation: move 2s linear infinite;
}
.bootProgress .wave .parallax>use:nth-child(2) {
animation-delay: -0.1s;
} }
} }
......
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