提交 bace33e9 authored 作者: lihuihui's avatar lihuihui
...@@ -39,7 +39,7 @@ export default { ...@@ -39,7 +39,7 @@ export default {
}, },
methods: { methods: {
bindFocus() { bindFocus() {
this.formInput.focus() this.focus && this.formInput.focus()
}, },
onChange() { onChange() {
this.$emit('input', this.currentValue) this.$emit('input', this.currentValue)
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
</li> </li>
</ul> </ul>
</div> </div>
<card title="课程试听" style="padding-bottom:40px;"> <card title="课程试听" style="padding-bottom:50px;">
<free-course-item v-for="item in courseList" :data="item" :key="item.course_id"></free-course-item> <free-course-item v-for="item in courseList" :data="item" :key="item.course_id"></free-course-item>
</card> </card>
</div> </div>
...@@ -101,6 +101,9 @@ export default { ...@@ -101,6 +101,9 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.main-container {
padding-bottom: env(safe-area-inset-bottom);
}
.banner { .banner {
height: 2.4rem; height: 2.4rem;
img { img {
...@@ -126,4 +129,7 @@ export default { ...@@ -126,4 +129,7 @@ export default {
height: 100%; height: 100%;
} }
} }
::v-deep .course-item:last-child {
border-bottom: 0;
}
</style> </style>
<template> <template>
<div class="main-list"> <div class="main-list">
<ul v-if="list.length"> <ul v-if="list.length">
<li v-for="item in list" :key="item.course_id">{{item.chapter_name}}</li> <li v-for="item in list" :key="item.course_id" @click="onClick(item)">{{item.course_name}}</li>
</ul> </ul>
<template v-else> <template v-else>
<slot name="empty"> <slot name="empty">
...@@ -46,6 +46,9 @@ export default { ...@@ -46,6 +46,9 @@ export default {
// 刷新 // 刷新
refresh() { refresh() {
this.getList() this.getList()
},
onClick(data) {
this.$router.push({ name: 'courseLearnItem', params: { id: data.id } })
} }
}, },
beforeMount() { beforeMount() {
......
<template> <template>
<div class="main-list"> <div class="main-list">
<ul v-if="list.length"> <ul v-if="list.length">
<li v-for="item in list" :key="item.id">{{item.title}}</li> <li v-for="item in list" :key="item.id" @click="onClick">{{item.title}}</li>
</ul> </ul>
<template v-else> <template v-else>
<slot name="empty"> <slot name="empty">
...@@ -46,6 +46,10 @@ export default { ...@@ -46,6 +46,10 @@ export default {
// 刷新 // 刷新
refresh() { refresh() {
this.getList() this.getList()
},
onClick() {
window.alert('开发中')
// this.$router.push({ name: 'courseLearnItem', params: { id } })
} }
}, },
beforeMount() { beforeMount() {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="main-list"> <div class="main-list">
<template v-if="list.length"> <template v-if="list.length">
<ul> <ul>
<li v-for="item in list" :key="item.id">{{item.chapter_name}}</li> <li v-for="item in list" :key="item.id" @click="onClick(item)">{{item.chapter_name}}</li>
</ul> </ul>
</template> </template>
<template v-else> <template v-else>
...@@ -39,6 +39,11 @@ export default { ...@@ -39,6 +39,11 @@ export default {
} }
} }
}, },
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
methods: { methods: {
getList() { getList() {
api.getCourseVideoSearchList(this.requestParams).then(response => { api.getCourseVideoSearchList(this.requestParams).then(response => {
...@@ -48,6 +53,15 @@ export default { ...@@ -48,6 +53,15 @@ export default {
// 刷新 // 刷新
refresh() { refresh() {
this.getList() this.getList()
},
onClick(data) {
if (this.isWeapp) {
wx.miniProgram.navigateTo({
url: `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
})
} else {
window.alert('请在微信小程序中打开')
}
} }
}, },
beforeMount() { beforeMount() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论