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