信息完善

This commit is contained in:
kron
2025-07-17 13:55:04 +08:00
parent 9ab54b6740
commit bb3d251041
7 changed files with 89 additions and 56 deletions

View File

@@ -57,7 +57,7 @@ class AudioManager {
// 监听加载状态 // 监听加载状态
audio.onCanplay(() => { audio.onCanplay(() => {
console.log(`音频 ${key} 已加载完成`); // console.log(`音频 ${key} 已加载完成`);
}); });
audio.onError((res) => { audio.onError((res) => {

View File

@@ -113,20 +113,14 @@ export const getBattleResultTips = (
return tests[getRandomIndex(3)]; return tests[getRandomIndex(3)];
} }
} else if (mode === 2) { } else if (mode === 2) {
if (score > 0) { if (rank <= 3) {
const tests = [ const tests = [
"王者一定属于你!", "好成绩!全国排位赛等着你!",
"高光时刻!继续保持!", "持续练习,就会迎来更多高光时刻!",
"射灵世界的佼佼者!",
]; ];
return tests[getRandomIndex(3)]; return tests[getRandomIndex(2)];
} else { } else {
const tests = [ return "每日练习打卡,争取下次脱颖而出!";
"再来一次,定能脱颖而出!",
"加强练习,争取越战越勇",
"人生走过的每一步都算数",
];
return tests[getRandomIndex(3)];
} }
} }
} else if (gameMode === 2) { } else if (gameMode === 2) {
@@ -147,14 +141,20 @@ export const getBattleResultTips = (
return tests[getRandomIndex(3)]; return tests[getRandomIndex(3)];
} }
} else if (mode === 2) { } else if (mode === 2) {
if (rank <= 3) { if (score > 0) {
const tests = [ const tests = [
"好成绩!全国排位赛等着你!", "王者一定属于你!",
"持续练习,就会迎来更多高光时刻!", "高光时刻!继续保持!",
"射灵世界的佼佼者!",
]; ];
return tests[getRandomIndex(2)]; return tests[getRandomIndex(3)];
} else { } else {
return "每日练习打卡,争取下次脱颖而出!"; const tests = [
"再来一次,定能脱颖而出!",
"加强练习,争取越战越勇",
"人生走过的每一步都算数",
];
return tests[getRandomIndex(3)];
} }
} }
} }

View File

@@ -85,8 +85,18 @@ onLoad(async (options) => {
redTeam.value = battleInfo.redTeam; redTeam.value = battleInfo.redTeam;
blueTeam.value = battleInfo.blueTeam; blueTeam.value = battleInfo.blueTeam;
currentRound.value = battleInfo.currentRound; currentRound.value = battleInfo.currentRound;
bluePoints.value = battleInfo.blueScore; battleInfo.roundResults.forEach((round) => {
redPoints.value = battleInfo.redScore; if (round.blueTotal && round.redTotal) {
if (round.blueTotal === round.redTotal) {
bluePoints.value += 1;
redPoints.value += 1;
} else if (round.blueTotal > round.redTotal) {
bluePoints.value += 2;
} else {
redPoints.value += 2;
}
}
});
totalRounds.value = battleInfo.maxRound; totalRounds.value = battleInfo.maxRound;
roundResults.value = battleInfo.roundResults; roundResults.value = battleInfo.roundResults;
currentShooterId.value = battleInfo.firePlayerIndex; currentShooterId.value = battleInfo.firePlayerIndex;

View File

@@ -185,11 +185,11 @@ const comingSoon = () => {
<view class="region-stats"> <view class="region-stats">
<view <view
v-for="(region, index) in [ v-for="(region, index) in [
'广东', { name: '广东', score: 4291 },
'湖南', { name: '湖南', score: 3095 },
'内蒙', { name: '内蒙', score: 2342 },
'海南', { name: '海南', score: 1812 },
'四川', { name: '四川', score: 1293 },
]" ]"
:key="index" :key="index"
class="region-item" class="region-item"
@@ -221,9 +221,11 @@ const comingSoon = () => {
src="../static/region-5.png" src="../static/region-5.png"
mode="widthFix" mode="widthFix"
/> />
<text>{{ region }}</text> <text>{{ region.name }}</text>
<view> <view>
<text :style="{ color: '#fff', marginRight: '2px' }">2323</text> <text :style="{ color: '#fff', marginRight: '2px' }">{{
region.score
}}</text>
<text>分</text> <text>分</text>
</view> </view>
</view> </view>

View File

@@ -33,20 +33,31 @@ onLoad(async (options) => {
blueId = Object.keys(item)[1]; blueId = Object.keys(item)[1];
redId = Object.keys(item)[0]; redId = Object.keys(item)[0];
} }
let bluePoint = 1;
let redPoint = 1;
const blueTotalRings = item[blueId].reduce((a, b) => a + b.ring, 0);
const redTotalRings = item[redId].reduce((a, b) => a + b.ring, 0);
if (blueTotalRings > redTotalRings) {
bluePoint = 2;
redPoint = 0;
} else if (blueTotalRings < redTotalRings) {
bluePoint = 0;
redPoint = 2;
}
roundsData.value.push({ roundsData.value.push({
blue: { blue: {
name: result.bluePlayers[blueId].name, name: result.bluePlayers[blueId].name,
avatar: result.bluePlayers[blueId].avatar, avatar: result.bluePlayers[blueId].avatar,
arrows: item[blueId], arrows: item[blueId],
totalRing: item[blueId].reduce((a, b) => a + b.ring, 0), totalRing: blueTotalRings,
totalScore: item[blueId].reduce((a, b) => a + b.ringScore, 0), totalScore: bluePoint,
}, },
red: { red: {
name: result.redPlayers[redId].name, name: result.redPlayers[redId].name,
avatar: result.redPlayers[redId].avatar, avatar: result.redPlayers[redId].avatar,
arrows: item[redId], arrows: item[redId],
totalRing: item[redId].reduce((a, b) => a + b.ring, 0), totalRing: redTotalRings,
totalScore: item[redId].reduce((a, b) => a + b.ringScore, 0), totalScore: redPoint,
}, },
}); });
}); });
@@ -76,6 +87,28 @@ const checkBowData = () => {
:redTeam="redTeam" :redTeam="redTeam"
:players="data.players" :players="data.players"
/> />
<view
v-if="data.players && data.players.length"
class="score-header"
:style="{ border: 'none', padding: '5px 15px' }"
>
<text>大乱斗</text>
<view @click="checkBowData">
<text>查看靶纸</text>
<image src="../static/back.png" mode="widthFix" />
</view>
</view>
<PlayerScore2
v-if="data.players && data.players.length"
v-for="(player, index) in data.players"
:key="index"
:name="player.name"
:avatar="player.avatar"
:scores="player.arrowHistory"
:totalScore="player.totalScore"
:totalRing="player.totalRings"
:rank="index + 1"
/>
<block v-if="data.goldenRound"> <block v-if="data.goldenRound">
<view class="score-header"> <view class="score-header">
<text>决金箭轮环数</text> <text>决金箭轮环数</text>
@@ -127,28 +160,6 @@ const checkBowData = () => {
/> />
</view> </view>
</block> </block>
<view
v-if="data.players && data.players.length"
class="score-header"
:style="{ border: 'none', padding: '5px 15px' }"
>
<text>大乱斗</text>
<view @click="checkBowData">
<text>查看靶纸</text>
<image src="../static/back.png" mode="widthFix" />
</view>
</view>
<PlayerScore2
v-if="data.players && data.players.length"
v-for="(player, index) in data.players"
:key="index"
:name="player.name"
:avatar="player.avatar"
:scores="player.arrowHistory"
:totalScore="player.totalScore"
:totalRing="player.totalRings"
:rank="index + 1"
/>
<view <view
v-for="(round, index) in roundsData" v-for="(round, index) in roundsData"
:key="index" :key="index"
@@ -184,9 +195,9 @@ const checkBowData = () => {
</view> </view>
<view> <view>
<text :style="{ color: '#FF6767' }"> <text :style="{ color: '#FF6767' }">
{{ round.blue.totalRing }}环 {{ round.red.totalRing }}环
</text> </text>
<text>得分 {{ round.blue.totalScore }}</text> <text>得分 {{ round.red.totalScore }}</text>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -54,8 +54,18 @@ onLoad(async (options) => {
redTeam.value = battleInfo.redTeam; redTeam.value = battleInfo.redTeam;
blueTeam.value = battleInfo.blueTeam; blueTeam.value = battleInfo.blueTeam;
currentRound.value = battleInfo.currentRound; currentRound.value = battleInfo.currentRound;
bluePoints.value = battleInfo.blueScore; battleInfo.roundResults.forEach((round) => {
redPoints.value = battleInfo.redScore; if (round.blueTotal && round.redTotal) {
if (round.blueTotal === round.redTotal) {
bluePoints.value += 1;
redPoints.value += 1;
} else if (round.blueTotal > round.redTotal) {
bluePoints.value += 2;
} else {
redPoints.value += 2;
}
}
});
totalRounds.value = battleInfo.maxRound; totalRounds.value = battleInfo.maxRound;
roundResults.value = battleInfo.roundResults; roundResults.value = battleInfo.roundResults;
setTimeout(() => { setTimeout(() => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 22 KiB