diff --git a/src/components/BowData.vue b/src/components/BowData.vue
index 01f90bd..256caa9 100644
--- a/src/components/BowData.vue
+++ b/src/components/BowData.vue
@@ -40,7 +40,7 @@ const props = defineProps({
-
+
{{ arrows.length }}
diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue
index f37adf3..c78fbd2 100644
--- a/src/components/BowTarget.vue
+++ b/src/components/BowTarget.vue
@@ -34,14 +34,13 @@ const props = defineProps({
type: Array,
default: () => [],
},
- showE: {
+ showLatestArrow: {
type: Boolean,
default: true,
},
});
const showRoundTips = ref(false);
-const showLatestArrow = ref(false);
const prevLength = ref(0);
const timer = ref(null);
@@ -51,7 +50,6 @@ watch(
if (newVal.length - prevLength.value === 1) {
if (timer.value) clearTimeout(timer.value);
showRoundTips.value = true;
- showLatestArrow.value = true;
timer.value = setTimeout(() => {
showRoundTips.value = false;
}, 1000);
@@ -86,11 +84,13 @@ function calcRealY(num) {
经验 +1
- {{ scores[scores.length - 1].ring }}环
-
+
12支箭,共
-
+
{
+ for (let key in MESSAGETYPES) {
+ if (MESSAGETYPES[key] === id) {
+ return key;
+ }
+ }
+ return null;
};
export const roundsName = {
diff --git a/src/pages/melee-match.vue b/src/pages/melee-match.vue
index 69b388a..7c99f9c 100644
--- a/src/pages/melee-match.vue
+++ b/src/pages/melee-match.vue
@@ -9,8 +9,9 @@ import BattleHeader from "@/components/BattleHeader.vue";
import Timer from "@/components/Timer.vue";
import PlayerScore from "@/components/PlayerScore.vue";
import SButton from "@/components/SButton.vue";
+import Avatar from "@/components/Avatar.vue";
import { matchGameAPI, readyGameAPI } from "@/apis";
-import { MESSAGETYPES } from "@/constants";
+import { MESSAGETYPES, getMessageTypeName } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
@@ -62,7 +63,7 @@ async function onReceiveMessage(content) {
(battleId.value && msg.id === battleId.value) ||
msg.constructor === MESSAGETYPES.WaitForAllReady
) {
- console.log("收到消息:", msg);
+ console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
}
if (msg.constructor === MESSAGETYPES.WaitForAllReady) {
// 这里会掉多次;
@@ -82,11 +83,10 @@ async function onReceiveMessage(content) {
}
if (msg.id !== battleId.value) return;
if (msg.constructor === MESSAGETYPES.MeleeAllReady) {
- totalRounds.value = msg.groupUserStatus.config.maxRounds;
start.value = true;
seq.value += 1;
timerSeq.value = 0;
- tips.value = "请在90秒内射完12支箭";
+ tips.value = "请连续射出6支箭";
scores.value = [];
}
if (msg.constructor === MESSAGETYPES.ShootResult) {
@@ -98,7 +98,7 @@ async function onReceiveMessage(content) {
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
uni.redirectTo({
- url: `/pages/battle-result?battleId=${msg.id}&winner=${msg.endStatus.winner}&gameType=${gameType.value}`,
+ url: `/pages/battle-result?battleId=${msg.id}`,
});
}
});
@@ -128,11 +128,13 @@ onUnmounted(() => {
+
+
+
+
{
.container {
width: 100%;
}
+.infos {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ padding: 0 15px;
+ padding-top: 15px;
+}
diff --git a/src/pages/team-match.vue b/src/pages/team-match.vue
index d0972d4..a2c9f3c 100644
--- a/src/pages/team-match.vue
+++ b/src/pages/team-match.vue
@@ -11,7 +11,7 @@ import Timer from "@/components/Timer.vue";
import BattleFooter from "@/components/BattleFooter.vue";
import SButton from "@/components/SButton.vue";
import { matchGameAPI, readyGameAPI } from "@/apis";
-import { MESSAGETYPES, roundsName } from "@/constants";
+import { MESSAGETYPES, roundsName, getMessageTypeName } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
@@ -73,7 +73,7 @@ async function onReceiveMessage(content) {
(battleId.value && msg.id === battleId.value) ||
msg.constructor === MESSAGETYPES.WaitForAllReady
) {
- console.log("收到消息:", msg);
+ console.log("收到消息:", getMessageTypeName(msg.constructor), msg);
}
if (!start.value && msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);