index.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="complaint-submit-page">
  3. <view class="form-card">
  4. <view class="form-item">
  5. <text class="form-label">关联订单</text>
  6. <text class="form-value">{{ orderId || '无' }}</text>
  7. </view>
  8. <view class="form-item">
  9. <text class="form-label">投诉评分</text>
  10. <view class="rate-wrap">
  11. <text v-for="i in 5" :key="i" :class="['star', { active: i <= rating }]" @click="rating = i">★</text>
  12. </view>
  13. </view>
  14. <view class="form-item column">
  15. <text class="form-label">投诉内容</text>
  16. <textarea class="form-textarea" v-model="content" placeholder="请详细描述您的投诉内容..." maxlength="500"></textarea>
  17. </view>
  18. </view>
  19. <button class="submit-btn" @click="onSubmit">提交投诉</button>
  20. </view>
  21. </template>
  22. <script setup>
  23. import { ref } from 'vue'
  24. import { onLoad } from '@dcloudio/uni-app'
  25. const orderId = ref('')
  26. const rating = ref(3)
  27. const content = ref('')
  28. onLoad((options) => {
  29. if (options.orderId) orderId.value = options.orderId
  30. })
  31. const onSubmit = () => {
  32. if (!content.value) { uni.showToast({ title: '请填写投诉内容', icon: 'none' }); return }
  33. uni.showToast({ title: '投诉已提交', icon: 'success' })
  34. setTimeout(() => uni.navigateBack(), 1000)
  35. }
  36. </script>
  37. <style lang="scss" scoped>
  38. .complaint-submit-page { min-height: 100vh; background: #f7f8fa; padding: 24rpx; padding-bottom: 160rpx; }
  39. .form-card { background: #fff; border-radius: 24rpx; padding: 8rpx 32rpx; }
  40. .form-item { display: flex; align-items: center; padding: 28rpx 0; border-bottom: 1rpx solid #f5f5f5; }
  41. .form-item.column { flex-direction: column; align-items: flex-start; }
  42. .form-item:last-child { border-bottom: none; }
  43. .form-label { width: 180rpx; font-size: 28rpx; color: #333; flex-shrink: 0; margin-bottom: 16rpx; }
  44. .form-value { flex: 1; font-size: 28rpx; color: #666; text-align: right; }
  45. .rate-wrap { display: flex; gap: 12rpx; }
  46. .star { font-size: 40rpx; color: #ddd; }
  47. .star.active { color: #f7ca3e; }
  48. .form-textarea { width: 100%; font-size: 28rpx; color: #333; height: 240rpx; background: #f9f9f9; border-radius: 16rpx; padding: 20rpx; }
  49. .submit-btn { margin-top: 48rpx; width: 100%; height: 96rpx; background: linear-gradient(90deg, #ffd53f, #ff9500); color: #333; border: none; border-radius: 48rpx; font-size: 32rpx; font-weight: bold; line-height: 96rpx; }
  50. </style>