Commit aaa64f3e authored by wangqinghua's avatar wangqinghua

更新首页滑动加载下拉失败

parent 96105f19
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.partyCloud.starter.test" version="0.2.2" 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.3" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>部机关党建云(测试)</name> <name>部机关党建云(测试)</name>
<description>An awesome Ionic/Cordova app.</description> <description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author> <author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
......
<div class="slides-content"> <div class="slides-content">
<ion-slides (ionSlideDidChange)="slideChange($event)" #slides *ngIf="slidersItems.length>0" <ion-slides (ionSlideDidChange)="slideChange($event)" *ngIf="slidersItems.length>0"
loop="true" loop="true" autoplay="2000" speed="1500">
autoplay="2000" speed="1500">
<ion-slide *ngFor="let item of slidersItems;"> <ion-slide *ngFor="let item of slidersItems;">
<img src="{{picture+item.imgUrl}}" class="slide-image" (click)="goToDetail(item)"> <img src="{{picture+item.imgUrl}}" class="slide-image" (click)="goToDetail(item)">
</ion-slide> </ion-slide>
......
...@@ -146,6 +146,7 @@ page-discover { ...@@ -146,6 +146,7 @@ page-discover {
.swiper-slide{ .swiper-slide{
align-items: baseline; align-items: baseline;
font-size: 1.4rem; font-size: 1.4rem;
overflow-y: auto;
} }
.slide-zoom{ .slide-zoom{
text-align: left; text-align: left;
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</div> </div>
</div> </div>
<ion-slides (ionSlideDidChange)="slideChange($event)" loop="true"> <ion-slides initialSlide="4" (ionSlideDidChange)="slideChange($event)" loop="true">
<ion-slide *ngFor="let item of slideList"> <ion-slide *ngFor="let item of slideList">
<div class="main-news"> <div class="main-news">
<ng-container *ngFor="let new of item;"> <ng-container *ngFor="let new of item;">
......
...@@ -120,7 +120,7 @@ page-home { ...@@ -120,7 +120,7 @@ page-home {
//新闻区 //新闻区
.main-news { .main-news {
padding: 0 1rem; padding: 0 1rem;
text-align: left;
.news-item { .news-item {
padding: .8rem 0; padding: .8rem 0;
...@@ -189,6 +189,7 @@ page-home { ...@@ -189,6 +189,7 @@ page-home {
.swiper-slide{ .swiper-slide{
align-items: baseline; align-items: baseline;
font-size: 1.4rem; font-size: 1.4rem;
overflow-y: auto;
} }
.slide-zoom{ .slide-zoom{
text-align: left; text-align: left;
......
...@@ -48,6 +48,7 @@ export class HomePage { ...@@ -48,6 +48,7 @@ export class HomePage {
isScroll = false; //tabs置顶 isScroll = false; //tabs置顶
noReadNum; noReadNum;
initSlide = 0;
signObj = { signObj = {
'text': '', 'text': '',
...@@ -145,17 +146,22 @@ export class HomePage { ...@@ -145,17 +146,22 @@ export class HomePage {
} }
}); });
this.slideList[index] = arr; this.slideList[index] = arr;
this.slides1.slideTo(index, 500); if(this.slides1) this.slides1.slideTo(index, 500);
} }
} }
) )
} }
slideChange(e) { slideChange(e) {
if(this.initSlide == 0){ //防止初始化加载
this.initSlide = 1;
return false;
}
let index = this.slides1.getActiveIndex(); let index = this.slides1.getActiveIndex();
if (index == this.tabsList.length) index = 0; if (index == this.tabsList.length) index = 0;
if (index == this.tabsList.length + 1) index = 1; if (index == this.tabsList.length + 1) index = 1;
this.change(this.tabsList[index]) this.change(this.tabsList[index])
console.log(index);
} }
...@@ -186,7 +192,7 @@ export class HomePage { ...@@ -186,7 +192,7 @@ export class HomePage {
localStorage.setItem('partyBir', nowDay); localStorage.setItem('partyBir', nowDay);
this.isBir = false; this.isBir = false;
this.homeMiddleTips.nativeElement.style.height = "60px"; this.homeMiddleTips.nativeElement.style.height = "50px";
this.homeMiddleTips.nativeElement.style.padding = ".5rem"; this.homeMiddleTips.nativeElement.style.padding = ".5rem";
let child_div = this.verticaLamp.nativeElement.children; let child_div = this.verticaLamp.nativeElement.children;
const scrollWidth = this.verticaLamp.nativeElement.offsetWidth; const scrollWidth = this.verticaLamp.nativeElement.offsetWidth;
......
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