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

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()
})

View File

@@ -7,6 +7,7 @@
"play": "Play",
"star": "Star",
"setting": "Setting",
"exists": "Already exists",
"videoName": "Video Name",
"type": "Type",
"time": "Time",
@@ -15,6 +16,7 @@
"detail": "Detail",
"close": "Close",
"download": "Download",
"all_download": "All Download",
"next": "Next",
"play_list": "Play List",
"history": "History",
@@ -32,9 +34,11 @@
"donate": "Donate",
"set_success": "Set up successfully.",
"delete_success": "Delete successful.",
"delete_failed": "Delete failed.",
"star_success": "Collection success.",
"last_video": "This is the last episode.",
"qr_tips": "Long click recognition.",
"zy_tips": "Prohibit the dissemination of illegal resources.",
"share_tips": "It has been copied to the clipboard. Please share it~"
"share_tips": "It has been copied to the clipboard. Please share it~",
"not_support_search": "Search is not supported on this site."
}

View File

@@ -7,6 +7,7 @@
"play": "播放",
"star": "收藏",
"setting": "设置",
"exists": "已存在",
"videoName": "视频名称",
"type": "类型",
"time": "时间",
@@ -15,6 +16,7 @@
"detail": "详情",
"close": "关闭",
"download": "下载",
"all_download": "全集下载",
"next": "下一集",
"play_list": "播放列表",
"history": "历史记录",
@@ -32,9 +34,11 @@
"donate": "捐赠",
"set_success": "设置成功。",
"delete_success": "删除成功。",
"delete_failed": "删除失败。",
"star_success": "收藏成功。",
"last_video": "这已经是最后一集了。",
"qr_tips": "长按二维码,识别播放。",
"zy_tips": "『ZY Player』技术支持严禁传播违法资源。",
"share_tips": "已复制到剪贴板,快去分享吧~"
"share_tips": "已复制到剪贴板,快去分享吧~",
"not_support_search": "这个网站不支持搜索。"
}

View File

@@ -85,6 +85,7 @@ html,body{
height: 100%;
width: 100%;
overflow: hidden;
background-color: #000;
}
.mini{
box-sizing: border-box;