我的预约0.2

This commit is contained in:
WindowBird 2025-08-15 16:43:24 +08:00
parent 80af8f718b
commit 85c5296cef
2 changed files with 25 additions and 10 deletions

View File

@ -43,6 +43,20 @@ export function getAppointmentQRCode(id) {
})
}
/**
* 核销验证码
* @param {string} subscribeId - 预约ID
* @returns {Promise} 返回核销结果
*/
export function verifyAppointmentCode(subscribeId) {
return get('/app/subscribe/verifiedCode', {
subscribeId: subscribeId
}, {
timeout: 10000,
showLoading: true,
})
}
/**
* 获取用户信息
* @returns {Promise} 返回用户信息

View File

@ -68,7 +68,7 @@
mode="aspectFit"
src="https://api.ccttiot.com/image-1755237410755.png"
/>
<text class="btn-text">出示码券</text>
<text class="btn-text">核销验证码</text>
</view>
<!-- 只有待核销状态才显示取消预约按钮 -->
<view
@ -128,6 +128,7 @@ import {
cancelAppointment,
getAppointmentList,
getAppointmentQRCode,
verifyAppointmentCode,
} from "@/api/personalCenter/index.js";
export default {
@ -268,28 +269,28 @@ export default {
return classMap[state] || "status-default";
},
//
//
async showQRCode(item) {
try {
const response = await getAppointmentQRCode(item.subscribeId || item.id);
const response = await verifyAppointmentCode(item.subscribeId || item.id);
if (response.code === 200) {
// TODO:
console.log("二维码数据:", response.data);
uni.showToast({
title: "二维码功能开发中",
icon: "none",
title: "核销成功",
icon: "success",
});
//
this.refreshList();
} else {
uni.showToast({
title: response.msg || "获取二维码失败",
title: response.msg || "核销失败",
icon: "none",
});
}
} catch (error) {
console.error("获取二维码失败:", error);
console.error("核销失败:", error);
uni.showToast({
title: "获取二维码失败,请重试",
title: "核销失败,请重试",
icon: "none",
});
}