diff --git a/public/index.html b/public/index.html index 7b9845e..2a0608a 100644 --- a/public/index.html +++ b/public/index.html @@ -10,7 +10,7 @@ var _hmt = _hmt || []; (function() { var hm = document.createElement('script'); - hm.src = 'https://hm.baidu.com/hm.js?72fbad6ebf1d6c705117fe8fe0686a0e'; + hm.src = 'https://hm.baidu.com/hm.js?e4d7deeca2d6ea71d2bd5fa2365bc654'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(hm, s); })(); diff --git a/src/pages/product/list/index.vue b/src/pages/product/list/index.vue index 128c05f..e8260a7 100644 --- a/src/pages/product/list/index.vue +++ b/src/pages/product/list/index.vue @@ -234,7 +234,6 @@ export default { this.professionalId = params.professionalId this.curTab = params.curTab this.$store.commit('product/setParams', null) - console.log("🚀 ~ mounted ~ this.form:", params) } this.carouselHeight = parseInt(window.innerWidth / 3.6) + 'px' diff --git a/src/pages/product/show/index.vue b/src/pages/product/show/index.vue index 6cfaaf0..65cf449 100644 --- a/src/pages/product/show/index.vue +++ b/src/pages/product/show/index.vue @@ -2,7 +2,7 @@
- +
@@ -329,6 +329,12 @@ export default { this.id = id this.getData() }, + back () { + const { query } = this.$route + query.active ? + this.$router.push(`/station?keyword=${query.keyword || ''}&active=${query.active || 0}`) : + this.$router.push('list') + }, } }; diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index 8b0e2f1..1ca8c2a 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -22,7 +22,7 @@

{{ item.goodsName || item.curriculumName }}

续费 - 进入实验 + 进入实验
@@ -84,7 +84,7 @@ export default { classificationName: '最近使用', }, { - classificationId: '', + classificationId: -1, classificationName: '全部', }, ...data, @@ -103,28 +103,38 @@ export default { this.products = page.records } else { const { data } = await this.$get(this.api.schoolCourse, { - authority: this.active, + authority: this.active === -1 ? '' : this.active, goodsName: this.keyword, }) this.products = data } }, + // 记录最近使用 + async addRecord (mallId) { + await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`) + }, toProduct (item) { + const params = `&keyword=${this.keyword}&active=${this.active}` const links = item.nonAssociatedLinks // 已过期 / 没有cid并且没有链接,则跳转到产品详情 - if (!item.isInEffect || (!item.cid && !links)) { - this.$router.push(`/product/show?id=${item.mallId}`) + if (!item.isInEffect) { + this.$router.push(`/product/show?id=${item.mallId}${params}`) + } else if (item.isInEffect && !item.cid && !links) { + this.addRecord(item.mallId) + this.$router.push(`/product/show?id=${item.mallId}${params}`) } else { // 有链接 if (links && links.length) { if (links.length === 1) { + this.addRecord(item.mallId) window.open(links[0].url) } else { + this.addRecord(item.mallId) this.linkVisible = true this.links = item.nonAssociatedLinks } } else { - this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&keyword=${this.keyword}&active=${this.active}`) + this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}${params}`) } } }, diff --git a/src/pages/station/preview/index.vue b/src/pages/station/preview/index.vue index 0f562a7..1607de2 100644 --- a/src/pages/station/preview/index.vue +++ b/src/pages/station/preview/index.vue @@ -453,8 +453,8 @@ export default { this.getStatus() }, // 记录最近使用 - addRecord () { - this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}`).then(res => { }).catch(res => { }) + async addRecord () { + await this.$post(`${this.api.recordRecentUsage}?mallId=${this.mallId}`) }, // 查询是否过期 getStatus () {