|
@@ -48,9 +48,26 @@
|
|
<van-switch v-model="checked" slot="right-icon" size="24" />
|
|
<van-switch v-model="checked" slot="right-icon" size="24" />
|
|
</van-cell>
|
|
</van-cell>
|
|
|
|
|
|
- <van-panel title="评论给所有学生">
|
|
|
|
- <div slot="default" class="content">盼望着,盼望着,东风来了,春天的脚步近了。一切都像刚睡醒的样子,欣欣然张开了眼。山朗润起来了,水涨起来</div>
|
|
|
|
|
|
+ <van-panel title="评论给所有学生" class="evaluation-panel" v-if="checked">
|
|
|
|
+ <div slot="default">
|
|
|
|
+ <van-field rows="3" v-model="contentall" autosize type="textarea" placeholder="请输入1-255字" />
|
|
|
|
+ </div>
|
|
</van-panel>
|
|
</van-panel>
|
|
|
|
+
|
|
|
|
+ <div v-else>
|
|
|
|
+ <van-panel class="evaluation-panel" v-for="(item, index) in students" :key="index">
|
|
|
|
+ <div slot="header" class="van-hairline--bottom" style="display: flex; padding-left: .16rem">
|
|
|
|
+ <div class="header">
|
|
|
|
+ <img v-if="item.avatar" :src="item.avatar" alt="">
|
|
|
|
+ <img v-else src="../../assets/images/app/icon_student.png" alt="">
|
|
|
|
+ {{ item.username }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div slot="default">
|
|
|
|
+ <van-field rows="3" v-model="item.content" autosize type="textarea" placeholder="请输入1-255字" />
|
|
|
|
+ </div>
|
|
|
|
+ </van-panel>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="button-group">
|
|
<div class="button-group">
|
|
@@ -61,6 +78,7 @@
|
|
<script>
|
|
<script>
|
|
import MHeader from '@/components/MHeader'
|
|
import MHeader from '@/components/MHeader'
|
|
import { getStuAndTeaReview, batchAdd } from '@/api/app'
|
|
import { getStuAndTeaReview, batchAdd } from '@/api/app'
|
|
|
|
+import { browser } from '@/common/common'
|
|
export default {
|
|
export default {
|
|
name: 'courseEvaluation',
|
|
name: 'courseEvaluation',
|
|
components: { MHeader },
|
|
components: { MHeader },
|
|
@@ -68,14 +86,15 @@ export default {
|
|
let query = this.$route.query
|
|
let query = this.$route.query
|
|
return {
|
|
return {
|
|
checked: true,
|
|
checked: true,
|
|
- rate: 2,
|
|
|
|
courseId: query.courseId,
|
|
courseId: query.courseId,
|
|
teachingMaterial: null,
|
|
teachingMaterial: null,
|
|
teacherClassHeadInfo: {},
|
|
teacherClassHeadInfo: {},
|
|
- courseScheduleReview: [],
|
|
|
|
- courseScheduleComplaints: [],
|
|
|
|
|
|
+ courseScheduleReview: [], // 学生评价
|
|
|
|
+ courseScheduleComplaints: [], // 老师评价
|
|
courseScheduleReviewList: {},
|
|
courseScheduleReviewList: {},
|
|
- review4StudentIds: {}
|
|
|
|
|
|
+ review4StudentIds: {},
|
|
|
|
+ students: [], // 学生列表
|
|
|
|
+ contentall: null, // 回复内容
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -97,6 +116,10 @@ export default {
|
|
this.courseScheduleComplaints = tempResult.courseScheduleComplaints ? tempResult.courseScheduleComplaints : []
|
|
this.courseScheduleComplaints = tempResult.courseScheduleComplaints ? tempResult.courseScheduleComplaints : []
|
|
this.courseScheduleReviewList = tempResult.courseScheduleReviewList ? tempResult.courseScheduleReviewList : {}
|
|
this.courseScheduleReviewList = tempResult.courseScheduleReviewList ? tempResult.courseScheduleReviewList : {}
|
|
this.review4StudentIds = tempResult.review4StudentIds ? tempResult.review4StudentIds : {}
|
|
this.review4StudentIds = tempResult.review4StudentIds ? tempResult.review4StudentIds : {}
|
|
|
|
+ this.students = tempResult.students ? tempResult.students : []
|
|
|
|
+ tempResult.students.forEach(item => {
|
|
|
|
+ item.content = null
|
|
|
|
+ })
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
this.$toast(result.msg)
|
|
this.$toast(result.msg)
|
|
@@ -104,8 +127,57 @@ export default {
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onSubmit() {
|
|
onSubmit() {
|
|
-
|
|
|
|
|
|
+ let students = this.students
|
|
|
|
+ let params = []
|
|
|
|
+ if(!this.teachingMaterial) {
|
|
|
|
+ this.$toast('请输入教学内容')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(!this.contentall && this.checked) {
|
|
|
|
+ this.$toast('请输入学生评价')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ students.forEach(item => {
|
|
|
|
+ if(!this.checked && !item.content) {
|
|
|
|
+ this.$toast('请输入学生评价')
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ params.push({
|
|
|
|
+ "memo": this.checked ? this.contentall : item.content,
|
|
|
|
+ "courseScheduleId": this.courseId,
|
|
|
|
+ "studentId": item.id,
|
|
|
|
+ "teachingMaterial": this.teachingMaterial
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ this.$toast.loading({
|
|
|
|
+ duration: 0,
|
|
|
|
+ message: '加载中...',
|
|
|
|
+ forbidClick: true,
|
|
|
|
+ loadingType: 'spinner'
|
|
|
|
+ })
|
|
|
|
+ batchAdd(params).then(res => {
|
|
|
|
+ this.$toast.clear()
|
|
|
|
+ let result = res.data
|
|
|
|
+ if(result.code == 200) {
|
|
|
|
+ this.$toast('评价成功')
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ this.onSubmitStatus = true
|
|
|
|
+ if(browser().iPhone) {
|
|
|
|
+ window.webkit.messageHandlers.DAYA.postMessage(JSON.stringify({api: 'back'}))
|
|
|
|
+ } else if(browser().android) {
|
|
|
|
+ DAYA.postMessage(JSON.stringify({api: 'back'}))
|
|
|
|
+ } else {
|
|
|
|
+ this.$router.push('/business')
|
|
|
|
+ }
|
|
|
|
+ }, 500)
|
|
|
|
+ } else {
|
|
|
|
+ this.$toast(result.msg)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ destroyed() {
|
|
|
|
+ this.$toast.clear()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
@@ -210,11 +282,24 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.evaluation-panel {
|
|
|
|
+ padding: 0;
|
|
|
|
+ margin-top: .15rem;
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
+ /deep/.van-cell {
|
|
|
|
+ padding: .1rem .16rem;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
.button-group {
|
|
.button-group {
|
|
margin: .3rem .26rem .2rem;
|
|
margin: .3rem .26rem .2rem;
|
|
.van-button--primary {
|
|
.van-button--primary {
|
|
background: @mColor;
|
|
background: @mColor;
|
|
font-size: .18rem;
|
|
font-size: .18rem;
|
|
}
|
|
}
|
|
|
|
+ /deep/.van-field__control {
|
|
|
|
+ font-size: .15rem;
|
|
|
|
+ color: #999;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|