| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <div class="l-flex--col u-text--center has-content-padding o-device-status u-releative">
- <slot />
- <video
- class="video"
- src="@/assets/map_1.mp4"
- muted
- autoplay
- loop
- />
- <div class="u-bold o-device-status__ratio">
- <div class="o-device-status__text">良性运营率</div>
- <div>{{ ratio }}%</div>
- </div>
- <div class="o-device-status__padding">
- <cards
- :items="itemList"
- lg
- />
- </div>
- <div class="date">截止时间: {{ date }}</div>
- </div>
- </template>
- <script>
- import { parseTime } from '@/utils'
- import Cards from './Cards'
- export default {
- name: 'DeviceStatus',
- components: {
- Cards
- },
- props: {
- items: {
- type: Array,
- required: true
- },
- ratio: {
- type: String,
- required: true
- }
- },
- data () {
- return {
- date: ''
- }
- },
- computed: {
- itemList () {
- const colors = ['#2956F0', '#04A681', '#C4C4C4', '#F40645']
- return this.items.map((item, index) => {
- return {
- ...item,
- icon: 'menu-four',
- style: { color: colors[index] }
- }
- })
- }
- },
- created () {
- this.getCurrentTime()
- },
- methods: {
- getCurrentTime () {
- const now = parseTime(new Date(), '{y}年{m}月{d}日 {h}:{i}:{s}').split(' ')
- this.date = now[0]
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .video {
- position: absolute;
- left: 0;
- top: 0;
- width: 1840px;
- height: 1237px;
- object-fit: cover;
- }
- .has-content-padding {
- padding: 0 24px 24px;
- }
- .o-device-status {
- position: relative;
- font-size: 36px;
- color: #fff;
- &__ratio {
- font-size: 96px;
- line-height: 110px;
- height: 930px;
- z-index: 2;
- }
- &__text {
- margin-top: 350px;
- margin-bottom: 68px;
- word-spacing: 2px;
- }
- &_item {
- width: 33.3333%;
- }
- &__num {
- font-size: 64px;
- line-height: 100px;
- color: #f7d308;
- }
- &__padding {
- padding: 0 160px;
- z-index: 2;
- }
- }
- .date {
- text-align: center;
- font-size: 32px;
- color: #9ea9cd;
- z-index: 2;
- margin-top: 30px;
- }
- </style>
|