|
@@ -82,9 +82,9 @@
|
|
|
<span :style="activeId === items.onlyId ? 'color:red;' : ''">
|
|
|
{{ items.menuName }}
|
|
|
</span>
|
|
|
- <span v-if="items.type === 3" class="itemsty"
|
|
|
- >{{ $methodsTools.secondToDate(items.durationTime,false)}}</span
|
|
|
- >
|
|
|
+ <span v-if="items.type === 3" class="itemsty">{{
|
|
|
+ $methodsTools.secondToDate(items.durationTime, false)
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<template v-if="items.checked">
|
|
|
<div
|
|
@@ -112,9 +112,9 @@
|
|
|
>
|
|
|
{{ its.menuName }}
|
|
|
</span>
|
|
|
- <span v-if="its.type === 3" class="itemsty"
|
|
|
- >{{ $methodsTools.secondToDate(its.durationTime,false)}}</span
|
|
|
- >
|
|
|
+ <span v-if="its.type === 3" class="itemsty">{{
|
|
|
+ $methodsTools.secondToDate(its.durationTime, false)
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<template v-if="its.checked">
|
|
|
<div
|
|
@@ -134,9 +134,12 @@
|
|
|
>
|
|
|
{{ itschild.menuName }}
|
|
|
</span>
|
|
|
- <span class="itemsty"
|
|
|
- >{{ $methodsTools.secondToDate(itschild.durationTime,false)}}</span
|
|
|
- >
|
|
|
+ <span class="itemsty">{{
|
|
|
+ $methodsTools.secondToDate(
|
|
|
+ itschild.durationTime,
|
|
|
+ false
|
|
|
+ )
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -158,6 +161,7 @@
|
|
|
import searchBoxNew from "@/components/searchBoxNew";
|
|
|
import tableList from "@/components/tableList";
|
|
|
import pagination from "@/components/pagination";
|
|
|
+import { login } from "../../../../api/login";
|
|
|
export default {
|
|
|
name: "CourseInquiryList",
|
|
|
components: { searchBoxNew, tableList, pagination },
|
|
@@ -193,8 +197,8 @@ export default {
|
|
|
edu: "educationTypeId",
|
|
|
},
|
|
|
{
|
|
|
- prop: "goodsName",
|
|
|
- placeholder: "请输入商品名称",
|
|
|
+ prop: "searchKey",
|
|
|
+ placeholder: "请输入商品编码/商品名称",
|
|
|
},
|
|
|
],
|
|
|
formData: {
|
|
@@ -249,7 +253,7 @@ export default {
|
|
|
label: "视频节数量",
|
|
|
prop: "sectionNum",
|
|
|
hidden: true,
|
|
|
- width:'100px'
|
|
|
+ width: "100px",
|
|
|
},
|
|
|
{
|
|
|
label: "学习有效期",
|
|
@@ -341,12 +345,142 @@ export default {
|
|
|
* 点击详情
|
|
|
*/
|
|
|
msgInfo(option) {
|
|
|
- this.$api.obtainCourseSgoodsId(option.goodsId).then((res) => {
|
|
|
- res.rows.forEach((item) => {
|
|
|
- item.checked = false;
|
|
|
- });
|
|
|
- this.courseList = res.rows;
|
|
|
- this.dialogVisible = true;
|
|
|
+ this.$api.obtainCourseSgoodsId(option.goodsId).then(async (res) => {
|
|
|
+ if (res.rows.length) {
|
|
|
+ res.rows.forEach((item, index) => {
|
|
|
+ item.checked = false;
|
|
|
+ });
|
|
|
+ this.courseList = res.rows;
|
|
|
+ await this.autoGetCourseInfos(res.rows[0], 0);
|
|
|
+ this.dialogVisible = true;
|
|
|
+ } else {
|
|
|
+ this.$message.warning("该商品暂无课程");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 自动播放第一个视频
|
|
|
+ */
|
|
|
+ autoGetCourseInfos(option, int) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$api
|
|
|
+ .inquireCoursemenuListS({ courseId: option.courseId })
|
|
|
+ .then((res) => {
|
|
|
+ res.rows.forEach((item) => {
|
|
|
+ if (item.type !== 3) {
|
|
|
+ item.checked = false;
|
|
|
+ }
|
|
|
+ if (item.type === 3) {
|
|
|
+ item.onlyId = `${option.courseId}-0-0-${item.menuId}`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(this.courseList[int], "children", res.rows);
|
|
|
+ this.$set(this.courseList[int], "checked", true);
|
|
|
+ if (this.courseList[0].children.length) {
|
|
|
+ switch (this.courseList[0].children[0].type) {
|
|
|
+ case 1:
|
|
|
+ this.$api
|
|
|
+ .inquireCourseListmodulechapter(
|
|
|
+ this.courseList[0].children[0].menuId
|
|
|
+ )
|
|
|
+ .then((resz) => {
|
|
|
+ resz.data.forEach((item) => {
|
|
|
+ if (item.type !== 3) {
|
|
|
+ item.checked = false;
|
|
|
+ item.type = 2;
|
|
|
+ item.courseId =
|
|
|
+ this.courseList[0].children[0].courseId;
|
|
|
+ item.menuName = item.name;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0],
|
|
|
+ "children",
|
|
|
+ resz.data
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0],
|
|
|
+ "checked",
|
|
|
+ true
|
|
|
+ );
|
|
|
+ if (this.courseList[int].children[0].children.length) {
|
|
|
+ this.$api
|
|
|
+ .inquireCoursechaptersectionlist(
|
|
|
+ this.courseList[0].children[0].children[0].chapterId
|
|
|
+ )
|
|
|
+ .then((result) => {
|
|
|
+ result.data.forEach((item) => {
|
|
|
+ item.type = 3;
|
|
|
+ item.menuName = item.name;
|
|
|
+ item.onlyId = `${this.courseList[0].children[0].children[0].courseId}-${this.courseList[0].children[0].children[0].moduleId}-${this.courseList[0].children[0].children[0].chapterId}-${item.sectionId}`;
|
|
|
+ });
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0].children[0],
|
|
|
+ "children",
|
|
|
+ result.data
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0].children[0],
|
|
|
+ "checked",
|
|
|
+ true
|
|
|
+ );
|
|
|
+ if (
|
|
|
+ this.courseList[int].children[0].children[0]
|
|
|
+ .children.length
|
|
|
+ ) {
|
|
|
+ this.activeId =
|
|
|
+ this.courseList[0].children[0].children[0].children[0].onlyId;
|
|
|
+ this.initVideo(
|
|
|
+ this.courseList[0].children[0].children[0]
|
|
|
+ .children[0]
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ this.$api
|
|
|
+ .inquireCoursechaptersectionlist(
|
|
|
+ this.courseList[0].children[0].menuId
|
|
|
+ )
|
|
|
+ .then((result) => {
|
|
|
+ result.data.forEach((item) => {
|
|
|
+ item.type = 3;
|
|
|
+ item.menuName = item.name;
|
|
|
+ item.onlyId = `${this.courseList[0].children[0].courseId}-0-${this.courseList[0].children[0].menuId}-${item.sectionId}`;
|
|
|
+ });
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0],
|
|
|
+ "children",
|
|
|
+ result.data
|
|
|
+ );
|
|
|
+ this.$set(
|
|
|
+ this.courseList[int].children[0],
|
|
|
+ "checked",
|
|
|
+ true
|
|
|
+ );
|
|
|
+ if (this.courseList[0].children[0].children.length) {
|
|
|
+ this.activeId =
|
|
|
+ this.courseList[0].children[0].children[0].onlyId;
|
|
|
+ this.initVideo(
|
|
|
+ this.courseList[0].children[0].children[0]
|
|
|
+ );
|
|
|
+ }
|
|
|
+ });
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ this.activeId = this.courseList[0].children[0].onlyId;
|
|
|
+ this.initVideo(this.courseList[0].children[0]);
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
});
|
|
|
},
|
|
|
/**
|