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

bug fixes

上级 87db0f30
...@@ -19,16 +19,24 @@ export default { ...@@ -19,16 +19,24 @@ export default {
computed: { computed: {
curriculum() { curriculum() {
return this.data.curriculum return this.data.curriculum
},
isWeapp() {
return this.$store.state.isWeapp
} }
}, },
methods: { methods: {
onClick(data) { onClick(data) {
if (this.isWeapp) {
const url = `/pages/web/index?src=${window.location.origin}/course/learn/${data.course_id}`
wx.miniProgram.navigateTo({ url })
} else {
this.$router.push({ this.$router.push({
name: 'courseLearnItem', name: 'courseLearnItem',
params: { id: data.course_id } params: { id: data.course_id }
}) })
} }
} }
}
} }
</script> </script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> <meta http-equiv="Expires" content="0" />
<title>道路运输安全知识线上课</title> <title></title>
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no"> <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
</head> </head>
<body> <body>
......
...@@ -48,6 +48,9 @@ export default { ...@@ -48,6 +48,9 @@ export default {
return { return {
'has-more': this.hasMore && !this.showMore 'has-more': this.hasMore && !this.showMore
} }
},
isWeapp() {
return this.$store.state.isWeapp
} }
}, },
methods: { methods: {
......
...@@ -38,6 +38,9 @@ import * as api from '@/api/course.js' ...@@ -38,6 +38,9 @@ import * as api from '@/api/course.js'
export default { export default {
name: 'Index', name: 'Index',
components: { SearchBar, Card, FreeCourseItem }, components: { SearchBar, Card, FreeCourseItem },
metaInfo: {
title: '道路运输安全知识线上课'
},
data() { data() {
return { return {
courseList: [] // 免费课程列表 courseList: [] // 免费课程列表
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论