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
65b65be3
Commit
65b65be3
authored
May 06, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分离文章列表
parent
ac0ecacd
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
224 additions
and
198 deletions
+224
-198
components.module.ts
src/components/components.module.ts
+3
-0
slide-list.html
src/components/slide-list/slide-list.html
+51
-0
slide-list.scss
src/components/slide-list/slide-list.scss
+3
-0
slide-list.ts
src/components/slide-list/slide-list.ts
+82
-0
slide.html
src/components/slide/slide.html
+11
-36
slide.scss
src/components/slide/slide.scss
+23
-0
slide.ts
src/components/slide/slide.ts
+25
-44
discover.ts
src/pages/tabs/discover/discover.ts
+1
-1
home.html
src/pages/tabs/home/home.html
+12
-67
home.scss
src/pages/tabs/home/home.scss
+9
-15
home.ts
src/pages/tabs/home/home.ts
+4
-35
No files found.
src/components/components.module.ts
View file @
65b65be3
import
{
NgModule
}
from
'@angular/core'
;
import
{
NgModule
}
from
'@angular/core'
;
import
{
SlideComponent
}
from
'./slide/slide'
;
import
{
SlideComponent
}
from
'./slide/slide'
;
import
{
IonicPageModule
}
from
"ionic-angular"
;
import
{
IonicPageModule
}
from
"ionic-angular"
;
import
{
SlideListComponent
}
from
'./slide-list/slide-list'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
SlideComponent
,
declarations
:
[
SlideComponent
,
SlideListComponent
,
],
],
imports
:
[
imports
:
[
IonicPageModule
IonicPageModule
],
],
exports
:
[
SlideComponent
,
exports
:
[
SlideComponent
,
SlideListComponent
,
],
],
providers
:[
providers
:[
...
...
src/components/slide-list/slide-list.html
0 → 100644
View file @
65b65be3
<div
[
hidden
]="
isScroll
"
class=
"news-content"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
<span
#
tabSpan
[
style
.
color
]="
index =
=
i
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
</div>
<span
#
tips
class=
"tips"
></span>
</div>
</div>
<div
[
hidden
]="!
isScroll
"
ion-fixed
class=
"news-content ion-fixed"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
<span
#
tabSpan1
[
style
.
color
]="
index =
=
i
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
</div>
<span
#
tips1
class=
"tips"
></span>
</div>
</div>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
>
<ion-slide
*
ngFor=
"let item of slideList"
>
<div
class=
"main-news"
>
<ng-container
*
ngFor=
"let new of item;"
>
<ng-container
*
ngIf=
"new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-8
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
<img
src=
"{{picture+new.imgUrl}}"
>
</ion-col>
</ion-row>
</ng-container>
<ng-container
*
ngIf=
"!new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-12
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
</ion-row>
</ng-container>
</ng-container>
</div>
</ion-slide>
</ion-slides>
src/components/slide-list/slide-list.scss
0 → 100644
View file @
65b65be3
slide-list
{
}
src/components/slide-list/slide-list.ts
0 → 100644
View file @
65b65be3
import
{
AfterViewInit
,
Component
,
ElementRef
,
ViewChild
}
from
'@angular/core'
;
import
{
Slides
}
from
"ionic-angular"
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
@
Component
({
selector
:
'slide-list'
,
templateUrl
:
'slide-list.html'
})
export
class
SlideListComponent
implements
AfterViewInit
{
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
'tabSpan'
)
tabSpan
:
ElementRef
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
'tips1'
)
tips1
:
ElementRef
;
isScroll
=
false
;
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
tabsList
=
[
{
name
:
"系列讲话"
,
type
:
2
,
index
:
0
},
{
name
:
"党章党规"
,
type
:
1
,
index
:
1
},
{
name
:
"中央精神"
,
type
:
3
,
index
:
2
},
{
name
:
"本市部署"
,
type
:
4
,
index
:
3
}
];
index
=
0
;
slideList
=
[];
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
constructor
(
private
tabsSer
:
TabsService
)
{
this
.
slideList
.
length
=
4
;
console
.
log
(
'Hello SlideListComponent Component'
);
}
ngAfterViewInit
():
void
{
this
.
change
(
this
.
tabsList
[
0
]);
}
change
(
item
)
{
const
index
=
item
.
index
;
let
itemWidth
=
window
.
screen
.
width
/
4
;
let
spanWidth
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
;
//文字宽度
this
.
tips
.
nativeElement
.
style
.
width
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
+
'px'
;
this
.
tips1
.
nativeElement
.
style
.
width
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
+
'px'
;
// 自身div的一半 - 滑块的一半
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
;
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
obj
:
{
'plateType'
:
item
.
type
,
'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
.
slides
.
slideTo
(
index
,
500
);
this
.
slideList
[
index
]
=
arr
;
}
)
}
slideChange
(
e
){
const
index
=
this
.
slides
.
getActiveIndex
();
// console.log(this.tabsList[index]);
// this.changeParent(this.tabsList[index])
}
//
goToDetail
(
item
){}
}
src/components/slide/slide.html
View file @
65b65be3
<div
#
headerTag
class=
"news-content"
ion-fixed
>
<div
class=
"slides-content"
>
<div
class=
"tabs-parent"
>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
#
slides
*
ngIf=
"slidersItems.length>0"
pager
<div
*
ngFor=
"let item of tabsList;let i = index;"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
loop=
"true"
<span
#
tabSpan
[
style
.
color
]="
index =
=
i
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
autoplay=
"2000"
speed=
"1500"
>
</div>
<ion-slide
*
ngFor=
"let item of slidersItems;"
>
<span
#
tips
id=
"tips"
></span>
<img
src=
"{{picture+item.imgUrl}}"
class=
"slide-image"
(
click
)="
goToDetail
(
item
)"
>
</div>
</ion-slide>
</div>
</ion-slides>
<div
#
scrollableTag
class=
"main-news"
>
<ng-container
*
ngFor=
"let new of newList;"
>
<ng-container
*
ngIf=
"new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-8
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
<img
src=
"{{picture+new.imgUrl}}"
>
</ion-col>
</ion-row>
</ng-container>
<ng-container
*
ngIf=
"!new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-12
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
</ion-row>
</ng-container>
</ng-container>
</div>
</div>
<p
class=
"slides-title"
>
{{slideTitle}}
<span
class=
"main-color"
float-end
>
1
<span
style=
"font-size: 1.5rem;font-weight: 400;"
>
/{{slidersItems.length}}
</span></span></p>
\ No newline at end of file
src/components/slide/slide.scss
View file @
65b65be3
slide
{
slide
{
$slide-height
:
200px
;
.news-content
{
.news-content
{
margin-top
:
1
.2rem
;
margin-top
:
1
.2rem
;
}
}
.slides-content
{
height
:
$slide-height
;
ion-slide
{
width
:
100%
;
height
:
$slide-height
;
}
ion-slides
{
width
:
100%
;
height
:
$slide-height
;
}
.slide-image
{
width
:
100%
;
height
:
$slide-height
;
}
.swiper-container
{
height
:
$slide-height
;
width
:
100%
;
overflow-y
:
auto
;
}
}
//新闻区
//新闻区
.main-news
{
.main-news
{
...
...
src/components/slide/slide.ts
View file @
65b65be3
import
{
AfterViewInit
,
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
AfterViewInit
,
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
import
{
Slides
}
from
"ionic-angular"
;
// import {StuffDetailPage} from "../../pages/home-pages/stuff-detail/stuff-detail";
// import {StuffDetailPage} from "../../pages/home-pages/stuff-detail/stuff-detail";
// import {NavController} from "ionic-angular";
// import {NavController} from "ionic-angular";
...
@@ -9,21 +10,11 @@ import {AppGlobal} from "../../service/http.service";
...
@@ -9,21 +10,11 @@ import {AppGlobal} from "../../service/http.service";
templateUrl
:
'slide.html'
templateUrl
:
'slide.html'
})
})
export
class
SlideComponent
implements
AfterViewInit
{
export
class
SlideComponent
implements
AfterViewInit
{
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
'tabSpan'
)
tabSpan
:
ElementRef
;
@
ViewChild
(
'headerTag'
)
headerTag
:
ElementRef
;
@
ViewChild
(
'scrollableTag'
)
scrollableTag
:
ElementRef
;
text
:
string
;
index
=
0
;
newList
=
[];
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
tabsList
=
[
slideTitle
;
{
name
:
"系列讲话"
,
type
:
2
,
index
:
0
},
slidersItems
=
[];
{
name
:
"党章党规"
,
type
:
1
,
index
:
1
},
{
name
:
"中央精神"
,
type
:
3
,
index
:
2
},
{
name
:
"本市部署"
,
type
:
4
,
index
:
3
}
];
constructor
(
private
tabsSer
:
TabsService
,
constructor
(
private
tabsSer
:
TabsService
,
// private navCtrl:NavController
// private navCtrl:NavController
...
@@ -31,34 +22,24 @@ export class SlideComponent implements AfterViewInit{
...
@@ -31,34 +22,24 @@ export class SlideComponent implements AfterViewInit{
}
}
ngAfterViewInit
(){
ngAfterViewInit
(){
console
.
log
(
this
.
headerTag
);
this
.
getBanner
();
let
offset
=
this
.
headerTag
.
nativeElement
.
offsetHeight
;
(
<
HTMLDivElement
>
this
.
scrollableTag
.
nativeElement
).
style
.
marginTop
=
offset
+
'px'
;
this
.
change
(
this
.
tabsList
[
0
]);
}
}
//所属板块类型(1党规党章,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,
//获取轮播图
// * 8党务参考,9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶)
getBanner
()
{
change
(
item
)
{
const
index
=
item
.
index
;
let
itemWidth
=
window
.
screen
.
width
/
4
;
let
spanWidth
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
;
//文字宽度
this
.
tips
.
nativeElement
.
style
.
width
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
+
'px'
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
(
index
)
+
(
itemWidth
-
spanWidth
)
/
2
+
'px'
;
this
.
index
=
index
;
const
data
=
{
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
obj
:
{
obj
:
{
'plateType'
:
item
.
type
,
resourceType
:
2
,
'resourceType'
:
1
isRecommend
:
1
,
}
}
}
}
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
(
res
)
=>
{
(
res
)
=>
{
this
.
newList
=
res
.
data
;
this
.
slidersItems
=
res
.
data
;
this
.
newList
.
forEach
(
e
=>
{
this
.
slidersItems
.
forEach
(
e
=>
{
if
(
e
.
title
.
length
>
16
)
{
e
.
title
=
e
.
title
.
substr
(
0
,
14
)
+
'...'
;
}
if
(
e
.
attachments
.
length
>
0
)
{
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
}
...
@@ -67,17 +48,17 @@ export class SlideComponent implements AfterViewInit{
...
@@ -67,17 +48,17 @@ export class SlideComponent implements AfterViewInit{
)
)
}
}
//
//轮播图变动
setTop
(
height
){
slideChange
(
e
)
{
console
.
log
(
this
.
headerTag
);
let
index
=
this
.
slides
.
getActiveIndex
();
// this.headerTag.nativeElement.style.top = height +'px';
if
(
index
==
this
.
slidersItems
.
length
+
1
)
index
=
1
this
.
slideTitle
=
this
.
slidersItems
[
index
-
1
].
title
;
}
}
// //查看文章详情
//查看文章详情
// goToDetail(item) {
goToDetail
(
item
)
{
// this.navCtrl.push(StuffDetailPage, {
// this.navCtrl.push(StuffDetailPage, {
// id: item.id
// id: item.id
// })
// })
// }
}
}
}
src/pages/tabs/discover/discover.ts
View file @
65b65be3
...
@@ -144,7 +144,7 @@ export class DiscoverPage {
...
@@ -144,7 +144,7 @@ export class DiscoverPage {
noReadNum
;
noReadNum
;
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
slideList
=
[];
slideList
=
[];
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
commonSer
:
CommonService
,
public
commonSer
:
CommonService
,
...
...
src/pages/tabs/home/home.html
View file @
65b65be3
...
@@ -22,7 +22,13 @@
...
@@ -22,7 +22,13 @@
</ion-buttons>
</ion-buttons>
</ion-navbar>
</ion-navbar>
</ion-header>
</ion-header>
<ion-content
#
content
>
<ion-content>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
pullingIcon=
"arrow-dropdown"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
<div
#
topHeight
>
<div
#
topHeight
>
<div
#
homeMiddleTips
class=
"home-middle-tips"
>
<div
#
homeMiddleTips
class=
"home-middle-tips"
>
<ion-row>
<ion-row>
...
@@ -39,74 +45,13 @@
...
@@ -39,74 +45,13 @@
</ion-col>
</ion-col>
</ion-row>
</ion-row>
</div>
</div>
<div
style=
"height: 250px"
>
<slide></slide>
<ion-slides
(
ionSlideDidChange
)="
slideChange
($
event
)"
#
slides
*
ngIf=
"slidersItems.length>0"
pager
loop=
"true"
autoplay=
"2000"
speed=
"1500"
>
<ion-slide
style=
"height:250px;width: 100%;"
*
ngFor=
"let item of slidersItems;"
>
<img
src=
"{{picture+item.imgUrl}}"
class=
"slide-image"
(
click
)="
goToDetail
(
item
)"
>
</ion-slide>
</ion-slides>
</div>
<p
class=
"slides-title"
>
{{slideTitle}}
<span
class=
"main-color"
float-end
>
1
<span
style=
"font-size: 1.5rem;font-weight: 400;"
>
/{{slidersItems.length}}
</span></span></p>
</div>
<div
[
hidden
]="
isScroll
"
class=
"news-content"
>
<div
class=
"tabs-parent"
>
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
<span
#
tabSpan
[
style
.
color
]="
index =
=
i
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
</div>
<span
#
tips
class=
"tips"
></span>
</div>
</div>
</div>
<div
[
hidden
]="!
isScroll
"
ion-fixed
class=
"news-content ion-fixed"
>
<slide-list></slide-list>
<div
class=
"tabs-parent"
>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">-->
<div
*
ngFor=
"let item of tabsList;let i = index"
(
click
)="
change
(
item
)"
class=
"tabs-children"
>
<!-- <ion-infinite-scroll-content></ion-infinite-scroll-content>-->
<span
#
tabSpan1
[
style
.
color
]="
index =
=
i
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
<!-- </ion-infinite-scroll>-->
</div>
<span
#
tips1
class=
"tips"
></span>
</div>
</div>
<div
class=
"main-news"
>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
pullingIcon=
"arrow-dropdown"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
<ng-container
*
ngFor=
"let new of newList;"
>
<ng-container
*
ngIf=
"new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-8
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
<ion-col
col-4
class=
"news-right"
>
<img
src=
"{{picture+new.imgUrl}}"
>
</ion-col>
</ion-row>
</ng-container>
<ng-container
*
ngIf=
"!new.imgUrl"
>
<ion-row
class=
"news-item"
(
click
)="
goToDetail
(
new
)"
>
<ion-col
col-12
class=
"news-left"
>
<p
class=
"news-title"
>
{{new.title}}
</p>
<p
class=
"news-end"
>
<span>
{{new.source}}
</span>
<span>
{{new.publishTime | date:'yyyy-MM-dd'}}
</span>
</p>
</ion-col>
</ion-row>
</ng-container>
</ng-container>
<ion-infinite-scroll
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content></ion-infinite-scroll-content>
</ion-infinite-scroll>
</div>
</ion-content>
</ion-content>
<!--政治生日-->
<!--政治生日-->
<div
*
ngIf=
"isBir"
class=
"signMask"
>
<div
*
ngIf=
"isBir"
class=
"signMask"
>
...
...
src/pages/tabs/home/home.scss
View file @
65b65be3
page-home
{
page-home
{
ion-slides
{
width
:
100%
;
height
:
250px
;
}
.slide-image
{
width
:
100%
;
height
:
250px
;
}
.swiper-container
{
height
:
250px
;
width
:
100%
;
overflow-y
:
auto
;
}
.slides-title
{
.slides-title
{
color
:
#333
;
color
:
#333
;
...
@@ -98,7 +84,7 @@ page-home {
...
@@ -98,7 +84,7 @@ page-home {
transition
:
height
500ms
;
transition
:
height
500ms
;
ion-row
{
ion-row
{
padding
:
.5rem
0
;
padding
:
0
;
-webkit-border-radius
:
5px
;
-webkit-border-radius
:
5px
;
-moz-border-radius
:
5px
;
-moz-border-radius
:
5px
;
border-radius
:
5px
;
border-radius
:
5px
;
...
@@ -203,5 +189,13 @@ page-home {
...
@@ -203,5 +189,13 @@ page-home {
text-overflow
:
ellipsis
;
text-overflow
:
ellipsis
;
white-space
:
nowrap
;
white-space
:
nowrap
;
}
}
.swiper-slide
{
align-items
:
baseline
;
font-size
:
1
.4rem
;
}
.slide-zoom
{
text-align
:
left
;
}
}
}
src/pages/tabs/home/home.ts
View file @
65b65be3
...
@@ -32,7 +32,6 @@ export class HomePage {
...
@@ -32,7 +32,6 @@ export class HomePage {
@
ViewChild
(
'homeMiddleTips'
)
homeMiddleTips
:
ElementRef
;
@
ViewChild
(
'homeMiddleTips'
)
homeMiddleTips
:
ElementRef
;
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
slidersItems
=
[];
//所属板块类型:
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
...
@@ -58,7 +57,7 @@ export class HomePage {
...
@@ -58,7 +57,7 @@ export class HomePage {
signText
;
//签到倒计时
signText
;
//签到倒计时
partyObj
;
//政治生日
partyObj
;
//政治生日
slideTitle
;
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
public
commonSer
:
CommonService
,
public
emitSer
:
EmitService
,
public
commonSer
:
CommonService
,
public
emitSer
:
EmitService
,
...
@@ -82,8 +81,7 @@ export class HomePage {
...
@@ -82,8 +81,7 @@ export class HomePage {
}
}
ionViewDidLoad
()
{
ionViewDidLoad
()
{
this
.
change
(
this
.
tabsList
[
0
]);
// this.change(this.tabsList[0]);
this
.
getBanner
();
this
.
getInfo
();
this
.
getInfo
();
this
.
scrollHeight
();
this
.
scrollHeight
();
}
}
...
@@ -104,35 +102,6 @@ export class HomePage {
...
@@ -104,35 +102,6 @@ export class HomePage {
//获取轮播图
getBanner
()
{
const
data
=
{
obj
:
{
resourceType
:
2
,
isRecommend
:
1
,
}
}
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
(
res
)
=>
{
this
.
slidersItems
=
res
.
data
;
this
.
slidersItems
.
forEach
(
e
=>
{
if
(
e
.
title
.
length
>
16
)
{
e
.
title
=
e
.
title
.
substr
(
0
,
14
)
+
'...'
;
}
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
})
}
)
}
//slideChange
slideChange
(
e
)
{
let
index
=
this
.
slides
.
getActiveIndex
();
if
(
index
==
this
.
slidersItems
.
length
+
1
)
index
=
1
this
.
slideTitle
=
this
.
slidersItems
[
index
-
1
].
title
;
}
//获取党员生日
//获取党员生日
getInfo
()
{
getInfo
()
{
...
@@ -161,8 +130,8 @@ export class HomePage {
...
@@ -161,8 +130,8 @@ export class HomePage {
localStorage
.
setItem
(
'partyBir'
,
nowDay
);
localStorage
.
setItem
(
'partyBir'
,
nowDay
);
this
.
isBir
=
false
;
this
.
isBir
=
false
;
this
.
homeMiddleTips
.
nativeElement
.
style
.
height
=
"
8
0px"
;
this
.
homeMiddleTips
.
nativeElement
.
style
.
height
=
"
6
0px"
;
this
.
homeMiddleTips
.
nativeElement
.
style
.
padding
=
"
1
rem"
;
this
.
homeMiddleTips
.
nativeElement
.
style
.
padding
=
"
.5
rem"
;
let
child_div
=
this
.
verticaLamp
.
nativeElement
.
children
;
let
child_div
=
this
.
verticaLamp
.
nativeElement
.
children
;
const
scrollWidth
=
this
.
verticaLamp
.
nativeElement
.
offsetWidth
;
const
scrollWidth
=
this
.
verticaLamp
.
nativeElement
.
offsetWidth
;
const
textWidth
=
child_div
[
0
].
offsetWidth
;
const
textWidth
=
child_div
[
0
].
offsetWidth
;
...
...
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