update:优化跳转
This commit is contained in:
@@ -47,6 +47,7 @@ const enterRoom = debounce(async (number) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
let keepLoading = false;
|
||||||
try {
|
try {
|
||||||
const room = await getRoomAPI(number);
|
const room = await getRoomAPI(number);
|
||||||
if (!room.number) {
|
if (!room.number) {
|
||||||
@@ -65,11 +66,15 @@ const enterRoom = debounce(async (number) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
keepLoading = true;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/battle-room?roomNumber=" + number,
|
url: "/pages/battle-room?roomNumber=" + number,
|
||||||
|
fail: () => {
|
||||||
|
loading.value = false;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false;
|
if (!keepLoading) loading.value = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const onCreateRoom = debounce(async () => {
|
const onCreateRoom = debounce(async () => {
|
||||||
@@ -123,6 +128,7 @@ const goMyRecord = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
|
loading.value = false;
|
||||||
if (user.value.id) {
|
if (user.value.id) {
|
||||||
const [result] = await Promise.all([
|
const [result] = await Promise.all([
|
||||||
getBattleDataAPI(),
|
getBattleDataAPI(),
|
||||||
|
|||||||
Reference in New Issue
Block a user