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