|
@ -82,10 +82,9 @@ export default { |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.initSmartBookshelf() |
|
|
this.initSmartBookshelf() |
|
|
this.getBookList() |
|
|
|
|
|
|
|
|
this.getNewBookList() |
|
|
this.rackList = data.bookList.splice(0, 1) |
|
|
this.rackList = data.bookList.splice(0, 1) |
|
|
this.otherList = data.bookList.splice(-2) |
|
|
this.otherList = data.bookList.splice(-2) |
|
|
// this.newList = data.newList |
|
|
|
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
|
|
@ -94,10 +93,17 @@ export default { |
|
|
toPath(path) { |
|
|
toPath(path) { |
|
|
this.$router.push(path) |
|
|
this.$router.push(path) |
|
|
}, |
|
|
}, |
|
|
getBookList() { |
|
|
|
|
|
FetchNewBookRecommend().then(res => { |
|
|
|
|
|
|
|
|
// 首页 - 新书推荐 |
|
|
|
|
|
getNewBookList() { |
|
|
|
|
|
const params = { |
|
|
|
|
|
libcode: this.libcode, |
|
|
|
|
|
pageNo: 1, |
|
|
|
|
|
pageSize: 4 |
|
|
|
|
|
} |
|
|
|
|
|
FetchNewBookRecommend(params).then(res => { |
|
|
|
|
|
console.log(res) |
|
|
let data = [] |
|
|
let data = [] |
|
|
data = res |
|
|
|
|
|
|
|
|
data = res.newbookList |
|
|
data.forEach(item => { |
|
|
data.forEach(item => { |
|
|
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|
|
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|
|
}) |
|
|
}) |
|
@ -105,6 +111,7 @@ export default { |
|
|
this.$message.error('接口错误') |
|
|
this.$message.error('接口错误') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 根据isbn获取图书封面 |
|
|
getCoverByISBN(isbn, item) { |
|
|
getCoverByISBN(isbn, item) { |
|
|
const params = { |
|
|
const params = { |
|
|
isbn: isbn |
|
|
isbn: isbn |
|
@ -112,9 +119,9 @@ export default { |
|
|
FetchCoverByISBN(params).then((res) => { |
|
|
FetchCoverByISBN(params).then((res) => { |
|
|
item.cover = window.URL.createObjectURL(res) |
|
|
item.cover = window.URL.createObjectURL(res) |
|
|
this.newList.push(item) |
|
|
this.newList.push(item) |
|
|
// this.newList.slice(0, 4) |
|
|
|
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 初始化首页书架信息 |
|
|
initSmartBookshelf() { |
|
|
initSmartBookshelf() { |
|
|
const params = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' } |
|
|
const params = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' } |
|
|
initSmartBookshelf(params).then((res) => { |
|
|
initSmartBookshelf(params).then((res) => { |
|
|