添加设备绑定提示
This commit is contained in:
@@ -18,11 +18,21 @@ const isIos = ref(true);
|
|||||||
const toPage = (path) => {
|
const toPage = (path) => {
|
||||||
if (!user.value.id) {
|
if (!user.value.id) {
|
||||||
showModal.value = true;
|
showModal.value = true;
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
"/pages/first-try,/pages/practise,/pages/friend-battle".indexOf(path) !== -1
|
||||||
|
) {
|
||||||
|
if (!device.value.deviceId) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: "请先绑定设备",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: path,
|
url: path,
|
||||||
});
|
});
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { ref } from "vue";
|
|||||||
import useStore from "@/store";
|
import useStore from "@/store";
|
||||||
import { storeToRefs } from "pinia";
|
import { storeToRefs } from "pinia";
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user, device } = storeToRefs(store);
|
||||||
|
|
||||||
const selectedIndex = ref(0);
|
const selectedIndex = ref(0);
|
||||||
|
|
||||||
@@ -14,12 +14,24 @@ const handleSelect = (index) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const toTeamMatchPage = (gameType, teamSize) => {
|
const toTeamMatchPage = (gameType, teamSize) => {
|
||||||
|
if (!device.value.deviceId) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: "请先绑定设备",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/team-match?gameType=${gameType}&teamSize=${teamSize}`,
|
url: `/pages/team-match?gameType=${gameType}&teamSize=${teamSize}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const toMeleeMatchPage = (gameType, teamSize) => {
|
const toMeleeMatchPage = (gameType, teamSize) => {
|
||||||
|
if (!device.value.deviceId) {
|
||||||
|
return uni.showToast({
|
||||||
|
title: "请先绑定设备",
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/melee-match?gameType=${gameType}&teamSize=${teamSize}`,
|
url: `/pages/melee-match?gameType=${gameType}&teamSize=${teamSize}`,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user