|
|
|
@ -124,7 +124,7 @@ |
|
|
|
|
<div class="courses"> |
|
|
|
|
<template v-if="list.length"> |
|
|
|
|
<ul> |
|
|
|
|
<li v-for="(item, i) in list" :key="i" @click="toDetail(item.id)"> |
|
|
|
|
<li v-for="(item, i) in list" :key="i" @click="toDetail(item)"> |
|
|
|
|
<img :src="item.coverImageUrl" alt="" /> |
|
|
|
|
<div class="texts"> |
|
|
|
|
<el-tooltip effect="dark" :visible-arrow="false" :content="item.name" placement="bottom"> |
|
|
|
@ -132,18 +132,16 @@ |
|
|
|
|
</el-tooltip> |
|
|
|
|
<div class="desc" v-html="item.introduction"></div> |
|
|
|
|
<div class="tags"> |
|
|
|
|
<el-tooltip v-if="item.tagsName" class="item" effect="dark" :visible-arrow="false" |
|
|
|
|
:content="item.tagsName" placement="bottom"> |
|
|
|
|
<el-tooltip v-if="item.tag" class="item" effect="dark" :visible-arrow="false" :content="item.tag" |
|
|
|
|
placement="bottom"> |
|
|
|
|
<div> |
|
|
|
|
<el-tag v-for="(tag, i) in item.tagsName.split(',')" :key="i" class="tag">{{ tag }}</el-tag> |
|
|
|
|
<el-tag v-for="(tag, i) in item.tag.split(',')" :key="i" class="tag">{{ tag }}</el-tag> |
|
|
|
|
</div> |
|
|
|
|
</el-tooltip> |
|
|
|
|
</div> |
|
|
|
|
<div :class="['metas']"> |
|
|
|
|
<el-tag v-if="item.typeName" effect="dark"> |
|
|
|
|
{{ item.typeName }} |
|
|
|
|
</el-tag> |
|
|
|
|
<div v-if="item.isCourse" class="meta">{{ item.totalBrowsing }}人看过</div> |
|
|
|
|
<div class="metas"> |
|
|
|
|
<el-tag v-if="item.isTop" effect="dark" size="small">官方精选</el-tag> |
|
|
|
|
<div class="meta">{{ item.totalBrowsing }}人看过</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</li> |
|
|
|
@ -188,6 +186,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
form: { |
|
|
|
|
categoryId: '', |
|
|
|
|
subjectCategoryId: '', |
|
|
|
|
professionalCategoryId: '', |
|
|
|
|
majorId: '', |
|
|
|
@ -197,9 +196,6 @@ export default { |
|
|
|
|
timeOrdering: '', |
|
|
|
|
classificationTagId: '', |
|
|
|
|
}, |
|
|
|
|
categoryId: '', |
|
|
|
|
professionalCategoryId: '', |
|
|
|
|
professionalId: '', |
|
|
|
|
category: [], |
|
|
|
|
professionalClasses: [], |
|
|
|
|
professionals: [], |
|
|
|
@ -240,6 +236,11 @@ export default { |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
$route () { |
|
|
|
|
this.id = this.$route.query.id |
|
|
|
|
this.getBanner() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
'form.keyWord': function (val) { |
|
|
|
|
clearTimeout(this.searchTimer); |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
@ -254,7 +255,8 @@ export default { |
|
|
|
|
this.getClass() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
methods: {// 初始化动画 |
|
|
|
|
methods: { |
|
|
|
|
// 初始化动画 |
|
|
|
|
initAnimate () { |
|
|
|
|
ScrollReveal().reveal('.animate', { |
|
|
|
|
reset: true, // 滚动鼠标时,动画开关(如果为true, 动画可以执行n次) |
|
|
|
@ -332,36 +334,39 @@ export default { |
|
|
|
|
data[data.length - 1][data[data.length - 1].state ? 'theEditedJson' : 'jsonBeforeEditing']) |
|
|
|
|
this.modules = json |
|
|
|
|
this.$nextTick(this.initAnimate) |
|
|
|
|
console.log("🚀 ~ file: index.vue ~ line 180 ~ this.$post ~ json", json) |
|
|
|
|
} |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
}, |
|
|
|
|
// 获取列表 |
|
|
|
|
getData () { |
|
|
|
|
async getData () { |
|
|
|
|
try { |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.$post(this.api.courseProduct, { |
|
|
|
|
const { data } = await this.$post(this.api.courseProduct, { |
|
|
|
|
...this.form, |
|
|
|
|
siteId: this.site, |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
columnId: +this.id, |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.list = data.records |
|
|
|
|
}) |
|
|
|
|
const list = data.records |
|
|
|
|
list && list.forEach(e => { |
|
|
|
|
// 没简介则取描述,描述要去掉标签图片 |
|
|
|
|
if (!e.introduction) { |
|
|
|
|
const el = document.createElement('div') |
|
|
|
|
el.innerHTML = e.detailedDescription |
|
|
|
|
e.introduction = el.innerText |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
this.list = list |
|
|
|
|
this.total = +data.total |
|
|
|
|
} finally { |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
// 简介点击定位锚点 |
|
|
|
|
toPart (i) { |
|
|
|
|
this.active = i |
|
|
|
|
// document.querySelector(`#part${i}`).scrollIntoView() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 获取产品标签 |
|
|
|
|
async getLabel () { |
|
|
|
@ -407,47 +412,6 @@ export default { |
|
|
|
|
this.form.majorId = item.professionalId |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 获取学科类别 |
|
|
|
|
// async getSubject () { |
|
|
|
|
// // 学科类别 |
|
|
|
|
// this.$get(this.api.subjectCategoryCited).then(({ list }) => { |
|
|
|
|
// list = list.filter(e => e.disciplineId != 1) |
|
|
|
|
// list.map((e, i) => { |
|
|
|
|
// e.id = e.disciplineId |
|
|
|
|
// e.name = e.disciplineName |
|
|
|
|
// // 专业类 |
|
|
|
|
// e.professionalClasses.map(e => { |
|
|
|
|
// e.id = e.professionalClassId |
|
|
|
|
// e.name = e.professionalClassName |
|
|
|
|
|
|
|
|
|
// // 专业 |
|
|
|
|
// e.professionals.map(e => { |
|
|
|
|
// e.id = e.professionalId |
|
|
|
|
// e.name = e.professionalName |
|
|
|
|
// }) |
|
|
|
|
// e.children = e.professionals |
|
|
|
|
// }) |
|
|
|
|
// e.children = e.professionalClasses |
|
|
|
|
// }) |
|
|
|
|
// this.category = list |
|
|
|
|
// }).catch(err => { }) |
|
|
|
|
// }, |
|
|
|
|
// 学科点击回调 |
|
|
|
|
categoryClick (item, i) { |
|
|
|
|
const { id, children } = item |
|
|
|
|
this[i === 1 ? 'categoryId' : i === 2 ? 'professionalCategoryId' : 'professionalId'] = id |
|
|
|
|
// 学科类别 |
|
|
|
|
if (i === 1) { |
|
|
|
|
this.professionalCategoryId = '' |
|
|
|
|
this.professionalId = '' |
|
|
|
|
if (children) this.professionalClasses = children |
|
|
|
|
this.professionals = [] |
|
|
|
|
} else if (i === 2) { // 专业类 |
|
|
|
|
this.professionalId = '' |
|
|
|
|
if (children) this.professionals = children |
|
|
|
|
} |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// 获取产品类型 |
|
|
|
|
async getClass () { |
|
|
|
|
const { data } = await this.$post(`${this.api.categoryList}?siteId=${this.site}&type=1`) |
|
|
|
@ -482,8 +446,9 @@ export default { |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
// 跳转详情 |
|
|
|
|
toDetail (id) { |
|
|
|
|
this.$router.push(`/index/show?id=${id}`); |
|
|
|
|
toDetail (item) { |
|
|
|
|
item.listStyleId = 73 // 手动把产品中心长页的id赋进去,跳转文章的方法是公用的,产品中心要跳转到产品详情页,不是文章详情页 |
|
|
|
|
this.toArtice(item) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|