import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import {AppService} from "../../../../service/appHttpService";
import {Storage} from "@ionic/storage";

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

    userId;
    list = [];
    constructor(public navCtrl: NavController, public navParams: NavParams,
                public appService: AppService,public storage: Storage) {}

    ionViewDidEnter() {
        this.storage.get("user").then((res)=>{
            this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/findQuesByUserId/',res.id)
                .subscribe((res)=>{
                    this.list = res.json().datalist;
                })
        });
        // this.getSurveyList()
    }

    getSurveyList(){
        const userId = {};
        console.log( this.userId);
    }

    //填写问卷
    geToWrite(item){
        this.navCtrl.push('SurveyWritePage',{item:item});
    }

    //查看问卷结果
    goToResult(item){
        this.navCtrl.push('SurveyPreviewPage',{item:item});
    }

}
