无需定义getPage函数

This commit is contained in:
haiyangcui
2020-11-30 23:49:56 +01:00
parent f772ac2e9d
commit f8041290d2

View File

@@ -433,10 +433,9 @@ export default {
this.show.classList = false
this.list = []
this.type = this.classList.find(x => x.name === className)
this.getPage().then(res => {
if (res) {
this.infiniteId += 1
}
zy.page(this.site.key, this.type.tid).then(res => {
this.pagecount = res.pagecount
this.infiniteId += 1
})
},
getClass () {
@@ -473,19 +472,6 @@ export default {
}
return this.r18KeyWords.some(v => name.includes(v))
},
getPage () {
return new Promise((resolve, reject) => {
const key = this.site.key
const type = this.type.tid
zy.page(key, type).then(res => {
this.pagecount = res.pagecount
this.show.body = true
resolve(true)
}).catch(err => {
reject(err)
})
})
},
infiniteHandler ($state) {
const key = this.site.key
const type = this.type.tid