Browse Source

swiper-bug/图书详情bug

master
xuhuajiao 2 years ago
parent
commit
238521f947
  1. 13
      src/views/bookRackList.vue
  2. 6
      src/views/digitalResource.vue
  3. 2
      src/views/index.vue
  4. 2
      src/views/module/bookDetails.vue
  5. 11
      src/views/module/bookList.vue
  6. 0
      src/views/module/homeListItem.vue
  7. 3
      src/views/newBook.vue

13
src/views/bookRackList.vue

@ -76,6 +76,14 @@ export default {
} }
}) })
}, },
// swiper
setSwiperInit() {
setTimeout(() => {
this.listData.forEach((item, index) => {
document.getElementsByClassName('swiper-wrapper')[index].style.transform = 'translate3d(0px, 0px, 0px)'
})
}, 50)
},
handleDetails(itemData) { handleDetails(itemData) {
const params = { const params = {
isbn: itemData.isbn.replace(/\-/g, '') isbn: itemData.isbn.replace(/\-/g, '')
@ -126,7 +134,10 @@ export default {
const shelfNo = res.shelfs[index] const shelfNo = res.shelfs[index]
this.$set(this.bookList, shelfNo, res.shelfBook[shelfNo]) this.$set(this.bookList, shelfNo, res.shelfBook[shelfNo])
} }
this.initSwiper()
if (this.listData.length > 0) {
this.initSwiper()
this.setSwiperInit()
}
setTimeout(() => { setTimeout(() => {
this.loading = false this.loading = false
}, 1000) }, 1000)

6
src/views/digitalResource.vue

@ -1,6 +1,5 @@
<template> <template>
<div id="bookshelf"> <div id="bookshelf">
<!-- <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">&#xe631;</span> <span class="icon iconfont icon-l">&#xe631;</span>
@ -8,7 +7,6 @@
<h2>数字资源</h2> <h2>数字资源</h2>
</div> </div>
<div class="main"> <div class="main">
<!-- <div v-for="item in srcList" :key="item" class="book-rack"> -->
<div v-for="(item,index) in srcList" :key="index" class="main-item" @click="jump(item.nrsUrl)"> <div v-for="(item,index) in srcList" :key="index" class="main-item" @click="jump(item.nrsUrl)">
<img :src="'data:image/png;base64,' + item.nrsImages"> <img :src="'data:image/png;base64,' + item.nrsImages">
<div class="title"> <div class="title">
@ -21,13 +19,10 @@
</template> </template>
<script> <script>
// import HeaderTop from '@/views/module/headerTop.vue'
import { initNumberResoures } from '@/api/bookshelf' import { initNumberResoures } from '@/api/bookshelf'
// import data1 from './data1.json'
export default { export default {
name: 'DigitalResource', name: 'DigitalResource',
components: { components: {
// HeaderTop
}, },
data() { data() {
return { return {
@ -35,7 +30,6 @@ export default {
} }
}, },
created() { created() {
// this.srcList = data1.srcList
this.getInfo() this.getInfo()
}, },
methods: { methods: {

2
src/views/index.vue

@ -62,7 +62,7 @@
</template> </template>
<script> <script>
import BookListItem from '@/views/module/bookListItem.vue'
import BookListItem from '@/views/module/homeListItem.vue'
import { FetchNewBookRecommend, FetchCoverByISBN, initSmartBookshelf } from '@/api/bookshelf' import { FetchNewBookRecommend, FetchCoverByISBN, initSmartBookshelf } from '@/api/bookshelf'
export default { export default {
name: 'Home', name: 'Home',

2
src/views/module/bookDetails.vue

@ -20,7 +20,7 @@
</div> </div>
</div> </div>
<div class="book-local"> <div class="book-local">
{{ bookData.bookPlace }}
<span v-if="bookData.bookPlace">所在位置{{ bookData.bookPlace }}</span>
</div> </div>
</div> </div>
</div> </div>

11
src/views/module/bookList.vue

@ -54,9 +54,14 @@ export default {
isbn: this.bookdata[index].isbn.replace(/\-/g, '') isbn: this.bookdata[index].isbn.replace(/\-/g, '')
} }
getBookDetailsByISBN(params).then(res => { getBookDetailsByISBN(params).then(res => {
console.log(res)
this.$refs.detailDom.bookData = res
this.$refs.detailDom.dialogVisible = true
if (res) {
this.$refs.detailDom.bookData = res
this.$refs.detailDom.dialogVisible = true
} else {
this.$message.error('暂无图书内容~')
}
}).catch(() => {
this.$message.error('接口错误')
}) })
} }
} }

0
src/views/module/bookListItem.vue → src/views/module/homeListItem.vue

3
src/views/newBook.vue

@ -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">&#xe631;</span> <span class="icon iconfont icon-l">&#xe631;</span>
@ -13,7 +11,6 @@
</template> </template>
<script> <script>
// import HeaderTop from '@/views/module/headerTop.vue'
import BookList from '@/views/module/bookList.vue' import BookList from '@/views/module/bookList.vue'
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/bookshelf' import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/bookshelf'
export default { export default {

Loading…
Cancel
Save