Browse Source

新书推荐详情 接口

master
x_ying 2 years ago
parent
commit
84771be119
  1. 12
      src/api/inquiryMachine.js
  2. 10
      src/views/module/bookDetails.vue
  3. 17
      src/views/newBookRecommend.vue

12
src/api/inquiryMachine.js

@ -47,10 +47,20 @@ export function FetchCoverByISBN(params) {
}) })
} }
// 图书详情
export function getBookDetailsByISBN(params) {
return request({
url: '/dxhtsg/getBookDetailsByISBN',
method: 'get',
params: params
})
}
export default { export default {
activityInquiry, activityInquiry,
libraryIntro, libraryIntro,
FetchNewBookRecommend, FetchNewBookRecommend,
FetchCoverByISBN, FetchCoverByISBN,
initNumberResoures
initNumberResoures,
getBookDetailsByISBN
} }

10
src/views/module/bookDetails.vue

@ -10,13 +10,13 @@
<div class="book-details-box"> <div class="book-details-box">
<div class="book-details"> <div class="book-details">
<div class="book-cover"> <div class="book-cover">
<img :src="bookData.cover" :onerror="defaultImg">
<img :src="bookData.srcUrl ? bookData.srcUrl : ''" :onerror="defaultImg">
</div> </div>
<div class="book-desc"> <div class="book-desc">
<h3>{{ bookData.nbName }}</h3>
<p class="book-from">作者{{ bookData.nbAuthor }}</p>
<p class="book-from">出版社{{ bookData.nbPublisher }}</p>
<p class="book-brief"> 简介{{ bookData.nbExplain }}</p>
<h3>{{ bookData.bookName }}</h3>
<p class="book-from">作者{{ bookData.bookAuthor }}</p>
<p v-if="bookData.Publish" class="book-from">出版社{{ bookData.Publish }}</p>
<p class="book-brief"> 简介{{ bookData.gist }}</p>
</div> </div>
</div> </div>
<div class="book-local"> <div class="book-local">

17
src/views/newBookRecommend.vue

@ -35,7 +35,7 @@
<script> <script>
import { Swiper } from 'vue-awesome-swiper' import { Swiper } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css' import 'swiper/swiper-bundle.css'
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/inquiryMachine'
import { FetchNewBookRecommend, FetchCoverByISBN, getBookDetailsByISBN } from '@/api/inquiryMachine'
import BookDetails from './module/bookDetails.vue' import BookDetails from './module/bookDetails.vue'
export default { export default {
name: 'NewBookRecommend', name: 'NewBookRecommend',
@ -63,13 +63,18 @@ export default {
spaceBetween: 20, spaceBetween: 20,
centeredSlides: true, centeredSlides: true,
observer: true, observer: true,
loop: true,
// loop: true,
centeredSlidesBounds: true, centeredSlidesBounds: true,
watchSlidesVisibility: true, watchSlidesVisibility: true,
navigation: { navigation: {
nextEl: '.next-btn', nextEl: '.next-btn',
prevEl: '.prev-btn' prevEl: '.prev-btn'
} }
// on: {
// click: function() {
// alert(this.clickedIndex)
// }
// }
}) })
}) })
}, },
@ -97,9 +102,13 @@ export default {
}, },
// //
handleDetails(index) { handleDetails(index) {
console.log(index)
this.$refs.detailDom.bookData = this.rankingList[index]
const params = {
isbn: this.rankingList[index].isbn.replace(/\-/g, '')
}
getBookDetailsByISBN(params).then(res => {
this.$refs.detailDom.bookData = res
this.$refs.detailDom.dialogVisible = true this.$refs.detailDom.dialogVisible = true
})
} }
} }
} }

Loading…
Cancel
Save