Commit 2584ca53 authored by wangqinghua's avatar wangqinghua

color

parent 6bcf8c40
...@@ -7,22 +7,23 @@ import {EditPage} from "../item/edit/edit"; ...@@ -7,22 +7,23 @@ import {EditPage} from "../item/edit/edit";
declare var Swiper; declare var Swiper;
@IonicPage() @IonicPage()
@Component({ @Component({
selector: 'page-list', selector: 'page-list',
templateUrl: 'list.html', templateUrl: 'list.html',
}) })
export class ListPage { export class ListPage {
@ViewChild('contentSlides') contentSlides :Slides; @ViewChild('contentSlides') contentSlides: Slides;
contentList = <any>[ contentList = <any>[
{ {
datalist:[] datalist: []
} }
]; ];
menuList = [ menuList = [
{ name:'草稿箱' }, {name: '草稿箱'},
{ name:'已发布' }, {name: '已发布'},
{ name:'已过期' } {name: '已过期'}
]; ];
showOp = false; showOp = false;
swiperIndex; swiperIndex;
...@@ -40,7 +41,7 @@ export class ListPage { ...@@ -40,7 +41,7 @@ export class ListPage {
} }
initSwiper(){ initSwiper() {
this.swiper = new Swiper('.pageMenuSlides .swiper-container', { this.swiper = new Swiper('.pageMenuSlides .swiper-container', {
//设置slider容器能够同时显示的slides数量( //设置slider容器能够同时显示的slides数量(
slidesPreView: 3, slidesPreView: 3,
...@@ -70,11 +71,11 @@ export class ListPage { ...@@ -70,11 +71,11 @@ export class ListPage {
selectPageMenu(index) { selectPageMenu(index) {
const data = { const data = {
state:index +1 state: index + 1
}; };
this.appService.ObserverHttpGet('/wisdomgroup/modules/question/findByState',data) this.appService.ObserverHttpGet('/wisdomgroup/modules/question/findByState', data)
.subscribe( .subscribe(
(res:Response)=>{ (res: Response) => {
this.contentList = res.json(); this.contentList = res.json();
} }
); );
...@@ -93,64 +94,74 @@ export class ListPage { ...@@ -93,64 +94,74 @@ export class ListPage {
//显示问卷操作 //显示问卷操作
showOpra(item){ showOpra(item) {
this.temp = item; this.temp = item;
this.showOp = true; this.showOp = true;
} }
//创建 //创建
create(){ create() {
// this.showOp = false;
this.navCtrl.push('DesicrPage'); this.navCtrl.push('DesicrPage');
} }
//查看 //查看
look(){ look() {
this.showOp = false; this.showOp = false;
this.navCtrl.push('EditPage',{temp:this.temp}); this.navCtrl.push('EditPage', {temp: this.temp});
} }
//设为过期 //设为过期
overDue(){ overDue() {
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/outdate/',this.temp.id) this.appService.alert('确定将该问卷设为过期吗',(res)=>{
.subscribe((res)=>{ this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/outdate/', this.temp.id)
.subscribe((res) => {
this.appService.popToastView('问卷状态已更新','middle',1000);
this.selectPageMenu(this.swiperIndex); this.selectPageMenu(this.swiperIndex);
}) })
})
} }
//发布 //发布
release(){ release() {
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/submit/',this.temp.id) this.appService.alert('确定发布该问卷吗',
.subscribe((res)=>{ (res) => {
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/submit/', this.temp.id)
.subscribe((res) => {
this.appService.popToastView('发布成功','middle',1000);
this.selectPageMenu(this.swiperIndex); this.selectPageMenu(this.swiperIndex);
}) })
} }
)
}
//结果 //结果
result(){ result() {
this.showOp = false; this.showOp = false;
this.navCtrl.push('ResultPage'); this.navCtrl.push('ResultPage');
} }
//复制 //复制
copy(){ copy() {
this.appService.ObserverHttpGetOption('/wisdomgroup/modules/question/copyQuestion',{id:this.temp.id}) this.appService.ObserverHttpGetOption('/wisdomgroup/modules/question/copyQuestion', {id: this.temp.id})
.subscribe((res)=>{ .subscribe((res) => {
this.selectPageMenu(this.swiperIndex); this.selectPageMenu(this.swiperIndex);
}) })
} }
//删除 //删除
delete(){ delete() {
this.appService.ObserverHttpGet('/wisdomgroup/modules/question/delete',{id:this.temp.id}) this.appService.alert('确定删除该问卷吗',(res)=>{
.subscribe((res)=>{ this.appService.ObserverHttpGet('/wisdomgroup/modules/question/delete', {id: this.temp.id})
console.log(res); .subscribe((res) => {
this.appService.popToastView('删除成功','middle',1000);
this.selectPageMenu(0); this.selectPageMenu(0);
this.showOp = false; this.showOp = false;
}) })
})
} }
cancle(){ cancle() {
this.showOp = false; this.showOp = false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment