Compare commits

...

38 Commits

Author SHA1 Message Date
haiyangcui
17be5d45f1 v2.6.2 2020-11-03 17:16:51 +01:00
haiyangcui
f493fcd24e 屏蔽福利片checkbox可以直接关联setting.excludeR18Films 2020-11-03 17:06:05 +01:00
haiyangcui
d040bc01fc 更新收藏导出时的提示 2020-11-03 16:45:38 +01:00
haiyangcui
6644c97811 导入收藏时,deep copy当前的list,否则列表会在没有排序好之前就被展示 2020-11-03 16:39:00 +01:00
haiyangcui
68960ab5bb 改进star的导入导出时的排序问题 2020-11-03 16:34:12 +01:00
haiyangcui
46de044214 统一海报视图 2020-11-03 15:46:48 +01:00
haiyangcui
0cbf9ca7fb 改进推荐页面排序问题 2020-11-03 15:41:15 +01:00
haiyangcui
6fa40af9bd 更新推荐 2020-11-03 15:23:38 +01:00
haiyangcui
7343f1824a 集中豆瓣评分和豆瓣链接获取功能到tools中 2020-11-03 14:57:07 +01:00
haiyangcui
3df0665950 改进过滤关键词 2020-11-03 14:13:26 +01:00
haiyangcui
022b1b28ad 改进Film页面刷新的逻辑,避免不必要的刷新 2020-11-03 13:56:41 +01:00
haiyangcui
55d1740354 移动"屏蔽福利片"到源编辑页面 2020-11-03 12:58:34 +01:00
haiyangcui
9d71991103 如果开启屏蔽福利片选项,也过滤搜索结果 2020-11-02 22:08:38 +01:00
haiyangcui
361e24ecad 引入vue-clickaway 2020-11-02 21:28:29 +01:00
haiyangcui
53f80d2cce 点击换源后,不需要关闭换源窗口.用户可以等待新源确定工作后自行关闭 2020-11-02 21:09:53 +01:00
haiyangcui
880dd9ff35 重新解决换源时间进度问题,发现记录this.video.info.time的话,视频会卡一下 2020-11-02 18:03:47 +01:00
haiyangcui
42c89120da 如果没有任何收藏有更新时,发消息提醒用户'未查询到任何更新' 2020-11-02 17:54:43 +01:00
haiyangcui
d990aa92b0 记录当前播放时间this.video.info.time, 解决换源时时间进度定位问题 2020-11-02 16:23:05 +01:00
haiyangcui
e117564ecb 在style.css里统一定义el-select的样式 2020-11-02 12:11:45 +01:00
haiyangcui
99592e3fcb 改进el-select样式,设置不同主题下的背景色等 2020-11-02 11:21:33 +01:00
Hunlongyu
adc8fd4329 🍁 修复因为分类异常, 导致资源加载不出来. 2020-11-02 13:44:10 +08:00
haiyangcui
579caddaeb 更新推荐 2020-11-01 23:29:49 +01:00
haiyangcui
1d5344f292 更新推荐 2020-11-01 23:19:32 +01:00
haiyangcui
22dc74ea3a 更新推荐 2020-11-01 23:15:39 +01:00
haiyangcui
72d7c91540 更新推荐 2020-11-01 22:38:46 +01:00
haiyangcui
ef874d1831 v2.6.1 2020-11-01 18:36:08 +01:00
haiyangcui
bb9a8ca65d 获取其他源时,排除当前源 2020-11-01 18:03:33 +01:00
haiyangcui
747abf3b26 设置密码对话框的宽度 2020-11-01 17:41:20 +01:00
haiyangcui
1078cf3c63 修复自动更新功能 2020-11-01 17:29:57 +01:00
haiyangcui
22b877b0fb 定义不同的waterfall的ref 2020-11-01 17:24:29 +01:00
haiyangcui
34e6b8bd08 更新推荐 2020-11-01 14:02:11 +01:00
haiyangcui
4d039e9a63 更新推荐后刷新分类过滤数据 2020-11-01 14:01:48 +01:00
haiyangcui
16f3954959 删除无用的style 2020-11-01 12:17:20 +01:00
haiyangcui
17845e6ab4 改进换源功能,在新源中打开当前剧集和时间进度 2020-11-01 12:07:54 +01:00
hunlongyu
292f932130 Merge branch 'master' of https://github.com/Hunlongyu/ZY-Player 2020-11-01 15:29:24 +08:00
hunlongyu
127ef9ad43 ⛸ 设置界面样式微调 2020-11-01 15:26:31 +08:00
cuiocean
11f0ae27fd v2.6.0 2020-11-01 08:22:24 +01:00
hunlongyu
2599343943 样式优化, 修复film table 错误提示 2020-11-01 14:57:49 +08:00
17 changed files with 5725 additions and 1863 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "2.5.9",
"version": "2.6.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -37,6 +37,7 @@
"randomstring": "^1.1.5",
"v-fit-columns": "^0.2.0",
"vue": "^2.6.12",
"vue-clickaway": "^2.2.2",
"vue-infinite-loading": "^2.4.5",
"vue-waterfall-plugin": "^1.1.0",
"vuedraggable": "^2.24.2",

View File

@@ -235,8 +235,15 @@
background-color: none !important;
}
.el-input{
font-size: 1rem;
width: 200px;
}
.el-select-dropdown__item{
font-size: 1rem;
}
.el-select{
margin-left: 20px;
}
}
.listpage-body{
height: calc(100% - 60px);
@@ -258,14 +265,13 @@
.show-table{
height: 100%;
width: 100%;
overflow-y: auto;
.el-table::before{
height: 0px;
}
.el-table{
height: 100%;
width: 100%;
overflow-y: auto;
overflow: hidden;
font-size: 1rem;
}
.el-table__body-wrapper{
@@ -317,7 +323,7 @@
}
.rate{
position: absolute;
top: 5%;
top: 3%;
right: -40%;
width: 100%;
background-color: #111111aa;
@@ -392,119 +398,6 @@
}
}
// PictureView
.pictureView{
.body{
height: calc(100% - 40px);
display: flex;
position: relative;
overflow-y: auto;
&::-webkit-scrollbar{
width: 5px;
height: 1px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
position: absolute;
}
&::-webkit-scrollbar-track {
border-radius: 10px;
position: absolute;
}
.body-box{
height: 100%;
width: 100%;
}
.show-img{
height: 100%;
width: 100%;
padding: 10px;
.card{
border-radius: 6px;
overflow: hidden;
.img{
position: relative;
min-height: 40px;
img{
width: 100%;
height: auto;
cursor: pointer;
}
.rate{
position: absolute;
top: 5%;
right: -40%;
width: 100%;
background-color: #2f90b9;
color: #cdcdcd;
height: 30px;
line-height: 30px;
font-size: 14px;
text-align: center;
transform: rotate(45deg);
}
.update{
position: absolute;
top: 5%;
left: -40%;
width: 100%;
background-color: #68b88e;
color: #cdcdcd;
height: 30px;
line-height: 30px;
font-size: 14px;
text-align: center;
transform: rotate(-45deg);
}
.operate{
display: none;
position: absolute;
left: 0;
bottom: 0;
background-color: #111111aa;
width: 100%;
font-size: 13px;
.operate-wrap{
display: flex;
justify-content: space-between;
.o-play, .o-star, .o-share{
cursor: pointer;
display: inline-block;
width: 80px;
height: 36px;
text-align: center;
line-height: 36px;
color: #cdcdcd;
&:hover{
background-color: #111;
}
}
}
}
}
.name{
font-size: 16px;
padding: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
}
.info{
display: flex;
justify-content: space-between;
font-size: 12px;
padding: 10px;
}
&:hover{
.operate{
display: block;
}
}
}
}
}
}
// loading
.zy-loading{
width: 100%;

View File

@@ -359,6 +359,31 @@
color: var(--d-fc-2);
}
}
.el-select-dropdown{
color: var(--d-fc-1);
border: none;
background-color: var(--d-bgc-1);
box-shadow: var(--d-bsc);
}
.el-select-dropdown__item{
color: var(--d-fc-1);
border: none;
background-color: var(--d-bgc-1);
}
.el-select-dropdown__item.hover{
background-color: var(--d-c-1);
box-shadow: var(--d-bsc);
}
.el-select-dropdown__item.selected{
color: var(--d-fc-1);
background-color: var(--d-c-1);
box-shadow: var(--d-bsc);
}
.el-select-dropdown__item.selected.hover{
color: var(--d-fc-1);
background-color: var(--d-c-1);
box-shadow: var(--d-bsc);
}
}
.listpage-body{
color: var(--d-fc-1);

View File

@@ -354,6 +354,31 @@
color: var(--g-fc-2);
}
}
.el-select-dropdown{
color: var(--g-fc-1);
border: none;
background-color: var(--g-bgc-1);
box-shadow: var(--g-bsc);
}
.el-select-dropdown__item{
color: var(--g-fc-1);
border: none;
background-color: var(--g-bgc-1);
}
.el-select-dropdown__item.hover{
background-color: var(--g-c-1);
box-shadow: var(--g-bsc);
}
.el-select-dropdown__item.selected{
color: var(--g-fc-1);
background-color: var(--g-c-1);
box-shadow: var(--g-bsc);
}
.el-select-dropdown__item.selected.hover{
color: var(--g-fc-1);
background-color: var(--g-c-1);
box-shadow: var(--g-bsc);
}
}
.listpage-body{
color: var(--g-fc-1);

View File

@@ -334,26 +334,51 @@
.listpage{
color: var(--l-fc-2);
.listpage-header{
border-bottom-color: var(--l-c-3);
.btn{
&:hover{
color: var(--l-fc-3)
}
border-bottom-color: var(--l-c-3);
.btn{
&:hover{
color: var(--l-fc-3)
}
.el-button{
background-color: var(--l-bgc-2);
}
.el-button{
background-color: var(--l-bgc-2);
color: var(--l-fc-2);
&:hover{
color: var(--l-fc-3)
}
}
.el-input{
input{
background-color: var(--l-bgc-1);
border: 1px solid var(--l-bgc-1);
color: var(--l-fc-2);
&:hover{
color: var(--l-fc-3)
}
}
.el-input{
input{
background-color: var(--l-bgc-1);
border: 1px solid var(--l-bgc-1);
color: var(--l-fc-2);
}
}
}
.el-select-dropdown{
color: var(--l-fc-1);
border: none;
background-color: var(--l-bgc-1);
box-shadow: var(--l-bsc);
}
.el-select-dropdown__item{
color: var(--l-fc-1);
border: none;
background-color: var(--l-bgc-1);
}
.el-select-dropdown__item.hover{
background-color: var(--l-c-1);
box-shadow: var(--l-bsc);
}
.el-select-dropdown__item.selected{
color: var(--l-fc-1);
background-color: var(--l-c-1);
box-shadow: var(--l-bsc);
}
.el-select-dropdown__item.selected.hover{
color: var(--l-fc-1);
background-color: var(--l-c-1);
box-shadow: var(--l-bsc);
}
}
.listpage-body{
color: var(--l-fc-1);

View File

@@ -333,26 +333,51 @@
.listpage{
color: var(--p-fc-2);
.listpage-header{
border-bottom-color: var(--p-c-3);
.btn{
&:hover{
color: var(--p-fc-3)
}
border-bottom-color: var(--p-c-3);
.btn{
&:hover{
color: var(--p-fc-3)
}
.el-button{
background-color: var(--p-bgc-2);
}
.el-button{
background-color: var(--p-bgc-2);
color: var(--p-fc-2);
&:hover{
color: var(--p-fc-3)
}
}
.el-input{
input{
background-color: var(--p-bgc-1);
border: 1px solid var(--p-bgc-1);
color: var(--p-fc-2);
&:hover{
color: var(--p-fc-3)
}
}
.el-input{
input{
background-color: var(--p-bgc-1);
border: 1px solid var(--p-bgc-1);
color: var(--p-fc-2);
}
}
}
.el-select-dropdown{
color: var(--p-fc-1);
border: none;
background-color: var(--p-bgc-1);
box-shadow: var(--p-bsc);
}
.el-select-dropdown__item{
color: var(--p-fc-1);
border: none;
background-color: var(--p-bgc-1);
}
.el-select-dropdown__item.hover{
background-color: var(--p-c-1);
box-shadow: var(--p-bsc);
}
.el-select-dropdown__item.selected{
color: var(--p-fc-1);
background-color: var(--p-c-1);
box-shadow: var(--p-bsc);
}
.el-select-dropdown__item.selected.hover{
color: var(--p-fc-1);
background-color: var(--p-c-1);
box-shadow: var(--p-bsc);
}
}
.listpage-body{
color: var(--p-fc-1);

View File

@@ -256,25 +256,9 @@ export default {
}
},
doubanLinkEvent () {
const open = require('open')
const axios = require('axios')
const cheerio = require('cheerio')
const name = this.detail.info.name.trim()
// 豆瓣搜索链接
var doubanSearchLink = 'https://www.douban.com/search?q=' + name
var link = doubanSearchLink
axios.get(doubanSearchLink).then(res => {
const $ = cheerio.load(res.data)
// 比较第一和第二豆瓣搜索结果, 如果名字相符, 就打开该链接,否则打开搜索页面
var nameInDouban = $($('div.result')[0]).find('div>div>h3>a').first()
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
link = nameInDouban.attr('href')
} else {
nameInDouban = $($('div.result')[1]).find('div>div>h3>a').first()
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
link = nameInDouban.attr('href')
}
}
zy.doubanLink(name).then(link => {
const open = require('open')
open(link)
})
},

View File

@@ -2,6 +2,7 @@
<div class="listpage" id="sites">
<div class="listpage-header" v-show="!enableBatchEdit">
<el-switch v-model="enableBatchEdit" active-text="批处理分组">></el-switch>
<el-checkbox v-model="setting.excludeR18Films" @change="excludeR18FilmsChangeEvent">屏蔽福利片</el-checkbox>
<el-button @click="addSite" icon="el-icon-document-add">新增</el-button>
<el-button @click="exportSites" icon="el-icon-upload2" >导出</el-button>
<el-button @click="importSites" icon="el-icon-download">导入</el-button>
@@ -111,7 +112,7 @@
</template>
<script>
import { mapMutations } from 'vuex'
import { sites } from '../lib/dexie'
import { sites, setting } from '../lib/dexie'
import zy from '../lib/site/tools'
import { remote } from 'electron'
import { sites as defaultSites } from '../lib/dexie/initData'
@@ -187,6 +188,12 @@ export default {
},
methods: {
...mapMutations(['SET_SETTING', 'SET_EDITSITES']),
excludeR18FilmsChangeEvent () {
setting.find().then(res => {
res.excludeR18Films = this.setting.excludeR18Films
setting.update(res)
})
},
filterHandle (value, row) {
return row.group === value
},

View File

@@ -29,14 +29,14 @@
</div>
<div class="listpage-body" id="film-body" infinite-wrapper>
<div class="show-picture" v-if="setting.view === 'picture' && !show.find">
<Waterfall ref="waterfall" :list="list" :gutter="20" :width="240"
<Waterfall ref="filmWaterfall" :list="list" :gutter="20" :width="240"
:breakpoints="{ 1200: { rowPerView: 4 } }"
animationEffect="fadeInUp"
backgroundColor="rgba(0, 0, 0, 0)">
<template slot="item" slot-scope="props">
<div class="card" v-show="!setting.excludeR18Films || !containsR18Keywords(props.data.type)">
<div class="img">
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(site, props.data)">
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.filmWaterfall.refresh()" @click="detailEvent(site, props.data)">
<div class="operate">
<div class="operate-wrap">
<span class="o-play" @click="playEvent(site, props.data)">播放</span>
@@ -47,6 +47,7 @@
</div>
<div class="name" @click="detailEvent(site, props.data)">{{props.data.name}}</div>
<div class="info">
<span>{{props.data.area}}</span>
<span>{{props.data.year}}</span>
<span>{{props.data.note}}</span>
<span>{{props.data.type}}</span>
@@ -60,7 +61,6 @@
<el-table size="mini"
:data="list.filter(res => !setting.excludeR18Films || !containsR18Keywords(res.type))"
height="100%"
row-key="id"
@row-click="(row) => detailEvent(site, row)"
style="width: 100%">
<el-table-column
@@ -117,7 +117,7 @@
</div>
<div class="show-table" v-show="show.find">
<el-table size="mini"
:data="searchContents"
:data="searchContents.filter(res => !setting.excludeR18Films || (res.type !== undefined && !containsR18Keywords(res.type)))"
height="100%"
row-key="id"
@row-click="(row) => detailEvent(row.site, row)"
@@ -253,11 +253,15 @@ export default {
},
sitesList () {
return this.$store.getters.getEditSites.sites // 需要监听的数据
},
filterSettings () {
return this.$store.getters.getSetting.excludeR18Films // 需要监听的数据
}
},
filters: {
classNameFilter: (name) => {
return name.replace(/[^\u4e00-\u9fa5]/gi, '')
const clsName = name.toString()
return clsName.replace(/[^\u4e00-\u9fa5]/gi, '')
}
},
watch: {
@@ -269,6 +273,9 @@ export default {
},
sitesList () {
this.getAllsites()
},
filterSettings () {
this.siteClick(this.site)
}
},
methods: {
@@ -284,10 +291,9 @@ export default {
this.classList = []
this.type = {}
this.getClass().then(res => {
if (res) {
this.show.class = true
this.infiniteId += 1
}
this.show.class = true
this.infiniteId += 1
this.classClick(this.classList[0])
})
}
},
@@ -463,11 +469,11 @@ export default {
changeView () {
if (this.view === 'Film') {
if (this.setting.view === 'picture') {
this.$refs.waterfall.refresh()
this.$refs.filmWaterfall.refresh()
this.getPage().then(() => {
this.infiniteId += 1
})
}
this.getPage().then(() => {
this.infiniteId += 1
})
}
},
getAllSearch () {
@@ -555,8 +561,10 @@ export default {
this.sites = res.filter((item, index, self) => {
return self.indexOf(item) >= 0 && item.isActive
})
this.site = this.sites[0]
this.siteClick(this.site)
if (this.site === undefined || !this.sites.some(x => x.key === this.site.key)) {
this.site = this.sites[0]
this.siteClick(this.site)
}
}
})
}

View File

@@ -129,9 +129,9 @@
<ul v-show="right.type === 'shortcut'" class="list-shortcut">
<li v-for="(m, n) in right.shortcut" :key="n"><span class="title">{{m.desc}} -- [ {{m.key}} ]</span></li>
</ul>
<ul v-show="right.type === 'other'" class="list-other">
<ul v-show="right.type === 'other'" class="list-other" v-on-clickaway="closeListEvent">
<li v-show="right.other.length === 0">无数据</li>
<li @click="otherItemEvent(m)" v-for="(m, n) in right.other" :key="n"><span class="title">{{m.name}} - [{{m.site}}]</span></li>
<li @click="otherItemEvent(m)" v-for="(m, n) in right.other" :key="n"><span class="title">{{m.name}} - [{{m.site.name}}]</span></li>
</ul>
</div>
</div>
@@ -145,6 +145,8 @@ import zy from '../lib/site/tools'
import Player from 'xgplayer'
import Hls from 'xgplayer-hls.js'
import mt from 'mousetrap'
import { directive as onClickaway } from 'vue-clickaway'
const { remote, ipcRenderer, clipboard } = require('electron')
const VIDEO_DETAIL_CACHE = {}
@@ -247,6 +249,9 @@ export default {
}
}
},
directives: {
onClickaway: onClickaway
},
computed: {
view: {
get () {
@@ -744,48 +749,39 @@ export default {
this.$message.warning('删除历史记录失败, 错误信息: ' + err)
})
},
async getAllsites () {
const all = await sites.all()
async getOtherSites () {
this.right.other = []
for (const i of all) {
if (i.isActive) {
try {
const searchRes = await zy.search(i.key, this.name)
sites.all().then(sitesRes => {
// 排除已关闭的源和当前源
for (const siteItem of sitesRes.filter(x => x.isActive && x.key !== this.video.key)) {
zy.search(siteItem.key, this.name).then(searchRes => {
const type = Object.prototype.toString.call(searchRes)
if (type === '[object Array]') {
searchRes.forEach(async item => {
const detailRes = item
detailRes.key = i.key
detailRes.site = i.site
detailRes.key = siteItem.key
detailRes.site = siteItem
this.right.other.push(detailRes)
})
}
if (type === '[object Object]') {
const detailRes = searchRes
detailRes.key = i.key
detailRes.site = i.name
detailRes.key = siteItem.key
detailRes.site = siteItem
this.right.other.push(detailRes)
}
} catch (err) {
console.error(err)
}
})
}
}
})
},
otherEvent (m) {
this.right.type = 'other'
this.getAllsites()
this.getOtherSites()
this.right.show = true
},
async otherItemEvent (e) {
const db = await history.find({ site: e.key, ids: e.id })
if (db) {
this.video = { key: db.site, info: { id: db.ids, name: db.name, index: db.index, site: e.key } }
} else {
this.video = { key: e.key, info: { id: e.id, name: e.name, index: 0, site: e.key } }
}
this.right.show = false
this.right.type = ''
// 打开当前播放的剧集index, 定位到当前的时间
this.video = { key: e.key, info: { id: e.id, name: e.name, site: e.site, index: this.video.info.index, time: this.xg.currentTime } }
},
mtEvent () {
setting.find().then(res => {

View File

@@ -3,7 +3,7 @@
<div class="listpage-header" id="recommandataions-header">
<el-switch v-model="viewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="list" @change="updateViewMode"></el-switch>
<el-button type="text">视频数{{ recommandations.length }}</el-button>
<el-select size="mini" v-model="selectedAreas" multiple collapse-tags style="margin-left: 20px;" placeholder="地区">
<el-select v-model="selectedAreas" multiple collapse-tags placeholder="地区" :popper-append-to-body="false">
<el-option
v-for="item in areas"
:key="item"
@@ -11,7 +11,7 @@
:value="item">
</el-option>
</el-select>
<el-select size="mini" v-model="selectedTypes" multiple collapse-tags style="margin-left: 20px;" placeholder="类型">
<el-select v-model="selectedTypes" multiple collapse-tags placeholder="类型" :popper-append-to-body="false">
<el-option
v-for="item in types"
:key="item"
@@ -71,7 +71,7 @@
</el-table>
</div>
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
<Waterfall ref="waterfall" :list="filteredRecommandations" :gutter="20" :width="240"
<Waterfall ref="recommandataionsWaterfall" :list="filteredRecommandations" :gutter="20" :width="240"
:breakpoints="{ 1200: { rowPerView: 4 } }"
animationEffect="fadeInUp"
backgroundColor="rgba(0, 0, 0, 0)">
@@ -81,7 +81,7 @@
<div class="rate" v-if="props.data.rate && props.data.rate !== '暂无评分'">
<span>{{props.data.rate}}</span>
</div>
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(props.data)">
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.recommandataionsWaterfall.refresh()" @click="detailEvent(props.data)">
<div class="operate">
<div class="operate-wrap">
<span class="o-play" @click="playEvent(props.data)">播放</span>
@@ -171,7 +171,7 @@ export default {
view () {
if (this.view === 'Recommandation') {
this.getRecommandations()
this.$refs.waterfall.refresh()
this.$refs.recommandataionsWaterfall.refresh()
}
}
},
@@ -194,11 +194,11 @@ export default {
axios.get(url).then(res => {
if (res.status === 200) {
if (res.data.length > 0) {
this.recommandations = res.data
this.recommandations.sort(function (a, b) {
this.recommandations = res.data.sort(function (a, b) {
return b.detail.year - a.detail.year
})
recommandation.clear().then(recommandation.bulkAdd(this.recommandations))
this.getFilterData()
this.$message.success('更新推荐成功')
}
}
@@ -275,9 +275,8 @@ export default {
},
getRecommandations () {
recommandation.all().then(res => {
this.recommandations = res
this.recommandations.sort(function (a, b) {
return b.detail.year - a.detail.year
this.recommandations = res.sort(function (a, b) {
return b.id - a.id
})
this.getFilterData()
})

View File

@@ -87,9 +87,6 @@
<div class="zy-input" @click="toggleExcludeRootClasses">
<input type="checkbox" v-model = "d.excludeRootClasses" @change="updateSettingEvent"> 屏蔽主分类
</div>
<div class="zy-input" @click="toggleExcludeR18Films">
<input type="checkbox" v-model = "d.excludeR18Films" @change="updateSettingEvent"> 屏蔽福利片
</div>
</div>
</div>
<div class="theme">
@@ -131,14 +128,14 @@
<div class="clearDB">
<span @click="clearDBEvent" class="clearBtn">软件重置</span>
<span @click="changePasswordEvent" class="clearBtn">设置密码</span>
<span class="clearTips">如果新安装用户, 无法显示资源, 请点击软件重置. 如非必要, 切勿点击. 会清空用户数据, 恢复默认设置. 点击即软件重置, 并关闭软件.</span>
<div class="clearTips">如果新安装用户, 无法显示资源, 请点击软件重置. 如非必要, 切勿点击. 会清空用户数据, 恢复默认设置. 点击即软件重置, 并关闭软件.</div>
</div>
<div class="Tips">
<span>所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容, 禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.</span>
</div>
</div>
<div> <!-- 输入密码页面 -->
<el-dialog :visible.sync="show.checkPasswordDialog" v-if='show.checkPasswordDialog' :append-to-body="true" @close="closeDialog">
<el-dialog :visible.sync="show.checkPasswordDialog" v-if='show.checkPasswordDialog' :append-to-body="true" @close="closeDialog" width="300px">
<el-form label-width="75px" label-position="left">
<el-form-item label="当前密码" prop='name'>
<el-input v-model="inputPassword" placeholder="请输入您的当前密码" />
@@ -151,7 +148,7 @@
</el-dialog>
</div>
<div> <!-- 修改密码页面 -->
<el-dialog :visible.sync="show.changePasswordDialog" v-if='show.changePasswordDialog' :append-to-body="true" @close="closeDialog">
<el-dialog :visible.sync="show.changePasswordDialog" v-if='show.changePasswordDialog' :append-to-body="true" @close="closeDialog" width="300px">
<el-form label-width="75px" label-position="left">
<el-form-item label="新密码" prop='name'>
<el-input v-model="inputPassword" placeholder="请输入您的新密码" />
@@ -270,10 +267,6 @@ export default {
this.d.searchAllSites = !this.d.searchAllSites
this.updateSettingEvent()
},
toggleExcludeR18Films () {
this.d.excludeR18Films = !this.d.excludeR18Films
this.updateSettingEvent()
},
toggleExcludeRootClasses () {
this.d.excludeRootClasses = !this.d.excludeRootClasses
this.updateSettingEvent()
@@ -403,7 +396,7 @@ export default {
getLatestVersion () {
ipcRenderer.send('checkForUpdate')
ipcRenderer.on('update-available', (e, info) => {
this.d.latestVersion = info.version
this.latestVersion = info.version
})
ipcRenderer.on('update-error', () => {
this.$message.warning = '更新出错.'
@@ -570,9 +563,9 @@ export default {
line-height: 32px;
}
.clearTips{
margin: 10px 0 0 20px;
font-size: 12px;
color: #ff000088;
margin-left: 10px;
}
}
.Tips{

View File

@@ -1,5 +1,5 @@
<template>
<div class="share" id="share" @click="shareClickEvent">
<div class="share" id="share" @click="shareClickEvent" v-on-clickaway="shareClickEvent">
<div class="left">
<img :src="pic" alt="" @load="picLoadEvent">
</div>
@@ -22,6 +22,7 @@ import { mapMutations } from 'vuex'
import QrcodeVue from 'qrcode.vue'
import html2canvas from 'html2canvas'
import zy from '../lib/site/tools'
import { directive as onClickaway } from 'vue-clickaway'
const { clipboard, nativeImage } = require('electron')
export default {
name: 'share',
@@ -56,6 +57,9 @@ export default {
deep: true
}
},
directives: {
onClickaway: onClickaway
},
methods: {
...mapMutations(['SET_SHARE']),
shareClickEvent () {

View File

@@ -77,7 +77,7 @@
</el-table>
</div>
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
<Waterfall ref="waterfall" :list="list" :gutter="20" :width="240"
<Waterfall ref="starWaterfall" :list="list" :gutter="20" :width="240"
:breakpoints="{ 1200: { rowPerView: 4 } }"
animationEffect="fadeInUp"
backgroundColor="rgba(0, 0, 0, 0)">
@@ -90,7 +90,7 @@
<div class="update" v-if="props.data.hasUpdate">
<span>有更新</span>
</div>
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(props.data)">
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.starWaterfall.refresh()" @click="detailEvent(props.data)">
<div class="operate">
<div class="operate-wrap">
<span class="o-play" @click="playEvent(props.data)">播放</span>
@@ -102,6 +102,7 @@
</div>
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
<div class="info">
<span>{{props.data.detail.area}}</span>
<span>{{props.data.detail.year}}</span>
<span>{{props.data.detail.note}}</span>
<span>{{props.data.detail.type}}</span>
@@ -128,7 +129,8 @@ export default {
return {
list: [],
sites: [],
viewMode: 'picture'
viewMode: 'picture',
numNoUpdate: 0
}
},
components: {
@@ -173,6 +175,14 @@ export default {
if (this.view === 'Star') {
this.getAllsites()
this.getFavorites()
this.$refs.starWaterfall.refresh()
}
},
numNoUpdate () {
// 如果所有收藏都没有更新的话
if (this.numNoUpdate === this.list.length) {
this.numNoUpdate = 0
this.$message.warning('未查询到任何更新')
}
}
},
@@ -253,11 +263,12 @@ export default {
index: e.index
}
star.get(e.id).then(resStar => {
var msg = ''
if (e.detail.last !== detailRes.last) {
if (!e.hasUpdate && e.detail.last !== detailRes.last) {
doc.hasUpdate = true
msg = `同步"${e.name}"成功, 检查到更新。`
var msg = `同步"${e.name}"成功, 检查到更新。`
this.$message.success(msg)
} else {
this.numNoUpdate += 1
}
star.update(e.id, doc)
this.getFavorites()
@@ -268,6 +279,7 @@ export default {
})
},
updateAllEvent () {
this.numNoUpdate = 0
this.list.forEach(e => {
this.updateEvent(e)
})
@@ -333,7 +345,9 @@ export default {
},
getFavorites () {
star.all().then(res => {
this.list = res.reverse()
this.list = res.sort(function (a, b) {
return b.id - a.id
})
})
},
getAllsites () {
@@ -354,7 +368,7 @@ export default {
remote.dialog.showSaveDialog(options).then(result => {
if (!result.canceled) {
fs.writeFileSync(result.filePath, str)
this.$message.success('已保存成功')
this.$message.success('导出收藏成功')
}
}).catch(err => {
this.$message.error(err)
@@ -371,14 +385,16 @@ export default {
}
remote.dialog.showOpenDialog(options).then(result => {
if (!result.canceled) {
var starList = this.list
var starList = Array.from(this.list)
var id = this.list.length + 1
result.filePaths.forEach(file => {
var str = fs.readFileSync(file)
const json = JSON.parse(str)
json.forEach(ele => {
const starExists = starList.includes(x => x.key === ele.key && x.ids === ele.ids)
json.reverse().forEach(ele => {
const starExists = starList.some(x => x.key === ele.key && x.ids === ele.ids)
if (!starExists) {
var doc = {
id: id,
key: ele.key,
ids: ele.ids,
site: ele.site === undefined ? ele.site = this.sites.find(x => x.key === ele.key) : ele.site,
@@ -397,6 +413,7 @@ export default {
note: ele.note
} : ele.detail
}
id += 1
starList.push(doc)
}
})

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
import Vue from 'vue'
import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option } from 'element-ui'
import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option, Checkbox } from 'element-ui'
import Plugin from 'v-fit-columns'
Vue.use(Button)
Vue.use(Table)
@@ -13,4 +13,5 @@ Vue.use(Switch)
Vue.use(Plugin)
Vue.use(Select)
Vue.use(Option)
Vue.use(Checkbox)
Vue.prototype.$message = Message

View File

@@ -214,11 +214,11 @@ const zy = {
}
},
/**
* 获取豆瓣评分
* 获取豆瓣页面链接
* @param {*} name 视频名称
* @returns 豆瓣评分
* @returns 豆瓣页面链接,如果没有搜到该视频,返回搜索页面链接
*/
doubanRate (name) {
doubanLink (name) {
return new Promise((resolve, reject) => {
// 豆瓣搜索链接
var nameToSearch = name.replace(/\s/g, '')
@@ -229,17 +229,38 @@ const zy = {
var link = ''
var linkInDouban = $($('div.result')[0]).find('div>div>h3>a').first()
var nameInDouban = linkInDouban.text().replace(/\s/g, '')
if (nameToSearch.includes(nameInDouban) || nameInDouban.includes(nameToSearch)) {
if (nameToSearch === nameInDouban) {
link = linkInDouban.attr('href')
} else {
linkInDouban = $($('div.result')[1]).find('div>div>h3>a').first()
nameInDouban = linkInDouban.text().replace(/\s/g, '')
if (nameToSearch.includes(nameInDouban) || nameInDouban.includes(nameToSearch)) {
if (nameToSearch === nameInDouban) {
link = linkInDouban.attr('href')
}
}
// 如果找到链接,就打开该链接获取评分
if (link) {
resolve(link)
} else {
// 如果没找到符合的链接,返回搜索页面
resolve(doubanSearchLink)
}
}).catch(err => {
reject(err)
})
})
},
/**
* 获取豆瓣评分
* @param {*} name 视频名称
* @returns 豆瓣评分
*/
doubanRate (name) {
return new Promise((resolve, reject) => {
var nameToSearch = name.replace(/\s/g, '')
this.doubanLink(nameToSearch).then(link => {
if (link.includes('https://www.douban.com/search')) {
resolve('暂无评分')
} else {
axios.get(link).then(response => {
const parsedHtml = cheerio.load(response.data)
var rating = parsedHtml('body').find('#interest_sectl').first().find('strong').first()
@@ -251,8 +272,6 @@ const zy = {
}).catch(err => {
reject(err)
})
} else {
resolve('暂无评分')
}
}).catch(err => {
reject(err)