Browse Source

本架图书

master
z_yu 2 years ago
parent
commit
cba110b79a
  1. 12
      src/api/bookshelf.js
  2. 26
      src/views/bookRackList.vue
  3. 12
      src/views/index.vue

12
src/api/bookshelf.js

@ -74,6 +74,15 @@ export function FetchProposeAuthor(params) {
})
}
// 作者推荐
export function initBookshelfDetails(params) {
return request({
url: '/dxhtsg/initBookshelfDetails',
method: 'get',
params
})
}
export default {
FetchNewBookRecommend,
FetchCoverByISBN,
@ -82,5 +91,6 @@ export default {
initSmartBookshelf,
FetchInitBookshelfDetails,
FetchHotBookRecommend,
FetchProposeAuthor
FetchProposeAuthor,
initBookshelfDetails
}

26
src/views/bookRackList.vue

@ -27,17 +27,17 @@
</div> -->
<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 v-for="(eitem , eindex) in bookList[item]" :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>
<span class="book-name">{{ eitem.bookName }} {{ eindex+1 }}</span>
<span class="book-writer">{{ eitem.bookAuthor }}</span>
</div>
</div>
</div>
</div>
<div class="rack-floor">
<span :class="['icon','iconfont','icon-l'+index]" @click="handlePage(-1)">&#xe631;</span>
<p><span style="margin-right:25px">{{ index+1 }}</span><span>( {{ bookList.length }})</span></p>
<p><span style="margin-right:25px">{{ index+1 }}</span><span>( {{ bookList[item].length }})</span></p>
<span :class="['icon','iconfont','icon-r'+index]" @click="handlePage(1)">&#xe62f;</span>
</div>
</div>
@ -48,6 +48,7 @@
<script>
import data1 from './data1.json'
import { initBookshelfDetails } from '@/api/bookshelf'
import BookDetails from './module/bookDetails.vue'
import { Swiper } from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
@ -66,8 +67,10 @@ export default {
}
},
created() {
// this.$route.query.leftShelfNo
this.listData = data1.listData
this.bookList = data1.rackBook
this.initBookshelfDetails(-1)
},
mounted() {
this.initSwiper()
@ -109,6 +112,21 @@ export default {
this.classnameL = null
this.classnameR = 'rack-direct-active'
}
this.initBookshelfDetails(n)
},
initBookshelfDetails(n) {
const params = {}
if (n === -1) { //
params.shelfNo = this.$route.query.leftShelfNo
} else { //
params.shelfNo = this.$route.query.rightShelfNo
}
console.log(params, this.$route.query.leftShelfNo)
initBookshelfDetails(params).then((res) => {
console.log(res)
this.listData = res.shelfs
this.bookList = res.shelfBook
})
}
}
}

12
src/views/index.vue

@ -74,6 +74,8 @@ export default {
shelfName: '1',
leftShelfMsg: '',
rightShelfMsg: '',
leftShelfNo: '1201-03-001-A-01',
rightShelfNo: '1201-03-001-B-01',
rackList: [], //
otherList: [], //
newList: [] //
@ -88,7 +90,12 @@ export default {
},
methods: {
toPath(path) {
if (path === '/CurrentRackBook') {
const query = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' }
this.$router.push({ path: path, query: query })
} else {
this.$router.push(path)
}
},
// -
getNewBookList() {
@ -119,7 +126,9 @@ export default {
},
//
initSmartBookshelf() {
const params = { leftShelfNo: '1201-03-001-A-01', rightShelfNo: '1201-03-001-B-01' }
// this.$route.query.leftShelfNo
// this.$route.query.rightShelfNo
const params = { leftShelfNo: this.leftShelfNo, rightShelfNo: this.rightShelfNo }
// const _this = this
initSmartBookshelf(params).then((res) => {
this.shelfName = res.shelfName
@ -145,7 +154,6 @@ export default {
num: 0,
isbn: item.isbn
}
// return newItem
const params = {
isbn: item.isbn
}

Loading…
Cancel
Save