Bladeren bron

页面优化

fengyu 2 maanden geleden
bovenliggende
commit
c0148286f6
1 gewijzigde bestanden met toevoegingen van 43 en 8 verwijderingen
  1. 43 8
      src/pages/questionnaire.vue

+ 43 - 8
src/pages/questionnaire.vue

@@ -3,7 +3,7 @@
3 3
  * @Author: Fengyu
4 4
  * @Date: 2025-12-12 10:12:59
5 5
  * @LastEditors: Fengyu
6
- * @LastEditTime: 2025-12-17 10:26:23
6
+ * @LastEditTime: 2025-12-17 11:12:47
7 7
 -->
8 8
 <template>
9 9
   <view class="questionnaire-container">
@@ -38,7 +38,7 @@
38 38
             <view class="grid-title">1.您所在的服务区</view>
39 39
             <view class="grid-desc">
40 40
               <u-select v-model="parkSelectShow" :list="parkList" @confirm="confirm"></u-select>
41
-              <span @click="parkSelectShow = true">{{ parkName || '请选择' }}</span>
41
+              <span @click="parkSelectShow = true">{{ parkName || '请选择' }}&nbsp;﹥</span>
42 42
             </view>
43 43
           </view>
44 44
         </view>
@@ -61,18 +61,27 @@
61 61
         <!-- 最好的高速 -->
62 62
         <view class="grid-item">
63 63
           <view class="grid-content">
64
-            <view class="grid-title">{{ dataFilledIn.length + 2 }}. 您认为本服务区的最好的高速是?</view>
64
+            <view class="grid-title">{{ dataFilledIn.length + 2 }}. 您认为途经最好的高速是?</view>
65 65
             <view class="grid-desc">
66
-              <u-input v-model="bestWay" type="textarea" :border="false" :height="100" :auto-height="true" placeholder="请输入您的评价" />
66
+              <u-input v-model="bestWay" type="textarea" :border="false" :height="100" :auto-height="true" placeholder="请输入您认为途经最好的高速" />
67 67
             </view>
68 68
           </view>
69 69
         </view>
70 70
         <!-- 最好的服务区 -->
71 71
         <view class="grid-item">
72 72
           <view class="grid-content">
73
-            <view class="grid-title">{{ dataFilledIn.length + 3 }}. 您认为本服务区的最好的服务区是?</view>
73
+            <view class="grid-title">{{ dataFilledIn.length + 3 }}. 您认为途经最好的服务区是?</view>
74 74
             <view class="grid-desc">
75
-              <u-input v-model="bestService" type="textarea" :border="false" :height="100" :auto-height="true" placeholder="请输入您的评价" />
75
+              <u-input v-model="bestService" type="textarea" :border="false" :height="100" :auto-height="true" placeholder="请输入您认为途经最好的服务区" />
76
+            </view>
77
+          </view>
78
+        </view>
79
+
80
+        <view class="grid-item">
81
+          <view class="grid-content">
82
+            <view class="grid-title">您的手机号:</view>
83
+            <view class="grid-desc">
84
+              <u-input v-model="phone" type="number" :border="false" :height="100" :maxlength="11" :auto-height="true" placeholder="请输入您的手机号" />
76 85
             </view>
77 86
           </view>
78 87
         </view>
@@ -155,6 +164,8 @@
155 164
   const parkId = ref('')
156 165
   const parkName = ref('')
157 166
 
167
+  const phone = ref('')
168
+
158 169
   // 获取服务区列表
159 170
   const getParkListApi = () => {
160 171
     getParkList().then(res => {
@@ -263,6 +274,30 @@
263 274
         return;
264 275
       }
265 276
       
277
+      if (!phone.value) {
278
+        uni.showToast({
279
+          title: '请输入手机号',
280
+          icon: 'none'
281
+        });
282
+        return;
283
+      }
284
+
285
+      if (!bestWay.value) {
286
+        uni.showToast({
287
+          title: '请输入最好的高速',
288
+          icon: 'none'
289
+        });
290
+        return;
291
+      }
292
+
293
+      if (!bestService.value) {
294
+        uni.showToast({
295
+          title: '请输入最好的服务区',
296
+          icon: 'none'
297
+        });
298
+        return;
299
+      }
300
+      
266 301
       // 解析URL参数
267 302
       const urlParams = new URLSearchParams(window.location.search);
268 303
       const questionnaireId = questionnaireInfo.value.id || 0;
@@ -308,7 +343,7 @@
308 343
       let params = {
309 344
         questionnaireId,
310 345
         // parkid, // 使用API要求的参数名
311
-        mobile,
346
+        mobile: phone.value,
312 347
         ...scoreData
313 348
       };
314 349
 
@@ -322,7 +357,7 @@
322 357
             icon: 'success'
323 358
           });
324 359
           setTimeout(() => {
325
-            uni.redirectTo({
360
+            uni.switchTab({
326 361
               url: '/pages/index'
327 362
             })
328 363
           }, 2000);