Browse Source

0618页面制作

master
xuhuajiao 8 months ago
parent
commit
81fac0c94b
  1. BIN
      src/assets/images/1_03.png
  2. BIN
      src/assets/images/2_03.png
  3. BIN
      src/assets/images/book_03.png
  4. BIN
      src/assets/images/database-img1.png
  5. BIN
      src/assets/images/database-img2.png
  6. BIN
      src/assets/images/mapBg.png
  7. BIN
      src/assets/images/map_03.png
  8. BIN
      src/assets/images/map_10.png
  9. BIN
      src/assets/images/map_14.png
  10. BIN
      src/assets/images/map_18.png
  11. BIN
      src/assets/images/map_20.png
  12. BIN
      src/assets/images/map_28.png
  13. BIN
      src/assets/images/map_30.png
  14. BIN
      src/assets/images/ranking01.png
  15. BIN
      src/assets/images/ranking02.png
  16. BIN
      src/assets/images/ranking03.png
  17. BIN
      src/assets/images/title-big.png
  18. BIN
      src/assets/images/wechat-img1.png
  19. BIN
      src/assets/images/wechat-img2.png
  20. 27
      src/assets/styles/font-some.css
  21. 116
      src/assets/styles/index.scss
  22. 4
      src/main.js
  23. 54
      src/views/index.vue
  24. 22
      src/views/map/index.vue
  25. 169
      src/views/pageOne/index.vue

BIN
src/assets/images/1_03.png

After

Width: 905  |  Height: 723  |  Size: 97 KiB

BIN
src/assets/images/2_03.png

After

Width: 1306  |  Height: 1037  |  Size: 133 KiB

BIN
src/assets/images/book_03.png

After

Width: 112  |  Height: 160  |  Size: 40 KiB

BIN
src/assets/images/database-img1.png

After

Width: 503  |  Height: 512  |  Size: 408 KiB

BIN
src/assets/images/database-img2.png

After

Width: 158  |  Height: 140  |  Size: 19 KiB

BIN
src/assets/images/mapBg.png

After

Width: 1920  |  Height: 1080  |  Size: 2.3 MiB

BIN
src/assets/images/map_03.png

After

Width: 152  |  Height: 122  |  Size: 21 KiB

BIN
src/assets/images/map_10.png

After

Width: 61  |  Height: 43  |  Size: 6.8 KiB

BIN
src/assets/images/map_14.png

After

Width: 196  |  Height: 2  |  Size: 1.0 KiB

BIN
src/assets/images/map_18.png

After

Width: 58  |  Height: 52  |  Size: 3.4 KiB

BIN
src/assets/images/map_20.png

After

Width: 58  |  Height: 52  |  Size: 2.6 KiB

BIN
src/assets/images/map_28.png

After

Width: 58  |  Height: 52  |  Size: 2.5 KiB

BIN
src/assets/images/map_30.png

After

Width: 62  |  Height: 40  |  Size: 3.3 KiB

BIN
src/assets/images/ranking01.png

After

Width: 18  |  Height: 25  |  Size: 2.3 KiB

BIN
src/assets/images/ranking02.png

After

Width: 18  |  Height: 25  |  Size: 2.4 KiB

BIN
src/assets/images/ranking03.png

After

Width: 18  |  Height: 25  |  Size: 2.4 KiB

BIN
src/assets/images/title-big.png

Before

Width: 1173  |  Height: 48  |  Size: 15 KiB

After

Width: 1160  |  Height: 48  |  Size: 20 KiB

BIN
src/assets/images/wechat-img1.png

After

Width: 322  |  Height: 432  |  Size: 76 KiB

BIN
src/assets/images/wechat-img2.png

After

Width: 152  |  Height: 153  |  Size: 738 B

27
src/assets/styles/font-some.css

@ -1,12 +1,11 @@
.chartNum{
display: flex;
justify-content: center;
margin-top: 0.25rem;
}
.box-items {
position: relative;
display: flex;
height: 0.6rem;
height: .5rem;
text-align: center;
}
/*滚动数字设置*/
@ -14,11 +13,9 @@
display: flex;
justify-content: center;
text-align: center;
width: 0.45rem;
height: 0.6rem;
line-height: 0.6rem;
margin-right: 0.125rem;
border: 1px solid #2C75E0;
width: .225rem;
height: .5rem;
line-height: .4rem;
}
.number-item span{
position: relative;
@ -32,14 +29,18 @@
.number-item span i{
font-style: normal;
position: absolute;
top: 0.1rem;
top: 0;
left: 50%;
font-size: 0.325rem;
font-size: 0.375rem;
font-weight: bold;
color: #1AC9FF;
transform: translate(-50%,0);
transition: transform 1s ease-in-out;
letter-spacing: 10px;
z-index: 99999;
color: #fff;
background: -webkit-linear-gradient(90deg, rgba(14,197,236,1) 20%,rgba(239,252,254,1) 70%);
background: linear-gradient(90deg, rgba(14,197,236,1) 20%,rgba(239,252,254,1) 70%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
text-shadow: 0 2px 8px rgba(5,28,55,0.42);
}
.number-item:last-child {
margin-right: 0;

116
src/assets/styles/index.scss

@ -9,6 +9,13 @@
background: url('~@/assets/images/bg.png') no-repeat top center #02061a;
background-size: cover;
}
.map-wrapper{
width: 100%;
height: 100vh;
background: url('~@/assets/images/mapBg.png') no-repeat top left; position: absolute;
left:0; top: 0;
background-size: cover; display: flex; justify-content: space-around; padding-top: 1.25rem;
}
.loading {
position: fixed;
@ -29,6 +36,7 @@
height: 1.25rem;
font-size: .375rem;
color: #fff;
z-index: 9999;
// &::before,
// &::after{
// content: "";
@ -157,22 +165,76 @@
.pageOne-database {
display: flex;
justify-content: space-between;
margin-bottom: .575rem;
height: 6.25rem;
margin-top: .1875rem;
.database-left,
.database-right {
width: 5.7875rem;
height: 5.25rem;
background-color: #041231;
overflow: hidden;
height: 5.625rem;
background-color: #041232;
}
.database-middle {
position: relative;
margin-top: -0.25rem;
flex: 1;
display: flex;
justify-content: center;
align-items: center;
& img{
display: block;
}
.middle-item{
position: absolute;
width: 1.975rem;
height: 1.75rem;
display: flex;
justify-content: flex-start;
flex-direction: column;
align-items: center;
background: url('~@/assets/images/database-img2.png') no-repeat top left;
background-size: cover;
p{
margin-top: .3rem;
font-size: .275rem;
font-weight: 600;
font-style: italic;
color: #44C1EF;
text-shadow: 0 0 10px rgba(73,223,255,.1), 0 0 10px rgba(73,223,255,.1), 0 0 10px rgba(73,223,255,.1), 0 0 10px rgba(73,223,255,.1);
background: linear-gradient(0deg, #50CEF2 0%, #54D2F3 100%);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: .025rem;
}
&.totalBook{
top: .85rem;
left: .4125rem;
}
&.fansNum{
top: 3.575rem;
left: 1.3rem;
}
&.lendingNum{
top: 3.575rem;
right: 1.6375rem
}
&.cardNum{
top: .85rem;
right: .55rem;
}
}
}
}
.small-module{
height: .4rem;
overflow: hidden;
}
.database-title {
height: .6rem;
padding-left: .4rem;
margin-top: -0.25rem;
font-size: .25rem;
line-height: .5625rem;
color: #f6f9fe;
@ -283,7 +345,7 @@
width: 2.2rem;
font-size: .175rem;
padding-left: .2875rem;
margin-top: .625rem;
margin-top: .7rem;
p{
position: relative;
&::before{
@ -355,6 +417,50 @@
}
// pageOne 底部图书
.pageOne-book{
background-color: #031437;
border: 1px solid #031A47;
margin-top: -0.1875rem;
.database-title{
width: 14.5rem;
height: .6rem;
background: url('~@/assets/images/title-big.png') no-repeat left top;
background-size: cover;
}
.pageOne-book-content{
display: flex;
justify-content: flex-start;
align-items: center;
padding-top: .125rem;
.wechat-code{
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
width: 4.025rem;
height: 5.25rem;
background: url('~@/assets/images/wechat-img1.png') no-repeat left top;
background-size: cover;
margin-top: -0.5rem;
.wechat-img{
width: 1.9rem;
height: 1.9rem;
background: url('~@/assets/images/wechat-img2.png') no-repeat left top;
background-size: cover;
margin: 0 auto .3rem auto;
text-align: center;
line-height: 1.9rem;
}
span{
display: block;
font-size: .2rem;
color: #4DDBFF;
text-align: center;
}
}
}
}
// .number-scroll {

4
src/main.js

@ -44,11 +44,9 @@ import {
decoration3,
decoration5,
decoration10,
activeRingChart,
capsuleChart
activeRingChart
} from '@jiaminghi/data-view'
Vue.use(capsuleChart)
Vue.use(loading)
Vue.use(borderBox8)
Vue.use(decoration3)

54
src/views/index.vue

@ -4,7 +4,7 @@
<dv-loading>Loading...</dv-loading>
</div>
<Header :header-title="headerTitle" />
<div style="position: fixed; right: .175rem; top:.175rem; font-size:.175rem; background: rgba(82,146,255,0.2);border: 1px solid #5292FF; padding: 0 .075rem; line-height: .3125rem;">{{ active +' / '+ pageData.length }}</div>
<div style="position: fixed; right: .175rem; top:.175rem; font-size:.175rem; background: rgba(82,146,255,0.2);border: 1px solid #5292FF; padding: 0 .075rem; line-height: .3125rem; z-index: 999;">{{ active +' / '+ pageData.length }}</div>
<section ref="sectionRef">
<keep-alive>
<PageOne
@ -39,7 +39,7 @@ export default {
},
data() {
return {
active: 1,
active: 2,
isLoading: false,
fullscreen: false,
height: '',
@ -126,6 +126,7 @@ export default {
},
//
setNumberTransform(item) {
console.log(`.${item.id} i`)
const numberItems = document.querySelectorAll(`.${item.id} i`)
// const numberItems = this.$refs[`${item.id}`]
const numberArr = item.valueArr.filter(item => !isNaN(item))
@ -140,6 +141,7 @@ export default {
})
}, 15)
},
//
initInterval(targetList, time) {
const { setNumberTransform } = this
@ -154,24 +156,52 @@ export default {
},
//
timedRefresh(targetList, type) {
let cityTimer
let userTimer
let leftTimer
let middleTimer
let deviceTimer
if (type === 'city') {
cityTimer = this.initInterval(targetList, 8000)
} else if (type === 'user') {
userTimer = this.initInterval(targetList, 10000)
if (type === 'middle') {
middleTimer = this.initInterval2(targetList, 8000)
} else if (type === 'left') {
leftTimer = this.initInterval(targetList, 10000)
} else if (type === 'device') {
deviceTimer = this.initInterval(targetList, 8000)
}
this.$once('hook:beforeDestroy', () => {
clearInterval(cityTimer)
clearInterval(userTimer)
clearInterval(leftTimer)
clearInterval(middleTimer)
clearInterval(deviceTimer)
userTimer = null
cityTimer = null
middleTimer = null
leftTimer = null
deviceTimer = null
})
},
setNumberTransform2(item) {
var numberItems = document.querySelectorAll(`.${item.id} i`)
const numberArr = item.valueArr.filter(item => !isNaN(item))
for (var index = 0; index < numberItems.length; index++) {
const elem = numberItems[index]
elem.style.transition = 'transform 0s ease-in-out'
elem.style.transform = `translate(-50%,-0%)`
}
setTimeout(() => {
for (var index = 0; index < numberItems.length; index++) {
const elem = numberItems[index]
elem.style.transition = 'transform 1s ease-in-out'
elem.style.transform = 'translate(-50%, -' + numberArr[index] * 10 + '%)'
}
}, 15)
},
//
initInterval2(targetList, time) {
const { setNumberTransform2 } = this
return setInterval((function fn() {
targetList.forEach(t => {
setTimeout(() => {
setNumberTransform2(t)
}, 50)
})
return fn
})(), time)
}
}
}

22
src/views/map/index.vue

@ -1,7 +1,5 @@
<template>
<div style="display: flex; justify-content: space-around; height: calc(100vh - 1.125rem); padding: 20px;">
<!-- <svg-icon icon-class="map" style="width: 100%; height: 100%; " /> -->
<div class="map-wrapper">
<div class="lib-info">
<div class="lib-title">{{ libCurrent && libCurrent.name }}</div>
图片切换{{ currentIndex+1 }}
@ -310,7 +308,7 @@ export default {
{
map: 'qiyang',
aspectScale: 1,
zoom: 1.2,
zoom: 1.1,
top: '8%', //* ********************
left: '11%',
roam: false,
@ -318,8 +316,8 @@ export default {
itemStyle: {
areaColor: 'rgba(17,57,118,1)', //* *******
borderColor: '#9ffcff',
borderWidth: 1,
shadowColor: '#0f4c74',
borderWidth: 4,
shadowColor: '#4cd4eb',
shadowOffsetX: 0,
shadowOffsetY: 4,
shadowBlur: 10,
@ -344,13 +342,13 @@ export default {
{
map: 'qiyang',
aspectScale: 1,
zoom: 1.2,
zoom: 1.1,
top: '9%', //
left: '11%',
left: '9%',
roam: false,
z: 4, //
itemStyle: {
areaColor: 'rgba(7,107,151,1)', //
areaColor: '#05498f', //
borderColor: '#195175',
borderWidth: 2,
shadowColor: '#0f4c74',
@ -368,7 +366,7 @@ export default {
{
map: 'qiyang',
aspectScale: 1,
zoom: 1.2,
zoom: 1.1,
top: '10%', //
left: '11%',
roam: false,
@ -392,7 +390,7 @@ export default {
{
map: 'qiyang',
aspectScale: 1,
zoom: 1.2,
zoom: 1.1,
top: '11%', //
left: '11%',
roam: false,
@ -416,7 +414,7 @@ export default {
{
map: 'qiyang',
aspectScale: 1,
zoom: 1.2,
zoom: 1.1,
top: '12%', //
left: '11%',
roam: false,

169
src/views/pageOne/index.vue

@ -1,11 +1,12 @@
<template>
<div style="padding: 0 .4rem;">
<div class="pageOne-database">
<!-- 到馆统计 -->
<div class="database-left">
<h3 class="database-title">到馆统计</h3>
<ul class="inLib-num">
<li
v-for="(item, index) in userData"
v-for="(item, index) in leftData"
:key="index"
:class="[{'allTotal': item.id === 'allTotal'}, {'currentNum': item.id === 'currentNum'}]"
>
@ -21,7 +22,6 @@
<div class="flop-item-name">{{ item.name }}</div>
</li>
</ul>
<!-- <dv-capsule-chart :config="config" style="width:300px;height:200px" /> -->
<ul class="pageOne-left-progress">
<li v-for="(item,index) in progressdata" :key="index" :class="[{'blue-progress':item.type===1 || item.type === 2},{'orange-progress':item.type===3 || item.type === 4}]">
<p>{{ item.name }}</p>
@ -30,29 +30,46 @@
</li>
</ul>
</div>
<div class="database-middle">中间大数据</div>
<!-- 中间大数据 -->
<div class="database-middle">
<img src="~@/assets/images/database-img1.png" alt="">
<div v-for="(item,index) in middleData" :key="index" :class="['middle-item', {'totalBook': item.id === 'totalBook'}, {'fansNum': item.id === 'fansNum'}, {'lendingNum': item.id === 'lendingNum'}, {'cardNum': item.id === 'cardNum'}]">
<p>{{ item.name }}</p>
<div class="small-module">
<div class="chartNum">
<div class="box-items">
<li v-for="(e,i) in item.valueArr" :key="i" class="number-item">
<span><i ref="numberItem" class="item">0123456789</i></span>
</li>
</div>
</div>
</div>
</div>
</div>
<!-- 热门搜索 -->
<div class="database-right">
<h3 class="database-title">热门搜索</h3>
<div id="tagcloud1" class="tagcloud">
<p v-for="(item,index) in hotTagData" :key="index" class="color1">
<p v-for="(item,index) in hotTagData" :key="index" :class="'color' + ((index % 4) + 1)">
<span>{{ item }}</span>
</p>
</div>
</div>
</div>
<!-- 底部 图书推荐 -->
<div class="pageOne-book">
<h3 class="database-title">图书推荐</h3>
<div class="pageOne-book-content">
<div class="scrollBox">
<p>第一行书</p>
<vue-seamless-scroll
ref="listData"
:data="list"
:class-option="defaultOption"
style="height: 100px; overflow: hidden"
class="seamless01"
>
<ul>
<li v-for="(item, index) in list" :key="index">
<div class="bord">
{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
@ -60,17 +77,15 @@
</li>
</ul>
</vue-seamless-scroll>
<p>第二行书</p>
<vue-seamless-scroll
ref="listData2"
:data="list"
:class-option="default2Option"
style="height: 100px; overflow: hidden"
class="seamless02"
>
<ul>
<li v-for="(item, index) in list" :key="index">
<div class="bord">
{{ index }}
<div class="book-img">
<img :src="item.cover" :onerror="defaultImg">
</div>
@ -79,6 +94,13 @@
</ul>
</vue-seamless-scroll>
</div>
<div class="wechat-code">
<div class="wechat-img">
二维码
</div>
<span>微信扫一扫关注</span>
</div>
</div>
</div>
</div>
</template>
@ -91,8 +113,8 @@ export default {
data() {
return {
list: [],
defaultImg: 'this.src="' + require('@/assets/images/default-img.png') + '"',
userData: [],
defaultImg: 'this.src="' + require('@/assets/images/book_03.png') + '"',
leftData: [],
progressdata: [
{
name: '今日到馆',
@ -115,7 +137,9 @@ export default {
type: 4
}
],
hotTagData: ['呼啸山庄', '大卫·科波菲尔', '百年孤独', '孙子兵法', '傲慢与偏见', '钢铁是怎样炼成的', '世界上下五千年', '明朝那些事', '呼啸山庄', '大卫·科波菲尔', '百年孤独', '孙子兵法', '傲慢与偏见', '钢铁是怎样炼成的', '世界上下五千年', '明朝那些事']
hotTagData: ['呼啸山庄', '大卫·科波菲尔', '百年孤独', '孙子兵法', '傲慢与偏见', '钢铁是怎样炼成的', '世界上下五千年', '明朝那些事', '呼啸山庄', '大卫·科波菲尔', '百年孤独', '孙子兵法', '傲慢与偏见', '钢铁是怎样炼成的', '世界上下五千年', '明朝那些事'],
colors: ['color1', 'color2', 'color3', 'color4'], //
middleData: []
}
},
computed: {
@ -156,7 +180,6 @@ export default {
}
}
}
},
created() {
this.list = data
@ -168,6 +191,7 @@ export default {
//
setTimeout(() => {
this.initDataPreview()
this.ininMiddleData()
}, 700)
this.tagAnimation()
},
@ -191,11 +215,11 @@ export default {
tagAnimation() {
tagCloud({
selector: '#tagcloud1', // id class
fontsize: 24, // , 16px
radius: 360, // /, 60px60[60][60, 60]
fontsize: 22, // , 16px
radius: 340, // /, 60px60[60][60, 60]
mspeed: 'normal', // , : slow, normal(), fast
ispeed: 'normal', // , : slow, normal(), fast
direction: 135, // , (360): 0top, 90left, 135right-bottom()...
direction: 45, // , (360): 0top, 90left, 135right-bottom()...
keep: false, // , : false, true() ,
multicolour: false // true(),false
})
@ -213,8 +237,8 @@ export default {
}
if (previewData.code !== 0) return
this.allUserNumCount = previewData.data.allUserNumCount
this.userData = []
this.userData.push({
this.leftData = []
this.leftData.push({
id: 'allTotal',
name: '本年累计到馆',
value: this.$parent.formatter(previewData.data.allUserNumCount),
@ -225,12 +249,48 @@ export default {
value: this.$parent.formatter(previewData.data.allUserOpenNumCount),
valueArr: this.$parent.formatter(previewData.data.allUserOpenNumCount).split('')
})
console.log('userData', this.userData)
setTimeout(() => {
this.$parent.timedRefresh(this.userData, 'user')
this.$parent.timedRefresh(this.leftData, 'left')
}, 1000)
},
ininMiddleData() {
const previewData = {
'code': 0,
'data': {
'number1': 679363,
'number2': 5927,
'number3': 34798,
'number4': 30541
},
'message': 'success'
}
this.middleData = []
this.middleData.push({
id: 'totalBook',
name: '藏书总量',
value: previewData.data.number1,
valueArr: previewData.data.number1.toString().split('')
}, {
id: 'fansNum',
name: '粉丝数量',
value: previewData.data.number2,
valueArr: previewData.data.number2.toString().split('')
}, {
id: 'lendingNum',
name: '累计借出',
value: previewData.data.number3,
valueArr: previewData.data.number3.toString().split('')
}, {
id: 'cardNum',
name: '累计办证',
value: previewData.data.number4,
valueArr: previewData.data.number4.toString().split('')
})
setTimeout(() => {
this.$parent.timedRefresh(this.middleData, 'middle')
}, 1000)
}
}
}
@ -238,44 +298,80 @@ export default {
<style lang="scss">
@import "~@/assets/styles/index.scss";
@import "~@/assets/styles/font-some.css";
.tagcloud {
width: 5rem;
height: 5rem;
margin: 0 0 0 .45rem;
margin: 0 0 0 .325rem;
overflow: hidden;
p{
border-top: 2px dotted #1F6374;
border-left: 2px dotted #184D61;
border-right: 2px dotted #184D61;
border-bottom: 2px dotted RGBA(24, 77, 97, 0.3);
padding: .0625rem;
border-bottom: 2px dashed rgba(24, 77, 97, 0.5);
span{
display: block;
padding: .075rem 8px;
white-space: nowrap;
}
&.color1{
border-top: 2px dashed #1F6374;
border-left: 3px dashed #184D61;
border-right: 3px dashed #184D61;
span{
border: 1px solid #30ADA6;
background-color: #106B66;
color: #51EAE2;
z-index: 99;
}
}
&.color2{
border-top: 2px dashed #203F7F;
border-left: 3px dashed #102857;
border-right: 3px dashed #102857;
span{
border: 1px solid #3A64BE;
background: rgba(16,45,107,0.7);
color: #7EA7FF;
}
}
&.color3{
border-top: 2px dashed #613689;
border-left: 3px dashed #4C2E75;
border-right: 3px dashed #4C2E75;
span{
border: 1px solid #9439B6;
background: rgba(74,18,95,0.8);
color: #CD63F4;
}
}
&.color4{
border-top: 2px dashed #6A5735;
border-left: 3px dashed #655435;
border-right: 3px dashed #655435;
span{
border: 1px solid #C2943C;
background: rgba(107,76,16,0.7);
color: #F4C263;
}
}
}
}
.scrollBox{
width: 100%;
height: 96px;
flex: 1;
height: calc(100%);
box-sizing: border-box;
margin-left: 0.45rem;
overflow: hidden;
.seamless01{
margin-bottom: .35rem;
}
ul{
height: 96px;
display: flex;
height: 2rem;
overflow: hidden;
li{
width: 240px;
margin-right: 10px;
border: solid 2px #f7f7f9;
width: 1.375rem;
height: 2rem;
margin-right: .7375rem;
cursor: pointer;
.bord{
display: flex;
@ -283,9 +379,9 @@ export default {
justify-content: space-around;
align-items: center;
.book-img{
width: .5rem;
height: .5rem;
background: url('~@/assets/images/default-img.png') no-repeat center center;
width: 1.375rem;
height: 2rem;
background: url('~@/assets/images/book_03.png') no-repeat center center;
background-size: contain;
display: flex;
align-items: center;
@ -298,6 +394,7 @@ export default {
}
}
}
}
</style>
Loading…
Cancel
Save