提交 f3f002e6 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 f9dab7db
......@@ -21,8 +21,14 @@ export default {
},
methods: {
getCourseList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getCourseList().then(response => {
this.courseList = response
this.$toast.clear()
})
}
},
......
......@@ -5,7 +5,6 @@
class="main-tabs"
v-model="tabActive"
color="#2b7ce9"
:sticky="true"
:line-height="2"
@click="onTabClick"
>
......@@ -13,10 +12,9 @@
<course-chapter :courseId="courseId" :data="detail.chapters"></course-chapter>
</van-tab>
<van-tab title="知识点速学" name="1">
<course-tag
:courseId="courseId"
style="margin-left:-0.4rem;margin-right:-0.4rem;min-height:100vh;background:#eee;"
></course-tag>
<div class="tab-content">
<course-tag :courseId="courseId"></course-tag>
</div>
</van-tab>
</van-tabs>
</div>
......@@ -42,7 +40,7 @@ export default {
$route: {
immediate: true,
handler(route) {
this.tabActive = route.query.tab || '1'
this.tabActive = route.query.tab || '0'
}
}
},
......@@ -57,12 +55,19 @@ export default {
},
// 课程学习
getCourse() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getCourse(this.courseId).then(response => {
response.chapters = response.chapters.filter(item => {
item.children = item.children.filter(child => child.type === 2)
return item.children.length
})
this.detail = response
this.$toast.clear()
})
}
},
......@@ -77,6 +82,13 @@ export default {
font-size: 15px;
font-weight: 600;
color: #222;
padding: 20px 0 10px;
padding: 20px 20px 10px;
}
.tab-content {
margin-left: -0.4rem;
margin-right: -0.4rem;
min-height: 100vh;
background: #eee;
padding: 0.4rem;
}
</style>
......@@ -69,7 +69,11 @@ export default {
viewMore() {
this.$router.push({
name: 'courseTag',
params: { courseId: this.courseId, chapterId: this.data.id }
params: {
courseId: this.courseId,
chapterId: this.data.id
},
query: { is_test: this.isTest ? '1' : '0' }
})
}
},
......
......@@ -60,6 +60,11 @@ export default {
methods: {
// 获取知识点列表
getCourseTagList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getCourseTagList(this.courseId).then(response => {
this.$emit('ready', response)
this.detail = response
......@@ -71,6 +76,7 @@ export default {
payload: item
}
})
this.$toast.clear()
})
},
// 输入搜索
......@@ -152,6 +158,7 @@ export default {
}
.send {
height: 50px;
padding-bottom: env(safe-area-inset-bottom);
.inner {
position: fixed;
left: 0;
......
......@@ -33,8 +33,14 @@ export default {
methods: {
// 获取知识点详情
getCourseTag() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getCourseTag(this.tagId).then(response => {
this.detail = response
this.$toast.clear()
})
}
},
......
......@@ -40,16 +40,34 @@ export default {
},
tagList() {
return this.chapter.tag || []
},
isTest() {
return this.$route.query.is_test === '1'
}
},
methods: {
// 获取知识点列表
getCourseTagList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getCourseTagList(this.courseId).then(response => {
this.detail = response
this.$toast.clear()
})
},
onClick({ id }) {
if (this.isTest) {
const query = {
type: 2,
tag_id: id,
papersUrl: 'zy/v2/examination/course-papers'
}
this.$router.push({ path: '/exam/answer', query })
return
}
this.$router.push({ name: 'courseTagItem', params: { id } })
}
},
......
......@@ -51,8 +51,14 @@ export default {
methods: {
// 获取课程试听列表
getCourseList() {
this.$toast.loading({
duration: 0,
message: '加载中...',
forbidClick: true
})
api.getFreeCourseList().then(response => {
this.courseList = response
this.$toast.clear()
})
},
// 搜索
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论