diff --git a/src/api/library.js b/src/api/library.js index 8781791..30ec0a7 100644 --- a/src/api/library.js +++ b/src/api/library.js @@ -91,6 +91,33 @@ export function FetchReadRanking(params) { }) } +// page4 获取通知 +export function FetchNoticeList(params) { + return request({ + url: '/qyzt/getNoticeList' + '?' + qs.stringify(params, { indices: false }), + method: 'get', + urlType: 'local' + }) +} + +// page4 文献排行榜 +export function FetchSync36(params) { + return request({ + url: '/qyzt/sync36' + '?' + qs.stringify(params, { indices: false }), + method: 'get', + urlType: 'local' + }) +} + +// page4 获取总馆资料 +export function FetchTotalResource(params) { + return request({ + url: '/qyzt/getTotalResource' + '?' + qs.stringify(params, { indices: false }), + method: 'get', + urlType: 'local' + }) +} + export default { FetchInitToken, FetchLibBookTotal, @@ -101,5 +128,8 @@ export default { FetchHotSearch, FetchNewBook, FetchReadRanking, - FetchLibcodeDetails + FetchLibcodeDetails, + FetchNoticeList, + FetchSync36, + FetchTotalResource } diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index aebb12d..0d39b27 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -1460,30 +1460,48 @@ margin-top: .125rem; overflow: hidden; .notice-text{ - position: absolute; - padding: .4125rem .375rem; + position: relative; + padding: 0 .375rem; + margin-bottom: .25rem; font-size: .225rem; color: #ADC7FF; line-height: .375rem; - // height: 1.625rem; - text-indent: 2em; font-weight: bold; - // animation: myMove 20s linear infinite; - // animation-fill-mode: forwards; - span{ - display: block; - text-align: right; + .notice-title{ + position: absolute; + left: 0; + top: 0; + z-index: 9999; + display: flex; + justify-content: space-between; + flex-wrap: nowrap; + width: calc(100%); + height: .5rem; + line-height: .5rem; + padding: 0 .375rem; color: #7D93C2; font-size: .2rem; + background-color: #011244; + span{ + display: block; + } } + p{ + color: #fff; + text-indent: 2em; + } + } + .scroll-animation { + animation: myMove 15s linear infinite; + animation-fill-mode: forwards; } @keyframes myMove { 0% { - transform: translateY(2rem); + transform: translateY(1rem); } 100% { - transform: translateY(-3rem); + transform: translateY(calc(-1 * var(--container-height))); } } } @@ -1534,6 +1552,7 @@ overflow: hidden; img{ display: block; + padding: .125rem; width: 100%; } } diff --git a/src/main.js b/src/main.js index d5c32e3..f564836 100644 --- a/src/main.js +++ b/src/main.js @@ -29,6 +29,13 @@ Vue.prototype.$message = Message // Vue.prototype.libcode = 'FTZN' Vue.prototype.libcode = '1201' +// 全局注册过滤 - 时间 +import { parseTime, getFormattedDate } from '@/utils/index.js' +Vue.filter('parseTime', function(time, cFormat) { + return parseTime(time, cFormat) +}) +Vue.prototype.getFormattedDate = getFormattedDate + import axios from 'axios' Vue.prototype.$axios = axios diff --git a/src/utils/index.js b/src/utils/index.js index 65f1862..d7ed7b6 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -91,6 +91,14 @@ export function getCurrentTime() { return time } +export function getFormattedDate(date, yearOffset = 0) { + date.setFullYear(date.getFullYear() + yearOffset) + const year = date.getFullYear() + const month = (date.getMonth() + 1).toString().padStart(2, '0') + const day = date.getDate().toString().padStart(2, '0') + return `${year}-${month}-${day}` +} + export function isExternal(path) { return /^(https?:|mailto:|tel:)/.test(path) } diff --git a/src/views/index.vue b/src/views/index.vue index c35ce93..60ccf1f 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -55,7 +55,7 @@ export default { }, data() { return { - currentIndex: 2, // 当前显示的页面索引 + currentIndex: 1, // 当前显示的页面索引 currentPage: null, // 当前显示的页面数据 isLoading: false, height: '', @@ -75,7 +75,8 @@ export default { todayTimer: null, yearTimer: null, intervalId: null, - orderIds: [] + orderIds: [], + wecharQrCodeSrc: null } }, computed: { @@ -100,7 +101,7 @@ export default { // meta.callback = (r) => { // console.log(r, '回调') // } - // this.getInitSetting() + this.getInitSetting() }, beforeDestroy() { clearInterval(this.timer2) @@ -145,9 +146,12 @@ export default { // selectorder 显示的屏和顺序 1第一屏 2第二屏 // show1 第一屏显示时间 // show2 第二屏显示时间 + const linkSrc = process.env.VUE_APP_BASE_API FetchInitSetting().then(res => { const result = JSON.parse(res.data) console.log(result) + this.wecharQrCodeSrc = linkSrc + '/downloadFile' + result.wecharQrCode + localStorage.setItem('wecharQrCodeSrc', this.wecharQrCodeSrc) const selectorder = result.selectorder const showDurations = { 1: result.show1, 2: result.show2, 3: result.show3, 4: result.show4 } diff --git a/src/views/map/index.vue b/src/views/map/index.vue index d9f0969..5cabeaa 100644 --- a/src/views/map/index.vue +++ b/src/views/map/index.vue @@ -51,7 +51,7 @@
读者统计
-

累计办证人数

+

本年累计办证人数

{{ cardTotal }}

@@ -84,7 +84,6 @@ import { FetchLibBookTotal, FetchLibcodeDetails, FetchReadRanking, FetchLendingTotal } from '@/api/library' import mapJson from '@/assets/json/qy.json' import libJson from '@/assets/json/lib2.json' -// import libJsonData from '@/assets/json/lib.json' import { debounce } from 'lodash' // js工具类,按需加载 import { swiper, swiperSlide } from 'vue-awesome-swiper' import 'swiper/dist/css/swiper.css' @@ -162,10 +161,11 @@ export default { }, getReadRanking() { const params = { - 'libcode': 'QYTSG', - 'starttime': '2000-01-01', - 'endtime': '2034-01-01', - 'rownum': 10 + 'libcode': 'QYTSG,SJLFG,FXLFG,SEDSG,BZHFG', + 'starttime': this.getFormattedDate(new Date(), -1), + 'endtime': this.getFormattedDate(new Date()), + 'rownum': 10, + 'nordtype': 0 } FetchReadRanking(params).then(res => { const result = JSON.parse(res.data) @@ -194,19 +194,19 @@ export default { } else if (item.RDNAME.length === 3) { // 截取第一个和第三个字符 item.RDNAME = item.RDNAME.substring(0, 1) + ' * ' + item.RDNAME.substring(2, 3) - } else if (item.name.length > 3) { + } else if (item.RDNAME.length > 3) { // 截取第一个和大于第4个字符 - item.RDNAME = item.RDNAME.substring(0, 1) + ' * ' + ' * ' + item.RDNAME.substring(3, item.name.length) + item.RDNAME = item.RDNAME.substring(0, 1) + ' * ' + ' * ' + item.RDNAME.substring(3, item.RDNAME.length) } const percentage = (item.TOTALNUM / firstPlaceNum) * 100 return { ...item, percentage } }) }, - // 累计借出 getLendingTotal() { FetchLendingTotal().then(res => { const result = JSON.parse(res.data) if (result.success & result.resultlist.length !== 0) { + // BZL_YEAR 本年办证人数 this.cardTotal = result.resultlist.filter(item => item.LIBCODE !== '999').reduce((acc, obj) => acc + obj.BZL_YEAR, 0) } else { this.cardTotal = 0 @@ -219,13 +219,13 @@ export default { getLibBookTotal() { const params = { 'libcode': 'LSJDFG,LJPFG,DCDFG,QYTSG,SJLFG,XMDFG,FXLFG,QLQFG,SEDSG,MZZFG,GYTZFG,KJSKCFG,JBTZFG,SKTZFG,XJZFG,PSZFG,DZQZFG,WXJDFG,CHJDFG,BSZFG,BZHFG', - 'starttime': '2000-01-01', - 'endtime': '2034-01-01' + 'starttime': this.getFormattedDate(new Date(), -1), + 'endtime': this.getFormattedDate(new Date()) } FetchLibBookTotal(params).then(res => { const result = JSON.parse(res.data) - console.log(result.resultlist) if (result.success & result.resultlist.length !== 0) { + // 目的拿到馆藏量 this.libALLNum = result.resultlist } else { this.libALLNum = [] @@ -242,7 +242,7 @@ export default { getLibcodeDetails() { FetchLibcodeDetails().then(res => { const result = JSON.parse(res.data) - + console.log('result', result) if (result.length !== 0) { const libCode = { 'QYTSG': [111.848657, 26.588519], @@ -267,7 +267,6 @@ export default { 'BSZFG': [111.989802, 26.421353], 'BZHFG': [111.862001, 26.580311] } - const updatedLibraries = result.map(library => { const matchingData = this.libALLNum.find(item => item.LIBCODE === library.tcId) if (matchingData) { @@ -288,7 +287,6 @@ export default { }).sort((a, b) => a.sort - b.sort) this.libInfoData = updatedLibraries - console.log(updatedLibraries) if (localStorage.getItem('countItem')) { @@ -296,14 +294,16 @@ export default { } else { this.count = 0 } - this.initChart() // 初始化 - setTimeout(() => { - this.updateChart() // 更新数据,散点轮播显示 - window.addEventListener('resize', debounce(this.resize, 2000)) // 使用事件捕获,由外层向内 - }, 300) + if (this.libInfoData.length !== 0) { + this.initChart() // 初始化 + setTimeout(() => { + this.updateChart() // 更新数据,散点轮播显示 + window.addEventListener('resize', debounce(this.resize, 2000)) // 使用事件捕获,由外层向内 + }, 300) - if (document.getElementsByClassName('scroll-container')[0]) { - this.startScrolling() + if (document.getElementsByClassName('scroll-container')[0]) { + this.startScrolling() + } } } else { this.libInfoData = [] @@ -319,7 +319,7 @@ export default { var mapImg = document.createElement('img') mapImg.style.height = mapImg.height = mapImg.width = mapImg.style.width = '1px' mapImg.src = require('../../assets/images/map-bg2.png') - + console.log('this.libInfoData', this.libInfoData) var XAData = this.libInfoData.map(item => { return [ { name: '陶铸图书馆' }, @@ -347,6 +347,7 @@ export default { [ ['陶铸图书馆', XAData] ].forEach(function(item, i) { + console.log('item', item[1]) series.push( { name: item[0], @@ -381,9 +382,10 @@ export default { show: true }, data: item[1].map(function(dataItem) { + console.log('dataItem', dataItem) return { name: dataItem[1].name, - value: libJson[dataItem[1].name].concat([dataItem[1].value]), + value: dataItem[1].name ? libJson[dataItem[1].name].concat([dataItem[1].value]) : '', place: dataItem[1].value } }) @@ -792,7 +794,6 @@ export default { } return item }) - console.log('displayedImages', this.displayedImages) this.currentIndex = 0 this.swiperKey += 1 if (this.displayedImages.length === 1) { diff --git a/src/views/pageFour/index.vue b/src/views/pageFour/index.vue index 4a3c7fd..317f8f8 100644 --- a/src/views/pageFour/index.vue +++ b/src/views/pageFour/index.vue @@ -2,7 +2,8 @@
-

{{ slideData[videoIndex].title }}

+ +

宣传视频

重要通知
- +
-
+ + +
+
+ {{ item.title }} {{ item.startTime | parseTime('{y}-{m}-{d}') }} +
+
+

+

+ +
@@ -56,25 +64,25 @@
  • 排名
  • -
  • 图书馆名称
  • -
  • -
  • 借阅数量
  • +
  • 题名
  • + +
  • 借阅数量
    -
  • +
  • {{ index>=3 ? index+1 : null }}
    -
    {{ item.name }}
    -
    +
    {{ item.TITLE }}
    + +
    {{ item.BOOKRECNO }}
- 二维码 +
扫一扫关注我们
@@ -84,97 +92,168 @@