|
|
|
@ -22,8 +22,8 @@ |
|
|
|
|
@click="tab1Change(item)">{{ item.classificationName }}</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="curs"> |
|
|
|
|
<template v-if="products.length"> |
|
|
|
|
<template v-if="products.length"> |
|
|
|
|
<div class="curs"> |
|
|
|
|
<div v-for="(item, i) in products" class="item" :title="item.goodsName" @click="toProduct(item)" :key="i"> |
|
|
|
|
<div v-if="isZj || isSq" class="cover" :style="{ backgroundImage: 'url(/images/' + i + '.png)' }"></div> |
|
|
|
|
<div v-else class="cover" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"></div> |
|
|
|
@ -33,12 +33,16 @@ |
|
|
|
|
<a v-else>进入实验</a> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<div class="empty flex-1" v-else> |
|
|
|
|
<div> |
|
|
|
|
<img src="@/assets/img/none.png" alt=""> |
|
|
|
|
<p>暂无数据</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background :current-page="page" layout="total, prev, pager, next" :total="total" |
|
|
|
|
:page-size="pageSize" @current-change="handleCurrentChange"></el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<div class="empty flex-1" v-else> |
|
|
|
|
<div> |
|
|
|
|
<img src="@/assets/img/none.png" alt=""> |
|
|
|
|
<p>暂无数据</p> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -65,7 +69,7 @@ export default { |
|
|
|
|
isSq: Setting.isSq, |
|
|
|
|
keyword: this.$route.query.keyword || '', |
|
|
|
|
typeActive: +this.$route.query.typeActive || 0, |
|
|
|
|
active: +this.$route.query.active || '', |
|
|
|
|
active: this.$route.query.active ? +this.$route.query.active : '', |
|
|
|
|
searchTimer: null, |
|
|
|
|
types: [ |
|
|
|
|
{ |
|
|
|
@ -90,6 +94,9 @@ export default { |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
tabs: [], |
|
|
|
|
page: +this.$route.query.page || 1, |
|
|
|
|
pageSize: 12, |
|
|
|
|
total: 0, |
|
|
|
|
products: [], |
|
|
|
|
loading: false, |
|
|
|
|
|
|
|
|
@ -100,7 +107,7 @@ export default { |
|
|
|
|
watch: { |
|
|
|
|
keyword: function () { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(this.getList, 500) |
|
|
|
|
this.searchTimer = setTimeout(this.initData, 500) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
@ -114,7 +121,7 @@ export default { |
|
|
|
|
this.selfBuildCourseType = res.selfBuildCourseType |
|
|
|
|
this.tabs = [ |
|
|
|
|
...this.defaultTabs, |
|
|
|
|
...res.data, |
|
|
|
|
...this[this.typeActive ? 'selfBuildCourseType' : 'defaultTypes'], |
|
|
|
|
] |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
@ -124,37 +131,54 @@ export default { |
|
|
|
|
// 最近使用 |
|
|
|
|
if (this.active === -1) { |
|
|
|
|
const { list } = await this.$post(this.api.recentUse, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
courseType: this.typeActive, |
|
|
|
|
goodsName: this.keyword, |
|
|
|
|
}) |
|
|
|
|
this.products = list |
|
|
|
|
this.products = list.records |
|
|
|
|
this.total = list.total |
|
|
|
|
this.loading = false |
|
|
|
|
} else { |
|
|
|
|
if (this.typeActive) { |
|
|
|
|
// 我的课程 |
|
|
|
|
const res = await this.$post(this.api.selfBuildCourse, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
curriculumType: this.active, |
|
|
|
|
curriculumName: this.keyword, |
|
|
|
|
}) |
|
|
|
|
this.products = res.courses |
|
|
|
|
this.products = res.courses.records |
|
|
|
|
this.total = res.courses.total |
|
|
|
|
this.loading = false |
|
|
|
|
} else { |
|
|
|
|
// 校本课程 |
|
|
|
|
const { data } = await this.$get(this.api.schoolCourse, { |
|
|
|
|
const { data } = await this.$post(this.api.schoolCourse, { |
|
|
|
|
pageNum: this.page, |
|
|
|
|
pageSize: this.pageSize, |
|
|
|
|
authority: this.active, |
|
|
|
|
goodsName: this.keyword, |
|
|
|
|
}) |
|
|
|
|
this.products = data |
|
|
|
|
this.products = data.records |
|
|
|
|
this.total = data.total |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
handleCurrentChange (val) { |
|
|
|
|
this.page = val |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
initData () { |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
// 记录最近使用 |
|
|
|
|
async addRecord (mallId) { |
|
|
|
|
await this.$post(`${this.api.recordRecentUsage}?mallId=${mallId}`) |
|
|
|
|
}, |
|
|
|
|
toProduct (item) { |
|
|
|
|
const params = `&keyword=${this.keyword}&active=${this.active}&typeActive=${this.typeActive}` |
|
|
|
|
const params = `&keyword=${this.keyword}&active=${this.active}&typeActive=${this.typeActive}&page=${this.page}` |
|
|
|
|
if (this.typeActive) { |
|
|
|
|
this.$router.push(`/station/preview?courseId=${item.cid || ''}&curriculumName=${encodeURIComponent(item.goodsName || item.curriculumName)}&mallId=${item.mallId || ''}${params}`) |
|
|
|
|
} else { |
|
|
|
@ -190,12 +214,12 @@ export default { |
|
|
|
|
...this[id ? 'selfBuildCourseType' : 'defaultTypes'], |
|
|
|
|
] |
|
|
|
|
if (this.active !== '' && this.active !== -1) this.active = '' |
|
|
|
|
this.getList() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
// tab切换 |
|
|
|
|
tab1Change (item) { |
|
|
|
|
this.active = item.classificationId |
|
|
|
|
this.getList() |
|
|
|
|
this.initData() |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|