|
|
@@ -93,254 +93,26 @@
|
|
|
</Course-tree>
|
|
|
</template>
|
|
|
<template v-if="tab.name == '3'">
|
|
|
- <div class="answer-question">
|
|
|
- <div class="answer-question__header clearfix">
|
|
|
- <div class="textarea-wrap">
|
|
|
- <el-input
|
|
|
- class="textarea"
|
|
|
- resize="none"
|
|
|
- v-model="textarea"
|
|
|
- rows="3"
|
|
|
- type="textarea"
|
|
|
- placeholder="请输入"
|
|
|
- maxlength="1000"
|
|
|
- show-word-limit
|
|
|
- ></el-input>
|
|
|
- </div>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="submit"
|
|
|
- @click="addAnswer"
|
|
|
- >提出疑问</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div class="answer-question__body">
|
|
|
- <div class="question-list">
|
|
|
- <div
|
|
|
- v-if="answerList.length == 0"
|
|
|
- style="
|
|
|
- text-align: center;
|
|
|
- color: #cccccc;
|
|
|
- margin-top: 14px;
|
|
|
- "
|
|
|
- >
|
|
|
- 暂无记录
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="question-list__item"
|
|
|
- v-for="(item, index) in answerList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div class="question-list__item__avatar">
|
|
|
- <img
|
|
|
- v-if="item.assignRealname"
|
|
|
- :src="
|
|
|
- $tools.splitImgHost(item.assignAvatar)
|
|
|
- "
|
|
|
- alt=""
|
|
|
- />
|
|
|
- <img
|
|
|
- v-else
|
|
|
- :src="$tools.splitImgHost(item.avatar)"
|
|
|
- alt=""
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="question-list__item__content">
|
|
|
- <div class="nickname">
|
|
|
- {{ item.realname }}
|
|
|
- </div>
|
|
|
- <div class="desc">
|
|
|
- {{ item.answerText }}
|
|
|
- </div>
|
|
|
- <div class="time">
|
|
|
- {{
|
|
|
- $tools.timestampToTime(
|
|
|
- item.createTime,
|
|
|
- false
|
|
|
- )
|
|
|
- }}
|
|
|
-
|
|
|
- <div
|
|
|
- class="del"
|
|
|
- v-if="item.userId !== userInfo.userId"
|
|
|
- @click="answerBack(item)"
|
|
|
- >
|
|
|
- <el-button type="text"
|
|
|
- >回复</el-button
|
|
|
- >
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="del"
|
|
|
- style="color: red"
|
|
|
- @click="del(item)"
|
|
|
- v-if="item.userId === userInfo.userId"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="reply-list"
|
|
|
- v-if="
|
|
|
- item.newArraysAnswerList &&
|
|
|
- item.newArraysAnswerList.length
|
|
|
- "
|
|
|
- >
|
|
|
- <div
|
|
|
- class="reply-list__item"
|
|
|
- v-for="(
|
|
|
- items, indexs
|
|
|
- ) in item.newArraysAnswerList"
|
|
|
- :key="indexs"
|
|
|
- >
|
|
|
- <div class="reply-list__item__avatar">
|
|
|
- <img
|
|
|
- :src="
|
|
|
- $tools.splitImgHost(
|
|
|
- items.avatar
|
|
|
- )
|
|
|
- "
|
|
|
- alt=""
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="reply-list__item__content"
|
|
|
- >
|
|
|
- <div class="nickname">
|
|
|
- {{ items.realname }}
|
|
|
- </div>
|
|
|
- <div class="desc">
|
|
|
- 回复
|
|
|
- <span
|
|
|
- style="
|
|
|
- margin: 0px 4px;
|
|
|
- color: #409eff;
|
|
|
- "
|
|
|
- >@{{
|
|
|
- items.assignRealname
|
|
|
- }}</span
|
|
|
- >
|
|
|
- <span style="color: #ccc">{{
|
|
|
- items.answerText
|
|
|
- }}</span>
|
|
|
- </div>
|
|
|
- <div class="time">
|
|
|
- {{
|
|
|
- $tools.timestampToTime(
|
|
|
- items.createTime,
|
|
|
- false
|
|
|
- )
|
|
|
- }}
|
|
|
- <div
|
|
|
- class="del"
|
|
|
- style="color: red"
|
|
|
- @click="del(items)"
|
|
|
- v-if="
|
|
|
- items.userId ===
|
|
|
- userInfo.userId
|
|
|
- "
|
|
|
- >
|
|
|
- 删除
|
|
|
- </div>
|
|
|
- <div
|
|
|
- class="reply"
|
|
|
- v-if="
|
|
|
- items.userId !==
|
|
|
- userInfo.userId
|
|
|
- "
|
|
|
- @click="answerBack(items)"
|
|
|
- >
|
|
|
- 回复
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <Answer-questions
|
|
|
+ ref="answerQuestions"
|
|
|
+ :goodsId="goodsId"
|
|
|
+ :courseId="courseId"
|
|
|
+ :orderGoodsId="orderGoodsId"
|
|
|
+ ></Answer-questions>
|
|
|
</template>
|
|
|
<template v-if="tab.name == '4'">
|
|
|
- <div class="lecture-notes">
|
|
|
- <div class="lecture-notes__content clearfix">
|
|
|
- <div class="left-boxs">
|
|
|
- <div
|
|
|
- class="textarea clearfix"
|
|
|
- v-if="!(isPlayRebuild > 0) && !vidzb"
|
|
|
- >
|
|
|
- <el-input
|
|
|
- resize="none"
|
|
|
- rows="3"
|
|
|
- v-model="textareaNote"
|
|
|
- type="textarea"
|
|
|
- maxlength="1000"
|
|
|
- show-word-limit
|
|
|
- placeholder="觉得重要的就记下来吧~"
|
|
|
- ></el-input>
|
|
|
- <el-button
|
|
|
- type="primary"
|
|
|
- class="submit"
|
|
|
- @click="noteSubmit"
|
|
|
- >
|
|
|
- 提交笔记
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="note-list">
|
|
|
- <div
|
|
|
- v-if="noteList.length == 0"
|
|
|
- style="
|
|
|
- text-align: center;
|
|
|
- color: #cccccc;
|
|
|
- margin-top: 14px;
|
|
|
- "
|
|
|
- >
|
|
|
- 暂无笔记
|
|
|
- </div>
|
|
|
-
|
|
|
- <div
|
|
|
- class="note-list__content"
|
|
|
- v-for="(item, index) in noteList"
|
|
|
- :key="index"
|
|
|
- >
|
|
|
- <div
|
|
|
- v-for="(note, index) in item.userNotes"
|
|
|
- :key="index"
|
|
|
- class="user_notes"
|
|
|
- >
|
|
|
- <p class="p1">
|
|
|
- <i
|
|
|
- class="el-icon-video-camera"
|
|
|
- style="margin-right: 8px"
|
|
|
- ></i
|
|
|
- >{{
|
|
|
- $tools.secondToDate(note.noteSecond)
|
|
|
- }}
|
|
|
- <span>{{
|
|
|
- $tools.timestampToTime(
|
|
|
- note.createTime,
|
|
|
- false,
|
|
|
- false
|
|
|
- )
|
|
|
- }}</span>
|
|
|
- </p>
|
|
|
- <p class="p2">{{ note.noteText }}</p>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- <div class="pagination">
|
|
|
- <el-pagination
|
|
|
- background
|
|
|
- layout="prev, pager, next"
|
|
|
- :total="noteTotal"
|
|
|
- :page-size="noteParams.pageSize"
|
|
|
- >
|
|
|
- </el-pagination>
|
|
|
- </div> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <Notes
|
|
|
+ ref="notes"
|
|
|
+ :gradeId="gradeId"
|
|
|
+ :goodsId="goodsId"
|
|
|
+ :courseId="courseId"
|
|
|
+ :moduleId="moduleId"
|
|
|
+ :chapterId="chapterId"
|
|
|
+ :isPlayRebuild="isPlayRebuild"
|
|
|
+ :playSectionId="playSectionId"
|
|
|
+ :vidzb="vidzb"
|
|
|
+ :player="player"
|
|
|
+ ></Notes>
|
|
|
</template>
|
|
|
<template v-if="tab.name == '5'">
|
|
|
<div class="lecture-notesjy">
|
|
|
@@ -1493,7 +1265,9 @@ import GoodsItem from "@/components/goodsItem/index";
|
|
|
import * as imageConversion from "image-conversion";
|
|
|
import { mapGetters, mapMutations, mapActions } from "vuex";
|
|
|
import pdf from "vue-pdf";
|
|
|
-import CourseTree from "@/components/courseTree/CourseTree.vue";
|
|
|
+import CourseTree from "./components/CourseTree.vue";
|
|
|
+import AnswerQuestions from "./components/AnswerQuestions.vue";
|
|
|
+import Notes from "./components/Notes.vue";
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
components: {
|
|
|
@@ -1503,6 +1277,8 @@ export default {
|
|
|
pdf,
|
|
|
GoodsItem,
|
|
|
CourseTree,
|
|
|
+ AnswerQuestions,
|
|
|
+ Notes,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -1546,6 +1322,7 @@ export default {
|
|
|
courseId: "",
|
|
|
courseTabIndex: "1",
|
|
|
goodsId: "",
|
|
|
+ orderGoodsId: "",
|
|
|
gradeId: "",
|
|
|
livingTimer: null,
|
|
|
sectionItem: {},
|
|
|
@@ -1973,7 +1750,7 @@ export default {
|
|
|
},
|
|
|
handleClick(tab) {
|
|
|
if (tab.name == "3") {
|
|
|
- this.getAnswerList(); //答疑列表
|
|
|
+ this.$refs.answerQuestions[0].getAnswerList(); //答疑列表
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
@@ -3648,8 +3425,8 @@ export default {
|
|
|
this.playerzb = "";
|
|
|
this.vidzb = "";
|
|
|
this.nowTime = Number(new Date().getTime() / 1000).toFixed(0);
|
|
|
- this.getAnswerList(); //答疑列表
|
|
|
- this.getNoteList(); //获取节笔记
|
|
|
+ this.$refs.answerQuestions[0].getAnswerList(); //答疑列表
|
|
|
+ this.$refs.notes[0].getNoteList(); //获取节笔记
|
|
|
resolve();
|
|
|
});
|
|
|
},
|
|
|
@@ -3894,7 +3671,7 @@ export default {
|
|
|
this.playSectionId = option.sectionId || option.menuId;
|
|
|
await this.getPhotoLastRecord();
|
|
|
this.recordObj = await this.getRecordLast();
|
|
|
- this.getNoteList();
|
|
|
+ this.$refs.notes[0].getNoteList();
|
|
|
await this.clears();
|
|
|
|
|
|
this.vid = option.recordingUrl;
|
|
|
@@ -3929,7 +3706,7 @@ export default {
|
|
|
// console.log(this.moduleId, this.chapterId, this.playSectionId);
|
|
|
await this.getPhotoLastRecord();
|
|
|
this.recordObj = await this.getRecordLast();
|
|
|
- this.getNoteList();
|
|
|
+ this.$refs.notes[0].getNoteList();
|
|
|
//设置播放的节ID
|
|
|
await this.clears();
|
|
|
this.vidzb = option.liveUrl;
|
|
|
@@ -4828,27 +4605,6 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- /**
|
|
|
- * 获取笔记列表
|
|
|
- */
|
|
|
- getNoteList() {
|
|
|
- let self = this;
|
|
|
- self.noteList = [];
|
|
|
- let data = {
|
|
|
- courseId: this.courseId,
|
|
|
- gradeId: this.gradeId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- // pageNum: this.noteParams.pageNum,
|
|
|
- // pageSize: this.noteParams.pageSize,
|
|
|
- };
|
|
|
- if (this.playSectionId > 0) {
|
|
|
- data.sectionId = this.playSectionId;
|
|
|
- }
|
|
|
- this.$request.noteList(data).then((res) => {
|
|
|
- self.noteList = res.rows;
|
|
|
- self.noteTotal = res.total;
|
|
|
- });
|
|
|
- },
|
|
|
|
|
|
noteClick(note) {
|
|
|
if (this.vid) {
|
|
|
@@ -4923,109 +4679,6 @@ export default {
|
|
|
this.businessData = res.data;
|
|
|
});
|
|
|
},
|
|
|
- /**提出答疑 */
|
|
|
- addAnswer() {
|
|
|
- if (!this.textarea) {
|
|
|
- this.$message.warning("请输入疑问内容");
|
|
|
- return;
|
|
|
- }
|
|
|
- let data = {
|
|
|
- courseId: this.courseId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- answerText: this.textarea,
|
|
|
- };
|
|
|
- this.$request.addAnswer(data).then((res) => {
|
|
|
- this.textarea = "";
|
|
|
- this.getAnswerList();
|
|
|
- });
|
|
|
- },
|
|
|
- /**回复 */
|
|
|
- answerBack(row) {
|
|
|
- this.$prompt(`${row.realname}:${row.answerText}`, "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- inputErrorMessage: "输入不能为空",
|
|
|
- inputValidator: (value) => {
|
|
|
- let str = value.replace(/^ +| +$/g, "");
|
|
|
- // 点击按钮时,对文本框里面的值进行验证
|
|
|
- if (!str) {
|
|
|
- return "输入不能为空";
|
|
|
- }
|
|
|
- },
|
|
|
- })
|
|
|
- .then(({ value }) => {
|
|
|
- let data = {
|
|
|
- assignUserId: row.userId,
|
|
|
- assignAnswerId: row.answerId,
|
|
|
- courseId: this.courseId,
|
|
|
- goodsId: this.goodsId,
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
- answerText: value,
|
|
|
- assignAnswerText: row.assignAnswerText,
|
|
|
- };
|
|
|
- this.$request.addAnswer(data).then((res) => {
|
|
|
- this.getAnswerList();
|
|
|
- });
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- },
|
|
|
- getAnswerList() {
|
|
|
- let self = this;
|
|
|
- // /app/answer/list 查询答疑列表
|
|
|
- this.$request
|
|
|
- .answerList({ courseId: this.courseId, goodsId: this.goodsId })
|
|
|
- .then((res) => {
|
|
|
- let data1 = [];
|
|
|
- let data2 = [];
|
|
|
- let copydata2 = [];
|
|
|
- res.rows.forEach((item) => {
|
|
|
- if (!item.assignAnswerId) {
|
|
|
- data1.push(item);
|
|
|
- } else {
|
|
|
- data2.push(item);
|
|
|
- copydata2.push(item);
|
|
|
- }
|
|
|
- });
|
|
|
- data2.forEach((item, index) => {
|
|
|
- //回复层
|
|
|
- data1.forEach((items) => {
|
|
|
- //提问层
|
|
|
- if (items.answerId === item.assignAnswerId) {
|
|
|
- if (
|
|
|
- items.newArraysAnswerList &&
|
|
|
- items.newArraysAnswerList.length
|
|
|
- ) {
|
|
|
- items.newArraysAnswerList.push(item);
|
|
|
- } else {
|
|
|
- items.newArraysAnswerList = [item];
|
|
|
- }
|
|
|
- let indexInd = copydata2.findIndex((itemsxs) => {
|
|
|
- return itemsxs.answerId === item.answerId;
|
|
|
- });
|
|
|
- if (indexInd !== -1) {
|
|
|
- copydata2.splice(indexInd, 1);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- copydata2.forEach((it) => {
|
|
|
- for (let i = 0; i < data1.length; i++) {
|
|
|
- let STATUS = null;
|
|
|
- if (data1[i].newArraysAnswerList) {
|
|
|
- STATUS = data1[i].newArraysAnswerList.some((items) => {
|
|
|
- return items.answerId === it.assignAnswerId;
|
|
|
- });
|
|
|
- }
|
|
|
- if (STATUS) {
|
|
|
- data1[i].newArraysAnswerList.push(it);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- self.answerList = data1.reverse();
|
|
|
- });
|
|
|
- },
|
|
|
courseCourseList() {
|
|
|
return new Promise((resolve) => {
|
|
|
this.$request
|
|
|
@@ -5139,22 +4792,10 @@ export default {
|
|
|
message: "发布成功",
|
|
|
type: "success",
|
|
|
});
|
|
|
- self.getNoteList();
|
|
|
+ self.$refs.notes[0].getNoteList();
|
|
|
this.textareaNote = "";
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
- del(item) {
|
|
|
- console.log(item);
|
|
|
- let data = { answerId: item.answerId, status: -1 };
|
|
|
- this.$request.delAnswer(data).then((res) => {
|
|
|
- this.$message({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- this.getAnswerList();
|
|
|
- });
|
|
|
- },
|
|
|
/**
|
|
|
* 打印
|
|
|
*/
|