Tsyg.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="tsyg-page">
  3. <div class="yg-bg">
  4. <div class="name">态势预估</div>
  5. <div class="progress">
  6. <img class="arrow" src="@/assets/img/znxy/tsyg_arrow.png" />
  7. <div class="line">
  8. <div :class="['yse-events',{'active':active===0}]" @click="handleActive(0)"> &nbsp;&nbsp;&nbsp;当前&nbsp;&nbsp;&nbsp;</div>
  9. <div :class="['blue','yse-events',{'active':active===5}]" @click="handleActive(5)">未来5天</div>
  10. <div :class="['red','yse-events',{'active':active===7}]" @click="handleActive(7)">未来7天</div>
  11. <!-- <div :class="['red','yse-events',{'active':active===15}]" @click="handleActive(15)">未来15天</div> -->
  12. <!-- <div :class="['red','yse-events',{'active':active===30}]" @click="handleActive(30)">未来30天</div> -->
  13. <img :style="{left:iconLeft(active)}" class="orientation" src="@/assets/img/znxy/orientation.png" />
  14. </div>
  15. </div>
  16. </div>
  17. </div>
  18. </template>
  19. <script setup>
  20. import {ref} from 'vue'
  21. let emits = defineEmits(["selectDay"])
  22. const active = ref(0)
  23. const handleActive = (e) =>{
  24. active.value = e
  25. emits("selectDay",e)
  26. }
  27. const iconLeft = (e) =>{
  28. let left = '40'
  29. if(e===5){
  30. left = '62.4'
  31. }
  32. if(e===7){
  33. left = '84.6'
  34. }
  35. if(e===15){
  36. left = '74.3'
  37. }
  38. if(e===30){
  39. left = '89.3'
  40. }
  41. return left + '%'
  42. }
  43. </script>
  44. <style lang="scss" scoped>
  45. .tsyg-page {
  46. .yg-bg {
  47. background-image: url("@/assets/img/znxy/tsyg_bg.png");
  48. background-repeat: no-repeat;
  49. background-size: 100% 100%;
  50. width: 480px;
  51. height: 60px;
  52. position: absolute;
  53. bottom: 19px;
  54. display: flex;
  55. align-items: center;
  56. .name {
  57. font-size: 15px;
  58. color: #ffffff;
  59. margin-left: 17px;
  60. }
  61. .progress {
  62. display: flex;
  63. align-items: center;
  64. .line {
  65. width: 320px;
  66. height: 1px;
  67. margin-left: -2px;
  68. background: linear-gradient(90deg, #29f19c 0%, #02a1f9 100%);
  69. display: flex;
  70. // color: #fde16f;
  71. color: #44d6e9;
  72. div {
  73. padding-top: 7px;
  74. position: relative;
  75. width: 30%;
  76. display: flex;
  77. justify-content: flex-end;
  78. margin-right: -20px;
  79. cursor: pointer;
  80. margin-left: 10%;
  81. &::before {
  82. content: "";
  83. position: absolute;
  84. top: -6px;
  85. right: 20px;
  86. width: 8px;
  87. height: 8px;
  88. background: #112325;
  89. border-radius: 50%;
  90. border: 2px solid #51e9f0;
  91. }
  92. }
  93. .active {
  94. color: #fde16f;
  95. &::before {
  96. background: #027278;
  97. }
  98. }
  99. // .blue {
  100. // color: #44d6e9;
  101. // }
  102. // .red {
  103. // color: #fd696a;
  104. // }
  105. .orientation {
  106. width: 26px;
  107. height: 32px;
  108. position: absolute;
  109. top: -8px;
  110. left: 29.4%;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. </style>