|
|
@ -11,7 +11,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="rack-box"> |
|
|
|
<div v-for="(item,index) in listData" :key="index" class="rack-item"> |
|
|
|
<div v-for="(item, index) in listData" :key="index" class="rack-item"> |
|
|
|
<!-- <ul class="rack-box-list"> |
|
|
|
<li v-for="(eitem , eindex) in bookList" :key="eitem.id" class="list-item" @click="handleDetails(eindex)"> |
|
|
|
<div class="box-txt"> |
|
|
@ -27,17 +27,17 @@ |
|
|
|
</div> --> |
|
|
|
<div :class="['swiper'+index,'rack-box-list']"> |
|
|
|
<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"> |
|
|
|
<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 class="rack-floor"> |
|
|
|
<span :class="['icon','iconfont','icon-l'+index]" @click="handlePage(-1)"></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)"></span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -48,6 +48,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import data1 from './data1.json' |
|
|
|
import { initBookshelfDetails } from '@/api/bookshelf' |
|
|
|
import BookDetails from './module/bookDetails.vue' |
|
|
|
import { Swiper } from 'vue-awesome-swiper' |
|
|
|
import 'swiper/swiper-bundle.css' |
|
|
@ -66,8 +67,10 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
// this.$route.query.leftShelfNo |
|
|
|
this.listData = data1.listData |
|
|
|
this.bookList = data1.rackBook |
|
|
|
this.initBookshelfDetails(-1) |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.initSwiper() |
|
|
@ -109,6 +112,21 @@ export default { |
|
|
|
this.classnameL = null |
|
|
|
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 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -116,11 +134,11 @@ export default { |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
@import "~@/assets/styles/index.scss"; |
|
|
|
.swiper-container{ |
|
|
|
.swiper-container { |
|
|
|
position: relative; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
.swiper-slide{ |
|
|
|
.swiper-slide { |
|
|
|
width: 65px !important; |
|
|
|
} |
|
|
|
</style> |