Commit 10383c29 authored by wangqinghua's avatar wangqinghua

文章分类滚动

parent fd87d6c7
...@@ -55,8 +55,6 @@ export class StuffDetailPage { ...@@ -55,8 +55,6 @@ export class StuffDetailPage {
setTimeout(() => { setTimeout(() => {
this.footerView = true; this.footerView = true;
}, 300) }, 300)
//增加浏览量
// this.initVideo();
} }
//获取文章信息 //获取文章信息
...@@ -89,8 +87,8 @@ export class StuffDetailPage { ...@@ -89,8 +87,8 @@ export class StuffDetailPage {
} }
this.tabSer.updateNumByType(data).subscribe( this.tabSer.updateNumByType(data).subscribe(
(res) => { (res) => {
if (res.errcode == '1000') { if (res.data.content) {
this.commonSer.log('浏览数 +1') this.commonSer.toast(res.data.content);
} }
} }
) )
......
...@@ -92,9 +92,9 @@ ...@@ -92,9 +92,9 @@
<div id="swiper-discover" class="swiper-container"> <div id="swiper-discover" class="swiper-container">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<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" (scroll)="test($event)" >
<ion-content> <ion-content (ionScroll)="test($event)">
<div class="search-content"> <div class="search-content" (scroll)="test($event)">
<ng-container *ngFor="let item of new;"> <ng-container *ngFor="let item of new;">
<div *ngIf="obj.childrenName != '你问我答'" class="search-item" (click)="goToDetail(item)"> <div *ngIf="obj.childrenName != '你问我答'" class="search-item" (click)="goToDetail(item)">
<p class="item-info"> <p class="item-info">
......
...@@ -29,6 +29,7 @@ export class DiscoverPage { ...@@ -29,6 +29,7 @@ export class DiscoverPage {
@ViewChild('newContentParent') newContentParent: ElementRef; @ViewChild('newContentParent') newContentParent: ElementRef;
@ViewChild('scrollTab') scrollTab: ElementRef; @ViewChild('scrollTab') scrollTab: ElementRef;
@ViewChild(Content) content: Content; @ViewChild(Content) content: Content;
@ViewChild('slideContent') slideContent: Content;
//所属板块类型: //所属板块类型:
//1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考 //1党章党规,2系列讲话,3中央精神,4本市部署,5通知公告,6党建动态,7工作提示,8党务参考
...@@ -280,6 +281,16 @@ export class DiscoverPage { ...@@ -280,6 +281,16 @@ export class DiscoverPage {
} }
}) })
}) })
// this.slideContent.ionScroll.subscribe(($event) => {
// this.zone.run(() => {
// console.log(this.slideContent);
// })
// })
}
test(e){
console.log(e);
} }
//初始化swiper //初始化swiper
...@@ -296,7 +307,7 @@ export class DiscoverPage { ...@@ -296,7 +307,7 @@ export class DiscoverPage {
slideChangeTransitionEnd: function () { slideChangeTransitionEnd: function () {
that.swiper.update(); that.swiper.update();
that.changeParent(that.tabsList[this.activeIndex]); that.changeParent(that.tabsList[this.activeIndex]);
const distancs = this.activeIndex * that.itemWidth/2; //滑动的长度 const distancs = this.activeIndex * that.itemWidth / 2; //滑动的长度
let scrollInter = window.setInterval(() => { let scrollInter = window.setInterval(() => {
if (distancs == that.newContentParent.nativeElement.scrollLeft) { if (distancs == that.newContentParent.nativeElement.scrollLeft) {
window.clearInterval(scrollInter); window.clearInterval(scrollInter);
......
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