细节调整

This commit is contained in:
kron
2025-11-11 16:31:47 +08:00
parent 6df7986c47
commit 59a2b173a6
8 changed files with 46 additions and 32 deletions

View File

@@ -88,10 +88,7 @@
"path": "pages/friend-battle"
},
{
"path": "pages/battle-room",
"style": {
"disableSwipeBack": true
}
"path": "pages/battle-room"
},
{
"path": "pages/ranking"

View File

@@ -5,11 +5,11 @@ import SButton from "@/components/SButton.vue";
import { laserAimAPI, laserCloseAPI } from "@/apis";
import { MESSAGETYPES } from "@/constants";
import audioManager from "@/audioManager";
// import audioManager from "@/audioManager";
const guides = [
{
title: "箭头面向墙面,直至语音提示激光坐标已校准",
title: "箭头面向靶子",
src: "https://static.shelingxingqiu.com/attachment/2025-10-30/ddv9p5fk5wscg7hrfo.png",
},
{
@@ -34,7 +34,7 @@ function onReceiveMessage(messages = []) {
if (msg.constructor === MESSAGETYPES.Calibration) {
done.value = true;
uni.setStorageSync("calibration", true);
audioManager.play("激光已校准");
// audioManager.play("激光已校准");
}
});
}
@@ -109,7 +109,7 @@ onBeforeUnmount(async () => {
height: 250rpx;
}
.container > text {
font-size: 20rpx;
font-size: 24rpx;
color: #fff9;
margin: 30rpx;
}

View File

@@ -167,7 +167,13 @@ const onClose = () => {
: 0
"
>
<text v-if="step === 0" :style="{ fontSize: '28rpx' }">
<text
v-if="step === 0"
:style="{
fontSize: '28rpx',
marginTop: user.nickName.length > 6 ? '-10rpx' : '0',
}"
>
hi<text :style="{ color: '#fed847' }">{{ user.nickName }}</text>
这是新人必刷小任务0基础小白也能快速掌握弓箭技巧和游戏规则哦~
</text>

View File

@@ -102,6 +102,12 @@ onLoad(async (options) => {
setTimeout(getCurrentGameAPI, 2000);
}
}
uni.enableAlertBeforeUnload({
message: "离开比赛可能导致比赛失败,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
});
async function onReceiveMessage(messages = []) {
@@ -149,9 +155,6 @@ async function onReceiveMessage(messages = []) {
}
});
}
const onBack = () => {
uni.$showHint(2);
};
onMounted(async () => {
uni.setKeepScreenOn({
keepScreenOn: true,
@@ -188,7 +191,7 @@ onHide(() => {
</script>
<template>
<Container :title="title" :bgType="1" :onBack="onBack">
<Container :title="title" :bgType="1">
<view class="container">
<BattleHeader v-if="!start" :players="players" />
<TestDistance v-if="!start" :guide="false" :isBattle="true" />

View File

@@ -233,7 +233,7 @@ onShow(() => {
<SButton :onClick="goCalibration" width="60vw" :rounded="40">
开启智能弓进行校准
</SButton>
<text :style="{ marginTop: '20rpx', fontSize: '20rpx', color: '#fff9' }"
<text :style="{ marginTop: '20rpx', fontSize: '24rpx', color: '#fff9' }"
>校准时弓箭激光将开启请勿直视激光</text
>
</block>
@@ -386,6 +386,7 @@ onShow(() => {
flex-direction: column;
align-items: center;
position: relative;
font-size: 26rpx;
}
.device-binded > view > image {
width: 140rpx;
@@ -414,7 +415,7 @@ onShow(() => {
display: flex;
flex-direction: column;
align-items: center;
font-size: 14px;
font-size: 28rpx;
margin-bottom: 100rpx;
}
.has-device > view:nth-child(2) > text,
@@ -427,7 +428,7 @@ onShow(() => {
left: 20rpx;
}
.calibration > button {
font-size: 22rpx;
font-size: 26rpx;
color: #287fff;
display: flex;
align-items: center;
@@ -440,11 +441,11 @@ onShow(() => {
}
.calibration > view {
position: relative;
font-size: 20rpx;
font-size: 22rpx;
color: #fff9;
padding-top: 40rpx;
padding-top: 34rpx;
padding-left: 35rpx;
width: 300rpx;
width: 322rpx;
}
.calibration > view > image {
position: absolute;

View File

@@ -222,7 +222,7 @@ onShareTimeline(async () => {
/>
</button> -->
</view>
<view :style="{ transform: 'translateY(-45rpx)' }">
<view :style="{ transform: 'translateY(-45rpx) scale(0.9)' }">
<BowTargetEdit
:id="targetId"
:src="targetSrc"
@@ -291,7 +291,7 @@ onShareTimeline(async () => {
</view>
<ScreenHint2
:show="showTip || showTip2 || showTip3"
:onClose="!notes && showTip3 ? null : closeTip"
:onClose="showTip3 ? null : closeTip"
>
<view class="tip-content">
<block v-if="showTip">

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, onMounted } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import ScreenHint2 from "@/components/ScreenHint2.vue";
import SButton from "@/components/SButton.vue";
@@ -74,6 +75,15 @@ const onEditDone = (arrow) => {
if (currentArrow.value < amount.value - 1) currentArrow.value++;
};
onLoad(() => {
uni.enableAlertBeforeUnload({
message: "现在离开会导致未提交的数据丢失,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
});
onMounted(() => {
const pointBook = uni.getStorageSync("last-point-book");
if (pointBook.bowtargetType) {
@@ -96,12 +106,7 @@ onMounted(() => {
</script>
<template>
<Container
:bgType="2"
bgColor="#F5F5F5"
:whiteBackArrow="false"
:onBack="() => (showTip = true)"
>
<Container :bgType="2" bgColor="#F5F5F5" :whiteBackArrow="false">
<view class="container">
<BowTargetEdit
:onChange="onEditDone"

View File

@@ -39,10 +39,6 @@ const showRoundTip = ref(false);
const isFinalShoot = ref(false);
const isEnded = ref(false);
const onBack = () => {
uni.$showHint(2);
};
function recoverData(battleInfo) {
uni.removeStorageSync("last-awake-time");
battleId.value = battleInfo.id;
@@ -282,6 +278,12 @@ onLoad(async (options) => {
setTimeout(getCurrentGameAPI, 2000);
}
}
uni.enableAlertBeforeUnload({
message: "离开比赛可能导致比赛失败,是否继续?",
success: (res) => {
console.log("已启用离开提示");
},
});
});
onMounted(async () => {
uni.setKeepScreenOn({
@@ -319,7 +321,7 @@ onHide(() => {
</script>
<template>
<Container :bgType="start ? 3 : 1" :onBack="onBack">
<Container :bgType="start ? 3 : 1">
<view class="container">
<BattleHeader v-if="!start" :redTeam="redTeam" :blueTeam="blueTeam" />
<TestDistance v-if="!start" :guide="false" :isBattle="true" />