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

bug fixes

上级 72517431
...@@ -72,12 +72,7 @@ export default { ...@@ -72,12 +72,7 @@ export default {
}, },
handleClick(data) { handleClick(data) {
if (this.isWeapp) { if (this.isWeapp) {
let url = `/pages/course/item?id=${this.courseId}&chapter_id=${data.id}` wx.miniProgram.navigateTo({ 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 { } else {
window.alert('请在微信小程序中打开') window.alert('请在微信小程序中打开')
} }
......
...@@ -53,12 +53,7 @@ export default { ...@@ -53,12 +53,7 @@ export default {
}, },
handleClick(data) { handleClick(data) {
if (this.isWeapp) { if (this.isWeapp) {
let url = `/pages/course/player?course_id=${this.courseId}&chapter_id=${data.id}` wx.miniProgram.navigateTo({ url: `/pages/course/player?course_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 { } else {
window.alert('请在微信小程序中打开') window.alert('请在微信小程序中打开')
} }
......
...@@ -34,7 +34,7 @@ export default { ...@@ -34,7 +34,7 @@ export default {
} }
}, },
computed: { computed: {
...mapState(['isWeapp', 'isAndroid', 'isIos', 'isVip']), ...mapState(['isWeapp', 'isAndroid', 'isIos', 'isVip', 'isLogin']),
hasMore() { hasMore() {
return this.data.tag ? this.data.tag.length > this.maxCount : false return this.data.tag ? this.data.tag.length > this.maxCount : false
}, },
...@@ -59,14 +59,16 @@ export default { ...@@ -59,14 +59,16 @@ export default {
}, },
methods: { methods: {
onClick(data) { onClick(data) {
// 未登录
if (!data.free && !this.isLogin) {
this.isWeapp ? wx.miniProgram.navigateTo({ url: '/pages/login/index' }) : this.$router.push({ name: 'login' })
return
}
// 未开通 // 未开通
if (!data.free && !this.isVip) { if (!data.free && !this.isVip) {
if (this.isWeapp) { this.isWeapp
const url = `/pages/web/index?src=${window.location.origin}/pay` ? wx.miniProgram.navigateTo({ url: `/pages/web/index?src=${window.location.origin}/pay` })
wx.miniProgram.navigateTo({ url }) : this.$router.push({ name: 'pay' })
} else {
this.$router.push({ name: 'pay' })
}
return return
} }
if (this.isTest) { if (this.isTest) {
......
...@@ -45,6 +45,9 @@ export default { ...@@ -45,6 +45,9 @@ export default {
isVip() { isVip() {
return this.$store.state.isVip return this.$store.state.isVip
}, },
isLogin() {
return this.$store.state.isLogin
},
hasMore() { hasMore() {
return this.data.length > this.maxCount return this.data.length > this.maxCount
}, },
...@@ -57,14 +60,17 @@ export default { ...@@ -57,14 +60,17 @@ export default {
}, },
methods: { methods: {
onClick(data) { onClick(data) {
// 未登录
if (!data.free && !this.isLogin) {
this.isWeapp ? wx.miniProgram.navigateTo({ url: '/pages/login/index' }) : this.$router.push({ name: 'login' })
return
}
// 未开通 // 未开通
if (!data.free && !this.isVip) { if (!data.free && !this.isVip) {
if (this.isWeapp) { this.isWeapp
const url = `/pages/web/index?src=${window.location.origin}/pay` ? wx.miniProgram.navigateTo({ url: `/pages/web/index?src=${window.location.origin}/pay` })
wx.miniProgram.navigateTo({ url }) : this.$router.push({ name: 'pay' })
} else { return
this.$router.push({ name: 'pay' })
}
} }
if (this.isTest) { if (this.isTest) {
// 知识点测试 // 知识点测试
......
...@@ -26,7 +26,10 @@ ...@@ -26,7 +26,10 @@
<div class="qrcode"> <div class="qrcode">
<p>开启学习提醒功能,需先关注紫荆职教公众号。</p> <p>开启学习提醒功能,需先关注紫荆职教公众号。</p>
<div class="ui-button" style="margin:40px 0 10px;"> <div class="ui-button" style="margin:40px 0 10px;">
<a href="https://mp.weixin.qq.com/s/xcWMbYk5NgzUF3qxLzGTMg">关注公众号</a> <a
href="https://mp.weixin.qq.com/s/xcWMbYk5NgzUF3qxLzGTMg"
@click="followPopupVisible = false"
>关注公众号</a>
</div> </div>
</div> </div>
</van-popup> </van-popup>
......
...@@ -57,12 +57,7 @@ export default { ...@@ -57,12 +57,7 @@ export default {
}, },
handleClick(data) { handleClick(data) {
if (this.isWeapp) { if (this.isWeapp) {
let url = `/pages/course/item?id=${this.courseId}&chapter_id=${data.id}` wx.miniProgram.navigateTo({ 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 { } else {
window.alert('请在微信小程序中打开') window.alert('请在微信小程序中打开')
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论