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

bug fixes

上级 58485dac
...@@ -59,6 +59,16 @@ export default { ...@@ -59,6 +59,16 @@ export default {
}, },
methods: { methods: {
onClick(data) { onClick(data) {
// 未开通
if (!data.free && !this.isVip) {
if (this.isWeapp) {
const url = `/pages/web/index?src=${window.location.origin}/pay`
wx.miniProgram.navigateTo({ url })
} else {
this.$router.push({ name: 'pay' })
}
return
}
if (this.isTest) { if (this.isTest) {
// 知识点测试 // 知识点测试
const path = `/exam/courseNodeExam?tag_id=${data.id}` const path = `/exam/courseNodeExam?tag_id=${data.id}`
......
...@@ -39,6 +39,12 @@ export default { ...@@ -39,6 +39,12 @@ export default {
return { showMore: false, maxCount: 7 } return { showMore: false, maxCount: 7 }
}, },
computed: { computed: {
isWeapp() {
return this.$store.state.isWeapp
},
isVip() {
return this.$store.state.isVip
},
hasMore() { hasMore() {
return this.data.length > this.maxCount return this.data.length > this.maxCount
}, },
...@@ -47,13 +53,19 @@ export default { ...@@ -47,13 +53,19 @@ export default {
return this.data.filter((item, index) => index < this.maxCount) return this.data.filter((item, index) => index < this.maxCount)
} }
return this.data return this.data
},
isWeapp() {
return this.$store.state.isWeapp
} }
}, },
methods: { methods: {
onClick(data) { onClick(data) {
// 未开通
if (!data.free && !this.isVip) {
if (this.isWeapp) {
const url = `/pages/web/index?src=${window.location.origin}/pay`
wx.miniProgram.navigateTo({ url })
} else {
this.$router.push({ name: 'pay' })
}
}
if (this.isTest) { if (this.isTest) {
// 知识点测试 // 知识点测试
const path = `/exam/courseNodeExam?tag_id=${data.id}` const path = `/exam/courseNodeExam?tag_id=${data.id}`
......
...@@ -185,7 +185,7 @@ export default { ...@@ -185,7 +185,7 @@ export default {
domain: '.ezijing.com' domain: '.ezijing.com'
}) })
// 打开地址 // 打开地址
window.location.href = wechatUrl window.location.replace(wechatUrl)
}, },
checkWechatLogin() { checkWechatLogin() {
return !!(Cookies.get('wechat_login_error') || Cookies.get('wechat_login_no_phone_error')) return !!(Cookies.get('wechat_login_error') || Cookies.get('wechat_login_no_phone_error'))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论