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
ee91e14d
Commit
ee91e14d
authored
May 06, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
top置顶
parent
a37b7ffa
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
148 additions
and
56 deletions
+148
-56
config.xml
config.xml
+1
-1
slide-list.ts
src/components/slide-list/slide-list.ts
+11
-3
slide.ts
src/components/slide/slide.ts
+8
-7
home.html
src/pages/tabs/home/home.html
+53
-1
home.ts
src/pages/tabs/home/home.ts
+73
-42
http.service.ts
src/service/http.service.ts
+2
-2
No files found.
config.xml
View file @
ee91e14d
<?xml version='1.0' encoding='utf-8'?>
<widget
id=
"io.ionic.partyCloud.starter.test"
version=
"0.
1.9
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<widget
id=
"io.ionic.partyCloud.starter.test"
version=
"0.
2.1
"
xmlns=
"http://www.w3.org/ns/widgets"
xmlns:cdv=
"http://cordova.apache.org/ns/1.0"
>
<name>
部机关党建云(测试)
</name>
<description>
An awesome Ionic/Cordova app.
</description>
<author
email=
"hi@ionicframework"
href=
"http://ionicframework.com/"
>
Ionic Framework Team
</author>
...
...
src/components/slide-list/slide-list.ts
View file @
ee91e14d
import
{
AfterViewInit
,
Component
,
ElementRef
,
NgZone
,
ViewChild
}
from
'@angular/core'
;
import
{
Content
,
Slides
}
from
"ionic-angular"
;
import
{
App
,
Content
,
NavController
,
Slides
}
from
"ionic-angular"
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
import
{
CommonService
}
from
"../../provide/common.service"
;
import
{
StuffDetailPage
}
from
"../../pages/home-pages/stuff-detail/stuff-detail"
;
@
Component
({
selector
:
'slide-list'
,
...
...
@@ -15,6 +16,7 @@ export class SlideListComponent implements AfterViewInit {
@
ViewChild
(
'tips1'
)
tips1
:
ElementRef
;
isScroll
=
false
;
private
nav
:
NavController
;
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
...
...
@@ -31,8 +33,9 @@ export class SlideListComponent implements AfterViewInit {
constructor
(
private
tabsSer
:
TabsService
,
public
zone
:
NgZone
,
private
commonSer
:
CommonService
)
{
private
commonSer
:
CommonService
,
private
app
:
App
)
{
this
.
slideList
.
length
=
4
;
this
.
nav
=
this
.
app
.
getRootNav
();
}
ngAfterViewInit
():
void
{
...
...
@@ -50,6 +53,7 @@ export class SlideListComponent implements AfterViewInit {
this
.
tips1
.
nativeElement
.
style
.
left
=
itemWidth
*
(
index
)
+
(
itemWidth
-
spanWidth
)
/
2
+
'px'
;
this
.
index
=
index
;
this
.
plateType
=
item
.
type
;
console
.
log
(
this
.
plateType
)
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
...
...
@@ -85,12 +89,16 @@ export class SlideListComponent implements AfterViewInit {
console
.
log
(
this
.
isScroll
)
}
//
//
查看详情
goToDetail
(
item
)
{
this
.
nav
.
push
(
StuffDetailPage
,
{
id
:
item
.
id
})
}
//下拉刷新
refresh
(
e
){
console
.
log
(
this
.
plateType
)
const
data
=
{
pageSize
:
1
,
pageCount
:
100
,
...
...
src/components/slide/slide.ts
View file @
ee91e14d
import
{
AfterViewInit
,
Component
,
ElementRef
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
TabsService
}
from
"../../pages/tabs/tabs.service"
;
import
{
AppGlobal
}
from
"../../service/http.service"
;
import
{
Slides
}
from
"ionic-angular"
;
// import {StuffDetailPage} from "../../pages/home-pages/stuff-detail/stuff-detail";
// import {NavController} from "ionic-angular";
import
{
App
,
NavController
,
Slides
}
from
"ionic-angular"
;
import
{
StuffDetailPage
}
from
"../../pages/home-pages/stuff-detail/stuff-detail"
;
@
Component
({
selector
:
'slide'
,
...
...
@@ -15,10 +14,12 @@ export class SlideComponent implements AfterViewInit{
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
slideTitle
;
slidersItems
=
[];
private
nav
:
NavController
;
constructor
(
private
tabsSer
:
TabsService
,
// private navCtrl:NavController
private
app
:
App
)
{
this
.
nav
=
this
.
app
.
getRootNav
();
}
ngAfterViewInit
(){
...
...
@@ -57,8 +58,8 @@ export class SlideComponent implements AfterViewInit{
//查看文章详情
goToDetail
(
item
)
{
// this.navCtrl
.push(StuffDetailPage, {
//
id: item.id
//
})
this
.
nav
.
push
(
StuffDetailPage
,
{
id
:
item
.
id
})
}
}
src/pages/tabs/home/home.html
View file @
ee91e14d
...
...
@@ -47,7 +47,59 @@
<slide></slide>
</div>
<slide-list></slide-list>
<!--true 隐藏 false 显示-->
<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>
<!--固定 false -->
<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
)"
loop=
"true"
>
<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>
<!-- <ion-infinite-scroll (ionInfinite)="doInfinite($event)">-->
<!-- <ion-infinite-scroll-content></ion-infinite-scroll-content>-->
<!-- </ion-infinite-scroll>-->
...
...
src/pages/tabs/home/home.ts
View file @
ee91e14d
...
...
@@ -21,7 +21,7 @@ import {SlideListComponent} from "../../../components/slide-list/slide-list";
})
export
class
HomePage
{
@
ViewChild
(
Slides
)
slides
:
Slides
;
@
ViewChild
(
Slides
)
slides
1
:
Slides
;
@
ViewChild
(
Content
)
content
:
Content
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
'tips1'
)
tips1
:
ElementRef
;
...
...
@@ -42,12 +42,10 @@ export class HomePage {
{
name
:
"中央精神"
,
type
:
3
,
index
:
2
},
{
name
:
"本市部署"
,
type
:
4
,
index
:
3
}
];
index
=
0
;
isSign
=
false
;
//签到弹窗
isBir
=
false
;
//政治生日弹窗
isScroll
=
false
;
//tabs置顶
newList
=
[];
noReadNum
;
signObj
=
{
...
...
@@ -58,6 +56,12 @@ export class HomePage {
signText
;
//签到倒计时
partyObj
;
//政治生日
plateType
;
index
=
0
;
slideList
=
[];
itemWidth
;
spanWidth
;
//文字宽度
constructor
(
public
navCtrl
:
NavController
,
public
tts
:
TextToSpeech
,
public
datePipe
:
DatePipe
,
...
...
@@ -71,6 +75,7 @@ export class HomePage {
this
.
noReadNum
=
value
;
}
});
this
.
slideList
.
length
=
4
;
}
ionViewDidEnter
(){
...
...
@@ -82,28 +87,66 @@ export class HomePage {
}
ionViewDidLoad
()
{
// this.change(this.tabsList[0]);
this
.
itemWidth
=
window
.
screen
.
width
/
4
;
this
.
spanWidth
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
;
//文字宽度
console
.
log
(
this
.
spanWidth
)
this
.
tips
.
nativeElement
.
style
.
width
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
+
'px'
;
this
.
tips1
.
nativeElement
.
style
.
width
=
this
.
tabSpan
.
nativeElement
.
offsetWidth
+
'px'
;
this
.
change
(
this
.
tabsList
[
0
]);
this
.
getInfo
();
this
.
scrollHeight
();
}
scrollHeight
(){
const
height
=
this
.
topHeight
.
nativeElement
.
offsetHeight
+
80
;
const
height
=
this
.
topHeight
.
nativeElement
.
offsetHeight
+
54
;
console
.
log
(
this
.
topHeight
.
nativeElement
.
offsetHeight
)
this
.
content
.
ionScroll
.
subscribe
((
$event
)
=>
{
this
.
zone
.
run
(()
=>
{
// this.headerTag.nativeElement.
if
(
this
.
content
.
scrollTop
>
height
){
this
.
slideListCom
.
scroll
(
'true'
)
;
this
.
isScroll
=
true
;
}
else
{
this
.
slideListCom
.
scroll
(
'false'
)
;
this
.
isScroll
=
false
;
}
this
.
content
.
resize
();
})
})
}
change
(
item
)
{
const
index
=
item
.
index
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
this
.
itemWidth
*
(
index
)
+
(
this
.
itemWidth
-
this
.
spanWidth
)
/
2
+
'px'
;
this
.
tips1
.
nativeElement
.
style
.
left
=
this
.
itemWidth
*
(
index
)
+
(
this
.
itemWidth
-
this
.
spanWidth
)
/
2
+
'px'
;
this
.
index
=
index
;
this
.
plateType
=
item
.
type
;
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
.
slideList
[
index
]
=
arr
;
this
.
slides1
.
slideTo
(
index
,
500
);
}
)
}
slideChange
(
e
)
{
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
])
}
//获取党员生日
...
...
@@ -149,37 +192,6 @@ export class HomePage {
},
20
)
}
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
)
=>
{
this
.
newList
=
res
.
data
;
this
.
newList
.
forEach
(
e
=>
{
if
(
e
.
attachments
.
length
>
0
)
{
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
})
}
)
}
//签到接口
signUp
()
{
this
.
tabsSer
.
sign
().
subscribe
(
...
...
@@ -233,8 +245,27 @@ export class HomePage {
}
doRefresh
(
e
){
this
.
slideListCom
.
refresh
(
e
)
// e.complete();
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/service/http.service.ts
View file @
ee91e14d
...
...
@@ -15,8 +15,8 @@ export class AppGlobal {
//接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://180.168.156.212:2931"; //测试环境
// static domain = "http://47.103.35.216:8080";
//阿里云地址
static
domain
=
""
;
//本地环境
static
domain
=
"http://47.103.35.216:8080"
;
//阿里云地址
//
static domain = ""; //本地环境
//图片地址
...
...
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