我的预约0.2
This commit is contained in:
parent
80af8f718b
commit
85c5296cef
|
|
@ -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} 返回用户信息
|
* @returns {Promise} 返回用户信息
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@
|
||||||
mode="aspectFit"
|
mode="aspectFit"
|
||||||
src="https://api.ccttiot.com/image-1755237410755.png"
|
src="https://api.ccttiot.com/image-1755237410755.png"
|
||||||
/>
|
/>
|
||||||
<text class="btn-text">出示码券</text>
|
<text class="btn-text">核销验证码</text>
|
||||||
</view>
|
</view>
|
||||||
<!-- 只有待核销状态才显示取消预约按钮 -->
|
<!-- 只有待核销状态才显示取消预约按钮 -->
|
||||||
<view
|
<view
|
||||||
|
|
@ -128,6 +128,7 @@ import {
|
||||||
cancelAppointment,
|
cancelAppointment,
|
||||||
getAppointmentList,
|
getAppointmentList,
|
||||||
getAppointmentQRCode,
|
getAppointmentQRCode,
|
||||||
|
verifyAppointmentCode,
|
||||||
} from "@/api/personalCenter/index.js";
|
} from "@/api/personalCenter/index.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -268,28 +269,28 @@ export default {
|
||||||
return classMap[state] || "status-default";
|
return classMap[state] || "status-default";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 显示二维码
|
// 核销验证码
|
||||||
async showQRCode(item) {
|
async showQRCode(item) {
|
||||||
try {
|
try {
|
||||||
const response = await getAppointmentQRCode(item.subscribeId || item.id);
|
const response = await verifyAppointmentCode(item.subscribeId || item.id);
|
||||||
|
|
||||||
if (response.code === 200) {
|
if (response.code === 200) {
|
||||||
// TODO: 显示二维码弹窗
|
|
||||||
console.log("二维码数据:", response.data);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "二维码功能开发中",
|
title: "核销成功",
|
||||||
icon: "none",
|
icon: "success",
|
||||||
});
|
});
|
||||||
|
// 刷新列表
|
||||||
|
this.refreshList();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: response.msg || "获取二维码失败",
|
title: response.msg || "核销失败",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("获取二维码失败:", error);
|
console.error("核销失败:", error);
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "获取二维码失败,请重试",
|
title: "核销失败,请重试",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user