完成单组练习接口调试

This commit is contained in:
kron
2025-05-29 23:45:44 +08:00
parent 6466c65b66
commit 9db31ce664
14 changed files with 282 additions and 122 deletions

View File

@@ -20,8 +20,11 @@ const props = defineProps({
type: Number,
default: 0,
},
scores: {
type: Array,
default: () => [],
},
});
const items = ref(new Array(props.total).fill(9));
const showPanel = ref(true);
const showComment = ref(false);
const closePanel = () => {
@@ -40,14 +43,22 @@ setTimeout(() => {
<view :class="['container-header', showPanel ? 'scale-in' : 'scale-out']">
<image src="../static/finish-tip.png" mode="widthFix" />
<image src="../static/finish-frame.png" mode="widthFix" />
<text>完成36箭获得36点经验</text>
<text
>完成{{ total }}获得{{
scores.reduce((last, next) => last + next, 0)
}}点经验</text
>
</view>
<view
class="container-content"
:style="{ transform: `translateY(${showPanel ? '0%' : '100%'})` }"
>
<view>
<text>本剧成绩{{ total }}</text>
<text
>本剧成绩{{
scores.reduce((last, next) => last + next, 0)
}}</text
>
<button>
<text>查看靶纸</text>
<image
@@ -58,7 +69,7 @@ setTimeout(() => {
</button>
</view>
<view :style="{ gridTemplateColumns: `repeat(${rowCount}, 1fr)` }">
<view v-for="(score, index) in items" :key="index">
<view v-for="(score, index) in scores" :key="index">
{{ score }}<text></text>
</view>
</view>