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