6 changed files with 343 additions and 333 deletions
-
34.env.development
-
190src/api/library.js
-
3src/views/accessToLibrary/index.vue
-
197src/views/lengingRanking/index.vue
-
248src/views/newBookRecommend/index.vue
-
4src/views/video/index.vue
@ -1,19 +1,15 @@ |
|||
ENV = 'development' |
|||
|
|||
# 接口地址 |
|||
|
|||
#内网服务地址 |
|||
#VUE_APP_BASE_API = 'http://192.168.99.107:7070' |
|||
#VUE_APP_WS_API = 'ws://192.168.99.107:7071' |
|||
#VUE_APP_CAMERA_API = '192.168.99.107' |
|||
|
|||
# 刘力-本地服地址 |
|||
#VUE_APP_BASE_API = 'http://192.168.99.65:7070' |
|||
#VUE_APP_WS_API = 'ws://192.168.99.65:7071' |
|||
|
|||
# 许镇-本地服地址 |
|||
VUE_APP_BASE_API = 'http://192.168.99.84:8080' |
|||
VUE_APP_WS_API = 'ws://192.168.99.84:8081' |
|||
|
|||
# 是否启用 babel-plugin-dynamic-import-node插件 |
|||
VUE_CLI_BABEL_TRANSPILE_MODULES = true |
|||
ENV = 'development' |
|||
|
|||
# 接口地址 |
|||
|
|||
#内网服务地址 |
|||
#VUE_APP_BASE_API = 'http://192.168.99.107:7070' |
|||
#VUE_APP_WS_API = 'ws://192.168.99.107:7071' |
|||
#VUE_APP_CAMERA_API = '192.168.99.107' |
|||
|
|||
# 许镇-本地服地址 |
|||
VUE_APP_BASE_API = 'http://192.168.99.67:8080' |
|||
VUE_APP_WS_API = 'ws://192.168.99.67:8081' |
|||
|
|||
# 是否启用 babel-plugin-dynamic-import-node插件 |
|||
VUE_CLI_BABEL_TRANSPILE_MODULES = true |
@ -1,95 +1,95 @@ |
|||
import request from '@/utils/request' |
|||
// import qs from 'qs'
|
|||
|
|||
// 总借阅量
|
|||
export function FetchHalfYearBorrowNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getHalfYearBorrowNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 借阅排行榜
|
|||
export function FetchBorrowRank(params) { |
|||
return request({ |
|||
url: '/dxhtsg/borrowRank', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 阅读之星
|
|||
export function FetchBorrowStar(params) { |
|||
return request({ |
|||
url: '/dxhtsg/borrowStar', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 新书推荐
|
|||
export function FetchNewBookRecommend(params) { |
|||
return request({ |
|||
url: '/dxhtsg/newBookRecommend', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 通知公告
|
|||
export function FetchInitNotice(params) { |
|||
return request({ |
|||
url: '/dxhtsg/initNotice', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 进馆人数
|
|||
export function FetchInitIntoNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/initIntoNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 24小时借还量
|
|||
export function FetchHalfYearBRNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getHalfYearBRNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 大屏幕播放文件
|
|||
export function FetchShowFileList(params) { |
|||
return request({ |
|||
url: '/dxhtsg/showFileList', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 通过isbn获取图书封面
|
|||
export function FetchCoverByISBN(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getCoverByISBN', |
|||
method: 'get', |
|||
params: params, |
|||
responseType: 'blob' |
|||
}) |
|||
} |
|||
|
|||
export default { |
|||
FetchHalfYearBorrowNum, |
|||
FetchBorrowRank, |
|||
FetchBorrowStar, |
|||
FetchNewBookRecommend, |
|||
FetchInitNotice, |
|||
FetchInitIntoNum, |
|||
FetchHalfYearBRNum, |
|||
FetchShowFileList |
|||
} |
|||
import request from '@/utils/request' |
|||
// import qs from 'qs'
|
|||
|
|||
// 总借阅量
|
|||
export function FetchHalfYearBorrowNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getHalfYearBorrowNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 借阅排行榜
|
|||
export function FetchBorrowRank(params) { |
|||
return request({ |
|||
url: '/dxhtsg/borrowRank', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 阅读之星
|
|||
export function FetchBorrowStar(params) { |
|||
return request({ |
|||
url: '/dxhtsg/borrowStar', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 新书推荐
|
|||
export function FetchNewBookRecommend(params) { |
|||
return request({ |
|||
url: '/dxhtsg/newBookRecommend', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 通知公告
|
|||
export function FetchInitNotice(params) { |
|||
return request({ |
|||
url: '/dxhtsg/initNotice', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 进馆人数
|
|||
export function FetchInitIntoNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/initIntoNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 24小时借还量
|
|||
export function FetchHalfYearBRNum(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getHalfYearBRNum', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 大屏幕播放文件
|
|||
export function FetchShowFileList(params) { |
|||
return request({ |
|||
url: '/dxhtsg/showFileList', |
|||
method: 'get', |
|||
params: params |
|||
}) |
|||
} |
|||
|
|||
// 通过isbn获取图书封面
|
|||
export function FetchCoverByISBN(params) { |
|||
return request({ |
|||
url: '/dxhtsg/getCoverByISBN', |
|||
method: 'get', |
|||
params: params |
|||
// responseType: 'blob'
|
|||
}) |
|||
} |
|||
|
|||
export default { |
|||
FetchHalfYearBorrowNum, |
|||
FetchBorrowRank, |
|||
FetchBorrowStar, |
|||
FetchNewBookRecommend, |
|||
FetchInitNotice, |
|||
FetchInitIntoNum, |
|||
FetchHalfYearBRNum, |
|||
FetchShowFileList |
|||
} |
@ -1,95 +1,102 @@ |
|||
<template> |
|||
<!-- 借阅排行榜 --> |
|||
<div class="screen-item lending-ranking"> |
|||
<div class="common-title">借阅排行榜</div> |
|||
<vue-seamless-scroll |
|||
ref="listData" |
|||
:data="rankingList" |
|||
:class-option="defaultOption" |
|||
class="big-module module-content" |
|||
> |
|||
<div |
|||
v-for="(item, index) in rankingList" |
|||
:key="index" |
|||
class="book-list-item" |
|||
> |
|||
<div class="book-img"> |
|||
<img :src="item.cover" :onerror="defaultImg"> |
|||
</div> |
|||
<div class="book-info"> |
|||
<h4 class="title-item">{{ item.bookName }}</h4> |
|||
<p>{{ item.author }}</p> |
|||
</div> |
|||
<div class="ranking-num"> |
|||
<svg v-if="index === 0" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no1" /> |
|||
</svg> |
|||
<svg v-if="index === 1" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no21" /> |
|||
</svg> |
|||
<svg v-if="index === 2" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no3" /> |
|||
</svg> |
|||
<p>NO.{{ index + 1 }}</p> |
|||
</div> |
|||
</div> |
|||
</vue-seamless-scroll> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { FetchBorrowRank, FetchCoverByISBN } from '@/api/library' |
|||
|
|||
export default { |
|||
name: 'LengingRanking', |
|||
data() { |
|||
return { |
|||
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', |
|||
rankingList: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
defaultOption() { |
|||
return { |
|||
step: 1.1, // 滚动的速度 |
|||
hoverStop: false, // 是否开启鼠标悬停stop |
|||
singleHeight: 102, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1 |
|||
openWatch: true, |
|||
waitTime: 2000 // 单步运动停止的时间(默认值1000ms) |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getBorrowRank() |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
getBorrowRank() { |
|||
FetchBorrowRank().then((res) => { |
|||
if (res.errCode === 0) { |
|||
this.rankingList = res.data |
|||
this.rankingList.forEach(item => { |
|||
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|||
}) |
|||
} else { |
|||
this.$message.error('接口错误') |
|||
} |
|||
}) |
|||
}, |
|||
getCoverByISBN(isbn, item) { |
|||
const params = { |
|||
isbn: isbn |
|||
} |
|||
FetchCoverByISBN(params).then((res) => { |
|||
item.cover = window.URL.createObjectURL(res) |
|||
this.$refs.listData.reset() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
@import '~@/assets/styles/index.scss'; |
|||
</style> |
|||
<template> |
|||
<!-- 借阅排行榜 --> |
|||
<div class="screen-item lending-ranking"> |
|||
<div class="common-title">借阅排行榜</div> |
|||
<vue-seamless-scroll |
|||
ref="listData" |
|||
:data="rankingList" |
|||
:class-option="defaultOption" |
|||
class="big-module module-content" |
|||
> |
|||
<div |
|||
v-for="(item, index) in rankingList" |
|||
:key="index" |
|||
class="book-list-item" |
|||
> |
|||
<div class="book-img"> |
|||
<img :src="item.cover" :onerror="defaultImg"> |
|||
</div> |
|||
<div class="book-info"> |
|||
<h4 class="title-item">{{ item.bookName }}</h4> |
|||
<p>{{ item.author }}</p> |
|||
</div> |
|||
<div class="ranking-num"> |
|||
<svg v-if="index === 0" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no1" /> |
|||
</svg> |
|||
<svg v-if="index === 1" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no21" /> |
|||
</svg> |
|||
<svg v-if="index === 2" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no3" /> |
|||
</svg> |
|||
<p>NO.{{ index + 1 }}</p> |
|||
</div> |
|||
</div> |
|||
</vue-seamless-scroll> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { FetchBorrowRank, FetchCoverByISBN } from '@/api/library' |
|||
|
|||
export default { |
|||
name: 'LengingRanking', |
|||
data() { |
|||
return { |
|||
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', |
|||
rankingList: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
defaultOption() { |
|||
return { |
|||
step: 1.1, // 滚动的速度 |
|||
hoverStop: false, // 是否开启鼠标悬停stop |
|||
singleHeight: 102, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1 |
|||
openWatch: true, |
|||
waitTime: 2000 // 单步运动停止的时间(默认值1000ms) |
|||
} |
|||
} |
|||
}, |
|||
created() { |
|||
this.getBorrowRank() |
|||
}, |
|||
mounted() { |
|||
}, |
|||
methods: { |
|||
getBorrowRank() { |
|||
FetchBorrowRank().then((res) => { |
|||
if (res.errCode === 0) { |
|||
this.rankingList = res.data |
|||
this.rankingList.forEach(item => { |
|||
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|||
}) |
|||
} else { |
|||
this.$message.error('接口错误') |
|||
} |
|||
}) |
|||
}, |
|||
getCoverByISBN(isbn, item) { |
|||
const params = { |
|||
isbn: isbn |
|||
} |
|||
FetchCoverByISBN(params).then((res) => { |
|||
console.log('RES', res) |
|||
if (res) { |
|||
// item.cover = window.URL.createObjectURL(res) |
|||
item.cover = res |
|||
} else { |
|||
item.cover = '' |
|||
} |
|||
console.log(item.cover) |
|||
this.$refs.listData.reset() |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
@import '~@/assets/styles/index.scss'; |
|||
</style> |
@ -1,121 +1,127 @@ |
|||
<template> |
|||
<!-- 新书推荐 --> |
|||
<div class="screen-item lending-ranking"> |
|||
<div class="common-title">新书推荐</div> |
|||
<div ref="newbook" class="big-module module-content"> |
|||
<swiper ref="swiperThumbs" class="swiper gallery-thumbs directive" :options="swiperOptionThumbs"> |
|||
<swiper-slide v-for="(item,index) in rankingList" :key="index" class="slide-1"> |
|||
<div class="book-list-item"> |
|||
<div class="book-img"> |
|||
<img :src="item.cover" :onerror="defaultImg"> |
|||
</div> |
|||
<div class="book-info"> |
|||
<h4 class="title-item">{{ item.nbName }}</h4> |
|||
<p>{{ item.nbAuthor }}</p> |
|||
</div> |
|||
<div class="ranking-num"> |
|||
<svg v-if="index === 0" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no1" /> |
|||
</svg> |
|||
<svg v-if="index === 1" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no21" /> |
|||
</svg> |
|||
<svg v-if="index === 2" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no3" /> |
|||
</svg> |
|||
<p>NO.{{ index+1 }}</p> |
|||
</div> |
|||
</div> |
|||
</swiper-slide> |
|||
</swiper> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/library' |
|||
import { swiper, swiperSlide } from 'vue-awesome-swiper' |
|||
import 'swiper/dist/css/swiper.css' |
|||
|
|||
export default { |
|||
name: 'NewBookRecommend', |
|||
components: { |
|||
swiper, |
|||
swiperSlide |
|||
}, |
|||
data() { |
|||
return { |
|||
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', |
|||
rankingList: [], |
|||
swiperOptionThumbs: { |
|||
direction: 'vertical', |
|||
autoplay: true, |
|||
loop: true, |
|||
slidesPerView: 'auto', |
|||
centeredSlides: true, |
|||
touchRatio: 0.2, |
|||
autoScrollOffset: true |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
swiper() { |
|||
return this.$refs.swiperThumbs.swiper |
|||
} |
|||
}, |
|||
created() { |
|||
}, |
|||
mounted() { |
|||
this.getNewBookRecommend() |
|||
}, |
|||
methods: { |
|||
getNewBookRecommend() { |
|||
const params = { |
|||
libcode: this.libcode, |
|||
pageNo: 1, |
|||
pageSize: 20 |
|||
} |
|||
FetchNewBookRecommend(params).then(res => { |
|||
if (res.errCode === 0) { |
|||
let data = [] |
|||
data = res.data.newbookList |
|||
data.forEach(item => { |
|||
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|||
}) |
|||
} else { |
|||
this.$message.error('接口错误') |
|||
} |
|||
}) |
|||
}, |
|||
getCoverByISBN(isbn, item) { |
|||
const params = { |
|||
isbn: isbn |
|||
} |
|||
FetchCoverByISBN(params).then((res) => { |
|||
console.log(res) |
|||
item.cover = window.URL.createObjectURL(res) |
|||
this.rankingList.push(item) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
@import "~@/assets/styles/index.scss"; |
|||
.swiper-container{ |
|||
overflow: initial; |
|||
} |
|||
.swiper { |
|||
&.gallery-thumbs { |
|||
height: 1.275rem; |
|||
} |
|||
&.gallery-thumbs .swiper-slide { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
&.gallery-thumbs .swiper-slide-active { |
|||
background-color: #09194B; |
|||
} |
|||
} |
|||
</style> |
|||
<template> |
|||
<!-- 新书推荐 --> |
|||
<div class="screen-item lending-ranking"> |
|||
<div class="common-title">新书推荐</div> |
|||
<div ref="newbook" class="big-module module-content"> |
|||
<swiper ref="swiperThumbs" class="swiper gallery-thumbs directive" :options="swiperOptionThumbs"> |
|||
<swiper-slide v-for="(item,index) in rankingList" :key="index" class="slide-1"> |
|||
<div class="book-list-item"> |
|||
<div class="book-img"> |
|||
<img :src="item.cover" :onerror="defaultImg"> |
|||
</div> |
|||
<div class="book-info"> |
|||
<h4 class="title-item">{{ item.nbName }}</h4> |
|||
<p>{{ item.nbAuthor }}</p> |
|||
</div> |
|||
<div class="ranking-num"> |
|||
<svg v-if="index === 0" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no1" /> |
|||
</svg> |
|||
<svg v-if="index === 1" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no21" /> |
|||
</svg> |
|||
<svg v-if="index === 2" class="icon" aria-hidden="true"> |
|||
<use xlink:href="#icon-a-no3" /> |
|||
</svg> |
|||
<p>NO.{{ index+1 }}</p> |
|||
</div> |
|||
</div> |
|||
</swiper-slide> |
|||
</swiper> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { FetchNewBookRecommend, FetchCoverByISBN } from '@/api/library' |
|||
import { swiper, swiperSlide } from 'vue-awesome-swiper' |
|||
import 'swiper/dist/css/swiper.css' |
|||
|
|||
export default { |
|||
name: 'NewBookRecommend', |
|||
components: { |
|||
swiper, |
|||
swiperSlide |
|||
}, |
|||
data() { |
|||
return { |
|||
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"', |
|||
rankingList: [], |
|||
swiperOptionThumbs: { |
|||
direction: 'vertical', |
|||
autoplay: true, |
|||
loop: true, |
|||
slidesPerView: 'auto', |
|||
centeredSlides: true, |
|||
touchRatio: 0.2, |
|||
autoScrollOffset: true |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
swiper() { |
|||
return this.$refs.swiperThumbs.swiper |
|||
} |
|||
}, |
|||
created() { |
|||
}, |
|||
mounted() { |
|||
this.getNewBookRecommend() |
|||
}, |
|||
methods: { |
|||
getNewBookRecommend() { |
|||
const params = { |
|||
libcode: this.libcode, |
|||
pageNo: 1, |
|||
pageSize: 20 |
|||
} |
|||
FetchNewBookRecommend(params).then(res => { |
|||
if (res.errCode === 0) { |
|||
let data = [] |
|||
data = res.data.newbookList |
|||
data.forEach(item => { |
|||
this.getCoverByISBN(item.isbn.replace(/\-/g, ''), item) |
|||
}) |
|||
} else { |
|||
this.$message.error('接口错误') |
|||
} |
|||
}) |
|||
}, |
|||
getCoverByISBN(isbn, item) { |
|||
const params = { |
|||
isbn: isbn |
|||
} |
|||
FetchCoverByISBN(params).then((res) => { |
|||
console.log(res) |
|||
// item.cover = window.URL.createObjectURL(res) |
|||
if (res) { |
|||
// item.cover = window.URL.createObjectURL(res) |
|||
item.cover = res |
|||
} else { |
|||
item.cover = '' |
|||
} |
|||
this.rankingList.push(item) |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style lang="scss"> |
|||
@import "~@/assets/styles/index.scss"; |
|||
.swiper-container{ |
|||
overflow: initial; |
|||
} |
|||
.swiper { |
|||
&.gallery-thumbs { |
|||
height: 1.275rem; |
|||
} |
|||
&.gallery-thumbs .swiper-slide { |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
&.gallery-thumbs .swiper-slide-active { |
|||
background-color: #09194B; |
|||
} |
|||
} |
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue