Commit 2584ca53 authored by wangqinghua's avatar wangqinghua

color

parent 6bcf8c40
......@@ -7,40 +7,41 @@ import {EditPage} from "../item/edit/edit";
declare var Swiper;
@IonicPage()
@Component({
selector: 'page-list',
templateUrl: 'list.html',
selector: 'page-list',
templateUrl: 'list.html',
})
export class ListPage {
@ViewChild('contentSlides') contentSlides :Slides;
@ViewChild('contentSlides') contentSlides: Slides;
contentList = <any>[
{
datalist:[]
datalist: []
}
];
];
menuList = [
{ name:'草稿箱' },
{ name:'已发布' },
{ name:'已过期' }
{name: '草稿箱'},
{name: '已发布'},
{name: '已过期'}
];
showOp = false;
swiperIndex;
swiper;
temp; //选中的item
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService) {
}
ionViewDidEnter() {
this.initSwiper();
this.selectPageMenu(0);
this.swiperIndex = 0;
}
ionViewDidEnter() {
this.initSwiper();
this.selectPageMenu(0);
this.swiperIndex = 0;
}
initSwiper(){
initSwiper() {
this.swiper = new Swiper('.pageMenuSlides .swiper-container', {
//设置slider容器能够同时显示的slides数量(
slidesPreView: 3,
......@@ -70,12 +71,12 @@ export class ListPage {
selectPageMenu(index) {
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(
(res:Response)=>{
this.contentList = res.json();
(res: Response) => {
this.contentList = res.json();
}
);
this.swiperIndex = index;
......@@ -93,65 +94,75 @@ export class ListPage {
//显示问卷操作
showOpra(item){
this.temp = item;
this.showOp = true;
showOpra(item) {
this.temp = item;
this.showOp = true;
}
//创建
create(){
// this.showOp = false;
create() {
this.navCtrl.push('DesicrPage');
}
//查看
look(){
look() {
this.showOp = false;
this.navCtrl.push('EditPage',{temp:this.temp});
this.navCtrl.push('EditPage', {temp: this.temp});
}
//设为过期
overDue(){
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/outdate/',this.temp.id)
.subscribe((res)=>{
overDue() {
this.appService.alert('确定将该问卷设为过期吗',(res)=>{
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/outdate/', this.temp.id)
.subscribe((res) => {
this.appService.popToastView('问卷状态已更新','middle',1000);
this.selectPageMenu(this.swiperIndex);
})
})
}
//发布
release(){
this.appService.ObserverHttpGetAdd('/wisdomgroup/modules/question/submit/',this.temp.id)
.subscribe((res)=>{
this.selectPageMenu(this.swiperIndex);
})
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);
})
}
)
}
//结果
result(){
result() {
this.showOp = false;
this.navCtrl.push('ResultPage');
this.navCtrl.push('ResultPage');
}
//复制
copy(){
this.appService.ObserverHttpGetOption('/wisdomgroup/modules/question/copyQuestion',{id:this.temp.id})
.subscribe((res)=>{
copy() {
this.appService.ObserverHttpGetOption('/wisdomgroup/modules/question/copyQuestion', {id: this.temp.id})
.subscribe((res) => {
this.selectPageMenu(this.swiperIndex);
})
}
//删除
delete(){
this.appService.ObserverHttpGet('/wisdomgroup/modules/question/delete',{id:this.temp.id})
.subscribe((res)=>{
console.log(res);
this.selectPageMenu(0);
this.showOp = false;
})
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;
})
})
}
cancle(){
this.showOp = false;
cancle() {
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