|
@ -1,7 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div id="bookshelf"> |
|
|
<div id="bookshelf"> |
|
|
<HeaderTop /> |
|
|
|
|
|
<!-- <div class="top-bg" /> --> |
|
|
|
|
|
<div class="bookshelf-header" style="height:120px"> |
|
|
<div class="bookshelf-header" style="height:120px"> |
|
|
<router-link to="/"> |
|
|
<router-link to="/"> |
|
|
<span class="icon iconfont icon-l"></span> |
|
|
<span class="icon iconfont icon-l"></span> |
|
@ -14,18 +12,44 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div class="rack-box"> |
|
|
<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"> |
|
|
|
|
|
|
|
|
<!-- <ul class="rack-box-list"> |
|
|
<li v-for="(eitem , eindex) in bookList" :key="eitem.id" class="list-item" @click="handleDetails(eindex)"> |
|
|
<li v-for="(eitem , eindex) in bookList" :key="eitem.id" class="list-item" @click="handleDetails(eindex)"> |
|
|
<div class="box-txt"> |
|
|
<div class="box-txt"> |
|
|
<span class="book-name">{{ eitem.title }}</span> |
|
|
<span class="book-name">{{ eitem.title }}</span> |
|
|
<span class="book-writer">{{ eitem.author }}</span> |
|
|
<span class="book-writer">{{ eitem.author }}</span> |
|
|
</div> |
|
|
</div> |
|
|
</li> |
|
|
</li> |
|
|
</ul> |
|
|
|
|
|
<div class="rack-floor"> |
|
|
|
|
|
|
|
|
</ul> --> |
|
|
|
|
|
<!-- <div class="rack-floor"> |
|
|
<span class="icon iconfont icon-l" @click="handlePage(-1)"></span> |
|
|
<span class="icon iconfont icon-l" @click="handlePage(-1)"></span> |
|
|
<p><span style="margin-right:25px" @click="handlePage(1)">第一层</span><span>(共15本)</span></p> |
|
|
|
|
|
<span class="icon iconfont icon-r"></span> |
|
|
|
|
|
|
|
|
<p><span style="margin-right:25px">第一层</span><span>(共15本)</span></p> |
|
|
|
|
|
<span class="icon iconfont icon-r" @click="handlePage(1)"></span> |
|
|
|
|
|
</div> --> |
|
|
|
|
|
<!-- <swiper |
|
|
|
|
|
class="swiper rack-box-list" |
|
|
|
|
|
:options="swiperOption" |
|
|
|
|
|
> |
|
|
|
|
|
<swiper-slide v-for="(eitem , eindex) in bookList" :key="eitem.id" class="list-item" @click="handleDetails(eindex)"> |
|
|
|
|
|
<div class="box-txt"> |
|
|
|
|
|
<span class="book-name">{{ eitem.title }} {{ eindex+1 }}</span> |
|
|
|
|
|
<span class="book-writer">{{ eitem.author }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</swiper-slide> |
|
|
|
|
|
</swiper> --> |
|
|
|
|
|
<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 class="box-txt"> |
|
|
|
|
|
<span class="book-name">{{ eitem.title }} {{ eindex+1 }}</span> |
|
|
|
|
|
<span class="book-writer">{{ eitem.author }}</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div :class="['swiper-nav'+index,'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> |
|
|
|
|
|
<span :class="['icon','iconfont','icon-r'+index]" @click="handlePage(1)"></span> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
@ -36,20 +60,29 @@ |
|
|
<script> |
|
|
<script> |
|
|
import data1 from './data1.json' |
|
|
import data1 from './data1.json' |
|
|
import BookDetails from './module/bookDetails.vue' |
|
|
import BookDetails from './module/bookDetails.vue' |
|
|
import HeaderTop from '@/views/module/headerTop.vue' |
|
|
|
|
|
|
|
|
import { Swiper } from 'vue-awesome-swiper' |
|
|
|
|
|
import 'swiper/swiper-bundle.css' |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: 'CurrentRackBook', |
|
|
name: 'CurrentRackBook', |
|
|
components: { |
|
|
components: { |
|
|
BookDetails, |
|
|
|
|
|
HeaderTop |
|
|
|
|
|
|
|
|
BookDetails |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
listData: [], |
|
|
listData: [], |
|
|
bookList: [], |
|
|
bookList: [], |
|
|
classnameL: 'rack-direct-active', |
|
|
classnameL: 'rack-direct-active', |
|
|
classnameR: null |
|
|
|
|
|
|
|
|
classnameR: null, |
|
|
|
|
|
swiperOption: { |
|
|
|
|
|
slidesPerView: 'auto', |
|
|
|
|
|
slidesPerGroup: 15, |
|
|
|
|
|
observer: true, |
|
|
|
|
|
navigation: { |
|
|
|
|
|
nextEl: '.icon-r', |
|
|
|
|
|
prevEl: '.icon-l' |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created() { |
|
|
created() { |
|
@ -57,8 +90,25 @@ export default { |
|
|
this.bookList = data1.rackBook |
|
|
this.bookList = data1.rackBook |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
|
|
|
this.initSwiper1() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
initSwiper1() { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
// const objName = document.get |
|
|
|
|
|
this.bookList.forEach((el, index) => { |
|
|
|
|
|
new Swiper('.swiper' + index, { |
|
|
|
|
|
slidesPerView: 'auto', |
|
|
|
|
|
slidesPerGroup: 15, |
|
|
|
|
|
observer: true, |
|
|
|
|
|
navigation: { |
|
|
|
|
|
nextEl: '.icon-r' + index, |
|
|
|
|
|
prevEl: '.icon-l' + index |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
handleDetails(index) { |
|
|
handleDetails(index) { |
|
|
this.$refs.detailDom.bookData = this.bookList[index] |
|
|
this.$refs.detailDom.bookData = this.bookList[index] |
|
|
this.$refs.detailDom.dialogVisible = true |
|
|
this.$refs.detailDom.dialogVisible = true |
|
@ -87,5 +137,11 @@ export default { |
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
<style lang="scss"> |
|
|
@import "~@/assets/styles/index.scss"; |
|
|
@import "~@/assets/styles/index.scss"; |
|
|
|
|
|
|
|
|
|
|
|
.swiper-container{ |
|
|
|
|
|
position: relative; |
|
|
|
|
|
width: 100%; |
|
|
|
|
|
} |
|
|
|
|
|
.swiper-slide{ |
|
|
|
|
|
width: 65px !important; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |