diff --git a/src/components/BattleHeader.vue b/src/components/BattleHeader.vue
index 03c9b9c..d479966 100644
--- a/src/components/BattleHeader.vue
+++ b/src/components/BattleHeader.vue
@@ -1,9 +1,18 @@
@@ -18,18 +27,12 @@ defineProps({
-
-
-
-
- 选手1
+
+ {{ blueTeam[0].name }}
-
-
-
-
- 选手2
+
+ {{ redTeam[0].name }}
@@ -59,6 +62,7 @@ defineProps({
color: #fff9;
font-size: 14px;
padding-top: 20px;
+ overflow: hidden;
}
.players > view:first-child {
background-color: #364469;
@@ -66,21 +70,4 @@ defineProps({
.players > view:last-child {
background-color: #692735;
}
-.avatar {
- position: relative;
- display: flex;
- align-items: center;
- justify-content: center;
- margin: 5px 0;
-}
-.avatar > image:first-child {
- position: absolute;
- width: 55px;
- height: 55px;
-}
-.avatar > image {
- width: 45px;
- height: 45px;
- border-radius: 50%;
-}
diff --git a/src/components/PlayersRow.vue b/src/components/PlayersRow.vue
index 55044d0..985e962 100644
--- a/src/components/PlayersRow.vue
+++ b/src/components/PlayersRow.vue
@@ -12,15 +12,22 @@ defineProps({
type: Array,
default: () => [],
},
+ currentShooterId: {
+ type: Number,
+ default: 0,
+ },
});
-
+
- {{ item.name }}
+ {{ player.name }}
- {{ item.name }}
+ {{ player.name }}
@@ -104,6 +112,8 @@ defineProps({
}
.container > view > view > text {
margin: 0 10px;
+ overflow: hidden;
+ width: 100px;
}
.avatar {
width: 40px;
diff --git a/src/components/ShootProgress.vue b/src/components/ShootProgress.vue
index 77a27df..cee2bc0 100644
--- a/src/components/ShootProgress.vue
+++ b/src/components/ShootProgress.vue
@@ -13,23 +13,43 @@ const props = defineProps({
type: Number,
default: 90,
},
+ seq: {
+ type: Number,
+ default: 0,
+ },
});
let barColor = "#fed847";
if (props.tips.includes("红队")) barColor = "#FF6060";
if (props.tips.includes("蓝队")) barColor = "#5FADFF";
const remain = ref(props.total);
+const timer = ref(null);
+
+watch(
+ () => props.seq,
+ () => {
+ if (timer.value) clearInterval(timer.value);
+ remain.value = props.total;
+ timer.value = setInterval(() => {
+ if (remain.value > 0) {
+ remain.value--;
+ }
+ }, 1000);
+ }
+);
watch(
() => props.start,
(newVal, oldVal) => {
if (oldVal === false && newVal === true) {
remain.value = props.total;
- setInterval(() => {
+ timer.value = setInterval(() => {
if (remain.value > 0) {
remain.value--;
}
}, 1000);
+ } else {
+ if (timer.value) clearInterval(timer.value);
}
}
);
diff --git a/src/components/Timer.vue b/src/components/Timer.vue
new file mode 100644
index 0000000..039eeb1
--- /dev/null
+++ b/src/components/Timer.vue
@@ -0,0 +1,86 @@
+
+
+
+
+ 距离正式比赛
+
+ 开始还有
+ {{ count }}
+ 秒
+
+
+
+
+
diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue
index 4ea4440..8bdb484 100644
--- a/src/pages/battle-room.vue
+++ b/src/pages/battle-room.vue
@@ -1,5 +1,5 @@
diff --git a/src/pages/match-room.vue b/src/pages/match-room.vue
index 60eb1af..aaaee6b 100644
--- a/src/pages/match-room.vue
+++ b/src/pages/match-room.vue
@@ -1,108 +1,162 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
+