Browse Source

获取首页书架基本信息

master
z_yu 2 years ago
parent
commit
542d47a8d8
  1. 12
      src/api/bookshelf.js
  2. 2
      src/assets/styles/index.scss
  3. 21
      src/views/index.vue

12
src/api/bookshelf.js

@ -38,9 +38,19 @@ export function getBookDetailsByISBN(params) {
}) })
} }
// 获取首页书架基本信息
export function initSmartBookshelf(params) {
return request({
url: '/dxhtsg/initSmartBookshelf',
method: 'get',
params
})
}
export default { export default {
FetchNewBookRecommend, FetchNewBookRecommend,
FetchCoverByISBN, FetchCoverByISBN,
initNumberResoures, initNumberResoures,
getBookDetailsByISBN
getBookDetailsByISBN,
initSmartBookshelf
} }

2
src/assets/styles/index.scss

@ -35,7 +35,7 @@
position: absolute; position: absolute;
top: 30px; top: 30px;
right: 40px; right: 40px;
width: 134px;
width: 180px;
height: 58px; height: 58px;
line-height: 60px; line-height: 60px;
background: linear-gradient(90deg, #ACDAFF 0%, #9BCEFF 100%); background: linear-gradient(90deg, #ACDAFF 0%, #9BCEFF 100%);

21
src/views/index.vue

@ -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
})
} }
} }
} }

Loading…
Cancel
Save