Commit c9309ca6 authored by 杨思琦's avatar 杨思琦

过渡页修改

parent 7d68ad6c
Pipeline #84707 passed with stages
...@@ -38,7 +38,7 @@ const BootPage = props => { ...@@ -38,7 +38,7 @@ const BootPage = props => {
const [percentBottom, setPercentBottom] = useState(-40); 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);
const [hasRole, setHasRole] = useState(false); const [hasRole, setHasRole] = useState(false);
const [scale, setScale] = useState(1); const [scale, setScale] = useState(1);
const [loginAction, setAction] = useState(() => new LoginAction(props)); const [loginAction, setAction] = useState(() => new LoginAction(props));
...@@ -53,7 +53,9 @@ const BootPage = props => { ...@@ -53,7 +53,9 @@ const BootPage = props => {
}, [percentNum]); }, [percentNum]);
// eslint-disable-next-line no-shadow // eslint-disable-next-line no-shadow
const handlePage = (event, type, loginAction) => { const handlePage = (event, type, loginAction) => {
if (loadding) return;
let count = 1; let count = 1;
setLoadding(true);
setPercentBottom(-40 + Math.ceil(Math.random() * 8 * count)); setPercentBottom(-40 + Math.ceil(Math.random() * 8 * count));
setPercentNum(Math.ceil(Math.random() * 10)); setPercentNum(Math.ceil(Math.random() * 10));
setCurrentType(type); setCurrentType(type);
...@@ -65,18 +67,20 @@ const BootPage = props => { ...@@ -65,18 +67,20 @@ const BootPage = props => {
const perBottom = -40 + 8 * count + Math.ceil(Math.random() * 8); const perBottom = -40 + 8 * count + Math.ceil(Math.random() * 8);
const perNum = 10 * count + Math.ceil(Math.random() * 10); const perNum = 10 * count + Math.ceil(Math.random() * 10);
if (perNum >= 80 || dataRef.current >= 80 || count === 10) { if (perNum >= 80 || dataRef.current >= 80 || count === 10) {
setLoadding(false);
return clearInterval(process.current); return clearInterval(process.current);
} }
setPercentBottom(perBottom); setPercentBottom(perBottom);
setPercentNum(perNum); setPercentNum(perNum);
count += 1; count += 1;
}, 0); }, 0);
}, 3000); }, 2000);
// 新增熊猫新产品引导页 // 新增熊猫新产品引导页
if (type === '熊猫新产品') { if (type === '熊猫新产品') {
setTimeout(() => { setTimeout(() => {
setPercentBottom(40); setPercentBottom(40);
setPercentNum(100); setPercentNum(100);
setLoadding(false);
clearInterval(process.current); clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
props.history.push('/cloud/introduction/newproducts'); props.history.push('/cloud/introduction/newproducts');
...@@ -115,6 +119,7 @@ const BootPage = props => { ...@@ -115,6 +119,7 @@ const BootPage = props => {
const handleToggleIndustry = event => { const handleToggleIndustry = event => {
setPercentBottom(38); setPercentBottom(38);
setPercentNum(98); setPercentNum(98);
setLoadding(false);
clearInterval(process.current); clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
props.history.push(`/?client=${props.global.client}`); props.history.push(`/?client=${props.global.client}`);
...@@ -138,6 +143,7 @@ const BootPage = props => { ...@@ -138,6 +143,7 @@ const BootPage = props => {
setTimeout(() => { setTimeout(() => {
setPercentBottom(40); setPercentBottom(40);
setPercentNum(100); setPercentNum(100);
setLoadding(false);
clearInterval(process.current); clearInterval(process.current);
setTimeout(() => { setTimeout(() => {
window.history.pushState(null, '', ret); window.history.pushState(null, '', ret);
......
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