DeviceStatus.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="l-flex--col u-text--center has-content-padding o-device-status u-releative">
  3. <slot />
  4. <video
  5. class="video"
  6. src="@/assets/map_1.mp4"
  7. muted
  8. autoplay
  9. loop
  10. />
  11. <div class="u-bold o-device-status__ratio">
  12. <div class="o-device-status__text">良性运营率</div>
  13. <div>{{ ratio }}%</div>
  14. </div>
  15. <div class="o-device-status__padding">
  16. <cards
  17. :items="itemList"
  18. lg
  19. />
  20. </div>
  21. <div class="date">截止时间: {{ date }}</div>
  22. </div>
  23. </template>
  24. <script>
  25. import { parseTime } from '@/utils'
  26. import Cards from './Cards'
  27. export default {
  28. name: 'DeviceStatus',
  29. components: {
  30. Cards
  31. },
  32. props: {
  33. items: {
  34. type: Array,
  35. required: true
  36. },
  37. ratio: {
  38. type: String,
  39. required: true
  40. }
  41. },
  42. data () {
  43. return {
  44. date: ''
  45. }
  46. },
  47. computed: {
  48. itemList () {
  49. const colors = ['#2956F0', '#04A681', '#C4C4C4', '#F40645']
  50. return this.items.map((item, index) => {
  51. return {
  52. ...item,
  53. icon: 'menu-four',
  54. style: { color: colors[index] }
  55. }
  56. })
  57. }
  58. },
  59. created () {
  60. this.getCurrentTime()
  61. },
  62. methods: {
  63. getCurrentTime () {
  64. const now = parseTime(new Date(), '{y}年{m}月{d}日 {h}:{i}:{s}').split(' ')
  65. this.date = now[0]
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .video {
  72. position: absolute;
  73. left: 0;
  74. top: 0;
  75. width: 1840px;
  76. height: 1237px;
  77. object-fit: cover;
  78. }
  79. .has-content-padding {
  80. padding: 0 24px 24px;
  81. }
  82. .o-device-status {
  83. position: relative;
  84. font-size: 36px;
  85. color: #fff;
  86. &__ratio {
  87. font-size: 96px;
  88. line-height: 110px;
  89. height: 930px;
  90. z-index: 2;
  91. }
  92. &__text {
  93. margin-top: 350px;
  94. margin-bottom: 68px;
  95. word-spacing: 2px;
  96. }
  97. &_item {
  98. width: 33.3333%;
  99. }
  100. &__num {
  101. font-size: 64px;
  102. line-height: 100px;
  103. color: #f7d308;
  104. }
  105. &__padding {
  106. padding: 0 160px;
  107. z-index: 2;
  108. }
  109. }
  110. .date {
  111. text-align: center;
  112. font-size: 32px;
  113. color: #9ea9cd;
  114. z-index: 2;
  115. margin-top: 30px;
  116. }
  117. </style>