diff --git a/pages/coach/job/add.vue b/pages/coach/job/add.vue index a3cafa3..fdd25a5 100644 --- a/pages/coach/job/add.vue +++ b/pages/coach/job/add.vue @@ -3,7 +3,7 @@ - + @@ -24,6 +24,28 @@ + + + + + + + + 图片作业 + + + + + + 视频作业 + + + + + + + + @@ -130,7 +152,7 @@ export default { course_id: '',//课程id(下拉) course_id_name: '',//课程id(中文名字) - content_type: '',//作业类型(单选)|1图片,2视频 + content_type: '1',//作业类型(单选)|1图片,2视频 content_text: '',//文字作业内容 classes_id: '',//班级id(下拉) @@ -221,7 +243,7 @@ export default { //监听选择器-班级 changeClass(e) { console.log('选择器-班级', e); - this.formData.class_id = e.value; // 更新 class_id + this.formData.classes_id = e.value; // 更新 class_id this.formData.classes_id_name = e.text; // 更新 class_name this.show_class = false; // 关闭选择器 }, @@ -247,7 +269,7 @@ export default { this.show_student = false; // 关闭选择器 }, - //监听选择器-作业类型 + //监听选择器-发布类型 changeType(e) { console.log('选择器-作业类型', e); this.formData.type = e.detail.value; // 更新 type @@ -260,6 +282,13 @@ export default { } }, + //监听选择器-作业类型 + changeContentType(e) { + console.log('选择器-作业类型', e); + this.formData.content_type = e.detail.value; // 更新 type + }, + + //表单验证 async validatorForm(data) { let res = await this.$refs.form.validator(data, rules) return res @@ -269,16 +298,13 @@ export default { async submetForm(){ let data = {...this.formData} console.log('提交',data) - let vf = await this.validatorForm(data) + let vf = await this.validatorForm(data)//表单验证 if(!vf.isPassed){ console.log('验证',vf) return } - - - return - + //发布作业 let res = await memberApi.jlPublishJob(data) if (res.code != 1){ uni.showToast({