const app = getApp(); Page({ data: { }, create_question: function({detail:{value}}){ ; let data = { question_title:value.question_title, question_type:0, question_score:5, question_choices:[value.question_choices_0, value.question_choices_1, value.question_choices_2, value.question_choices_3], standard_answers:value.standard_answers } let exercise_bank_id = this.exercise_id; app.api("exercises.exercise_questions")({exercise_bank_id,...data}) .then(res=>{ ; wx.navigateBack({ delta: 1 }) }).catch(app.showError) }, onLoad: function (options) { this.exercise_id = options.exercise_id; } })