hookehuyr

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

调整核销结果页的字体大小和间距,提升可读性
修复fn.js中核销失败时未返回res.data的问题
移除冗余的msg显示,改为在失败时显示详细错误信息
......@@ -29,7 +29,7 @@ export const fn = (api) => {
icon: 'none',
duration: 2000
});
return false;
return res.data || false;
}
})
.catch(err => {
......
<!--
* @Date: 2026-01-08 13:01:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-20 16:16:47
* @LastEditTime: 2026-01-20 17:36:04
* @FilePath: /xyxBooking-weapp/src/pages/verificationResult/index.vue
* @Description: 核销结果页面
-->
......@@ -9,12 +9,12 @@
<view class="min-h-screen bg-gray-100 p-4 verify-page">
<view class="rounded-2xl bg-white p-4 shadow-sm">
<view class="flex items-center">
<view class="flex h-11 w-11 items-center justify-center rounded-full bg-amber-50">
<icon :type="status_icon_type" size="24" :color="status_icon_color" />
<view class="flex h-14 w-14 items-center justify-center rounded-full bg-amber-50">
<icon :type="status_icon_type" size="30" :color="status_icon_color" />
</view>
<view class="ml-4 flex-1">
<view class="text-sm font-semibold text-gray-900">{{ status_title }}</view>
<view class="mt-1 text-xs text-gray-500">{{ msg }}</view>
<view class="text-lg font-semibold text-gray-900">{{ status_title }}</view>
<!-- <view class="mt-1 text-sm text-gray-500">{{ msg }}</view> -->
</view>
</view>
</view>
......@@ -25,36 +25,40 @@
</view> -->
<view class="mt-4 rounded-2xl bg-white p-5 shadow-sm">
<view class="text-xs text-gray-500 mb-3">核销记录信息</view>
<view class="text-sm text-gray-500 mb-4">核销记录信息</view>
<template v-if="verify_info && Object.keys(verify_info).length > 0">
<view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-sm">姓名</view>
<view class="text-gray-900 text-sm font-medium">{{ verify_info.person_name || '-' }}</view>
<view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-base">姓名</view>
<view class="text-gray-900 text-lg font-medium">{{ verify_info.person_name || '-' }}</view>
</view>
<view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-sm">证件号码</view>
<view class="text-gray-900 text-sm font-medium">{{ formatIdNumber(verify_info.id_number) }}</view>
<view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-base">证件号码</view>
<view class="text-gray-900 text-lg font-medium">{{ formatIdNumber(verify_info.id_number) }}</view>
</view>
<view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-sm">状态</view>
<view class="text-amber-600 text-sm font-medium">{{ verify_info.status || '-' }}</view>
<view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-base">状态</view>
<view class="text-amber-600 text-lg font-medium">{{ verify_info.status || '-' }}</view>
</view>
<view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-sm">预约开始</view>
<view class="text-gray-900 text-sm font-medium">{{ verify_info.begin_time || '-' }}</view>
<view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-base">预约开始</view>
<view class="text-gray-900 text-lg font-medium">{{ verify_info.begin_time || '-' }}</view>
</view>
<view class="flex justify-between items-center py-2 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-sm">预约结束</view>
<view class="text-gray-900 text-sm font-medium">{{ verify_info.end_time || '-' }}</view>
<view class="flex justify-between items-center py-3 border-b border-gray-50 border-solid last:border-0">
<view class="text-gray-500 text-base">预约结束</view>
<view class="text-gray-900 text-lg font-medium">{{ verify_info.end_time || '-' }}</view>
</view>
</template>
<view v-else-if="verify_code" class="mt-2 break-all whitespace-pre-wrap text-sm font-medium text-gray-900">{{ verify_code }}</view>
<view v-else class="mt-2 text-sm text-gray-400">暂无核销信息</view>
<view v-else-if="verify_status === 'fail'" class="py-2">
<view class="text-gray-500 text-base mb-2">失败原因</view>
<view class="text-red-500 text-lg font-medium break-all">{{ msg }}</view>
</view>
<view v-else-if="verify_code" class="mt-2 break-all whitespace-pre-wrap text-lg font-medium text-gray-900">{{ verify_code }}</view>
<view v-else class="mt-2 text-base text-gray-400">暂无核销信息</view>
</view>
<view class="verify-footer">
......@@ -66,9 +70,9 @@
class="verify-btn"
@tap="start_scan_and_verify"
>
核销
<view class="text-lg">核销</view>
</nut-button>
<view class="mt-4 text-center text-xs text-gray-400">扫描预约码二维码进行核销</view>
<view class="mt-4 text-center text-sm text-gray-400">扫描预约码二维码进行核销</view>
</view>
</view>
</template>
......@@ -151,6 +155,7 @@ const verify_ticket = async (code) => {
return
}
verify_status.value = 'fail'
console.warn(res);
msg.value = res?.msg || '核销失败'
verify_info.value = {}
} catch (e) {
......@@ -215,7 +220,7 @@ const start_scan_and_verify = () => {
}
.verify-btn {
font-size: 32rpx;
font-size: 36rpx;
height: 104rpx;
line-height: 104rpx;
border-radius: 16rpx;
......