添加教练点评

This commit is contained in:
kron
2025-07-05 19:23:38 +08:00
parent 620ab246b9
commit 58efda67fb
2 changed files with 57 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import SButton from "@/components/SButton.vue";
import ScreenHint from "@/components/ScreenHint.vue";
import BowData from "@/components/BowData.vue";
import { wxShare } from "@/util";
import { directionAdjusts } from "@/constants";
const props = defineProps({
onClose: {
type: Function,
@@ -31,6 +32,7 @@ const showPanel = ref(true);
const showComment = ref(false);
const showBowData = ref(false);
const finished = ref(false);
const totalRing = ref(0);
const closePanel = () => {
showPanel.value = false;
setTimeout(() => {
@@ -38,6 +40,12 @@ const closePanel = () => {
}, 300);
};
onMounted(() => {
if (props.result.arrows) {
totalRing.value = props.result.arrows.reduce(
(last, next) => last + next.ring,
0
);
}
finished.value =
props.result.arrows && props.result.arrows.length === props.total;
});
@@ -62,11 +70,7 @@ onMounted(() => {
:style="{ transform: `translateY(${showPanel ? '0%' : '100%'})` }"
>
<view>
<text
>本局成绩{{
result.arrows.reduce((last, next) => last + next.ring, 0)
}}</text
>
<text>本局成绩{{ totalRing }}</text>
<button @click="() => (showBowData = true)">
<text>查看靶纸</text>
<image
@@ -102,8 +106,37 @@ onMounted(() => {
>
</view>
</view>
<ScreenHint :show="showComment" :onClose="() => (showComment = false)">
{{ result.adjustmentHint }}
<ScreenHint
:show="showComment"
:onClose="() => (showComment = false)"
mode="tall"
>
<view class="coach-comment">
<text>
您本次练习取得了<text :style="{ color: '#fed847' }">{{
totalRing
}}</text
>环的成绩所有箭支上靶后的平均点间距为<text
:style="{ color: '#fed847' }"
>{{ Number(result.average_distance.toFixed(2)) }}</text
>{{
result.spreadEvaluation === "Dispersed"
? "还需要持续改进。"
: "成绩优秀。"
}}
</text>
<text :style="{ marginTop: '12px' }"
>针对您本次的练习{{
result.spreadEvaluation === "Dispersed"
? "我们建议您充分练习推弓、靠位以及撒放动作一致性,以持续提高成绩。"
: totalRing >= 100
? "我们建议您继续保持即可。"
: `我们建议您将设备的瞄准器${
directionAdjusts[result.adjustmentHint]
}调整。`
}}</text
>
</view>
</ScreenHint>
<BowData
:arrows="result.arrows"
@@ -193,4 +226,10 @@ onMounted(() => {
font-size: 20px;
margin: 0 2px;
}
.coach-comment {
display: flex;
flex-direction: column;
font-size: 14px;
margin-top: -20px;
}
</style>