pestArchive.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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()"
  9. >
  10. <view class="pest-card__image">
  11. <image :src="pest_info.img_urls" 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. {{ pest_info.name || '未知' }}
  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" style="height:200rpx;overflow: auto;">
  27. {{ pest_info.prevention || '未知' }}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. props: {
  37. scrollHeight: {
  38. type: String,
  39. default: '500rpx'
  40. },
  41. pest_info: {
  42. type: Object,
  43. default: () => ({})
  44. }
  45. },
  46. data() {
  47. return {
  48. }
  49. },
  50. methods: {
  51. handleCardClick() {
  52. this.$emit('click', this.pest_info)
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss" scoped>
  58. .pest-archive {
  59. width: 100%;
  60. padding: 32rpx;
  61. margin-top: 24rpx;
  62. box-sizing: border-box;
  63. background: #fff;
  64. border-radius: 16rpx;
  65. }
  66. .pest-archive__header {
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. margin-bottom: 24rpx;
  71. }
  72. .pest-archive__title {
  73. font-size: 36rpx;
  74. color: #042118;
  75. font-family: 'Source Han Sans CN VF';
  76. font-weight: 700;
  77. }
  78. .pest-archive__add {
  79. width: 56rpx;
  80. height: 56rpx;
  81. border-radius: 50%;
  82. background: linear-gradient(135deg, #00D26A 0%, #00B55A 100%);
  83. display: flex;
  84. align-items: center;
  85. justify-content: center;
  86. box-shadow: 0 4rpx 12rpx rgba(0, 210, 106, 0.3);
  87. .add-icon {
  88. font-size: 40rpx;
  89. color: #fff;
  90. line-height: 1;
  91. font-weight: 300;
  92. }
  93. }
  94. .pest-archive__list {
  95. width: 100%;
  96. }
  97. .pest-card {
  98. display: flex;
  99. padding: 24rpx;
  100. margin-bottom: 16rpx;
  101. background: #F7F8F9;
  102. border-radius: 16rpx;
  103. box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
  104. &:last-child {
  105. margin-bottom: 0;
  106. }
  107. &:active {
  108. opacity: 0.8;
  109. }
  110. }
  111. .pest-card__image {
  112. width: 200rpx;
  113. height: 200rpx;
  114. border-radius: 12rpx;
  115. overflow: hidden;
  116. flex-shrink: 0;
  117. margin-right: 20rpx;
  118. background: #e0e0e0;
  119. .pest-img {
  120. width: 100%;
  121. height: 100%;
  122. }
  123. }
  124. .pest-card__info {
  125. padding: 4rpx 0;
  126. }
  127. .pest-card__top {
  128. display: flex;
  129. }
  130. .pest-card__name {
  131. font-size: 24rpx;
  132. color: #999999;
  133. font-family: "Source Han Sans CN VF";
  134. font-weight: 400;
  135. width: 100rpx;
  136. }
  137. .pest-card__status {
  138. width: 270rpx;
  139. border-radius: 20rpx;
  140. font-size: 24rpx;
  141. font-weight: 500;
  142. &.status--handled {
  143. background: rgba(0, 210, 106, 0.15);
  144. color: #00B55A;
  145. }
  146. &.status--handling {
  147. background: rgba(255, 149, 0, 0.15);
  148. color: #FF9500;
  149. }
  150. &.status--pending {
  151. background: rgba(255, 53, 70, 0.15);
  152. color: #FF3546;
  153. }
  154. }
  155. .pest-card__time {
  156. font-size: 24rpx;
  157. color: #86909C;
  158. margin-top: 8rpx;
  159. }
  160. .pest-card__desc {
  161. font-size: 26rpx;
  162. color: #4E5969;
  163. margin-top: 12rpx;
  164. overflow: hidden;
  165. text-overflow: ellipsis;
  166. display: -webkit-box;
  167. -webkit-line-clamp: 2;
  168. line-clamp: 2;
  169. -webkit-box-orient: vertical;
  170. line-height: 1.5;
  171. }
  172. </style>