|
@@ -1,28 +1,37 @@
|
|
|
<template>
|
|
|
<div style="overflow: hidden">
|
|
|
<m-header v-if="headerStatus" />
|
|
|
+ <div class="course-header">
|
|
|
+ <div class="title-info">
|
|
|
+ <span class="teachMode" v-if="teachMode">
|
|
|
+ {{ teachMode == 'ONLINE' ? '线上' : null }}
|
|
|
+ {{ teachMode == 'OFFLINE' ? '线下' : null }}
|
|
|
+ </span>
|
|
|
+ <span :class="['courseType', classType]">{{ classType | coursesType }}</span>
|
|
|
+ <span style="font-size: .18rem; font-weight: 500; color: #333;line-height: 18px;vertical-align: middle;">{{ classGroupName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="title-time">
|
|
|
+ {{ classTimer }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<van-cell-group>
|
|
|
- <van-cell title="课程班名称" :value="classGroupName" />
|
|
|
- <van-cell title="课程类型">
|
|
|
- <template #default>
|
|
|
- {{ classType | coursesType }}
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- <van-cell title="上课时间" :value="classTimer" />
|
|
|
- <van-cell title="乐器" :value="subjectNames" />
|
|
|
+ <div class="dot"></div>
|
|
|
+ <!-- v-if="enableAssignHomework" -->
|
|
|
+ <van-cell class="input" :is-link="!isAssignHomework ? true : false" title="课后训练" :value='isAssignHomework ? "已布置" : "未布置"' @click="onWork()"></van-cell>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
|
<div class="dot"></div>
|
|
|
<van-field
|
|
|
required
|
|
|
- rows="4"
|
|
|
+ rows="3"
|
|
|
class="textarea"
|
|
|
v-model="teachingMaterial"
|
|
|
maxlength="255"
|
|
|
autosize
|
|
|
label="教材内容"
|
|
|
type="textarea"
|
|
|
- placeholder="请输入(1-255字)"
|
|
|
+ placeholder="请输入本课程学习内容"
|
|
|
+ show-word-limit
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group>
|
|
@@ -38,7 +47,7 @@
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
<!-- <van-cell-group >
|
|
|
-
|
|
|
+
|
|
|
</van-cell-group> -->
|
|
|
<!-- label="评价备注" -->
|
|
|
<van-cell-group>
|
|
@@ -52,6 +61,7 @@
|
|
|
<van-rate
|
|
|
v-model="pronunciation"
|
|
|
:size="25"
|
|
|
+ color="#F7B500"
|
|
|
void-color="#eee"
|
|
|
void-icon="star"
|
|
|
/>
|
|
@@ -60,6 +70,7 @@
|
|
|
<span class="text">节奏</span>
|
|
|
<van-rate
|
|
|
:size="25"
|
|
|
+ color="#F7B500"
|
|
|
void-color="#eee"
|
|
|
v-model="tempo"
|
|
|
void-icon="star"
|
|
@@ -70,6 +81,7 @@
|
|
|
<van-rate
|
|
|
:size="25"
|
|
|
v-model="musicTheory"
|
|
|
+ color="#F7B500"
|
|
|
void-color="#eee"
|
|
|
void-icon="star"
|
|
|
/>
|
|
@@ -77,14 +89,15 @@
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
<van-field
|
|
|
- rows="4"
|
|
|
+ rows="3"
|
|
|
required
|
|
|
class="textarea"
|
|
|
maxlength="255"
|
|
|
v-model="memo"
|
|
|
autosize
|
|
|
type="textarea"
|
|
|
- placeholder="请输入(1-255字)"
|
|
|
+ placeholder="请输入本课程学习内容"
|
|
|
+ show-word-limit
|
|
|
/>
|
|
|
</van-cell-group>
|
|
|
<van-cell-group v-if="classType != 'VIP'">
|
|
@@ -100,25 +113,12 @@
|
|
|
</van-cell-group>
|
|
|
|
|
|
<div class="button-group" v-if="!reviewId">
|
|
|
- <van-button type="primary" round size="large" @click="submitReview"
|
|
|
- >提交评价</van-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="button-group btn-operation" v-if="reviewId">
|
|
|
- <van-button
|
|
|
- type="primary"
|
|
|
- :disabled="homeWork ? true : false"
|
|
|
- v-if="enableAssignHomework"
|
|
|
- round
|
|
|
- @click="onWork(isAssignHomework)"
|
|
|
- >{{ homeWork ? "已布置作业" : "布置作业" }}</van-button
|
|
|
- >
|
|
|
- <van-button type="primary" round class="btn-plain" @click="submitReview"
|
|
|
- >修改评价</van-button
|
|
|
- >
|
|
|
+ <van-button type="primary" round size="large" @click="submitReview">
|
|
|
+ {{ !reviewId ? '提交评价' : '修改评价' }}
|
|
|
+ </van-button>
|
|
|
</div>
|
|
|
|
|
|
- <van-popup v-model="showWork">
|
|
|
+ <!-- <van-popup v-model="showWork">
|
|
|
<van-icon class="closeable" @click="onClose" name="cross" />
|
|
|
<div class="popup_container">
|
|
|
<p class="content">
|
|
@@ -133,7 +133,7 @@
|
|
|
<span @click="onWork(0)">布置作业</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </van-popup>
|
|
|
+ </van-popup> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
courseReviewAdd,
|
|
|
getReviewInfo,
|
|
|
updateReviewInfo,
|
|
|
- checkeIsAssignHomework,
|
|
|
+ checkeIsAssignHomework
|
|
|
} from "@/api/teacher";
|
|
|
import { browser } from "@/common/common";
|
|
|
import MHeader from "@/components/MHeader";
|
|
@@ -153,13 +153,14 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
headerStatus: true,
|
|
|
- showWork: false, // 是否布置作业
|
|
|
+ // showWork: false, // 是否布置作业
|
|
|
radio: 1,
|
|
|
voice: 0,
|
|
|
courseId: null,
|
|
|
reviewId: null,
|
|
|
classTimer: null,
|
|
|
classGroupName: null,
|
|
|
+ teachMode: null,
|
|
|
classType: null, // 课程类型
|
|
|
teachingMaterial: null, //教材
|
|
|
song: null, // 曲目
|
|
@@ -168,7 +169,6 @@ export default {
|
|
|
musicTheory: null, // 乐理
|
|
|
memo: null, // 备注
|
|
|
homeWork: null, // 作业
|
|
|
- handHomework: null, // 是否完成作业
|
|
|
hasLiaison: null,
|
|
|
subjectNames: null,
|
|
|
// isReset: false,
|
|
@@ -178,7 +178,7 @@ export default {
|
|
|
memberStatus: 0, // 是否有学生或者乐团是会员
|
|
|
};
|
|
|
},
|
|
|
- created() {
|
|
|
+ async mounted() {
|
|
|
let params = this.$route.query;
|
|
|
if (params.Authorization) {
|
|
|
localStorage.setItem("Authorization", decodeURI(params.Authorization));
|
|
@@ -190,27 +190,35 @@ export default {
|
|
|
if (!this.courseId) {
|
|
|
this.$toast("课程信息错误");
|
|
|
}
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- let params = this.$route.query;
|
|
|
- if (params.Authorization) {
|
|
|
- localStorage.setItem("Authorization", decodeURI(params.Authorization));
|
|
|
- localStorage.setItem("userInfo", decodeURI(params.Authorization));
|
|
|
- }
|
|
|
if (browser().android || browser().iPhone) {
|
|
|
this.headerStatus = false;
|
|
|
}
|
|
|
+ this.$toast.loading({
|
|
|
+ message: "加载中...",
|
|
|
+ duration: 10000,
|
|
|
+ forbidClick: true,
|
|
|
+ loadingType: "spinner",
|
|
|
+ });
|
|
|
+ await checkeIsAssignHomework({ courseScheduleId: this.courseId }).then((res) => {
|
|
|
+ let result = res.data;
|
|
|
+ if (result.code == 200) {
|
|
|
+ let tempData = result.data || {}
|
|
|
+ this.isAssignHomework = tempData.isAssignHomework;
|
|
|
+ this.enableAssignHomework = tempData.enableAssignHomework;
|
|
|
+ const memberNum = tempData.memberNum;
|
|
|
+ const courseStudentNum = tempData.courseStudentNum;
|
|
|
+ if(courseStudentNum == memberNum) {
|
|
|
+ this.memberStatus = 1
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.$toast(result.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
// 获取头部信息
|
|
|
if (this.reviewId) {
|
|
|
// 获取老评价
|
|
|
- this.$toast.loading({
|
|
|
- message: "加载中...",
|
|
|
- duration: 10000,
|
|
|
- forbidClick: true,
|
|
|
- loadingType: "spinner",
|
|
|
- });
|
|
|
- getReviewInfo({ id: this.reviewId }).then((res) => {
|
|
|
- this.$toast.clear();
|
|
|
+ await getReviewInfo({ id: this.reviewId }).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
let result = res.data.data;
|
|
|
let teacherClassHeadInfo = result.teacherClassHeadInfo;
|
|
@@ -221,6 +229,7 @@ export default {
|
|
|
teacherClassHeadInfo.endClassTime;
|
|
|
this.subjectNames = teacherClassHeadInfo.subjectNames;
|
|
|
this.classGroupName = teacherClassHeadInfo.classGroupName;
|
|
|
+ this.teachMode = teacherClassHeadInfo.teachMode
|
|
|
this.classType = teacherClassHeadInfo.courseScheduleType;
|
|
|
|
|
|
// 评价内容
|
|
@@ -233,11 +242,10 @@ export default {
|
|
|
this.memo = courseScheduleReview.memo;
|
|
|
this.homeWork = courseScheduleReview.homeWork;
|
|
|
this.hasLiaison = courseScheduleReview.hasLiaison.toString();
|
|
|
- this.handHomework = courseScheduleReview.handHomework.toString();
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- getCourseInfoHead({ courseId: this.courseId }).then((res) => {
|
|
|
+ await getCourseInfoHead({ courseId: this.courseId }).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
let result = res.data.data;
|
|
|
this.classTimer =
|
|
@@ -247,26 +255,27 @@ export default {
|
|
|
result.endClassTime;
|
|
|
this.subjectNames = result.subjectNames;
|
|
|
this.classGroupName = result.classGroupName;
|
|
|
+ this.teachMode = result.teachMode
|
|
|
this.classType = result.courseScheduleType;
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
- checkeIsAssignHomework({ courseScheduleId: this.courseId }).then((res) => {
|
|
|
- let result = res.data;
|
|
|
- if (result.code == 200) {
|
|
|
- let tempData = result.data || {}
|
|
|
- this.isAssignHomework = tempData.isAssignHomework;
|
|
|
- this.enableAssignHomework = tempData.enableAssignHomework;
|
|
|
- // const courseViewType = tempData.courseViewType || 0;
|
|
|
- const memberNum = tempData.memberNum;
|
|
|
- const courseStudentNum = tempData.courseStudentNum;
|
|
|
- if(courseStudentNum == memberNum) {
|
|
|
- this.memberStatus = 1
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.$toast(result.msg);
|
|
|
+
|
|
|
+ // 只有添加的时候才会有缓存数据
|
|
|
+ let courseEvaluationObj = sessionStorage.getItem('courseEvaluationObj')
|
|
|
+ courseEvaluationObj = courseEvaluationObj ? JSON.parse(courseEvaluationObj) : null
|
|
|
+ sessionStorage.removeItem('courseEvaluationObj')
|
|
|
+ if(courseEvaluationObj) {
|
|
|
+ this.teachingMaterial = courseEvaluationObj.teachingMaterial
|
|
|
+ this.song = courseEvaluationObj.song
|
|
|
+ this.pronunciation = courseEvaluationObj.pronunciation
|
|
|
+ this.tempo = courseEvaluationObj.tempo
|
|
|
+ this.musicTheory = courseEvaluationObj.musicTheory
|
|
|
+ this.memo = courseEvaluationObj.memo
|
|
|
+ this.hasLiaison = courseEvaluationObj.hasLiaison
|
|
|
+ this.courseId = courseEvaluationObj.courseId
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
+ this.$toast.clear();
|
|
|
},
|
|
|
methods: {
|
|
|
submitReview() {
|
|
@@ -279,7 +288,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
if (!this.memo) {
|
|
|
- this.$toast("请输入备注");
|
|
|
+ this.$toast("请输入本课程学习内容");
|
|
|
return;
|
|
|
}
|
|
|
// VIP课程是没有双向沟通的
|
|
@@ -294,9 +303,7 @@ export default {
|
|
|
tempo: this.tempo, //节奏
|
|
|
musicTheory: this.musicTheory, // 乐理
|
|
|
memo: this.memo, // 备注
|
|
|
- // homeWork: this.homeWork,
|
|
|
hasLiaison: this.hasLiaison,
|
|
|
- handHomework: this.handHomework,
|
|
|
courseScheduleId: this.courseId,
|
|
|
};
|
|
|
if (this.reviewId) {
|
|
@@ -314,48 +321,65 @@ export default {
|
|
|
} else {
|
|
|
courseReviewAdd(obj).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
- if (this.enableAssignHomework) {
|
|
|
- this.showWork = true;
|
|
|
- } else {
|
|
|
- this.$toast("提交成功");
|
|
|
- setTimeout((res) => {
|
|
|
- if (this.isInside) {
|
|
|
- this.$router.push({ path: "/manageEvaluation" });
|
|
|
- } else {
|
|
|
- this.onAppBack();
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
+ this.$toast("提交成功");
|
|
|
+ setTimeout((res) => {
|
|
|
+ if (this.isInside) {
|
|
|
+ this.$router.push({ path: "/manageEvaluation" });
|
|
|
+ } else {
|
|
|
+ this.onAppBack();
|
|
|
+ }
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- onWork(isAssignHomework) {
|
|
|
- if (isAssignHomework == 1) {
|
|
|
+ onWork() {
|
|
|
+ const obj = {
|
|
|
+ teachingMaterial: this.teachingMaterial, //教材
|
|
|
+ song: this.song, // 曲目
|
|
|
+ pronunciation: this.pronunciation, // 发音
|
|
|
+ tempo: this.tempo, //节奏
|
|
|
+ musicTheory: this.musicTheory, // 乐理
|
|
|
+ memo: this.memo, // 备注
|
|
|
+ hasLiaison: this.hasLiaison,
|
|
|
+ handHomework: this.handHomework,
|
|
|
+ courseScheduleId: this.courseId,
|
|
|
+ }
|
|
|
+ if(this.isAssignHomework == 1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.enableAssignHomework == 1) {
|
|
|
this.$dialog
|
|
|
.confirm({
|
|
|
message: "您课程所在周已经布置作业,是否继续布置?",
|
|
|
confirmButtonText: "布置作业",
|
|
|
+ confirmButtonColor: '#01C1B5'
|
|
|
})
|
|
|
.then(() => {
|
|
|
// on confirm
|
|
|
- this.$router.replace({
|
|
|
+ sessionStorage.setItem('courseEvaluationObj', JSON.stringify(obj))
|
|
|
+ this.$router.push({
|
|
|
path: "/arrangeWork",
|
|
|
query: {
|
|
|
courseId: this.courseId,
|
|
|
- memberNum: this.memberStatus
|
|
|
- },
|
|
|
+ memberNum: this.memberStatus,
|
|
|
+ classGroupName: this.classGroupName,
|
|
|
+ ...this.$route.query
|
|
|
+ }
|
|
|
});
|
|
|
})
|
|
|
.catch(() => {
|
|
|
// on cancel
|
|
|
});
|
|
|
} else {
|
|
|
- this.$router.replace({
|
|
|
+ sessionStorage.setItem('courseEvaluationObj', JSON.stringify(obj))
|
|
|
+ this.$router.push({
|
|
|
path: "/arrangeWork",
|
|
|
query: {
|
|
|
courseId: this.courseId,
|
|
|
- memberNum: this.memberStatus
|
|
|
+ memberNum: this.memberStatus,
|
|
|
+ classGroupName: this.classGroupName,
|
|
|
+ ...this.$route.query
|
|
|
},
|
|
|
});
|
|
|
}
|
|
@@ -387,7 +411,7 @@ export default {
|
|
|
@import url("../../assets/commonLess/variable.less");
|
|
|
|
|
|
/deep/.van-cell-group {
|
|
|
- margin-top: 0.15rem;
|
|
|
+ margin-top: 0.1rem;
|
|
|
}
|
|
|
/deep/.van-cell {
|
|
|
padding: 16px 16px;
|
|
@@ -417,7 +441,7 @@ export default {
|
|
|
/deep/.van-field__control,
|
|
|
/deep/.van-cell__value {
|
|
|
font-size: 16px;
|
|
|
- color: #666;
|
|
|
+ color: #1A1A1A !important;
|
|
|
width: 70%;
|
|
|
flex: auto;
|
|
|
}
|
|
@@ -429,6 +453,9 @@ export default {
|
|
|
width: 100%;
|
|
|
}
|
|
|
}
|
|
|
+.input {
|
|
|
+ padding:16px .21rem;
|
|
|
+}
|
|
|
.twoConnect {
|
|
|
width: 55%;
|
|
|
}
|
|
@@ -473,6 +500,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.course-header {
|
|
|
+ margin-top: .1rem;
|
|
|
+ background: #fff;
|
|
|
+ padding: 16px 0.21rem 16px .12rem;
|
|
|
+ .title-info {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
+ .title-time {
|
|
|
+ color: #a1a1a1;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.van-popup {
|
|
|
width: 90%;
|
|
|
border-radius: 0.05rem;
|
|
@@ -530,7 +569,7 @@ export default {
|
|
|
background: #01c1b5;
|
|
|
border-radius: 3px;
|
|
|
position: absolute;
|
|
|
- z-index: 200;
|
|
|
+ z-index: 98;
|
|
|
top: 19px;
|
|
|
left: 0.12rem;
|
|
|
}
|
|
@@ -563,4 +602,16 @@ textarea:-ms-input-placeholder {
|
|
|
color: #777 !important;
|
|
|
font-size: .14rem;
|
|
|
}
|
|
|
+
|
|
|
+.teachMode {
|
|
|
+ background: #F2FFFC;
|
|
|
+ border-radius: .03rem;
|
|
|
+ border: 1px solid #01C1B5;
|
|
|
+ font-size: 12px;
|
|
|
+ color: #01C1B5;
|
|
|
+ display: inline-block;
|
|
|
+ // height: 16px;
|
|
|
+ line-height: 16px;
|
|
|
+ padding: 0 5px;
|
|
|
+}
|
|
|
</style>
|