Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivWeb
Commits
1b56a1f5
Commit
1b56a1f5
authored
1 year ago
by
周宏民
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pref: 演示入口功能 loading优化
parent
b122d3d9
Pipeline
#86110
waiting for manual action with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
9 deletions
+56
-9
index.js
src/pages/bootpage/demonstration/index.js
+41
-8
index.less
src/pages/bootpage/demonstration/index.less
+15
-1
No files found.
src/pages/bootpage/demonstration/index.js
View file @
1b56a1f5
...
...
@@ -9,7 +9,7 @@
*/
import
{
FullscreenExitOutlined
,
FullscreenOutlined
,
RightOutlined
}
from
'@ant-design/icons'
;
import
exitImg
from
'@/assets/images/demonstration/退出.png'
;
import
{
Button
,
Spin
,
message
,
Tooltip
}
from
'antd'
;
import
{
Button
,
Spin
,
message
,
Progress
}
from
'antd'
;
import
React
,
{
useMemo
,
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
cloneDeep
,
debounce
}
from
'lodash'
;
import
Cookies
from
'js-cookie'
;
...
...
@@ -35,7 +35,12 @@ const Demonstration = props => {
const
showFullScreen
=
true
;
const
videoRef
=
useRef
(
null
);
const
[
loginAction
,
setAction
]
=
useState
(()
=>
new
LoginAction
(
props
));
const
progressRef
=
useRef
(
0
);
const
timer
=
useRef
(
null
);
const
[
progressValue
,
setProgressValue
]
=
useState
(
0
);
const
[
loading
,
setLoading
]
=
useState
(
true
);
const
[
showContent
,
setShowContent
]
=
useState
(
false
);
const
[
jumpLoading
,
setJumpLoading
]
=
useState
(
false
);
const
[
selectKey
,
setSelectKey
]
=
useState
(
'供水产品'
);
const
[
boxSize
,
setBoxSize
]
=
useState
({
...
...
@@ -298,7 +303,28 @@ const Demonstration = props => {
const
handError
=
err
=>
{
setJumpLoading
(
false
);
};
useEffect
(()
=>
{
if
(
loading
&&
!
timer
.
current
)
{
timer
.
current
=
setInterval
(()
=>
{
if
(
progressRef
.
current
<
80
)
{
progressRef
.
current
+=
20
;
setProgressValue
(
progressRef
.
current
);
}
else
{
setProgressValue
(
99
);
timer
.
current
&&
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
}
},
100
);
}
if
(
!
loading
)
{
setProgressValue
(
100
);
timer
.
current
&&
clearInterval
(
timer
.
current
);
timer
.
current
=
null
;
setTimeout
(()
=>
{
setShowContent
(
true
);
},
0
);
}
},
[
loading
]);
useEffect
(()
=>
{
const
handleToggleIndustry
=
event
=>
{
props
.
history
&&
props
.
history
.
push
(
`/?client=
${
props
.
global
.
client
}
`
);
...
...
@@ -331,6 +357,17 @@ const Demonstration = props => {
<
div
className
=
{
styles
.
jumpLoader
}
/
>
<
/div
>
)
:
null
}
{
loading
||
progressValue
!==
100
?
(
<
div
className
=
{
styles
.
loadingWrap
}
>
<
Progress
style
=
{{
width
:
'30%'
}}
trailColor
=
"rgba(255,255,255,0.5)"
strokeColor
=
"#1685FF"
percent
=
{
progressValue
}
showInfo
=
{
false
}
/
>
<
/div
>
)
:
null
}
{
showFullScreen
?
(
<
div
className
=
{
styles
.
CV_exit
}
onClick
=
{
exit
}
>
<
Button
type
=
"text"
style
=
{{
color
:
'#fff'
,
fontSize
:
'24px'
}}
>
...
...
@@ -359,12 +396,8 @@ const Demonstration = props => {
<
div
className
=
{
styles
.
top_r_text
}
>-
引领中国智慧水务
-<
/div
>
<
/div
>
<
/div
>
{
loading
?
(
<
div
className
=
{
styles
.
loadingWrap
}
>
<
div
className
=
{
styles
.
loader
}
/
>
<
/div
>
)
:
null
}
{
!
loading
?
(
{
showContent
?
(
<>
<
div
className
=
{
classNames
(
styles
.
row
,
'animate__fadeInDown'
,
'animate__animated'
,
'duration-500ms'
)}
>
<
div
className
=
{
styles
.
row_l
}
>
...
...
This diff is collapsed.
Click to expand it.
src/pages/bootpage/demonstration/index.less
View file @
1b56a1f5
...
...
@@ -5,7 +5,7 @@
width: 100%;
overflow: hidden;
display: flex;
background: url('@{imgSrc}/背景.png') no-repeat center center;
background:
rgba(8, 33, 77, 1)
url('@{imgSrc}/背景.png') no-repeat center center;
background-size: 100% 100%;
position: relative;
font-size: 14px;
...
...
@@ -374,4 +374,17 @@
100% {
height: 4px
}
}
.loadingWrap {
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
bottom: 20%;
left: 50%;
z-index: 10;
transform: translateX(-50%);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment