Browse Source

swiper-bug/图书详情bug

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

11
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) {
const params = {
isbn: itemData.isbn.replace(/\-/g, '')
@ -126,7 +134,10 @@ export default {
const shelfNo = res.shelfs[index]
this.$set(this.bookList, shelfNo, res.shelfBook[shelfNo])
}
if (this.listData.length > 0) {
this.initSwiper()
this.setSwiperInit()
}
setTimeout(() => {
this.loading = false
}, 1000)

6
src/views/digitalResource.vue

@ -1,6 +1,5 @@
<template>
<div id="bookshelf">
<!-- <div class="top-bg" /> -->
<div class="bookshelf-header" style="height:120px">
<router-link to="/">
<span class="icon iconfont icon-l">&#xe631;</span>
@ -8,7 +7,6 @@
<h2>数字资源</h2>
</div>
<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)">
<img :src="'data:image/png;base64,' + item.nrsImages">
<div class="title">
@ -21,13 +19,10 @@
</template>
<script>
// import HeaderTop from '@/views/module/headerTop.vue'
import { initNumberResoures } from '@/api/bookshelf'
// import data1 from './data1.json'
export default {
name: 'DigitalResource',
components: {
// HeaderTop
},
data() {
return {
@ -35,7 +30,6 @@ export default {
}
},
created() {
// this.srcList = data1.srcList
this.getInfo()
},
methods: {

2
src/views/index.vue

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

2
src/views/module/bookDetails.vue

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

7
src/views/module/bookList.vue

@ -54,9 +54,14 @@ export default {
isbn: this.bookdata[index].isbn.replace(/\-/g, '')
}
getBookDetailsByISBN(params).then(res => {
console.log(res)
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>
<div id="bookshelf">
<!-- <HeaderTop /> -->
<!-- <div class="top-bg" /> -->
<div class="bookshelf-header" style="height:120px">
<router-link to="/">
<span class="icon iconfont icon-l">&#xe631;</span>
@ -13,7 +11,6 @@
</template>
<script>
// import HeaderTop from '@/views/module/headerTop.vue'
import BookList from '@/views/module/bookList.vue'
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/bookshelf'
export default {

Loading…
Cancel
Save