fengyu před 2 měsíci
rodič
revize
c0148286f6
1 změnil soubory, kde provedl 43 přidání a 8 odebrání
  1. 43 8
      src/pages/questionnaire.vue

+ 43 - 8
src/pages/questionnaire.vue

@@ -3,7 +3,7 @@
3
  * @Author: Fengyu
3
  * @Author: Fengyu
4
  * @Date: 2025-12-12 10:12:59
4
  * @Date: 2025-12-12 10:12:59
5
  * @LastEditors: Fengyu
5
  * @LastEditors: Fengyu
6
- * @LastEditTime: 2025-12-17 10:26:23
6
+ * @LastEditTime: 2025-12-17 11:12:47
7
 -->
7
 -->
8
 <template>
8
 <template>
9
   <view class="questionnaire-container">
9
   <view class="questionnaire-container">
@@ -38,7 +38,7 @@
38
             <view class="grid-title">1.您所在的服务区</view>
38
             <view class="grid-title">1.您所在的服务区</view>
39
             <view class="grid-desc">
39
             <view class="grid-desc">
40
               <u-select v-model="parkSelectShow" :list="parkList" @confirm="confirm"></u-select>
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
             </view>
42
             </view>
43
           </view>
43
           </view>
44
         </view>
44
         </view>
@@ -61,18 +61,27 @@
61
         <!-- 最好的高速 -->
61
         <!-- 最好的高速 -->
62
         <view class="grid-item">
62
         <view class="grid-item">
63
           <view class="grid-content">
63
           <view class="grid-content">
64
-            <view class="grid-title">{{ dataFilledIn.length + 2 }}. 您认为本服务区的最好的高速是?</view>
64
+            <view class="grid-title">{{ dataFilledIn.length + 2 }}. 您认为途经最好的高速是?</view>
65
             <view class="grid-desc">
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
             </view>
67
             </view>
68
           </view>
68
           </view>
69
         </view>
69
         </view>
70
         <!-- 最好的服务区 -->
70
         <!-- 最好的服务区 -->
71
         <view class="grid-item">
71
         <view class="grid-item">
72
           <view class="grid-content">
72
           <view class="grid-content">
73
-            <view class="grid-title">{{ dataFilledIn.length + 3 }}. 您认为本服务区的最好的服务区是?</view>
73
+            <view class="grid-title">{{ dataFilledIn.length + 3 }}. 您认为途经最好的服务区是?</view>
74
             <view class="grid-desc">
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
             </view>
85
             </view>
77
           </view>
86
           </view>
78
         </view>
87
         </view>
@@ -155,6 +164,8 @@
155
   const parkId = ref('')
164
   const parkId = ref('')
156
   const parkName = ref('')
165
   const parkName = ref('')
157
 
166
 
167
+  const phone = ref('')
168
+
158
   // 获取服务区列表
169
   // 获取服务区列表
159
   const getParkListApi = () => {
170
   const getParkListApi = () => {
160
     getParkList().then(res => {
171
     getParkList().then(res => {
@@ -263,6 +274,30 @@
263
         return;
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
       // 解析URL参数
301
       // 解析URL参数
267
       const urlParams = new URLSearchParams(window.location.search);
302
       const urlParams = new URLSearchParams(window.location.search);
268
       const questionnaireId = questionnaireInfo.value.id || 0;
303
       const questionnaireId = questionnaireInfo.value.id || 0;
@@ -308,7 +343,7 @@
308
       let params = {
343
       let params = {
309
         questionnaireId,
344
         questionnaireId,
310
         // parkid, // 使用API要求的参数名
345
         // parkid, // 使用API要求的参数名
311
-        mobile,
346
+        mobile: phone.value,
312
         ...scoreData
347
         ...scoreData
313
       };
348
       };
314
 
349
 
@@ -322,7 +357,7 @@
322
             icon: 'success'
357
             icon: 'success'
323
           });
358
           });
324
           setTimeout(() => {
359
           setTimeout(() => {
325
-            uni.redirectTo({
360
+            uni.switchTab({
326
               url: '/pages/index'
361
               url: '/pages/index'
327
             })
362
             })
328
           }, 2000);
363
           }, 2000);