bug修复
This commit is contained in:
@@ -53,6 +53,10 @@ const props = defineProps({
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
default: "solo", // solo 单排,team 双排
|
||||
},
|
||||
});
|
||||
|
||||
const showRoundTips = ref(false);
|
||||
@@ -89,6 +93,23 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.blueScores,
|
||||
(newVal) => {
|
||||
if (newVal.length - prevLength.value === 1) {
|
||||
if (timer.value) clearTimeout(timer.value);
|
||||
showRoundTips.value = true;
|
||||
timer.value = setTimeout(() => {
|
||||
showRoundTips.value = false;
|
||||
}, 1000);
|
||||
}
|
||||
prevLength.value = newVal.length;
|
||||
},
|
||||
{
|
||||
deep: true,
|
||||
}
|
||||
);
|
||||
|
||||
function calcRealX(num) {
|
||||
const len = 20 + num;
|
||||
return `calc(${(len / 40) * 100}% - 10px)`;
|
||||
@@ -124,16 +145,24 @@ const simulShoot = async () => {
|
||||
class="round-tip fade-in"
|
||||
>{{ scores[scores.length - 1].ring }}<text>环</text></view
|
||||
>
|
||||
<view
|
||||
v-if="blueScores.length && showRoundTips && showLatestArrow"
|
||||
class="round-tip fade-in"
|
||||
>{{ blueScores[blueScores.length - 1].ring }}<text>环</text></view
|
||||
>
|
||||
<block v-for="(bow, index) in scores" :key="index">
|
||||
<image
|
||||
v-if="bow.ring > 0"
|
||||
:src="
|
||||
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||
index === scores.length - 1 &&
|
||||
!blueScores.length &&
|
||||
showLatestArrow &&
|
||||
mode !== 'team'
|
||||
? '../static/hit-icon-green.png'
|
||||
: '../static/hit-icon.png'
|
||||
"
|
||||
:class="`hit ${
|
||||
index + 1 === scores.length && !blueScores.length && showLatestArrow
|
||||
index === scores.length - 1 && !blueScores.length && showLatestArrow
|
||||
? 'pump-in'
|
||||
: ''
|
||||
}`"
|
||||
@@ -148,6 +177,7 @@ const simulShoot = async () => {
|
||||
v-if="bow.ring > 0"
|
||||
src="../static/hit-icon-blue.png"
|
||||
class="hit"
|
||||
:class="`hit ${blueScores.length === 1 ? 'pump-in' : ''}`"
|
||||
:style="{
|
||||
left: calcRealX(bow.x),
|
||||
top: calcRealY(bow.y),
|
||||
|
||||
@@ -75,7 +75,7 @@ watch(
|
||||
clearInterval(timer.value);
|
||||
setTimeout(() => {
|
||||
newVal();
|
||||
}, 1000);
|
||||
}, 2000);
|
||||
} else {
|
||||
totalTop.value += 0.5;
|
||||
}
|
||||
@@ -117,7 +117,7 @@ onUnmounted(() => {
|
||||
v-for="(name, index) in playerNames"
|
||||
:key="index"
|
||||
:style="{
|
||||
lineHeight: `${98 / 7}vw`,
|
||||
lineHeight: `${95 / 7}vw`,
|
||||
...(textStyles[index] || {}),
|
||||
}"
|
||||
>
|
||||
@@ -129,7 +129,7 @@ onUnmounted(() => {
|
||||
v-for="(name, index) in playerNames"
|
||||
:key="index"
|
||||
:style="{
|
||||
lineHeight: `${98 / 7}vw`,
|
||||
lineHeight: `${95 / 7}vw`,
|
||||
...(textStyles[index + 7] || {}),
|
||||
}"
|
||||
>
|
||||
@@ -153,20 +153,19 @@ onUnmounted(() => {
|
||||
}
|
||||
.matching > view {
|
||||
width: 70vw;
|
||||
height: 98vw;
|
||||
height: 95vw;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
transform: translateY(3vw);
|
||||
}
|
||||
.matching-bg {
|
||||
position: absolute;
|
||||
width: 70vw;
|
||||
height: 102vw;
|
||||
top: 30vw;
|
||||
top: 27vw;
|
||||
}
|
||||
.matching > button {
|
||||
width: 55%;
|
||||
margin-top: 20vw;
|
||||
margin-top: 15vw;
|
||||
padding: 18px;
|
||||
color: #000;
|
||||
background-color: #fed847;
|
||||
@@ -175,12 +174,11 @@ onUnmounted(() => {
|
||||
}
|
||||
.player-names {
|
||||
width: 100%;
|
||||
height: 98vw;
|
||||
height: 95vw;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
transform: translateY(3vw);
|
||||
}
|
||||
.player-names > text {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user