pestArchive.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <template>
  2. <view class="pest-archive">
  3. <view class="pest-archive__header">
  4. <view class="pest-archive__title">虫害档案</view>
  5. </view>
  6. <view
  7. class="pest-card"
  8. @tap="handleCardClick(item)"
  9. >
  10. <view class="pest-card__image">
  11. <image :src="item.image" mode="aspectFill" class="pest-img"></image>
  12. </view>
  13. <view class="pest-card__info">
  14. <view class="pest-card__top">
  15. <view class="pest-card__name">
  16. 名称
  17. </view>
  18. <view class="pest-card__status">
  19. 叶蝉
  20. </view>
  21. </view>
  22. <view class="pest-card__top">
  23. <view class="pest-card__name">
  24. 科目
  25. </view>
  26. <view class="pest-card__status">
  27. 叶蝉
  28. </view>
  29. </view>
  30. <view class="pest-card__top">
  31. <view class="pest-card__name">
  32. 别名
  33. </view>
  34. <view class="pest-card__status">
  35. 叶蝉
  36. </view>
  37. </view>
  38. <view class="pest-card__top">
  39. <view class="pest-card__name">
  40. 危害作物
  41. </view>
  42. <view class="pest-card__status">
  43. 叶蝉科半翅目
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. export default {
  52. props: {
  53. scrollHeight: {
  54. type: String,
  55. default: '500rpx'
  56. }
  57. },
  58. data() {
  59. return {
  60. item: {
  61. name: '小菜蛾',
  62. status: '已防治',
  63. statusType: 'handled',
  64. time: '2025-06-15',
  65. description: '采用生物防治方法,投放赤眼蜂进行防治',
  66. image: 'https://via.placeholder.com/120x120/4CAF50/FFFFFF?text=小菜蛾'
  67. },
  68. }
  69. },
  70. methods: {
  71. handleCardClick(item) {
  72. this.$emit('click', item)
  73. }
  74. }
  75. }
  76. </script>
  77. <style lang="scss" scoped>
  78. .pest-archive {
  79. width: 100%;
  80. padding: 32rpx;
  81. margin-top: 24rpx;
  82. box-sizing: border-box;
  83. background: #fff;
  84. border-radius: 16rpx;
  85. }
  86. .pest-archive__header {
  87. display: flex;
  88. justify-content: space-between;
  89. align-items: center;
  90. margin-bottom: 24rpx;
  91. }
  92. .pest-archive__title {
  93. font-size: 36rpx;
  94. color: #042118;
  95. font-family: 'Source Han Sans CN VF';
  96. font-weight: 700;
  97. }
  98. .pest-archive__add {
  99. width: 56rpx;
  100. height: 56rpx;
  101. border-radius: 50%;
  102. background: linear-gradient(135deg, #00D26A 0%, #00B55A 100%);
  103. display: flex;
  104. align-items: center;
  105. justify-content: center;
  106. box-shadow: 0 4rpx 12rpx rgba(0, 210, 106, 0.3);
  107. .add-icon {
  108. font-size: 40rpx;
  109. color: #fff;
  110. line-height: 1;
  111. font-weight: 300;
  112. }
  113. }
  114. .pest-archive__list {
  115. width: 100%;
  116. }
  117. .pest-card {
  118. display: flex;
  119. padding: 24rpx;
  120. margin-bottom: 16rpx;
  121. background: #F7F8F9;
  122. border-radius: 16rpx;
  123. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
  124. &:last-child {
  125. margin-bottom: 0;
  126. }
  127. &:active {
  128. opacity: 0.8;
  129. }
  130. }
  131. .pest-card__image {
  132. width: 200rpx;
  133. height: 200rpx;
  134. border-radius: 12rpx;
  135. overflow: hidden;
  136. flex-shrink: 0;
  137. margin-right: 20rpx;
  138. background: #e0e0e0;
  139. .pest-img {
  140. width: 100%;
  141. height: 100%;
  142. }
  143. }
  144. .pest-card__info {
  145. flex: 1;
  146. display: flex;
  147. flex-direction: column;
  148. justify-content: space-between;
  149. padding: 4rpx 0;
  150. }
  151. .pest-card__top {
  152. display: flex;
  153. align-items: center;
  154. }
  155. .pest-card__name {
  156. font-size: 24rpx;
  157. color: #042118;
  158. color: #999999;
  159. font-family: "Source Han Sans CN VF";
  160. font-size: 24rpx;
  161. font-weight: 400;
  162. }
  163. .pest-card__status {
  164. padding: 6rpx 16rpx;
  165. border-radius: 20rpx;
  166. font-size: 24rpx;
  167. font-weight: 500;
  168. // 超出隐藏
  169. white-space: nowrap;
  170. overflow: hidden;
  171. text-overflow: ellipsis;
  172. &.status--handled {
  173. background: rgba(0, 210, 106, 0.15);
  174. color: #00B55A;
  175. }
  176. &.status--handling {
  177. background: rgba(255, 149, 0, 0.15);
  178. color: #FF9500;
  179. }
  180. &.status--pending {
  181. background: rgba(255, 53, 70, 0.15);
  182. color: #FF3546;
  183. }
  184. }
  185. .pest-card__time {
  186. font-size: 24rpx;
  187. color: #86909C;
  188. margin-top: 8rpx;
  189. }
  190. .pest-card__desc {
  191. font-size: 26rpx;
  192. color: #4E5969;
  193. margin-top: 12rpx;
  194. overflow: hidden;
  195. text-overflow: ellipsis;
  196. display: -webkit-box;
  197. -webkit-line-clamp: 2;
  198. line-clamp: 2;
  199. -webkit-box-orient: vertical;
  200. line-height: 1.5;
  201. }
  202. </style>