@@ -185,9 +184,9 @@ export default {
searchTxt () {
this.searchChangeEvent()
},
- setting: {
- handler (ov, nv) {
- this.settingChangeEvent(ov, nv)
+ 'setting.site': {
+ handler (nv) {
+ this.getAllsites(nv)
},
deep: true
}
@@ -323,7 +322,7 @@ export default {
},
downloadEvent (e) {
zy.download(this.site.key, e.id).then(res => {
- if (res) {
+ if (res.length > 0) {
const text = res.dl.dd._t
if (text) {
const list = text.split('#')
@@ -338,9 +337,20 @@ export default {
this.$message.warning('没有查询到下载链接.')
}
} else {
- const list = [...this.m3u8List]
+ let m3u8List = []
+ const dd = e.dl.dd
+ const type = Object.prototype.toString.call(dd)
+ if (type === '[object Array]') {
+ for (const i of dd) {
+ if (i._flag.indexOf('m3u8') >= 0) {
+ m3u8List = i._t.split('#')
+ }
+ }
+ } else {
+ m3u8List = dd._t.split('#')
+ }
let downloadUrl = e.name + '\n'
- for (const i of list) {
+ for (const i of m3u8List) {
const url = encodeURI(i.split('$')[1])
downloadUrl += (url + '\n')
}
@@ -352,7 +362,7 @@ export default {
changeView () {
if (this.view === 'Film') {
if (this.show.img) {
- this.$refs.wimg.refresh()
+ this.$refs.waterfall.refresh()
}
this.getPage().then(() => {
this.infiniteId += 1
@@ -371,6 +381,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) {
@@ -389,7 +400,6 @@ export default {
if (type === '[object Object]') {
this.searchContents.push(res)
}
- this.show.find = true
})
} else {
this.show.find = false
@@ -405,6 +415,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()
@@ -420,7 +431,6 @@ export default {
if (type === '[object Object]') {
this.searchContents.push(res)
}
- this.show.find = true
})
},
clearSearch () {
@@ -436,20 +446,29 @@ export default {
this.searchContents = []
this.show.find = false
if (this.show.img) {
- this.$refs.wimg.refresh()
+ this.$refs.waterfall.refresh()
}
}
},
- getAllsites () {
- sites.all().then(res => {
- this.sites = res
- this.site = this.sites[0]
- this.siteClick(this.site)
- })
- },
- settingChangeEvent (ov, nv) {
- console.log(ov, nv, 'ov nv')
- 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 () {
diff --git a/src/components/Play.vue b/src/components/Play.vue
index c2f042b..fec8448 100644
--- a/src/components/Play.vue
+++ b/src/components/Play.vue
@@ -210,7 +210,6 @@ export default {
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
getUrls () {
- console.log(this.video, 'this.video')
this.name = ''
if (this.timer !== null) {
clearInterval(this.timer)
diff --git a/src/components/Setting.vue b/src/components/Setting.vue
index af8aa14..92ca4e4 100644
--- a/src/components/Setting.vue
+++ b/src/components/Setting.vue
@@ -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
+ })
})
})
},
diff --git a/src/components/Share.vue b/src/components/Share.vue
index aa2d3ea..4d17e89 100644
--- a/src/components/Share.vue
+++ b/src/components/Share.vue
@@ -1,9 +1,9 @@
-
![]()
+
-
+
{{ share.info.name }}
@@ -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;
diff --git a/src/lib/site/tools.js b/src/lib/site/tools.js
index 7d05622..baa4a27 100644
--- a/src/lib/site/tools.js
+++ b/src/lib/site/tools.js
@@ -184,7 +184,7 @@ const zy = {
reject(err)
})
} else {
- resolve(null)
+ resolve([])
}
})
})
diff --git a/src/mini/Mini.vue b/src/mini/Mini.vue
index b988d24..c8778a0 100644
--- a/src/mini/Mini.vue
+++ b/src/mini/Mini.vue
@@ -177,6 +177,7 @@ export default {
},
prevEvent () {
if (this.video.index === 0) {
+ this.$message.info('已是第一集.')
return false
}
history.find({ site: this.video.site, ids: this.video.ids }).then(res => {
@@ -192,6 +193,7 @@ export default {
},
nextEvent () {
if (this.video.index >= this.m3u8Arr.length - 1) {
+ this.$message.info('已是最后一集.')
return false
}
history.find({ site: this.video.site, ids: this.video.ids }).then(res => {