Commit 5ac0a203 by wdc147

Merge remote-tracking branch 'origin/20210819' into wdc

parents ad5ef65f a726c4df
<template>
<div class="chartNum">
<div :class="isMin ? 'box-item-min' : 'box-item'">
<li v-for="(item,index) in orderNum"
:class="{'number-item': !isNaN(item), 'mark-item': isNaN(item) }" :key="index">
        <span v-if="!isNaN(item)">
         <i ref="numberItem">0123456789</i>
       </span>
       <span class="comma" v-else>{{item}}</span>
</li>
</div>
</div>
</template>
<script>
export default {
name: 'CountRoll',
props: {
count: Number,
isMin: {
type: Boolean,
default: false
}
},
data () {
return {
orderNum: []
}
},
mounted () {
this.toOrderNum(this.count)
this.increaseNumber()
},
deactivated () {
clearInterval(this.timer)
},
methods: {
// TODO: 定时器
increaseNumber () {
this.timer = setInterval(() => {
this.setNumberTransform()
}, 300)
},
// TODO:设置文字滚动
setNumberTransform () {
const numberItems = this.$refs.numberItem // 拿到数字的ref,计算元素数量
const numberArr = this.orderNum.filter(item => !isNaN(item))
// 结合CSS 对数字字符进行滚动
for (let index = 0; index < numberItems.length; index++) {
const elem = numberItems[index]
elem.style.transform = `translate(-50%, -${numberArr[index] * 10}%)`
}
clearInterval(this.timer)
},
// TODO: 处理数字
toOrderNum (num) {
num = this.utils.formatNumber(num, num.length)
this.orderNum = num // 将其便变成数据,渲染至滚动数组
}
}
}
</script>
<style scoped lang='less'>
.chartNum {
.box-item {
position: relative;
font-size: 36px;
line-height: 48px;
text-align: center;
list-style: none;
color: #FFFFFF;
writing-mode: vertical-lr;
text-orientation: upright;
/* 默认逗号设置 */
 .mark-item {
width: 20px;
height: 48px;
border: 1px solid #2B79BC;
margin-right: 5px;
line-height: 10px;
font-size: 36px;
position: relative;
& > span {
position: absolute;
width: 100%;
bottom: 4px;
left: -2px;
writing-mode: vertical-rl;
text-orientation: upright;
}
}
/*滚动数字设置*/
.number-item {
width: 30px;
height: 48px;
display: flex;
list-style: none;
margin-right: 5px;
border-radius: 4px;
border: 1px solid #2B79BC;
color: #FFFFFF;
& > span {
position: relative;
display: inline-block;
margin-right: 10px;
width: 100%;
height: 100%;
writing-mode: vertical-rl;
text-orientation: upright;
overflow: hidden;
& > i {
font-style: normal;
position: absolute;
top: 6px;
left: 50%;
transform: translate(-50%, 0);
transition: transform 1s ease-in-out;
letter-spacing: 10px;
color: #FFFFFF;
}
}
}
.number-item:last-child {
margin-right: 0;
}
.comma {
bottom: 4px;
}
}
.box-item-min {
position: relative;
font-size: 28px;
line-height: 36px;
text-align: center;
list-style: none;
color: #FFFFFF;
writing-mode: vertical-lr;
text-orientation: upright;
/* 默认逗号设置 */
 .mark-item {
width: 24px;
height: 36px;
border: 1px solid #2B79BC;
margin-right: 8px;
line-height: 10px;
font-size: 28px;
position: relative;
& > span {
position: absolute;
width: 100%;
bottom: 4px;
left: -2px;
writing-mode: vertical-rl;
text-orientation: upright;
}
}
/*滚动数字设置*/
.number-item {
width: 24px;
height: 36px;
display: flex;
list-style: none;
margin-right: 8px;
border-radius: 4px;
border: 1px solid #2B79BC;
color: #FFFFFF;
& > span {
position: relative;
display: inline-block;
margin-right: 10px;
width: 100%;
height: 100%;
writing-mode: vertical-rl;
text-orientation: upright;
overflow: hidden;
& > i {
font-style: normal;
position: absolute;
top: 2px;
left: 50%;
transform: translate(-50%, 0);
transition: transform 1s ease-in-out;
letter-spacing: 10px;
color: #FFFFFF;
}
}
}
.number-item:last-child {
margin-right: 0;
}
.comma {
bottom: 4px;
}
}
}
</style>
<template>
<CountTo
:startVal="startVal"
:endVal="endVal"
:duration="duration"
:decimals="decimals"
:separator="separator"
:suffix="suffix"
:prefix="prefix"
/>
</template>
<script>
import CountTo from 'vue-count-to'
export default {
name: 'VueCountTo', // TODO: 数字变动组件
components: { CountTo },
props: {
autoplay: { type: Boolean, default: true }, // 自动播放 默认为 True
startVal: { type: Number, default: 0 }, // 起始值
endVal: { type: Number, default: 0 }, // 结束值
duration: { type: Number, default: 800 }, // 持续时间,以毫秒为单位
decimals: { type: Number, default: 0 }, // 要显示的小数位数
separator: { type: String, default: ',' }, // 分隔符
prefix: { type: String, default: '' }, // 前缀
suffix: { type: String, default: '' } // 后缀
}
}
</script>
<style scoped>
span {
font-family: "Century Gothic";
}
</style>
...@@ -88,17 +88,13 @@ export default { ...@@ -88,17 +88,13 @@ export default {
top: 7px; top: 7px;
} }
} }
.content {
margin-top: 15px;
}
.close { .close {
width: 24px; width: 24px;
height: 24px; height: 24px;
background: url('../../static/images/index/bulletFrame-close.png') background: url('../../static/images/index/bulletFrame-close.png') no-repeat left top;
no-repeat left top;
position: absolute; position: absolute;
top: 36px; top: 20px;
right: 19px; right: 20px;
cursor: pointer; cursor: pointer;
} }
} }
......
...@@ -99,15 +99,19 @@ ...@@ -99,15 +99,19 @@
</vue-seamless-scroll> </vue-seamless-scroll>
</div> </div>
</div> </div>
<!-- 弹框 -->
<popup-frame :visible="visible" :layout="{width: '960px', height: '540px'}" @beforeClose="closePopup">
<img src="../../../static/images/index/studentDemeanor.jpg" alt="弹框">
</popup-frame>
</div> </div>
</template> </template>
<script> <script>
import TitleLine from '@/components/TitleLine' import TitleLine from 'components/TitleLine'
import BarChart from '@/components/echarts/BarChart.vue' import BarChart from 'components/echarts/BarChart.vue'
import PieChart from '@/components/echarts/PieChart.vue' import PieChart from 'components/echarts/PieChart.vue'
import LineChart from '@/components/echarts/LineChart.vue' import LineChart from 'components/echarts/LineChart.vue'
import Swiper from '@/components/Swiper' import Swiper from 'components/Swiper'
import { swiperSlide } from 'vue-awesome-swiper' import { swiperSlide } from 'vue-awesome-swiper'
import utils from 'utils' import utils from 'utils'
export default { export default {
...@@ -185,7 +189,9 @@ export default { ...@@ -185,7 +189,9 @@ export default {
step: 0.35, step: 0.35,
singleHeight: 50 singleHeight: 50
}, },
greatKey: 0 greatKey: 0,
// 弹框是否显示
visible: false
} }
}, },
...@@ -385,6 +391,11 @@ export default { ...@@ -385,6 +391,11 @@ export default {
// 打开学员风采弹框 // 打开学员风采弹框
openStudent (index) { openStudent (index) {
console.log(index) console.log(index)
this.visible = true
},
// 关闭弹框
closePopup (data) {
this.visible = data
}, },
// 把数组中的key转成name // 把数组中的key转成name
formatArr (arr) { formatArr (arr) {
......
...@@ -34,14 +34,45 @@ ...@@ -34,14 +34,45 @@
</div> </div>
<!-- 活动开展 --> <!-- 活动开展 -->
<div class='activ'> <div class='activ'>
<active /> <div class="activity-one">
<div class="act">活动开展</div>
<div class="mor" @click="getMore">查看更多</div>
</div>
<div class="activity-two">
<div class="left">
<div class="act-left">
<count-roll :count="4166" class="act-style"/><span></span>
</div>
<p class="act-num">活动开展次数</p>
</div>
<div class="line"></div>
<div class="right">
<line-bar
:layout="activeConfig.layout"
:option="activeConfig.option"
/>
</div>
</div>
</div> </div>
<popup-frame
:visible.sync="activeShow"
@beforeClose="beforeCloses"
>
<div class="img">
<img src="../../../static/images/index/03.png" alt="">
</div>
</popup-frame>
<popup-frame <popup-frame
:visible.sync="showVisible" :visible.sync="showVisible"
@beforeClose="beforeCloses" @beforeClose="beforeCloses"
class="topic-frame"
> >
<div class="img"> <div class="img">
<img src="../../../static/images/index/supply-demand2.jpg" alt=""> <img src="../../../static/images/index/supply-demand1.jpg" alt="" v-show="topicShow">
<img src="../../../static/images/index/supply-demand2.jpg" alt="" v-show="!topicShow">
<div class="button" @click="topicChange"></div>
</div> </div>
</popup-frame> </popup-frame>
<div class="right-bottom"> <div class="right-bottom">
...@@ -115,6 +146,8 @@ ...@@ -115,6 +146,8 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 活动开展 查看更多的弹出层 -->
</div> </div>
</template> </template>
...@@ -124,7 +157,9 @@ import { swiper, swiperSlide } from 'vue-awesome-swiper' ...@@ -124,7 +157,9 @@ import { swiper, swiperSlide } from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css' import 'swiper/dist/css/swiper.css'
import BarChart from 'components/echarts/BarChart.vue' import BarChart from 'components/echarts/BarChart.vue'
import PieChart from 'components/echarts/PieChart.vue' import PieChart from 'components/echarts/PieChart.vue'
import active from './active' import LineBar from 'components/echarts/LineBar'
import CountRoll from 'components/CountRoll.vue'
// import PopupFrame from './PopupFrame'
export default { export default {
name: 'Right', name: 'Right',
components: { components: {
...@@ -133,7 +168,9 @@ export default { ...@@ -133,7 +168,9 @@ export default {
PieChart, PieChart,
swiper, swiper,
swiperSlide, swiperSlide,
active LineBar,
CountRoll
// PopupFrame
}, },
props: { props: {
rightData: { rightData: {
...@@ -145,6 +182,7 @@ export default { ...@@ -145,6 +182,7 @@ export default {
}, },
data () { data () {
return { return {
activeShow: false,
showVisible: false, showVisible: false,
// 师资力量 // 师资力量
eduConfig: {}, eduConfig: {},
...@@ -198,7 +236,21 @@ export default { ...@@ -198,7 +236,21 @@ export default {
img: '../../../static/images/index/topic-bg1.png' img: '../../../static/images/index/topic-bg1.png'
} }
] ],
topicShow: true,
// 活动开展
activeConfig: {},
activeList: [
{name: '*****活动', value: 192},
{name: '组织活动', value: 1103},
{name: '*****活动', value: 381}
],
moreConfig: {
props: {
visible: false,
title: ''
}
}
} }
}, },
mounted () { mounted () {
...@@ -208,6 +260,7 @@ export default { ...@@ -208,6 +260,7 @@ export default {
this.getlinedata() this.getlinedata()
this.getline() this.getline()
this.getlearn() this.getlearn()
this.getActive(this.activeList)
}, },
methods: { methods: {
// 师资力量 // 师资力量
...@@ -524,6 +577,68 @@ export default { ...@@ -524,6 +577,68 @@ export default {
} }
} }
}, },
getActive (data) {
let yData = data.map(v => v.name).reverse()
let y2Data = data.map(v => v.value).reverse()
let max = 4166
let maxData = new Array(data.length).fill(max)
let pointData = data.reverse().map((v, i) => {
return {
xAxis: v.value,
yAxis: i
}
})
this.activeConfig = {
layout: {
width: '100%',
height: '100%'
},
option: {
base: {
xAxis: {
max: max
},
yAxis: [
{
axisLabel: {
color: '#fff',
align: 'left',
padding: [0, 0, 0, -60]
},
data: yData
}, {
data: y2Data.map(v => v)
}
]
},
seriesData: [
{
name: 'back',
barWidth: '5px',
data: maxData
},
{
name: 'show',
barWidth: '5px',
itemStyle: {
borderRadius: [0, 0, 0, 0],
color: 'rgba(64, 169, 248, .05)'
},
markPoint: {
symbolOffset: [0, 0.5],
data: pointData
},
data: y2Data
}
]
}
}
},
// 查看更多的点击事件
getMore () {
console.log(123)
this.activeShow = true
},
// 交流会/专题弹框 // 交流会/专题弹框
topicDialog () { topicDialog () {
this.showVisible = true this.showVisible = true
...@@ -531,7 +646,12 @@ export default { ...@@ -531,7 +646,12 @@ export default {
// 关闭交流会/专题弹框弹框前的回调 // 关闭交流会/专题弹框弹框前的回调
beforeCloses (flag) { beforeCloses (flag) {
this.showVisible = flag this.showVisible = flag
this.activeShow = flag
},
topicChange () {
this.topicShow = !this.topicShow
} }
} }
} }
</script> </script>
...@@ -602,9 +722,80 @@ export default { ...@@ -602,9 +722,80 @@ export default {
} }
// 活动开展 // 活动开展
.activ{ .activ{
width: 100%; width: 100%;
height: 150px; height: 140px;
} .activity-one{
height: 20px;
display: flex;
justify-content: space-between;
.act{
width: 72px;
height: 20px;
margin-top: -5px;
font-size: 18px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
line-height: 28px;
}
.mor{
width: 94px;
height: 20px;
cursor: pointer;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #18d1c6;
background:url('../../../static/images/index/more.png') no-repeat right;
}
}
.activity-two{
margin-top: 12px;
display: flex;
justify-content: space-between;
.left{
margin-top:10px;
width: 150px;
.act-left{
display: flex;
.act-style{
width: 150px;
}
span{
width: 16px;
height: 17px;
margin-top: 22px;
margin-left: 12px;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #FFFFFF;
line-height: 35px;
}
}
.act-num{
width: 108px;
height: 18px;
margin-top: 20px;
font-size: 18px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #6DCDFF;
line-height: 17px;
}
}
.line{
width: 3px;
height: 76px;
margin: 10px 0 0 20px;
background:url('../../../static/images/index/3.png');
}
.right{
width: 270px;
height: 100%;
}
}
}
.right-bottom { .right-bottom {
position: relative; position: relative;
.seemore { .seemore {
...@@ -772,5 +963,21 @@ export default { ...@@ -772,5 +963,21 @@ export default {
} }
} }
} }
.topic-frame{
width: 100%;
height: 100%;
.img{
position: relative;
width: 100%;
height: 100%;
.button{
width: 50px;
height: 100px;
position: absolute;
top: 40%;
right: 10px;
}
}
}
} }
</style> </style>
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
module.exports = { module.exports = {
host: '127.0.0.1', host: '127.0.0.1',
port: '8082', // 自定义端口号 port: '8087', // 自定义端口号
proxyTable: { // Vue开发环境跨域配置 proxyTable: { // Vue开发环境跨域配置
'/apis': { '/apis': {
target: 'http://test-a.com', target: 'http://test-a.com',
......
...@@ -5,7 +5,6 @@ import ContentContainer from 'components/ContentContainer' ...@@ -5,7 +5,6 @@ import ContentContainer from 'components/ContentContainer'
// 页面头 // 页面头
import Header from 'components/Header' import Header from 'components/Header'
// 插件 // 插件
import CountTo from 'components/CountTo.vue'
import PopupFrame from '@/components/PopupFrame' import PopupFrame from '@/components/PopupFrame'
const UsePlugin = {} const UsePlugin = {}
...@@ -21,8 +20,6 @@ UsePlugin.install = function (Vue, options = {}) { ...@@ -21,8 +20,6 @@ UsePlugin.install = function (Vue, options = {}) {
// 内容容器 // 内容容器
Vue.component('content-container', ContentContainer) Vue.component('content-container', ContentContainer)
Vue.component('page-head', Header) Vue.component('page-head', Header)
// 数组滚动
Vue.component('count-to', CountTo)
// 弹框组件 // 弹框组件
Vue.component('popup-frame', PopupFrame) Vue.component('popup-frame', PopupFrame)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment