|
|
@ -2,12 +2,12 @@ |
|
|
|
<div id="bookshelf"> |
|
|
|
<div class="bookshelf-header"> |
|
|
|
<h2>RFID智慧书架</h2> |
|
|
|
<span class="shelf-num">01架</span> |
|
|
|
<span class="shelf-num">{{ shelfName }}</span> |
|
|
|
</div> |
|
|
|
<!-- 本架分类 --> |
|
|
|
<div class="book-category"> |
|
|
|
<p>近代文学类</p> |
|
|
|
<p>古代文学类</p> |
|
|
|
<p>{{ leftShelfMsg }}</p> |
|
|
|
<p>{{ rightShelfMsg }}</p> |
|
|
|
</div> |
|
|
|
<!-- 智慧书架导航 --> |
|
|
|
<ul class="book-nav"> |
|
|
@ -64,7 +64,7 @@ |
|
|
|
<script> |
|
|
|
import data from './data' |
|
|
|
import BookListItem from '@/views/module/bookListItem.vue' |
|
|
|
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/bookshelf' |
|
|
|
import { FetchNewBookRecommend, FetchCoverByISBN, initSmartBookshelf } from '@/api/bookshelf' |
|
|
|
export default { |
|
|
|
name: 'Home', |
|
|
|
components: { |
|
|
@ -72,12 +72,16 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
shelfName: '', |
|
|
|
leftShelfMsg: '', |
|
|
|
rightShelfMsg: '', |
|
|
|
rackList: [], // 本架图书排行第一 |
|
|
|
otherList: [], // 本架图书排行后两本 |
|
|
|
newList: [] // 新书推荐 |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.initSmartBookshelf() |
|
|
|
this.getBookList() |
|
|
|
this.rackList = data.bookList.splice(0, 1) |
|
|
|
this.otherList = data.bookList.splice(-2) |
|
|
@ -110,6 +114,15 @@ export default { |
|
|
|
this.newList.push(item) |
|
|
|
// this.newList.slice(0, 4) |
|
|
|
}) |
|
|
|
}, |
|
|
|
initSmartBookshelf() { |
|
|
|
const params = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' } |
|
|
|
initSmartBookshelf(params).then((res) => { |
|
|
|
console.log(res) |
|
|
|
this.shelfName = res.shelfName |
|
|
|
this.leftShelfMsg = res.leftShelf.sortMsg |
|
|
|
this.rightShelfMsg = res.rightShelf.sortMsg |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|