添加分享房间链接和对战结束返回房间

This commit is contained in:
kron
2026-01-09 11:50:21 +08:00
parent 4aa14c6a4c
commit 71b25144a4
14 changed files with 204 additions and 209 deletions

View File

@@ -4,12 +4,12 @@ import { onShow } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import Avatar from "@/components/Avatar.vue";
import { topThreeColors } from "@/constants";
import { isGamingAPI, getHomeData } from "@/apis";
import { getHomeData } from "@/apis";
import { canEenter } from "@/util";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
const { user, device, online } = storeToRefs(store);
const { user, device, online, game } = storeToRefs(store);
const { getLvlName } = store;
const defaultSeasonData = {
@@ -43,8 +43,7 @@ const handleSelect = (index) => {
const toMatchPage = async (gameType, teamSize) => {
if (!canEenter(user.value, device.value, online.value)) return;
const isGaming = await isGamingAPI();
if (isGaming) {
if (game.value.inBattle) {
uni.$showHint(1);
return;
}
@@ -64,14 +63,14 @@ const toRankListPage = () => {
});
};
const onChangeSeason = async (seasonId, name) => {
showSeasonList.value = false;
if (name !== seasonName.value) {
handleSelect(selectedIndex.value);
const result = await getHomeData(seasonId);
rankData.value = result;
seasonName.value = name;
handleSelect(selectedIndex.value);
updateData();
}
showSeasonList.value = false;
};
const updateData = () => {
const { userGameStats, seasonList } = rankData.value;
@@ -502,10 +501,11 @@ onShow(async () => {
}
.ranking-data > view:first-of-type > view {
width: 25%;
padding: 7px 10px;
text-align: center;
border-radius: 20px;
font-size: 30rpx;
word-break: keep-all;
line-height: 70rpx;
}
.rank-item {
width: calc(100% - 30px);
@@ -595,13 +595,19 @@ onShow(async () => {
.season-list > view {
display: flex;
align-items: center;
padding: 10px 20px;
word-break: keep-all;
padding: 20rpx 0;
}
.season-list > view > text {
width: 140rpx;
text-align: right;
}
.season-list > view > image {
width: 12px;
height: 12px;
margin-left: 10px;
width: 24rpx;
height: 24rpx;
min-width: 24rpx;
min-height: 24rpx;
margin-left: 20rpx;
}
.my-rank-score {
position: absolute !important;