🍗 优化分类,以及详情页播放逻辑

This commit is contained in:
hunlongyu
2020-04-21 18:03:23 +08:00
parent ba8312b78c
commit 75cc6dd3c1
6 changed files with 30 additions and 20 deletions

View File

@@ -14,16 +14,16 @@
<div class="info" v-html="vDetail.info"></div>
<div class="desc" v-html="vDetail.desc" v-if="show.desc"></div>
<div class="m3u8_urls">
<div class="title">{{$t('play')}}:</div>
<div class="title">{{$t('play')}}:</div>
<div class="box">
<span v-for="(i, j) in vDetail.m3u8_urls" :key="j" @click="playEvent(i)">{{i | ftName}}</span>
<span v-for="(i, j) in vDetail.m3u8_urls" :key="j" @click="playEvent(j)">{{i | ftName}}</span>
</div>
</div>
<div class="mp4_urls" v-if="show.download">
<div class="title">{{$t('download')}}:</div>
<div class="title">{{$t('download')}}:</div>
<div class="box">
<span v-for="(i, j) in vDetail.mp4_urls" :key="j" @click="download(i)">{{i | ftName}}</span>
<span @click="allDownload" v-show="vDetail.mp4_urls.length > 1">全集下载</span>
<span @click="allDownload" v-show="vDetail.mp4_urls.length > 1">{{$t('all_download')}}</span>
</div>
</div>
</div>
@@ -101,8 +101,10 @@ export default {
})
})
},
playEvent (e) {
this.video = this.detail.v
playEvent (n) {
const v = { ...this.detail.v }
v.index = n
this.video = v
this.detail.show = false
this.view = 'Play'
},

View File

@@ -21,7 +21,8 @@
</div>
<!-- type -->
<div class="zy-select" @mouseleave="show.type = false" v-if="site.tags[tag].children.length > 0">
<div class="vs-placeholder" @click="show.type = true">{{site.tags[tag].children[type].title}}</div>
<!-- <div class="vs-placeholder" @click="show.type = true">{{site.tags[tag].children[type].title}}</div> -->
<div class="vs-placeholder" @click="show.type = true">{{typeName}}</div>
<div class="vs-options" v-show="show.type">
<ul>
<li :class="type === j ? 'active' : ''" v-for="(i, j) in site.tags[tag].children" :key="j" @click="typeClick(i, j)">{{ i.title }}</li>
@@ -89,6 +90,7 @@ export default {
top: false,
tag: 0,
type: 0,
typeName: '',
keywords: '',
id: '',
show: {
@@ -188,12 +190,8 @@ export default {
this.tb.update = 0
this.tb.total = 0
this.tag = n
this.type = 0
if (e.children.length === 0) {
this.id = e.id
} else {
this.id = e.children[this.type].id
}
this.id = e.id
this.typeName = 'All'
this.tb.loading = true
this.show.tags = false
tools.film_get(this.site.key, this.id).then(res => {
@@ -207,6 +205,7 @@ export default {
this.tb.update = 0
this.tb.total = 0
this.type = n
this.typeName = e.title
this.id = e.id
this.tb.loading = true
this.show.type = false
@@ -220,7 +219,7 @@ export default {
searchEvent () {
const flag = this.site.search
if (flag === '') {
this.$message.warning('该视频源不支持搜索')
this.$message.warning(this.$t('not_support_search'))
return false
}
this.tb.loading = true
@@ -245,10 +244,10 @@ export default {
starEvent (e) {
video.find({ detail: e.detail }).then(res => {
if (res) {
this.$message.warning('已存在')
this.$message.warning(this.$t('exists'))
} else {
video.add(e).then(res => {
this.$message.success('收藏成功')
this.$message.success(this.$t('star_success'))
})
}
})

View File

@@ -107,9 +107,9 @@ export default {
deleteEvent (e) {
video.remove(e.id).then(res => {
if (res) {
this.$message.warning('删除失败')
this.$message.warning(this.$t('delete_failed'))
} else {
this.$message.success('删除成功')
this.$message.success(this.$t('delete_success'))
}
this.getAllStar()
})