You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

119 lines
2.5 KiB

  1. <template>
  2. <view class="service-pets-card">
  3. <view class="card-title">
  4. <text>服务宠物</text>
  5. </view>
  6. <view class="pets-list">
  7. <view class="pet-item" v-for="(pet, index) in pets" :key="index">
  8. <view class="pet-avatar">
  9. <image :src="pet.avatar || '/static/images/personal/pet.png'" mode="aspectFill"></image>
  10. <!-- <view class="pet-tag" v-if="pet.tag">
  11. <text>{{pet.tag}}</text>
  12. </view> -->
  13. </view>
  14. <view class="pet-details">
  15. <view class="pet-name-gender" style="display: flex; align-items: center;">
  16. <text class="pet-name">{{pet.name}}</text>
  17. <view class="pet-gender" style="margin-left: 10rpx; display: flex; align-items: center;">
  18. <image :src="pet.gender=='男生'?'/static/images/details/boy.svg':'/static/images/details/girl.svg'" style="width: 24rpx; height: 24rpx;" alt="sex"></image>
  19. </view>
  20. </view>
  21. <text class="pet-service">{{pet.services.join(',')}}: {{pet.serviceDates.join(',')}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. props: {
  30. pets: {
  31. type: Array,
  32. default: () => []
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .service-pets-card {
  39. background-color: #FFFFFF;
  40. border-radius: 20rpx;
  41. padding: 30rpx;
  42. margin-bottom: 20rpx;
  43. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  44. }
  45. .card-title {
  46. font-size: 32rpx;
  47. font-weight: bold;
  48. color: #333;
  49. margin-bottom: 20rpx;
  50. display: flex;
  51. align-items: center;
  52. &::before {
  53. content: '';
  54. display: inline-block;
  55. width: 8rpx;
  56. height: 32rpx;
  57. background-color: #FFAA48;
  58. margin-right: 16rpx;
  59. border-radius: 4rpx;
  60. }
  61. }
  62. .pets-list {
  63. .pet-item {
  64. display: flex;
  65. align-items: center;
  66. margin-bottom: 20rpx;
  67. &:last-child {
  68. margin-bottom: 0;
  69. }
  70. .pet-avatar {
  71. position: relative;
  72. width: 80rpx;
  73. height: 80rpx;
  74. margin-right: 20rpx;
  75. image {
  76. width: 100%;
  77. height: 100%;
  78. border-radius: 50%;
  79. }
  80. .pet-tag {
  81. position: absolute;
  82. right: -10rpx;
  83. bottom: -10rpx;
  84. background-color: #FFAA48;
  85. color: #FFFFFF;
  86. font-size: 20rpx;
  87. padding: 4rpx 8rpx;
  88. border-radius: 10rpx;
  89. line-height: 1;
  90. }
  91. }
  92. .pet-details {
  93. display: flex;
  94. flex-direction: column;
  95. .pet-name {
  96. font-size: 28rpx;
  97. color: #333;
  98. font-weight: bold;
  99. }
  100. .pet-service {
  101. font-size: 24rpx;
  102. color: #666;
  103. margin-top: 4rpx;
  104. }
  105. }
  106. }
  107. }
  108. </style>