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

bug fixes

上级 34571fa3
...@@ -50,6 +50,9 @@ export default { ...@@ -50,6 +50,9 @@ export default {
}, },
isWeapp() { isWeapp() {
return this.$store.state.isWeapp return this.$store.state.isWeapp
},
isVip() {
return this.$store.state.isVip
} }
}, },
methods: { methods: {
......
...@@ -31,6 +31,9 @@ export default { ...@@ -31,6 +31,9 @@ export default {
}, },
isWeapp() { isWeapp() {
return this.$store.state.isWeapp return this.$store.state.isWeapp
},
isVip() {
return this.$store.state.isVip
} }
}, },
methods: { methods: {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
:courseId="courseId" :courseId="courseId"
:data="detail.chapters" :data="detail.chapters"
:show-progress="true" :show-progress="true"
@on-click="handleClick"
v-if="detail.chapters && detail.chapters.length" v-if="detail.chapters && detail.chapters.length"
></course-chapter> ></course-chapter>
<van-empty description="暂无内容" v-else /> <van-empty description="暂无内容" v-else />
...@@ -31,6 +32,12 @@ export default { ...@@ -31,6 +32,12 @@ export default {
computed: { computed: {
courseId() { courseId() {
return this.$route.params.id return this.$route.params.id
},
isWeapp() {
return this.$store.state.isWeapp
},
isVip() {
return this.$store.state.isVip
} }
}, },
methods: { methods: {
...@@ -47,6 +54,18 @@ export default { ...@@ -47,6 +54,18 @@ export default {
}) })
this.detail = response this.detail = response
}) })
},
handleClick(data) {
if (this.isWeapp) {
let url = `/pages/course/item?id=${this.courseId}&chapter_id=${data.id}`
// 未开通
if (!data.free && !this.isVip) {
url = `/pages/web/index?src=${window.location.origin}/pay`
}
wx.miniProgram.navigateTo({ url })
} else {
window.alert('请在微信小程序中打开')
}
} }
}, },
beforeMount() { beforeMount() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论