Commit 11ce2696 authored by wangqinghua's avatar wangqinghua

首页分页的问题

parent 7b517dda
...@@ -113,11 +113,11 @@ ...@@ -113,11 +113,11 @@
</div> </div>
<ion-slides (ionSlideDidChange)="slideChanged()" [loop]="false"> <ion-slides (ionSlideDidChange)="slideChanged()" [loop]="false">
<ng-container *ngFor="let item of slideList;let i = index;"> <ng-container *ngFor="let item of slideArr;let i = index;">
<ion-slide> <ion-slide>
<ion-content> <ion-content>
<div class="main-news"> <div class="main-news">
<ng-container *ngFor="let new of item;"> <ng-container *ngFor="let new of slideList[i];">
<ng-container *ngIf="new.imgUrl"> <ng-container *ngIf="new.imgUrl">
<ion-row class="news-item" (click)="goToDetail(new)"> <ion-row class="news-item" (click)="goToDetail(new)">
<ion-col col-8 class="news-left"> <ion-col col-8 class="news-left">
......
...@@ -80,7 +80,8 @@ export class HomePage { ...@@ -80,7 +80,8 @@ export class HomePage {
plateType; plateType;
index; index;
slideList = []; slideList = new Array(5);
slideArr = new Array(5);
itemWidth; itemWidth;
spanWidth; //文字宽度 spanWidth; //文字宽度
...@@ -205,7 +206,6 @@ export class HomePage { ...@@ -205,7 +206,6 @@ export class HomePage {
} }
change(item) { change(item) {
console.log('213');
if (this.index === item.index) return; if (this.index === item.index) return;
this.index = item.index; this.index = item.index;
this.pageNum = 1; this.pageNum = 1;
...@@ -234,7 +234,6 @@ export class HomePage { ...@@ -234,7 +234,6 @@ export class HomePage {
}); });
this.slideList[this.index] = arr; this.slideList[this.index] = arr;
} }
console.log(arr);
this.slides.slideTo(this.index, 500); this.slides.slideTo(this.index, 500);
} }
) )
...@@ -242,7 +241,6 @@ export class HomePage { ...@@ -242,7 +241,6 @@ export class HomePage {
//加载更多 //加载更多
doInfinite(e) { doInfinite(e) {
console.log('doInfinite');
if (this.total < this.pageSize || this.total == this.pageSize) { if (this.total < this.pageSize || this.total == this.pageSize) {
e.complete(); e.complete();
return false; return false;
...@@ -259,7 +257,6 @@ export class HomePage { ...@@ -259,7 +257,6 @@ export class HomePage {
this.tabsSer.stuffPage(data).subscribe( this.tabsSer.stuffPage(data).subscribe(
(res) => { (res) => {
e.complete(); e.complete();
console.log('e.complete();');
res.data.list.forEach(e => { res.data.list.forEach(e => {
if (e.attachments.length > 0) { if (e.attachments.length > 0) {
e.imgUrl = e.attachments[0].path; e.imgUrl = e.attachments[0].path;
......
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