index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <template>
  2. <view class="complaint-list-page">
  3. <nav-bar title="我的评价"></nav-bar>
  4. <view class="list-container">
  5. <view class="empty-state" v-if="historyList.length === 0">
  6. <text>暂无投诉记录</text>
  7. </view>
  8. <view v-else class="history-card" v-for="item in historyList" :key="item.id">
  9. <view class="card-header">
  10. <text class="order-no">订单号:{{ item.orderNo }}</text>
  11. <text :class="['status-text', item.status === '已处理' ? 'text-green' : 'text-orange']">{{ item.status
  12. }}</text>
  13. </view>
  14. <view class="card-body">
  15. <view class="rate-row">
  16. <text class="label">评价评分:</text>
  17. <text class="stars">{{ '★'.repeat(item.rating) }}{{ '☆'.repeat(5 - item.rating) }}</text>
  18. </view>
  19. <text class="content-text">{{ item.content }}</text>
  20. <view class="images-preview" v-if="item.images && item.images.length">
  21. <image v-for="(img, idx) in item.images" :key="idx" :src="img" class="preview-img"
  22. mode="aspectFill"></image>
  23. </view>
  24. </view>
  25. <view class="card-footer">
  26. <text class="time">{{ item.time }}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script setup>
  33. import { ref } from 'vue'
  34. import navBar from '@/components/nav-bar/index.vue'
  35. import complaintMockData from '@/mock/complaint.json'
  36. const historyList = ref(complaintMockData)
  37. </script>
  38. <style lang="scss" scoped>
  39. .complaint-list-page {
  40. min-height: 100vh;
  41. background: #f7f8fa;
  42. padding-bottom: 40rpx;
  43. }
  44. .list-container {
  45. padding: 24rpx;
  46. }
  47. .empty-state {
  48. text-align: center;
  49. padding: 100rpx 0;
  50. color: #999;
  51. font-size: 28rpx;
  52. }
  53. .history-card {
  54. background: #fff;
  55. border-radius: 24rpx;
  56. padding: 32rpx;
  57. margin-bottom: 24rpx;
  58. }
  59. .card-header {
  60. display: flex;
  61. justify-content: space-between;
  62. border-bottom: 1rpx solid #f5f5f5;
  63. padding-bottom: 20rpx;
  64. margin-bottom: 24rpx;
  65. font-size: 26rpx;
  66. }
  67. .order-no {
  68. color: #666;
  69. }
  70. .status-text {
  71. font-weight: bold;
  72. }
  73. .text-green {
  74. color: #4caf50;
  75. }
  76. .text-orange {
  77. color: #ff9800;
  78. }
  79. .rate-row {
  80. display: flex;
  81. align-items: center;
  82. margin-bottom: 16rpx;
  83. }
  84. .label {
  85. font-size: 26rpx;
  86. color: #333;
  87. }
  88. .stars {
  89. color: #f7ca3e;
  90. font-size: 28rpx;
  91. margin-left: 8rpx;
  92. }
  93. .content-text {
  94. font-size: 28rpx;
  95. color: #333;
  96. line-height: 1.5;
  97. margin-bottom: 20rpx;
  98. }
  99. .images-preview {
  100. display: flex;
  101. gap: 16rpx;
  102. flex-wrap: wrap;
  103. }
  104. .preview-img {
  105. width: 120rpx;
  106. height: 120rpx;
  107. border-radius: 8rpx;
  108. border: 1rpx solid #eee;
  109. }
  110. .card-footer {
  111. display: flex;
  112. justify-content: flex-end;
  113. border-top: 1rpx solid #f5f5f5;
  114. padding-top: 20rpx;
  115. }
  116. .time {
  117. font-size: 24rpx;
  118. color: #999;
  119. }
  120. </style>