完成决金箭调试
This commit is contained in:
@@ -23,7 +23,7 @@ const bubbleTypes = [
|
||||
<image
|
||||
v-if="!noBg"
|
||||
:src="bubbleTypes[type]"
|
||||
:style="{ top: type === 2 ? '-5%' : '-12%' }"
|
||||
:style="{ top: type === 2 ? '-6%' : '-12%' }"
|
||||
mode="widthFix"
|
||||
/>
|
||||
<slot />
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { ref, watch, onMounted, onUnmounted } from "vue";
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
isFinal: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
round: {
|
||||
type: Number,
|
||||
@@ -21,15 +21,31 @@ const props = defineProps({
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
onAutoClose: {
|
||||
type: Function,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const count = ref(10);
|
||||
const count = ref(3);
|
||||
const tiemr = ref(null);
|
||||
onMounted(() => {
|
||||
function startCount() {
|
||||
if (tiemr.value) clearInterval(tiemr.value);
|
||||
tiemr.value = setInterval(() => {
|
||||
if (count.value === 0) clearInterval(tiemr.value);
|
||||
else count.value -= 1;
|
||||
if (count.value === 0) {
|
||||
clearInterval(tiemr.value);
|
||||
props.onAutoClose();
|
||||
} else count.value -= 1;
|
||||
}, 1000);
|
||||
}
|
||||
watch(
|
||||
() => [props.isFinal, props.roundData],
|
||||
([n_isFinal, n_roundData]) => {
|
||||
count.value = n_isFinal ? 10 : 3;
|
||||
startCount();
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
startCount();
|
||||
});
|
||||
onUnmounted(() => {
|
||||
if (tiemr.value) clearInterval(tiemr.value);
|
||||
@@ -39,7 +55,7 @@ onUnmounted(() => {
|
||||
<template>
|
||||
<view class="round-end-tip">
|
||||
<text>第{{ round }}轮射击结束</text>
|
||||
<block v-if="type === 0">
|
||||
<block v-if="!isFinal">
|
||||
<view class="point-view1">
|
||||
<text>本轮红队</text>
|
||||
<text>{{
|
||||
@@ -76,7 +92,7 @@ onUnmounted(() => {
|
||||
>分
|
||||
</text>
|
||||
</block>
|
||||
<block v-if="type === 1">
|
||||
<block v-if="isFinal">
|
||||
<view class="point-view2">
|
||||
<text>蓝队</text>
|
||||
<text>{{ bluePoint }}</text>
|
||||
|
||||
@@ -16,7 +16,7 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
const getContentHeight = () => {
|
||||
if (props.mode === "tall") return "47vw";
|
||||
if (props.mode === "tall") return "50vw";
|
||||
if (props.mode === "square") return "74vw";
|
||||
return "36vw";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user