mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-05-10 00:02:16 +08:00
🎋 优化搜索 🎄
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zy",
|
||||
"version": "1.1.3",
|
||||
"version": "1.1.4",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
|
||||
@@ -122,7 +122,6 @@ if (!gotTheLock) {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
if (isDevelopment) {
|
||||
if (process.platform === 'win32') {
|
||||
process.on('message', data => {
|
||||
|
||||
@@ -22,57 +22,80 @@
|
||||
<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 @click="clearSearch">清空历史记录</li>
|
||||
<li v-show="searchList.length >= 1" @click="clearSearch">清空历史记录</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="body zy-scroll" infinite-wrapper>
|
||||
<div class="show-img" v-if="show.img">
|
||||
<Waterfall :list="list" :gutter="20" :width="240"
|
||||
:breakpoints="{ 1200: { rowPerView: 4 } }"
|
||||
animationEffect="fadeInUp"
|
||||
backgroundColor="rgba(0, 0, 0, 0)"
|
||||
ref="waterfall">
|
||||
<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)">
|
||||
<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>
|
||||
<div class="body-box" v-if="!show.find">
|
||||
<div class="show-img" v-if="setting.view === 'picture'">
|
||||
<Waterfall :list="list" :gutter="20" :width="240"
|
||||
:breakpoints="{ 1200: { rowPerView: 4 } }"
|
||||
animationEffect="fadeInUp"
|
||||
backgroundColor="rgba(0, 0, 0, 0)"
|
||||
ref="waterfall">
|
||||
<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)">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.year}}</span>
|
||||
<span>{{props.data.type}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.year}}</span>
|
||||
<span>{{props.data.type}}</span>
|
||||
</div>
|
||||
</template>
|
||||
</Waterfall>
|
||||
<infinite-loading force-use-infinite-wrapper :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
|
||||
</div>
|
||||
<div class="show-table" v-if="setting.view === 'table'">
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<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="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>
|
||||
</li>
|
||||
</ul>
|
||||
<infinite-loading force-use-infinite-wrapper="tBody" :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
|
||||
</div>
|
||||
</template>
|
||||
</Waterfall>
|
||||
<infinite-loading force-use-infinite-wrapper :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show-table" v-if="!show.img">
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<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="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>
|
||||
</li>
|
||||
</ul>
|
||||
<infinite-loading force-use-infinite-wrapper="tBody" :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
|
||||
<div class="body-box" v-if="show.find">
|
||||
<div class="show-table">
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<ul>
|
||||
<li v-for="(i, j) in searchContents" :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="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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -95,7 +118,9 @@ export default {
|
||||
class: false,
|
||||
classList: false,
|
||||
search: false,
|
||||
img: true
|
||||
img: true,
|
||||
table: false,
|
||||
find: false
|
||||
},
|
||||
sites: [],
|
||||
site: {},
|
||||
@@ -104,9 +129,9 @@ export default {
|
||||
pagecount: 0,
|
||||
list: [],
|
||||
infiniteId: +new Date(),
|
||||
refresh: 0,
|
||||
searchList: [],
|
||||
searchTxt: ''
|
||||
searchTxt: '',
|
||||
searchContents: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -151,12 +176,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
setting: {
|
||||
handler () {
|
||||
this.changeSetting()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
view () {
|
||||
this.changeView()
|
||||
},
|
||||
@@ -170,6 +189,7 @@ export default {
|
||||
this.list = []
|
||||
this.site = e
|
||||
this.show.site = false
|
||||
this.show.class = false
|
||||
if (this.searchTxt.length > 0) {
|
||||
this.searchEvent()
|
||||
} else {
|
||||
@@ -232,9 +252,13 @@ export default {
|
||||
if (res) {
|
||||
this.pagecount -= 1
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
$state.complete()
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
this.list.push(...res)
|
||||
} else {
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
this.list.push(res)
|
||||
}
|
||||
$state.loaded()
|
||||
@@ -288,17 +312,11 @@ export default {
|
||||
info: e
|
||||
}
|
||||
},
|
||||
changeSetting () {
|
||||
this.list = []
|
||||
this.setting.view === 'picture' ? this.show.img = true : this.show.img = false
|
||||
this.refresh++
|
||||
},
|
||||
changeView () {
|
||||
if (this.refresh >= 1) {
|
||||
if (this.view === 'Film') {
|
||||
this.$refs.waterfall.refresh()
|
||||
this.getPage().then(() => {
|
||||
this.infiniteId += 1
|
||||
this.refresh = 0
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -309,7 +327,7 @@ export default {
|
||||
},
|
||||
searchEvent () {
|
||||
const wd = this.searchTxt
|
||||
this.list = []
|
||||
this.searchContents = []
|
||||
this.pagecount = 0
|
||||
this.show.search = false
|
||||
if (wd) {
|
||||
@@ -320,14 +338,29 @@ export default {
|
||||
this.getAllSearch()
|
||||
})
|
||||
zy.search(this.site.key, wd).then(res => {
|
||||
this.list = 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)
|
||||
}
|
||||
this.show.find = true
|
||||
})
|
||||
} else {
|
||||
this.$message.warning('请输入关键字')
|
||||
this.show.find = false
|
||||
this.getClass().then(res => {
|
||||
if (res) {
|
||||
this.infiniteId += 1
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
searchClickEvent (e) {
|
||||
this.list = []
|
||||
this.searchContents = []
|
||||
this.pagecount = 0
|
||||
this.searchTxt = e.keywords
|
||||
this.show.search = false
|
||||
@@ -336,7 +369,17 @@ export default {
|
||||
this.getAllSearch()
|
||||
})
|
||||
zy.search(this.site.key, e.keywords).then(res => {
|
||||
this.list = 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)
|
||||
}
|
||||
this.show.find = true
|
||||
})
|
||||
},
|
||||
clearSearch () {
|
||||
@@ -397,6 +440,10 @@ export default {
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
}
|
||||
.body-box{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
.show-img{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
|
||||
@@ -14,256 +14,168 @@ const sites = [
|
||||
key: 'okzy',
|
||||
name: 'OK 资源网',
|
||||
api: 'http://cj.okzy.tv/inc/api.php',
|
||||
download: 'http://cj.okzy.tv/inc/apidown.php',
|
||||
level: 16
|
||||
download: 'http://cj.okzy.tv/inc/apidown.php'
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
key: 'zuidazy',
|
||||
name: '最大资源网',
|
||||
api: 'http://www.zdziyuan.com/inc/api.php',
|
||||
download: 'http://www.zdziyuan.com/inc/apidown.php',
|
||||
level: 16
|
||||
download: 'http://www.zdziyuan.com/inc/apidown.php'
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
key: 'gaoqingzy',
|
||||
name: '高清资源网',
|
||||
api: 'http://cj.gaoqingzyw.com/inc/api.php',
|
||||
download: 'http://cj.gaoqingzyw.com/inc/apidown.php',
|
||||
level: 16
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
key: 'doubanzy',
|
||||
name: '豆瓣电影资源',
|
||||
api: 'http://v.1988cj.com/inc/api.php',
|
||||
download: 'http://v.1988cj.com/inc/apidown.php',
|
||||
level: 16
|
||||
download: 'http://v.1988cj.com/inc/apidown.php'
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
id: 4,
|
||||
key: '135zy',
|
||||
name: '135 资源网',
|
||||
api: 'http://cj.zycjw1.com/inc/api.php',
|
||||
download: 'http://cj.zycjw1.com/inc/apidown.php',
|
||||
level: 16
|
||||
download: 'http://cj.zycjw1.com/inc/apidown.php'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
id: 5,
|
||||
key: 'kuyunzy',
|
||||
name: '酷云资源',
|
||||
api: 'http://caiji.kuyun98.com/inc/ldg_api.php',
|
||||
download: 'http://caiji.kuyun98.com/inc/apidown.php',
|
||||
level: 16
|
||||
download: 'http://caiji.kuyun98.com/inc/apidown.php'
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
key: 'mgtvzy',
|
||||
name: '芒果 TV 资源网',
|
||||
api: 'https://api.shijiapi.com/api.php/provide/vod/at/xml/',
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
key: 'subo988',
|
||||
name: '速播资源站',
|
||||
api: 'https://www.subo988.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
key: '209zy',
|
||||
name: '209 资源',
|
||||
api: 'http://cj.1156zy.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
key: 'zuixinzy',
|
||||
name: '最新资源',
|
||||
api: 'http://api.zuixinapi.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 10,
|
||||
key: 'kubozy',
|
||||
name: '酷播资源',
|
||||
api: 'http://api.kbzyapi.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
key: 'yongjiuzy',
|
||||
name: '永久资源',
|
||||
api: 'http://cj.yongjiuzyw.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 12,
|
||||
key: '123ku',
|
||||
name: '123 资源',
|
||||
api: 'http://cj.123ku2.com:12315/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
key: '88zyw',
|
||||
name: '88 影视资源站',
|
||||
api: 'http://www.88zyw.net/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
key: 'wolongzy',
|
||||
name: '卧龙资源',
|
||||
api: 'http://cj.wlzy.tv/inc/api_mac.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
key: 'mahuazy',
|
||||
name: '麻花资源',
|
||||
api: 'https://www.mhapi123.com/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 16,
|
||||
key: 'kkzy',
|
||||
name: '快快资源',
|
||||
api: 'https://api.kkzy.tv/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 17,
|
||||
key: '158zy',
|
||||
name: '壹伍捌资源网',
|
||||
api: 'http://cj.158zyz.net:158/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 18,
|
||||
key: 'rrzy',
|
||||
name: '人人资源',
|
||||
api: 'https://www.rrzyw.cc/api.php/provide/vod/from/rrm3u8/at/xml/',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 19,
|
||||
key: 'mokazy',
|
||||
name: '魔卡资源网',
|
||||
api: 'https://cj.heiyap.com/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 20,
|
||||
key: 'kyzy',
|
||||
name: '快影资源站',
|
||||
api: 'https://www.kyzy.tv/api.php/kyyun/vod/at/xml/',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 21,
|
||||
key: 'khzy',
|
||||
name: '快活资源站',
|
||||
api: 'https://www.khzyapi.com/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 22,
|
||||
key: 'smzy',
|
||||
name: '神马资源网',
|
||||
api: 'http://api.shenmacj.com/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 23,
|
||||
key: 'xhgcjym',
|
||||
name: '小黄瓜资源',
|
||||
api: 'http://cj.xhgcjym.com/inc/api.php',
|
||||
download: 'http://cj.xhgcjym.com/inc/apidown.php',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 24,
|
||||
key: 'jiali',
|
||||
name: '佳丽 TV',
|
||||
api: 'https://jialiapi.com/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 25,
|
||||
key: 'agzy',
|
||||
name: '环亚资源',
|
||||
api: 'http://wmcj8.com/inc/sapi.php',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 26,
|
||||
key: 'solezy',
|
||||
name: '搜乐资源网',
|
||||
api: 'https://www.caijizy.vip/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 27,
|
||||
key: 'lajiaozy',
|
||||
name: '辣椒资源',
|
||||
api: 'http://api.11bat.com/mac10.php',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 28,
|
||||
key: '9188zy',
|
||||
name: '9188 资源',
|
||||
api: 'http://cj.vod1769.com/zyapimacc.php',
|
||||
download: '',
|
||||
level: 18
|
||||
},
|
||||
{
|
||||
id: 29,
|
||||
id: 22,
|
||||
key: 'bbkdj',
|
||||
name: '步步高顶尖资源网',
|
||||
api: 'http://api.bbkdj.com/api',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 30,
|
||||
id: 23,
|
||||
key: '1886zy',
|
||||
name: '1886 资源',
|
||||
api: 'http://cj.1886zy.co/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
},
|
||||
{
|
||||
id: 31,
|
||||
id: 24,
|
||||
key: 'mbo',
|
||||
name: '秒播资源',
|
||||
api: 'http://caiji.mb77.vip/inc/api.php',
|
||||
download: '',
|
||||
level: 16
|
||||
},
|
||||
{
|
||||
id: 32,
|
||||
key: 'mgtvzy',
|
||||
name: '芒果 TV 资源网',
|
||||
api: 'https://api.shijiapi.com/api.php/provide/vod/at/xml/',
|
||||
download: '',
|
||||
level: 16
|
||||
download: ''
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user