bannerFive.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="banner-wrap banner-three">
  3. <view class="title-wrap">
  4. <view class="title">生态农场指数</view>
  5. <view class="sub-title">通风透光防病虫,覆草种植原生态</view>
  6. </view>
  7. <swiper v-if="boxList.length" class="carousel" :indicator-dots="true" :autoplay="true" style="height: 370px" arrow="always" :interval="5000">
  8. <swiper-item class="carousel-item" v-for="(item, index) in boxList" :key="index">
  9. <view class="name">
  10. <text>{{ item.title }}: {{item.value}}分 </text>
  11. <text class="size">(排名前 {{item.rank}}%)</text>
  12. </view>
  13. <image class="img" :src="item.img" alt="" />
  14. <view class="desc">{{ item.name }}</view>
  15. </swiper-item>
  16. </swiper>
  17. </view>
  18. </template>
  19. <script setup>
  20. import { ref ,watch} from "vue";
  21. const props = defineProps({
  22. baseData:{
  23. type:Object,
  24. defalut:{}
  25. }
  26. })
  27. const boxList = ref([]);
  28. watch(()=>props.baseData,(newValue) =>{
  29. boxList.value = []
  30. getData(newValue)
  31. })
  32. const getData = (data) =>{
  33. boxList.value.push(
  34. {
  35. value:data.ventilationScore,
  36. name:data.ventilationText,
  37. img:data.ventilationImg,
  38. title: "通风率",
  39. rank:'20',
  40. },
  41. {
  42. value:data.transmittanceScore,
  43. name:data.transmittanceText,
  44. img:data.transmittanceImg,
  45. title: "透光率",
  46. rank:'20',
  47. },
  48. {
  49. value:data.biodiversityScore,
  50. name:data.biodiversityText,
  51. img:data.biodiversityImg,
  52. title: "生物多样性",
  53. rank:'5',
  54. },
  55. // {
  56. // value:data.stfzScore,
  57. // name:data.stfzText,
  58. // img:data.stfzImg,
  59. // title: "生态防治",
  60. // rank:'20',
  61. // }
  62. )
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .banner-wrap {
  67. width: 100%;
  68. height: 100%;
  69. background-size: 100% 100%;
  70. background-repeat: no-repeat;
  71. background-position: center center;
  72. .title {
  73. font-size: 72rpx;
  74. letter-spacing: 8rpx;
  75. font-family: "jiangxizhuokai";
  76. }
  77. &.banner-three {
  78. background-image: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/report-banner-3.png");
  79. padding: 120rpx 28rpx;
  80. box-sizing: border-box;
  81. .sub-title {
  82. letter-spacing: 6rpx;
  83. margin-top: 20rpx;
  84. }
  85. .carousel {
  86. margin-top: 24rpx;
  87. width: 100%;
  88. ::v-deep {
  89. .el-carousel__button {
  90. width: 10rpx;
  91. height: 10rpx;
  92. border-radius: 50%;
  93. }
  94. .el-carousel__arrow{
  95. width: 64rpx;
  96. height: 64rpx;
  97. background: rgba(0, 0, 0,0.6);
  98. .el-icon{
  99. font-size: 44rpx;
  100. font-weight: bold;
  101. }
  102. }
  103. }
  104. .carousel-item {
  105. width: 100%;
  106. height: 100%;
  107. background: rgba(255, 255, 255, 0.6);
  108. border-radius: 24rpx;
  109. padding: 78rpx 32rpx 52rpx 32rpx;
  110. box-sizing: border-box;
  111. backdrop-filter: blur(4rpx);
  112. .name {
  113. position: absolute;
  114. top: 0;
  115. left: calc(50% - 450rpx / 2);
  116. font-family: "jiangxizhuokai";
  117. padding: 12rpx;
  118. font-size: 32rpx;
  119. color: #333333;
  120. text-align: center;
  121. width: 450rpx;
  122. box-sizing: border-box;
  123. background: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/name-bg.png") no-repeat center center / 100% 100%;
  124. .size {
  125. font-size: 26rpx;
  126. }
  127. }
  128. .img{
  129. width: 100%;
  130. height: 480rpx;
  131. object-fit: cover;
  132. margin: 22rpx 0;
  133. border-radius: 10rpx;
  134. }
  135. .desc {
  136. color: #333333;
  137. font-size: 24rpx;
  138. letter-spacing: 2rpx;
  139. line-height: 36rpx;
  140. }
  141. }
  142. }
  143. }
  144. }
  145. </style>