Commit eb1043ff authored by wangqinghua's avatar wangqinghua

返回按钮提示

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