Compare commits
6 Commits
feature-xv
...
feature-po
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1ce2ea9eb7 | ||
|
|
b31689b19f | ||
|
|
8110a0f5c1 | ||
|
|
b2abcc71b1 | ||
|
|
7242475735 | ||
|
|
13c4ce7690 |
25
src/apis.js
@@ -6,7 +6,8 @@ try {
|
|||||||
|
|
||||||
switch (envVersion) {
|
switch (envVersion) {
|
||||||
case "develop": // 开发版
|
case "develop": // 开发版
|
||||||
BASE_URL = "http://192.168.1.242:8000/api/shoot";
|
// BASE_URL = "http://192.168.1.242:8000/api/shoot";
|
||||||
|
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
||||||
break;
|
break;
|
||||||
case "trial": // 体验版
|
case "trial": // 体验版
|
||||||
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
BASE_URL = "https://apitest.shelingxingqiu.com/api/shoot";
|
||||||
@@ -256,7 +257,7 @@ export const getGameAPI = async (battleId) => {
|
|||||||
goldenRoundRecords = [],
|
goldenRoundRecords = [],
|
||||||
} = result;
|
} = result;
|
||||||
const data = {
|
const data = {
|
||||||
battleId,
|
id: battleId,
|
||||||
mode: battleStats.mode, // 1.几V几 2.大乱斗
|
mode: battleStats.mode, // 1.几V几 2.大乱斗
|
||||||
gameMode: battleStats.gameMode, // 1.约战 2.排位
|
gameMode: battleStats.gameMode, // 1.约战 2.排位
|
||||||
teamSize: battleStats.teamSize,
|
teamSize: battleStats.teamSize,
|
||||||
@@ -267,10 +268,8 @@ export const getGameAPI = async (battleId) => {
|
|||||||
data.redPlayers = {};
|
data.redPlayers = {};
|
||||||
data.bluePlayers = {};
|
data.bluePlayers = {};
|
||||||
data.mvps = [];
|
data.mvps = [];
|
||||||
data.goldenRound =
|
data.goldenRounds =
|
||||||
goldenRoundRecords && goldenRoundRecords.length
|
goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords : [];
|
||||||
? goldenRoundRecords[0]
|
|
||||||
: null;
|
|
||||||
playerStats.forEach((item) => {
|
playerStats.forEach((item) => {
|
||||||
const { playerBattleStats = {}, roundRecords = [] } = item;
|
const { playerBattleStats = {}, roundRecords = [] } = item;
|
||||||
if (playerBattleStats.team === 0) {
|
if (playerBattleStats.team === 0) {
|
||||||
@@ -289,6 +288,20 @@ export const getGameAPI = async (battleId) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
(goldenRoundRecords || []).forEach((item, index) => {
|
||||||
|
item.arrowHistory.forEach((arrow) => {
|
||||||
|
if (!data.roundsData[playerStats.length + index + 1]) {
|
||||||
|
data.roundsData[playerStats.length + index + 1] = {};
|
||||||
|
}
|
||||||
|
if (!data.roundsData[playerStats.length + index + 1][arrow.playerId]) {
|
||||||
|
data.roundsData[playerStats.length + index + 1][arrow.playerId] = [];
|
||||||
|
}
|
||||||
|
data.roundsData[playerStats.length + index + 1][arrow.playerId].push(
|
||||||
|
arrow
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
data.mvps.sort((a, b) => b.totalRings - a.totalRings);
|
data.mvps.sort((a, b) => b.totalRings - a.totalRings);
|
||||||
}
|
}
|
||||||
if (battleStats && battleStats.mode === 2) {
|
if (battleStats && battleStats.mode === 2) {
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ defineProps({
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
|
goldenRound: {
|
||||||
|
type: Number,
|
||||||
|
default: 0,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -43,7 +47,21 @@ defineProps({
|
|||||||
<view class="players">
|
<view class="players">
|
||||||
<view>
|
<view>
|
||||||
<view v-for="(result, index) in roundResults" :key="index">
|
<view v-for="(result, index) in roundResults" :key="index">
|
||||||
<image :src="RoundImages[`round${index + 1}`]" mode="widthFix" />
|
<block
|
||||||
|
v-if="goldenRound > 0 && index >= roundResults.length - goldenRound"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="
|
||||||
|
RoundImages[
|
||||||
|
`gold${index + 1 - (roundResults.length - goldenRound)}`
|
||||||
|
]
|
||||||
|
"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<image :src="RoundImages[`round${index + 1}`]" mode="widthFix" />
|
||||||
|
</block>
|
||||||
<view>
|
<view>
|
||||||
<text>{{
|
<text>{{
|
||||||
result.blueArrows.length
|
result.blueArrows.length
|
||||||
@@ -70,7 +88,21 @@ defineProps({
|
|||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view v-for="(result, index) in roundResults" :key="index">
|
<view v-for="(result, index) in roundResults" :key="index">
|
||||||
<image :src="RoundImages[`round${index + 1}`]" mode="widthFix" />
|
<block
|
||||||
|
v-if="goldenRound > 0 && index >= roundResults.length - goldenRound"
|
||||||
|
>
|
||||||
|
<image
|
||||||
|
:src="
|
||||||
|
RoundImages[
|
||||||
|
`gold${index + 1 - (roundResults.length - goldenRound)}`
|
||||||
|
]
|
||||||
|
"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</block>
|
||||||
|
<block v-else>
|
||||||
|
<image :src="RoundImages[`round${index + 1}`]" mode="widthFix" />
|
||||||
|
</block>
|
||||||
<view>
|
<view>
|
||||||
<text>{{
|
<text>{{
|
||||||
result.redArrows.length
|
result.redArrows.length
|
||||||
|
|||||||
@@ -45,7 +45,10 @@ defineProps({
|
|||||||
<view
|
<view
|
||||||
v-for="(player, index) in blueTeam"
|
v-for="(player, index) in blueTeam"
|
||||||
:key="index"
|
:key="index"
|
||||||
:style="{ margin: blueTeam.length === 2 ? '0 12px' : '0 6px' }"
|
:style="{
|
||||||
|
margin: blueTeam.length === 2 ? '0 12px' : '0 6px',
|
||||||
|
width: `${100 / blueTeam.length - blueTeam.length * 3}%`,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<Avatar :src="player.avatar" :rankLvl="player.rankLvl" />
|
<Avatar :src="player.avatar" :rankLvl="player.rankLvl" />
|
||||||
<text class="player-name">{{ player.name }}</text>
|
<text class="player-name">{{ player.name }}</text>
|
||||||
@@ -60,7 +63,10 @@ defineProps({
|
|||||||
<view
|
<view
|
||||||
v-for="(player, index) in redTeam"
|
v-for="(player, index) in redTeam"
|
||||||
:key="index"
|
:key="index"
|
||||||
:style="{ margin: redTeam.length === 2 ? '0 12px' : '0 6px' }"
|
:style="{
|
||||||
|
margin: redTeam.length === 2 ? '0 12px' : '0 6px',
|
||||||
|
width: `${100 / redTeam.length - redTeam.length * 3}%`,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
<Avatar :src="player.avatar" :rankLvl="player.rankLvl" />
|
<Avatar :src="player.avatar" :rankLvl="player.rankLvl" />
|
||||||
<text class="player-name">{{ player.name }}</text>
|
<text class="player-name">{{ player.name }}</text>
|
||||||
@@ -131,9 +137,10 @@ defineProps({
|
|||||||
}
|
}
|
||||||
.players > view > image:last-child {
|
.players > view > image:last-child {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 40px;
|
width: 50px;
|
||||||
top: 0;
|
top: -10%;
|
||||||
left: 0;
|
left: -5%;
|
||||||
|
transform: rotate(-12deg);
|
||||||
}
|
}
|
||||||
.players > view > view {
|
.players > view > view {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -164,7 +171,7 @@ defineProps({
|
|||||||
}
|
}
|
||||||
.player-name {
|
.player-name {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
width: 80%;
|
width: 100%;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ const { user } = storeToRefs(store);
|
|||||||
|
|
||||||
const tips = ref("");
|
const tips = ref("");
|
||||||
const melee = ref(false);
|
const melee = ref(false);
|
||||||
const battleId = ref("");
|
|
||||||
const timer = ref(null);
|
const timer = ref(null);
|
||||||
const sound = ref(true);
|
const sound = ref(true);
|
||||||
const currentSound = ref("");
|
const currentSound = ref("");
|
||||||
@@ -51,16 +50,15 @@ const updateSound = () => {
|
|||||||
async function onReceiveMessage(messages = []) {
|
async function onReceiveMessage(messages = []) {
|
||||||
if (!sound.value || ended.value) return;
|
if (!sound.value || ended.value) return;
|
||||||
messages.forEach((msg) => {
|
messages.forEach((msg) => {
|
||||||
if (battleId.value && msg.constructor === MESSAGETYPES.ShootResult) {
|
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||||
if (melee.value && msg.userId !== user.value.id) return;
|
if (melee.value && msg.userId !== user.value.id) return;
|
||||||
if (!halfTime.value && msg.target) {
|
if (!halfTime.value && msg.target) {
|
||||||
currentSound.value = msg.target.ring
|
currentSound.value = msg.target.ring
|
||||||
? `${msg.target.ring}环`
|
? `${msg.target.ring}环`
|
||||||
: "未上靶";
|
: "未上靶";
|
||||||
|
console.log(currentSound.value);
|
||||||
audioManager.play(currentSound.value);
|
audioManager.play(currentSound.value);
|
||||||
}
|
}
|
||||||
} else if (msg.constructor === MESSAGETYPES.WaitForAllReady) {
|
|
||||||
battleId.value = msg.id;
|
|
||||||
} else if (msg.constructor === MESSAGETYPES.AllReady) {
|
} else if (msg.constructor === MESSAGETYPES.AllReady) {
|
||||||
currentRoundEnded.value = true;
|
currentRoundEnded.value = true;
|
||||||
audioManager.play("比赛开始");
|
audioManager.play("比赛开始");
|
||||||
@@ -84,6 +82,10 @@ async function onReceiveMessage(messages = []) {
|
|||||||
ended.value = true;
|
ended.value = true;
|
||||||
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
|
||||||
ended.value = true;
|
ended.value = true;
|
||||||
|
} else if (msg.constructor === MESSAGETYPES.BackToGame) {
|
||||||
|
if (msg.battleInfo) {
|
||||||
|
melee.value = msg.battleInfo.config.battleMode === 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,9 +101,9 @@ onUnmounted(() => {
|
|||||||
<block v-if="isFinal">
|
<block v-if="isFinal">
|
||||||
<view class="point-view2">
|
<view class="point-view2">
|
||||||
<text>蓝队</text>
|
<text>蓝队</text>
|
||||||
<text>5</text>
|
<text>{{ bluePoint }}</text>
|
||||||
<text>分,红队</text>
|
<text>分,红队</text>
|
||||||
<text>5</text>
|
<text>{{ redPoint }}</text>
|
||||||
<text>分</text>
|
<text>分</text>
|
||||||
</view>
|
</view>
|
||||||
<text>同分僵局!最后一箭定江山</text>
|
<text>同分僵局!最后一箭定江山</text>
|
||||||
|
|||||||
@@ -177,23 +177,39 @@ export const getBattleResultTips = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const RoundImages = {
|
export const RoundImages = {
|
||||||
"round1":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggifbnw9snvs.png",
|
round1:
|
||||||
"round2":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgf0swue5xzpd.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggifbnw9snvs.png",
|
||||||
"round3":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slglkylhmq8beb.png",
|
round2:
|
||||||
"round4":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggc88nasmxf5.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgf0swue5xzpd.png",
|
||||||
"round5":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgeloitb8mixf.png",
|
round3:
|
||||||
"round6":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgsjbyyuu1des.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slglkylhmq8beb.png",
|
||||||
"round7":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgdysd1wqulj5.png",
|
round4:
|
||||||
"round8":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgm82ny3qjd8m.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggc88nasmxf5.png",
|
||||||
}
|
round5:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgeloitb8mixf.png",
|
||||||
|
gold1:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgsjbyyuu1des.png",
|
||||||
|
gold2:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgdysd1wqulj5.png",
|
||||||
|
gold3:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgm82ny3qjd8m.png",
|
||||||
|
};
|
||||||
|
|
||||||
export const RoundGoldImages = {
|
export const RoundGoldImages = {
|
||||||
"round1":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slg7kfzzwwiwcb.png",
|
round1:
|
||||||
"round2":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgs5htghfh3a9.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slg7kfzzwwiwcb.png",
|
||||||
"round3":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgc9ge3paqkba.png",
|
round2:
|
||||||
"round4":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgehduk96yurp.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgs5htghfh3a9.png",
|
||||||
"round5":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgefz3hdmwbnz.png",
|
round3:
|
||||||
"round6":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgeyb4cqwezgc.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgc9ge3paqkba.png",
|
||||||
"round7":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggu3tlh97v5p.png",
|
round4:
|
||||||
"round8":"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgszmdtmaotch.png",
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgehduk96yurp.png",
|
||||||
}
|
round5:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgefz3hdmwbnz.png",
|
||||||
|
gold1:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgeyb4cqwezgc.png",
|
||||||
|
gold2:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slggu3tlh97v5p.png",
|
||||||
|
gold3:
|
||||||
|
"https://static.shelingxingqiu.com/attachment/2025-08-13/dc12slgszmdtmaotch.png",
|
||||||
|
};
|
||||||
|
|||||||
@@ -120,7 +120,11 @@ const checkBowData = () => {
|
|||||||
:src="`../static/${data.winner === 1 ? 'blue' : 'red'}-team-win.png`"
|
:src="`../static/${data.winner === 1 ? 'blue' : 'red'}-team-win.png`"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
<view>
|
<view
|
||||||
|
:style="{
|
||||||
|
transform: `translateY(50px) rotate(-${5 + data.mvps.length}deg)`,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<view v-if="data.mvps && data.mvps[0].totalRings">
|
<view v-if="data.mvps && data.mvps[0].totalRings">
|
||||||
<image src="../static/title-mvp.png" mode="widthFix" />
|
<image src="../static/title-mvp.png" mode="widthFix" />
|
||||||
<text
|
<text
|
||||||
@@ -132,7 +136,7 @@ const checkBowData = () => {
|
|||||||
</view>
|
</view>
|
||||||
<view v-if="data.mvps && data.mvps.length">
|
<view v-if="data.mvps && data.mvps.length">
|
||||||
<view v-for="(player, index) in data.mvps" :key="index">
|
<view v-for="(player, index) in data.mvps" :key="index">
|
||||||
<view class="team-avatar">
|
<view class="team-avatar" :style="{ transform: 'rotate(10deg)' }">
|
||||||
<Avatar
|
<Avatar
|
||||||
:src="player.avatar"
|
:src="player.avatar"
|
||||||
:size="40"
|
:size="40"
|
||||||
@@ -146,7 +150,7 @@ const checkBowData = () => {
|
|||||||
>自己</text
|
>自己</text
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<text>{{ player.name }}</text>
|
<text class="truncate">{{ player.name }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -495,13 +499,11 @@ const checkBowData = () => {
|
|||||||
.header-mvp > view {
|
.header-mvp > view {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
transform: translateY(55px);
|
|
||||||
}
|
}
|
||||||
.header-mvp > view > view:first-child {
|
.header-mvp > view > view:first-child {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-right: 5vw;
|
|
||||||
}
|
}
|
||||||
.header-mvp > view > view:first-child > image {
|
.header-mvp > view > view:first-child > image {
|
||||||
width: 24vw;
|
width: 24vw;
|
||||||
@@ -509,23 +511,24 @@ const checkBowData = () => {
|
|||||||
.header-mvp > view > view:first-child > text {
|
.header-mvp > view > view:first-child > text {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transform: translateY(-4px) skewY(-6deg);
|
transform: skewX(-10deg);
|
||||||
}
|
}
|
||||||
.header-mvp > view > view:last-child {
|
.header-mvp > view > view:last-child {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 8px;
|
font-size: 9px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
transform: translateY(-16px) skewY(-6deg);
|
transform: translateY(-4px);
|
||||||
min-width: 40%;
|
|
||||||
}
|
}
|
||||||
.header-mvp > view > view:last-child > view {
|
.header-mvp > view > view:last-child > view {
|
||||||
margin-right: 4vw;
|
margin-left: 4vw;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
.header-mvp > view > view:last-child > view > text {
|
.header-mvp > view > view:last-child > view > text {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
|
width: 40px;
|
||||||
|
transform: skewX(-10deg) translateX(-3px);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ onShow(async () => {
|
|||||||
<view class="my-data">
|
<view class="my-data">
|
||||||
<view>
|
<view>
|
||||||
<Avatar :rankLvl="user.rankLvl" :src="user.avatar" :size="30" />
|
<Avatar :rankLvl="user.rankLvl" :src="user.avatar" :size="30" />
|
||||||
<text>{{ user.nickName }}</text>
|
<text class="truncate">{{ user.nickName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
@@ -278,6 +278,7 @@ onShow(async () => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 17px;
|
font-size: 17px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
|
width: 120px;
|
||||||
}
|
}
|
||||||
.my-data > view:last-child {
|
.my-data > view:last-child {
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
|
|||||||
@@ -58,10 +58,11 @@ const toRankListPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onShow(async () => {
|
onShow(async () => {
|
||||||
|
const rankList = await getRankListAPI();
|
||||||
|
updateRank(rankList);
|
||||||
const token = uni.getStorageSync("token");
|
const token = uni.getStorageSync("token");
|
||||||
if (token) {
|
if (token) {
|
||||||
const result = await getHomeData();
|
const result = await getHomeData();
|
||||||
updateRank(result);
|
|
||||||
console.log("首页数据:", result);
|
console.log("首页数据:", result);
|
||||||
if (result.user) {
|
if (result.user) {
|
||||||
updateUser(result.user);
|
updateUser(result.user);
|
||||||
@@ -79,9 +80,6 @@ onShow(async () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
const result = await getRankListAPI();
|
|
||||||
updateRank(result);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -187,7 +185,9 @@ const comingSoon = () => {
|
|||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<text>段位</text>
|
<text>段位</text>
|
||||||
<text>{{ user.scores ? getLvlName(user.scores) : "暂无" }}</text>
|
<text>{{
|
||||||
|
user.scores ? getLvlName(user.scores) : "暂无"
|
||||||
|
}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text>赛季平均环数</text>
|
<text>赛季平均环数</text>
|
||||||
@@ -367,7 +367,7 @@ const comingSoon = () => {
|
|||||||
height: 82rpx;
|
height: 82rpx;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: -10px;
|
margin-right: -10px;
|
||||||
border: 1px solid #312F35;
|
border: 1px solid #312f35;
|
||||||
position: relative;
|
position: relative;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { getGameAPI } from "@/apis";
|
|||||||
const blueTeam = ref([]);
|
const blueTeam = ref([]);
|
||||||
const redTeam = ref([]);
|
const redTeam = ref([]);
|
||||||
const roundsData = ref([]);
|
const roundsData = ref([]);
|
||||||
|
const goldenRoundsData = ref([]);
|
||||||
const battleId = ref("");
|
const battleId = ref("");
|
||||||
const data = ref({
|
const data = ref({
|
||||||
players: [],
|
players: [],
|
||||||
@@ -20,23 +21,29 @@ const data = ref({
|
|||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
battleId.value = options.id || "BATTLE-1751732742024840058-732";
|
battleId.value = options.id || "BATTLE-1755484626207409508-955";
|
||||||
const result = await getGameAPI(battleId.value);
|
const result = await getGameAPI(battleId.value);
|
||||||
data.value = result;
|
data.value = result;
|
||||||
if (result.mode === 1) {
|
if (result.mode === 1) {
|
||||||
blueTeam.value = Object.values(result.bluePlayers || {});
|
blueTeam.value = Object.values(result.bluePlayers || {});
|
||||||
redTeam.value = Object.values(result.redPlayers || {});
|
redTeam.value = Object.values(result.redPlayers || {});
|
||||||
Object.values(result.roundsData).forEach((item) => {
|
Object.values(result.roundsData).forEach((item) => {
|
||||||
let blueId = Object.keys(item)[0];
|
|
||||||
let redId = Object.keys(item)[1];
|
|
||||||
if (!result.bluePlayers[blueId]) {
|
|
||||||
blueId = Object.keys(item)[1];
|
|
||||||
redId = Object.keys(item)[0];
|
|
||||||
}
|
|
||||||
let bluePoint = 1;
|
let bluePoint = 1;
|
||||||
let redPoint = 1;
|
let redPoint = 1;
|
||||||
const blueTotalRings = item[blueId].reduce((a, b) => a + b.ring, 0);
|
let blueTotalRings = 0;
|
||||||
const redTotalRings = item[redId].reduce((a, b) => a + b.ring, 0);
|
let redTotalRings = 0;
|
||||||
|
let blueArrows = [];
|
||||||
|
let redArrows = [];
|
||||||
|
blueTeam.value.forEach((p) => {
|
||||||
|
if (!item[p.playerId]) return;
|
||||||
|
blueTotalRings += item[p.playerId].reduce((a, b) => a + b.ring, 0);
|
||||||
|
blueArrows = [...blueArrows, ...item[p.playerId]];
|
||||||
|
});
|
||||||
|
redTeam.value.forEach((p) => {
|
||||||
|
if (!item[p.playerId]) return;
|
||||||
|
redTotalRings += item[p.playerId].reduce((a, b) => a + b.ring, 0);
|
||||||
|
redArrows = [...redArrows, ...item[p.playerId]];
|
||||||
|
});
|
||||||
if (blueTotalRings > redTotalRings) {
|
if (blueTotalRings > redTotalRings) {
|
||||||
bluePoint = 2;
|
bluePoint = 2;
|
||||||
redPoint = 0;
|
redPoint = 0;
|
||||||
@@ -46,21 +53,32 @@ onLoad(async (options) => {
|
|||||||
}
|
}
|
||||||
roundsData.value.push({
|
roundsData.value.push({
|
||||||
blue: {
|
blue: {
|
||||||
name: result.bluePlayers[blueId].name,
|
avatars: blueTeam.value.map((p) => p.avatar),
|
||||||
avatar: result.bluePlayers[blueId].avatar,
|
arrows: blueArrows,
|
||||||
arrows: item[blueId],
|
|
||||||
totalRing: blueTotalRings,
|
totalRing: blueTotalRings,
|
||||||
totalScore: bluePoint,
|
totalScore: bluePoint,
|
||||||
},
|
},
|
||||||
red: {
|
red: {
|
||||||
name: result.redPlayers[redId].name,
|
avatars: redTeam.value.map((p) => p.avatar),
|
||||||
avatar: result.redPlayers[redId].avatar,
|
arrows: redArrows,
|
||||||
arrows: item[redId],
|
|
||||||
totalRing: redTotalRings,
|
totalRing: redTotalRings,
|
||||||
totalScore: redPoint,
|
totalScore: redPoint,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
result.goldenRounds.forEach((round) => {
|
||||||
|
goldenRoundsData.value.push({
|
||||||
|
blue: {
|
||||||
|
avatars: blueTeam.value.map((p) => p.avatar),
|
||||||
|
arrows: round.arrowHistory.filter((a) => a.team === 1),
|
||||||
|
},
|
||||||
|
red: {
|
||||||
|
avatars: redTeam.value.map((p) => p.avatar),
|
||||||
|
arrows: round.arrowHistory.filter((a) => a.team === 0),
|
||||||
|
},
|
||||||
|
winner: round.winner,
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -109,7 +127,7 @@ const checkBowData = () => {
|
|||||||
:totalRing="player.totalRings"
|
:totalRing="player.totalRings"
|
||||||
:rank="index + 1"
|
:rank="index + 1"
|
||||||
/>
|
/>
|
||||||
<block v-if="data.goldenRound">
|
<block v-for="(round, index) in goldenRoundsData" :key="index">
|
||||||
<view class="score-header">
|
<view class="score-header">
|
||||||
<text>决金箭轮(环数)</text>
|
<text>决金箭轮(环数)</text>
|
||||||
<view @click="checkBowData">
|
<view @click="checkBowData">
|
||||||
@@ -119,42 +137,48 @@ const checkBowData = () => {
|
|||||||
</view>
|
</view>
|
||||||
<view class="score-row">
|
<view class="score-row">
|
||||||
<view>
|
<view>
|
||||||
<Avatar
|
<view>
|
||||||
:src="blueTeam[0].avatar"
|
<image
|
||||||
:size="25"
|
v-for="(src, index) in round.blue.avatars"
|
||||||
borderColor="#64BAFF"
|
:style="{
|
||||||
/>
|
borderColor: '#64BAFF',
|
||||||
<text
|
transform: `translateX(-${index * 15}px)`,
|
||||||
v-if="data.goldenRound.blueTotal"
|
}"
|
||||||
v-for="(arrow, index) in data.goldenRound.arrowHistory.filter(
|
:src="src"
|
||||||
(a) => a.playerId === blueTeam[0].playerId
|
:key="index"
|
||||||
)"
|
mode="widthFix"
|
||||||
:key="index"
|
/>
|
||||||
>
|
</view>
|
||||||
|
<text v-for="(arrow, index) in round.blue.arrows" :key="index">
|
||||||
{{ arrow.ring }}环
|
{{ arrow.ring }}环
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
v-if="data.goldenRound.winner === 1"
|
v-if="round.winner === 1"
|
||||||
src="../static/winner-badge.png"
|
src="../static/winner-badge.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="score-row" :style="{ marginBottom: '5px' }">
|
<view class="score-row" :style="{ marginBottom: '5px' }">
|
||||||
<view>
|
<view>
|
||||||
<Avatar :src="redTeam[0].avatar" :size="25" borderColor="#FF6767" />
|
<view>
|
||||||
<text
|
<image
|
||||||
v-if="data.goldenRound.redTotal"
|
v-for="(src, index) in round.red.avatars"
|
||||||
v-for="(arrow, index) in data.goldenRound.arrowHistory.filter(
|
:style="{
|
||||||
(a) => a.playerId === redTeam[0].playerId
|
borderColor: '#FF6767',
|
||||||
)"
|
transform: `translateX(-${index * 15}px)`,
|
||||||
:key="index"
|
}"
|
||||||
>
|
:src="src"
|
||||||
|
:key="index"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<text v-for="(arrow, index) in round.red.arrows" :key="index">
|
||||||
{{ arrow.ring }}环
|
{{ arrow.ring }}环
|
||||||
</text>
|
</text>
|
||||||
</view>
|
</view>
|
||||||
<image
|
<image
|
||||||
v-if="data.goldenRound.winner === 0"
|
v-if="round.winner === 0"
|
||||||
src="../static/winner-badge.png"
|
src="../static/winner-badge.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -165,41 +189,69 @@ const checkBowData = () => {
|
|||||||
:key="index"
|
:key="index"
|
||||||
:style="{ marginBottom: '5px' }"
|
:style="{ marginBottom: '5px' }"
|
||||||
>
|
>
|
||||||
<view class="score-header">
|
<block
|
||||||
<text>第{{ index + 1 }}轮</text>
|
v-if="
|
||||||
<view @click="checkBowData">
|
index < Object.keys(roundsData).length - goldenRoundsData.length
|
||||||
<text>查看靶纸</text>
|
"
|
||||||
<image src="../static/back.png" mode="widthFix" />
|
>
|
||||||
|
<view class="score-header">
|
||||||
|
<text>第{{ index + 1 }}轮</text>
|
||||||
|
<view @click="checkBowData">
|
||||||
|
<text>查看靶纸</text>
|
||||||
|
<image src="../static/back.png" mode="widthFix" />
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
<view class="score-row">
|
||||||
<view class="score-row">
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<Avatar :src="round.blue.avatar" :size="25" borderColor="#64BAFF" />
|
<image
|
||||||
<text v-for="(arrow, index2) in round.blue.arrows" :key="index2">
|
v-for="(src, index) in round.blue.avatars"
|
||||||
{{ arrow.ring }}环
|
:style="{
|
||||||
</text>
|
borderColor: '#64BAFF',
|
||||||
|
transform: `translateX(-${index * 15}px)`,
|
||||||
|
}"
|
||||||
|
:src="src"
|
||||||
|
:key="index"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<text v-for="(arrow, index2) in round.blue.arrows" :key="index2">
|
||||||
|
{{ arrow.ring }}环
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text :style="{ color: '#64BAFF' }">
|
||||||
|
{{ round.blue.totalRing }}环
|
||||||
|
</text>
|
||||||
|
<text>得分 {{ round.blue.totalScore }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view class="score-row">
|
||||||
<text :style="{ color: '#64BAFF' }">
|
<view>
|
||||||
{{ round.blue.totalRing }}环
|
<view>
|
||||||
</text>
|
<image
|
||||||
<text>得分 {{ round.blue.totalScore }}</text>
|
v-for="(src, index) in round.red.avatars"
|
||||||
|
:style="{
|
||||||
|
borderColor: '#FF6767',
|
||||||
|
transform: `translateX(-${index * 15}px)`,
|
||||||
|
}"
|
||||||
|
:src="src"
|
||||||
|
:key="index"
|
||||||
|
mode="widthFix"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
<text v-for="(arrow, index2) in round.red.arrows" :key="index2">
|
||||||
|
{{ arrow.ring }}环
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<text :style="{ color: '#FF6767' }">
|
||||||
|
{{ round.red.totalRing }}环
|
||||||
|
</text>
|
||||||
|
<text>得分 {{ round.red.totalScore }}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</block>
|
||||||
<view class="score-row">
|
|
||||||
<view>
|
|
||||||
<Avatar :src="round.red.avatar" :size="25" borderColor="#FF6767" />
|
|
||||||
<text v-for="(arrow, index2) in round.red.arrows" :key="index2">
|
|
||||||
{{ arrow.ring }}环
|
|
||||||
</text>
|
|
||||||
</view>
|
|
||||||
<view>
|
|
||||||
<text :style="{ color: '#FF6767' }">
|
|
||||||
{{ round.red.totalRing }}环
|
|
||||||
</text>
|
|
||||||
<text>得分 {{ round.red.totalScore }}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
<view :style="{ height: '20px' }"></view>
|
<view :style="{ height: '20px' }"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -250,20 +302,33 @@ const checkBowData = () => {
|
|||||||
.score-row > view {
|
.score-row > view {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.score-row > view:first-child > view:first-child {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
width: 70px;
|
||||||
|
}
|
||||||
|
.score-row > view:first-child > view:first-child > image {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
min-width: 25px;
|
||||||
|
min-height: 25px;
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.score-row > view:first-child > text {
|
.score-row > view:first-child > text {
|
||||||
margin-left: 20px;
|
|
||||||
color: #fff;
|
color: #fff;
|
||||||
display: block;
|
display: block;
|
||||||
width: 30px;
|
width: 35px;
|
||||||
}
|
}
|
||||||
.score-row > image:last-child {
|
.score-row > image:last-child {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
}
|
}
|
||||||
.score-row > view:last-child {
|
.score-row > view:nth-child(2) {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
.score-row > view:last-child > text:last-child {
|
.score-row > view:nth-child(2) > text:last-child {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ onShow(async () => {
|
|||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<Avatar :rankLvl="user.rankLvl" :src="user.avatar" :size="30" />
|
<Avatar :rankLvl="user.rankLvl" :src="user.avatar" :size="30" />
|
||||||
<text>{{ user.nickName }}</text>
|
<text class="truncate">{{ user.nickName }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<text>已练习打卡</text>
|
<text>已练习打卡</text>
|
||||||
@@ -127,6 +127,7 @@ onShow(async () => {
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
|
width: 120px;
|
||||||
}
|
}
|
||||||
.practise-data > view:first-child > view:last-child > text:nth-child(2) {
|
.practise-data > view:first-child > view:last-child > text:nth-child(2) {
|
||||||
color: #f7d247;
|
color: #f7d247;
|
||||||
|
|||||||
@@ -16,22 +16,28 @@ const addBg = ref("");
|
|||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
|
const menuBtnInfo = uni.getMenuButtonBoundingClientRect();
|
||||||
capsuleHeight.value = menuBtnInfo.top - 9;
|
capsuleHeight.value = menuBtnInfo.top - 9;
|
||||||
currentList.value = rankData.value.rank;
|
handleSelect(0);
|
||||||
if (rankData.value.myRankPos) myData.value = rankData.value.myRankPos;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleSelect = (index) => {
|
const handleSelect = (index) => {
|
||||||
selectedIndex.value = index;
|
selectedIndex.value = index;
|
||||||
|
myData.value = {};
|
||||||
|
currentList.value = [];
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
currentList.value = rankData.value.rank;
|
currentList.value = rankData.value.rank;
|
||||||
if (rankData.value.myRankPos) myData.value = rankData.value.myRankPos;
|
} else if (index === 1) {
|
||||||
|
currentList.value = rankData.value.mvpRank;
|
||||||
} else if (index === 2) {
|
} else if (index === 2) {
|
||||||
currentList.value = rankData.value.ringRank;
|
currentList.value = rankData.value.ringRank;
|
||||||
if (rankData.value.myRingRankPos)
|
}
|
||||||
myData.value = rankData.value.myRingRankPos;
|
if (user.value.id) {
|
||||||
} else {
|
currentList.value.some((item) => {
|
||||||
myData.value = {};
|
if (item.userId === user.value.id) {
|
||||||
currentList.value = [];
|
myData.value = item;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,6 +149,11 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
|||||||
>{{ item.totalScore }} </text
|
>{{ item.totalScore }} </text
|
||||||
>分
|
>分
|
||||||
</text>
|
</text>
|
||||||
|
<text class="rank-item-integral" v-if="selectedIndex === 1">
|
||||||
|
<text :style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||||
|
>{{ item.mvpCount }} </text
|
||||||
|
>次
|
||||||
|
</text>
|
||||||
<text class="rank-item-integral" v-if="selectedIndex === 2">
|
<text class="rank-item-integral" v-if="selectedIndex === 2">
|
||||||
<text :style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
<text :style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||||
>{{ item.TenRings }} </text
|
>{{ item.TenRings }} </text
|
||||||
@@ -164,18 +175,24 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"];
|
|||||||
<text class="truncate">{{ user.nickName }}</text>
|
<text class="truncate">{{ user.nickName }}</text>
|
||||||
<text>{{ user.lvlName }},{{ myData.TotalGames }}场</text>
|
<text>{{ user.lvlName }},{{ myData.TotalGames }}场</text>
|
||||||
</view>
|
</view>
|
||||||
|
<text class="rank-item-integral" v-if="selectedIndex === 0">
|
||||||
|
<text
|
||||||
|
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||||
|
>{{ myData.totalScore }}</text
|
||||||
|
>次</text
|
||||||
|
>
|
||||||
|
<text class="rank-item-integral" v-if="selectedIndex === 1">
|
||||||
|
<text
|
||||||
|
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||||
|
>{{ myData.TotalGames }}</text
|
||||||
|
>次</text
|
||||||
|
>
|
||||||
<text class="rank-item-integral" v-if="selectedIndex === 2">
|
<text class="rank-item-integral" v-if="selectedIndex === 2">
|
||||||
<text
|
<text
|
||||||
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
||||||
>{{ rankData.myRankPos.TenRings }}</text
|
>{{ myData.TenRings }}</text
|
||||||
>次</text
|
>次</text
|
||||||
>
|
>
|
||||||
<text class="rank-item-integral" v-else>
|
|
||||||
<text
|
|
||||||
:style="{ fontSize: '14px', color: '#fff', marginRight: '5px' }"
|
|
||||||
>{{ rankData.myRingRankPos.totalScore }}</text
|
|
||||||
>分</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ const handleSelect = (index) => {
|
|||||||
selectedIndex.value = index;
|
selectedIndex.value = index;
|
||||||
if (index === 0 && rankData.value.rank) {
|
if (index === 0 && rankData.value.rank) {
|
||||||
currentList.value = rankData.value.rank.slice(0, 10);
|
currentList.value = rankData.value.rank.slice(0, 10);
|
||||||
|
} else if (index === 1 && rankData.value.mvpRank) {
|
||||||
|
currentList.value = rankData.value.mvpRank.slice(0, 10);
|
||||||
} else if (index === 2 && rankData.value.ringRank) {
|
} else if (index === 2 && rankData.value.ringRank) {
|
||||||
currentList.value = rankData.value.ringRank.slice(0, 10);
|
currentList.value = rankData.value.ringRank.slice(0, 10);
|
||||||
} else {
|
} else {
|
||||||
@@ -139,12 +141,12 @@ onShow(async () => {
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="ranking-season"
|
class="ranking-season"
|
||||||
v-if="seasonData.length"
|
v-show="seasonData.length"
|
||||||
@click.stop="() => (showSeasonList = true)"
|
@click.stop="() => (showSeasonList = true)"
|
||||||
>
|
>
|
||||||
<text>{{ seasonName }}</text>
|
<text>{{ seasonName }}</text>
|
||||||
<image
|
<image
|
||||||
v-if="seasonData.length > 1"
|
v-show="seasonData.length > 1"
|
||||||
src="../static/triangle.png"
|
src="../static/triangle.png"
|
||||||
mode="widthFix"
|
mode="widthFix"
|
||||||
/>
|
/>
|
||||||
@@ -355,6 +357,9 @@ onShow(async () => {
|
|||||||
<text v-if="selectedIndex === 0">
|
<text v-if="selectedIndex === 0">
|
||||||
{{ item.totalScore }}<text>分</text>
|
{{ item.totalScore }}<text>分</text>
|
||||||
</text>
|
</text>
|
||||||
|
<text v-if="selectedIndex === 1">
|
||||||
|
{{ item.mvpCount }}<text>次</text>
|
||||||
|
</text>
|
||||||
<text v-if="selectedIndex === 2">
|
<text v-if="selectedIndex === 2">
|
||||||
{{ item.TenRings }}<text>次</text>
|
{{ item.TenRings }}<text>次</text>
|
||||||
</text>
|
</text>
|
||||||
@@ -417,6 +422,7 @@ onShow(async () => {
|
|||||||
}
|
}
|
||||||
.ranking-season > image {
|
.ranking-season > image {
|
||||||
width: 12px;
|
width: 12px;
|
||||||
|
height: 12px;
|
||||||
}
|
}
|
||||||
.ranking-season > text {
|
.ranking-season > text {
|
||||||
color: #ffd947;
|
color: #ffd947;
|
||||||
@@ -463,6 +469,7 @@ onShow(async () => {
|
|||||||
}
|
}
|
||||||
.battle-types > image {
|
.battle-types > image {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
height: 14vw;
|
||||||
}
|
}
|
||||||
.data-progress {
|
.data-progress {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ const start = ref(false);
|
|||||||
const tips = ref("");
|
const tips = ref("");
|
||||||
const battleId = ref("");
|
const battleId = ref("");
|
||||||
const currentRound = ref(1);
|
const currentRound = ref(1);
|
||||||
|
const goldenRound = ref(0);
|
||||||
const currentRedPoint = ref(0);
|
const currentRedPoint = ref(0);
|
||||||
const currentBluePoint = ref(0);
|
const currentBluePoint = ref(0);
|
||||||
const totalRounds = ref(0);
|
const totalRounds = ref(0);
|
||||||
@@ -105,6 +106,7 @@ function recoverData(battleInfo) {
|
|||||||
const { ShotCount, RedRecords, BlueRecords } = battleInfo.goldenRound;
|
const { ShotCount, RedRecords, BlueRecords } = battleInfo.goldenRound;
|
||||||
const roundCount = Math.max(RedRecords.length, BlueRecords.length);
|
const roundCount = Math.max(RedRecords.length, BlueRecords.length);
|
||||||
currentRound.value += roundCount;
|
currentRound.value += roundCount;
|
||||||
|
goldenRound.value += roundCount;
|
||||||
isFinalShoot.value = true;
|
isFinalShoot.value = true;
|
||||||
for (let i = 0; i < roundCount; i++) {
|
for (let i = 0; i < roundCount; i++) {
|
||||||
const roundData = {
|
const roundData = {
|
||||||
@@ -112,6 +114,7 @@ function recoverData(battleInfo) {
|
|||||||
RedRecords && RedRecords[i] ? RedRecords[i].Arrows || [] : [],
|
RedRecords && RedRecords[i] ? RedRecords[i].Arrows || [] : [],
|
||||||
blueArrows:
|
blueArrows:
|
||||||
BlueRecords && BlueRecords[i] ? BlueRecords[i].Arrows || [] : [],
|
BlueRecords && BlueRecords[i] ? BlueRecords[i].Arrows || [] : [],
|
||||||
|
gold: true,
|
||||||
};
|
};
|
||||||
if (roundResults.value[5 + i]) {
|
if (roundResults.value[5 + i]) {
|
||||||
roundResults.value[5 + i] = roundData;
|
roundResults.value[5 + i] = roundData;
|
||||||
@@ -167,14 +170,13 @@ async function onReceiveMessage(messages = []) {
|
|||||||
const redPlayer = redTeam.value.find(
|
const redPlayer = redTeam.value.find(
|
||||||
(item) => item.id === currentShooterId.value
|
(item) => item.id === currentShooterId.value
|
||||||
);
|
);
|
||||||
tips.value = redPlayer ? "请红队射箭" : "请蓝队射箭";
|
const nextTips = redPlayer ? "请红队射箭" : "请蓝队射箭";
|
||||||
uni.$emit("update-tips", tips.value);
|
if (nextTips !== tips.value) {
|
||||||
// if (redPlayer) tips.value = "红队" + redPlayer.id;
|
tips.value = nextTips;
|
||||||
// const bluePlayer = blueTeam.value.find(
|
uni.$emit("update-tips", tips.value);
|
||||||
// (item) => item.id === currentShooterId.value
|
} else {
|
||||||
// );
|
uni.$emit("update-ramain", 15);
|
||||||
// if (bluePlayer) tips.value = "蓝队" + bluePlayer.id;
|
}
|
||||||
uni.$emit("update-tips", tips.value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||||
@@ -186,6 +188,7 @@ async function onReceiveMessage(messages = []) {
|
|||||||
roundResults.value.push({
|
roundResults.value.push({
|
||||||
redArrows: [],
|
redArrows: [],
|
||||||
blueArrows: [],
|
blueArrows: [],
|
||||||
|
gold: goldenRound.value > 0,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
roundResults.value[currentRound.value - 1][
|
roundResults.value[currentRound.value - 1][
|
||||||
@@ -212,11 +215,13 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}
|
}
|
||||||
if (msg.constructor === MESSAGETYPES.FinalShoot) {
|
if (msg.constructor === MESSAGETYPES.FinalShoot) {
|
||||||
currentShooterId.value = 0;
|
currentShooterId.value = 0;
|
||||||
currentRound.value += 1;
|
goldenRound.value += 1;
|
||||||
roundResults.value.push({
|
roundResults.value.push({
|
||||||
redArrows: [],
|
redArrows: [],
|
||||||
blueArrows: [],
|
blueArrows: [],
|
||||||
});
|
});
|
||||||
|
currentBluePoint.value = bluePoints.value;
|
||||||
|
currentRedPoint.value = redPoints.value;
|
||||||
if (!isFinalShoot.value) {
|
if (!isFinalShoot.value) {
|
||||||
isFinalShoot.value = true;
|
isFinalShoot.value = true;
|
||||||
showRoundTip.value = true;
|
showRoundTip.value = true;
|
||||||
@@ -308,7 +313,12 @@ onHide(() => {
|
|||||||
:isRed="false"
|
:isRed="false"
|
||||||
:currentShooterId="currentShooterId"
|
:currentShooterId="currentShooterId"
|
||||||
/>
|
/>
|
||||||
<ShootProgress2 :tips="tips" :currentRound="'round' + currentRound" />
|
<ShootProgress2
|
||||||
|
:tips="tips"
|
||||||
|
:currentRound="
|
||||||
|
goldenRound > 0 ? 'gold' + goldenRound : 'round' + currentRound
|
||||||
|
"
|
||||||
|
/>
|
||||||
<TeamAvatars :team="redTeam" :currentShooterId="currentShooterId" />
|
<TeamAvatars :team="redTeam" :currentShooterId="currentShooterId" />
|
||||||
</view>
|
</view>
|
||||||
<BowTarget
|
<BowTarget
|
||||||
@@ -323,6 +333,7 @@ onHide(() => {
|
|||||||
:roundResults="roundResults"
|
:roundResults="roundResults"
|
||||||
:redPoints="redPoints"
|
:redPoints="redPoints"
|
||||||
:bluePoints="bluePoints"
|
:bluePoints="bluePoints"
|
||||||
|
:goldenRound="goldenRound"
|
||||||
:power="power"
|
:power="power"
|
||||||
/>
|
/>
|
||||||
<Timer v-if="!start" />
|
<Timer v-if="!start" />
|
||||||
|
|||||||
@@ -12,27 +12,36 @@ const blueScores = ref([]);
|
|||||||
const tabs = ref(["所有轮次"]);
|
const tabs = ref(["所有轮次"]);
|
||||||
const players = ref([]);
|
const players = ref([]);
|
||||||
const allRoundsScore = ref({});
|
const allRoundsScore = ref({});
|
||||||
const data = ref({});
|
const data = ref({
|
||||||
|
goldenRounds: [],
|
||||||
|
});
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if (!options.battleId) {
|
if (options.battleId) {
|
||||||
const result = await getGameAPI(
|
const result = await getGameAPI(
|
||||||
options.battleId || "BATTLE-1754988051086075885-926"
|
options.battleId || "BATTLE-1755484626207409508-955"
|
||||||
);
|
);
|
||||||
data.value = result;
|
data.value = result;
|
||||||
if (result.winner === 0) {
|
Object.values(result.bluePlayers).forEach((p, index) => {
|
||||||
players.value = [
|
players.value.push(p);
|
||||||
...Object.values(result.redPlayers),
|
if (
|
||||||
...Object.values(result.bluePlayers),
|
Object.values(result.redPlayers) &&
|
||||||
];
|
Object.values(result.redPlayers)[index]
|
||||||
} else if (result.winner === 1) {
|
) {
|
||||||
players.value = [
|
players.value.push(Object.values(result.redPlayers)[index]);
|
||||||
...Object.values(result.bluePlayers),
|
}
|
||||||
...Object.values(result.redPlayers),
|
});
|
||||||
];
|
if (result.goldenRounds) {
|
||||||
|
result.goldenRounds.forEach(() => {
|
||||||
|
tabs.value.push("决金箭");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
if (result.goldenRound) tabs.value.push("决金箭");
|
Object.keys(result.roundsData).forEach((key, index) => {
|
||||||
Object.keys(result.roundsData).forEach((key) => {
|
if (
|
||||||
tabs.value.push(`第${roundsName[key]}轮`);
|
index <
|
||||||
|
Object.keys(result.roundsData).length - result.goldenRounds.length
|
||||||
|
) {
|
||||||
|
tabs.value.push(`第${roundsName[key]}轮`);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
onClickTab(0);
|
onClickTab(0);
|
||||||
}
|
}
|
||||||
@@ -41,11 +50,13 @@ const onClickTab = (index) => {
|
|||||||
selected.value = index;
|
selected.value = index;
|
||||||
redScores.value = [];
|
redScores.value = [];
|
||||||
blueScores.value = [];
|
blueScores.value = [];
|
||||||
const { bluePlayers, redPlayers, roundsData, goldenRound } = data.value;
|
const { bluePlayers, redPlayers, roundsData, goldenRounds } = data.value;
|
||||||
|
let maxArrowLength = 0;
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
Object.keys(bluePlayers).forEach((p) => {
|
Object.keys(bluePlayers).forEach((p) => {
|
||||||
allRoundsScore.value[p] = [];
|
allRoundsScore.value[p] = [];
|
||||||
Object.values(roundsData).forEach((round) => {
|
Object.values(roundsData).forEach((round) => {
|
||||||
|
if (!round[p]) return;
|
||||||
allRoundsScore.value[p].push(
|
allRoundsScore.value[p].push(
|
||||||
round[p].reduce((last, next) => last + next.ring, 0)
|
round[p].reduce((last, next) => last + next.ring, 0)
|
||||||
);
|
);
|
||||||
@@ -57,6 +68,7 @@ const onClickTab = (index) => {
|
|||||||
Object.keys(redPlayers).forEach((p) => {
|
Object.keys(redPlayers).forEach((p) => {
|
||||||
allRoundsScore.value[p] = [];
|
allRoundsScore.value[p] = [];
|
||||||
Object.values(roundsData).forEach((round) => {
|
Object.values(roundsData).forEach((round) => {
|
||||||
|
if (!round[p]) return;
|
||||||
allRoundsScore.value[p].push(
|
allRoundsScore.value[p].push(
|
||||||
round[p].reduce((last, next) => last + next.ring, 0)
|
round[p].reduce((last, next) => last + next.ring, 0)
|
||||||
);
|
);
|
||||||
@@ -65,20 +77,29 @@ const onClickTab = (index) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (index === 1 && goldenRound) {
|
} else if (index <= goldenRounds.length) {
|
||||||
if (goldenRound.winner === 1) {
|
const dataIndex =
|
||||||
blueScores.value = goldenRound.arrowHistory;
|
Object.keys(roundsData).length - goldenRounds.length + index;
|
||||||
} else {
|
|
||||||
redScores.value = goldenRound.arrowHistory;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Object.keys(bluePlayers).forEach((p) => {
|
Object.keys(bluePlayers).forEach((p) => {
|
||||||
roundsData[goldenRound ? index - 1 : index][p].forEach((arrow) => {
|
if (!roundsData[dataIndex][p]) return;
|
||||||
|
roundsData[dataIndex][p].forEach((arrow) => {
|
||||||
blueScores.value.push(arrow);
|
blueScores.value.push(arrow);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Object.keys(redPlayers).forEach((p) => {
|
Object.keys(redPlayers).forEach((p) => {
|
||||||
roundsData[goldenRound ? index - 1 : index][p].forEach((arrow) => {
|
if (!roundsData[dataIndex][p]) return;
|
||||||
|
roundsData[dataIndex][p].forEach((arrow) => {
|
||||||
|
redScores.value.push(arrow);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
Object.keys(bluePlayers).forEach((p) => {
|
||||||
|
roundsData[index - goldenRounds.length][p].forEach((arrow) => {
|
||||||
|
blueScores.value.push(arrow);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Object.keys(redPlayers).forEach((p) => {
|
||||||
|
roundsData[index - goldenRounds.length][p].forEach((arrow) => {
|
||||||
redScores.value.push(arrow);
|
redScores.value.push(arrow);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -129,25 +150,23 @@ const onClickTab = (index) => {
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="
|
v-if="
|
||||||
selected === 1 &&
|
selected >= data.goldenRounds.length &&
|
||||||
data.goldenRound &&
|
selected <= data.goldenRounds.length
|
||||||
data.goldenRound.arrowHistory.find(
|
|
||||||
(a) => a.playerId === player.playerId
|
|
||||||
)
|
|
||||||
"
|
"
|
||||||
v-for="(score, index) in data.goldenRound.arrowHistory"
|
v-for="(score, index) in data.roundsData[
|
||||||
|
Object.keys(data.roundsData).length -
|
||||||
|
data.goldenRounds.length +
|
||||||
|
selected
|
||||||
|
][player.playerId]"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="score-item"
|
class="score-item"
|
||||||
>
|
>
|
||||||
{{ score.ring }}
|
{{ score.ring }}
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-if="
|
v-if="selected > data.goldenRounds.length"
|
||||||
(!data.goldenRound && selected > 0) ||
|
|
||||||
(data.goldenRound && selected > 1)
|
|
||||||
"
|
|
||||||
v-for="(score, index) in data.roundsData[
|
v-for="(score, index) in data.roundsData[
|
||||||
data.goldenRound ? selected - 1 : selected
|
selected - data.goldenRounds.length
|
||||||
][player.playerId]"
|
][player.playerId]"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="score-item"
|
class="score-item"
|
||||||
@@ -198,13 +217,17 @@ const onClickTab = (index) => {
|
|||||||
.score-row {
|
.score-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
margin-left: 15px;
|
margin-bottom: 5px;
|
||||||
|
width: calc(50% - 5px);
|
||||||
|
padding-left: 5px;
|
||||||
}
|
}
|
||||||
.score-row > view:last-child {
|
.score-row > view:last-child {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, auto);
|
grid-template-columns: repeat(3, auto);
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
|
margin-right: 5px;
|
||||||
|
min-width: 26%;
|
||||||
}
|
}
|
||||||
.score-item {
|
.score-item {
|
||||||
background-image: url("../static/score-bg.png");
|
background-image: url("../static/score-bg.png");
|
||||||
@@ -220,8 +243,8 @@ const onClickTab = (index) => {
|
|||||||
height: 10vw;
|
height: 10vw;
|
||||||
}
|
}
|
||||||
.score-container {
|
.score-container {
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
flex-wrap: wrap;
|
||||||
row-gap: 15px;
|
width: 100%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 113 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 52 KiB |
@@ -14,7 +14,8 @@ function createWebSocket(token, onMessage) {
|
|||||||
|
|
||||||
switch (envVersion) {
|
switch (envVersion) {
|
||||||
case "develop": // 开发版
|
case "develop": // 开发版
|
||||||
url = "ws://192.168.1.242:8000/socket";
|
// url = "ws://192.168.1.242:8000/socket";
|
||||||
|
url = "wss://apitest.shelingxingqiu.com/socket";
|
||||||
break;
|
break;
|
||||||
case "trial": // 体验版
|
case "trial": // 体验版
|
||||||
url = "wss://apitest.shelingxingqiu.com/socket";
|
url = "wss://apitest.shelingxingqiu.com/socket";
|
||||||
|
|||||||