提交 1c14d0db authored 作者: lihuihui's avatar lihuihui
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<div class="course-tag-message-hd"> <div class="course-tag-message-hd">
<div class="course-tag-message__title">{{data.name}}</div> <div class="course-tag-message__title">{{data.name}}</div>
<div class="course-tag-message__more" @click="viewMore" v-if="hasMore"> <div class="course-tag-message__more" @click="viewMore" v-if="hasMore">
<span>{{moreText}}</span> <span>更多</span>
<van-icon name="arrow" /> <van-icon name="arrow" />
</div> </div>
</div> </div>
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<ul class="message-tag-list" ref="content"> <ul class="message-tag-list" ref="content">
<template v-for="item in dataList"> <template v-for="item in dataList">
<li class="course-tag-item" :key="item.id" @click="onClick(item)"> <li class="course-tag-item" :key="item.id" @click="onClick(item)">
<p>{{item.title}}</p> <p>{{item.title}}{{item.free? '(免费)': ''}}</p>
</li> </li>
</template> </template>
</ul> </ul>
...@@ -42,7 +42,8 @@ export default { ...@@ -42,7 +42,8 @@ export default {
dataList() { dataList() {
let list = this.data.tag || [] let list = this.data.tag || []
if (!this.isVip) { if (!this.isVip) {
list = list.filter(item => item.free) // 免费的在前
list = [...list.filter(item => item.free), ...list.filter(item => !item.free)]
} }
return list.slice(0, this.maxCount) return list.slice(0, this.maxCount)
}, },
...@@ -58,6 +59,16 @@ export default { ...@@ -58,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}`
...@@ -87,7 +99,7 @@ export default { ...@@ -87,7 +99,7 @@ export default {
overflow: hidden; overflow: hidden;
.num { .num {
display: inline-block; display: inline-block;
min-width: 24px; padding-right: 5px;
} }
.text { .text {
border-bottom: 1px solid #c62245; border-bottom: 1px solid #c62245;
......
...@@ -8,9 +8,9 @@ ...@@ -8,9 +8,9 @@
<ul class="tag-list"> <ul class="tag-list">
<li class="tag-item" v-for="item in tagList" :key="item.id" @click="onClick(item)"> <li class="tag-item" v-for="item in tagList" :key="item.id" @click="onClick(item)">
<div class="tag-item__title"> <div class="tag-item__title">
<span>{{item.title}}</span> <span>{{item.title}}{{item.free? '(免费)': ''}}</span>
</div> </div>
<div class="tag-item__free" v-if="item.free">(免费)</div> <!-- <div class="tag-item__free" v-if="item.free">(免费)</div> -->
<div class="tag-item__arrow"> <div class="tag-item__arrow">
<van-icon name="arrow" /> <van-icon name="arrow" />
</div> </div>
......
...@@ -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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论