pestDiscern.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <view class="pest-discern">
  3. <view class="pest-discern__header">
  4. <view class="pest-discern__title">
  5. 虫害识别
  6. </view>
  7. </view>
  8. <view class="pest-discern__content">
  9. <view class="pest-discern__item" v-for="(item,index) in pests" :key="index">
  10. <view class="pest-discern__item-title">
  11. {{ item.name }}
  12. </view>
  13. <view class="pest-discern__item-content">
  14. <u-line-progress :active-color="item.color" :percent="item.percent" :show-percent="false" height="8"></u-line-progress>
  15. </view>
  16. <view class="pest-discern__item-count">
  17. 6521
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. data() {
  26. return {
  27. pests: [
  28. {
  29. color:'#FF3546',
  30. name: '叶蝉',
  31. percent: 90
  32. },
  33. {
  34. color:'#F69B47',
  35. name: '稻飞虱',
  36. percent: 80
  37. },
  38. {
  39. color:'#EEAC19',
  40. name: '水龟虫',
  41. percent: 70
  42. },
  43. {
  44. color:'#0085FF',
  45. name: '蝼蛄',
  46. percent: 60
  47. }
  48. ]
  49. }
  50. }
  51. }
  52. </script>
  53. <style lang="scss" scoped>
  54. .pest-discern {
  55. width: 100%;
  56. padding: 32rpx;
  57. box-sizing: border-box;
  58. background: #fff;
  59. border-radius: 16rpx;
  60. }
  61. .pest-discern__header {
  62. padding: 20rpx 0rpx;
  63. font-size: 32rpx;
  64. color: #042118;
  65. font-family: 'Source Han Sans CN VF';
  66. font-weight: 700;
  67. }
  68. .pest-discern__title {
  69. font-size: 32rpx;
  70. color: #042118;
  71. font-family: 'Source Han Sans CN VF';
  72. font-weight: 700;
  73. }
  74. .pest-discern__item {
  75. display: flex;
  76. width: 100%;
  77. margin-bottom: 20rpx;
  78. align-items: center;
  79. .pest-discern__item-title{
  80. width: 120rpx;
  81. font-size: 28rpx;
  82. color: #042118;
  83. font-family: 'Source Han Sans CN VF';
  84. font-weight: 400;
  85. // 超出隐藏
  86. overflow: hidden;
  87. text-overflow: ellipsis;
  88. white-space: nowrap;
  89. }
  90. .pest-discern__item-content{
  91. flex: 1;
  92. margin: 0 20rpx;
  93. }
  94. .pest-discern__item-count{
  95. width: 80rpx;
  96. font-size: 28rpx;
  97. color: #042118;
  98. text-align: right;
  99. }
  100. }
  101. </style>