import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams} from 'ionic-angular';
import {HomeService} from "../../home.service";
import {YearReportPage} from "../year-report/year-report";


@Component({
    selector: 'page-info-detail',
    templateUrl: 'info-detail.html',
})
export class InfoDetailPage {

    type = 1;
    infoObj;

    constructor(public navCtrl: NavController, public navParams: NavParams,
                private homeSer: HomeService) {
        this.infoObj = this.navParams.get('obj');
        this.type = this.navParams.get('type');
    }

    ionViewDidLoad() {
        console.log('ionViewDidLoad InfoDetailPage');
    }

    goToYearReport(item) {
        if (item.is_public == '0') {
            return;
        }
        this.navCtrl.push(YearReportPage, {ndbg_id: item.ndbg_id, unit_id: this.infoObj.unit_id});
    }
}
