mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-11-05 23:08:03 +08:00
删除searchSingleSiteEvent
This commit is contained in:
@@ -383,7 +383,7 @@ export default {
|
|||||||
this.searchList = res.reverse()
|
this.searchList = res.reverse()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
searchSingleSiteEvent (wd) {
|
searchAllSitesEvent (sites, wd) {
|
||||||
this.searchTxt = wd
|
this.searchTxt = wd
|
||||||
this.searchContents = []
|
this.searchContents = []
|
||||||
this.pagecount = 0
|
this.pagecount = 0
|
||||||
@@ -396,45 +396,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.getAllSearch()
|
this.getAllSearch()
|
||||||
})
|
})
|
||||||
zy.search(this.site.key, wd).then(res => {
|
sites.forEach(site =>
|
||||||
const type = Object.prototype.toString.call(res)
|
|
||||||
if (type === '[object Undefined]') {
|
|
||||||
this.$message.info(this.site.name + ' 无搜索结果')
|
|
||||||
}
|
|
||||||
if (type === '[object Array]') {
|
|
||||||
res.forEach(element => {
|
|
||||||
element.site = this.site
|
|
||||||
this.searchContents.push(element)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if (type === '[object Object]') {
|
|
||||||
res.site = this.site
|
|
||||||
this.searchContents.push(res)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.show.find = false
|
|
||||||
this.getClass().then(res => {
|
|
||||||
if (res) {
|
|
||||||
this.infiniteId += 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
searchAllSitesEvent (wd) {
|
|
||||||
this.searchTxt = wd
|
|
||||||
this.searchContents = []
|
|
||||||
this.pagecount = 0
|
|
||||||
this.show.search = false
|
|
||||||
this.show.find = true
|
|
||||||
if (wd) {
|
|
||||||
search.find({ keywords: wd }).then(res => {
|
|
||||||
if (!res) {
|
|
||||||
search.add({ keywords: wd })
|
|
||||||
}
|
|
||||||
this.getAllSearch()
|
|
||||||
})
|
|
||||||
this.sites.forEach(site =>
|
|
||||||
zy.search(site.key, wd).then(res => {
|
zy.search(site.key, wd).then(res => {
|
||||||
const type = Object.prototype.toString.call(res)
|
const type = Object.prototype.toString.call(res)
|
||||||
if (type === '[object Undefined]') {
|
if (type === '[object Undefined]') {
|
||||||
@@ -462,11 +424,13 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
searchEvent (wd) {
|
searchEvent (wd) {
|
||||||
|
var sites = []
|
||||||
if (this.searchAllSites) {
|
if (this.searchAllSites) {
|
||||||
this.searchAllSitesEvent(wd)
|
sites.push(...this.sites)
|
||||||
} else {
|
} else {
|
||||||
this.searchSingleSiteEvent(wd)
|
sites.push(this.site)
|
||||||
}
|
}
|
||||||
|
this.searchAllSitesEvent(sites, wd)
|
||||||
},
|
},
|
||||||
clearSearch () {
|
clearSearch () {
|
||||||
search.clear().then(res => {
|
search.clear().then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user