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.

139 lines
2.8 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.serviceDates.join(',')}}</text>
  22. </view>
  23. <view class="count">
  24. <text>{{ pet.serviceDates.length }}</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: {
  33. pets: {
  34. type: Array,
  35. default: () => []
  36. }
  37. }
  38. }
  39. </script>
  40. <style lang="scss" scoped>
  41. .service-pets-card {
  42. background-color: #FFFFFF;
  43. border-radius: 20rpx;
  44. padding: 30rpx;
  45. margin-bottom: 20rpx;
  46. box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
  47. }
  48. .card-title {
  49. font-size: 32rpx;
  50. font-weight: bold;
  51. color: #333;
  52. margin-bottom: 20rpx;
  53. display: flex;
  54. align-items: center;
  55. &::before {
  56. content: '';
  57. display: inline-block;
  58. width: 8rpx;
  59. height: 32rpx;
  60. background-color: #FFAA48;
  61. margin-right: 16rpx;
  62. border-radius: 4rpx;
  63. }
  64. }
  65. .pets-list {
  66. flex-direction: column;
  67. display: flex;
  68. gap: 20rpx;
  69. .pet-item {
  70. display: flex;
  71. align-items: center;
  72. margin-bottom: 20rpx;
  73. background-color: #f7f7f7;
  74. padding: 20rpx;
  75. border-radius: 20rpx;
  76. &:last-child {
  77. margin-bottom: 0;
  78. }
  79. .pet-avatar {
  80. position: relative;
  81. width: 100rpx;
  82. height: 100rpx;
  83. margin-right: 20rpx;
  84. image {
  85. width: 100%;
  86. height: 100%;
  87. border-radius: 50%;
  88. }
  89. .pet-tag {
  90. position: absolute;
  91. right: -10rpx;
  92. bottom: -10rpx;
  93. background-color: #FFAA48;
  94. color: #FFFFFF;
  95. font-size: 20rpx;
  96. padding: 4rpx 8rpx;
  97. border-radius: 10rpx;
  98. line-height: 1;
  99. }
  100. }
  101. .pet-details {
  102. display: flex;
  103. flex-direction: column;
  104. .pet-name {
  105. font-size: 28rpx;
  106. color: #333;
  107. font-weight: bold;
  108. }
  109. .pet-service {
  110. font-size: 24rpx;
  111. color: #666;
  112. margin-top: 4rpx;
  113. }
  114. }
  115. .count{
  116. margin-left: auto;
  117. margin-right: 20rpx;
  118. font-size: 26rpx;
  119. color: #999;
  120. text{
  121. font-size: 34rpx;
  122. color: #333;
  123. }
  124. }
  125. }
  126. }
  127. </style>