细节完善
This commit is contained in:
@@ -49,16 +49,16 @@ const props = defineProps({
|
||||
<view class="desc">
|
||||
<text>{{ arrows.length }}</text>
|
||||
<text>支箭,共</text>
|
||||
<text>{{ arrows.reduce((a, b) => a + b.ring, 0) }}</text>
|
||||
<text>{{ arrows.reduce((a, b) => a + (b.ring || 0), 0) }}</text>
|
||||
<text>环</text>
|
||||
</view>
|
||||
<ScorePanel
|
||||
:completeEffect="false"
|
||||
:rowCount="arrows.length === 12 ? 6 : 9"
|
||||
:rowCount="total === 12 ? 6 : 9"
|
||||
:total="total"
|
||||
:arrows="arrows"
|
||||
:margin="arrows.length === 12 ? 4 : 1"
|
||||
:fontSize="arrows.length === 12 ? 25 : 22"
|
||||
:margin="total === 12 ? 4 : 1"
|
||||
:fontSize="total === 12 ? 25 : 22"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -55,11 +55,9 @@ async function onReceiveMessage(message) {
|
||||
totalShot.value = mode === 1 ? 3 : 2;
|
||||
currentRoundEnded.value = true;
|
||||
audioManager.play("比赛开始");
|
||||
}
|
||||
if (type === MESSAGETYPESV2.BattleEnd) {
|
||||
} else if (type === MESSAGETYPESV2.BattleEnd) {
|
||||
audioManager.play("比赛结束");
|
||||
}
|
||||
if (type === MESSAGETYPESV2.ShootResult) {
|
||||
} else if (type === MESSAGETYPESV2.ShootResult) {
|
||||
if (melee.value && current.playerId !== user.value.id) return;
|
||||
if (current.playerId === user.value.id) currentShot.value++;
|
||||
if (message.shootData) {
|
||||
@@ -73,11 +71,16 @@ async function onReceiveMessage(message) {
|
||||
key.push(`向${getDirectionText(shootData.angle)}调整`);
|
||||
audioManager.play(key, false);
|
||||
}
|
||||
}
|
||||
if (type === MESSAGETYPESV2.NewRound) {
|
||||
} else if (type === MESSAGETYPESV2.NewRound) {
|
||||
currentShot.value = 0;
|
||||
currentRound.value = current.round;
|
||||
currentRoundEnded.value = true;
|
||||
} else if (type === MESSAGETYPESV2.InvalidShot) {
|
||||
uni.showToast({
|
||||
title: "距离不足,无效",
|
||||
icon: "none",
|
||||
});
|
||||
audioManager.pLay("射击无效");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ const getRing = (arrow) => {
|
||||
};
|
||||
|
||||
const arrows = computed(() => {
|
||||
const data = new Array(props.total).fill({});
|
||||
const data = new Array(props.total).fill({ ring: 0 });
|
||||
(props.result.details || []).forEach((arrow, index) => {
|
||||
data[index] = arrow;
|
||||
});
|
||||
@@ -78,8 +78,8 @@ const validArrows = computed(() => arrows.value.filter((a) => !!a.ring).length);
|
||||
<image :src="tipSrc" mode="widthFix" />
|
||||
<image src="../static/finish-frame.png" mode="widthFix" />
|
||||
<text
|
||||
>完成<text class="gold-text">{{ validArrows.length }}</text
|
||||
>箭,获得<text class="gold-text">{{ validArrows.length }}</text
|
||||
>完成<text class="gold-text">{{ validArrows }}</text
|
||||
>箭,获得<text class="gold-text">{{ validArrows }}</text
|
||||
>点经验</text
|
||||
>
|
||||
</view>
|
||||
@@ -165,7 +165,7 @@ const validArrows = computed(() => arrows.value.filter((a) => !!a.ring).length);
|
||||
</ScreenHint>
|
||||
<BowData
|
||||
:total="arrows.length"
|
||||
:arrows="arrows"
|
||||
:arrows="result.details"
|
||||
:show="showBowData"
|
||||
:onClose="() => (showBowData = false)"
|
||||
/>
|
||||
|
||||
@@ -143,6 +143,12 @@ async function onReceiveMessage(msg) {
|
||||
} else if (msg.type === MESSAGETYPESV2.HalfRest) {
|
||||
halfTime.value = true;
|
||||
audioManager.play("中场休息");
|
||||
} else if (type === MESSAGETYPESV2.InvalidShot) {
|
||||
uni.showToast({
|
||||
title: "距离不足,无效",
|
||||
icon: "none",
|
||||
});
|
||||
audioManager.pLay("射击无效");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ export const MESSAGETYPESV2 = {
|
||||
HalfRest: 7,
|
||||
TestDistance: 8,
|
||||
MatchSuccess: 9,
|
||||
InvalidShot: 10,
|
||||
};
|
||||
|
||||
export const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
|
||||
|
||||
@@ -129,7 +129,7 @@ const nextStep = async () => {
|
||||
btnDisabled.value = true;
|
||||
step.value = 2;
|
||||
title.value = "-感知距离";
|
||||
const result = await createPractiseAPI(total, 360);
|
||||
const result = await createPractiseAPI(total, 120);
|
||||
if (result) practiseId.value = result.id;
|
||||
} else if (step.value === 2) {
|
||||
showGuide.value = false;
|
||||
@@ -166,7 +166,7 @@ const onClose = async () => {
|
||||
start.value = false;
|
||||
scores.value = [];
|
||||
step.value = 3;
|
||||
const result = await createPractiseAPI(total, 360);
|
||||
const result = await createPractiseAPI(total, 120);
|
||||
if (result) practiseId.value = result.id;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,11 +14,10 @@ const arrows = ref([]);
|
||||
const total = ref(0);
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.id) {
|
||||
const result = await getPractiseAPI(options.id);
|
||||
arrows.value = result.details;
|
||||
total.value = result.details.length;
|
||||
}
|
||||
if (!options.id) return;
|
||||
const result = await getPractiseAPI(options.id || 176);
|
||||
arrows.value = result.details;
|
||||
total.value = result.details.length;
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ async function onComplete() {
|
||||
start.value = false;
|
||||
scores.value = [];
|
||||
currentRound.value = 0;
|
||||
const result = await createPractiseAPI(total, 360);
|
||||
const result = await createPractiseAPI(total, 120);
|
||||
if (result) practiseId.value = result.id;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user