Newer
Older
import {Component, ViewChild} from '@angular/core';
import {IonicPage, NavController, NavParams, Slides} from 'ionic-angular';
import {ResultPage} from "../result/result";
import {DesicrPage} from "../item/desicr/desicr";
import {AppService} from "../../../service/appHttpService";
import {EditPage} from "../item/edit/edit";
import {SurveyResultPage} from "../../mine/mySurvey/survey-result/survey-result";
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidEnter() {
this.initSwiper();
this.selectPageMenu(0);
this.swiperIndex = 0;
}
this.swiper = new Swiper('.pageMenuSlides .swiper-container', {
//设置slider容器能够同时显示的slides数量(
slidesPreView: 3,
//slide之间的距离(单位px)
spaceBetween: 0,
//断点设定:根据屏幕宽度设置某参数为不同的值
breakpoints: {
1024: {
slidesPerView: 3,
spaceBetween: 0
},
768: {
slidesPerView: 3,
spaceBetween: 0
},
640: {
slidesPerView: 3,
spaceBetween: 0
},
320: {
slidesPerView: 3,
spaceBetween: 0
}
}
});
}
selectPageMenu(index) {
this.appService.ObserverHttpGet('/wisdomgroup/modules/question/findByState', data)
//查看
look(){
this.showOp = false;
this.navCtrl.push('DetailPage',{temp:this.temp});
}
overDue() {
this.appService.alert('确定将该问卷设为过期吗',(res)=>{
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/outdate/', this.temp.id)
.subscribe((res) => {
this.appService.popToastView('问卷状态已更新','middle',1000);
release() {
this.appService.alert('确定发布该问卷吗',
(res) => {
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/submit/', this.temp.id)
.subscribe((res) => {
this.appService.popToastView('发布成功','middle',1000);
this.selectPageMenu(this.swiperIndex);
})
}
)
this.appService.ObserverHttpForm('/wisdomgroup/modules/question/cancel/', this.temp.id,data)
.subscribe((res) => {
this.appService.popToastView('取消发布成功','middle',1000);
this.selectPageMenu(this.swiperIndex);
})
}
)
const data = {
id:this.temp.id
}
this.navCtrl.push('SurveyResultPage',{item:data});
copy() {
this.appService.ObserverHttpGetOption('/wisdomgroup/modules/question/copyQuestion', {id: this.temp.id})
.subscribe((res) => {
delete() {
this.appService.alert('确定删除该问卷吗',(res)=>{
this.appService.ObserverHttpGet('/wisdomgroup/modules/question/delete', {id: this.temp.id})
.subscribe((res) => {
this.appService.popToastView('删除成功','middle',1000);
this.selectPageMenu(0);
this.showOp = false;
})
})