import { Component } from '@angular/core';
import { IonicPage, NavController } from 'ionic-angular';
import {  Response } from '@angular/http';
import { JoinDetailPage } from '../joinDetail/joinDetail';
import { AppService } from '../../../service/appHttpService';

@IonicPage()
@Component({
  selector: 'page-activityTrack',
  templateUrl: 'activityTrack.html',
})
export class ActivityTrackPage {

  activityList: object[];
  
 
  constructor(
    public navCtrl: NavController,
    public appService: AppService,
  ) {

  }

  ngOnInit() {
    this.appService.ObserverHttpGet("/wisdomgroup/modules/activity/findAllActivityForTraceList",null)
    .subscribe((res: Response) => {
        let resultback = res.json();
        this.activityList = resultback           
      }, error => {        
          this.appService.alert('网络异常！');    
      }   
    );
  }

  goDetail(item) {
    this.navCtrl.push("JoinDetailPage",{id:item.id});
  }

  goBack(){
    this.navCtrl.popToRoot();
  }
}
