|
@@ -16,7 +16,7 @@
|
|
|
>
|
|
|
</h4>
|
|
|
<div v-for="(item, index) in courseList" :key="index">
|
|
|
- <p class="firstTop" @click="changeStatus(item)">
|
|
|
+ <p class="firstTop hoverStyle" @click="changeStatus(item)">
|
|
|
<span class="iconStyle">课</span
|
|
|
><span class="titles">{{ item.courseName }}</span
|
|
|
><span class="showHide"
|
|
@@ -30,7 +30,7 @@
|
|
|
<template v-for="(items, indexs) in item.children">
|
|
|
<div v-if="items.type === 1" :key="indexs">
|
|
|
<p
|
|
|
- class="moduleStyle"
|
|
|
+ class="moduleStyle hoverStyle"
|
|
|
@click="changeModuleStatus(items, index, indexs)"
|
|
|
>
|
|
|
{{ items.menuName }}
|
|
@@ -52,10 +52,10 @@
|
|
|
style="padding-left: 20px"
|
|
|
>
|
|
|
<div
|
|
|
- class="chapterStyle"
|
|
|
+ class="chapterStyle hoverStyle"
|
|
|
@click="changeChapterStatus(2, i, index, indexs, k)"
|
|
|
>
|
|
|
- <span class="iconStyle">章</span>
|
|
|
+ <!-- <span class="iconStyle">章</span> -->
|
|
|
{{ i.name }}
|
|
|
<span class="showHide"
|
|
|
><i v-if="i.showStatus" class="el-icon-arrow-up"></i>
|
|
@@ -65,14 +65,23 @@
|
|
|
<template v-if="i.showStatus && i.children.length > 0">
|
|
|
<div
|
|
|
v-for="(is, ks) in i.children"
|
|
|
- class="sectionStyle"
|
|
|
+ class="sectionStyle hoverStyleSection"
|
|
|
:key="ks"
|
|
|
style="padding-left: 20px"
|
|
|
>
|
|
|
<el-row style="display: flex; align-items: center">
|
|
|
<el-col :span="12">
|
|
|
<span class="iconStyles">•</span>
|
|
|
- {{ is.name }}
|
|
|
+ <span class="upStudyStyle sizeStyle">{{
|
|
|
+ is.sectionType === 1
|
|
|
+ ? "录播"
|
|
|
+ : is.sectionType === 2
|
|
|
+ ? "直播"
|
|
|
+ : is.sectionType === 3
|
|
|
+ ? "回放"
|
|
|
+ : "练习"
|
|
|
+ }}</span>
|
|
|
+ <span class="span_style">{{ is.name }}</span>
|
|
|
<span v-if="is.recordStatus" class="upStudyStyle"
|
|
|
>上次学到</span
|
|
|
>
|
|
@@ -100,10 +109,15 @@
|
|
|
}}
|
|
|
</span>
|
|
|
</el-col>
|
|
|
- <el-col :span="2" :offset="1">
|
|
|
+ <el-col
|
|
|
+ :span="2"
|
|
|
+ :offset="1"
|
|
|
+ v-if="is.sectionType != 2"
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
+ style="width: 90px !important"
|
|
|
v-if="
|
|
|
is.studyDuration > 0 &&
|
|
|
is.durationTime > 0 &&
|
|
@@ -115,6 +129,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
v-else-if="
|
|
|
is.studyDuration > 0 &&
|
|
|
is.durationTime > 0 &&
|
|
@@ -126,12 +141,46 @@
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="primary"
|
|
|
+ style="width: 90px !important"
|
|
|
plain
|
|
|
v-else-if="
|
|
|
is.studyDuration == 0 && is.durationTime > 0
|
|
|
"
|
|
|
@click="studyFunc(item, is)"
|
|
|
>未开始</el-button
|
|
|
+ > </el-col
|
|
|
+ ><el-col :span="2" :offset="1" v-else>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="success"
|
|
|
+ style="width: 90px !important"
|
|
|
+ v-if="is.liveStartTime > sysTime"
|
|
|
+ @click="studyFunc(item, is)"
|
|
|
+ >未开播</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="danger"
|
|
|
+ style="width: 90px !important"
|
|
|
+ v-else-if="is.liveEndTime < sysTime"
|
|
|
+ @click="studyFunc(item, is)"
|
|
|
+ >已结束</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ style="width: 90px !important;text-align:center;"
|
|
|
+ v-else-if="
|
|
|
+ is.liveEndTime > sysTime &&
|
|
|
+ is.liveStartTime < sysTime
|
|
|
+ "
|
|
|
+ @click="studyFunc(item, is)"
|
|
|
+ >进入直播间</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -142,10 +191,10 @@
|
|
|
</div>
|
|
|
<div v-if="items.type === 2" :key="indexs">
|
|
|
<div
|
|
|
- class="chapterStyle"
|
|
|
+ class="chapterStyle hoverStyle"
|
|
|
@click="changeChapterStatus(1, items, index, indexs)"
|
|
|
>
|
|
|
- <span class="iconStyle">章</span>
|
|
|
+ <!-- <span class="iconStyle">章</span> -->
|
|
|
{{ items.menuName }}
|
|
|
<span class="showHide"
|
|
|
><i v-if="items.showStatus" class="el-icon-arrow-up"></i>
|
|
@@ -155,14 +204,25 @@
|
|
|
<template v-if="items.showStatus && items.children.length > 0">
|
|
|
<div
|
|
|
v-for="(i, k) in items.children"
|
|
|
- class="sectionStyle"
|
|
|
+ class="sectionStyle hoverStyleSection"
|
|
|
:key="k"
|
|
|
style="padding-left: 20px"
|
|
|
>
|
|
|
<el-row style="display: flex; align-items: center">
|
|
|
<el-col :span="12">
|
|
|
<span class="iconStyles">•</span>
|
|
|
- {{ i.name }}
|
|
|
+ <span class="upStudyStyle sizeStyle">{{
|
|
|
+ i.sectionType === 1
|
|
|
+ ? "录播"
|
|
|
+ : i.sectionType === 2
|
|
|
+ ? "直播"
|
|
|
+ : i.sectionType === 3
|
|
|
+ ? "回放"
|
|
|
+ : "练习"
|
|
|
+ }}</span>
|
|
|
+ <span class="span_style">
|
|
|
+ {{ i.name }}
|
|
|
+ </span>
|
|
|
<span v-if="i.recordStatus" class="upStudyStyle"
|
|
|
>上次学到</span
|
|
|
>
|
|
@@ -188,10 +248,11 @@
|
|
|
}}
|
|
|
</span>
|
|
|
</el-col>
|
|
|
- <el-col :span="2" :offset="1">
|
|
|
+ <el-col :span="2" :offset="1" v-if="i.sectionType != 2">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
+ style="width: 90px !important"
|
|
|
v-if="
|
|
|
i.studyDuration > 0 &&
|
|
|
i.durationTime > 0 &&
|
|
@@ -203,6 +264,7 @@
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
v-else-if="
|
|
|
i.studyDuration > 0 &&
|
|
|
i.durationTime > 0 &&
|
|
@@ -215,20 +277,69 @@
|
|
|
size="mini"
|
|
|
plain
|
|
|
type="primary"
|
|
|
+ style="width: 90px !important"
|
|
|
v-else-if="i.studyDuration == 0 && i.durationTime > 0"
|
|
|
@click="studyFunc(item, i)"
|
|
|
>未开始</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
+ <el-col :span="2" :offset="1" v-else>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="success"
|
|
|
+ v-if="i.liveStartTime > sysTime"
|
|
|
+ @click="studyFunc(item, i)"
|
|
|
+ >未开播</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="danger"
|
|
|
+ v-else-if="i.liveEndTime < sysTime"
|
|
|
+ @click="studyFunc(item, i)"
|
|
|
+ >已结束</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important;text-align:center;"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ v-else-if="
|
|
|
+ i.liveEndTime > sysTime && i.liveStartTime < sysTime
|
|
|
+ "
|
|
|
+ @click="studyFunc(item, i)"
|
|
|
+ >进入直播间</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
- <div v-if="items.type === 3" :key="indexs" class="sectionStyle">
|
|
|
+ <div
|
|
|
+ v-if="items.type === 3"
|
|
|
+ :key="indexs"
|
|
|
+ class="sectionStyle hoverStyle"
|
|
|
+ >
|
|
|
<el-row style="display: flex; align-items: center">
|
|
|
<el-col :span="12">
|
|
|
<span class="iconStyles">•</span>
|
|
|
- {{ items.menuName }}
|
|
|
+ <span class="upStudyStyle sizeStyle">{{
|
|
|
+ items.sectionType === 1
|
|
|
+ ? "录播"
|
|
|
+ : items.sectionType === 2
|
|
|
+ ? "直播"
|
|
|
+ : items.sectionType === 3
|
|
|
+ ? "回放"
|
|
|
+ : "练习"
|
|
|
+ }}</span>
|
|
|
+ <span class="span_style">
|
|
|
+ {{ items.menuName }}
|
|
|
+ </span>
|
|
|
<span v-if="items.recordStatus" class="upStudyStyle"
|
|
|
>上次学到</span
|
|
|
>
|
|
@@ -256,9 +367,10 @@
|
|
|
}}
|
|
|
</span>
|
|
|
</el-col>
|
|
|
- <el-col :span="2" :offset="1">
|
|
|
+ <el-col :span="2" :offset="1" v-if="items.sectionType != 2">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
type="text"
|
|
|
v-if="
|
|
|
items.studyDuration > 0 &&
|
|
@@ -270,6 +382,7 @@
|
|
|
>
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
+ style="width: 90px !important"
|
|
|
size="mini"
|
|
|
v-else-if="
|
|
|
items.studyDuration > 0 &&
|
|
@@ -280,6 +393,7 @@
|
|
|
>继续学习</el-button
|
|
|
>
|
|
|
<el-button
|
|
|
+ style="width: 90px !important"
|
|
|
plain
|
|
|
size="mini"
|
|
|
type="primary"
|
|
@@ -290,6 +404,40 @@
|
|
|
>未开始</el-button
|
|
|
>
|
|
|
</el-col>
|
|
|
+ <el-col :span="2" :offset="1" v-else>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="success"
|
|
|
+ v-if="items.liveStartTime > sysTime"
|
|
|
+ @click="studyFunc(item, items)"
|
|
|
+ >未开播</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important"
|
|
|
+ plain
|
|
|
+ disabled
|
|
|
+ type="danger"
|
|
|
+ v-else-if="items.liveEndTime < sysTime"
|
|
|
+ @click="studyFunc(item, items)"
|
|
|
+ >已结束</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ style="width: 90px !important;text-align:center;"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ v-else-if="
|
|
|
+ items.liveEndTime > sysTime &&
|
|
|
+ items.liveStartTime < sysTime
|
|
|
+ "
|
|
|
+ @click="studyFunc(item, items)"
|
|
|
+ >进入直播间</el-button
|
|
|
+ >
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -374,6 +522,7 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
comeStyle(courseItem, item) {
|
|
|
+ console.log(item,"itemitem")
|
|
|
this.$router.push({
|
|
|
path: `/my-course-detail/${this.goodsData.goodsId}`,
|
|
|
query: {
|
|
@@ -384,7 +533,10 @@ export default {
|
|
|
moduleId: item.moduleId,
|
|
|
sectionId: item.sectionId || item.menuId,
|
|
|
recordingUrl: item.recordingUrl,
|
|
|
+ liveUrl:item.liveUrl,
|
|
|
sectionType: item.sectionType,
|
|
|
+ liveStartTime:item.liveStartTime,
|
|
|
+ liveEndTime:item.liveEndTime,
|
|
|
},
|
|
|
});
|
|
|
},
|
|
@@ -423,14 +575,14 @@ export default {
|
|
|
this.$request
|
|
|
.courseGoodsList({ orderGoodsId: res.data.orderGoodsId })
|
|
|
.then(async (result) => {
|
|
|
- if(result.rows.length == 0){
|
|
|
- this.resultCourseGoodsList()
|
|
|
- }else{
|
|
|
- let array = result.rows[0];
|
|
|
- array.orderGoodsId = res.data.orderGoodsId;
|
|
|
- this.goodsData = array;
|
|
|
- await this.getGoodsCourseList(array);
|
|
|
- resolve();
|
|
|
+ if (result.rows.length == 0) {
|
|
|
+ this.resultCourseGoodsList();
|
|
|
+ } else {
|
|
|
+ let array = result.rows[0];
|
|
|
+ array.orderGoodsId = res.data.orderGoodsId;
|
|
|
+ this.goodsData = array;
|
|
|
+ await this.getGoodsCourseList(array);
|
|
|
+ resolve();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -550,18 +702,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- this.resultCourseGoodsList()
|
|
|
+ this.resultCourseGoodsList();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- resultCourseGoodsList(){
|
|
|
- this.$request
|
|
|
- .courseGoodsList({ pageNum: 1, pageSize: 1 })
|
|
|
- .then((res) => {
|
|
|
- if (res.rows && res.rows.length > 0) {
|
|
|
- this.backData(res.rows[0]);
|
|
|
- }
|
|
|
- });
|
|
|
+ resultCourseGoodsList() {
|
|
|
+ this.$request.courseGoodsList({ pageNum: 1, pageSize: 1 }).then((res) => {
|
|
|
+ if (res.rows && res.rows.length > 0) {
|
|
|
+ this.backData(res.rows[0]);
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 展开获取课程详情列表
|
|
@@ -672,6 +822,7 @@ export default {
|
|
|
async studyFunc(courseItem, items) {
|
|
|
this.sysTime = this.$tools.timest();
|
|
|
let item = this.goodsData;
|
|
|
+ console.log(item,"学习服务期")
|
|
|
if (item.interfaceAccountId > 0) {
|
|
|
//学习账号已开通
|
|
|
|
|
@@ -797,7 +948,22 @@ export default {
|
|
|
goodsId: item.goodsId,
|
|
|
gradeId: item.gradeId,
|
|
|
})
|
|
|
- .then((res) => {
|
|
|
+ .then(async (res) => {
|
|
|
+ //学习次数是否上限---start
|
|
|
+ let learnNum = await this.goodsTodayStudySectionNum(courseItem);
|
|
|
+ let hasLearn = await this.gradeCheckGoodsStudy(courseItem, items);
|
|
|
+ console.log(learnNum, hasLearn);
|
|
|
+ if (this.goodsData.sectionMaxNum > 0) {
|
|
|
+ if (learnNum >= this.goodsData.sectionMaxNum && !hasLearn) {
|
|
|
+ this.clickLock = false;
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: `每天最多学习${this.goodsData.sectionMaxNum}节`,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //学习次数是否上限---end
|
|
|
if (res.rows.length) {
|
|
|
// this.$emit("backData", item);
|
|
|
// this.dialogVisible = false;
|
|
@@ -820,6 +986,35 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ gradeCheckGoodsStudy(courseItem, option) {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ this.$request
|
|
|
+ .gradeCheckGoodsStudy({
|
|
|
+ goodsId: this.goodsData.goodsId,
|
|
|
+ gradeId: courseItem.gradeId,
|
|
|
+ moduleId: option.moduleId || 0,
|
|
|
+ chapterId: option.chapterId || 0,
|
|
|
+ sectionId: option.sectionId || option.menuId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ resolve(res.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goodsTodayStudySectionNum(option) {
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ this.$request
|
|
|
+ .goodsTodayStudySectionNum({
|
|
|
+ goodsId: this.goodsData.goodsId,
|
|
|
+ gradeId: option.gradeId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ resolve(res.data);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
userConfirmInfoDetail() {
|
|
|
return new Promise((resolve) => {
|
|
|
this.$request
|
|
@@ -942,7 +1137,8 @@ export default {
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
.firstTop {
|
|
|
- margin: 24px 0px;
|
|
|
+ padding: 24px 0px;
|
|
|
+ // margin: 24px 0px;
|
|
|
.iconStyle {
|
|
|
background-color: #3f8dfd;
|
|
|
color: #fff;
|
|
@@ -1015,4 +1211,28 @@ export default {
|
|
|
padding: 3px 4px;
|
|
|
border-radius: 4px;
|
|
|
}
|
|
|
+.sizeStyle {
|
|
|
+ background-color: #fff !important;
|
|
|
+ border-color: #979ea5 !important;
|
|
|
+ color: #979ea5 !important;
|
|
|
+ padding: 2px 3px !important;
|
|
|
+}
|
|
|
+.hoverStyle {
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.2s;
|
|
|
+ &:hover {
|
|
|
+ background-color: #eaf3ff;
|
|
|
+ }
|
|
|
+}
|
|
|
+.hoverStyleSection {
|
|
|
+ transition: all 0.2s;
|
|
|
+ &:hover {
|
|
|
+ background-color: #eaf3ff;
|
|
|
+ }
|
|
|
+}
|
|
|
+.span_style {
|
|
|
+ max-width: 400px;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+}
|
|
|
</style>
|