Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
muChangApp
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
WitCloud
muChangApp
Commits
4b3769e5
Commit
4b3769e5
authored
Jun 13, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load改版
parent
cd44eb77
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
19 deletions
+21
-19
app.component.html
src/app/app.component.html
+4
-4
app.component.ts
src/app/app.component.ts
+4
-2
load.ts
src/app/service/load.ts
+10
-12
global.scss
src/global.scss
+3
-1
No files found.
src/app/app.component.html
View file @
4b3769e5
<div
id=
"v-loading"
>
<div
id=
"v-loading"
*
ngIf=
"load.isLoad"
>
<div
class=
"loading-inner"
>
<div
class=
"loading-inner"
>
<div
class=
"circle_process"
>
<div
class=
"circle_process"
*
ngIf=
"load.showNum"
>
<div
id=
"innerNum"
></div>
<div
id=
"innerNum"
>
{{load.time}}s
</div>
<div
class=
"wrapper right"
>
<div
class=
"wrapper right"
>
<div
class=
"circle rightcircle"
></div>
<div
class=
"circle rightcircle"
></div>
</div>
</div>
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<div
class=
"circle leftcircle"
id=
"leftcircle"
></div>
<div
class=
"circle leftcircle"
id=
"leftcircle"
></div>
</div>
</div>
</div>
</div>
<div
id=
"loading-inner"
></div>
<div
id=
"loading-inner"
>
{{load.msg}}
</div>
</div>
</div>
</div>
</div>
<ion-app>
<ion-app>
...
...
src/app/app.component.ts
View file @
4b3769e5
...
@@ -6,18 +6,19 @@ import {StatusBar} from '@ionic-native/status-bar/ngx';
...
@@ -6,18 +6,19 @@ import {StatusBar} from '@ionic-native/status-bar/ngx';
import
{
Router
,
NavigationEnd
}
from
'@angular/router'
;
import
{
Router
,
NavigationEnd
}
from
'@angular/router'
;
import
{
AppMinimize
}
from
'@ionic-native/app-minimize/ngx'
;
import
{
AppMinimize
}
from
'@ionic-native/app-minimize/ngx'
;
import
{
Mqtt
}
from
'./service/mqtt'
;
import
{
Mqtt
}
from
'./service/mqtt'
;
import
{
Load
}
from
'./service/load'
;
declare
var
screen
:
any
;
declare
var
screen
:
any
;
@
Component
({
@
Component
({
selector
:
'app-root'
,
selector
:
'app-root'
,
templateUrl
:
'app.component.html'
,
templateUrl
:
'app.component.html'
,
providers
:
[
Load
],
styles
:
[
`
styles
:
[
`
.circle_process {
.circle_process {
width: 100px;
width: 100px;
height: 100px;
height: 100px;
margin: 0 auto;
margin: 0 auto;
display: none;
}
}
.circle_process .wrapper {
.circle_process .wrapper {
...
@@ -100,7 +101,8 @@ export class AppComponent implements AfterViewInit, OnDestroy {
...
@@ -100,7 +101,8 @@ export class AppComponent implements AfterViewInit, OnDestroy {
private
statusBar
:
StatusBar
,
private
statusBar
:
StatusBar
,
private
appMinimize
:
AppMinimize
,
private
appMinimize
:
AppMinimize
,
private
router
:
Router
,
private
router
:
Router
,
private
mqtt
:
Mqtt
private
mqtt
:
Mqtt
,
public
load
:
Load
)
{
)
{
this
.
initializeApp
();
this
.
initializeApp
();
}
}
...
...
src/app/service/load.ts
View file @
4b3769e5
...
@@ -5,19 +5,18 @@ export class Load {
...
@@ -5,19 +5,18 @@ export class Load {
constructor
()
{
constructor
()
{
}
}
private
isLoad
=
false
;
public
isLoad
=
false
;
private
time
=
0
;
public
showNum
=
false
;
public
msg
=
''
;
public
time
=
0
;
toLoad
(
msg
,
type
)
{
toLoad
(
msg
,
type
)
{
if
(
!
this
.
isLoad
)
{
if
(
!
this
.
isLoad
)
{
this
.
isLoad
=
true
;
this
.
isLoad
=
true
;
document
.
getElementById
(
'v-loading'
).
style
.
display
=
'block'
;
this
.
msg
=
msg
;
document
.
getElementById
(
'loading-inner'
).
innerText
=
msg
;
if
(
type
)
{
if
(
type
)
{
this
.
showNum
=
true
;
this
.
time
=
0
;
this
.
time
=
0
;
// @ts-ignore
document
.
getElementsByClassName
(
'circle_process'
)[
0
].
style
.
display
=
'block'
;
document
.
getElementById
(
'innerNum'
).
innerText
=
this
.
time
.
toString
()
+
's'
;
this
.
addNum
();
this
.
addNum
();
}
}
}
}
...
@@ -26,8 +25,7 @@ export class Load {
...
@@ -26,8 +25,7 @@ export class Load {
addNum
()
{
addNum
()
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
if
(
this
.
isLoad
)
{
if
(
this
.
isLoad
)
{
this
.
time
++
;
this
.
time
++
;
document
.
getElementById
(
'innerNum'
).
innerText
=
this
.
time
.
toString
()
+
's'
;
this
.
addNum
();
this
.
addNum
();
}
}
},
1000
);
},
1000
);
...
@@ -35,8 +33,8 @@ export class Load {
...
@@ -35,8 +33,8 @@ export class Load {
offLoad
()
{
offLoad
()
{
this
.
isLoad
=
false
;
this
.
isLoad
=
false
;
document
.
getElementById
(
'v-loading'
).
style
.
display
=
'none'
;
this
.
showNum
=
false
;
document
.
getElementById
(
'loading-inner'
).
innerText
=
''
;
this
.
msg
=
''
;
document
.
getElementById
(
'innerNum'
).
innerText
=
'0s'
;
this
.
time
=
0
;
}
}
}
}
src/global.scss
View file @
4b3769e5
...
@@ -107,7 +107,6 @@ img {
...
@@ -107,7 +107,6 @@ img {
z-index
:
9999999999999
;
z-index
:
9999999999999
;
position
:
relative
;
position
:
relative
;
text-align
:
center
;
text-align
:
center
;
display
:
none
;
.loading-inner
{
.loading-inner
{
min-height
:
30px
;
min-height
:
30px
;
min-width
:
150px
;
min-width
:
150px
;
...
@@ -122,6 +121,9 @@ img {
...
@@ -122,6 +121,9 @@ img {
line-height
:
30px
;
line-height
:
30px
;
text-align
:
center
;
text-align
:
center
;
}
}
#loading-inner
{
font-size
:
16px
;
}
}
}
.msgToast
{
.msgToast
{
...
...
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