课程说明云点播
This commit is contained in:
@@ -45,11 +45,13 @@
|
||||
<text >课程观看有效期截止到:2025-06-14 00:00 </text><uni-tag type="primary" text="继续学习"></uni-tag>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" v-for="(item, index) in courseList" :key="index" @click="chooseChapter(item, index)">
|
||||
<text>{{item.title}}</text>
|
||||
|
||||
<uni-tag v-if="librayList[curIndex].isBuy == 1 && item.isLearned == 0" style="" :inverted="true" text="未学"
|
||||
size="mini" type="primary" />
|
||||
<uni-tag v-if="librayList[curIndex].isBuy == 1 && item.isLearned == 1" style="" :inverted="true" text="已学"
|
||||
size="mini" type="primary" />
|
||||
</view>
|
||||
<!-- <view class="showAll zhezhe" v-show="fold">
|
||||
<view class="flexbox icon" @click="tozhankai()"><u-icon class="icon_item" name="arrow-left-double"
|
||||
@@ -82,6 +84,16 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-divider v-else text="暂无数据"></u-divider>
|
||||
<!-- <view class="">
|
||||
<view class="" v-for="(item, index) in librayList" :key="index">
|
||||
<view class="">
|
||||
|
||||
</view>
|
||||
<view class="">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<uni-section class="mb-10 completionBg" title="学习进度" type="line" v-if="librayList.length > 0 && librayList[curIndex].completion > 0">
|
||||
<view class="progress-box">
|
||||
<progress :percent="librayList[curIndex].completion" show-info stroke-width="3" />
|
||||
@@ -605,11 +617,15 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
.then( res => {
|
||||
if (res.code == 0) {
|
||||
this.course = res.data.course
|
||||
this.pageTitle = this.course.title
|
||||
this.librayList = res.data.catalogues
|
||||
// this.librayList.map(async item => {
|
||||
// item.courseList = await this.getChapters(item.id)
|
||||
// })
|
||||
// console.log(this.librayList,'this.librayList')
|
||||
if (this.librayList.length > 0) {
|
||||
this.catalogueId = this.librayList[0].id
|
||||
this.curId = this.librayList[0].id
|
||||
@@ -628,6 +644,7 @@
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
goBuy() {
|
||||
$http.request({
|
||||
url: "sociology/product/getProductListForCourse",
|
||||
@@ -706,6 +723,33 @@
|
||||
tozhankai() {
|
||||
this.fold = false
|
||||
},
|
||||
async getChapters(id) {
|
||||
let list = []
|
||||
await $http.request({
|
||||
url: "sociology/course/getCourseCatalogueChapterList",
|
||||
method: "POST", // POST、GET、PUT、DELETE,具体说明查看官方文档
|
||||
data: {
|
||||
"id": id
|
||||
},
|
||||
header: { //默认 无 说明:请求头
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
})
|
||||
.then(res => {
|
||||
if (res.code == 0) {
|
||||
if (res.chapterList.length > 0) {
|
||||
list = res.chapterList
|
||||
// console.log('status', res)
|
||||
} else {
|
||||
list = []
|
||||
}
|
||||
}
|
||||
|
||||
}).catch(e => {
|
||||
console.log(e, '获取章节列表数据报错')
|
||||
});
|
||||
return list
|
||||
},
|
||||
getChapterList(id) {
|
||||
$http.request({
|
||||
url: "sociology/course/getCourseCatalogueChapterList",
|
||||
|
||||
Reference in New Issue
Block a user