Browse Source

swiper-新书推荐

master
xuhuajiao 2 years ago
parent
commit
2e4e91e4c5
  1. 2
      src/router/index.js
  2. 20
      src/views/newBookRecommend.vue

2
src/router/index.js

@ -25,7 +25,7 @@ const routes = [
name: 'LibraryIntroduction',
component: () => import('../views/libraryIntroduction.vue'),
meta: {
title: '图书简介'
title: '图书简介'
}
},
{

20
src/views/newBookRecommend.vue

@ -48,7 +48,6 @@ export default {
this.getBookList()
},
mounted() {
this.initSwiper()
},
methods: {
initSwiper() {
@ -72,8 +71,9 @@ export default {
getBookList() {
FetchNewBookRecommend().then(res => {
console.log(res, 'res')
this.rankingList = res.data
this.rankingList.forEach(item => {
let data = []
data = res
data.forEach(item => {
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item)
})
}).catch(() => {
@ -85,8 +85,9 @@ export default {
isbn: isbn
}
FetchCoverByISBN(params).then((res) => {
console.log(res, 'blob')
item.cover = window.URL.createObjectURL(res)
this.rankingList.push(item)
this.initSwiper()
})
}
}
@ -108,12 +109,10 @@ export default {
}
.book-img{
height: 6.575rem;
line-height: 6.575rem;
img{
// display: block;
display: block;
width: 100%;
// height: 100%;
vertical-align: middle;
height: 100%;
}
}
.book-info{
@ -128,15 +127,12 @@ export default {
}
}
.icon{
height: 1.1em;
}
.prev-btn,
.next-btn{
position: absolute;
bottom: 60px;
font-size: 60px;
// color: #71C09E;
color: #71C09E;
z-index: 999;
}

Loading…
Cancel
Save