靶子组件优化
This commit is contained in:
@@ -321,8 +321,6 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
|
||||
if (room.value.battleType === 1) {
|
||||
if (currentShooterId.value !== msg.userId) {
|
||||
scores.value = [];
|
||||
blueScores.value = [];
|
||||
seq.value += 1;
|
||||
currentShooterId.value = msg.userId;
|
||||
if (redTeam.value[0].id === currentShooterId.value) {
|
||||
@@ -341,8 +339,8 @@ async function onReceiveMessage(messages = []) {
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
if (room.value.battleType === 1) {
|
||||
const isRed = redTeam.value.find((item) => item.id === msg.userId);
|
||||
if (isRed) scores.value = [msg.target];
|
||||
else blueScores.value = [msg.target];
|
||||
if (isRed) scores.value.push(msg.target);
|
||||
else blueScores.value.push(msg.target);
|
||||
if (roundResults.value[currentRound.value - 1]) {
|
||||
if (isRed && roundResults.value[currentRound.value - 1].redArrows) {
|
||||
roundResults.value[currentRound.value - 1].redArrows.push(
|
||||
@@ -551,7 +549,6 @@ onUnmounted(() => {
|
||||
/>
|
||||
<BowTarget
|
||||
:mode="room.battleType ? 'team' : 'solo'"
|
||||
:showE="start && user.id === currentShooterId"
|
||||
:power="start ? power : 0"
|
||||
:currentRound="currentRound"
|
||||
:totalRound="totalRounds"
|
||||
|
||||
@@ -239,7 +239,6 @@ const onClose = () => {
|
||||
</view>
|
||||
<BowTarget
|
||||
v-if="step === 4"
|
||||
:start="start"
|
||||
:currentRound="step === 4 ? scores.length : 0"
|
||||
:totalRound="step === 4 ? total : 0"
|
||||
:scores="scores"
|
||||
|
||||
@@ -54,7 +54,7 @@ onLoad(async (options) => {
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ marginTop: '10px' }">
|
||||
<BowTarget :scores="scores" :showLatestArrow="false" />
|
||||
<BowTarget :scores="scores" />
|
||||
</view>
|
||||
<view class="score-text"
|
||||
><text :style="{ color: '#fed847' }">{{ scores.length }}</text
|
||||
|
||||
@@ -207,7 +207,6 @@ onUnmounted(() => {
|
||||
</view>
|
||||
<BowTarget
|
||||
v-if="start"
|
||||
:showE="start"
|
||||
:currentRound="scores.length"
|
||||
:totalRound="start ? 12 : 0"
|
||||
:scores="scores"
|
||||
|
||||
@@ -33,7 +33,7 @@ onLoad(async (options) => {
|
||||
</view>
|
||||
</view> -->
|
||||
<view :style="{ marginBottom: '20px' }">
|
||||
<BowTarget :scores="arrows" :showLatestArrow="false" />
|
||||
<BowTarget :scores="arrows" />
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text>{{ arrows.length }}</text>
|
||||
|
||||
@@ -123,7 +123,6 @@ onUnmounted(() => {
|
||||
<BowPower :power="power" />
|
||||
</view>
|
||||
<BowTarget
|
||||
:start="start"
|
||||
:totalRound="start ? total / 4 : 0"
|
||||
:currentRound="currentRound"
|
||||
:scores="scores"
|
||||
|
||||
@@ -117,7 +117,6 @@ onUnmounted(() => {
|
||||
<BowPower :power="power" />
|
||||
</view>
|
||||
<BowTarget
|
||||
:start="start"
|
||||
:currentRound="scores.length"
|
||||
:totalRound="start ? total : 0"
|
||||
:scores="scores"
|
||||
|
||||
@@ -98,11 +98,7 @@ const onClickTab = (index) => {
|
||||
</view>
|
||||
</view>
|
||||
<view :style="{ margin: '20px 0' }">
|
||||
<BowTarget
|
||||
:scores="redScores"
|
||||
:blueScores="blueScores"
|
||||
:showLatestArrow="false"
|
||||
/>
|
||||
<BowTarget :scores="redScores" :blueScores="blueScores" />
|
||||
</view>
|
||||
<view class="score-row" v-for="(player, index) in players" :key="index">
|
||||
<Avatar
|
||||
|
||||
@@ -140,8 +140,6 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
|
||||
if (currentShooterId.value !== msg.userId) {
|
||||
scores.value = [];
|
||||
blueScores.value = [];
|
||||
seq.value += 1;
|
||||
currentShooterId.value = msg.userId;
|
||||
if (redTeam.value[0].id === currentShooterId.value) {
|
||||
@@ -158,8 +156,8 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.ShootResult) {
|
||||
const isRed = redTeam.value.find((item) => item.id === msg.userId);
|
||||
if (isRed) scores.value = [msg.target];
|
||||
else blueScores.value = [msg.target];
|
||||
if (isRed) scores.value.push(msg.target);
|
||||
else blueScores.value.push(msg.target);
|
||||
if (roundResults.value[currentRound.value - 1]) {
|
||||
if (isRed && roundResults.value[currentRound.value - 1].redArrows) {
|
||||
roundResults.value[currentRound.value - 1].redArrows.push(msg.target);
|
||||
@@ -266,7 +264,6 @@ onUnmounted(() => {
|
||||
<BowTarget
|
||||
v-if="start"
|
||||
mode="team"
|
||||
:showE="start && user.id === currentShooterId"
|
||||
:power="start ? power : 0"
|
||||
:currentRound="currentRound"
|
||||
:totalRound="totalRounds"
|
||||
|
||||
Reference in New Issue
Block a user