diff --git a/components/course-homework/course-homework.vue b/components/course-homework/course-homework.vue index ab05ed8..0fd2b46 100644 --- a/components/course-homework/course-homework.vue +++ b/components/course-homework/course-homework.vue @@ -93,7 +93,12 @@ }, watch:{ studyId(newVal){ - this.loadRecord(); + this.loadHomeworkInfo(); + }, + content(newVal,oldVal){ + if(newVal.id!=oldVal.id){ + this.loadHomeworkInfo(); + } } }, methods: { @@ -161,7 +166,6 @@ } let pamars = { - studyItemId: this.studyItemId,//学习内容记录id, studyId: this.studyId,//学习id, courseId: this.content.courseId,//课程id, contentId: this.content.id,//内容id, @@ -172,11 +176,15 @@ hwAnswer: this.answer,//文本提交的信息 score: 0 } + if(this.studyItemId){ + pamars.studyItemId=this.studyItemId;//学习内容记录id, + } apiCourseStudy.saveHomework(pamars).then(res=>{ if(res.status==200){ //this.$refs.messager.show({message:'作业已提交',type:'success'}) uni.showToast({title:'提交成功',type:'success'}) this.filePath=''; + this.fileList=[]; this.answer=''; this.records=[res.result]; this.$emit("submit", this.content); diff --git a/pages/resource/articeDetail.vue b/pages/resource/articeDetail.vue index d1195aa..e059597 100644 --- a/pages/resource/articeDetail.vue +++ b/pages/resource/articeDetail.vue @@ -14,10 +14,11 @@ - + +