Commit eb1043ff authored by wangqinghua's avatar wangqinghua

返回按钮提示

parent 79cde799
...@@ -175,6 +175,7 @@ p { ...@@ -175,6 +175,7 @@ p {
.news-content{ .news-content{
overflow-y: hidden; overflow-y: hidden;
overflow-x: scroll; overflow-x: scroll;
width: 100%;
.tabs-parent { .tabs-parent {
position: relative; position: relative;
background-color: #fff; background-color: #fff;
......
...@@ -21,22 +21,23 @@ export class DiscoverPage { ...@@ -21,22 +21,23 @@ export class DiscoverPage {
@ViewChild('tabSpan') tabSpan: ElementRef; @ViewChild('tabSpan') tabSpan: ElementRef;
tabsList = [ tabsList = [
{name: "支部风采",type:13,index:0}, {name: "支部风采", type: 13, index: 0},
{name: "机关党委",type:5,index:1}, {name: "机关党委", type: 5, index: 1},
{name: "党风廉政",type:9,index:2}, {name: "党风廉政", type: 9, index: 2},
{name: "互动交流",type:-1,index:3}, {name: "互动交流", type: -1, index: 3},
{name: "知识拓展",type:-1,index:4}, {name: "知识拓展", type: -1, index: 4},
]; ];
index = 0; index = 0;
isSign = false; isSign = false;
newList; //新闻列表 newList; //新闻列表
noReadNum; noReadNum;
picture: string = AppGlobal.domain +'/wisdomgroup'; picture: string = AppGlobal.domain + '/wisdomgroup';
constructor(public navCtrl: NavController, public navParams: NavParams, constructor(public navCtrl: NavController, public navParams: NavParams,
public tabsSer:TabsService,public emitSer:EmitService) { public tabsSer: TabsService, public emitSer: EmitService) {
// 接收发射过来的数据 // 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => { this.emitSer.eventEmit.subscribe((value: any) => {
if(!isNaN(value)){ if (!isNaN(value)) {
this.noReadNum = value; this.noReadNum = value;
} }
}); });
...@@ -46,8 +47,9 @@ export class DiscoverPage { ...@@ -46,8 +47,9 @@ export class DiscoverPage {
this.change(this.tabsList[0]); this.change(this.tabsList[0]);
} }
//所属板块类型(1党规党章,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示, //所属板块类型:
// * 8党务参考,9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶) //1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
//9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶
change(item) { change(item) {
const index = item.index; const index = item.index;
let itemWidth = window.screen.width / 4; let itemWidth = window.screen.width / 4;
...@@ -90,12 +92,12 @@ export class DiscoverPage { ...@@ -90,12 +92,12 @@ export class DiscoverPage {
} }
//前往发布页面 //前往发布页面
goToPublish(){ goToPublish() {
this.navCtrl.push(PublishPage); this.navCtrl.push(PublishPage);
} }
//消息提醒页面 //消息提醒页面
goToNotice(){ goToNotice() {
this.navCtrl.push(NoticePage); this.navCtrl.push(NoticePage);
} }
......
...@@ -26,15 +26,6 @@ ...@@ -26,15 +26,6 @@
</ion-navbar> </ion-navbar>
</ion-header> </ion-header>
<ion-content> <ion-content>
<div style="height: 200px">
<ion-slides (ionSlideDidChange)="slideChange($event)" #slides *ngIf="slidersItems.length>0" pager loop="true"
autoplay="2000" speed="1500">
<ion-slide style="height:200px;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 class="home-middle-tips"> <div class="home-middle-tips">
<ion-row> <ion-row>
<ion-col col-2 class="middle-left"> <ion-col col-2 class="middle-left">
...@@ -50,9 +41,18 @@ ...@@ -50,9 +41,18 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
<div style="height: 200px">
<ion-slides (ionSlideDidChange)="slideChange($event)" #slides *ngIf="slidersItems.length>0" pager loop="true"
autoplay="2000" speed="1500">
<ion-slide style="height:200px;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 class="news-content"> <div class="news-content">
<div class="tabs-parent"> <div class="tabs-parent">
<div *ngFor="let item of tabsList;let i = index" (click)="change(i)" class="tabs-children"> <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> <span #tabSpan [style.color]="index == i ? '#e12724':''">{{item.name}}</span>
</div> </div>
<span #tips id="tips"></span> <span #tips id="tips"></span>
......
...@@ -22,7 +22,7 @@ page-home { ...@@ -22,7 +22,7 @@ page-home {
height: 2rem; height: 2rem;
line-height: 2rem; line-height: 2rem;
padding: 0 1rem; padding: 0 1rem;
font-size: 1.8rem; font-size: 1.5rem;
font-weight: 500; font-weight: 500;
} }
...@@ -133,13 +133,12 @@ page-home { ...@@ -133,13 +133,12 @@ page-home {
align-self: flex-start; align-self: flex-start;
font-weight: bold; font-weight: bold;
width: 100%; width: 100%;
margin-bottom: 1.2rem; margin-bottom: .6rem;
} }
.news-end { .news-end {
align-self: flex-end; //align-self: flex-end;
color: #999999; color: #999999;
span { span {
margin-right: 1rem; margin-right: 1rem;
} }
...@@ -149,7 +148,7 @@ page-home { ...@@ -149,7 +148,7 @@ page-home {
.news-right { .news-right {
img { img {
border-radius: .5rem; border-radius: .5rem;
height: 80px; height: 60px;
} }
} }
} }
......
...@@ -35,10 +35,17 @@ export class HomePage { ...@@ -35,10 +35,17 @@ export class HomePage {
@ViewChild('lineChangeEle') lineChangeEle: ElementRef; @ViewChild('lineChangeEle') lineChangeEle: ElementRef;
@ViewChild('tabSpan') tabSpan: ElementRef; @ViewChild('tabSpan') tabSpan: ElementRef;
picture: string = AppGlobal.domain +'/wisdomgroup'; picture: string = AppGlobal.domain + '/wisdomgroup';
slidersItems = []; slidersItems = [];
noticeList = []; //所属板块类型:
tabsList = [{name: "党规党章",}, {name: "系列讲话",}, {name: "中央精神",}, {name: "本市部署"}]; //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; index = 0;
isSign = false; isSign = false;
...@@ -57,14 +64,14 @@ export class HomePage { ...@@ -57,14 +64,14 @@ export class HomePage {
move_h = 33; //移动高度 move_h = 33; //移动高度
scorllStep = 1; scorllStep = 1;
scrollTime = 60 ; scrollTime = 60;
stopTime = 1000; stopTime = 1000;
tmpH = 0; tmpH = 0;
constructor(public navCtrl: NavController, public tts: TextToSpeech, constructor(public navCtrl: NavController, public tts: TextToSpeech,
public commonSer: CommonService, public emitSer: EmitService, public commonSer: CommonService, public emitSer: EmitService,
public appService: AppService, public http: Http, private calendar: Calendar, public storage: Storage, public appService: AppService, public http: Http, public storage: Storage,
public badge: Badge, public tabsSer: TabsService) { public badge: Badge, public tabsSer: TabsService) {
// 接收发射过来的数据 // 接收发射过来的数据
this.emitSer.eventEmit.subscribe((value: any) => { this.emitSer.eventEmit.subscribe((value: any) => {
...@@ -75,34 +82,33 @@ export class HomePage { ...@@ -75,34 +82,33 @@ export class HomePage {
} }
lineChange(){ lineChange() {
let child_div = this.lineChangeEle.nativeElement.children; let child_div = this.lineChangeEle.nativeElement.children;
setTimeout( ()=> { setTimeout(() => {
if(child_div.length > 0){ if (child_div.length > 0) {
this.start(); this.start();
} }
},10); }, 10);
} }
start(){ start() {
if (this.tmpH < this.move_h) {// tmpH = 0 ; move_h = 33
if(this.tmpH < this.move_h){// tmpH = 0 ; move_h = 33 this.tmpH += this.scorllStep;//scorllStep = 1
this.tmpH += this.scorllStep;//scorllStep = 1 if (this.tmpH > this.move_h) {
if(this.tmpH >this.move_h){
this.tmpH = this.move_h; this.tmpH = this.move_h;
} }
this.lineChangeEle.nativeElement.scrollTop = this.tmpH; this.lineChangeEle.nativeElement.scrollTop = this.tmpH;
setTimeout( ()=>{ setTimeout(() => {
this.start() this.start()
},this.scrollTime);//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms }, this.scrollTime);//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
}else{ } else {
this.tmpH = 0; this.tmpH = 0;
this.lineChangeEle.nativeElement.appendChild(this.lineChangeEle.nativeElement.children[0]); this.lineChangeEle.nativeElement.appendChild(this.lineChangeEle.nativeElement.children[0]);
// this.lineChangeEle.nativeElement.scrollTop = 0; // this.lineChangeEle.nativeElement.scrollTop = 0;
setTimeout( ()=>{ setTimeout(() => {
this.start() this.start()
},this.stopTime);//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms }, this.stopTime);//stopTime = 3000 ; scrollTime = 30 每移动一个单位延时30ms
} }
} }
...@@ -113,7 +119,7 @@ export class HomePage { ...@@ -113,7 +119,7 @@ export class HomePage {
this.signObj = res.data; this.signObj = res.data;
} }
); );
this.change(0); this.change(this.tabsList[0]);
this.getBanner(); this.getBanner();
this.getInfo(); this.getInfo();
this.lineChange(); this.lineChange();
...@@ -131,14 +137,13 @@ export class HomePage { ...@@ -131,14 +137,13 @@ export class HomePage {
(res) => { (res) => {
this.slidersItems = res.data; this.slidersItems = res.data;
this.slidersItems.forEach(e => { this.slidersItems.forEach(e => {
if(e.title.length > 16){ if (e.title.length > 16) {
e.title = e.title.substr(0,14) +'...'; 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;
} }
}) })
console.log(this.slidersItems);
} }
) )
} }
...@@ -164,7 +169,8 @@ export class HomePage { ...@@ -164,7 +169,8 @@ export class HomePage {
//所属板块类型(1党规党章,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示, //所属板块类型(1党规党章,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,
// * 8党务参考,9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶) // * 8党务参考,9廉政格言,10纪检提示,11风险排查,12警示教育,13支部活动,14党建联建,15结对帮扶)
change(index) { change(item) {
const index = item.index;
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';
...@@ -175,8 +181,8 @@ export class HomePage { ...@@ -175,8 +181,8 @@ export class HomePage {
pageSize: 1, pageSize: 1,
pageCount: 100, pageCount: 100,
obj: { obj: {
'plateType': index + 1, 'plateType': index,
resourceType: 1 'resourceType': 1
} }
} }
this.tabsSer.stuffPage(data).subscribe( this.tabsSer.stuffPage(data).subscribe(
......
...@@ -38,7 +38,7 @@ export class BackButtonService { ...@@ -38,7 +38,7 @@ export class BackButtonService {
} else { } else {
if (tabRef == null || tabRef._selectHistory[tabRef._selectHistory.length - 1] === tabRef.getByIndex(0).id) { if (tabRef == null || tabRef._selectHistory[tabRef._selectHistory.length - 1] === tabRef.getByIndex(0).id) {
//执行退出 //执行退出
// this.showExit(); this.showExit();
} else { } else {
//选择首页第一个的标签 //选择首页第一个的标签
tabRef.select(0); tabRef.select(0);
...@@ -57,7 +57,7 @@ export class BackButtonService { ...@@ -57,7 +57,7 @@ export class BackButtonService {
this.toastCtrl.create({ this.toastCtrl.create({
message: '再按一次退出应用', message: '再按一次退出应用',
duration: 2000, duration: 2000,
position: 'top' position: 'middle'
}).present(); }).present();
//标记为true //标记为true
this.backButtonPressed = true; this.backButtonPressed = true;
......
...@@ -15,8 +15,8 @@ export class AppGlobal { ...@@ -15,8 +15,8 @@ export class AppGlobal {
//接口基地址 //接口基地址
// static domain = "http://101.89.112.92:80"; //正式环境 // static domain = "http://101.89.112.92:80"; //正式环境
// static domain = "http://180.168.156.212:2931"; //测试环境 // static domain = "http://180.168.156.212:2931"; //测试环境
static domain = "http://47.103.35.216:8080"; //阿里云地址 // static domain = "http://47.103.35.216:8080"; //阿里云地址
// static domain = ""; //本地环境 static domain = ""; //本地环境
//图片地址 //图片地址
......
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