|
|
|
@ -21,13 +21,13 @@ |
|
|
|
|
<cover-view class="chapterName">{{ item.name }}</cover-view> |
|
|
|
|
<cover-view class="section" v-if="item.subsectionList.length"> |
|
|
|
|
<cover-view v-for="(section, j) in item.subsectionList" :key="j"class="sectionName" :class="{ active: curRow.id === section.id }" @click="secClick(section, item)"> |
|
|
|
|
<cover-image v-if="section.fileType === 'pptx'" class="ext" src="https://izhixinyun.com/images/exts/ppt.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'mp4'" class="ext" src="https://izhixinyun.com/images/exts/video.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-if="section.fileType === 'pptx'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/ppt.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'mp4'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/video.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'doc' || section.fileType === 'docx'" class="ext" |
|
|
|
|
src="https://izhixinyun.com/images/exts/word.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'txt'" class="ext" src="https://izhixinyun.com/images/exts/txt.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'pdf'" class="ext" src="https://izhixinyun.com/images/exts/pdf.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else class="ext" src="https://izhixinyun.com/images/exts/pic.png" alt="" mode="widthFix" /> |
|
|
|
|
src="https://eduvessel.com/images/occupationlab/exts/word.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'txt'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/txt.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else-if="section.fileType === 'pdf'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/pdf.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-image v-else class="ext" src="https://eduvessel.com/images/occupationlab/exts/pic.png" alt="" mode="widthFix" /> |
|
|
|
|
<cover-view class="text">{{ section.name }}</cover-view> |
|
|
|
|
</cover-view> |
|
|
|
|
</cover-view> |
|
|
|
@ -49,8 +49,6 @@ |
|
|
|
|
|
|
|
|
|
<!-- 课程目录 --> |
|
|
|
|
<view v-show="curTab === 1"> |
|
|
|
|
<uni-search-bar class="search" radius="30" placeholder="请输入章节名称" v-model="keyword" clearButton="auto" cancelButton="none" /> |
|
|
|
|
|
|
|
|
|
<view v-if="chapterList.length" class="chapters"> |
|
|
|
|
<view class="chapter" v-for="(item, i) in chapterList" :key="i"> |
|
|
|
|
<view class="chapterName"> |
|
|
|
@ -59,13 +57,13 @@ |
|
|
|
|
</view> |
|
|
|
|
<view :class="['section', {shrink: item.shrink}]" v-if="item.subsectionList.length"> |
|
|
|
|
<view v-for="(section, j) in item.subsectionList" :key="j"class="sectionName" :class="{ active: curRow.id === section.id }" @click="secClick(section, item)"> |
|
|
|
|
<image v-if="section.fileType === 'pptx'" class="ext" src="https://izhixinyun.com/images/exts/ppt.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'mp4'" class="ext" src="https://izhixinyun.com/images/exts/video.png" alt=""> |
|
|
|
|
<image v-if="section.fileType === 'pptx'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/ppt.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'mp4'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/video.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'doc' || section.fileType === 'docx'" class="ext" |
|
|
|
|
src="https://izhixinyun.com/images/exts/word.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'txt'" class="ext" src="https://izhixinyun.com/images/exts/txt.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'pdf'" class="ext" src="https://izhixinyun.com/images/exts/pdf.png" alt=""> |
|
|
|
|
<image v-else class="ext" src="https://izhixinyun.com/images/exts/pic.png" alt=""> |
|
|
|
|
src="https://eduvessel.com/images/occupationlab/exts/word.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'txt'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/txt.png" alt=""> |
|
|
|
|
<image v-else-if="section.fileType === 'pdf'" class="ext" src="https://eduvessel.com/images/occupationlab/exts/pdf.png" alt=""> |
|
|
|
|
<image v-else class="ext" src="https://eduvessel.com/images/occupationlab/exts/pic.png" alt=""> |
|
|
|
|
{{ section.name }} |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -106,12 +104,13 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { queryChaptersAndSubsections, curriculumDetail, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth } from '@/apis/modules/course.js' |
|
|
|
|
import { queryChaptersAndSubsections, detailsOfGoods, queryPracticeByStudent, queryAssessmentByStudent, getPlayAuth, playRecordSave } from '@/apis/modules/course.js' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
cid: '', |
|
|
|
|
mallId: '', |
|
|
|
|
startTime: Date.now(), // 页面进来的时间 |
|
|
|
|
curTab: 1, |
|
|
|
|
tabs: [ |
|
|
|
|
{ |
|
|
|
@ -209,6 +208,17 @@ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onUnload () { |
|
|
|
|
console.log('hide fn') |
|
|
|
|
// 记录播放时长 |
|
|
|
|
if (this.cid) { |
|
|
|
|
playRecordSave({ |
|
|
|
|
courseId: this.cid, |
|
|
|
|
courseType: 0, |
|
|
|
|
playTime: Math.ceil((Date.now() - this.startTime) / 1000 / 60) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
const pages = getCurrentPages() |
|
|
|
|
const { options } = pages[pages.length - 1] |
|
|
|
@ -223,20 +233,20 @@ |
|
|
|
|
if (this.cid) { |
|
|
|
|
const res = await queryChaptersAndSubsections({ |
|
|
|
|
keyword: this.keyword, |
|
|
|
|
courseId: this.courseId, |
|
|
|
|
courseId: this.cid, |
|
|
|
|
}) |
|
|
|
|
this.chapterList = res.chapterList |
|
|
|
|
// if (this.chapterList.length && this.chapterList[0].subsectionList && this.chapterList[0].subsectionList.length && !this.commentId) { |
|
|
|
|
// this.preview(this.chapterList[0].subsectionList[0], this.chapterList[0].name, 1); |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 获取介绍 |
|
|
|
|
async getInfo () { |
|
|
|
|
if (this.cid && this.mallId) { |
|
|
|
|
const { data } = await curriculumDetail(this.cid, this.mallId) |
|
|
|
|
this.coverUrl = data.coverUrl |
|
|
|
|
this.briefIntroduction = data.briefIntroduction |
|
|
|
|
if (this.mallId) { |
|
|
|
|
const res = await detailsOfGoods({ |
|
|
|
|
mallId: this.mallId |
|
|
|
|
}) |
|
|
|
|
const e = res.orderDetails.mall |
|
|
|
|
this.coverUrl = e.coverDrawing |
|
|
|
|
this.briefIntroduction = e.detailedIntroduction |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 练习成绩 |
|
|
|
@ -389,6 +399,9 @@ |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|
page { |
|
|
|
|
background-color: #fff; |
|
|
|
|
} |
|
|
|
|
.file-wrap { |
|
|
|
|
position: relative; |
|
|
|
|
.pic, .video { |
|
|
|
@ -556,7 +569,9 @@ |
|
|
|
|
.item { |
|
|
|
|
position: relative; |
|
|
|
|
padding: 20rpx 0; |
|
|
|
|
border-bottom: 1px solid #e6e6e6; |
|
|
|
|
&:not(:last-child) { |
|
|
|
|
border-bottom: 1px solid #e6e6e6; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.c-name { |
|
|
|
|
font-size: 32rpx; |
|
|
|
|