hookehuyr

fix(核销结果页): 修复核销失败时返回数据问题并优化页面样式

调整核销结果页的字体大小和间距,提升可读性
修复fn.js中核销失败时未返回res.data的问题
移除冗余的msg显示,改为在失败时显示详细错误信息
...@@ -29,7 +29,7 @@ export const fn = (api) => { ...@@ -29,7 +29,7 @@ export const fn = (api) => {
29 icon: 'none', 29 icon: 'none',
30 duration: 2000 30 duration: 2000
31 }); 31 });
32 - return false; 32 + return res.data || false;
33 } 33 }
34 }) 34 })
35 .catch(err => { 35 .catch(err => {
......
1 <!-- 1 <!--
2 * @Date: 2026-01-08 13:01:20 2 * @Date: 2026-01-08 13:01:20
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2026-01-20 16:16:47 4 + * @LastEditTime: 2026-01-20 17:36:04
5 * @FilePath: /xyxBooking-weapp/src/pages/verificationResult/index.vue 5 * @FilePath: /xyxBooking-weapp/src/pages/verificationResult/index.vue
6 * @Description: 核销结果页面 6 * @Description: 核销结果页面
7 --> 7 -->
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
9 <view class="min-h-screen bg-gray-100 p-4 verify-page"> 9 <view class="min-h-screen bg-gray-100 p-4 verify-page">
10 <view class="rounded-2xl bg-white p-4 shadow-sm"> 10 <view class="rounded-2xl bg-white p-4 shadow-sm">
11 <view class="flex items-center"> 11 <view class="flex items-center">
12 - <view class="flex h-11 w-11 items-center justify-center rounded-full bg-amber-50"> 12 + <view class="flex h-14 w-14 items-center justify-center rounded-full bg-amber-50">
13 - <icon :type="status_icon_type" size="24" :color="status_icon_color" /> 13 + <icon :type="status_icon_type" size="30" :color="status_icon_color" />
14 </view> 14 </view>
15 <view class="ml-4 flex-1"> 15 <view class="ml-4 flex-1">
16 - <view class="text-sm font-semibold text-gray-900">{{ status_title }}</view> 16 + <view class="text-lg font-semibold text-gray-900">{{ status_title }}</view>
17 - <view class="mt-1 text-xs text-gray-500">{{ msg }}</view> 17 + <!-- <view class="mt-1 text-sm text-gray-500">{{ msg }}</view> -->
18 </view> 18 </view>
19 </view> 19 </view>
20 </view> 20 </view>
...@@ -25,36 +25,40 @@ ...@@ -25,36 +25,40 @@
25 </view> --> 25 </view> -->
26 26
27 <view class="mt-4 rounded-2xl bg-white p-5 shadow-sm"> 27 <view class="mt-4 rounded-2xl bg-white p-5 shadow-sm">
28 - <view class="text-xs text-gray-500 mb-3">核销记录信息</view> 28 + <view class="text-sm text-gray-500 mb-4">核销记录信息</view>
29 29
30 <template v-if="verify_info && Object.keys(verify_info).length > 0"> 30 <template v-if="verify_info && Object.keys(verify_info).length > 0">
31 - <view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0"> 31 + <view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
32 - <view class="text-gray-500 text-sm">姓名</view> 32 + <view class="text-gray-500 text-base">姓名</view>
33 - <view class="text-gray-900 text-sm font-medium">{{ verify_info.person_name || '-' }}</view> 33 + <view class="text-gray-900 text-lg font-medium">{{ verify_info.person_name || '-' }}</view>
34 </view> 34 </view>
35 35
36 - <view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0"> 36 + <view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
37 - <view class="text-gray-500 text-sm">证件号码</view> 37 + <view class="text-gray-500 text-base">证件号码</view>
38 - <view class="text-gray-900 text-sm font-medium">{{ formatIdNumber(verify_info.id_number) }}</view> 38 + <view class="text-gray-900 text-lg font-medium">{{ formatIdNumber(verify_info.id_number) }}</view>
39 </view> 39 </view>
40 40
41 - <view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0"> 41 + <view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
42 - <view class="text-gray-500 text-sm">状态</view> 42 + <view class="text-gray-500 text-base">状态</view>
43 - <view class="text-amber-600 text-sm font-medium">{{ verify_info.status || '-' }}</view> 43 + <view class="text-amber-600 text-lg font-medium">{{ verify_info.status || '-' }}</view>
44 </view> 44 </view>
45 45
46 - <view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0"> 46 + <view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
47 - <view class="text-gray-500 text-sm">预约开始</view> 47 + <view class="text-gray-500 text-base">预约开始</view>
48 - <view class="text-gray-900 text-sm font-medium">{{ verify_info.begin_time || '-' }}</view> 48 + <view class="text-gray-900 text-lg font-medium">{{ verify_info.begin_time || '-' }}</view>
49 </view> 49 </view>
50 50
51 - <view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0"> 51 + <view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
52 - <view class="text-gray-500 text-sm">预约结束</view> 52 + <view class="text-gray-500 text-base">预约结束</view>
53 - <view class="text-gray-900 text-sm font-medium">{{ verify_info.end_time || '-' }}</view> 53 + <view class="text-gray-900 text-lg font-medium">{{ verify_info.end_time || '-' }}</view>
54 </view> 54 </view>
55 </template> 55 </template>
56 - <view v-else-if="verify_code" class="mt-2 break-all whitespace-pre-wrap text-sm font-medium text-gray-900">{{ verify_code }}</view> 56 + <view v-else-if="verify_status === 'fail'" class="py-2">
57 - <view v-else class="mt-2 text-sm text-gray-400">暂无核销信息</view> 57 + <view class="text-gray-500 text-base mb-2">失败原因</view>
58 + <view class="text-red-500 text-lg font-medium break-all">{{ msg }}</view>
59 + </view>
60 + <view v-else-if="verify_code" class="mt-2 break-all whitespace-pre-wrap text-lg font-medium text-gray-900">{{ verify_code }}</view>
61 + <view v-else class="mt-2 text-base text-gray-400">暂无核销信息</view>
58 </view> 62 </view>
59 63
60 <view class="verify-footer"> 64 <view class="verify-footer">
...@@ -66,9 +70,9 @@ ...@@ -66,9 +70,9 @@
66 class="verify-btn" 70 class="verify-btn"
67 @tap="start_scan_and_verify" 71 @tap="start_scan_and_verify"
68 > 72 >
69 - 核销 73 + <view class="text-lg">核销</view>
70 </nut-button> 74 </nut-button>
71 - <view class="mt-4 text-center text-xs text-gray-400">扫描预约码二维码进行核销</view> 75 + <view class="mt-4 text-center text-sm text-gray-400">扫描预约码二维码进行核销</view>
72 </view> 76 </view>
73 </view> 77 </view>
74 </template> 78 </template>
...@@ -151,6 +155,7 @@ const verify_ticket = async (code) => { ...@@ -151,6 +155,7 @@ const verify_ticket = async (code) => {
151 return 155 return
152 } 156 }
153 verify_status.value = 'fail' 157 verify_status.value = 'fail'
158 + console.warn(res);
154 msg.value = res?.msg || '核销失败' 159 msg.value = res?.msg || '核销失败'
155 verify_info.value = {} 160 verify_info.value = {}
156 } catch (e) { 161 } catch (e) {
...@@ -215,7 +220,7 @@ const start_scan_and_verify = () => { ...@@ -215,7 +220,7 @@ const start_scan_and_verify = () => {
215 } 220 }
216 221
217 .verify-btn { 222 .verify-btn {
218 - font-size: 32rpx; 223 + font-size: 36rpx;
219 height: 104rpx; 224 height: 104rpx;
220 line-height: 104rpx; 225 line-height: 104rpx;
221 border-radius: 16rpx; 226 border-radius: 16rpx;
......