细节调整

This commit is contained in:
kron
2025-11-10 09:26:51 +08:00
parent 571073d7ec
commit 2cf55dcdde
2 changed files with 8 additions and 3 deletions

View File

@@ -23,6 +23,7 @@ watch(
() => tips.value,
(newVal) => {
let key = "";
if (newVal.includes("重回")) return;
if (newVal.includes("红队")) key = "请红方射箭";
if (newVal.includes("蓝队")) key = "请蓝方射箭";
if (!sound.value) return;
@@ -155,7 +156,7 @@ onBeforeUnmount(() => {
<template>
<view class="container">
<text>{{ (tips || "").replace(/你/g, "") }}</text>
<text>{{ (tips || "").replace(/你/g, "").replace(/重回/g, "") }}</text>
<text v-if="totalShot > 0"> ({{ currentShot }}/{{ totalShot }}) </text>
<button v-if="!!tips" hover-class="none" @click="updateSound">
<image

View File

@@ -171,7 +171,8 @@ function recoverData(battleInfo) {
(item) => item.id === currentShooterId.value
);
let nextTips = redPlayer ? "请红队射箭" : "请蓝队射箭";
if (battleInfo.firePlayerIndex === user.value.id) nextTips += "";
nextTips += "重回";
// if (battleInfo.firePlayerIndex === user.value.id) nextTips += "你";
tips.value = nextTips;
uni.$emit("update-tips", nextTips);
}
@@ -199,8 +200,11 @@ async function onReceiveMessage(messages = []) {
const redPlayer = redTeam.value.find(
(item) => item.id === currentShooterId.value
);
let nextTips = redPlayer ? "请红队射箭" : "请蓝队射箭";
if (msg.userId === user.value.id) nextTips += "你";
if (msg.userId === user.value.id && redTeam.value.length > 1) {
nextTips += "你";
}
if (nextTips !== tips.value) {
tips.value = nextTips;
uni.$emit("update-tips", tips.value);