index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <view class="review-list-page">
  3. <view class="list-container">
  4. <view class="review-card" v-for="item in reviews" :key="item.id">
  5. <view class="card-header">
  6. <text class="order-no">{{ item.orderNo }}</text>
  7. <text class="stars">{{ '★'.repeat(item.rating) }}{{ '☆'.repeat(5 - item.rating) }}</text>
  8. </view>
  9. <text class="review-content">{{ item.content }}</text>
  10. <view class="card-footer">
  11. <text class="time">{{ item.time }}</text>
  12. <text class="service-type">{{ item.serviceType }}</text>
  13. </view>
  14. </view>
  15. <view class="empty-state" v-if="reviews.length === 0">
  16. <text>暂无评价记录</text>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script setup>
  22. import { ref } from 'vue'
  23. import reviewMockData from '@/mock/review.json'
  24. const reviews = ref(reviewMockData)
  25. </script>
  26. <style lang="scss" scoped>
  27. .review-list-page { min-height: 100vh; background: #f7f8fa; }
  28. .list-container { padding: 24rpx; }
  29. .review-card { background: #fff; border-radius: 24rpx; padding: 32rpx; margin-bottom: 24rpx; }
  30. .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16rpx; }
  31. .order-no { font-size: 24rpx; color: #999; }
  32. .stars { color: #f7ca3e; font-size: 28rpx; }
  33. .review-content { font-size: 28rpx; color: #333; line-height: 1.6; margin-bottom: 20rpx; }
  34. .card-footer { display: flex; justify-content: space-between; padding-top: 16rpx; border-top: 1rpx solid #f5f5f5; }
  35. .time { font-size: 24rpx; color: #999; }
  36. .service-type { font-size: 24rpx; color: #ff9500; }
  37. .empty-state { text-align: center; padding: 100rpx 0; color: #999; font-size: 28rpx; }
  38. </style>