细节调整

This commit is contained in:
kron
2025-06-17 19:35:21 +08:00
parent 28e3d49e57
commit ab8aa08a35
5 changed files with 55 additions and 44 deletions

View File

@@ -38,6 +38,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
showE: {
type: Boolean,
default: true,
},
});
const showRoundTips = ref(false);
@@ -84,7 +88,7 @@ function calcRealY(num) {
</view>
<view class="target">
<view
v-if="scores.length && showRoundTips && showLatestArrow"
v-if="scores.length && showRoundTips && showLatestArrow && showE"
class="e-value fade-in"
>经验 +1</view
>
@@ -93,9 +97,9 @@ function calcRealY(num) {
class="round-tip fade-in"
>{{ scores[scores.length - 1].ring }}<text></text></view
>
<block v-for="(bow, index) in scores" :key="index">
<image
v-for="(bow, index) in scores"
:key="index"
v-if="bow.ring > 0"
:src="
index === scores.length - 1 && !blueScores.length && showLatestArrow
? '../static/hit-icon-green.png'
@@ -111,9 +115,10 @@ function calcRealY(num) {
top: calcRealY(bow.y),
}"
/>
</block>
<block v-for="(bow, index) in blueScores" :key="index">
<image
v-for="(bow, index) in blueScores"
:key="index"
v-if="bow.ring > 0"
src="../static/hit-icon-blue.png"
class="hit"
:style="{
@@ -121,6 +126,8 @@ function calcRealY(num) {
top: calcRealY(bow.y),
}"
/>
</block>
<image src="../static/bow-target.png" mode="widthFix" />
</view>
<view v-if="avatar" class="footer">

View File

@@ -36,20 +36,17 @@ onLoad((options) => {
teamSize.value = options.teamSize;
});
async function startMatch() {
if (gameType.value && teamSize.value) {
await matchGameAPI(true, gameType.value, teamSize.value);
startMatch.value = true;
}
matching.value = true;
}
async function stopMatch() {
if (gameType.value && teamSize.value) {
await matchGameAPI(false, gameType.value, teamSize.value);
startMatch.value = false;
}
matching.value = false;
}
async function readyToGo() {
if (battleId.value) {
await readyGameAPI(battleId.value);
scores.value = [];
start.value = true;
timerSeq.value = 0;
}
@@ -118,7 +115,7 @@ onUnmounted(() => {
<Container title="大乱斗排位赛" :bgType="1">
<view class="container">
<BattleHeader v-if="!start && players.length" :players="players" />
<Guide noBg v-if="!start">
<Guide noBg v-if="!start && matching">
<view :style="{ display: 'flex', justifyContent: 'space-between' }">
<view :style="{ display: 'flex', flexDirection: 'column' }">
<text :style="{ color: '#fed847' }">请预先射几箭测试</text>
@@ -128,13 +125,15 @@ onUnmounted(() => {
</view>
</Guide>
<ShootProgress v-if="start" :seq="seq" :start="start" :tips="tips" />
<view class="infos">
<view v-if="start" class="infos">
<Avatar :src="user.avatar" :size="35" />
<BowPower :power="power" />
</view>
<BowTarget
v-if="matching"
:showE="start"
:currentRound="scores.length"
:totalRound="12"
:totalRound="start ? 12 : 0"
:scores="scores"
/>
<PlayerScore

View File

@@ -25,6 +25,7 @@ const power = ref(0);
const onReady = async () => {
await createPractiseAPI(total);
start.value = true;
currentRound.value = 0;
scores.value = [];
};
@@ -82,7 +83,7 @@ onUnmounted(() => {
<BowPower :power="power" />
</view>
<BowTarget
:totalRound="total / 4"
:totalRound="start ? total / 4 : 0"
:currentRound="currentRound"
:scores="scores"
:tips="

View File

@@ -18,12 +18,14 @@ const start = ref(false);
const showScore = ref(false);
const scores = ref([]);
const total = 36;
const currentRound = ref(0);
const practiseResult = ref({});
const power = ref(0);
const onReady = async () => {
await createPractiseAPI(total);
start.value = true;
currentRound.value = 0;
scores.value = [];
};
@@ -33,6 +35,7 @@ async function onReceiveMessage(content) {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
power.value = msg.target.battery;
currentRound.value += 1;
if (scores.value.length === total) {
showScore.value = true;
}
@@ -73,8 +76,8 @@ onUnmounted(() => {
<BowPower :power="power" />
</view>
<BowTarget
:totalRound="total"
:currentRound="scores.length + 1"
:totalRound="start ? total : 0"
:currentRound="currentRound"
:scores="scores"
:tips="
!start && scores.length > 0

View File

@@ -146,7 +146,7 @@ onUnmounted(() => {
:redTeam="redTeam"
:blueTeam="blueTeam"
/>
<Guide noBg v-if="!start">
<Guide noBg v-if="!start && startMatch.value">
<view :style="{ display: 'flex', justifyContent: 'space-between' }">
<view :style="{ display: 'flex', flexDirection: 'column' }">
<text :style="{ color: '#fed847' }">请预先射几箭测试</text>
@@ -163,6 +163,7 @@ onUnmounted(() => {
:redTeam="redTeam"
/>
<BowTarget
v-if="startMatch.value"
:showE="start && user.id === currentShooterId"
:power="start ? power : 0"
:currentRound="currentRound"