完成创建房间相关接口

This commit is contained in:
kron
2025-05-30 16:14:17 +08:00
parent 01a327e40e
commit b7d64396ef
9 changed files with 364 additions and 45 deletions

View File

@@ -11,15 +11,26 @@ const store = useStore();
// 使用storeToRefs用于UI里显示保持响应性
const { user } = storeToRefs(store);
const isLogin = () => {
if (!user.value.id) {
uni.showToast({
title: "还未登录",
icon: "none",
});
}
return !!user.value.id;
};
const toLoginPage = () => {
uni.navigateTo({
url: "/pages/login",
});
};
const toFristTryPage = () => {
uni.navigateTo({
url: "/pages/first-try",
});
if (isLogin()) {
uni.navigateTo({
url: "/pages/first-try",
});
}
};
const toRankingPage = () => {
uni.navigateTo({
@@ -27,27 +38,35 @@ const toRankingPage = () => {
});
};
const toFriendBattlePage = () => {
uni.navigateTo({
url: "/pages/friend-battle",
});
if (isLogin()) {
uni.navigateTo({
url: "/pages/friend-battle",
});
}
};
const toPractisePage = () => {
uni.navigateTo({
url: "/pages/practise",
});
if (isLogin()) {
uni.navigateTo({
url: "/pages/practise",
});
}
};
const toQquipmentPage = () => {
uni.navigateTo({
url: "/pages/equipment-debug",
});
if (isLogin()) {
uni.navigateTo({
url: "/pages/equipment-debug",
});
}
};
const toAddDevicePage = () => {
uni.navigateTo({
url: "/pages/add-device",
});
if (isLogin()) {
uni.navigateTo({
url: "/pages/add-device",
});
}
};
// 获取全局配置