update:房间新增vip特效

This commit is contained in:
2026-07-10 18:13:41 +08:00
parent 4b39107453
commit 1796d4aa40
5 changed files with 143 additions and 40 deletions
+12 -4
View File
@@ -43,6 +43,10 @@ const props = defineProps({
type: String,
default: "solo", // solo 单排,team 双排
},
missAsZero: {
type: Boolean,
default: false,
},
stop: {
type: Boolean,
default: false,
@@ -78,6 +82,12 @@ const instance = getCurrentInstance();
const ROUND_TIP_OFFSET_Y = -32;
const EXPERIENCE_TIP_OFFSET_Y = -68;
function getRoundText(shot) {
if (shot?.ringX) return "X环";
if (shot?.ring) return `${shot.ring}`;
return props.missAsZero ? "0环" : "未上靶";
}
function buildShotEffectKey(team, shot, index) {
return [
team,
@@ -433,8 +443,7 @@ onBeforeUnmount(() => {
v-if="latestOne"
class="round-tip fade-in-out"
:style="getRoundTipStyle(latestOne)"
>{{ latestOne.ringX ? "X" : latestOne.ring || "未上靶"
}}<text v-if="latestOne.ring"></text>
>{{ getRoundText(latestOne) }}
</view>
<view
v-if="
@@ -451,8 +460,7 @@ onBeforeUnmount(() => {
v-if="bluelatestOne"
class="round-tip fade-in-out"
:style="getRoundTipStyle(bluelatestOne)"
>{{ bluelatestOne.ringX ? "X" : bluelatestOne.ring || "未上靶"
}}<text v-if="bluelatestOne.ring">环</text></view
>{{ getRoundText(bluelatestOne) }}</view
>
<block v-for="(bow, index) in scores" :key="index">
<image
+1 -1
View File
@@ -19,7 +19,7 @@ const rowCount = new Array(6).fill(0);
const getRingText = (arrow) => {
if (!arrow) return "-";
if (arrow.ringX && arrow.ring) return "X环";
return arrow.ring ? `${arrow.ring}` : "-";
return `${Number(arrow.ring) || 0}`;
};
const isMember = (player = {}) => player.vip === true || player.sVip === true;
+31 -5
View File
@@ -20,6 +20,15 @@ const props = defineProps({
default: false,
},
});
const isMember = (player = {}) => player.vip === true || player.sVip === true;
const getMemberNicknameClass = (player = {}) => [
"member-nickname",
player.vip === true && player.sVip !== true ? "member-nickname--vip" : "",
player.sVip === true ? "member-nickname--svip" : "",
];
const seats = new Array(props.total).fill(1);
</script>
@@ -40,10 +49,27 @@ const seats = new Array(props.total).fill(1);
<view v-else class="player-unknow">
<image src="../static/question-mark.png" mode="widthFix" />
</view>
<text v-if="players[index] && players[index].name">{{
players[index].name
}}</text>
<text v-else :style="{ color: '#fff9' }">虚位以待</text>
<view
v-if="players[index] && players[index].name && isMember(players[index])"
:class="['player-seat-name', ...getMemberNicknameClass(players[index])]"
>
<text class="member-nickname__text">{{ players[index].name }}</text>
<text
v-if="players[index].sVip === true"
class="member-nickname__shine"
>
{{ players[index].name }}
</text>
</view>
<text
v-else-if="players[index] && players[index].name"
class="player-seat-name"
>
{{ players[index].name }}
</text>
<text v-else class="player-seat-name" :style="{ color: '#fff9' }">
虚位以待
</text>
<view v-if="index === 0" class="founder">管理员</view>
<!-- <image
:src="`../static/player-${index + 1}.png`"
@@ -108,7 +134,7 @@ const seats = new Array(props.total).fill(1);
height: 28rpx;
line-height: 28rpx;
}
.players > view > text:nth-child(3) {
.player-seat-name {
width: 20vw;
white-space: nowrap;
overflow: hidden;