Commit 969bc66e authored by wangqinghua's avatar wangqinghua

主题教育

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