Newer
Older
import {Component} from '@angular/core';
import {IonicPage, NavController, NavParams, ToastController} from 'ionic-angular';
option_title: '', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0 //序号
];
set = { //设置
lastchange: '1',
morechange: '1',
isAns: '',
more: '100'
};
constructor(public navCtrl: NavController, public navParams: NavParams,
public appService: AppService, public toastCtrl: ToastController) {
}
ionViewDidLoad() {
this.qType = this.navParams.get('type');
this.temp = this.navParams.get('temp');
}
addOption() {
const option = {
option_title: '', //选项文字
canFill: 2, // 1是 2否
isNeed: 1, // 1是 2否
index: 0
}; //序号
this.quesDescList.push(option);
questionId: this.temp.id,
isAns: 1,
quesType: this.qType,
title: this.titile,
limit: 1000, //问答的字数限制
quesDesc: this.quesDescList,
minOps: 0,
maxOps: 0,
index: 0 //序号
console.log(this.temp);
const toast = this.toastCtrl.create(message);
this.appService.ObserverHttpPost('/wisdomgroup/modules/question/saveQuestion', data)
(res) => {
toast.setMessage('添加成功');
toast.present();
setTimeout((res) => {
this.navCtrl.push('EditPage', {
temp: this.temp
});
}, 2000)