Browse Source

本架图书

master
z_yu 2 years ago
parent
commit
cba110b79a
  1. 12
      src/api/bookshelf.js
  2. 26
      src/views/bookRackList.vue
  3. 12
      src/views/index.vue

12
src/api/bookshelf.js

@ -74,6 +74,15 @@ export function FetchProposeAuthor(params) {
}) })
} }
// 作者推荐
export function initBookshelfDetails(params) {
return request({
url: '/dxhtsg/initBookshelfDetails',
method: 'get',
params
})
}
export default { export default {
FetchNewBookRecommend, FetchNewBookRecommend,
FetchCoverByISBN, FetchCoverByISBN,
@ -82,5 +91,6 @@ export default {
initSmartBookshelf, initSmartBookshelf,
FetchInitBookshelfDetails, FetchInitBookshelfDetails,
FetchHotBookRecommend, FetchHotBookRecommend,
FetchProposeAuthor
FetchProposeAuthor,
initBookshelfDetails
} }

26
src/views/bookRackList.vue

@ -27,17 +27,17 @@
</div> --> </div> -->
<div :class="['swiper'+index,'rack-box-list']"> <div :class="['swiper'+index,'rack-box-list']">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div v-for="(eitem , eindex) in bookList" :key="eitem.id" class="list-item swiper-slide" @click="handleDetails(eindex)">
<div v-for="(eitem , eindex) in bookList[item]" :key="eitem.id" class="list-item swiper-slide" @click="handleDetails(eindex)">
<div class="box-txt"> <div class="box-txt">
<span class="book-name">{{ eitem.title }} {{ eindex+1 }}</span>
<span class="book-writer">{{ eitem.author }}</span>
<span class="book-name">{{ eitem.bookName }} {{ eindex+1 }}</span>
<span class="book-writer">{{ eitem.bookAuthor }}</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="rack-floor"> <div class="rack-floor">
<span :class="['icon','iconfont','icon-l'+index]" @click="handlePage(-1)">&#xe631;</span> <span :class="['icon','iconfont','icon-l'+index]" @click="handlePage(-1)">&#xe631;</span>
<p><span style="margin-right:25px">{{ index+1 }}</span><span>( {{ bookList.length }})</span></p>
<p><span style="margin-right:25px">{{ index+1 }}</span><span>( {{ bookList[item].length }})</span></p>
<span :class="['icon','iconfont','icon-r'+index]" @click="handlePage(1)">&#xe62f;</span> <span :class="['icon','iconfont','icon-r'+index]" @click="handlePage(1)">&#xe62f;</span>
</div> </div>
</div> </div>
@ -48,6 +48,7 @@
<script> <script>
import data1 from './data1.json' import data1 from './data1.json'
import { initBookshelfDetails } from '@/api/bookshelf'
import BookDetails from './module/bookDetails.vue' import BookDetails from './module/bookDetails.vue'
import { Swiper } from 'vue-awesome-swiper' import { Swiper } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css' import 'swiper/swiper-bundle.css'
@ -66,8 +67,10 @@ export default {
} }
}, },
created() { created() {
// this.$route.query.leftShelfNo
this.listData = data1.listData this.listData = data1.listData
this.bookList = data1.rackBook this.bookList = data1.rackBook
this.initBookshelfDetails(-1)
}, },
mounted() { mounted() {
this.initSwiper() this.initSwiper()
@ -109,6 +112,21 @@ export default {
this.classnameL = null this.classnameL = null
this.classnameR = 'rack-direct-active' this.classnameR = 'rack-direct-active'
} }
this.initBookshelfDetails(n)
},
initBookshelfDetails(n) {
const params = {}
if (n === -1) { //
params.shelfNo = this.$route.query.leftShelfNo
} else { //
params.shelfNo = this.$route.query.rightShelfNo
}
console.log(params, this.$route.query.leftShelfNo)
initBookshelfDetails(params).then((res) => {
console.log(res)
this.listData = res.shelfs
this.bookList = res.shelfBook
})
} }
} }
} }

12
src/views/index.vue

@ -74,6 +74,8 @@ export default {
shelfName: '1', shelfName: '1',
leftShelfMsg: '', leftShelfMsg: '',
rightShelfMsg: '', rightShelfMsg: '',
leftShelfNo: '1201-03-001-A-01',
rightShelfNo: '1201-03-001-B-01',
rackList: [], // rackList: [], //
otherList: [], // otherList: [], //
newList: [] // newList: [] //
@ -88,7 +90,12 @@ export default {
}, },
methods: { methods: {
toPath(path) { toPath(path) {
if (path === '/CurrentRackBook') {
const query = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' }
this.$router.push({ path: path, query: query })
} else {
this.$router.push(path) this.$router.push(path)
}
}, },
// - // -
getNewBookList() { getNewBookList() {
@ -119,7 +126,9 @@ export default {
}, },
// //
initSmartBookshelf() { initSmartBookshelf() {
const params = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' }
// this.$route.query.leftShelfNo
// this.$route.query.rightShelfNo
const params = { leftShelfNo: this.leftShelfNo, rightShelfNo: this.rightShelfNo }
// const _this = this // const _this = this
initSmartBookshelf(params).then((res) => { initSmartBookshelf(params).then((res) => {
this.shelfName = res.shelfName this.shelfName = res.shelfName
@ -145,7 +154,6 @@ export default {
num: 0, num: 0,
isbn: item.isbn isbn: item.isbn
} }
// return newItem
const params = { const params = {
isbn: item.isbn isbn: item.isbn
} }

Loading…
Cancel
Save