数据显示修改
This commit is contained in:
@@ -78,7 +78,10 @@ onBeforeUnmount(() => {
|
|||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<image src="../static/score-bg.png" mode="widthFix" />
|
<image src="../static/score-bg.png" mode="widthFix" />
|
||||||
<text>{{ scores[index] }}</text>
|
<text
|
||||||
|
:style="{ fontWeight: scores[index] !== undefined ? 'bold' : 'normal' }"
|
||||||
|
>{{ scores[index] !== undefined ? scores[index] : "-" }}</text
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@@ -111,7 +114,6 @@ onBeforeUnmount(() => {
|
|||||||
}
|
}
|
||||||
.score-item > text {
|
.score-item > text {
|
||||||
position: relative;
|
position: relative;
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
.complete-light {
|
.complete-light {
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ import { storeToRefs } from "pinia";
|
|||||||
const store = useStore();
|
const store = useStore();
|
||||||
const { user } = storeToRefs(store);
|
const { user } = storeToRefs(store);
|
||||||
const arrows = ref([]);
|
const arrows = ref([]);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
onLoad(async (options) => {
|
onLoad(async (options) => {
|
||||||
if (options.id) {
|
if (options.id) {
|
||||||
const result = await getPractiseAPI(options.id);
|
const result = await getPractiseAPI(options.id);
|
||||||
arrows.value = result.arrows;
|
arrows.value = result.arrows;
|
||||||
|
total.value = result.completed_arrows;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -43,8 +45,8 @@ onLoad(async (options) => {
|
|||||||
</view>
|
</view>
|
||||||
<ScorePanel
|
<ScorePanel
|
||||||
:completeEffect="false"
|
:completeEffect="false"
|
||||||
:rowCount="arrows.length === 12 ? 6 : 9"
|
:rowCount="total === 12 ? 6 : 9"
|
||||||
:total="arrows.length"
|
:total="total"
|
||||||
:scores="arrows.map((a) => a.ring)"
|
:scores="arrows.map((a) => a.ring)"
|
||||||
:margin="arrows.length === 12 ? 4 : 1"
|
:margin="arrows.length === 12 ? 4 : 1"
|
||||||
:fontSize="arrows.length === 12 ? 25 : 22"
|
:fontSize="arrows.length === 12 ? 25 : 22"
|
||||||
|
|||||||
Reference in New Issue
Block a user