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
a37b7ffa
Commit
a37b7ffa
authored
May 06, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下拉刷新
parent
f1ea0484
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
23 deletions
+55
-23
slide-list.html
src/components/slide-list/slide-list.html
+1
-1
slide-list.ts
src/components/slide-list/slide-list.ts
+34
-3
slide.scss
src/components/slide/slide.scss
+11
-1
discover.html
src/pages/tabs/discover/discover.html
+1
-1
discover.ts
src/pages/tabs/discover/discover.ts
+3
-2
home.html
src/pages/tabs/home/home.html
+0
-1
home.scss
src/pages/tabs/home/home.scss
+0
-10
home.ts
src/pages/tabs/home/home.ts
+5
-4
No files found.
src/components/slide-list/slide-list.html
View file @
a37b7ffa
...
...
@@ -18,7 +18,7 @@
</div>
</div>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
loop=
"true"
>
<ion-slide
*
ngFor=
"let item of slideList"
>
<div
class=
"main-news"
>
<ng-container
*
ngFor=
"let new of item;"
>
...
...
src/components/slide-list/slide-list.ts
View file @
a37b7ffa
...
...
@@ -2,6 +2,7 @@ import {AfterViewInit, Component, ElementRef, NgZone, ViewChild} from '@angular/
import
{
Content
,
Slides
}
from
"ionic-angular"
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
import
{
CommonService
}
from
"../../provide/common.service"
;
@
Component
({
selector
:
'slide-list'
,
...
...
@@ -23,12 +24,14 @@ export class SlideListComponent implements AfterViewInit {
{
name
:
"中央精神"
,
type
:
3
,
index
:
2
},
{
name
:
"本市部署"
,
type
:
4
,
index
:
3
}
];
plateType
;
index
=
0
;
slideList
=
[];
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
constructor
(
private
tabsSer
:
TabsService
,
public
zone
:
NgZone
)
{
constructor
(
private
tabsSer
:
TabsService
,
public
zone
:
NgZone
,
private
commonSer
:
CommonService
)
{
this
.
slideList
.
length
=
4
;
}
...
...
@@ -46,11 +49,12 @@ export class SlideListComponent implements AfterViewInit {
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
(
index
)
+
(
itemWidth
-
spanWidth
)
/
2
+
'px'
;
this
.
tips1
.
nativeElement
.
style
.
left
=
itemWidth
*
(
index
)
+
(
itemWidth
-
spanWidth
)
/
2
+
'px'
;
this
.
index
=
index
;
this
.
plateType
=
item
.
type
;
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
obj
:
{
'plateType'
:
item
.
t
ype
,
'plateType'
:
this
.
plateT
ype
,
'resourceType'
:
1
}
}
...
...
@@ -69,7 +73,9 @@ export class SlideListComponent implements AfterViewInit {
}
slideChange
(
e
)
{
const
index
=
this
.
slides1
.
getActiveIndex
();
let
index
=
this
.
slides1
.
getActiveIndex
();
if
(
index
==
this
.
tabsList
.
length
)
index
=
0
;
if
(
index
==
this
.
tabsList
.
length
+
1
)
index
=
1
;
this
.
change
(
this
.
tabsList
[
index
])
}
...
...
@@ -83,4 +89,29 @@ export class SlideListComponent implements AfterViewInit {
goToDetail
(
item
)
{
}
//下拉刷新
refresh
(
e
){
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
obj
:
{
'plateType'
:
this
.
plateType
,
'resourceType'
:
1
}
}
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
(
res
)
=>
{
let
arr
=
res
.
data
;
arr
.
forEach
(
e
=>
{
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
})
this
.
commonSer
.
toastTime
(
'刷新成功!'
,
800
)
this
.
slideList
[
this
.
index
]
=
arr
;
e
.
complete
();
}
)
}
}
src/components/slide/slide.scss
View file @
a37b7ffa
slide
{
$slide-height
:
2
0
0px
;
$slide-height
:
2
2
0px
;
.news-content
{
margin-top
:
1
.2rem
;
}
...
...
@@ -26,6 +26,16 @@ slide {
}
}
.slides-title
{
color
:
#333
;
width
:
100%
;
text-align
:
left
;
height
:
2rem
;
line-height
:
2rem
;
padding
:
0
1rem
;
font-size
:
1
.5rem
;
font-weight
:
500
;
}
//新闻区
.main-news
{
padding
:
0
1rem
;
...
...
src/pages/tabs/discover/discover.html
View file @
a37b7ffa
...
...
@@ -48,7 +48,7 @@
</ion-refresher-content>
</ion-refresher>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
loop=
"true"
>
<ion-slide
*
ngFor=
"let new of slideList"
>
<div
class=
"search-content"
>
<ng-container
*
ngFor=
"let item of new"
>
...
...
src/pages/tabs/discover/discover.ts
View file @
a37b7ffa
...
...
@@ -271,8 +271,9 @@ export class DiscoverPage {
}
slideChange
(
e
){
const
index
=
this
.
slides
.
getActiveIndex
();
console
.
log
(
this
.
tabsList
[
index
]);
let
index
=
this
.
slides
.
getActiveIndex
();
if
(
index
==
this
.
tabsList
.
length
)
index
=
0
;
if
(
index
==
this
.
tabsList
.
length
+
1
)
index
=
1
;
this
.
changeParent
(
this
.
tabsList
[
index
])
}
}
src/pages/tabs/home/home.html
View file @
a37b7ffa
...
...
@@ -25,7 +25,6 @@
<ion-content>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
pullingIcon=
"arrow-dropdown"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
...
...
src/pages/tabs/home/home.scss
View file @
a37b7ffa
page-home
{
.slides-title
{
color
:
#333
;
width
:
100%
;
text-align
:
left
;
height
:
2rem
;
line-height
:
2rem
;
padding
:
0
1rem
;
font-size
:
1
.5rem
;
font-weight
:
500
;
}
//头部搜索
.toolbar
.searchbar-ios
.searchbar-input
{
...
...
src/pages/tabs/home/home.ts
View file @
a37b7ffa
...
...
@@ -62,7 +62,7 @@ export class HomePage {
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
public
commonSer
:
CommonService
,
public
emitSer
:
EmitService
,
public
zone
:
NgZone
,
public
slideList
:
SlideListComponent
,
public
zone
:
NgZone
,
public
slideList
Com
:
SlideListComponent
,
public
appService
:
AppService
,
public
http
:
Http
,
public
storage
:
Storage
,
public
badge
:
Badge
,
public
tabsSer
:
TabsService
)
{
// 接收发射过来的数据
...
...
@@ -94,9 +94,9 @@ export class HomePage {
this
.
zone
.
run
(()
=>
{
// this.headerTag.nativeElement.
if
(
this
.
content
.
scrollTop
>
height
){
this
.
slideList
.
scroll
(
'true'
);
this
.
slideList
Com
.
scroll
(
'true'
);
}
else
{
this
.
slideList
.
scroll
(
'false'
);
this
.
slideList
Com
.
scroll
(
'false'
);
}
this
.
content
.
resize
();
})
...
...
@@ -233,7 +233,8 @@ export class HomePage {
}
doRefresh
(
e
){
e
.
complete
();
this
.
slideListCom
.
refresh
(
e
)
// e.complete();
}
}
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