添加教练点评
This commit is contained in:
@@ -5,6 +5,7 @@ import SButton from "@/components/SButton.vue";
|
|||||||
import ScreenHint from "@/components/ScreenHint.vue";
|
import ScreenHint from "@/components/ScreenHint.vue";
|
||||||
import BowData from "@/components/BowData.vue";
|
import BowData from "@/components/BowData.vue";
|
||||||
import { wxShare } from "@/util";
|
import { wxShare } from "@/util";
|
||||||
|
import { directionAdjusts } from "@/constants";
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
onClose: {
|
onClose: {
|
||||||
type: Function,
|
type: Function,
|
||||||
@@ -31,6 +32,7 @@ const showPanel = ref(true);
|
|||||||
const showComment = ref(false);
|
const showComment = ref(false);
|
||||||
const showBowData = ref(false);
|
const showBowData = ref(false);
|
||||||
const finished = ref(false);
|
const finished = ref(false);
|
||||||
|
const totalRing = ref(0);
|
||||||
const closePanel = () => {
|
const closePanel = () => {
|
||||||
showPanel.value = false;
|
showPanel.value = false;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -38,6 +40,12 @@ const closePanel = () => {
|
|||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
if (props.result.arrows) {
|
||||||
|
totalRing.value = props.result.arrows.reduce(
|
||||||
|
(last, next) => last + next.ring,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
}
|
||||||
finished.value =
|
finished.value =
|
||||||
props.result.arrows && props.result.arrows.length === props.total;
|
props.result.arrows && props.result.arrows.length === props.total;
|
||||||
});
|
});
|
||||||
@@ -62,11 +70,7 @@ onMounted(() => {
|
|||||||
:style="{ transform: `translateY(${showPanel ? '0%' : '100%'})` }"
|
:style="{ transform: `translateY(${showPanel ? '0%' : '100%'})` }"
|
||||||
>
|
>
|
||||||
<view>
|
<view>
|
||||||
<text
|
<text>本局成绩(共{{ totalRing }}环):</text>
|
||||||
>本局成绩(共{{
|
|
||||||
result.arrows.reduce((last, next) => last + next.ring, 0)
|
|
||||||
}}环):</text
|
|
||||||
>
|
|
||||||
<button @click="() => (showBowData = true)">
|
<button @click="() => (showBowData = true)">
|
||||||
<text>查看靶纸</text>
|
<text>查看靶纸</text>
|
||||||
<image
|
<image
|
||||||
@@ -102,8 +106,37 @@ onMounted(() => {
|
|||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<ScreenHint :show="showComment" :onClose="() => (showComment = false)">
|
<ScreenHint
|
||||||
{{ result.adjustmentHint }}
|
: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>
|
</ScreenHint>
|
||||||
<BowData
|
<BowData
|
||||||
:arrows="result.arrows"
|
:arrows="result.arrows"
|
||||||
@@ -193,4 +226,10 @@ onMounted(() => {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
margin: 0 2px;
|
margin: 0 2px;
|
||||||
}
|
}
|
||||||
|
.coach-comment {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
font-size: 14px;
|
||||||
|
margin-top: -20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -64,3 +64,14 @@ export const orderStatusNames = {
|
|||||||
8: "已退款",
|
8: "已退款",
|
||||||
9: "拒绝退款",
|
9: "拒绝退款",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const directionAdjusts = {
|
||||||
|
AdjustLowerRight: "向右下方调瞄",
|
||||||
|
AdjustDown: "向下方调瞄",
|
||||||
|
AdjustLowerLeft: "向左下方调瞄",
|
||||||
|
AdjustLeft: "向左侧调瞄",
|
||||||
|
AdjustUpperLeft: "向左上侧调瞄",
|
||||||
|
AdjustUp: "向上方调瞄",
|
||||||
|
AdjustUpperRight: "向右上方调瞄",
|
||||||
|
AdjustRight: "向右侧调瞄",
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user