bannerThree.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="banner-wrap banner-four">
  3. <view class="title-wrap">
  4. <view class="title">气象适宜指数</view>
  5. <!-- <el-viewider class="divider" /> -->
  6. <view class="title-line"></view>
  7. <view class="sub-title">温光水全年记录,好风好雨好荔枝</view>
  8. </view>
  9. <view class="weather-item">
  10. <view class="info">
  11. <view class="charts-box" v-if="opts">
  12. <qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
  13. </view>
  14. <view class="text">
  15. 该果园抗逆管理预案优秀,气象适宜指数超过88%的果园,有效保障糖分与风味物质含量,以精准农事护航品质。
  16. </view>
  17. </view>
  18. <view class="chart" @click="handleChart">
  19. <image src="https://birdseye-img.sysuimars.com/youwei-uniapp/home/pie.png" alt="" />
  20. </view>
  21. </view>
  22. <!-- <view class="btn" @click="handleShow">查看评分详情</view> -->
  23. </view>
  24. </template>
  25. <script setup>
  26. import { ref, watch } from 'vue';
  27. const props = defineProps({
  28. baseData:{
  29. type:Object,
  30. defalut:{}
  31. }
  32. });
  33. watch(()=>props.baseData,(newValue) =>{
  34. chartData.value = {
  35. series: [{
  36. name: "综合评分",
  37. data: newValue.weatherRiskScore / 100,
  38. }]
  39. }
  40. opts.value = {
  41. color: ["#FF8400", "#FFAF37"],
  42. padding: undefined,
  43. title: {
  44. name: newValue.weatherRiskScore + '分',
  45. fontSize: 20,
  46. color: "#FF8400"
  47. },
  48. subtitle: {
  49. name: "综合评分",
  50. fontSize: 12,
  51. color: "#999999"
  52. },
  53. extra: {
  54. arcbar: {
  55. type: "default",
  56. width: 8,
  57. backgroundColor: "#FFF3E6",
  58. startAngle: 0.75,
  59. endAngle: 0.25,
  60. gap: 2,
  61. linearType: "custom",
  62. customColor: ["#FF8400", "#FFAF37"]
  63. }
  64. }
  65. }
  66. })
  67. let opts = ref(null)
  68. let chartData = ref(null)
  69. function handleChart() {}
  70. </script>
  71. <style lang="scss" scoped>
  72. .charts-box {
  73. width: 216rpx;
  74. height: 200rpx;
  75. }
  76. .banner-wrap {
  77. width: 100%;
  78. height: 100%;
  79. background-size: 100% 100%;
  80. background-repeat: no-repeat;
  81. background-position: center center;
  82. .title {
  83. font-size: 72rpx;
  84. letter-spacing: 8rpx;
  85. font-family: "jiangxizhuokai";
  86. }
  87. &.banner-four {
  88. background-image: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/report-banner-4.png");
  89. padding: 120rpx 28rpx;
  90. box-sizing: border-box;
  91. .title-line {
  92. width: 72rpx;
  93. height: 2rpx;
  94. background: rgba(255, 255, 255, 0.6);
  95. margin: 24rpx 0;
  96. }
  97. .sub-title {
  98. letter-spacing: 6rpx;
  99. }
  100. .btn {
  101. font-size: 22rpx;
  102. padding: 14rpx 24rpx;
  103. border-radius: 40rpx;
  104. background: rgba(255, 255, 255, 0.2);
  105. text-align: center;
  106. margin-top: 48rpx;
  107. width: 180rpx;
  108. box-sizing: border-box;
  109. margin: 48rpx auto;
  110. }
  111. }
  112. .weather-item {
  113. margin-top: 24rpx;
  114. background: rgba(255, 255, 255, 0.9);
  115. padding: 24rpx 20rpx;
  116. border-radius: 24rpx;
  117. .info {
  118. width: 100%;
  119. display: flex;
  120. align-items: center;
  121. justify-content: space-between;
  122. .percentage-value {
  123. color: #ff8400;
  124. font-size: 40rpx;
  125. font-family: "jiangxizhuokai";
  126. margin-bottom: 10rpx;
  127. }
  128. .percentage-label {
  129. font-size: 24rpx;
  130. color: #999999;
  131. }
  132. .text {
  133. margin-left: 4rpx;
  134. font-size: 24rpx;
  135. line-height: 38rpx;
  136. color: #333;
  137. }
  138. }
  139. .chart {
  140. width: 100%;
  141. text-align: center;
  142. // img {
  143. // width: 100%;
  144. // height: 564rpx;
  145. // }
  146. }
  147. &.styleName2 {
  148. margin-top: 0;
  149. background: transparent;
  150. padding: 0;
  151. border-radius: 0;
  152. .info {
  153. flex-direction: column;
  154. .text {
  155. margin: 0;
  156. text-indent: 4rem;
  157. }
  158. }
  159. }
  160. }
  161. }
  162. </style>