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
969bc66e
Commit
969bc66e
authored
May 31, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主题教育
parent
16a2185b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
139 additions
and
115 deletions
+139
-115
app.component.ts
src/app/app.component.ts
+1
-1
education.html
src/components/education/education.html
+5
-7
education.ts
src/components/education/education.ts
+9
-8
discover.html
src/pages/tabs/discover/discover.html
+48
-43
discover.scss
src/pages/tabs/discover/discover.scss
+20
-11
discover.ts
src/pages/tabs/discover/discover.ts
+38
-22
home.html
src/pages/tabs/home/home.html
+12
-9
home.scss
src/pages/tabs/home/home.scss
+1
-0
home.ts
src/pages/tabs/home/home.ts
+5
-14
No files found.
src/app/app.component.ts
View file @
969bc66e
...
...
@@ -51,7 +51,7 @@ export class MyApp {
this
.
statusBar
.
backgroundColorByHexString
(
'#e12724'
);
this
.
statusBar
.
styleLightContent
();
timer
(
4
500
).
subscribe
((
res
)
=>
{
timer
(
500
).
subscribe
((
res
)
=>
{
this
.
showSplash
=
false
this
.
checkVersion
();
this
.
loadLogin
();
...
...
src/components/education/education.html
View file @
969bc66e
<!--主题教育-->
<div
*
ngIf=
"isEdu"
class=
"signMask"
(
click
)="
closeEdu
()"
>
<div
class=
"mask-content-bir"
(
click
)="
stop
($
event
)"
>
<p
class=
"title"
>
政治生日
</p>
<div
class=
"record-content"
>
<span
class=
"main-color"
>
{{partyObj?.name}}
</span>
同志,欢迎您,今天是
<span
class=
"main-color"
>
{{partyObj?.now | date:'yyyy年MM月dd日'}}
</span>
,是您加入中国共产党的第
<span
class=
"main-color"
>
{{partyObj?.partytime}}
</span>
天,希望您不忘初心,牢记使命,永远奋斗。
<div
class=
"mask-content-bir"
(
click
)="
stop
($
event
)"
>
<p
class=
"title"
>
主题教育
</p>
<div
class=
"mask-button"
>
<button
class=
"submit-btn submit"
>
查看详情
</button>
</div>
</div>
</div>
</div>
src/components/education/education.ts
View file @
969bc66e
import
{
Component
}
from
'@angular/core'
;
/**
* Generated class for the EducationComponent component.
*
* See https://angular.io/api/core/Component for more info on Angular
* Components.
*/
@
Component
({
selector
:
'education'
,
templateUrl
:
'education.html'
})
export
class
EducationComponent
{
text
:
string
;
isEdu
:
Boolean
=
false
;
constructor
()
{
console
.
log
(
'Hello EducationComponent Component'
);
this
.
text
=
'Hello World'
;
}
closeEdu
()
{
this
.
isEdu
=
false
;
}
stop
(
e
)
{
e
.
stopPropagation
();
}
}
src/pages/tabs/discover/discover.html
View file @
969bc66e
...
...
@@ -19,58 +19,69 @@
</button>
</ion-buttons>
</ion-navbar>
<ion-toolbar
class=
"fixed-toolbar parent-toolbar"
>
<div
ion-fixed
class=
"tabs-fixed "
>
<div
class=
"scroll-tab"
>
<div
class=
"news-content parent"
>
<div
#
tabsParent
class=
"tabs-parent parent"
>
<div
#
tabsChildren
*
ngFor=
"let item of tabsList;"
(
click
)="
changeParent
(
item
)"
class=
"tabs-children"
>
</ion-header>
<ion-content>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
<div
#
topHeight
class=
"padding-bottom-15"
>
<div
class=
"slides-content"
>
<div
id=
"swiper-slide"
class=
"swiper-container"
>
<div
class=
"swiper-wrapper"
>
<ng-container
*
ngIf=
"slidersItems.length > 0"
>
<div
class=
"swiper-slide"
*
ngFor=
"let item of slidersItems;"
>
<img
[
src
]="
picture
+
item
.
imgUrl
"
class=
"slide-image"
[
alt
]="
item
.
title
"
>
</div>
</ng-container>
</div>
</div>
</div>
<div
class=
"slides-title"
*
ngIf=
"slidersItems.length>0"
>
<div
class=
"slide-content"
>
{{slideTitle}}
</div>
<span
class=
"slide-index"
>
<span>
{{slideIndex}}
</span><span>
/{{slidersItems.length}}
</span>
</span>
</div>
</div>
<div
#
fixedTab
>
<div
class=
"fixed-toolbar parent-toolbar"
>
<div
class=
"tabs-fixed "
>
<div
class=
"scroll-tab"
>
<div
class=
"news-content parent"
>
<div
#
tabsParent
class=
"tabs-parent parent"
>
<div
#
tabsChildren
*
ngFor=
"let item of tabsList;"
(
click
)="
changeParent
(
item
)"
class=
"tabs-children"
>
<span
#
tabSpan
[
style
.
color
]="
indexParent =
=
item
.
indexParent
?
'#
e12724
'
:
''"
>
{{item.name}}
</span>
</div>
<span
#
tips
id=
"tips"
></span>
</div>
<span
#
tips
id=
"tips"
></span>
</div>
</div>
</div>
</div>
</ion-toolbar>
<ion-toolbar
class=
"fixed-toolbar margin-top-6"
>
<div
class=
"tabs-fixed"
>
<div
class=
"scroll-tab"
>
<div
class=
"news-content"
#
newsContent
>
<div
class=
"tabs-parent"
>
<div
class=
"tabs-child"
>
<div
class=
"fixed-toolbar"
>
<div
class=
"tabs-fixed"
>
<div
class=
"scroll-tab"
>
<div
class=
"news-content"
#
newsContent
>
<div
class=
"tabs-parent"
>
<div
class=
"tabs-child"
>
<span
*
ngFor=
"let ch of childrenList"
[
ngClass
]="{'
select
'
:indexChildren =
=
ch
.
indexChildren
}"
(
click
)="
changeChildren
(
ch
)"
>
{{ch.name}}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</ion-toolbar>
</ion-header>
<ion-content>
<div
class=
"slides-content"
>
<div
id=
"swiper-slide"
class=
"swiper-container"
>
<div
class=
"swiper-wrapper"
>
<ng-container
*
ngIf=
"slidersItems.length > 0"
>
<div
class=
"swiper-slide"
*
ngFor=
"let item of slidersItems;"
>
<img
[
src
]="
picture
+
item
.
imgUrl
"
class=
"slide-image"
[
alt
]="
item
.
title
"
>
</div>
</ng-container>
</div>
</div>
</div>
<div
class=
"slides-title"
*
ngIf=
"slidersItems.length>0"
>
<div
class=
"slide-content"
>
{{slideTitle}}
</div>
<span
class=
"slide-index"
>
<span>
{{slideIndex}}
</span><span>
/{{slidersItems.length}}
</span>
</span>
</div>
...
...
@@ -79,11 +90,6 @@
<ng-container
*
ngFor=
"let new of slideList;let i = index;"
>
<div
class=
"swiper-slide"
>
<ion-content>
<ion-refresher
(
ionRefresh
)="
doRefresh
($
event
)"
>
<ion-refresher-content
pullingText=
"下拉刷新"
refreshingSpinner=
"bubbles"
>
</ion-refresher-content>
</ion-refresher>
<div
class=
"search-content"
>
<ng-container
*
ngFor=
"let item of new"
>
<div
*
ngIf=
"indexChildren != '45'"
class=
"search-item"
(
click
)="
goToDetail
(
item
)"
>
...
...
@@ -183,4 +189,3 @@
<span>
发视频
</span></div>
</div>
</div>
src/pages/tabs/discover/discover.scss
View file @
969bc66e
...
...
@@ -127,7 +127,7 @@ page-discover {
.news-right
{
padding
:
5px
;
text-align
:
center
;
max-height
:
60px
;
img
{
border-radius
:
.5rem
;
}
...
...
@@ -163,15 +163,28 @@ page-discover {
}
.parent-toolbar
{
margin-bottom
:
.5rem
;
}
.tabs-fixed
{
position
:
fixed
;
top
:
0px
;
left
:
0px
;
.tabs-fixed-scroll
{
position
:
absolute
;
z-index
:
999
;
-webkit-transform
:
translateZ
(
0
);
transform
:
translateZ
(
0
);
width
:
100%
;
z-index
:
99999
;
.news-content
{
margin-top
:
0
;
}
}
.tabs-fixed-scroll
+
.swiper-container
{
ion-content
{
top
:
90px
;
}
}
.tabs-fixed
{
background-color
:
#ffffff
;
border-bottom
:
1px
solid
#ffffff
;
...
...
@@ -282,10 +295,6 @@ page-discover {
$slide-height
:
220px
;
.news-content
{
margin-top
:
1
.2rem
;
}
.slides-content
{
height
:
$slide-height
;
...
...
src/pages/tabs/discover/discover.ts
View file @
969bc66e
...
...
@@ -20,12 +20,15 @@ declare let Swiper: any;
export
class
DiscoverPage
{
@
ViewChild
(
'swiperCom'
)
swiperCom
:
SwiperComponent
;
@
ViewChild
(
'tips'
)
tips
:
ElementRef
;
@
ViewChild
(
'fixedTab'
)
fixedTab
:
ElementRef
;
@
ViewChild
(
'topHeight'
)
topHeight
:
ElementRef
;
@
ViewChild
(
'tabsParent'
)
tabsParent
:
ElementRef
;
@
ViewChild
(
'tabsChildren'
)
tabsChildren
:
ElementRef
;
@
ViewChild
(
'tabSpan'
)
tabSpan
:
ElementRef
;
@
ViewChild
(
'newsContent'
)
newsContent
:
ElementRef
;
@
ViewChild
(
InfiniteScrollContent
)
infiniteScrollContent
:
InfiniteScrollContent
;
@
ViewChild
(
'infiniteScrollContentEle'
)
infiniteScrollContentEle
:
ElementRef
;
@
ViewChild
(
Content
)
content
:
Content
;
//所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
...
...
@@ -75,30 +78,30 @@ export class DiscoverPage {
]
},
{
"name"
:
"主题教育"
,
"type"
:
-
1
,
"indexParent"
:
2
,
"children"
:
[
"name"
:
"主题教育"
,
"type"
:
3
,
"indexParent"
:
2
,
"children"
:
[
{
"name"
:
"中央精神"
,
"type"
:
-
1
,
"type"
:
3
,
"indexChildren"
:
'21'
},
{
"name"
:
"本市部署"
,
"type"
:
-
1
,
"type"
:
4
,
"indexChildren"
:
'22'
},
{
"name"
:
"机关动态"
,
"type"
:
-
1
,
"type"
:
6
,
"indexChildren"
:
'23'
},
{
"name"
:
"学习心得"
,
"type"
:
-
1
,
"type"
:
2
1
,
"indexChildren"
:
'24'
},
{
"name"
:
"学习资料"
,
"type"
:
-
1
,
"type"
:
16
,
"indexChildren"
:
'25'
},
]
...
...
@@ -177,6 +180,7 @@ export class DiscoverPage {
];
childrenList
=
[];
plateType
;
//分类
relateTopicedu
;
//是否主题教育 1 是 0否
picture
:
string
=
AppGlobal
.
domain
+
'/wisdomgroup'
;
slidersItems
=
[];
...
...
@@ -195,7 +199,6 @@ export class DiscoverPage {
//分页
pageCount
=
10
;
loadMore
=
true
;
totalNum
;
pageNum
=
1
;
...
...
@@ -220,6 +223,21 @@ export class DiscoverPage {
this
.
getBanner
();
this
.
slideList
.
length
=
5
;
this
.
changeParent
(
this
.
tabsList
[
1
]);
this
.
scrollHeight
();
}
scrollHeight
()
{
const
height
=
this
.
topHeight
.
nativeElement
.
offsetHeight
;
this
.
content
.
ionScroll
.
subscribe
((
$event
)
=>
{
this
.
zone
.
run
(()
=>
{
console
.
log
(
height
+
":"
+
this
.
content
.
scrollTop
);
if
(
this
.
content
.
scrollTop
>
height
)
{
this
.
renderer
.
addClass
(
this
.
fixedTab
.
nativeElement
,
'tabs-fixed-scroll'
)
}
else
{
this
.
renderer
.
removeClass
(
this
.
fixedTab
.
nativeElement
,
'tabs-fixed-scroll'
)
}
})
})
}
//初始化swiper
...
...
@@ -240,18 +258,18 @@ export class DiscoverPage {
});
that
.
swiperImg
=
new
Swiper
(
'#swiper-slide'
,
{
speed
:
1000
,
autoplay
:{
autoplay
:
{
delay
:
3000
,
disableOnInteraction
:
false
,
},
//可选选项,自动滑动
observer
:
true
,
observeParents
:
true
,
observeSlideChildren
:
true
,
observeSlideChildren
:
true
,
loop
:
true
,
on
:
{
slideChangeTransitionEnd
:
function
()
{
that
.
slideIndex
=
this
.
activeIndex
;
that
.
slideTitle
=
that
.
slidersItems
[
this
.
activeIndex
-
1
].
title
;
that
.
slideTitle
=
that
.
slidersItems
[
this
.
activeIndex
].
title
;
that
.
swiperImg
.
update
();
},
}
...
...
@@ -265,7 +283,6 @@ export class DiscoverPage {
obj
:
{
"resourceType"
:
2
,
//1标题图片,2推荐轮播图,3视频
"isRecommend"
:
1
,
//推荐(1是0否)
"plateType"
:
2
,
}
};
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
...
...
@@ -278,6 +295,7 @@ export class DiscoverPage {
})
}
this
.
slidersItems
=
res
.
data
.
list
;
this
.
slideTitle
=
this
.
slidersItems
[
this
.
slidersItems
.
length
-
1
].
title
;
}
)
}
...
...
@@ -285,27 +303,27 @@ export class DiscoverPage {
//父级选择
changeParent
(
item
)
{
this
.
newsContent
.
nativeElement
.
scrollLeft
=
0
;
//二级菜单滑动重置
this
.
loadMore
=
true
;
const
index
=
item
.
indexParent
;
this
.
indexParent
=
index
;
this
.
indexParent
=
item
.
indexParent
;
this
.
plateType
=
item
.
type
;
this
.
toIndex
=
item
.
indexParent
;
this
.
childrenList
=
item
.
children
;
this
.
relateTopicedu
=
item
.
indexParent
==
'2'
?
1
:
0
;
if
(
this
.
childrenList
.
length
>
0
)
this
.
indexChildren
=
this
.
childrenList
[
0
].
indexChildren
;
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
.
tips
.
nativeElement
.
style
.
left
=
itemWidth
*
(
this
.
indexParent
)
+
(
itemWidth
-
spanWidth
)
/
2
+
'px'
;
const
data
=
{
pageSize
:
1
,
pageCount
:
this
.
pageCount
,
isRecent
:
0
,
obj
:
{
'plateType'
:
this
.
plateType
,
'resourceType'
:
1
'resourceType'
:
1
,
'relateTopicedu'
:
this
.
relateTopicedu
,
}
};
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
...
...
@@ -316,9 +334,8 @@ export class DiscoverPage {
e
.
imgUrl
=
e
.
attachments
[
0
].
path
;
}
});
console
.
log
(
'slideTo:'
+
2
);
this
.
swiper
.
slideTo
(
index
,
500
);
this
.
slideList
[
index
]
=
this
.
newList
;
this
.
swiper
.
slideTo
(
this
.
indexParent
,
500
);
this
.
slideList
[
this
.
indexParent
]
=
this
.
newList
;
}
)
}
...
...
@@ -330,7 +347,6 @@ export class DiscoverPage {
this
.
getQuestion
();
return
false
;
}
this
.
loadMore
=
true
;
const
data
=
{
pageSize
:
1
,
...
...
@@ -338,7 +354,8 @@ export class DiscoverPage {
isRecent
:
0
,
obj
:
{
'plateType'
:
item
.
type
,
'resourceType'
:
1
'resourceType'
:
1
,
'relateTopicedu'
:
this
.
relateTopicedu
,
}
};
this
.
tabsSer
.
stuffPage
(
data
).
subscribe
(
...
...
@@ -403,7 +420,6 @@ export class DiscoverPage {
console
.
log
(
'infiniteScroll'
);
if
(
this
.
totalNum
<
this
.
slideList
[
this
.
toIndex
].
length
+
1
)
{
console
.
log
(
'没有数据了'
);
this
.
loadMore
=
false
;
infiniteScroll
.
enable
(
false
);
return
false
;
}
...
...
src/pages/tabs/home/home.html
View file @
969bc66e
...
...
@@ -14,25 +14,29 @@
</button>
</ion-buttons>
<ion-buttons
end
class=
"score margin-right-10"
>
<span
class=
"score-font"
>
积分
</span><span
class=
"score-num"
>
<ng-container
*
ngIf=
"mineInfo?.total"
>
{{mineInfo?.total}}
</ng-container>
<ng-container
*
ngIf=
"!mineInfo?.total"
>
0
</ng-container>
</span>
<span
class=
"score-font"
>
积分
</span>
<button
(
click
)="
goTo
('
IntegralPage
')"
style=
"background-color: transparent"
>
<span
class=
"score-num"
>
{{mineInfo?.total || 0 }}
</span>
</button>
</ion-buttons>
<ion-buttons
class=
"search-button margin-0-5"
end
>
<button
ion-button
icon-only
(
click
)="
goTo
Search
(
)"
>
<button
ion-button
icon-only
(
click
)="
goTo
('
SearchNewPage
'
)"
>
<ion-icon
class=
"search-icon"
name=
"search"
></ion-icon>
</button>
</ion-buttons>
<ion-buttons
end
class=
"margin-0-5"
>
<button
ion-button
icon-only
(
click
)="
goTo
Notice
(
)"
class=
"toolbar-icon"
>
<button
ion-button
icon-only
(
click
)="
goTo
('
NoticePage
'
)"
class=
"toolbar-icon"
>
<ion-icon
class=
"icon-youjian iconfont"
></ion-icon>
<span
*
ngIf=
"noReadNum > 0"
class=
"num"
>
{{noReadNum}}
</span>
</button>
</ion-buttons>
<ion-buttons
end
class=
"mine-button"
>
<span>
{{username}}
</span>
<ion-buttons
end
class=
"mine-button"
>
<button
(
click
)="
goTo
('
PersonInfoPage
')"
style=
"background-color: transparent;padding: 0;"
>
<span
>
{{username}}
</span>
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
...
...
@@ -136,7 +140,6 @@
</ion-row>
</ng-container>
</ng-container>
<p
class=
"noData"
*
ngIf=
"!loadMore"
>
你已经看到我的底线了
</p>
</div>
<ion-infinite-scroll
#
infiniteScrollContentEle
(
ionInfinite
)="
doInfinite
($
event
)"
>
<ion-infinite-scroll-content
...
...
src/pages/tabs/home/home.scss
View file @
969bc66e
...
...
@@ -75,6 +75,7 @@ page-home {
.score-num
{
font-size
:
2
.5rem
;
line-height
:
2
.3rem
;
color
:
#ffffff
;
}
}
...
...
src/pages/tabs/home/home.ts
View file @
969bc66e
...
...
@@ -87,7 +87,6 @@ export class HomePage {
pageCount
=
AppGlobal
.
pageCount
;
//分页
totalNum
;
loadMore
=
true
;
mineInfo
;
username
;
...
...
@@ -139,7 +138,6 @@ export class HomePage {
//初始化swiper
initSwiper
()
{
console
.
log
(
'initSwiper'
)
let
that
=
this
;
that
.
swiperImg
=
new
Swiper
(
'#swiper-container'
,
{
speed
:
1000
,
...
...
@@ -153,9 +151,8 @@ export class HomePage {
loop
:
true
,
on
:
{
slideChangeTransitionEnd
:
function
()
{
console
.
log
(
this
.
activeIndex
);
that
.
slideIndex
=
this
.
activeIndex
;
// that.slideTitle = that.slidersItems[this.activeIndex -1
].title;
that
.
slideTitle
=
that
.
slidersItems
[
this
.
activeIndex
].
title
;
that
.
swiperImg
.
update
();
},
}
...
...
@@ -193,7 +190,6 @@ export class HomePage {
change
(
item
)
{
this
.
pageNum
=
1
;
this
.
loadMore
=
true
;
this
.
index
=
item
.
index
;
// 自身div的一半 - 滑块的一半
this
.
tips
.
nativeElement
.
style
.
left
=
this
.
itemWidth
*
(
this
.
index
)
+
(
this
.
itemWidth
-
this
.
spanWidth
)
/
2
+
'px'
;
...
...
@@ -283,6 +279,7 @@ export class HomePage {
})
}
this
.
slidersItems
=
res
.
data
.
list
;
this
.
slideTitle
=
this
.
slidersItems
[
this
.
slidersItems
.
length
-
1
].
title
;
}
)
}
...
...
@@ -357,14 +354,9 @@ export class HomePage {
// })
}
//前往搜索页面
goToSearch
()
{
this
.
navCtrl
.
push
(
SearchNewPage
);
}
//消息提醒页面
goToNotice
()
{
this
.
navCtrl
.
push
(
NoticePage
);
//前往
goTo
(
page
)
{
this
.
navCtrl
.
push
(
page
);
}
//上拉加载
...
...
@@ -372,7 +364,6 @@ export class HomePage {
console
.
log
(
'doInfinite'
);
if
(
this
.
totalNum
<
this
.
slideList
[
this
.
index
].
length
+
1
)
{
console
.
log
(
'没有数据了'
);
this
.
loadMore
=
false
;
e
.
enable
(
false
);
return
false
;
}
...
...
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