细节调整

This commit is contained in:
kron
2025-07-11 22:21:34 +08:00
parent 81c064ba8b
commit e0807eb06a
14 changed files with 98 additions and 57 deletions

View File

@@ -28,9 +28,11 @@ defineProps({
<text>Round {{ index + 1 }}</text>
<view>
<text>{{
result.blueArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
result.blueArrows.length
? result.blueArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
: ""
}}</text>
<text></text>
</view>
@@ -41,9 +43,11 @@ defineProps({
<text>Round {{ index + 1 }}</text>
<view>
<text>{{
result.redArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
result.redArrows.length
? result.redArrows
.map((item) => item.ring)
.reduce((last, next) => last + next, 0)
: ""
}}</text>
<text></text>
</view>

View File

@@ -29,7 +29,7 @@ const props = defineProps({
<AppBackground :type="1" />
<view class="header">
<view>
<Avatar :src="user.avatar" :score="user.scores" :size="50" />
<Avatar :src="user.avatar" :score="user.scores" :size="45" />
<view>
<text>{{ user.nickName }}</text>
<text>{{ user.lvlName }}</text>

View File

@@ -131,8 +131,14 @@ const simulShoot2 = async () => {
v-if="scores.length && showRoundTips && showLatestArrow && showE"
class="e-value fade-in-out"
:style="{
left: calcRealX(scores[scores.length - 1].x, 66),
top: calcRealY(scores[scores.length - 1].y, 150),
left: calcRealX(
scores[scores.length - 1].ring ? scores[scores.length - 1].x : 0,
66
),
top: calcRealY(
scores[scores.length - 1].ring ? scores[scores.length - 1].y : 0,
150
),
}"
>
经验 +1
@@ -141,19 +147,37 @@ const simulShoot2 = async () => {
v-if="scores.length && showRoundTips && showLatestArrow"
class="round-tip fade-in-out"
:style="{
left: calcRealX(scores[scores.length - 1].x, 70),
top: calcRealY(scores[scores.length - 1].y, 100),
left: calcRealX(
scores[scores.length - 1].ring ? scores[scores.length - 1].x : 0,
100
),
top: calcRealY(
scores[scores.length - 1].ring ? scores[scores.length - 1].y : 0,
100
),
}"
>{{ scores[scores.length - 1].ring }}<text></text></view
>{{ scores[scores.length - 1].ring || "未上靶"
}}<text v-if="scores[scores.length - 1].ring"></text></view
>
<view
v-if="blueScores.length && showRoundTips && showLatestArrow"
class="round-tip fade-in-out"
:style="{
left: calcRealX(blueScores[blueScores.length - 1].x, 70),
top: calcRealY(blueScores[blueScores.length - 1].y, 100),
left: calcRealX(
blueScores[blueScores.length - 1].ring
? blueScores[blueScores.length - 1].x
: 0,
100
),
top: calcRealY(
blueScores[blueScores.length - 1].ring
? blueScores[blueScores.length - 1].y
: 0,
100
),
}"
>{{ blueScores[blueScores.length - 1].ring }}<text></text></view
>{{ blueScores[blueScores.length - 1].ring || "未上靶"
}}<text v-if="blueScores[blueScores.length - 1].ring"></text></view
>
<block v-for="(bow, index) in scores" :key="index">
<view
@@ -202,9 +226,9 @@ const simulShoot2 = async () => {
<button @click="simulShoot">模拟</button>
<button @click="simulShoot2">射箭</button>
</view>
<text :style="{ color: '#fff', wordBreak: 'break-all' }">{{
<!-- <text :style="{ color: '#fff', wordBreak: 'break-all' }">{{
scores.length ? scores[scores.length - 1] : ""
}}</text>
}}</text> -->
<!-- <StartCountdown :start="startCount" /> -->
</view>
</template>
@@ -240,7 +264,7 @@ const simulShoot2 = async () => {
font-size: 30px;
font-weight: bold;
z-index: 2;
width: 70px;
width: 100px;
text-align: center;
}
.round-tip > text {

View File

@@ -72,6 +72,7 @@ onMounted(() => {
padding-left: 15px;
color: #fff;
font-size: 16px;
font-weight: bold;
}
.back-btn {
display: flex;
@@ -98,6 +99,5 @@ onMounted(() => {
.current-step {
font-size: 16px;
color: #fff;
font-weight: bold;
}
</style>

View File

@@ -18,7 +18,7 @@ const seats = new Array(props.total).fill(1);
<image src="../static/player-bg.png" mode="widthFix" />
<image
v-if="players[index]"
:src="players[index].avatar"
:src="players[index].avatar || '../static/user-icon.png'"
mode="widthFix"
/>
<view v-else class="player-unknow">

View File

@@ -37,7 +37,7 @@ defineProps({
>
<image
class="avatar"
:src="player.avatar"
:src="player.avatar || '../static/user-icon.png'"
mode="widthFix"
:style="{
borderColor: currentShooterId === player.id ? '#5fadff' : '#fff',
@@ -79,7 +79,7 @@ defineProps({
</text>
<image
class="avatar"
:src="player.avatar"
:src="player.avatar || '../static/user-icon.png'"
mode="widthFix"
:style="{
borderColor: currentShooterId === player.id ? '#ff6060' : '#fff',
@@ -98,7 +98,6 @@ defineProps({
display: flex;
justify-content: space-between;
align-items: flex-start;
}
.container > view {
width: 50%;

View File

@@ -61,7 +61,6 @@ onUnmounted(() => {
<text :style="{ color: '#fed847' }">请预先射几箭测试</text>
<text>请确保射击距离有5米</text>
</view>
<BowPower :power="power" />
</view>
</Guide>
<view class="user-row">

View File

@@ -225,6 +225,10 @@ async function onReceiveMessage(messages = []) {
tips.value = "请在90秒内射完12支箭";
seq.value += 1;
}
roundResults.value.push({
redArrows: [],
blueArrows: [],
});
}
if (msg.constructor === MESSAGETYPES.MeleeAllReady) {
start.value = true;
@@ -273,11 +277,6 @@ async function onReceiveMessage(messages = []) {
msg.target
);
}
} else {
roundResults.value.push({
redArrows: isRed ? [msg.target] : [],
blueArrows: isRed ? [] : [msg.target],
});
}
}
if (room.value.battleType === 2) {
@@ -299,7 +298,13 @@ async function onReceiveMessage(messages = []) {
redPoints.value += result.redScore;
// roundResults.value = result.roundResults;
currentRound.value = result.currentRound + 1;
if (result.currentRound < 5) showRoundTip.value = true;
if (result.currentRound < 5) {
roundResults.value.push({
redArrows: [],
blueArrows: [],
});
showRoundTip.value = true;
}
}
}
if (msg.constructor === MESSAGETYPES.FinalShoot) {
@@ -378,13 +383,19 @@ onUnmounted(() => {
<image src="../static/1v1-bg.png" mode="widthFix" />
<view>
<view class="player" :style="{ transform: 'translateY(-60px)' }">
<image :src="owner.avatar" mode="widthFix" />
<image
:src="owner.avatar || '../static/user-icon.png'"
mode="widthFix"
/>
<text>{{ owner.name }}</text>
</view>
<image src="../static/versus.png" mode="widthFix" />
<block v-if="opponent.id">
<view class="player" :style="{ transform: 'translateY(60px)' }">
<image :src="opponent.avatar" mode="widthFix" />
<image
:src="opponent.avatar || '../static/user-icon.png'"
mode="widthFix"
/>
<text v-if="opponent.name">{{ opponent.name }}</text>
</view>
</block>

View File

@@ -45,7 +45,9 @@ const createPractise = async (arrows) => {
async function onReceiveMessage(messages = []) {
messages.forEach((msg) => {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
if (scores.value.length < total) {
scores.value.push(msg.target);
}
power.value = msg.target.battery;
// if (step.value === 2 && msg.target.dst / 100 > 5) {
// if (step.value === 2 && msg.target.dst > 5) {

View File

@@ -134,7 +134,7 @@ const backToHome = () => {
<image src="../static/bind-success.png" mode="widthFix" />
<view>
<image
:src="user.avatar"
:src="user.avatar || '../static/user-icon.png'"
mode="widthFix"
:style="{ borderRadius: '50%' }"
/>
@@ -162,7 +162,7 @@ const backToHome = () => {
<image src="../static/bind.png" mode="widthFix" />
<view>
<image
:src="user.avatar"
:src="user.avatar || '../static/user-icon.png'"
mode="widthFix"
:style="{ borderRadius: '50%' }"
/>

View File

@@ -59,7 +59,7 @@ const onPractiseLoading = async (page) => {
<Container title="我的成长脚印" overflow="hidden">
<view class="tabs">
<view
v-for="(rankType, index) in ['排位赛', '好友约战', '馆练习']"
v-for="(rankType, index) in ['排位赛', '好友约战', '馆练习']"
:key="index"
:style="{
color: index === selectedIndex ? '#000' : '#fff',

View File

@@ -36,10 +36,12 @@ const onReady = async () => {
async function onReceiveMessage(messages = []) {
messages.forEach((msg) => {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
currentRound.value += 1;
if (currentRound.value === 4) {
currentRound.value = 1;
if (scores.value.length < total) {
scores.value.push(msg.target);
currentRound.value += 1;
if (currentRound.value === 4) {
currentRound.value = 1;
}
}
power.value = msg.target.battery;
}
@@ -125,5 +127,4 @@ onUnmounted(() => {
</Container>
</template>
<style scoped>
</style>
<style scoped></style>

View File

@@ -20,7 +20,6 @@ const { updateUser } = store;
const start = ref(false);
const scores = ref([]);
const total = 36;
const currentRound = ref(0);
const practiseResult = ref({});
const power = ref(0);
const practiseId = ref("");
@@ -28,7 +27,6 @@ const practiseId = ref("");
const onReady = async () => {
const result = await createPractiseAPI(total);
if (result) practiseId.value = result.id;
currentRound.value = 0;
scores.value = [];
start.value = true;
};
@@ -36,9 +34,10 @@ const onReady = async () => {
async function onReceiveMessage(messages = []) {
messages.forEach((msg) => {
if (msg.constructor === MESSAGETYPES.ShootSyncMeArrowID) {
scores.value.push(msg.target);
if (scores.value.length < total) {
scores.value.push(msg.target);
}
power.value = msg.target.battery;
currentRound.value += 1;
}
if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
if (practiseId.value && practiseId.value === msg.practice.id) {
@@ -70,7 +69,6 @@ async function onComplete() {
practiseResult.value = {};
start.value = false;
scores.value = [];
currentRound.value = 0;
}
}
@@ -90,7 +88,7 @@ onUnmounted(() => {
<block v-if="start || practiseResult.arrows">
<ShootProgress
:start="start"
:tips="`请连续射${total}支`"
:tips="`请连续射${total}支`"
:total="120"
/>
<view class="user-row">
@@ -100,7 +98,6 @@ onUnmounted(() => {
<BowTarget
:start="start"
:totalRound="start ? total : 0"
:currentRound="currentRound"
:scores="scores"
/>
<ScorePanel
@@ -130,5 +127,4 @@ onUnmounted(() => {
</Container>
</template>
<style scoped>
</style>
<style scoped></style>

View File

@@ -117,6 +117,10 @@ async function onReceiveMessage(messages = []) {
timerSeq.value = 0;
scores.value = [];
totalRounds.value = msg.groupUserStatus.config.maxRounds;
roundResults.value.push({
redArrows: [],
blueArrows: [],
});
}
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
if (currentShooterId.value !== msg.userId) {
@@ -149,11 +153,6 @@ async function onReceiveMessage(messages = []) {
msg.target
);
}
} else {
roundResults.value.push({
redArrows: isRed ? [msg.target] : [],
blueArrows: isRed ? [] : [msg.target],
});
}
}
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
@@ -167,7 +166,13 @@ async function onReceiveMessage(messages = []) {
redPoints.value += result.redScore;
// roundResults.value = result.roundResults;
currentRound.value = result.currentRound + 1;
if (result.currentRound < 5) showRoundTip.value = true;
if (result.currentRound < 5) {
roundResults.value.push({
redArrows: [],
blueArrows: [],
});
showRoundTip.value = true;
}
}
if (msg.constructor === MESSAGETYPES.FinalShoot) {
if (!isFinalShoot.value) {