index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="complaint-list-page">
  3. <view class="list-container">
  4. <view class="empty-state" v-if="historyList.length === 0">
  5. <text>暂无投诉记录</text>
  6. </view>
  7. <view v-else class="history-card" v-for="item in historyList" :key="item.id">
  8. <view class="card-header">
  9. <text class="order-no">订单号:{{ item.orderNo }}</text>
  10. <text :class="['status-text', item.status === '已处理' ? 'text-green' : 'text-orange']">{{ item.status }}</text>
  11. </view>
  12. <view class="card-body">
  13. <view class="rate-row">
  14. <text class="label">评价评分:</text>
  15. <text class="stars">{{ '★'.repeat(item.rating) }}{{ '☆'.repeat(5 - item.rating) }}</text>
  16. </view>
  17. <text class="content-text">{{ item.content }}</text>
  18. <view class="images-preview" v-if="item.images && item.images.length">
  19. <image v-for="(img, idx) in item.images" :key="idx" :src="img" class="preview-img" mode="aspectFill"></image>
  20. </view>
  21. </view>
  22. <view class="card-footer">
  23. <text class="time">{{ item.time }}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import { ref } from 'vue'
  31. import complaintMockData from '@/mock/complaint.json'
  32. const historyList = ref(complaintMockData)
  33. </script>
  34. <style lang="scss" scoped>
  35. .complaint-list-page { min-height: 100vh; background: #f7f8fa; padding-bottom: 40rpx; }
  36. .list-container { padding: 24rpx; }
  37. .empty-state { text-align: center; padding: 100rpx 0; color: #999; font-size: 28rpx; }
  38. .history-card { background: #fff; border-radius: 24rpx; padding: 32rpx; margin-bottom: 24rpx; }
  39. .card-header { display: flex; justify-content: space-between; border-bottom: 1rpx solid #f5f5f5; padding-bottom: 20rpx; margin-bottom: 24rpx; font-size: 26rpx; }
  40. .order-no { color: #666; }
  41. .status-text { font-weight: bold; }
  42. .text-green { color: #4caf50; }
  43. .text-orange { color: #ff9800; }
  44. .rate-row { display: flex; align-items: center; margin-bottom: 16rpx; }
  45. .label { font-size: 26rpx; color: #333; }
  46. .stars { color: #f7ca3e; font-size: 28rpx; margin-left: 8rpx; }
  47. .content-text { font-size: 28rpx; color: #333; line-height: 1.5; margin-bottom: 20rpx; }
  48. .images-preview { display: flex; gap: 16rpx; flex-wrap: wrap; }
  49. .preview-img { width: 120rpx; height: 120rpx; border-radius: 8rpx; border: 1rpx solid #eee; }
  50. .card-footer { display: flex; justify-content: flex-end; border-top: 1rpx solid #f5f5f5; padding-top: 20rpx; }
  51. .time { font-size: 24rpx; color: #999; }
  52. </style>