diff --git a/src/components/ScoreResult.vue b/src/components/ScoreResult.vue index 9c21411..0d8a937 100644 --- a/src/components/ScoreResult.vue +++ b/src/components/ScoreResult.vue @@ -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%'})` }" > - 本局成绩(共{{ - result.arrows.reduce((last, next) => last + next.ring, 0) - }}环): + 本局成绩(共{{ totalRing }}环):