| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view class="pest-archive">
- <view class="pest-archive__header">
- <view class="pest-archive__title">虫害档案</view>
- </view>
- <view
- class="pest-card"
- @tap="handleCardClick()"
- >
- <view class="pest-card__image">
- <image :src="pest_info.img_urls" mode="aspectFill" class="pest-img"></image>
- </view>
- <view class="pest-card__info">
- <view class="pest-card__top">
- <view class="pest-card__name">
- 名称
- </view>
- <view class="pest-card__status">
- {{ pest_info.name || '未知' }}
- </view>
- </view>
- <view class="pest-card__top">
- <view class="pest-card__name">
- 害虫信息
- </view>
- <view class="pest-card__status" style="height:200rpx;overflow: auto;">
- {{ pest_info.prevention || '未知' }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- props: {
- scrollHeight: {
- type: String,
- default: '500rpx'
- },
- pest_info: {
- type: Object,
- default: () => ({})
- }
- },
- data() {
- return {
- }
- },
- methods: {
- handleCardClick() {
- this.$emit('click', this.pest_info)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .pest-archive {
- width: 100%;
- padding: 32rpx;
- margin-top: 24rpx;
- box-sizing: border-box;
- background: #fff;
- border-radius: 16rpx;
- }
- .pest-archive__header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 24rpx;
- }
- .pest-archive__title {
- font-size: 36rpx;
- color: #042118;
- font-family: 'Source Han Sans CN VF';
- font-weight: 700;
- }
- .pest-archive__add {
- width: 56rpx;
- height: 56rpx;
- border-radius: 50%;
- background: linear-gradient(135deg, #00D26A 0%, #00B55A 100%);
- display: flex;
- align-items: center;
- justify-content: center;
- box-shadow: 0 4rpx 12rpx rgba(0, 210, 106, 0.3);
- .add-icon {
- font-size: 40rpx;
- color: #fff;
- line-height: 1;
- font-weight: 300;
- }
- }
- .pest-archive__list {
- width: 100%;
- }
- .pest-card {
- display: flex;
- padding: 24rpx;
- margin-bottom: 16rpx;
- background: #F7F8F9;
- border-radius: 16rpx;
- box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04);
- &:last-child {
- margin-bottom: 0;
- }
- &:active {
- opacity: 0.8;
- }
- }
- .pest-card__image {
- width: 200rpx;
- height: 200rpx;
- border-radius: 12rpx;
- overflow: hidden;
- flex-shrink: 0;
- margin-right: 20rpx;
- background: #e0e0e0;
- .pest-img {
- width: 100%;
- height: 100%;
- }
- }
- .pest-card__info {
- padding: 4rpx 0;
- }
- .pest-card__top {
- display: flex;
- }
- .pest-card__name {
- font-size: 24rpx;
- color: #999999;
- font-family: "Source Han Sans CN VF";
- font-weight: 400;
- width: 100rpx;
- }
- .pest-card__status {
- width: 270rpx;
- border-radius: 20rpx;
- font-size: 24rpx;
- font-weight: 500;
- &.status--handled {
- background: rgba(0, 210, 106, 0.15);
- color: #00B55A;
- }
- &.status--handling {
- background: rgba(255, 149, 0, 0.15);
- color: #FF9500;
- }
- &.status--pending {
- background: rgba(255, 53, 70, 0.15);
- color: #FF3546;
- }
- }
- .pest-card__time {
- font-size: 24rpx;
- color: #86909C;
- margin-top: 8rpx;
- }
- .pest-card__desc {
- font-size: 26rpx;
- color: #4E5969;
- margin-top: 12rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- line-clamp: 2;
- -webkit-box-orient: vertical;
- line-height: 1.5;
- }
- </style>
|