diff --git a/src/api/library.js b/src/api/library.js index 224fb39..0726005 100644 --- a/src/api/library.js +++ b/src/api/library.js @@ -19,7 +19,45 @@ export function FetchBorrowRank(params) { }) } +// 阅读之星 +export function FetchBorrowStar(params) { + return request({ + url: '/txhtsg/borrowStar', + method: 'get', + params: params + }) +} + +// 新书推荐 +export function FetchNewBookRecommend(params) { + return request({ + url: '/txhtsg/newBookRecommend', + method: 'get', + params: params + }) +} + +// 通知公告 +export function FetchInitNotice(params) { + return request({ + url: '/txhtsg/initNotice', + method: 'get', + params: params + }) +} + +// 进馆人数 +export function FetchInitIntoNum(params) { + return request({ + url: '/txhtsg/initIntoNum', + method: 'get', + params: params + }) +} + export default { FetchHalfYearBorrowNum, - FetchBorrowRank + FetchBorrowRank, + FetchBorrowStar, + FetchNewBookRecommend } diff --git a/src/assets/images/default-img.png b/src/assets/images/default-img.png new file mode 100644 index 0000000..5b1fdd5 Binary files /dev/null and b/src/assets/images/default-img.png differ diff --git a/src/assets/styles/_variables.scss b/src/assets/styles/_variables.scss deleted file mode 100644 index 15c5eac..0000000 --- a/src/assets/styles/_variables.scss +++ /dev/null @@ -1,97 +0,0 @@ -// 颜色 -$colors: ( - "primary": #db9e3f, - "info-1": #4394e4, - "info": #4b67af, - "white": #ffffff, - "light": #f9f9f9, - "grey-1": #999999, - "grey": #666666, - "dark-1": #5f5f5f, - "dark": #222222, - "black-1": #171823, - "black": #000000, -); - -// 字体大小 -$base-font-size: 0.2rem; -$font-sizes: ( - xxs: 0.1, - //8px - xs: 0.125, - //10px - sm: 0.2875, - //12px - md: 0.1625, - //13px - lg: 0.175, - //14px - xl: 0.2, - //16px - xxl: 0.225, - //18px - xxxl: 0.25 -); - -// 宽高 -.w-100 { - width: 100%; -} -.h-100 { - height: 100%; -} - -//flex -.d-flex { - display: flex; -} -.flex-column { - flex-direction: column; -} -.flex-wrap { - flex-wrap: wrap; -} -.flex-nowrap { - flex-wrap: nowrap; -} -$flex-jc: ( - start: flex-start, - end: flex-end, - center: center, - between: space-between, - around: space-around, - evenly: space-evenly, -); - -$flex-ai: ( - start: flex-start, - end: flex-end, - center: center, - stretch: stretch, -); - -.flex-1 { - flex: 1; -} - -//.mt-1 => margin top -//spacing -$spacing-types: ( - m: margin, - p: padding, -); -$spacing-directions: ( - t: top, - r: right, - b: bottom, - l: left, -); -$spacing-base-size: 0.2rem; -$spacing-sizes: ( - 0: 0, - 1: 0.25, - 2: 0.5, - 3: 1, - 4: 1.5, - 5: 3, -); diff --git a/src/assets/styles/ball-running-animate.css b/src/assets/styles/ball-running-animate.css index 703374d..e87b926 100644 --- a/src/assets/styles/ball-running-animate.css +++ b/src/assets/styles/ball-running-animate.css @@ -26,8 +26,8 @@ border: 0 solid currentColor; } .ball-running-dots { - width: 12px; - height: 12px; + width: 16px; + height: 16px; } .ball-running-dots > div { position: absolute; @@ -56,7 +56,7 @@ 0%{ width: 100%; height: 100%; - transform: translateY(0) translateX(-500%) scale(50%,50%); + transform: translateY(0) translateX(-500%) scale(-.1); opacity: 0.5; } 80% { @@ -79,7 +79,7 @@ 100% { width: 100%; height: 100%; - transform: translateY(0) translateX(-500%) scale(50%,50%); + transform: translateY(0) translateX(-500%); opacity: 1; } } @@ -87,7 +87,7 @@ 0%{ width: 100%; height: 100%; - transform: translateY(0) translateX(500%) scale(50%,50%); + transform: translateY(0) translateX(500%) scale(-.1); opacity: 0.5; } 80% { diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index 36e7bef..357e1ab 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -166,10 +166,16 @@ align-items: center; padding: 0.1rem 0.25rem; .book-img{ - display: block; width: 0.825rem; height: 1.075rem; margin-right: 0.35rem; + background: url('~@/assets/images/default-img.png') no-repeat center center; + background-size: contain; + img{ + display: block; + width: 100%; + height: 100%; + } } .book-info{ flex: 1; @@ -298,18 +304,32 @@ .module-content{ display: flex; justify-content: space-between; + width: 100%; padding: 0.25rem 0.375rem 0.5rem 0.375rem; .notice-icon-gif{ display: block; - width: 3.375rem; + width: 2.375rem; height: 2.875rem; background: url('~@/assets/images/notice.gif') no-repeat left top; background-size: contain; margin-right: 0.15rem; } .seamless-warp{ + width: calc(100vw); height: 3.1rem; overflow: hidden; + .notice-txt { + animation: myMove 20s linear infinite; + animation-fill-mode: forwards; + } + @keyframes myMove { + 0% { + transform: translateY(2rem); + } + 100% { + transform: translateY(-6rem); + } + } } } } diff --git a/src/assets/styles/style.scss b/src/assets/styles/style.scss index a8c581c..68f4955 100644 --- a/src/assets/styles/style.scss +++ b/src/assets/styles/style.scss @@ -1,4 +1,3 @@ -@import "./variables"; @import '~@/assets/iconfont/iconfont.css'; // 全局样式 @@ -35,6 +34,13 @@ ul{ } } +img[src=""],img:not([src]){ + opacity: 0; + border:none; + visibility: hidden; + max-width: none; +} + .clearfix { &::after { content: ""; diff --git a/src/components/echart/lineChartService.vue b/src/components/echart/lineChartService.vue index 2ed52fa..b48fd39 100644 --- a/src/components/echart/lineChartService.vue +++ b/src/components/echart/lineChartService.vue @@ -9,13 +9,12 @@ export default { name: 'LineEcharts', mixins: [resize], props: { - className: { - type: String, - default: '' - }, chartData: { type: Object, - required: true + require: true, + default: function() { + return {} + } }, width: { type: String, @@ -34,8 +33,11 @@ export default { watch: { chartData: { deep: true, + mmediate: true, handler(val) { - this.setOptions(val) + setTimeout(() => { + this.setOptions(val) + }, 100) } } }, @@ -100,7 +102,6 @@ export default { } }, axisLabel: { - fontWeight: 'bold', color: '#fff' }, data: ['04:00', '08:00', '12:00', '16:00', '20:00', '24:00'] @@ -114,8 +115,7 @@ export default { interval: 250, axisLabel: { textStyle: { - color: '#fff', - fontWeight: 'bold' + color: '#fff' } }, // 轴线 diff --git a/src/utils/index.js b/src/utils/index.js index 3356ab6..114fe35 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -33,6 +33,52 @@ export function debounce(func, wait, immediate) { } } +/** + * Parse the time to string + * @param {(Object|string|number)} time + * @param {string} cFormat + * @returns {string} + */ +export function parseTime(time, cFormat) { + if (arguments.length === 0) { + return null + } + const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'undefined' || time === null || time === 'null') { + return '' + } else if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + // 获取当前日期时间 export function getCurrentTime() { const yy = new Date().getFullYear() diff --git a/src/views/accessToLibrary/index.vue b/src/views/accessToLibrary/index.vue index e9af46a..ed785c0 100644 --- a/src/views/accessToLibrary/index.vue +++ b/src/views/accessToLibrary/index.vue @@ -2,38 +2,56 @@
总进馆人数 - +
-
+
月进馆人数 - +
今日进馆人数 - + +
+
+ 今日出馆人数 +
diff --git a/src/views/data.json b/src/views/data.json deleted file mode 100644 index 54398c8..0000000 --- a/src/views/data.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "ranking":[ - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "大个子狗与小个子猫", - "author": "高小定", - "ranking": 1 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "森林大探险", - "author": "卷毛老师", - "ranking": 2 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "家有喵星人", - "author": "查尔斯", - "ranking": 3 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "奇妙的冒险", - "author": "李小飞", - "ranking": 4 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "豆豆龙成长记", - "author": "卷毛老师", - "ranking": 5 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "奇妙的冒险", - "author": "李小飞", - "ranking": 6 - }, - { - "img":"https://qiniu.aiyxlib.com/bg.png", - "title": "豆豆龙成长记", - "author": "卷毛老师", - "ranking": 7 - } - ], - "readstar":[ - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 1 - }, - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 2 - }, - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 3 - }, - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 4 - }, - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 5 - } - , - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 6 - }, - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 7 - } - , - { - "des": "读者张山上周借阅图书30册", - "date": "2022-09-06", - "ranking": 8 - } - ] -} \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index aaaf21e..660d261 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -7,7 +7,7 @@
- +