Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
party-build-cloud
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
wangqinghua
party-build-cloud
Commits
3df8b129
Commit
3df8b129
authored
Apr 29, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跑马灯 directive
parent
a12218bf
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
182 additions
and
76 deletions
+182
-76
app.scss
src/app/app.scss
+2
-1
icon-tips.png
src/assets/imgs/home/icon-tips.png
+0
-0
mail.png
src/assets/imgs/home/mail.png
+0
-0
no-sign.png
src/assets/imgs/home/no-sign.png
+0
-0
yes-sign.png
src/assets/imgs/home/yes-sign.png
+0
-0
directives.module.ts
src/directives/directives.module.ts
+11
-2
horizonta-lamp.ts
src/directives/horizonta-lamp/horizonta-lamp.ts
+46
-0
lamp.ts
src/directives/lamp/lamp.ts
+46
-0
vertica-lamp.ts
src/directives/vertica-lamp/vertica-lamp.ts
+47
-0
discover.html
src/pages/tabs/discover/discover.html
+2
-5
discover.scss
src/pages/tabs/discover/discover.scss
+2
-4
home.html
src/pages/tabs/home/home.html
+7
-7
home.module.ts
src/pages/tabs/home/home.module.ts
+6
-4
home.scss
src/pages/tabs/home/home.scss
+11
-13
home.ts
src/pages/tabs/home/home.ts
+0
-38
serve.html
src/pages/tabs/serve/serve.html
+2
-2
No files found.
src/app/app.scss
View file @
3df8b129
...
...
@@ -342,5 +342,5 @@ a[disabled], button[disabled], [ion-button][disabled],
padding-top
:
4rem
;
height
:
100%
;
background-image
:
url('../assets/imgs/login-bg.png')
;
background-size
:
cover
;
background-size
:
100%
100%
;
}
\ No newline at end of file
src/assets/imgs/home/icon-tips.png
0 → 100644
View file @
3df8b129
3.4 KB
src/assets/imgs/home/mail.png
0 → 100644
View file @
3df8b129
1.42 KB
src/assets/imgs/home/no-sign.png
0 → 100644
View file @
3df8b129
2.08 KB
src/assets/imgs/home/yes-sign.png
0 → 100644
View file @
3df8b129
2.18 KB
src/directives/directives.module.ts
View file @
3df8b129
import
{
NgModule
}
from
'@angular/core'
;
import
{
TabsSlidesDirective
}
from
'./tabs-slides/tabs-slides'
;
import
{
LampDirective
}
from
'./lamp/lamp'
;
import
{
HorizontaLampDirective
}
from
'./horizonta-lamp/horizonta-lamp'
;
import
{
VerticaLampDirective
}
from
'./vertica-lamp/vertica-lamp'
;
@
NgModule
({
declarations
:
[
TabsSlidesDirective
],
declarations
:
[
TabsSlidesDirective
,
LampDirective
,
HorizontaLampDirective
,
VerticaLampDirective
],
imports
:
[],
exports
:
[
TabsSlidesDirective
]
exports
:
[
TabsSlidesDirective
,
LampDirective
,
HorizontaLampDirective
,
VerticaLampDirective
]
})
export
class
DirectivesModule
{}
src/directives/horizonta-lamp/horizonta-lamp.ts
0 → 100644
View file @
3df8b129
import
{
Directive
,
ElementRef
}
from
'@angular/core'
;
@
Directive
({
selector
:
'[horizonta-lamp]'
// Attribute selector
})
export
class
HorizontaLampDirective
{
move_h
=
33
;
//移动高度
scorllStep
=
1
;
scrollTime
=
60
;
stopTime
=
1000
;
tmpH
=
0
;
constructor
(
public
el
:
ElementRef
)
{
this
.
lineChange
();
}
//跑马灯
lineChange
()
{
let
child_div
=
this
.
el
.
nativeElement
.
children
;
setTimeout
(()
=>
{
if
(
child_div
.
length
>
0
)
{
this
.
start
();
}
},
10
);
}
start
()
{
if
(
this
.
tmpH
<
this
.
move_h
)
{
// tmpH = 0 ; move_h = 33
this
.
tmpH
+=
this
.
scorllStep
;
//scorllStep = 1
if
(
this
.
tmpH
>
this
.
move_h
)
{
this
.
tmpH
=
this
.
move_h
;
}
this
.
el
.
nativeElement
.
scrollTop
=
this
.
tmpH
;
setTimeout
(()
=>
{
this
.
start
()
},
this
.
scrollTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
else
{
this
.
tmpH
=
0
;
this
.
el
.
nativeElement
.
appendChild
(
this
.
el
.
nativeElement
.
children
[
0
]);
setTimeout
(()
=>
{
this
.
start
()
},
this
.
stopTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
}
}
src/directives/lamp/lamp.ts
0 → 100644
View file @
3df8b129
import
{
Directive
,
ElementRef
}
from
'@angular/core'
;
@
Directive
({
selector
:
'[lamp]'
})
export
class
LampDirective
{
move_h
=
33
;
//移动高度
scorllStep
=
1
;
scrollTime
=
60
;
stopTime
=
1000
;
tmpH
=
0
;
constructor
(
public
el
:
ElementRef
)
{
console
.
log
(
el
);
this
.
lineChange
();
}
//跑马灯
lineChange
()
{
let
child_div
=
this
.
el
.
nativeElement
.
children
;
setTimeout
(()
=>
{
if
(
child_div
.
length
>
0
)
{
this
.
start
();
}
},
10
);
}
start
()
{
if
(
this
.
tmpH
<
this
.
move_h
)
{
// tmpH = 0 ; move_h = 33
this
.
tmpH
+=
this
.
scorllStep
;
//scorllStep = 1
if
(
this
.
tmpH
>
this
.
move_h
)
{
this
.
tmpH
=
this
.
move_h
;
}
this
.
el
.
nativeElement
.
scrollTop
=
this
.
tmpH
;
setTimeout
(()
=>
{
this
.
start
()
},
this
.
scrollTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
else
{
this
.
tmpH
=
0
;
this
.
el
.
nativeElement
.
appendChild
(
this
.
el
.
nativeElement
.
children
[
0
]);
setTimeout
(()
=>
{
this
.
start
()
},
this
.
stopTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
}
}
src/directives/vertica-lamp/vertica-lamp.ts
0 → 100644
View file @
3df8b129
import
{
Directive
,
ElementRef
}
from
'@angular/core'
;
@
Directive
({
selector
:
'[vertica-lamp]'
// Attribute selector
})
export
class
VerticaLampDirective
{
move_h
=
33
;
//移动高度
scorllStep
=
1
;
scrollTime
=
60
;
stopTime
=
1000
;
tmpH
=
0
;
constructor
(
public
el
:
ElementRef
)
{
console
.
log
(
el
);
this
.
lineChange
();
}
//跑马灯
lineChange
()
{
let
child_div
=
this
.
el
.
nativeElement
.
children
;
setTimeout
(()
=>
{
if
(
child_div
.
length
>
0
)
{
this
.
start
();
}
},
10
);
}
start
()
{
if
(
this
.
tmpH
<
this
.
move_h
)
{
// tmpH = 0 ; move_h = 33
this
.
tmpH
+=
this
.
scorllStep
;
//scorllStep = 1
if
(
this
.
tmpH
>
this
.
move_h
)
{
this
.
tmpH
=
this
.
move_h
;
}
this
.
el
.
nativeElement
.
scrollTop
=
this
.
tmpH
;
setTimeout
(()
=>
{
this
.
start
()
},
this
.
scrollTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
else
{
this
.
tmpH
=
0
;
this
.
el
.
nativeElement
.
appendChild
(
this
.
el
.
nativeElement
.
children
[
0
]);
setTimeout
(()
=>
{
this
.
start
()
},
this
.
stopTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
}
}
src/pages/tabs/discover/discover.html
View file @
3df8b129
<ion-header>
<ion-navbar>
<ion-buttons
start
>
<button
ion-button
icon-only
>
<button
ion-button
icon-only
(
click
)="
goToSearch
()"
class=
"search-button"
>
<img
class=
"toolbar-img"
src=
"./assets/imgs/logo.png"
>
<ion-icon
class=
"search-icon"
name=
"search"
></ion-icon>
</button>
</ion-buttons>
<ion-buttons
center
class=
"search-button"
(
click
)="
goToSearch
()"
>
<ion-searchbar
class=
"toolbar-search"
placeholder=
"搜索"
></ion-searchbar>
<ion-icon
class=
"search-icon"
name=
"search"
></ion-icon>
</ion-buttons>
<ion-buttons
end
>
<button
ion-button
icon-only
(
click
)="
goToPublish
()"
class=
"toolbar-signUp"
>
<ion-icon
class=
"icon-fabu iconfont"
></ion-icon>
...
...
src/pages/tabs/discover/discover.scss
View file @
3df8b129
...
...
@@ -9,11 +9,9 @@ page-discover {
position
:
relative
;
.search-icon
{
position
:
absolute
;
top
:
1rem
;
left
:
1
.1rem
;
color
:
#ffffff
;
font-size
:
2rem
;
font-size
:
2
.5rem
;
margin-left
:
1rem
;
}
}
...
...
src/pages/tabs/home/home.html
View file @
3df8b129
<ion-header>
<ion-navbar>
<ion-buttons
start
>
<button
ion-button
icon-only
>
<button
ion-button
icon-only
(
click
)="
goToSearch
()"
class=
"search-button"
>
<img
class=
"toolbar-img"
src=
"./assets/imgs/logo.png"
>
<ion-icon
class=
"search-icon"
name=
"search"
></ion-icon>
</button>
</ion-buttons>
<ion-buttons
center
class=
"search-button"
(
click
)="
goToSearch
()"
>
<ion-searchbar
class=
"toolbar-search"
placeholder=
"搜索"
></ion-searchbar>
<ion-icon
class=
"search-icon"
name=
"search"
></ion-icon>
</ion-buttons>
<ion-buttons
end
>
<button
ion-button
icon-only
(
click
)="
signNow
()"
class=
"toolbar-signUp"
>
<span
class=
"signUp-span"
>
签到
</span>
<span
class=
"signUp-span"
>
<img
*
ngIf=
"signObj.isSign == 'no'"
class=
"toolbar-img"
src=
"./assets/imgs/home/no-sign.png"
>
<img
*
ngIf=
"signObj.isSign == 'yes'"
class=
"toolbar-img"
src=
"./assets/imgs/home/yes-sign.png"
>
</span>
</button>
</ion-buttons>
<ion-buttons
end
>
...
...
@@ -30,7 +30,7 @@
<img
src=
"./assets/imgs/flag.png"
>
</ion-col>
<ion-col
col-10
class=
"middle-right"
>
<div
#
lineChangeEle
id=
"party-bir"
>
<div
horizonta-lamp
#
lineChangeEle
id=
"party-bir"
>
<div><span
class=
"main-color"
>
{{partyObj?.name}}
</span>
同志,欢迎您,
</div>
<div>
今天是
<span
class=
"main-color"
>
{{partyObj?.now | date:'yyyy年MM月dd日'}}
</span>
,
</div>
<div>
是您加入中国共产党的第
<span
class=
"main-color"
>
{{partyObj?.partytime}}
</span>
天,
</div>
...
...
src/pages/tabs/home/home.module.ts
View file @
3df8b129
...
...
@@ -3,16 +3,18 @@ import { IonicPageModule} from 'ionic-angular';
import
{
HomePage
}
from
'./home'
;
import
{
CalendarModule
}
from
"ion2-calendar"
;
import
{
DirectivesModule
}
from
"../../../directives/directives.module"
;
@
NgModule
({
declarations
:
[
HomePage
,
],
imports
:
[
IonicPageModule
.
forChild
(
HomePage
),
CalendarModule
],
imports
:
[
IonicPageModule
.
forChild
(
HomePage
),
CalendarModule
,
DirectivesModule
],
entryComponents
:
[
HomePage
,
],
...
...
src/pages/tabs/home/home.scss
View file @
3df8b129
...
...
@@ -37,11 +37,9 @@ page-home {
position
:
relative
;
.search-icon
{
position
:
absolute
;
top
:
1rem
;
left
:
1
.1rem
;
color
:
#ffffff
;
font-size
:
2rem
;
font-size
:
2
.5rem
;
margin-left
:
1rem
;
}
}
...
...
@@ -59,20 +57,20 @@ page-home {
.toolbar-signUp
{
.signUp-span
{
color
:
#fff
;
border
:
1px
solid
#fff
;
font-size
:
1
.2rem
;
padding
:
2px
5px
;
border-radius
:
4px
;
position
:
relative
;
margin-right
:
.4
rem
;
position
:
relative
;
}
img
.toolbar-img
{
width
:
2rem
;
margin-top
:
2px
;
margin-right
:
1
rem
;
}
.
signUp-span
:
:
after
{
content
:
''
;
position
:
absolute
;
right
:
-8
px
;
top
:
1
px
;
right
:
2
px
;
top
:
6
px
;
height
:
15px
;
width
:
1px
;
background-color
:
#fff
;
...
...
src/pages/tabs/home/home.ts
View file @
3df8b129
...
...
@@ -55,13 +55,6 @@ export class HomePage {
slideTitle
;
move_h
=
33
;
//移动高度
scorllStep
=
1
;
scrollTime
=
60
;
stopTime
=
1000
;
tmpH
=
0
;
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
public
commonSer
:
CommonService
,
public
emitSer
:
EmitService
,
public
ngZone
:
NgZone
,
...
...
@@ -75,36 +68,6 @@ export class HomePage {
});
}
//跑马灯
lineChange
()
{
let
child_div
=
this
.
lineChangeEle
.
nativeElement
.
children
;
setTimeout
(()
=>
{
if
(
child_div
.
length
>
0
)
{
this
.
start
();
}
},
10
);
}
start
()
{
if
(
this
.
tmpH
<
this
.
move_h
)
{
// tmpH = 0 ; move_h = 33
this
.
tmpH
+=
this
.
scorllStep
;
//scorllStep = 1
if
(
this
.
tmpH
>
this
.
move_h
)
{
this
.
tmpH
=
this
.
move_h
;
}
this
.
lineChangeEle
.
nativeElement
.
scrollTop
=
this
.
tmpH
;
setTimeout
(()
=>
{
this
.
start
()
},
this
.
scrollTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
else
{
this
.
tmpH
=
0
;
this
.
lineChangeEle
.
nativeElement
.
appendChild
(
this
.
lineChangeEle
.
nativeElement
.
children
[
0
]);
setTimeout
(()
=>
{
this
.
start
()
},
this
.
stopTime
);
//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}
}
ionViewDidLoad
()
{
this
.
tabsSer
.
signNow
().
subscribe
(
...
...
@@ -173,7 +136,6 @@ export class HomePage {
let
message
=
this
.
partyObj
.
name
+
"同志,欢迎您,今天是"
+
this
.
datePipe
.
transform
(
this
.
partyObj
.
now
,
'yyyy年MM月dd日'
)
+
",是您加入中国共产党的第"
+
this
.
partyObj
.
partytime
+
"天,希望您不忘初心,牢记使命,永远奋斗。"
;
this
.
commonSer
.
alert2
(
message
,
''
,()
=>
{
this
.
isTips
=
false
;
this
.
lineChange
();
});
}
);
...
...
src/pages/tabs/serve/serve.html
View file @
3df8b129
...
...
@@ -27,9 +27,9 @@
<div
class=
"item3-2"
(
click
)="
goToNotice
()"
>
<ion-col
col-2
class=
"card3"
>
<span
*
ngIf=
"hasNew.message == 1"
class=
"img-tips"
></span>
<img
src=
"./assets/imgs/home/icon-
mail
.png"
>
<img
src=
"./assets/imgs/home/icon-
tips
.png"
>
</ion-col>
<ion-col
col-9
class=
"card3"
>
<ion-col
col-9
class=
"card3"
lamp
>
<div
class=
"card3-item"
*
ngFor=
"let item of noticeList;"
>
<span
*
ngIf=
"noticeTips > 0"
class=
"tips"
></span>
<span
class=
"color-996"
>
{{item.title}}
</span>
...
...
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