update:优化样式

This commit is contained in:
2026-06-01 15:39:40 +08:00
parent f5497c534d
commit 72518fa17e
4 changed files with 73 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
<script setup> <script setup>
import AppBackground from "@/components/AppBackground.vue"; import AppBackground from "@/components/AppBackground.vue";
import Avatar from "@/components/Avatar.vue"; import Avatar from "@/components/Avatar.vue";
import BowTarget from "@./BowTarget.vue"; import BowTarget from "./BowTarget.vue";
import ScorePanel from "./ScorePanel.vue"; import ScorePanel from "./ScorePanel.vue";
import useStore from "@/store"; import useStore from "@/store";
import { storeToRefs } from "pinia"; import { storeToRefs } from "pinia";
@@ -30,7 +30,7 @@ const props = defineProps({
<template> <template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }"> <view class="container" :style="{ display: show ? 'flex' : 'none' }">
<AppBackground :type="1" /> <AppBackground :type="10" />
<view class="header"> <view class="header">
<view> <view>
<Avatar :src="user.avatar" :rankLvl="user.rankLvl" :size="45" /> <Avatar :src="user.avatar" :rankLvl="user.rankLvl" :size="45" />
@@ -40,7 +40,7 @@ const props = defineProps({
</view> </view>
</view> </view>
<view @click="onClose"> <view @click="onClose">
<image src="../static/close-white.png" mode="widthFix" /> <image src="/static/close-white.png" mode="widthFix" />
</view> </view>
</view> </view>
<view :style="{ width: '100%', marginBottom: '20px' }"> <view :style="{ width: '100%', marginBottom: '20px' }">

View File

@@ -23,13 +23,24 @@ const props = defineProps({
}, },
}); });
const items = ref(new Array(props.total).fill(9)); const items = ref(new Array(props.total).fill(9));
const width = ref(92);
const itemWidth = ref(0);
const bgImages = [ const bgImages = [
"../static/complete-light1.png", "../static/complete-light1.png",
"../static/complete-light2.png", "../static/complete-light2.png",
]; ];
const bgIndex = ref(0); const bgIndex = ref(0);
const getDisplayText = (arrow) => {
if (!arrow) return "-";
if (arrow.ringX) return "X";
return arrow.ring ?? "-";
};
const isLowScore = (arrow) => {
if (!arrow || arrow.ringX) return false;
const ring = Number(arrow.ring);
return Number.isFinite(ring) && ring < 6;
};
watch( watch(
() => props.total, () => props.total,
(newValue) => { (newValue) => {
@@ -69,55 +80,77 @@ onBeforeUnmount(() => {
v-for="(_, index) in items" v-for="(_, index) in items"
:key="index" :key="index"
class="score-item" class="score-item"
:style="{
width: 100 / (rowCount + 2) + 'vw',
height: 100 / (rowCount + 2) + 'vw',
lineHeight: 100 / (rowCount + 2) + 'vw',
fontSize: fontSize + 'px',
margin: 100 / (total * 2) + 'px',
}"
> >
<image src="/static/score-bg.png" mode="widthFix" /> <image
class="score-item-bg"
:src="
isLowScore(arrows[index])
? '/static/training-difficulty-design/block-gray.png'
: '/static/training-difficulty-design/block-gold.png'
"
/>
<text <text
:style="{ fontWeight: arrows[index] !== undefined ? 'bold' : 'normal' }" class="score-value"
>{{ :class="{ 'score-value--low': isLowScore(arrows[index]) }"
!arrows[index] ? "-" : arrows[index].ringX ? "X" : arrows[index].ring
}}</text
> >
{{ getDisplayText(arrows[index]) }}
</text>
</view> </view>
</view> </view>
</template> </template>
<style scoped> <style scoped lang="scss">
.container { .container {
width: 92vw; width: 100%;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; box-sizing: border-box;
margin: 0 4vw;
position: relative; position: relative;
padding: 1vw 0; padding: 30rpx 40rpx 0 40rpx;
} }
.score-item { .score-item {
/* background-image: url("../static/score-bg.png"); position: relative;
background-size: cover; width: 100rpx;
background-repeat: no-repeat; height: 56rpx;
background-position: center; */
color: #fed847;
display: flex; display: flex;
justify-content: center;
align-items: center; align-items: center;
position: relative; justify-content: center;
overflow: hidden;
margin-right: 14rpx;
margin-bottom: 14rpx;
} }
.score-item > image {
.score-item:nth-child(6n) {
margin-right: 0;
}
.score-item-bg {
position: absolute; position: absolute;
width: 100%; top: 0;
top: 5%; left: 0;
width: 100rpx;
height: 56rpx;
} }
.score-item > text {
.score-value {
position: relative; position: relative;
margin-top: 2px; z-index: 1;
min-width: 28rpx;
text-align: center;
font-size: 34rpx;
line-height: 1;
font-weight: 700;
font-style: italic;
color: #f6e3b2;
text-shadow: 0 2rpx 0 rgba(36, 36, 48, 0.5);
margin-left: -10rpx;
} }
.score-value--low {
color: #cfcfcf;
text-shadow: 0 2rpx 0 rgba(0, 0, 0, 0.5);
}
.complete-light { .complete-light {
position: absolute; position: absolute;
} }

View File

@@ -1,5 +1,5 @@
<script setup> <script setup>
import IconButton from "./IconButton.vue"; import IconButton from "@/components/IconButton.vue";
const props = defineProps({ const props = defineProps({
show: { show: {
@@ -27,29 +27,29 @@ const getContentHeight = () => {
<view class="scale-in" :style="{ height: getContentHeight() }"> <view class="scale-in" :style="{ height: getContentHeight() }">
<image <image
v-if="mode === 'normal'" v-if="mode === 'normal'"
src="../static/screen-hint-bg.png" src="/static/screen-hint-bg.png"
mode="widthFix" mode="widthFix"
/> />
<image <image
v-if="mode === 'tall'" v-if="mode === 'tall'"
src="../static/coach-comment.png" src="/static/coach-comment.png"
mode="widthFix" mode="widthFix"
/> />
<image <image
v-if="mode === 'square'" v-if="mode === 'square'"
src="../static/prompt-bg-square.png" src="/static/prompt-bg-square.png"
mode="widthFix" mode="widthFix"
/> />
<image <image
v-if="mode === 'small'" v-if="mode === 'small'"
src="../static/finish-frame.png" src="/static/finish-frame.png"
mode="widthFix" mode="widthFix"
/> />
<slot /> <slot />
</view> </view>
<IconButton <IconButton
v-if="!!onClose" v-if="!!onClose"
src="../static/close-gold-outline.png" src="/static/close-gold-outline.png"
:width="30" :width="30"
:onClick="onClose" :onClick="onClose"
/> />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

After

Width:  |  Height:  |  Size: 188 KiB