Compare commits

...

3 Commits

Author SHA1 Message Date
hunlongyu
6f8f700dfc 🍟 修复BUG 🌭 2020-07-14 15:26:01 +08:00
hunlongyu
001772d75c 🎉 优化搜索 🎊 2020-07-14 00:17:26 +08:00
hunlongyu
a2d2215646 🎆 修复详情页无法播放的BUG 🎇 2020-07-14 00:16:55 +08:00
6 changed files with 58 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "1.2.0",
"version": "1.2.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@@ -123,7 +123,7 @@ export default {
if (res) {
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n } }
} else {
this.video = { key: this.detail.key, info: { id: this.detail.info.ids, 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 } }
}
})

View File

@@ -28,13 +28,12 @@
</div>
</div>
<div class="body zy-scroll" infinite-wrapper>
<div class="body-box" v-if="!show.find">
<div class="body-box" v-show="!show.find">
<div class="show-img" v-if="setting.view === 'picture'">
<Waterfall :list="list" :gutter="20" :width="240"
<Waterfall ref="waterfall" :list="list" :gutter="20" :width="240"
:breakpoints="{ 1200: { rowPerView: 4 } }"
animationEffect="fadeInUp"
backgroundColor="rgba(0, 0, 0, 0)"
ref="waterfall">
backgroundColor="rgba(0, 0, 0, 0)">
<template slot="item" slot-scope="props">
<div class="card">
<div class="img">
@@ -79,7 +78,7 @@
</div>
</div>
</div>
<div class="body-box" v-if="show.find">
<div class="body-box" v-show="show.find">
<div class="show-table">
<div class="zy-table">
<div class="tBody">
@@ -185,9 +184,9 @@ export default {
searchTxt () {
this.searchChangeEvent()
},
setting: {
handler () {
this.settingChangeEvent()
'setting.site': {
handler (nv) {
this.getAllsites(nv)
},
deep: true
}
@@ -351,9 +350,13 @@ export default {
},
changeView () {
if (this.view === 'Film') {
this.$refs.waterfall.refresh()
if (this.show.img) {
this.$refs.waterfall.refresh()
}
this.getPage().then(() => {
this.infiniteId += 1
if (this.show.img || this.show.table) {
}
})
}
},
@@ -367,6 +370,7 @@ export default {
this.searchContents = []
this.pagecount = 0
this.show.search = false
this.show.find = true
if (wd) {
search.find({ keywords: wd }).then(res => {
if (!res) {
@@ -385,7 +389,6 @@ export default {
if (type === '[object Object]') {
this.searchContents.push(res)
}
this.show.find = true
})
} else {
this.show.find = false
@@ -401,6 +404,7 @@ export default {
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()
@@ -416,7 +420,6 @@ export default {
if (type === '[object Object]') {
this.searchContents.push(res)
}
this.show.find = true
})
},
clearSearch () {
@@ -429,17 +432,32 @@ export default {
this.show.class = false
} else {
this.show.class = true
this.searchContents = []
this.show.find = false
if (this.show.img) {
this.$refs.waterfall.refresh()
}
}
},
getAllsites () {
sites.all().then(res => {
this.sites = res
this.site = this.sites[0]
this.siteClick(this.site)
})
},
settingChangeEvent () {
this.getAllsites()
getAllsites (nv) {
if (nv) {
sites.all().then(res => {
this.sites = res
for (const i of res) {
if (i.key === nv) {
this.site = i
this.siteClick(this.site)
return false
}
}
})
} else {
sites.all().then(res => {
this.sites = res
this.site = this.sites[0]
this.siteClick(this.site)
})
}
}
},
created () {

View File

@@ -5,7 +5,7 @@
<span v-if="this.right.list.length > 1"> {{(video.info.index + 1)}} </span>{{name}}
</div>
<div class="player">
<div id="xg"></div>
<div id="xgplayer"></div>
</div>
<div class="more">
<span class="zy-svg" @click="nextEvent" v-show="showNext">
@@ -118,7 +118,7 @@ export default {
history: []
},
config: {
id: 'xg',
id: 'xgplayer',
url: '',
lang: 'zh-cn',
width: '100%',

View File

@@ -207,7 +207,9 @@ export default {
this.$message.success('已添加成功')
this.getSites()
this.d.site = json[0].key
this.setting = this.d
setting.update(this.d).then(res => {
this.setting = this.d
})
})
})
},

View File

@@ -1,9 +1,9 @@
<template>
<div class="share" id="share" @click="shareClickEvent">
<div class="left">
<img :src="pic" alt="">
<img :src="pic" alt="" @load="picLoadEvent">
</div>
<div class="right">
<div class="right" id="right">
<div class="title">{{ share.info.name }}</div>
<qrcode-vue id="qr" :value="link" :size="160" level="L" />
<div class="tips">
@@ -79,17 +79,17 @@ export default {
}
}
this.loading = false
this.$nextTick(() => {
const dom = document.getElementById('share')
html2canvas(dom, { useCORS: true, allowTaint: true }).then(res => {
const png = res.toDataURL('image/png')
const p = nativeImage.createFromDataURL(png)
clipboard.writeImage(p)
this.$message.success('已复制到剪贴板,快去分享吧~ 严禁传播违法资源!!!')
})
})
}
})
},
picLoadEvent () {
const dom = document.getElementById('right')
html2canvas(dom, { useCORS: true, allowTaint: true }).then(res => {
const png = res.toDataURL('image/png')
const p = nativeImage.createFromDataURL(png)
clipboard.writeImage(p)
this.$message.success('已复制到剪贴板,快去分享吧~ 严禁传播违法资源!!!')
})
}
},
mounted () {
@@ -108,7 +108,7 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
padding: 0px;
z-index: 999;
.left, .right{
width: 50%;
@@ -125,6 +125,7 @@ export default {
}
}
.right{
padding: 10px;
.title{
font-size: 18px;
margin-bottom: 10px;