update:新增扫码绑定失败界面

This commit is contained in:
2026-09-24 14:23:42 +08:00
parent 78fd64c697
commit f8bf9fdb63
5 changed files with 169 additions and 4 deletions
@@ -18,6 +18,16 @@ export function useDeviceBinding({
});
};
const showAlreadyBoundPage = () => {
uni.navigateTo({
url: "/pages/device/device-already-bound",
fail: (error) => {
console.error("打开设备已绑定页失败", error);
uni.showToast({ title: "设备已绑定其他账号,请解绑后再绑定", icon: "none" });
},
});
};
const handleScan = () => {
uni.scanCode({
onlyFromCamera: true,
@@ -45,10 +55,8 @@ export function useDeviceBinding({
const result = await bindDeviceAPIV2(token.value);
confirmBindTip.value = false;
if (result?.binded) {
uni.showToast({
title: "设备已绑定其他账号,请解绑后再绑定",
icon: "none",
});
token.value = "";
showAlreadyBoundPage();
return;
}
const deviceId = String(result?.deviceId || "").trim();