Commit 82f4f5c6 by 李伟康

修复分页BUG

1 parent f4572d82
...@@ -159,6 +159,7 @@ export default { ...@@ -159,6 +159,7 @@ export default {
this.list = list.concat(data) this.list = list.concat(data)
this.total = count this.total = count
this.hideLoading() this.hideLoading()
this.$refs.scrollView.loading = false
} catch (error) { } catch (error) {
this.hideLoading() this.hideLoading()
} }
...@@ -169,14 +170,17 @@ export default { ...@@ -169,14 +170,17 @@ export default {
let { total, params: { pageNum }, list, $refs: { let { total, params: { pageNum }, list, $refs: {
scrollView scrollView
} } = this } } = this
scrollView.loading = false scrollView.loading = true
if (list.length == total) { if (list.length == total) {
return scrollView.finished = true return scrollView.finished = true
} }
if (Math.ceil(total / 10) > pageNum) { if (Math.ceil(total / 10) > pageNum) {
this.params.pageNum = pageNum + 1 this.params.pageNum = pageNum + 1
this.getChatLibraryList() this.getChatLibraryList()
} else scrollView.finished = true } else {
scrollView.finished = true
scrollView.loading = false
}
}, },
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!