Jelajahi Sumber

feat(feedback): 添加反馈列表入口并优化提交逻辑

- 在意见反馈页面标题栏添加“反馈列表”跳转入口
- 新增 goToFeedbackList 方法实现页面跳转功能
- 提交反馈后自动清空内容和图片字段- 调整标题栏布局以容纳新增的操作按钮
nahida 6 bulan lalu
induk
melakukan
faa2af0be3
1 mengubah file dengan 15 tambahan dan 1 penghapusan
  1. 15 1
      src/pages/feedback/index.vue

+ 15 - 1
src/pages/feedback/index.vue

@@ -2,7 +2,10 @@
   <view class="bg-gray-50 p-2 min-h-screen">
     <view class="bg-white rounded-xl shadow-sm p-4">
       <!-- 标题 -->
-      <view class="text-gray-900 text-lg font-medium mb-6">意见反馈</view>
+      <view class="text-gray-900 text-lg font-medium mb-6 flex justify-between items-center">
+        <text>意见反馈</text>
+        <text class="text-sm text-blue-600 font-normal" @click="goToFeedbackList">反馈列表</text>
+      </view>
 
       <!-- 表单内容 -->
       <view class="space-y-6">
@@ -63,6 +66,13 @@ const feedback = ref({
   imageUrl: ''
 })
 
+// 跳转到反馈列表
+const goToFeedbackList = () => {
+  uni.navigateTo({
+    url: '/pages/feedback/list/index'
+  })
+}
+
 // 选择图片
 const chooseImage = () => {
   // 如果已有图片则先清空
@@ -106,5 +116,9 @@ const submitFeedback = () => {
   })
 
   // 实际项目中这里调用接口提交数据
+
+  // 清空表单
+  feedback.value.content = ''
+  feedback.value.imageUrl = ''
 }
 </script>