|
|
@ -147,9 +147,11 @@ export default { |
|
|
|
this.rightShelfMsg = res.rightShelf.sortMsg |
|
|
|
Promise.all(this.initBookData(res.bookList.splice(0, 1))).then((res) => { |
|
|
|
this.rackList = res |
|
|
|
console.log('rackList', this.rackList) |
|
|
|
}) |
|
|
|
Promise.all(this.initBookData(res.bookList.splice(-2))).then((res) => { |
|
|
|
this.otherList = res |
|
|
|
console.log('otherList', this.otherList) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
@ -157,19 +159,20 @@ export default { |
|
|
|
initBookData(bookList) { |
|
|
|
return bookList.map(async(item, index) => { |
|
|
|
const newItem = { |
|
|
|
cover: item.srcUrl, |
|
|
|
ranking: item.bookUID, |
|
|
|
nbName: item.bookName, |
|
|
|
isOtherBook: index !== 0, |
|
|
|
nbAuthor: item.bookAuthor, |
|
|
|
nbAuthor: item.bookAuthor ? item.bookAuthor : '', |
|
|
|
isNewBook: false, |
|
|
|
num: item.heat ? item.heat : '0', |
|
|
|
isbn: item.isbn |
|
|
|
} |
|
|
|
const params = { |
|
|
|
isbn: item.isbn |
|
|
|
} |
|
|
|
const res = await FetchCoverByISBN(params) |
|
|
|
newItem.cover = window.URL.createObjectURL(res) |
|
|
|
// const params = { |
|
|
|
// isbn: item.isbn |
|
|
|
// } |
|
|
|
// const res = await FetchCoverByISBN(params) |
|
|
|
// newItem.cover = window.URL.createObjectURL(res) |
|
|
|
return newItem |
|
|
|
}) |
|
|
|
} |
|
|
|