Commit b94b70f6 authored by wangqinghua's avatar wangqinghua

轮播图页面 返回的问题

parent 3e1a11ac
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.partyCloud.starter.test" version="0.3.1" 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.3.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>
......
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<widget id="io.ionic.partyCloud.starter.test" version="0.0.8" 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.3.2" 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>
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
<preference name="android-minSdkVersion" value="16" /> <preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" /> <preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" /> <preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" /> <preference name="FadeSplashScreenDuration" value="500" />
<preference name="SplashShowOnlyFirstTime" value="false" /> <preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" /> <preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" /> <preference name="SplashScreenDelay" value="5000" />
<preference name="ShowSplashScreenSpinner" value="false" />
</widget> </widget>
import {AfterViewInit, Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {AfterViewInit, Component, ElementRef, EventEmitter, OnInit, Output, ViewChild} from '@angular/core';
import {TabsService} from "../../pages/tabs/tabs.service"; import {TabsService} from "../../pages/tabs/tabs.service";
import {AppGlobal} from "../../service/http.service"; import {AppGlobal} from "../../service/http.service";
import {App, NavController, Slides} from "ionic-angular"; import {App, NavController, Slides} from "ionic-angular";
...@@ -10,17 +10,16 @@ import {StuffDetailPage} from "../../pages/home-pages/stuff-detail/stuff-detail" ...@@ -10,17 +10,16 @@ import {StuffDetailPage} from "../../pages/home-pages/stuff-detail/stuff-detail"
}) })
export class SlideComponent implements AfterViewInit{ export class SlideComponent implements AfterViewInit{
@ViewChild(Slides) slides:Slides; @ViewChild(Slides) slides:Slides;
@Output() done = new EventEmitter<any>();
picture: string = AppGlobal.domain + '/wisdomgroup'; picture: string = AppGlobal.domain + '/wisdomgroup';
slideTitle; slideTitle;
slideIndex; slideIndex;
slidersItems = []; slidersItems = [];
private nav:NavController;
constructor(private tabsSer:TabsService, constructor(private tabsSer:TabsService,
private app:App private app:App
) { ) {
this.nav = this.app.getRootNav();
} }
ngAfterViewInit(){ ngAfterViewInit(){
...@@ -62,8 +61,6 @@ export class SlideComponent implements AfterViewInit{ ...@@ -62,8 +61,6 @@ export class SlideComponent implements AfterViewInit{
goToDetail() { goToDetail() {
const index = this.slides.realIndex; const index = this.slides.realIndex;
if(this.slidersItems[index].plateType == 20) return false; if(this.slidersItems[index].plateType == 20) return false;
this.nav.push(StuffDetailPage, { this.done.emit(this.slidersItems[index]);
id: this.slidersItems[index].id
})
} }
} }
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
</div> </div>
<slide></slide> <slide (done)="goToDetail($event)"></slide>
</div> </div>
<!--true 隐藏 false 显示--> <!--true 隐藏 false 显示-->
<div [hidden]="isScroll" class="news-content"> <div [hidden]="isScroll" class="news-content">
......
import {Component, ElementRef, ViewChild, NgZone, Renderer2} from '@angular/core'; import {Component, ElementRef, ViewChild, NgZone, Renderer2, Input} from '@angular/core';
import {NavController, IonicPage, Slides, Content, InfiniteScrollContent} from 'ionic-angular'; import {NavController, IonicPage, Slides, Content, InfiniteScrollContent} from 'ionic-angular';
import {Http, Response} from '@angular/http'; import {Http, Response} from '@angular/http';
import {AppService, AppGlobal} from '../../../service/http.service'; import {AppService, AppGlobal} from '../../../service/http.service';
...@@ -22,6 +22,7 @@ import {SlideComponent} from "../../../components/slide/slide"; ...@@ -22,6 +22,7 @@ import {SlideComponent} from "../../../components/slide/slide";
}) })
export class HomePage { export class HomePage {
@ViewChild(Slides) slides1: Slides; @ViewChild(Slides) slides1: Slides;
@ViewChild(Content) content: Content; @ViewChild(Content) content: Content;
@ViewChild('tips') tips: ElementRef; @ViewChild('tips') tips: ElementRef;
...@@ -185,8 +186,10 @@ export class HomePage { ...@@ -185,8 +186,10 @@ export class HomePage {
const nowDay = this.datePipe.transform(new Date(), 'yyyy-MM-dd'); const nowDay = this.datePipe.transform(new Date(), 'yyyy-MM-dd');
const partyBir = localStorage.getItem('partyBir'); const partyBir = localStorage.getItem('partyBir');
if (nowDay == partyBir) { if (nowDay == partyBir) {
this.start(); setTimeout(()=>{
this.isBir = false; this.start();
this.isBir = false;
},500)
} else { } else {
this.isBir = true; this.isBir = true;
} }
...@@ -206,6 +209,7 @@ export class HomePage { ...@@ -206,6 +209,7 @@ export class HomePage {
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;
const textWidth = child_div[0].offsetWidth; const textWidth = child_div[0].offsetWidth;
console.log(textWidth);
let i = scrollWidth; let i = scrollWidth;
setInterval(() => { setInterval(() => {
......
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