index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view class="service-review-page">
  3. <view class="summary-bar">
  4. <text class="avg-score">4.8</text>
  5. <text class="avg-label">综合评分</text>
  6. <text class="total-count">共 {{ reviews.length }} 条评价</text>
  7. </view>
  8. <view class="review-list">
  9. <view class="review-card" v-for="item in reviews" :key="item.id">
  10. <view class="review-header">
  11. <view class="user-info">
  12. <view class="user-avatar"><text>{{ item.userName[0] }}</text></view>
  13. <text class="user-name">{{ item.userName }}</text>
  14. </view>
  15. <text class="stars">{{ '★'.repeat(item.rating) }}{{ '☆'.repeat(5 - item.rating) }}</text>
  16. </view>
  17. <text class="review-content">{{ item.content }}</text>
  18. <text class="review-time">{{ item.time }}</text>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script setup>
  24. import { ref } from 'vue'
  25. import reviewMockData from '@/mock/review.json'
  26. const reviews = ref(reviewMockData)
  27. </script>
  28. <style lang="scss" scoped>
  29. .service-review-page { min-height: 100vh; background: #f7f8fa; }
  30. .summary-bar { background: #fff; padding: 40rpx; display: flex; align-items: baseline; gap: 16rpx; border-bottom: 1rpx solid #f5f5f5; }
  31. .avg-score { font-size: 56rpx; font-weight: 900; color: #ff9500; }
  32. .avg-label { font-size: 26rpx; color: #333; }
  33. .total-count { font-size: 24rpx; color: #999; margin-left: auto; }
  34. .review-list { padding: 24rpx; }
  35. .review-card { background: #fff; border-radius: 20rpx; padding: 28rpx; margin-bottom: 20rpx; }
  36. .review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16rpx; }
  37. .user-info { display: flex; align-items: center; gap: 16rpx; }
  38. .user-avatar { width: 64rpx; height: 64rpx; border-radius: 50%; background: #e3f2fd; color: #2196f3; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 28rpx; }
  39. .user-name { font-size: 28rpx; color: #333; font-weight: 600; }
  40. .stars { color: #f7ca3e; font-size: 26rpx; }
  41. .review-content { display: block; font-size: 28rpx; color: #555; line-height: 1.6; margin-bottom: 12rpx; }
  42. .review-time { display: block; font-size: 24rpx; color: #bbb; }
  43. </style>