计分本细节调整

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/dcuuznjc78ljhzuw1o.mp3",
"https://static.shelingxingqiu.com/attachment/2025-11-12/de6n45o3tsm1v4unam.mp3",
"1环":
"https://static.shelingxingqiu.com/attachment/2025-09-17/dcutxin1aq7gxjih5l.mp3",
"2环":

View File

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

View File

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

View File

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

View File

@@ -6,17 +6,9 @@ const props = defineProps({
type: Object,
default: () => {},
},
onRemove: {
type: Function,
default: null,
},
});
const bowOptions = ref({});
const targetOptions = ref({});
// 使用插槽自定义右侧按钮为图标,若需要文字按钮可恢复 rightOptions
// 根据是否传入 onRemove 来决定是否允许左滑
const canSwipe = computed(() => typeof props.onRemove === "function");
const toDetailPage = () => {
const config = uni.getStorageSync("point-book-config");
@@ -46,60 +38,41 @@ onMounted(() => {
targetOptions.value[item.id] = item;
});
});
const onSwipeActionClick = () => {
if (typeof props.onRemove === "function") props.onRemove(props.data);
};
</script>
<template>
<uni-swipe-action>
<uni-swipe-action-item :disabled="!canSwipe" @change="() => {}">
<template v-slot:right v-if="canSwipe">
<view class="swipe-right" @click="onSwipeActionClick">
<image
class="swipe-icon"
src="../static/delete-white.png"
mode="widthFix"
/>
</view>
</template>
<view class="container" @click="toDetailPage">
<view class="left-part">
<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 class="container" @click="toDetailPage">
<view class="left-part">
<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>
</uni-swipe-action-item>
</uni-swipe-action>
<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>
</template>
<style scoped>
@@ -176,18 +149,4 @@ const onSwipeActionClick = () => {
font-size: 30rpx;
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>

View File

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

View File

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

View File

@@ -96,10 +96,26 @@ const onSelectOption = (itemIndex, value) => {
</view>
<view class="point-records">
<ScrollList :onLoading="onListLoading">
<view v-for="(item, index) in list" :key="item.id">
<PointRecord :data="item" :onRemove="onRemoveRecord" />
<view v-if="index < list.length - 1" :style="{ height: '25rpx' }"></view>
</view>
<uni-swipe-action>
<block v-for="(item, index) in list" :key="item.id">
<uni-swipe-action-item>
<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>
</ScrollList>
</view>
@@ -141,7 +157,7 @@ const onSelectOption = (itemIndex, value) => {
</SModal>
<ScreenHint2 :show="showTip">
<view class="tip-content">
<text>确认删除该记录吗</text>
<text>确认删除该记录吗?</text>
<view>
<button hover-class="none" @click="showTip = false">取消</button>
<button hover-class="none" @click="confirmRemove">确认</button>
@@ -245,4 +261,17 @@ const onSelectOption = (itemIndex, value) => {
.tip-content > view > button:last-child {
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>

View File

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