Skip to content

Commit

Permalink
@feat banner添加快捷点击&&video新增发布时间
Browse files Browse the repository at this point in the history
  • Loading branch information
YTU94 committed Feb 15, 2019
1 parent 5186238 commit 35067f9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/components/swiper-banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
next-margin ="15px">
<block v-for="(item, index) in swiperList" :key="index">
<swiper-item>
<div class="for-padding" @click="goToInfo(item.id)">
<div class="for-padding" @click="goToInfo(item)">
<img v-if="item.thumb" :class="{'active': activeIndex === index}" :src="item.thumb" class="slide-image"/>
<!-- <span v-if="item.title" class="slide-msg">{{item.title}}</span> :mode="activeIndex === index ? 'widthFix' : ''" -->
</div>
Expand Down Expand Up @@ -48,8 +48,8 @@ export default {
console.log(e.mp.detail.current)
this.activeIndex = e.mp.detail.current
},
goToInfo (id) {
this.$emit('navigateTo', id)
goToInfo (course) {
this.$emit('navigateTo', course)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/searchCourse/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<p class="title">相关课程</p>
<course-card v-for="(item, index) in courseList" :key="index" @goVideoList="goVideoList" :course="item"></course-card>
</div>
<div class="course-list" v-if="noneCourse">暂无相关课程</div>
</div>
</template>

Expand All @@ -32,7 +33,8 @@ export default {
return {
keywords: '',
hots: ['react.js', 'go', '小程序', 'php', 'vue.js', 'python', '人工智能', '区块链'],
courseList: []
courseList: [],
noneCourse: false
}
},
computed: {
Expand Down Expand Up @@ -67,6 +69,7 @@ export default {
_getCourseList (data) {
this.$http.course.getCourseList(data).then(res => {
this.courseList = res.data
this.noneCourse = !(res.data.length > 0)
})
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tabBar/course/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div class="course">
<div class="search-input" @click="goSearchCoure">请输入课程名称</div>
<swiper-banner :swiperList="courseList" :key="imgKey"></swiper-banner>
<swiper-banner :swiperList="courseList" :key="imgKey" @navigateTo="goVideoList"></swiper-banner>
<h1 class="couse-title">课程推荐</h1>
<div class="card-list" v-if="hasMounted">
<div class="" v-if="courseList && courseList.length > 0">
Expand Down
10 changes: 8 additions & 2 deletions src/pages/video/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
<div class="introduction">
<p class="introduction-title">
<span class="introduction-title__name">{{videoInfo.title}}</span>
<span class="introduction-title__num">播放次数:{{videoInfo.view_num || viewNum}}</span>
<span class="introduction-title__num">
<p>播放次数:{{videoInfo.view_num || viewNum}}</p>
</span>
</p>
<p class="introduction-lable c-red">
简介
<span class="introduction-title__num" style="float: right;">发布时间:{{videoInfo.published_format}}</span>
</p>
<p class="introduction-lable c-red">简介</p>
<p class="introduction-description" v-html="videoInfo.short_description"></p>
<p class="introduction-lable c-red">详细介绍</p>
<p class="introduction-description" v-html="videoInfo.description"></p>
Expand Down Expand Up @@ -134,6 +139,7 @@ export default {
_getVideosInfo (data, id) {
this.$http.video.getVideosInfo(data, id).then(res => {
this.videoInfo = res.data
this.videoInfo.published_format = formatTime(res.data.published_at, true)
})
},
// 视频播放地址
Expand Down

0 comments on commit 35067f9

Please sign in to comment.