update:新增扫码绑定失败界面
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user