index.vue 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <template>
  2. <view class="pet-detail-page">
  3. <view class="pet-hero">
  4. <image src="https://images.unsplash.com/photo-1552053831-71594a27632d?q=80&w=600&auto=format&fit=crop"
  5. class="hero-img" mode="aspectFill"></image>
  6. <view class="hero-overlay"></view>
  7. <view class="hero-info">
  8. <text class="pet-name">旺财</text>
  9. <text class="pet-breed">金毛寻回犬 · 公 · 3岁</text>
  10. </view>
  11. </view>
  12. <view class="info-card">
  13. <view class="info-row"><text class="label">体重</text><text class="value">30 kg</text></view>
  14. <view class="info-row"><text class="label">健康状况</text><text class="value">健康</text></view>
  15. <view class="info-row"><text class="label">绝育状态</text><text class="value">已绝育</text></view>
  16. <view class="info-row"><text class="label">疫苗状态</text><text class="value green">已接种 (3/3)</text></view>
  17. <view class="info-row"><text class="label">性格特点</text><text class="value">活泼好动,喜欢球类玩具</text></view>
  18. <view class="info-row"><text class="label">主人</text><text class="value">张先生 13800138000</text></view>
  19. </view>
  20. <button class="edit-btn" @click="goToEdit">编辑档案</button>
  21. </view>
  22. </template>
  23. <script setup>
  24. const goToEdit = () => uni.navigateTo({ url: '/pages/my/pet/edit/index' })
  25. </script>
  26. <style lang="scss" scoped>
  27. .pet-detail-page { min-height: 100vh; background: #f7f8fa; padding-bottom: 160rpx; }
  28. .pet-hero { position: relative; height: 480rpx; overflow: hidden; }
  29. .hero-img { width: 100%; height: 100%; }
  30. .hero-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.7) 100%); }
  31. .hero-info { position: absolute; bottom: 40rpx; left: 40rpx; z-index: 2; }
  32. .pet-name { display: block; font-size: 48rpx; font-weight: 900; color: #fff; }
  33. .pet-breed { display: block; font-size: 28rpx; color: rgba(255, 255, 255, 0.9); margin-top: 8rpx; }
  34. .info-card { background: #fff; border-radius: 32rpx 32rpx 0 0; margin-top: -40rpx; position: relative; z-index: 3; padding: 40rpx 32rpx; }
  35. .info-row { display: flex; justify-content: space-between; padding: 24rpx 0; border-bottom: 1rpx solid #f5f5f5; }
  36. .info-row:last-child { border-bottom: none; }
  37. .label { font-size: 28rpx; color: #999; }
  38. .value { font-size: 28rpx; color: #333; font-weight: 500; }
  39. .value.green { color: #4caf50; }
  40. .edit-btn { margin: 40rpx 32rpx; width: calc(100% - 64rpx); height: 96rpx; background: linear-gradient(90deg, #ffd53f, #ff9500); color: #333; border: none; border-radius: 48rpx; font-size: 32rpx; font-weight: bold; line-height: 96rpx; }
  41. </style>