diff --git a/src/views/mixins/booklist.js b/src/views/mixins/booklist.js index 6163527..c2985e0 100644 --- a/src/views/mixins/booklist.js +++ b/src/views/mixins/booklist.js @@ -6,8 +6,9 @@ export const bookListCrud = { defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', bookData: [], page: 1, - pageSize: 9, - pageCount: 1 + pageSize: 13, + pageCount: 1, + bookLoading: false } }, computed: { @@ -20,6 +21,7 @@ export const bookListCrud = { methods: { // 获取热门/新书图书list getBookData() { + this.bookLoading = true const bookType = this.$route.query.bookType const params = { libcode: this.libcode, @@ -53,6 +55,7 @@ export const bookListCrud = { FetchCoverByISBN(params).then((res) => { item.cover = window.URL.createObjectURL(res) this.bookData.push(item) + this.bookLoading = false }) }, // 滚动加载 @@ -62,8 +65,10 @@ export const bookListCrud = { const scrollHeight = e.target.scrollHeight // 滚动条到底部 if (scrollTop + windowHeight === scrollHeight) { + this.bookLoading = true this.page++ if (this.page > this.pageCount) { + this.bookLoading = false this.$message.success('暂无更多数据~') return } diff --git a/src/views/module/bookList.vue b/src/views/module/bookList.vue index 343269c..9268527 100644 --- a/src/views/module/bookList.vue +++ b/src/views/module/bookList.vue @@ -1,5 +1,5 @@