计分本细节调整

This commit is contained in:
kron
2025-11-12 20:40:00 +08:00
parent f41a3d7a3a
commit 9f33610f20
13 changed files with 128 additions and 123 deletions

View File

@@ -38,7 +38,7 @@ export const audioFils = {
射击无效: 射击无效:
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutya55ufiiw8oo55.mp3", "https://static.shelingxingqiu.com/attachment/2025-09-17/dcutya55ufiiw8oo55.mp3",
未上靶: 未上靶:
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcuuznjc78ljhzuw1o.mp3", "https://static.shelingxingqiu.com/attachment/2025-11-12/de6n45o3tsm1v4unam.mp3",
"1环": "1环":
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutxin1aq7gxjih5l.mp3", "https://static.shelingxingqiu.com/attachment/2025-09-17/dcutxin1aq7gxjih5l.mp3",
"2环": "2环":

View File

@@ -1,5 +1,4 @@
<script setup> <script setup>
const tabs = [ const tabs = [
{ image: "../static/tab-vip.png" }, { image: "../static/tab-vip.png" },
{ image: "../static/tab-point-book.png" }, { image: "../static/tab-point-book.png" },
@@ -34,7 +33,7 @@ function handleTabClick(index) {
class="tab-item" class="tab-item"
@click="handleTabClick(index)" @click="handleTabClick(index)"
:style="{ :style="{
width: index === 1 ? '36%' : '10%', width: index === 1 ? '36%' : '20%',
}" }"
> >
<image :src="tab.image" mode="widthFix" /> <image :src="tab.image" mode="widthFix" />
@@ -64,10 +63,13 @@ function handleTabClick(index) {
justify-content: center; justify-content: center;
} }
.tab-item > image { .tab-item > image {
width: 86%; width: 65rpx;
}
.tab-item:last-child > image {
width: 85rpx;
} }
.tab-item:nth-child(2) { .tab-item:nth-child(2) {
transform: translate(25%, 30%); transform: translate(10%, 40%);
} }
.tab-item:nth-child(3) { .tab-item:nth-child(3) {
margin-bottom: 25rpx; margin-bottom: 25rpx;
@@ -76,6 +78,6 @@ function handleTabClick(index) {
width: 140rpx; width: 140rpx;
} }
.tab-item:nth-child(4) { .tab-item:nth-child(4) {
transform: translate(-25%, 30%); transform: translate(-10%, 44%);
} }
</style> </style>

View File

@@ -109,7 +109,7 @@ const arrowStyle = computed(() => {
return { return {
transform: `rotateX(180deg) translate(-50%, -50%) rotate(${ transform: `rotateX(180deg) translate(-50%, -50%) rotate(${
360 - angle.value 360 - angle.value
}deg) translateY(100%)`, }deg) translateY(105%)`,
}; };
}); });
@@ -119,9 +119,12 @@ async function onReceiveMessage(messages = []) {
msg.constructor === MESSAGETYPES.ShootSyncMeArrowID || msg.constructor === MESSAGETYPES.ShootSyncMeArrowID ||
msg.constructor === MESSAGETYPES.ShootResult msg.constructor === MESSAGETYPES.ShootResult
) { ) {
if (msg.userId === user.value.id) { if (
angle.value = msg.userId === user.value.id &&
!msg.target.ring && msg.target.angle >= 0 ? msg.target.angle : null; !msg.target.ring &&
msg.target.angle >= 0
) {
angle.value = msg.target.angle;
dirTimer.value = setTimeout(() => { dirTimer.value = setTimeout(() => {
angle.value = null; angle.value = null;
}, 1200); }, 1200);

View File

@@ -19,6 +19,10 @@ const props = defineProps({
type: Function, type: Function,
default: null, default: null,
}, },
scroll: {
type: Boolean,
default: true,
},
}); });
const rect = ref({}); const rect = ref({});
@@ -166,7 +170,7 @@ onMounted(async () => {
<template> <template>
<scroll-view <scroll-view
scroll-y :scroll-y="scroll"
scroll-with-animation scroll-with-animation
:scroll-top="scrollTop" :scroll-top="scrollTop"
class="container" class="container"

View File

@@ -6,17 +6,9 @@ const props = defineProps({
type: Object, type: Object,
default: () => {}, default: () => {},
}, },
onRemove: {
type: Function,
default: null,
},
}); });
const bowOptions = ref({}); const bowOptions = ref({});
const targetOptions = ref({}); const targetOptions = ref({});
// 使用插槽自定义右侧按钮为图标,若需要文字按钮可恢复 rightOptions
// 根据是否传入 onRemove 来决定是否允许左滑
const canSwipe = computed(() => typeof props.onRemove === "function");
const toDetailPage = () => { const toDetailPage = () => {
const config = uni.getStorageSync("point-book-config"); const config = uni.getStorageSync("point-book-config");
@@ -46,60 +38,41 @@ onMounted(() => {
targetOptions.value[item.id] = item; targetOptions.value[item.id] = item;
}); });
}); });
const onSwipeActionClick = () => {
if (typeof props.onRemove === "function") props.onRemove(props.data);
};
</script> </script>
<template> <template>
<uni-swipe-action> <view class="container" @click="toDetailPage">
<uni-swipe-action-item :disabled="!canSwipe" @change="() => {}"> <view class="left-part">
<template v-slot:right v-if="canSwipe"> <view class="labels">
<view class="swipe-right" @click="onSwipeActionClick"> <view></view>
<image <text>{{
class="swipe-icon" bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
src="../static/delete-white.png" }}</text>
mode="widthFix" <text>{{ data.distance }} </text>
/> <text>{{
</view> targetOptions[data.targetType]
</template> ? targetOptions[data.targetType].name
<view class="container" @click="toDetailPage"> : ""
<view class="left-part"> }}</text>
<view class="labels">
<view></view>
<text>{{
bowOptions[data.bowType] ? bowOptions[data.bowType].name : ""
}}</text>
<text>{{ data.distance }} </text>
<text>{{
targetOptions[data.targetType]
? targetOptions[data.targetType].name
: ""
}}</text>
</view>
<view>
<text>{{ data.createAt }}</text>
</view>
<view>
<text
>黄心率{{ Number((data.yellowRate * 100).toFixed(2)) }}%</text
>
<text>10环数{{ data.tenRings }}</text>
<text>平均{{ data.averageRing }}</text>
</view>
</view>
<view class="right-part">
<image src="../static/bow-target.png" mode="widthFix" />
<view class="arrow-amount">
<text>{{ data.actualTotalRing }}</text>
<text>/</text>
<text>{{ data.totalRing }}</text>
</view>
</view>
</view> </view>
</uni-swipe-action-item> <view>
</uni-swipe-action> <text>{{ data.createAt }}</text>
</view>
<view>
<text>黄心率{{ Number((data.yellowRate * 100).toFixed(2)) }}%</text>
<text>10环数{{ data.tenRings }}</text>
<text>平均{{ data.averageRing }}</text>
</view>
</view>
<view class="right-part">
<image src="../static/bow-target.png" mode="widthFix" />
<view class="arrow-amount">
<text>{{ data.actualTotalRing }}</text>
<text>/</text>
<text>{{ data.totalRing }}</text>
</view>
</view>
</view>
</template> </template>
<style scoped> <style scoped>
@@ -176,18 +149,4 @@ const onSwipeActionClick = () => {
font-size: 30rpx; font-size: 30rpx;
color: #fff; color: #fff;
} }
/* 右侧滑动按钮(自定义宽度与图标) */
.swipe-right {
width: 120rpx; /* 这里可按需调整按钮宽度 */
height: 100%;
background-color: #ff7c7c;
display: flex;
align-items: center;
justify-content: center;
}
.swipe-icon {
width: 44rpx;
height: 44rpx;
}
</style> </style>

View File

@@ -42,9 +42,11 @@ const closeTip = () => {
}; };
const saveNote = async () => { const saveNote = async () => {
showTip3.value = false; if (record.value.id && notes.value) {
if (record.value.id) { if (record.value.remark !== notes.value) {
await addNoteAPI(record.value.id, notes.value); await addNoteAPI(record.value.id, notes.value);
}
showTip3.value = false;
} }
}; };
@@ -207,8 +209,11 @@ onShareTimeline(async () => {
@click="() => openTip(3)" @click="() => openTip(3)"
v-if="user.id === record.user.id" v-if="user.id === record.user.id"
> >
<image src="../static/edit.png" mode="widthFix" /> <image
<text>备注</text> :src="`../static/${notes ? 'has' : 'add'}-note.png`"
mode="widthFix"
/>
<text>{{ notes ? "我的备注" : "添加备注" }}</text>
</button> </button>
</view> </view>
<view class="title-bar"> <view class="title-bar">
@@ -222,14 +227,15 @@ onShareTimeline(async () => {
/> />
</button> --> </button> -->
</view> </view>
<view :style="{ transform: 'translateY(-45rpx) scale(0.9)' }"> <view :style="{ transform: 'translateY(-64rpx) scale(0.9)' }">
<BowTargetEdit <BowTargetEdit
:id="targetId" :id="targetId"
:src="targetSrc" :src="targetSrc"
:arrows="arrows.filter((item) => item.x && item.y)" :arrows="arrows.filter((item) => item.x && item.y)"
:scroll="false"
/> />
</view> </view>
<view :style="{ transform: 'translateY(-60rpx)' }"> <view :style="{ transform: 'translateY(-100rpx)' }">
<!-- <view class="title-bar"> <!-- <view class="title-bar">
<view /> <view />
<text>环值分布</text> <text>环值分布</text>
@@ -289,10 +295,7 @@ onShareTimeline(async () => {
</button> --> </button> -->
</view> </view>
</view> </view>
<ScreenHint2 <ScreenHint2 :show="showTip || showTip2 || showTip3" :onClose="closeTip">
:show="showTip || showTip2 || showTip3"
:onClose="showTip3 ? null : closeTip"
>
<view class="tip-content"> <view class="tip-content">
<block v-if="showTip"> <block v-if="showTip">
<text>落点稳定性说明</text> <text>落点稳定性说明</text>
@@ -309,14 +312,19 @@ onShareTimeline(async () => {
<textarea <textarea
v-model="notes" v-model="notes"
maxlength="300" maxlength="300"
rows="4" rows="3"
class="notes-input" class="notes-input"
placeholder="写下本次射箭的补充信息与心得" placeholder="写下本次射箭的补充信息与心得"
placeholder-style="color: #ccc;" placeholder-style="color: #ccc;"
/> />
<view> <view>
<button hover-class="none" @click="showTip3 = false">取消</button> <button
<button hover-class="none" @click="saveNote">保存备注</button> hover-class="none"
@click="saveNote"
:class="notes ? '' : 'button-disabled'"
>
保存备注
</button>
</view> </view>
</block> </block>
</view> </view>
@@ -394,15 +402,15 @@ onShareTimeline(async () => {
} }
.detail-data > button { .detail-data > button {
display: flex; display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center; align-items: center;
font-size: 26rpx; font-size: 24rpx;
color: #999999; color: #333333;
} }
.detail-data > button > image { .detail-data > button > image {
width: 28rpx; width: 44rpx;
height: 28rpx; height: 44rpx;
margin-right: 10rpx;
margin-left: 20rpx;
} }
.question-mark { .question-mark {
width: 28rpx; width: 28rpx;
@@ -452,7 +460,7 @@ onShareTimeline(async () => {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: center;
} }
.tip-content > view > input { .tip-content > view > input {
width: 80%; width: 80%;
@@ -465,21 +473,21 @@ onShareTimeline(async () => {
} }
.tip-content > view > button { .tip-content > view > button {
width: 48%; width: 48%;
background: linear-gradient(180deg, #fbfbfb 0%, #f5f5f5 100%); border-radius: 44rpx;
border-radius: 22px;
border: 1px solid #eeeeee;
padding: 12px 0; padding: 12px 0;
font-size: 14px; font-size: 14px;
color: #000; color: #000;
}
.tip-content > view > button:last-child {
background: #fed847; background: #fed847;
} }
.button-disabled {
background: linear-gradient(180deg, #fbfbfb 0%, #f5f5f5 100%) !important;
color: #ccc !important;
}
.ring-text-groups { .ring-text-groups {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: 20rpx; padding: 20rpx;
padding-top: 40rpx; padding-top: 50rpx;
font-size: 24rpx; font-size: 24rpx;
color: #999999; color: #999999;
} }
@@ -489,10 +497,9 @@ onShareTimeline(async () => {
} }
.ring-text-groups > view > view:first-child:nth-last-child(2) { .ring-text-groups > view > view:first-child:nth-last-child(2) {
margin-top: 10rpx; margin-top: 10rpx;
margin-left: 30rpx; width: 115rpx;
width: 90rpx;
text-align: center; text-align: center;
justify-content: flex-end; justify-content: flex-start;
font-size: 20rpx; font-size: 20rpx;
display: flex; display: flex;
color: #999; color: #999;
@@ -504,18 +511,17 @@ onShareTimeline(async () => {
> view > view
> view:first-child:nth-last-child(2) > view:first-child:nth-last-child(2)
> text:nth-child(2) { > text:nth-child(2) {
font-size: 40rpx; font-size: 28rpx;
/* min-width: 45rpx; */
color: #666; color: #666;
margin-right: 6rpx; margin-right: 6rpx;
margin-top: -5rpx; margin-top: -5rpx;
font-weight: 500;
} }
.ring-text-groups > view > view:last-child { .ring-text-groups > view > view:last-child {
width: 80%; width: 80%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 30rpx; margin-bottom: 30rpx;
transform: translateX(20rpx);
} }
.ring-text-groups > view > view:last-child > text { .ring-text-groups > view > view:last-child > text {
width: 16.6%; width: 16.6%;

View File

@@ -173,7 +173,7 @@ onMounted(() => {
</view> </view>
<view :style="{ marginBottom: '20px' }"> <view :style="{ marginBottom: '20px' }">
<SButton :rounded="50" :onClick="onSubmit"> <SButton :rounded="50" :onClick="onSubmit">
{{ currentGroup === groups ? "记完了,提交看分析" : "下一组" }} {{ currentGroup === groups ? "保存并查看分析" : "下一组" }}
</SButton> </SButton>
</view> </view>
</Container> </Container>

View File

@@ -96,10 +96,26 @@ const onSelectOption = (itemIndex, value) => {
</view> </view>
<view class="point-records"> <view class="point-records">
<ScrollList :onLoading="onListLoading"> <ScrollList :onLoading="onListLoading">
<view v-for="(item, index) in list" :key="item.id"> <uni-swipe-action>
<PointRecord :data="item" :onRemove="onRemoveRecord" /> <block v-for="(item, index) in list" :key="item.id">
<view v-if="index < list.length - 1" :style="{ height: '25rpx' }"></view> <uni-swipe-action-item>
</view> <template v-slot:right>
<view class="swipe-right" @click="onRemoveRecord(item)">
<image
class="swipe-icon"
src="../static/delete-white.png"
mode="widthFix"
/>
</view>
</template>
<PointRecord :data="item" />
</uni-swipe-action-item>
<view
v-if="index < list.length - 1"
:style="{ height: '25rpx' }"
></view>
</block>
</uni-swipe-action>
<view class="no-data" v-if="list.length === 0">暂无数据</view> <view class="no-data" v-if="list.length === 0">暂无数据</view>
</ScrollList> </ScrollList>
</view> </view>
@@ -141,7 +157,7 @@ const onSelectOption = (itemIndex, value) => {
</SModal> </SModal>
<ScreenHint2 :show="showTip"> <ScreenHint2 :show="showTip">
<view class="tip-content"> <view class="tip-content">
<text>确认删除该记录吗</text> <text>确认删除该记录吗?</text>
<view> <view>
<button hover-class="none" @click="showTip = false">取消</button> <button hover-class="none" @click="showTip = false">取消</button>
<button hover-class="none" @click="confirmRemove">确认</button> <button hover-class="none" @click="confirmRemove">确认</button>
@@ -245,4 +261,17 @@ const onSelectOption = (itemIndex, value) => {
.tip-content > view > button:last-child { .tip-content > view > button:last-child {
background: #fed847; background: #fed847;
} }
/* 右侧滑动按钮(自定义宽度与图标) */
.swipe-right {
width: 120rpx; /* 这里可按需调整按钮宽度 */
height: 100%;
background-color: #ff7c7c;
display: flex;
align-items: center;
justify-content: center;
}
.swipe-icon {
width: 44rpx;
height: 44rpx;
}
</style> </style>

View File

@@ -363,7 +363,7 @@ onShareTimeline(() => {
:onClose="() => (showTip = false)" :onClose="() => (showTip = false)"
/> />
<view class="tip-content" v-if="showTip2"> <view class="tip-content" v-if="showTip2">
<text>确认删除该记录吗</text> <text>确认删除该记录吗</text>
<view> <view>
<button hover-class="none" @click="showTip2 = false">取消</button> <button hover-class="none" @click="showTip2 = false">取消</button>
<button hover-class="none" @click="confirmRemove">确认</button> <button hover-class="none" @click="confirmRemove">确认</button>
@@ -484,6 +484,8 @@ onShareTimeline(() => {
width: calc(100vw - 70rpx); width: calc(100vw - 70rpx);
height: calc(100vw - 70rpx); height: calc(100vw - 70rpx);
transform: scale(0.9); transform: scale(0.9);
border-radius: 50%;
overflow: hidden;
} }
.heat-map > image { .heat-map > image {
width: 100%; width: 100%;

BIN
src/static/add-note.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 363 B

BIN
src/static/has-note.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB