index.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <script setup lang="ts">
  2. import { ref, onMounted } from 'vue'
  3. import { onLoad } from '@dcloudio/uni-app'
  4. // 模拟反馈详情数据
  5. interface FeedbackDetail {
  6. id: number
  7. content: string
  8. imageUrl?: string
  9. date: string
  10. status: '已回复' | '处理中' | '已解决'
  11. replyContent?: string
  12. replyDate?: string
  13. }
  14. const feedbackDetail = ref<FeedbackDetail>({
  15. id: 0,
  16. content: '',
  17. imageUrl: '',
  18. date: '',
  19. status: '处理中'
  20. })
  21. // 使用UniApp的onLoad钩子获取页面参数
  22. onLoad((options) => {
  23. if (options && options.id) {
  24. // 模拟根据ID获取详情数据
  25. // 实际项目中这里应该调用API获取数据
  26. setTimeout(() => {
  27. feedbackDetail.value = {
  28. id: parseInt(options.id),
  29. content: '这是一个详细的反馈内容,用户在这里描述了具体的问题和情况。希望团队能够尽快处理这个问题。',
  30. imageUrl: '/static/plus.png',
  31. date: '2025-10-28 14:30',
  32. status: '已回复',
  33. replyContent: '感谢您的反馈,我们已经收到并开始处理您的问题。预计会在3个工作日内解决,请耐心等待。',
  34. replyDate: '2025-10-29 09:15'
  35. }
  36. }, 500)
  37. }
  38. })
  39. </script>
  40. <template>
  41. <view class="bg-gray-50 min-h-screen">
  42. <!-- 详情内容 -->
  43. <view class="p-4">
  44. <view class="bg-white rounded-lg shadow-sm p-4 mb-4">
  45. <view class="flex justify-between items-start mb-3">
  46. <text class="text-gray-900 font-medium">反馈 #{{ feedbackDetail.id }}</text>
  47. <text class="text-xs px-2 py-1 rounded" :class="{
  48. 'bg-green-100 text-green-800': feedbackDetail.status === '已解决',
  49. 'bg-yellow-100 text-yellow-800': feedbackDetail.status === '处理中',
  50. 'bg-blue-100 text-blue-800': feedbackDetail.status === '已回复'
  51. }">{{ feedbackDetail.status }}</text>
  52. </view>
  53. <view class="text-gray-700 text-sm mb-4">
  54. {{ feedbackDetail.content }}
  55. </view>
  56. <view v-if="feedbackDetail.imageUrl" class="mb-4">
  57. <image
  58. :src="feedbackDetail.imageUrl"
  59. class="w-32 h-32 rounded object-cover"
  60. mode="aspectFill"
  61. />
  62. </view>
  63. <view class="text-xs text-gray-500 border-t border-gray-100 pt-3">
  64. {{ feedbackDetail.date }}
  65. </view>
  66. </view>
  67. <!-- 回复内容 -->
  68. <view
  69. v-if="feedbackDetail.replyContent"
  70. class="bg-white rounded-lg shadow-sm p-4"
  71. >
  72. <view class="font-medium text-gray-900 mb-3">官方回复</view>
  73. <view class="text-gray-700 text-sm mb-3">
  74. {{ feedbackDetail.replyContent }}
  75. </view>
  76. <view class="text-xs text-gray-500 border-t border-gray-100 pt-3">
  77. {{ feedbackDetail.replyDate }}
  78. </view>
  79. </view>
  80. <view
  81. v-else
  82. class="bg-white rounded-lg shadow-sm p-4"
  83. >
  84. <view class="text-gray-500 text-center py-6">
  85. 暂无回复
  86. </view>
  87. </view>
  88. </view>
  89. </view>
  90. </template>
  91. <style scoped>
  92. </style>