Commit f5f0f11a authored by ZhangKai's avatar ZhangKai

add: 课程资源 - 详情页接口对接

parent f48ed319
...@@ -9,6 +9,15 @@ export function selectCourseList(query) { ...@@ -9,6 +9,15 @@ export function selectCourseList(query) {
}) })
} }
// 分页查询课程列表
export function queryBLessonsByPagination(query) {
return request({
url: '/blesson/queryBLessonByPagination',
method: 'get',
params: query
})
}
// 查询三个推荐课程 // 查询三个推荐课程
export function recommendLesson(query) { export function recommendLesson(query) {
return request({ return request({
...@@ -28,3 +37,6 @@ export function queryOne(businessId) { ...@@ -28,3 +37,6 @@ export function queryOne(businessId) {
} }
}) })
} }
// 收藏课程
// 取消收藏课程
import request from '@/utils/request'
// 查询课程讲师信息
export function cmsLecturerDetail(businessId) {
return request({
url: `/cmslecturer/detail/${businessId}`,
method: 'get'
})
}
...@@ -121,14 +121,11 @@ ...@@ -121,14 +121,11 @@
</div> </div>
</div> </div>
<div class="paging-box"> <div class="paging-box">
<pagination <el-pagination
:total="100" background
:background="false"
layout="prev, pager, next" layout="prev, pager, next"
:page.sync="queryParams.pageNum" :total="1000">
:limit.sync="queryParams.pageSize" </el-pagination>
@pagination="loadData"
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -138,7 +135,7 @@ ...@@ -138,7 +135,7 @@
<script> <script>
import HomeSearch from '@/views/homePage/components/searchHome/index' import HomeSearch from '@/views/homePage/components/searchHome/index'
import NavList from '@/views/homePage/components/NavList/index' import NavList from '@/views/homePage/components/NavList/index'
import page from "@/mixins/page"; import {queryBLessonsByPagination, queryOne} from "@/api/bLesson/courseResources";
export default { export default {
name: 'Index', name: 'Index',
...@@ -146,7 +143,6 @@ export default { ...@@ -146,7 +143,6 @@ export default {
HomeSearch, HomeSearch,
NavList NavList
}, },
mixins: [page],
data() { data() {
return { return {
backTop: require('@/assets/image/top.png'), backTop: require('@/assets/image/top.png'),
...@@ -162,7 +158,9 @@ export default { ...@@ -162,7 +158,9 @@ export default {
// 分页 // 分页
pageNum: 1, pageNum: 1,
// 每页记录条数 // 每页记录条数
pageSize: 16 pageSize: 16,
// 总数
total: null
}, },
// 初始化查询条件页签位置 // 初始化查询条件页签位置
queryActiveName: 'first', queryActiveName: 'first',
...@@ -379,6 +377,7 @@ export default { ...@@ -379,6 +377,7 @@ export default {
}, },
created() { created() {
this.handleToTop() // 一进入页面自动滚动到最顶部 this.handleToTop() // 一进入页面自动滚动到最顶部
this.getCourseByPagination()
}, },
methods: { methods: {
/** 一进入页面自动滚动到最顶部*/ /** 一进入页面自动滚动到最顶部*/
...@@ -404,6 +403,15 @@ export default { ...@@ -404,6 +403,15 @@ export default {
// 重置全部页签查询条件 // 重置全部页签查询条件
this.queryParams.type = undefined this.queryParams.type = undefined
}, },
// 分页查询课程列表
getCourseByPagination() {
queryBLessonsByPagination(this.queryParams).then(res => {
if (res.code === 200) {
// TODO: please clear this log
console.log(`res`, res)
}
})
},
// 跳转到课程详情 // 跳转到课程详情
toCourseDetails(param) { toCourseDetails(param) {
this.$router.push({ this.$router.push({
......
...@@ -72,7 +72,14 @@ ...@@ -72,7 +72,14 @@
<i class="el-icon-d-arrow-right"/> <i class="el-icon-d-arrow-right"/>
</div> </div>
</div> </div>
<div class="box-bottom"> <div v-if="!enterpriseCourseList || enterpriseCourseList.length === 0" class="empty-box">
<el-image
class="img"
:src="require('@/assets/image/zanwushuju.png')"
fit="cover"
/>
</div>
<div v-if="enterpriseCourseList.length > 0" class="box-bottom">
<div <div
v-for="course in enterpriseCourseList" v-for="course in enterpriseCourseList"
:key="course.id" :key="course.id"
...@@ -87,8 +94,8 @@ ...@@ -87,8 +94,8 @@
fit="cover" fit="cover"
/> />
</div> </div>
<div :class="'status status-' + (course.lessonIsPay === '1' ? 'purchased' : 'unPurchased')"> <div :class="'status status-' + (course.lessonIsPay === 1 ? 'purchased' : 'unPurchased')">
{{ course.lessonIsPay === '1' ? '已购' : '未购' }} {{ course.lessonIsPay === 1 ? '已购' : '未购' }}
</div> </div>
</div> </div>
<div class="card-bottom"> <div class="card-bottom">
...@@ -122,7 +129,14 @@ ...@@ -122,7 +129,14 @@
<i class="el-icon-d-arrow-right"/> <i class="el-icon-d-arrow-right"/>
</div> </div>
</div> </div>
<div class="box-bottom"> <div v-if="!collegeCourseList || collegeCourseList.length === 0" class="empty-box">
<el-image
class="img"
:src="require('@/assets/image/zanwushuju.png')"
fit="cover"
/>
</div>
<div v-if="collegeCourseList.length > 0" class="box-bottom">
<div <div
v-for="course in collegeCourseList" v-for="course in collegeCourseList"
:key="course.id" :key="course.id"
...@@ -137,8 +151,8 @@ ...@@ -137,8 +151,8 @@
fit="cover" fit="cover"
/> />
</div> </div>
<div :class="'status status-' + (course.lessonIsPay === '1' ? 'purchased' : 'unPurchased')"> <div :class="'status status-' + (course.lessonIsPay === 1 ? 'purchased' : 'unPurchased')">
{{ course.lessonIsPay === '1' ? '已购' : '未购' }} {{ course.lessonIsPay === 1 ? '已购' : '未购' }}
</div> </div>
</div> </div>
<div class="card-bottom"> <div class="card-bottom">
...@@ -664,18 +678,26 @@ export default { ...@@ -664,18 +678,26 @@ export default {
line-height: 21px; line-height: 21px;
cursor: pointer; cursor: pointer;
} }
.toMore:hover { .toMore:hover {
color: #000; color: #000;
} }
} }
.empty-box {
margin: auto;
text-align: center;
}
.box-bottom { .box-bottom {
display: grid; display: grid;
grid-template-columns: repeat(4, 1fr); grid-template-columns: repeat(4, 1fr);
grid-gap: 24px 24px; grid-gap: 24px 24px;
.course-card:hover .img { .course-card:hover .img {
transform: scale(1.2); /* 鼠标悬停时放大图片,1.2为放大倍数,可自定义 */ transform: scale(1.2); /* 鼠标悬停时放大图片,1.2为放大倍数,可自定义 */
} }
.course-card { .course-card {
cursor: pointer; cursor: pointer;
height: 288px; height: 288px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment