提交 f9aa3bf8 authored 作者: lihuihui's avatar lihuihui
...@@ -21,19 +21,9 @@ export default { ...@@ -21,19 +21,9 @@ export default {
}, },
methods: { methods: {
getCourseList() { getCourseList() {
this.$toast.loading({ api.getCourseList().then(response => {
duration: 0,
message: '加载中...',
forbidClick: true
})
api
.getCourseList()
.then(response => {
this.courseList = response this.courseList = response
}) })
.finally(() => {
this.$toast.clear()
})
} }
}, },
beforeMount() { beforeMount() {
......
<template> <template>
<div class="main-container" v-if="loaded"> <div class="main-container" v-if="loaded">
<div class="course-title">{{detail.course_name}}</div> <div class="course-title">{{detail.course_name}}</div>
<van-tabs class="main-tabs" v-model="tabActive" color="#2b7ce9" :line-height="2"> <van-tabs
class="main-tabs"
v-model="tabActive"
color="#2b7ce9"
:line-height="2"
:swipeable="true"
>
<van-tab title="课程学习"> <van-tab title="课程学习">
<course-chapter :courseId="courseId" :data="detail.chapters"></course-chapter> <course-chapter :courseId="courseId" :data="detail.chapters"></course-chapter>
</van-tab> </van-tab>
...@@ -39,15 +45,8 @@ export default { ...@@ -39,15 +45,8 @@ export default {
methods: { methods: {
// 课程学习 // 课程学习
getCourse() { getCourse() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourse(this.courseId).then(response => {
.getCourse(this.courseId)
.then(response => {
this.loaded = true this.loaded = true
response.chapters = response.chapters.filter(item => { response.chapters = response.chapters.filter(item => {
item.children = item.children.filter( item.children = item.children.filter(
...@@ -60,9 +59,6 @@ export default { ...@@ -60,9 +59,6 @@ export default {
}) })
this.detail = response this.detail = response
}) })
.finally(() => {
this.$toast.clear()
})
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -61,14 +61,7 @@ export default { ...@@ -61,14 +61,7 @@ export default {
methods: { methods: {
// 获取知识点列表 // 获取知识点列表
getCourseTagList() { getCourseTagList() {
this.$toast.loading({ api.getCourseTagList(this.courseId).then(response => {
duration: 0,
message: '加载中...',
forbidClick: true
})
api
.getCourseTagList(this.courseId)
.then(response => {
this.$emit('ready', response) this.$emit('ready', response)
this.detail = response this.detail = response
this.messageList = response.chapters.map((item, index) => { this.messageList = response.chapters.map((item, index) => {
...@@ -80,9 +73,6 @@ export default { ...@@ -80,9 +73,6 @@ export default {
} }
}) })
}) })
.finally(() => {
this.$toast.clear()
})
}, },
// 输入搜索 // 输入搜索
onSearch() { onSearch() {
......
...@@ -57,21 +57,11 @@ export default { ...@@ -57,21 +57,11 @@ export default {
methods: { methods: {
// 获取知识点详情 // 获取知识点详情
getCourseTag(tagId) { getCourseTag(tagId) {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourseTag(tagId || this.tagId).then(response => {
.getCourseTag(tagId || this.tagId)
.then(response => {
this.loaded = true this.loaded = true
this.detail = response this.detail = response
}) })
.finally(() => {
this.$toast.clear()
})
}, },
// 去知识点考试页面 // 去知识点考试页面
toExamPage() { toExamPage() {
......
...@@ -57,21 +57,11 @@ export default { ...@@ -57,21 +57,11 @@ export default {
methods: { methods: {
// 获取知识点列表 // 获取知识点列表
getCourseTagList() { getCourseTagList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
this.loaded = false this.loaded = false
api api.getCourseTagList(this.courseId).then(response => {
.getCourseTagList(this.courseId)
.then(response => {
this.loaded = true this.loaded = true
this.detail = response this.detail = response
}) })
.finally(() => {
this.$toast.clear()
})
}, },
onClick({ id }) { onClick({ id }) {
const path = `/exam/answer?type=2&tag_id=${id}&papersUrl=zy/v2/examination/course-papers` const path = `/exam/answer?type=2&tag_id=${id}&papersUrl=zy/v2/examination/course-papers`
......
...@@ -104,6 +104,12 @@ export default { ...@@ -104,6 +104,12 @@ export default {
.tag-message-content { .tag-message-content {
font-size: 13px; font-size: 13px;
line-height: 30px; line-height: 30px;
::v-deep img {
max-width: 100%;
}
::v-deep b {
font-weight: bold;
}
} }
.more { .more {
padding-top: 10px; padding-top: 10px;
......
...@@ -75,19 +75,9 @@ export default { ...@@ -75,19 +75,9 @@ export default {
methods: { methods: {
// 获取课程试听列表 // 获取课程试听列表
getCourseList() { getCourseList() {
this.$toast.loading({ api.getFreeCourseList().then(response => {
duration: 0,
message: '加载中...',
forbidClick: true
})
api
.getFreeCourseList()
.then(response => {
this.courseList = response this.courseList = response
}) })
.finally(() => {
this.$toast.clear()
})
}, },
// 搜索 // 搜索
toSearch() { toSearch() {
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
v-model="tabActive" v-model="tabActive"
color="#2b7ce9" color="#2b7ce9"
:line-height="2" :line-height="2"
:animated="true"
:swipeable="true"
@click="onTabClick" @click="onTabClick"
> >
<van-tab title="知识点" name="0"> <van-tab title="知识点" name="0">
......
<template> <template>
<div class="main-list" v-show="loaded"> <div class="main-list" v-show="loaded">
<template v-if="list.length"> <template v-if="dataList.length">
<ul> <ul>
<li v-for="item in list" :key="item.id" @click="onClick(item)"> <li v-for="item in dataList" :key="item.id" @click="onClick(item)">
<div class="pic"> <div class="pic">
<img :src="item.url" /> <img :src="item.url" />
<div class="cover"></div> <div class="cover"></div>
...@@ -49,6 +49,12 @@ export default { ...@@ -49,6 +49,12 @@ export default {
computed: { computed: {
isWeapp() { isWeapp() {
return this.$store.state.isWeapp return this.$store.state.isWeapp
},
// 过滤空视频
dataList() {
return this.list.filter(
item => item.resource_id !== '6684350363920760832'
)
} }
}, },
methods: { methods: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论