细节调整
This commit is contained in:
@@ -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,34 +97,37 @@ function calcRealY(num) {
|
||||
class="round-tip fade-in"
|
||||
>{{ scores[scores.length - 1].ring }}<text>环</text></view
|
||||
>
|
||||
<image
|
||||
v-for="(bow, index) in scores"
|
||||
:key="index"
|
||||
:src="
|
||||
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||
? '../static/hit-icon-green.png'
|
||||
: '../static/hit-icon.png'
|
||||
"
|
||||
:class="`hit ${
|
||||
index + 1 === scores.length && !blueScores.length && showLatestArrow
|
||||
? 'pump-in'
|
||||
: ''
|
||||
}`"
|
||||
:style="{
|
||||
left: calcRealX(bow.x),
|
||||
top: calcRealY(bow.y),
|
||||
}"
|
||||
/>
|
||||
<image
|
||||
v-for="(bow, index) in blueScores"
|
||||
:key="index"
|
||||
src="../static/hit-icon-blue.png"
|
||||
class="hit"
|
||||
:style="{
|
||||
left: calcRealX(bow.x),
|
||||
top: calcRealY(bow.y),
|
||||
}"
|
||||
/>
|
||||
<block v-for="(bow, index) in scores" :key="index">
|
||||
<image
|
||||
v-if="bow.ring > 0"
|
||||
:src="
|
||||
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||
? '../static/hit-icon-green.png'
|
||||
: '../static/hit-icon.png'
|
||||
"
|
||||
:class="`hit ${
|
||||
index + 1 === scores.length && !blueScores.length && showLatestArrow
|
||||
? 'pump-in'
|
||||
: ''
|
||||
}`"
|
||||
:style="{
|
||||
left: calcRealX(bow.x),
|
||||
top: calcRealY(bow.y),
|
||||
}"
|
||||
/>
|
||||
</block>
|
||||
<block v-for="(bow, index) in blueScores" :key="index">
|
||||
<image
|
||||
v-if="bow.ring > 0"
|
||||
src="../static/hit-icon-blue.png"
|
||||
class="hit"
|
||||
:style="{
|
||||
left: calcRealX(bow.x),
|
||||
top: calcRealY(bow.y),
|
||||
}"
|
||||
/>
|
||||
</block>
|
||||
|
||||
<image src="../static/bow-target.png" mode="widthFix" />
|
||||
</view>
|
||||
<view v-if="avatar" class="footer">
|
||||
|
||||
@@ -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