mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-15 00:16:26 +08:00
Compare commits
43 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a00d965ce9 | ||
|
|
c9eb0c3e22 | ||
|
|
c80c0bd948 | ||
|
|
65dcfa04ae | ||
|
|
4e4ab82ea2 | ||
|
|
dd2adf4f99 | ||
|
|
777fbde528 | ||
|
|
472898f978 | ||
|
|
7f41d415f1 | ||
|
|
5d37a36c21 | ||
|
|
3a499766af | ||
|
|
cea797b6d0 | ||
|
|
37b41b0e20 | ||
|
|
1105c46f08 | ||
|
|
1df7b41edd | ||
|
|
f76c71c950 | ||
|
|
cd77384bd9 | ||
|
|
64adc9d6c1 | ||
|
|
e9095e50a6 | ||
|
|
acfa742b4f | ||
|
|
a79c48cba0 | ||
|
|
904ef5ccea | ||
|
|
3db281c87f | ||
|
|
076e6e99e4 | ||
|
|
32f6ac0310 | ||
|
|
b8706ea432 | ||
|
|
509d6c7900 | ||
|
|
51454d828c | ||
|
|
59449886f5 | ||
|
|
601e9895cc | ||
|
|
1ba8b46990 | ||
|
|
7ed34caa56 | ||
|
|
fc40521420 | ||
|
|
cfdd836e01 | ||
|
|
083e00ddbf | ||
|
|
c41c7c4857 | ||
|
|
4bde51dc38 | ||
|
|
38c7540145 | ||
|
|
a44579d4a1 | ||
|
|
7f2d6f12c0 | ||
|
|
daf1c4ddb6 | ||
|
|
c1372c5589 | ||
|
|
c623533271 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zy",
|
||||
"version": "2.1.0",
|
||||
"version": "2.3.7",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<Film v-show="view === 'Film'" />
|
||||
<Play v-show="view === 'Play'" />
|
||||
<Star v-show="view === 'Star'" />
|
||||
<History v-show="view === 'History'" />
|
||||
<Setting v-show="view === 'Setting'" />
|
||||
</div>
|
||||
<transition name="slide">
|
||||
|
||||
@@ -78,16 +78,43 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zy-checkbox{
|
||||
position: relative;
|
||||
display: flex;
|
||||
width: 200px;
|
||||
height: 30px;
|
||||
border-radius: 3px;
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
.search-all-check-input{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
// table
|
||||
.zy-table{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
font-size: 15px;
|
||||
.tHeader{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
height: 50px;
|
||||
min-height: 50px;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid;
|
||||
.btn{
|
||||
user-select: none;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
.tBody{
|
||||
flex: 1;
|
||||
border-bottom: 1px solid;
|
||||
overflow: auto;
|
||||
ul{
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
@@ -136,7 +163,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// scroll
|
||||
.zy-scroll{
|
||||
&::-webkit-scrollbar{
|
||||
@@ -152,7 +178,6 @@
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
// loading
|
||||
.zy-loading{
|
||||
width: 100%;
|
||||
|
||||
@@ -32,8 +32,25 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--d-fc-1);
|
||||
background-color: var(--d-bgc-1);
|
||||
box-shadow: var(--d-bsc);
|
||||
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
|
||||
&:hover{
|
||||
box-shadow: var(--d-bsc-hover);
|
||||
}
|
||||
}
|
||||
.zy-table{
|
||||
color: var(--d-fc-2);
|
||||
.tHeader{
|
||||
border-bottom-color: var(--d-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
color: var(--d-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tBody{
|
||||
border-bottom-color: var(--d-c-3);
|
||||
ul{
|
||||
@@ -169,6 +186,11 @@
|
||||
box-shadow: var(--d-bsc);
|
||||
.title{
|
||||
color: var(--d-fc-1);
|
||||
.right {
|
||||
svg {
|
||||
fill: var(--d-fc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.more{
|
||||
@@ -192,6 +214,10 @@
|
||||
fill: var(--d-c-3);
|
||||
}
|
||||
}
|
||||
&.last-tip {
|
||||
color: var(--d-fc-1);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +247,9 @@
|
||||
background-color: var(--d-c-2);
|
||||
color: var(--d-fc-3);
|
||||
}
|
||||
&:hover{
|
||||
background-color: var(--d-c-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-history{
|
||||
@@ -316,4 +345,8 @@
|
||||
background-color: var(--d-bgc-1);
|
||||
}
|
||||
}
|
||||
.history{
|
||||
background-color: var(--d-bgc-1);
|
||||
box-shadow: var(--d-bsc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,25 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--g-fc-1);
|
||||
background-color: var(--g-bgc-1);
|
||||
box-shadow: var(--g-bsc);
|
||||
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
|
||||
&:hover{
|
||||
box-shadow: var(--g-bsc-hover);
|
||||
}
|
||||
}
|
||||
.zy-table{
|
||||
color: var(--g-fc-2);
|
||||
.tHeader{
|
||||
border-bottom-color: var(--g-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
color: var(--g-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tBody{
|
||||
border-bottom-color: var(--g-c-3);
|
||||
ul{
|
||||
@@ -169,6 +186,11 @@
|
||||
box-shadow: var(--g-bsc);
|
||||
.title{
|
||||
color: var(--g-fc-1);
|
||||
.right {
|
||||
svg {
|
||||
fill: var(--g-fc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.more{
|
||||
@@ -192,6 +214,10 @@
|
||||
fill: var(--g-c-3);
|
||||
}
|
||||
}
|
||||
&.last-tip {
|
||||
color: var(--g-fc-1);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +247,9 @@
|
||||
background-color: var(--g-c-2);
|
||||
color: var(--g-fc-3);
|
||||
}
|
||||
&:hover{
|
||||
background-color: var(--d-c-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-history{
|
||||
@@ -316,4 +345,8 @@
|
||||
background-color: var(--g-bgc-1);
|
||||
}
|
||||
}
|
||||
.history{
|
||||
background-color: var(--g-bgc-1);
|
||||
box-shadow: var(--g-bsc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,25 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--l-fc-1);
|
||||
background-color: var(--l-bgc-1);
|
||||
box-shadow: var(--l-bsc);
|
||||
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
|
||||
&:hover{
|
||||
box-shadow: var(--l-bsc-hover);
|
||||
}
|
||||
}
|
||||
.zy-table{
|
||||
color: var(--l-fc-2);
|
||||
.tHeader{
|
||||
border-bottom-color: var(--l-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
color: var(--l-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tBody{
|
||||
border-bottom-color: var(--l-c-3);
|
||||
ul{
|
||||
@@ -169,6 +186,11 @@
|
||||
box-shadow: var(--l-bsc);
|
||||
.title{
|
||||
color: var(--l-fc-1);
|
||||
.right {
|
||||
svg {
|
||||
fill: var(--l-fc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.more{
|
||||
@@ -192,6 +214,10 @@
|
||||
fill: var(--l-c-3);
|
||||
}
|
||||
}
|
||||
&.last-tip {
|
||||
color: var(--l-fc-1);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +247,9 @@
|
||||
background-color: var(--l-c-2);
|
||||
color: var(--l-fc-3);
|
||||
}
|
||||
&:hover{
|
||||
background-color: var(--d-c-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-history{
|
||||
@@ -316,4 +345,8 @@
|
||||
background-color: var(--l-bgc-1);
|
||||
}
|
||||
}
|
||||
.history{
|
||||
background-color: var(--l-bgc-1);
|
||||
box-shadow: var(--l-bsc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,8 +32,25 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--p-fc-1);
|
||||
background-color: var(--p-bgc-1);
|
||||
box-shadow: var(--p-bsc);
|
||||
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
|
||||
&:hover{
|
||||
box-shadow: var(--p-bsc-hover);
|
||||
}
|
||||
}
|
||||
.zy-table{
|
||||
color: var(--p-fc-2);
|
||||
.tHeader{
|
||||
border-bottom-color: var(--p-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
color: var(--p-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.tBody{
|
||||
border-bottom-color: var(--p-c-3);
|
||||
ul{
|
||||
@@ -169,6 +186,11 @@
|
||||
box-shadow: var(--p-bsc);
|
||||
.title{
|
||||
color: var(--p-fc-1);
|
||||
.right {
|
||||
svg {
|
||||
fill: var(--p-fc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.more{
|
||||
@@ -192,6 +214,10 @@
|
||||
fill: var(--p-c-3);
|
||||
}
|
||||
}
|
||||
&.last-tip {
|
||||
color: var(--p-fc-1);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +247,9 @@
|
||||
background-color: var(--p-c-2);
|
||||
color: var(--p-fc-3);
|
||||
}
|
||||
&:hover{
|
||||
background-color: var(--d-c-3);
|
||||
}
|
||||
}
|
||||
}
|
||||
.list-history{
|
||||
@@ -316,4 +345,8 @@
|
||||
background-color: var(--p-bgc-1);
|
||||
}
|
||||
}
|
||||
.history{
|
||||
background-color: var(--p-bgc-1);
|
||||
box-shadow: var(--p-bsc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@ import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
|
||||
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||
|
||||
// 允许跨域
|
||||
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors')
|
||||
|
||||
let win
|
||||
let mini
|
||||
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
<path d="M12,21 L10.55,19.7051771 C5.4,15.1242507 2,12.1029973 2,8.39509537 C2,5.37384196 4.42,3 7.5,3 C9.24,3 10.91,3.79455041 12,5.05013624 C13.09,3.79455041 14.76,3 16.5,3 C19.58,3 22,5.37384196 22,8.39509537 C22,12.1029973 18.6,15.1242507 13.45,19.7149864 L12,21 Z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<span :class="[view === 'History' ? 'active ': ''] + 'zy-svg'" @click="changeView('History')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="timeIconTitle">
|
||||
<title id="timeIconTitle">历史记录</title>
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<polyline points="12 5 12 12 16 16"></polyline>
|
||||
</svg>
|
||||
</span>
|
||||
<span :class="[view === 'Setting' ? 'active ': ''] + 'zy-svg'" @click="changeView('Setting')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="settingsIconTitle">
|
||||
<title id="settingsIconTitle">setting</title>
|
||||
|
||||
@@ -121,9 +121,9 @@ export default {
|
||||
playEvent (n) {
|
||||
history.find({ site: this.detail.key, ids: this.detail.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n } }
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n, site: this.detail.site } }
|
||||
} else {
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.id, name: this.detail.info.name, index: n } }
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.id, name: this.detail.info.name, index: n, site: this.detail.site } }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -131,17 +131,19 @@ export default {
|
||||
this.detail.show = false
|
||||
},
|
||||
starEvent () {
|
||||
star.find({ site: this.detail.key, ids: this.info.id }).then(res => {
|
||||
star.find({ key: this.detail.site.key, ids: this.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.$message.info('已存在')
|
||||
} else {
|
||||
const docs = {
|
||||
site: this.detail.key,
|
||||
key: this.detail.site.key,
|
||||
site: this.detail.site,
|
||||
ids: this.info.id,
|
||||
name: this.info.name,
|
||||
type: this.info.type,
|
||||
year: this.info.year,
|
||||
last: this.info.last
|
||||
last: this.info.last,
|
||||
note: this.info.note
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
this.$message.success('收藏成功')
|
||||
|
||||
@@ -18,14 +18,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="zy-select" @mouseleave="show.search = false">
|
||||
<div class="vs-input" @click="show.search = true"><input v-model.trim="searchTxt" type="text" placeholder="搜索" @keyup.enter="searchEvent"></div>
|
||||
<div class="vs-input" @click="show.search = true"><input v-model.trim="searchTxt" type="text" placeholder="搜索" @keyup.enter="searchEvent(searchTxt)"></div>
|
||||
<div class="vs-options" v-show="show.search">
|
||||
<ul class="zy-scroll" style="max-height: 600px">
|
||||
<li v-for="(i, j) in searchList" :key="j" @click="searchClickEvent(i)">{{i.keywords}}</li>
|
||||
<li v-for="(i, j) in searchList" :key="j" @click="searchEvent(i.keywords)">{{i.keywords}}</li>
|
||||
<li v-show="searchList.length >= 1" @click="clearSearch">清空历史记录</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="zy-checkbox">
|
||||
<input type="checkbox" v-model="searchAllSites" class="search-all-check-input" > 搜索所有资源
|
||||
</div>
|
||||
</div>
|
||||
<div class="body zy-scroll" infinite-wrapper>
|
||||
<div class="body-box" v-show="!show.find">
|
||||
@@ -37,16 +40,16 @@
|
||||
<template slot="item" slot-scope="props">
|
||||
<div class="card">
|
||||
<div class="img">
|
||||
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(props.data)">
|
||||
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(site, props.data)">
|
||||
<div class="operate">
|
||||
<div class="operate-wrap">
|
||||
<span class="o-play" @click="playEvent(props.data)">播放</span>
|
||||
<span class="o-star" @click="starEvent(props.data)">收藏</span>
|
||||
<span class="o-share" @click="shareEvent(props.data)">分享</span>
|
||||
<span class="o-play" @click="playEvent(site, props.data)">播放</span>
|
||||
<span class="o-star" @click="starEvent(site, props.data)">收藏</span>
|
||||
<span class="o-share" @click="shareEvent(site, props.data)">分享</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
|
||||
<div class="name" @click="detailEvent(site, props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.year}}</span>
|
||||
<span>{{props.data.type}}</span>
|
||||
@@ -60,16 +63,16 @@
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<ul>
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(i)">
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(site, i)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="last">{{i.last}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn" @click.stop="playEvent(site, i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(site, i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(site, i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(site, i)">下载</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -83,16 +86,18 @@
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<ul>
|
||||
<li v-for="(i, j) in searchContents" :key="j" @click="detailEvent(i)">
|
||||
<li v-for="(i, j) in searchContents" :key="j" @click="detailEvent(i.site, i)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="last">{{i.last}}</span>
|
||||
<span class="site">{{i.site.name}}</span>
|
||||
<span class="note">{{i.note}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn" @click.stop="playEvent(i.site, i)">播放</span>
|
||||
<span class="btn" @click.stop="starEvent(i.site, i)">收藏</span>
|
||||
<span class="btn" @click.stop="shareEvent(i.site, i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i.site, i)">下载</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -133,7 +138,8 @@ export default {
|
||||
infiniteId: +new Date(),
|
||||
searchList: [],
|
||||
searchTxt: '',
|
||||
searchContents: []
|
||||
searchContents: [],
|
||||
searchAllSites: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -275,35 +281,38 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
detailEvent (e) {
|
||||
detailEvent (site, e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: this.site.key,
|
||||
key: site.key,
|
||||
site: site,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
playEvent (e) {
|
||||
history.find({ site: this.site.key, ids: e.id }).then(res => {
|
||||
playEvent (site, e) {
|
||||
history.find({ site: site.key, ids: e.id }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index } }
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index, site: site } }
|
||||
} else {
|
||||
this.video = { key: this.site.key, info: { id: e.id, name: e.name, index: 0 } }
|
||||
this.video = { key: site.key, info: { id: e.id, name: e.name, index: 0, site: site } }
|
||||
}
|
||||
})
|
||||
this.view = 'Play'
|
||||
},
|
||||
starEvent (e) {
|
||||
star.find({ site: this.site.key, ids: e.id }).then(res => {
|
||||
starEvent (site, e) {
|
||||
star.find({ key: site.key, ids: e.id }).then(res => {
|
||||
if (res) {
|
||||
this.$message.info('已存在')
|
||||
} else {
|
||||
const docs = {
|
||||
site: this.site.key,
|
||||
key: site.key,
|
||||
site: site,
|
||||
ids: e.id,
|
||||
name: e.name,
|
||||
type: e.type,
|
||||
year: e.year,
|
||||
last: e.last
|
||||
last: e.last,
|
||||
note: e.note
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
this.$message.success('收藏成功')
|
||||
@@ -313,15 +322,15 @@ export default {
|
||||
this.$message.warning('收藏失败')
|
||||
})
|
||||
},
|
||||
shareEvent (e) {
|
||||
shareEvent (site, e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: this.site.key,
|
||||
key: site.key,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(this.site.key, e.id).then(res => {
|
||||
downloadEvent (site, e) {
|
||||
zy.download(site.key, e.id).then(res => {
|
||||
if (res.length > 0) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
@@ -338,7 +347,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
let m3u8List = []
|
||||
const dd = e.dl.dd
|
||||
const dd = res.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
@@ -376,8 +385,8 @@ export default {
|
||||
this.searchList = res.reverse()
|
||||
})
|
||||
},
|
||||
searchEvent () {
|
||||
const wd = this.searchTxt
|
||||
searchAllSitesEvent (sites, wd) {
|
||||
this.searchTxt = wd
|
||||
this.searchContents = []
|
||||
this.pagecount = 0
|
||||
this.show.search = false
|
||||
@@ -389,18 +398,24 @@ export default {
|
||||
}
|
||||
this.getAllSearch()
|
||||
})
|
||||
zy.search(this.site.key, wd).then(res => {
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
this.$message.info('无搜索结果')
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
this.searchContents.push(...res)
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
this.searchContents.push(res)
|
||||
}
|
||||
})
|
||||
sites.forEach(site =>
|
||||
zy.search(site.key, wd).then(res => {
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
this.$message.info(site.name + ' 无搜索结果')
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
res.forEach(element => {
|
||||
element.site = site
|
||||
this.searchContents.push(element)
|
||||
})
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
res.site = site
|
||||
this.searchContents.push(res)
|
||||
}
|
||||
})
|
||||
)
|
||||
} else {
|
||||
this.show.find = false
|
||||
this.getClass().then(res => {
|
||||
@@ -410,28 +425,14 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
searchClickEvent (e) {
|
||||
this.searchContents = []
|
||||
this.pagecount = 0
|
||||
this.searchTxt = e.keywords
|
||||
this.show.search = false
|
||||
this.show.find = true
|
||||
search.remove(e.id).then(res => {
|
||||
search.add({ keywords: e.keywords })
|
||||
this.getAllSearch()
|
||||
})
|
||||
zy.search(this.site.key, e.keywords).then(res => {
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
this.$message.info('无搜索结果')
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
this.searchContents.push(...res)
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
this.searchContents.push(res)
|
||||
}
|
||||
})
|
||||
searchEvent (wd) {
|
||||
var sites = []
|
||||
if (this.searchAllSites) {
|
||||
sites.push(...this.sites)
|
||||
} else {
|
||||
sites.push(this.site)
|
||||
}
|
||||
this.searchAllSitesEvent(sites, wd)
|
||||
},
|
||||
clearSearch () {
|
||||
search.clear().then(res => {
|
||||
|
||||
189
src/components/History.vue
Normal file
189
src/components/History.vue
Normal file
@@ -0,0 +1,189 @@
|
||||
<template>
|
||||
<div class="history">
|
||||
<div class="body zy-scroll">
|
||||
<div class="zy-table">
|
||||
<div class="tHeader">
|
||||
<span class="btn" @click="clearAllHistory">清空</span>
|
||||
</div>
|
||||
<div class="tBody zy-scroll">
|
||||
<ul>
|
||||
<li v-show="this.history.length === 0">无数据</li>
|
||||
<li v-for="(i, j) in history" :key="j" @click="historyItemEvent(i)">
|
||||
<span class="name" @click.stop="playEvent(i)">{{i.name}}</span>
|
||||
<span class="site">{{getSiteName(i.site)}}</span>
|
||||
<span class="index">第{{i.index+1}}集</span>
|
||||
<span class="operate" style="width: 220px">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn" @click.stop="removeHistoryItem(i)">删除</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { history, sites } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'history',
|
||||
data () {
|
||||
return {
|
||||
history: history,
|
||||
sites: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
view: {
|
||||
get () {
|
||||
return this.$store.getters.getView
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
return this.$store.getters.getVideo
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIDEO(val)
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
get () {
|
||||
return this.$store.getters.getDetail
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DETAIL(val)
|
||||
}
|
||||
},
|
||||
share: {
|
||||
get () {
|
||||
return this.$store.getters.getShare
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
this.getAllhistory()
|
||||
this.getAllsites()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: e.site,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name
|
||||
}
|
||||
}
|
||||
},
|
||||
playEvent (e) {
|
||||
history.find({ site: e.site, ids: e.ids }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index } }
|
||||
} else {
|
||||
this.video = { key: e.site, info: { id: e.ids, name: e.name, index: 0 } }
|
||||
}
|
||||
})
|
||||
this.view = 'Play'
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.site, e.ids).then(res => {
|
||||
if (res) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
}
|
||||
})
|
||||
},
|
||||
clearAllHistory () {
|
||||
history.clear().then(res => {
|
||||
this.history = []
|
||||
})
|
||||
},
|
||||
getAllhistory () {
|
||||
history.all().then(res => {
|
||||
this.history = res.reverse()
|
||||
})
|
||||
},
|
||||
getAllsites () {
|
||||
sites.all().then(res => {
|
||||
this.sites = res
|
||||
})
|
||||
},
|
||||
getSiteName (key) {
|
||||
var site = this.sites.find(e => e.key === key)
|
||||
return site.name
|
||||
},
|
||||
historyItemEvent (e) {
|
||||
this.video = {
|
||||
key: e.site,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name,
|
||||
type: e.type,
|
||||
year: e.year,
|
||||
index: e.index,
|
||||
time: e.time
|
||||
}
|
||||
}
|
||||
},
|
||||
removeHistoryItem (e) {
|
||||
history.remove(e.id).then(res => {
|
||||
this.getAllhistory()
|
||||
}).catch(err => {
|
||||
this.$message.warning('删除历史记录失败, 错误信息: ' + err)
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getAllhistory()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.history{
|
||||
position: relative;
|
||||
height: calc(100% - 40px);
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 5px;
|
||||
.body{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,6 +3,11 @@
|
||||
<div class="box">
|
||||
<div class="title">
|
||||
<span v-if="this.right.list.length > 1">『第 {{(video.info.index + 1)}} 集』</span>{{name}}
|
||||
<span v-if="video.key" class="right" @click="issueEvent" title="复制调试信息">
|
||||
<svg t="1596338860607" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3127" width="24" height="24">
|
||||
<path d="M503.803829 63.578014c-247.050676 0-447.328072 200.277396-447.328072 447.327048 0 247.054769 200.277396 447.333188 447.328072 447.333188 247.054769 0 447.332165-200.278419 447.332165-447.333188C951.13497 263.85541 750.858598 63.578014 503.803829 63.578014L503.803829 63.578014zM503.803829 894.313336c-211.749682 0-383.408273-171.659615-383.408273-383.408273 0-211.749682 171.659615-383.40725 383.408273-383.40725 211.753775 0 383.412366 171.658591 383.412366 383.40725C887.216195 722.653721 715.557604 894.313336 503.803829 894.313336L503.803829 894.313336zM447.745069 255.897158l127.914298 0L575.659367 383.576095 447.745069 383.576095 447.745069 255.897158 447.745069 255.897158zM447.745069 425.470251l127.914298 0 0 342.058516L447.745069 767.528767 447.745069 425.470251 447.745069 425.470251zM447.745069 425.470251" p-id="3128"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="player">
|
||||
<div id="xgplayer"></div>
|
||||
@@ -70,6 +75,7 @@
|
||||
<rect x="17" y="6" width="1" height="1"></rect>
|
||||
</svg>
|
||||
</span>
|
||||
<span class="last-tip" v-if="!video.key && right.history.length > 0" @click="historyItemEvent(right.history[0])">上次播放到【{{right.history[0].site}}】{{right.history[0].name}} 第{{right.history[0].index+1}}集</span>
|
||||
</div>
|
||||
</div>
|
||||
<transition name="slideX">
|
||||
@@ -85,12 +91,12 @@
|
||||
</div>
|
||||
<div class="list-body zy-scroll" :style="{overflowY:scroll? 'auto' : 'hidden',paddingRight: scroll ? '0': '5px' }" @mouseenter="scroll = true" @mouseleave="scroll = false">
|
||||
<ul v-show="right.type === 'list'" class="list-item">
|
||||
<li v-show="right.history.length > 1" @click="exportM3u8">导出</li>
|
||||
<li v-show="right.list.length > 0" @click="exportM3u8">导出</li>
|
||||
<li v-show="right.list.length === 0">无数据</li>
|
||||
<li @click="listItemEvent(j)" :class="video.info.index === j ? 'active' : ''" v-for="(i, j) in right.list" :key="j">{{i | ftName(j)}}</li>
|
||||
</ul>
|
||||
<ul v-show="right.type === 'history'" class="list-history">
|
||||
<li v-show="right.history.length > 1" @click="clearAllHistory">清空</li>
|
||||
<li v-show="right.history.length > 0" @click="clearAllHistory">清空</li>
|
||||
<li v-show="right.history.length === 0">无数据</li>
|
||||
<li @click="historyItemEvent(m)" :class="video.info.id === m.ids ? 'active' : ''" v-for="(m, n) in right.history" :key="n"><span class="title" :title="'【' + m.site + '】' + m.name + ' 第' + (m.index+1) + '集'">【{{m.site}}】{{m.name}} 第{{m.index+1}}集</span><span @click.stop="removeHistoryItem(m)" class="detail-delete">删除</span></li>
|
||||
</ul>
|
||||
@@ -106,7 +112,7 @@ import zy from '../lib/site/tools'
|
||||
import Player from 'xgplayer'
|
||||
import Hls from 'xgplayer-hls.js'
|
||||
import mt from 'mousetrap'
|
||||
const { remote, ipcRenderer } = require('electron')
|
||||
const { remote, ipcRenderer, clipboard } = require('electron')
|
||||
|
||||
const VIDEO_DETAIL_CACHE = {}
|
||||
|
||||
@@ -132,7 +138,6 @@ const addPlayerBtn = function (event, svg, attrs) {
|
||||
|
||||
const addPlayerView = function (event, tpl, attrs) {
|
||||
const player = this
|
||||
console.log(player)
|
||||
const util = Player.util
|
||||
const rootEl = player.root
|
||||
const viewConfig = player.config[event]
|
||||
@@ -321,57 +326,6 @@ export default {
|
||||
this.xg.off('ended')
|
||||
})
|
||||
})
|
||||
// const id = this.video.info.id
|
||||
// zy.detail(this.video.key, id).then(res => {
|
||||
// this.name = res.name
|
||||
// const dd = res.dl.dd
|
||||
// const type = Object.prototype.toString.call(dd)
|
||||
// let m3u8Txt = []
|
||||
// if (type === '[object Array]') {
|
||||
// for (const i of dd) {
|
||||
// if (i._t.indexOf('m3u8') >= 0) {
|
||||
// m3u8Txt = i._t.split('#')
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// m3u8Txt = dd._t.split('#')
|
||||
// }
|
||||
// this.right.list = m3u8Txt
|
||||
// const m3u8Arr = []
|
||||
// for (const i of m3u8Txt) {
|
||||
// const j = i.split('$')
|
||||
// if (j.length > 1) {
|
||||
// for (let m = 0; m < j.length; m++) {
|
||||
// if (j[m].indexOf('m3u8') >= 0) {
|
||||
// m3u8Arr.push(j[m])
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// m3u8Arr.push(j[0])
|
||||
// }
|
||||
// }
|
||||
|
||||
// this.xg.src = m3u8Arr[index]
|
||||
// this.showNext = m3u8Arr.length > 1
|
||||
|
||||
// if (time !== 0) {
|
||||
// this.xg.play()
|
||||
// this.xg.once('playing', () => {
|
||||
// this.xg.currentTime = time
|
||||
// })
|
||||
// } else {
|
||||
// this.xg.play()
|
||||
// }
|
||||
|
||||
// this.videoPlaying()
|
||||
// this.xg.once('ended', () => {
|
||||
// if (m3u8Arr.length > 1 && (m3u8Arr.length - 1 > index)) {
|
||||
// this.video.info.time = 0
|
||||
// this.video.info.index++
|
||||
// }
|
||||
// this.xg.off('ended')
|
||||
// })
|
||||
// })
|
||||
},
|
||||
fetchM3u8List () {
|
||||
return new Promise((resolve) => {
|
||||
@@ -401,8 +355,9 @@ export default {
|
||||
const j = i.split('$')
|
||||
if (j.length > 1) {
|
||||
for (let m = 0; m < j.length; m++) {
|
||||
if (j[m].indexOf('m3u8') >= 0) {
|
||||
if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) {
|
||||
m3u8Arr.push(j[m])
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -497,9 +452,7 @@ export default {
|
||||
this.right.show = true
|
||||
this.right.type = 'history'
|
||||
}
|
||||
history.all().then(res => {
|
||||
this.right.history = res.reverse()
|
||||
})
|
||||
this.getAllhistory()
|
||||
},
|
||||
getAllhistory () {
|
||||
history.all().then(res => {
|
||||
@@ -508,20 +461,19 @@ export default {
|
||||
},
|
||||
starEvent () {
|
||||
const info = this.video.info
|
||||
star.find({ site: this.video.key, ids: info.id }).then(res => {
|
||||
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
||||
if (res) {
|
||||
star.remove(res.id).then(e => {
|
||||
this.$message.info('取消收藏')
|
||||
this.isStar = false
|
||||
})
|
||||
this.$message.info('已存在')
|
||||
} else {
|
||||
const docs = {
|
||||
site: this.video.key,
|
||||
key: this.video.key,
|
||||
site: this.video.site,
|
||||
ids: info.id,
|
||||
name: info.name,
|
||||
type: info.type,
|
||||
year: info.year,
|
||||
last: info.last
|
||||
last: info.last,
|
||||
note: info.note
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
this.$message.success('收藏成功')
|
||||
@@ -571,6 +523,18 @@ export default {
|
||||
info: this.video.info
|
||||
}
|
||||
},
|
||||
issueEvent () {
|
||||
const info = {
|
||||
video: this.video,
|
||||
list: this.right.list,
|
||||
m3u8List: VIDEO_DETAIL_CACHE[this.video.key + '@' + this.video.info.id] || [],
|
||||
playerError: this.xg.error || '',
|
||||
playerState: this.xg.readyState || '',
|
||||
networkState: this.xg.networkState || ''
|
||||
}
|
||||
clipboard.writeText(JSON.stringify(info, null, 4))
|
||||
this.$message.success('视频信息复制成功')
|
||||
},
|
||||
checkStar () {
|
||||
star.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
@@ -595,8 +559,9 @@ export default {
|
||||
let link, name
|
||||
if (j.length > 1) {
|
||||
for (let m = 0; m < j.length; m++) {
|
||||
if (j[m].indexOf('m3u8') >= 0) {
|
||||
if (j[m].indexOf('.m3u8') >= 0 && j[m].startsWith('http')) {
|
||||
link = j[m]
|
||||
break
|
||||
}
|
||||
}
|
||||
name = j[0]
|
||||
@@ -609,25 +574,19 @@ export default {
|
||||
link: link
|
||||
})
|
||||
}
|
||||
|
||||
console.log(m3u8Arr)
|
||||
|
||||
let m3u8Content = `#EXTM3U
|
||||
`
|
||||
let m3u8Content = '#EXTM3U'
|
||||
for (const item of m3u8Arr) {
|
||||
m3u8Content += `#EXTINF:-1, ${item.name}
|
||||
${item.link}
|
||||
`
|
||||
m3u8Content += `#EXTINF:-1, ${item.name}\n${item.link}`
|
||||
}
|
||||
const blob = new Blob([m3u8Content], { type: 'application/vnd.apple.mpegurl' })
|
||||
const downloadElement = document.createElement('a') // 创建下载的链接
|
||||
const downloadElement = document.createElement('a')
|
||||
const href = window.URL.createObjectURL(blob)
|
||||
downloadElement.href = href
|
||||
downloadElement.download = `${this.name}.m3u8` // 下载后的文件名
|
||||
downloadElement.download = `${this.name}.m3u8`
|
||||
document.body.appendChild(downloadElement)
|
||||
downloadElement.click() // 下载
|
||||
document.body.removeChild(downloadElement) // 下载完成 移除 a
|
||||
window.URL.revokeObjectURL(href) // 释放blob对象
|
||||
downloadElement.click()
|
||||
document.body.removeChild(downloadElement)
|
||||
window.URL.revokeObjectURL(href)
|
||||
},
|
||||
clearAllHistory () {
|
||||
history.clear().then(res => {
|
||||
@@ -869,6 +828,7 @@ ${item.link}
|
||||
}
|
||||
},
|
||||
refreshHistory () {
|
||||
this.getAllhistory()
|
||||
let ul = document.querySelector('xg-btn-showhistory ul')
|
||||
if (!ul) {
|
||||
ul = document.createElement('ul')
|
||||
@@ -945,7 +905,6 @@ ${item.link}
|
||||
this.mtEvent()
|
||||
},
|
||||
mounted () {
|
||||
console.log(this)
|
||||
Player.install('playPrev', function () {
|
||||
addPlayerBtn.bind(this, 'playPrev', '<svg t="1595866093990" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3657" style="width: 20px;height: 20px;margin-top: 11px;margin-left: 9px;" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M98.583851 3.180124h190.807453a31.801242 31.801242 0 0 1 31.801243 31.801242v387.021118L902.201242 10.176398l11.130435-7.632299A31.801242 31.801242 0 0 1 957.217391 31.801242v960.397516a31.801242 31.801242 0 0 1-43.885714 29.257143l-11.130435-7.632299L321.192547 601.997516V989.018634a31.801242 31.801242 0 0 1-31.801243 31.801242H98.583851a31.801242 31.801242 0 0 1-31.801242-31.801242v-954.037268a31.801242 31.801242 0 0 1 31.801242-31.801242z" p-id="3658" fill="#ffffff"></path></svg>', { title: '上一集' })()
|
||||
})
|
||||
@@ -971,10 +930,6 @@ ${item.link}
|
||||
|
||||
this.xg = new Hls(this.config)
|
||||
ipcRenderer.on('miniClosed', () => {
|
||||
// this.xg.destroy()
|
||||
// this.xg = new Hls(this.config)
|
||||
// this.bindEvent()
|
||||
// 同步进度
|
||||
history.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
if (this.video.info.index !== res.index) {
|
||||
@@ -1145,6 +1100,13 @@ ${item.link}
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
padding: 0 10px;
|
||||
.right {
|
||||
float: right;
|
||||
svg {
|
||||
margin-top: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.player{
|
||||
width: 100%;
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
<div class="clearDB">
|
||||
<span @click="clearDBEvent" class="clearBtn">软件重置</span>
|
||||
<span class="clearTips">如非必要, 切勿点击. 会清空用户数据, 恢复默认设置. 点击即软件重置, 并关闭软件.</span>
|
||||
<span class="clearTips">如果新安装用户, 无法显示资源, 请点击软件重置. 如非必要, 切勿点击. 会清空用户数据, 恢复默认设置. 点击即软件重置, 并关闭软件.</span>
|
||||
</div>
|
||||
<div class="Tips">
|
||||
<span>所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容, 禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.</span>
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
<template>
|
||||
<div class="star">
|
||||
<div class="body zy-scroll">
|
||||
<div class="body">
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<div class="tHeader">
|
||||
<span class="btn" @click="updateAllEvent(list)">同步所有收藏</span>
|
||||
</div>
|
||||
<div class="tBody zy-scroll">
|
||||
<ul>
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(i)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="from">{{i.site}}</span>
|
||||
<span class="from">{{i.site.name}}</span>
|
||||
<span class="note">{{i.note}}</span>
|
||||
<span class="operate" style="width: 220px">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="deleteEvent(i)">删除</span>
|
||||
@@ -79,7 +83,7 @@ export default {
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: e.site,
|
||||
key: e.site.key,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name
|
||||
@@ -87,11 +91,11 @@ export default {
|
||||
}
|
||||
},
|
||||
playEvent (e) {
|
||||
history.find({ site: e.site, ids: e.ids }).then(res => {
|
||||
history.find({ site: e.site.key, ids: e.ids }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index } }
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index, site: e.site } }
|
||||
} else {
|
||||
this.video = { key: e.site, info: { id: e.ids, name: e.name, index: 0 } }
|
||||
this.video = { key: e.site.key, info: { id: e.ids, name: e.name, index: 0, site: e.site } }
|
||||
}
|
||||
})
|
||||
this.view = 'Play'
|
||||
@@ -109,14 +113,15 @@ export default {
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.site,
|
||||
key: e.site.key,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
updateEvent (e) {
|
||||
zy.detail(e.site, e.ids).then(res => {
|
||||
zy.detail(e.site.key, e.ids).then(res => {
|
||||
if (e.last === res.last) {
|
||||
this.$message.info('同步成功, 未查询到更新。')
|
||||
var msg = `同步"${e.name}"成功, 未查询到更新。`
|
||||
this.$message.info(msg)
|
||||
} else {
|
||||
const doc = {
|
||||
id: e.id,
|
||||
@@ -125,18 +130,27 @@ export default {
|
||||
name: res.name,
|
||||
site: e.site,
|
||||
type: res.type,
|
||||
year: res.year
|
||||
year: res.year,
|
||||
note: res.note
|
||||
}
|
||||
star.update(e.id, doc).then(res => {
|
||||
this.$message.success('同步成功, 检查到更新.')
|
||||
var msg = `同步"${e.name}"成功, 检查到更新。`
|
||||
this.$message.success(msg)
|
||||
})
|
||||
this.getStarList()
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.warning('同步失败, 请重试', err)
|
||||
var msg = `同步"${e.name}"失败, 请重试。`
|
||||
this.$message.warning(msg, err)
|
||||
})
|
||||
},
|
||||
updateAllEvent (list) {
|
||||
list.forEach(e => {
|
||||
this.updateEvent(e)
|
||||
})
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.site, e.ids).then(res => {
|
||||
zy.download(e.site.key, e.ids).then(res => {
|
||||
if (res) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
@@ -186,7 +200,6 @@ export default {
|
||||
.body{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -7,6 +7,7 @@ import Star from './Star'
|
||||
import Setting from './Setting'
|
||||
import Detail from './Detail'
|
||||
import Share from './Share'
|
||||
import History from './History'
|
||||
|
||||
export default {
|
||||
registerComponents () {
|
||||
@@ -18,5 +19,6 @@ export default {
|
||||
Vue.component('Setting', Setting)
|
||||
Vue.component('Detail', Detail)
|
||||
Vue.component('Share', Share)
|
||||
Vue.component('History', History)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
<span class="progress" v-show="progress > 0">播放进度: {{progress}}%</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span class="top" @click="frameClickEvent('top')" title="置顶">
|
||||
<svg t="1595919317571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1188" style="width:12px;height:16px"><path d="M43.072 974.72l380.864-301.952 151.936 161.6c0 0 63.424 17.28 67.328-30.72l-3.904-163.584 225.088-259.648 98.048-5.696c0 0 76.928-15.488 21.184-82.752l-275.072-276.928c0 0-74.944-9.6-69.248 59.584l0 75.008L383.552 367.104 225.856 376.64c0 0-57.728 19.2-36.608 69.248l148.16 146.176L43.072 974.72 43.072 974.72z" p-id="1189" :fill="isAlwaysOnTop ? '#555555' : '#ffffff'"></path></svg>
|
||||
</span>
|
||||
<span class="min" @click="frameClickEvent('min')" title="最小化">
|
||||
<svg t="1595917239849" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" style="width:10px;height:16px"><path d="M0 479.936C0 444.64 28.448 416 64.064 416L959.936 416C995.328 416 1024 444.736 1024 479.936L1024 544.064C1024 579.392 995.552 608 959.936 608L64.064 608C28.672 608 0 579.264 0 544.064L0 479.936Z" p-id="1156" fill="#ffffff"></path></svg>
|
||||
</span>
|
||||
<span class="close" @click="frameClickEvent('close')" title="关闭">
|
||||
<svg t="1595917372551" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1685" style="width:10px;height:16px"><path d="M511.968 376.224 796.096 92.096C833.536 54.624 894.4 54.624 931.84 92.096 969.312 129.568 969.312 190.4 931.84 227.872L647.744 512 931.84 796.096C969.312 833.568 969.312 894.4 931.84 931.872 894.4 969.344 833.536 969.344 796.096 931.872L511.968 647.744 227.84 931.872C190.4 969.344 129.536 969.344 92.096 931.872 54.624 894.4 54.624 833.568 92.096 796.096L376.224 512 92.096 227.872C54.624 190.4 54.624 129.568 92.096 92.096 129.536 54.624 190.4 54.624 227.84 92.096L511.968 376.224Z" p-id="1686" fill="#ffffff"></path></svg>
|
||||
</span>
|
||||
<span class="top" @click="frameClickEvent('top')" title="置顶">
|
||||
<svg t="1595919317571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1188" style="width:12px;height:16px"><path d="M43.072 974.72l380.864-301.952 151.936 161.6c0 0 63.424 17.28 67.328-30.72l-3.904-163.584 225.088-259.648 98.048-5.696c0 0 76.928-15.488 21.184-82.752l-275.072-276.928c0 0-74.944-9.6-69.248 59.584l0 75.008L383.552 367.104 225.856 376.64c0 0-57.728 19.2-36.608 69.248l148.16 146.176L43.072 974.72 43.072 974.72z" p-id="1189" :fill="isAlwaysOnTop ? '#555555' : '#ffffff'"></path></svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bottom">
|
||||
|
||||
Reference in New Issue
Block a user