比赛逻辑代码统一

This commit is contained in:
kron
2025-07-28 13:54:37 +08:00
parent 0d7a421546
commit e116c8d22f
8 changed files with 290 additions and 764 deletions

View File

@@ -36,24 +36,7 @@ const handleSelect = (index) => {
}
};
const toTeamMatchPage = async (gameType, teamSize) => {
if (!device.value.deviceId) {
return uni.showToast({
title: "请先绑定设备",
icon: "none",
});
}
const isGaming = await isGamingAPI();
if (isGaming) {
uni.$showHint(1);
return;
}
uni.navigateTo({
url: `/pages/team-match?gameType=${gameType}&teamSize=${teamSize}`,
});
};
const toMeleeMatchPage = async (gameType, teamSize) => {
const toMatchPage = async (gameType, teamSize) => {
if (!device.value.deviceId) {
return uni.showToast({
title: "请先绑定设备",
@@ -72,7 +55,7 @@ const toMeleeMatchPage = async (gameType, teamSize) => {
return;
}
uni.navigateTo({
url: `/pages/melee-match?gameType=${gameType}&teamSize=${teamSize}`,
url: `/pages/match-page?gameType=${gameType}&teamSize=${teamSize}`,
});
};
const toMyGrowthPage = () => {
@@ -205,17 +188,17 @@ onShow(async () => {
<image
src="../static/battle1v1.png"
mode="widthFix"
@click.stop="() => toTeamMatchPage(1, 2)"
@click.stop="() => toMatchPage(1, 2)"
/>
<image
src="../static/battle5.png"
mode="widthFix"
@click.stop="() => toMeleeMatchPage(2, 5)"
@click.stop="() => toMatchPage(2, 5)"
/>
<image
src="../static/battle10.png"
mode="widthFix"
@click.stop="() => toMeleeMatchPage(2, 10)"
@click.stop="() => toMatchPage(2, 10)"
/>
</view>
<view class="data-progress">