细节调整
This commit is contained in:
@@ -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;
|
||||
}
|
||||
await matchGameAPI(true, gameType.value, teamSize.value);
|
||||
matching.value = true;
|
||||
}
|
||||
async function stopMatch() {
|
||||
if (gameType.value && teamSize.value) {
|
||||
await matchGameAPI(false, gameType.value, teamSize.value);
|
||||
startMatch.value = false;
|
||||
}
|
||||
await matchGameAPI(false, gameType.value, teamSize.value);
|
||||
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
|
||||
|
||||
@@ -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="
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user