update:优化新版个人训练
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import AppBackground from "@/components/AppBackground.vue";
|
||||
import Avatar from "@/components/Avatar.vue";
|
||||
import BowTarget from "./BowTarget.vue";
|
||||
@@ -7,6 +8,8 @@ import useStore from "@/store";
|
||||
import { storeToRefs } from "pinia";
|
||||
const store = useStore();
|
||||
const { user } = storeToRefs(store);
|
||||
const isSvip = computed(() => user.value.sVip === true);
|
||||
const isVip = computed(() => user.value.vip === true && !isSvip.value);
|
||||
|
||||
const props = defineProps({
|
||||
show: {
|
||||
@@ -35,8 +38,20 @@ const props = defineProps({
|
||||
<view>
|
||||
<Avatar :src="user.avatar" :rankLvl="user.rankLvl" :size="45" />
|
||||
<view>
|
||||
<text>{{ user.nickName }}</text>
|
||||
<!-- <text>{{ user.lvlName }}</text> -->
|
||||
<view
|
||||
:class="[
|
||||
'header-nickname',
|
||||
'member-nickname',
|
||||
isVip ? 'member-nickname--vip' : '',
|
||||
isSvip ? 'member-nickname--svip' : '',
|
||||
]"
|
||||
>
|
||||
<text class="member-nickname__text">{{ user.nickName }}</text>
|
||||
<text v-if="isSvip" class="member-nickname__shine">
|
||||
{{ user.nickName }}
|
||||
</text>
|
||||
</view>
|
||||
<text>{{ user.lvlName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view @click="onClose">
|
||||
@@ -95,9 +110,12 @@ const props = defineProps({
|
||||
margin-left: 10px;
|
||||
color: #fff;
|
||||
}
|
||||
.header-nickname {
|
||||
max-width: 240rpx;
|
||||
}
|
||||
.header > view:first-child > view:last-child > text:last-child {
|
||||
font-size: 10px;
|
||||
background-color: #5f51ff;
|
||||
/* background-color: #5f51ff; */
|
||||
padding: 2px 5px;
|
||||
border-radius: 10px;
|
||||
margin-top: 5px;
|
||||
|
||||
@@ -86,6 +86,8 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["shot-effect-complete"]);
|
||||
|
||||
const pMode = ref(true);
|
||||
const latestOne = ref(null);
|
||||
const bluelatestOne = ref(null);
|
||||
@@ -248,16 +250,25 @@ function triggerShotEffect(shot, index) {
|
||||
clearTipTimer();
|
||||
latestOne.value = null;
|
||||
hiddenLatestKey.value = key;
|
||||
shotEffect.value = { key, shot };
|
||||
shotEffect.value = {
|
||||
key,
|
||||
shot,
|
||||
token: props.shotEffectToken,
|
||||
};
|
||||
}
|
||||
|
||||
function completeShotEffect(key) {
|
||||
if (!shotEffect.value || shotEffect.value.key !== key) return;
|
||||
|
||||
const shot = shotEffect.value.shot;
|
||||
const completedEffect = shotEffect.value;
|
||||
const shot = completedEffect.shot;
|
||||
hiddenLatestKey.value = "";
|
||||
shotEffect.value = null;
|
||||
showShotTip(shot);
|
||||
emit("shot-effect-complete", {
|
||||
key,
|
||||
token: completedEffect.token,
|
||||
});
|
||||
}
|
||||
|
||||
function shouldHideLatestHit(index) {
|
||||
|
||||
@@ -35,6 +35,18 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: "precision",
|
||||
},
|
||||
isVip: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
isSvip: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
externalShootResultAudio: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
currentRound: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
@@ -195,6 +207,8 @@ async function onReceiveMessage(msg) {
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||
audioManager.play("比赛结束", false);
|
||||
} else if (msg.type === MESSAGETYPESV2.ShootResult) {
|
||||
// 精准训练由页面统一等待语音和飞箭结束,其他训练保持原播放链路。
|
||||
if (props.externalShootResultAudio) return;
|
||||
const latestDetail =
|
||||
Array.isArray(msg.details) && msg.details.length > 0
|
||||
? msg.details[msg.details.length - 1]
|
||||
@@ -261,7 +275,19 @@ onBeforeUnmount(() => {
|
||||
image-mode="aspectFill"
|
||||
/>
|
||||
</view>
|
||||
<text class="progress-card__name">{{ displayName }}</text>
|
||||
<view
|
||||
:class="[
|
||||
'progress-card__name',
|
||||
'member-nickname',
|
||||
isVip && !isSvip ? 'member-nickname--vip' : '',
|
||||
isSvip ? 'member-nickname--svip' : '',
|
||||
]"
|
||||
>
|
||||
<text class="member-nickname__text">{{ displayName }}</text>
|
||||
<text v-if="isSvip" class="member-nickname__shine">
|
||||
{{ displayName }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <button class="progress-card__sound" hover-class="none" @click="updateSound">
|
||||
@@ -338,9 +364,10 @@ onBeforeUnmount(() => {
|
||||
|
||||
.progress-card__name {
|
||||
width: 86rpx;
|
||||
color: #E7BA80;
|
||||
color: #fff;
|
||||
font-size: 18rpx;
|
||||
line-height: 1;
|
||||
justify-content: center;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
Reference in New Issue
Block a user