bannerFour.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <template>
  2. <view class="banner-wrap banner-five">
  3. <view class="title-wrap">
  4. <view class="title">标准农事体系</view>
  5. <view class="sub-title">看见营养好投入,见证安全高品质</view>
  6. </view>
  7. <view class="box-wrap" v-if="isFram">
  8. <view class="box-name">标准农事指数</view>
  9. <view class="circle-list" v-if="chartData2">
  10. <view class="circle-item">
  11. <qiun-data-charts type="arcbar" :opts="opts" :chartData="chartData" />
  12. </view>
  13. <view class="circle-item">
  14. <qiun-data-charts type="arcbar" :opts="opts2" :chartData="chartData2" />
  15. </view>
  16. <view class="tips">注:生态认证体现生物药剂的使用情况,营养认证则反映有机肥和叶面肥等的使用情况</view>
  17. </view>
  18. <view class="box-list">
  19. <view class="box-item">
  20. <view class="box-title">
  21. <image class="title-img"
  22. src="https://birdseye-img.sysuimars.com/youwei-uniapp/home/box-icon.png" alt="" />
  23. <view class="text">
  24. <text>农事认证列表</text>
  25. </view>
  26. </view>
  27. <view class="tabs" v-if="baseData?.periodList">
  28. <view class="tabs-item" :class="{ active: active === index }"
  29. v-for="(item, index) in baseData.periodList" :key="index" @click="handleActive(index)">
  30. {{ item }}
  31. </view>
  32. </view>
  33. <farm-table :tableData="tableData"></farm-table>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="box-wrap" v-else>
  38. <view class="no-data">
  39. <text>您暂且没有认证<br />农事,请立即认证</text>
  40. <view class="btn">去认证</view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script setup>
  46. import {
  47. ref,
  48. watch
  49. } from "vue";
  50. import farmTable from "./farmTable.vue";
  51. const props = defineProps({
  52. baseData: {
  53. type: Object,
  54. defalut: {},
  55. },
  56. });
  57. const isFram = ref(true);
  58. const active = ref(0);
  59. const handleActive = (index) => {
  60. active.value = index
  61. tableData.value = props.baseData.farmWorkAuths.filter(item => item.periodName === props.baseData.periodList[
  62. index])
  63. }
  64. const gradientColor = [{
  65. color: "#FFD887",
  66. percentage: 0
  67. },
  68. {
  69. color: "#FFAF2E",
  70. percentage: 100
  71. },
  72. ];
  73. const boxList = ref([{
  74. value: 0,
  75. title: "生态认证",
  76. },
  77. {
  78. value: 0,
  79. title: "营养认证",
  80. },
  81. ]);
  82. const tableData = ref([])
  83. watch(() => props.baseData, (newValue) => {
  84. tableData.value = newValue.farmWorkAuths.filter(item => item.periodName === newValue.periodList[0])
  85. opts.value = {
  86. color: ["#FFAF2E", "#FFAF2E"],
  87. padding: [0, 0, 0, 0],
  88. title: {
  89. name: props.baseData.yyAuthScore + "分",
  90. fontSize: 18,
  91. color: "#FF8400"
  92. },
  93. subtitle: {
  94. name: "生态认证",
  95. fontSize: 12,
  96. color: "#999999"
  97. },
  98. extra: {
  99. arcbar: {
  100. type: "circle",
  101. width: 8,
  102. backgroundColor: "#EDEDED",
  103. startAngle: 0.75,
  104. endAngle: 0.25,
  105. gap: 2,
  106. customColor: ["#FFAF2E", "#FFAF2E"]
  107. }
  108. }
  109. }
  110. chartData.value = {
  111. series: [{
  112. name: "生态认证",
  113. data: props.baseData.yyAuthScore / 100
  114. }]
  115. }
  116. opts2.value = {
  117. color: ["#FFAF2E", "#FFAF2E"],
  118. padding: [0, 0, 0, 0],
  119. title: {
  120. name: props.baseData.stAuthScore + "分",
  121. fontSize: 18,
  122. color: "#FF8400"
  123. },
  124. subtitle: {
  125. name: "营养认证",
  126. fontSize: 12,
  127. color: "#999999"
  128. },
  129. extra: {
  130. arcbar: {
  131. type: "circle",
  132. width: 8,
  133. backgroundColor: "#EDEDED",
  134. startAngle: 0.75,
  135. endAngle: 0.25,
  136. gap: 2,
  137. customColor: ["#FFAF2E", "#FFAF2E"]
  138. }
  139. }
  140. }
  141. chartData2.value = {
  142. series: [{
  143. name: "营养认证",
  144. data: props.baseData.stAuthScore / 100
  145. }]
  146. }
  147. })
  148. const opts = ref(null)
  149. const opts2 = ref(null)
  150. const chartData = ref(null)
  151. const chartData2 = ref(null)
  152. </script>
  153. <style lang="scss" scoped>
  154. .banner-wrap {
  155. width: 100%;
  156. height: 100%;
  157. background-size: 100% 100%;
  158. background-repeat: no-repeat;
  159. background-position: center center;
  160. .title {
  161. font-size: 36px;
  162. letter-spacing: 4px;
  163. font-family: "jiangxizhuokai";
  164. }
  165. &.banner-five {
  166. background-image: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/report-banner-5.png");
  167. padding: 60px 14px;
  168. box-sizing: border-box;
  169. .sub-title {
  170. letter-spacing: 3px;
  171. margin-top: 10px;
  172. }
  173. .box-wrap {
  174. margin-top: 12px;
  175. background: rgba(255, 255, 255, 0.94);
  176. padding: 30px 13px 13px 13px;
  177. border-radius: 12px;
  178. position: relative;
  179. .no-data {
  180. color: #999;
  181. width: 112px;
  182. text-align: center;
  183. margin: auto;
  184. .btn {
  185. background-image: linear-gradient(120deg, #ffd887, #ed9e1e);
  186. color: #ffffff;
  187. font-size: 12px;
  188. padding: 6px 33px;
  189. border-radius: 20px;
  190. margin-top: 12px;
  191. }
  192. }
  193. .box-name {
  194. position: absolute;
  195. top: 0;
  196. left: calc(50% - 173px / 2);
  197. font-size: 16px;
  198. padding: 5px 0 7px 0;
  199. text-align: center;
  200. width: 173px;
  201. color: #000;
  202. font-family: "jiangxizhuokai";
  203. background: url("https://birdseye-img.sysuimars.com/youwei-uniapp/home/box-name.png") no-repeat center center / 100% 100%;
  204. }
  205. .circle-list {
  206. display: flex;
  207. flex-wrap: wrap;
  208. justify-content: space-around;
  209. padding: 0 12px;
  210. .circle-item {
  211. width: 90px;
  212. height: 100px;
  213. }
  214. .percentage-value {
  215. color: #ff8400;
  216. font-size: 20px;
  217. font-family: "jiangxizhuokai";
  218. margin-bottom: 5px;
  219. .unit {
  220. font-size: 13px;
  221. }
  222. }
  223. .percentage-label {
  224. font-size: 12px;
  225. color: rgba(0, 0, 0, 0.4);
  226. }
  227. .tips {
  228. font-size: 11px;
  229. color: rgba(51, 51, 51, 0.5);
  230. text-align: center;
  231. margin: 10px 0;
  232. }
  233. }
  234. .box-list {
  235. .box-item {
  236. margin-top: 10px;
  237. .box-title {
  238. display: flex;
  239. align-items: center;
  240. color: #000;
  241. font-size: 15px;
  242. .title-img {
  243. width: 15px;
  244. height: 9px;
  245. margin-right: 6px;
  246. }
  247. .text {
  248. width: 100%;
  249. font-family: "jiangxizhuokai";
  250. display: flex;
  251. align-items: center;
  252. justify-content: space-between;
  253. .more {
  254. color: #bbbbbb;
  255. display: flex;
  256. align-items: center;
  257. font-size: 13px;
  258. }
  259. }
  260. }
  261. .tabs {
  262. margin-top: 10px;
  263. display: flex;
  264. justify-content: center;
  265. font-size: 13px;
  266. color: #666666;
  267. .tabs-item {
  268. padding: 3px 23px;
  269. border-radius: 20px;
  270. background: rgba(0, 0, 0, 0.09);
  271. &.active {
  272. color: #fff;
  273. background-image: linear-gradient(90deg, #FFD887, #ED9E1E);
  274. }
  275. }
  276. .tabs-item+.tabs-item {
  277. margin-left: 20px;
  278. }
  279. }
  280. }
  281. }
  282. }
  283. }
  284. }
  285. </style>