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

bug fixes

上级 f06359f8
......@@ -101,11 +101,12 @@ export default class API {
const { status, data } = res.response
if (data) {
if (status === 403 && !/getinfo$/i.test(res.config.url)) {
if (store.state.isWeapp) {
wx.miniProgram.navigateTo({ url: '/pages/login/index' })
} else {
router.push('/login')
}
// if (store.state.isWeapp) {
// wx.miniProgram.navigateTo({ url: '/pages/login/index' })
// } else {
// router.push('/login')
// }
router.push('/login')
}
if (status === 402) {
if (store.state.isWeapp) {
......
......@@ -38,6 +38,11 @@ export default {
}
}
},
computed: {
isWeapp() {
return this.$store.state.isWeapp
}
},
methods: {
getList() {
this.loaded = false
......@@ -51,6 +56,16 @@ export default {
this.getList()
},
onClick(data) {
if (data.free) {
if (this.isWeapp) {
wx.miniProgram.navigateTo({
url: `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
})
} else {
window.alert('请在微信小程序中打开')
}
return
}
this.$router.push({ name: 'courseLearnItem', params: { id: data.id } })
}
},
......
......@@ -65,9 +65,13 @@ export default {
},
onClick(data) {
if (this.isWeapp) {
wx.miniProgram.navigateTo({
url: `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
})
let url = ''
if (data.free) {
url = `/pages/free/item?id=${data.course_id}&chapter_id=${data.id}`
} else {
url = `/pages/course/item?id=${data.course_id}&chapter_id=${data.id}`
}
wx.miniProgram.navigateTo({ url })
} else {
window.alert('请在微信小程序中打开')
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论