Browse Source

0830

master
xuhuajiao 2 years ago
parent
commit
42bf844647
  1. 34
      .env.development
  2. 190
      src/api/library.js
  3. 3
      src/views/accessToLibrary/index.vue
  4. 197
      src/views/lengingRanking/index.vue
  5. 248
      src/views/newBookRecommend/index.vue
  6. 4
      src/views/video/index.vue

34
.env.development

@ -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

190
src/api/library.js

@ -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
}

3
src/views/accessToLibrary/index.vue

@ -65,7 +65,8 @@ export default {
methods: { methods: {
getInitIntoNum() { getInitIntoNum() {
this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1] this.otherDoorOther = window.location.href.split('?')[1]?.split('=')[1]
if (this.otherDoorOther !== '' && this.otherDoorOther.indexOf('&')) {
console.log(this.otherDoorOther)
if (this.otherDoorOther && this.otherDoorOther !== '' && this.otherDoorOther.indexOf('&')) {
this.otherDoorOther = this.otherDoorOther.replace(/\&/g, '、') this.otherDoorOther = this.otherDoorOther.replace(/\&/g, '、')
} else { } else {
this.otherDoorOther = null this.otherDoorOther = null

197
src/views/lengingRanking/index.vue

@ -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>

248
src/views/newBookRecommend/index.vue

@ -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>

4
src/views/video/index.vue

@ -3,7 +3,7 @@
<video v-if="srcList[0].endsWith('.mp4')" width="100%" height="100%" controls loop autoplay muted :poster="poster"> <video v-if="srcList[0].endsWith('.mp4')" width="100%" height="100%" controls loop autoplay muted :poster="poster">
<source :src="srcList[0]" type="video/mp4"> <source :src="srcList[0]" type="video/mp4">
</video> </video>
<el-carousel v-if="!srcList[0].endsWith('.mp4')" interval="6000">
<el-carousel v-if="!srcList[0].endsWith('.mp4')" :interval="6000">
<el-carousel-item v-for="src in srcList" :key="src"> <el-carousel-item v-for="src in srcList" :key="src">
<img width="100%" height="100%" :src="src"> <img width="100%" height="100%" :src="src">
</el-carousel-item> </el-carousel-item>
@ -38,7 +38,7 @@ export default {
FetchShowFileList(params).then(res => { FetchShowFileList(params).then(res => {
if (res.errCode === 0) { if (res.errCode === 0) {
// this.src = res.data[0].filePath.replace('D://', 'http://172.16.0.23:8888/') // this.src = res.data[0].filePath.replace('D://', 'http://172.16.0.23:8888/')
this.srcList = res.data.map(x => x.filePath.replace('D://', 'http://172.16.0.23:8888/'))
this.srcList = res.data.map(x => x.filePath.replace('D://', 'http://172.22.0.23:8888/'))
// this.srcList = res.data.map(x => x.filePath.replace('D://uploadFile', 'http://localhost:8080/static/')) // this.srcList = res.data.map(x => x.filePath.replace('D://uploadFile', 'http://localhost:8080/static/'))
// console.log(22222, this.srcList) // console.log(22222, this.srcList)
// this.src = 'D://uploadFile/11503339-b829-4357-8379-d2b49106431f.mp4'.replace('D://', 'http://127.0.0.1:8888/') // this.src = 'D://uploadFile/11503339-b829-4357-8379-d2b49106431f.mp4'.replace('D://', 'http://127.0.0.1:8888/')

Loading…
Cancel
Save