import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, AlertController, ToastController } from 'ionic-angular';

import { Http, Response } from '@angular/http';

import { AppService } from '../../service/appHttpService';

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

  items:object[];

  //批次id
  batchid:string;
  //批次
  batch = {};
  img = "./assets/imgs/logo.png"; //目前

  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    public alertCtrl: AlertController,
    public http: Http,
    public appService: AppService, public toast: ToastController) {

      this.batchid = this.navParams.get("batchid");
      console.log("选择的批次id:"+this.batchid);
      this.batch = this.navParams.get("batch");
      console.log("批次信息："+this.batch);
      
  }

  ngOnInit():void{
    
    this.appService.ObserverHttpGet("/wisdomgroup/modules/order/batchParticipantsInfo",{"id":this.batchid})
    .subscribe((res: Response) => {
          let data = res.json();
          console.log("canyurenyuan :"+data);
          this.items = data;
      }, error => {        
         this.appService.alert('网络异常！');     
      }   
    );

  }

}
