This commit is contained in:
kron
2025-06-08 12:52:49 +08:00
parent 5a50632c6c
commit deff79aa7b
15 changed files with 900 additions and 139 deletions

View File

@@ -20,7 +20,16 @@ defineProps({
type: Number,
default: 45,
},
borderColor: {
type: Number,
default: 0,
},
});
const borderColors = {
0: "#fff",
1: "#64BAFF",
2: "#FF6767",
};
</script>
<template>
@@ -29,7 +38,10 @@ defineProps({
v-if="frame"
src="../static/avatar-frame.png"
mode="widthFix"
:style="{ width: Number(size) + 10 + 'px', height: Number(size) + 10 + 'px' }"
:style="{
width: Number(size) + 10 + 'px',
height: Number(size) + 10 + 'px',
}"
class="avatar-frame"
/>
<image
@@ -54,7 +66,12 @@ defineProps({
<image
:src="src"
mode="widthFix"
:style="{ width: size + 'px', height: size + 'px' }"
:style="{
width: size + 'px',
height: size + 'px',
borderColor: borderColors[borderColor],
}"
class="avatar-image"
/>
</view>
</template>
@@ -85,7 +102,7 @@ defineProps({
border-top-left-radius: 50%;
border-bottom-right-radius: 50%;
}
.avatar > image:last-child {
.avatar-image {
border-radius: 50%;
border: 1px solid #fff;
}

View File

@@ -29,10 +29,20 @@ defineProps({
<view>
<Avatar v-if="blueTeam[0]" :src="blueTeam[0].avatar" frame />
<text>{{ blueTeam[0].name }}</text>
<image
v-if="blueTeam[0].winner"
src="../static/winner-badge.png"
mode="widthFix"
/>
</view>
<view>
<Avatar v-if="redTeam[0]" :src="redTeam[0].avatar" frame />
<text>{{ redTeam[0].name }}</text>
<image
v-if="redTeam[0].winner"
src="../static/winner-badge.png"
mode="widthFix"
/>
</view>
</view>
</view>
@@ -47,7 +57,8 @@ defineProps({
.container > image:first-child {
position: absolute;
width: 100%;
top: -10px;
top: -5px;
z-index: 1;
}
.players {
display: flex;
@@ -61,8 +72,10 @@ defineProps({
justify-content: center;
color: #fff9;
font-size: 14px;
padding-top: 20px;
margin-top: 20px;
padding-top: 5px;
overflow: hidden;
position: relative;
}
.players > view:first-child {
background-color: #364469;
@@ -70,4 +83,13 @@ defineProps({
.players > view:last-child {
background-color: #692735;
}
.players > view > text {
margin-top: 5px;
}
.players > view > image:last-child {
position: absolute;
width: 60px;
right: 0;
bottom: 0;
}
</style>

View File

@@ -1,4 +1,5 @@
<script setup>
import { ref, watch } from "vue";
import BowPower from "@/components/BowPower.vue";
const props = defineProps({
totalRound: {
@@ -31,6 +32,23 @@ const props = defineProps({
},
});
const showRoundTips = ref(false);
watch(
() => props.scores,
(newVal) => {
if (newVal.length > 0) {
showRoundTips.value = true;
setTimeout(() => {
showRoundTips.value = false;
}, 2000);
}
},
{
deep: true,
}
);
function calcRealX(num) {
const len = 20 + num;
return `calc(${(len / 40) * 100}% - 10px)`;
@@ -50,9 +68,15 @@ function calcRealY(num) {
"/" +
totalRound
}}</text>
<BowPower :power="power" />
<BowPower v-if="power > 0" :power="power" />
</view>
<view class="target">
<view v-if="scores.length && showRoundTips" class="e-value fade-in"
>经验 +1</view
>
<view v-if="scores.length && showRoundTips" class="round-tip fade-in"
>{{ scores[scores.length - 1].ring }}<text></text></view
>
<image
v-for="(bow, index) in scores"
:key="index"
@@ -81,6 +105,28 @@ function calcRealY(num) {
.target {
position: relative;
}
.e-value {
position: absolute;
top: 30%;
left: 60%;
background-color: #0006;
color: #fff;
font-size: 12px;
padding: 4px 7px;
border-radius: 5px;
}
.round-tip {
position: absolute;
top: 38%;
left: 60%;
color: #fff;
font-size: 30px;
font-weight: bold;
}
.round-tip > text {
font-size: 18px;
margin-left: 5px;
}
.target > image:last-child {
width: 100%;
}

View File

@@ -0,0 +1,162 @@
<script setup>
import { ref } from "vue";
import BowTarget from "@/components/BowTarget.vue";
import Avatar from "@/components/Avatar.vue";
const props = defineProps({
show: {
type: Boolean,
default: false,
},
onClose: {
type: Function,
default: () => {},
},
});
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
<view>
<text>5人大乱斗</text>
<view @click="onClose">
<image src="../static/close-white.png" mode="widthFix" />
</view>
</view>
<view class="rank-rows">
<view v-for="(item, index) in [1, 2, 3, 4, 5]" :key="index">
<image v-if="index === 0" src="../static/champ1.png" mode="widthFix" />
<image v-if="index === 1" src="../static/champ2.png" mode="widthFix" />
<image v-if="index === 2" src="../static/champ3.png" mode="widthFix" />
<view v-if="index > 2" class="rank-view">{{ item }}</view>
<Avatar src="../static/avatar.png" :size="24" />
<text>积分 + 117</text>
<text>117</text>
<text v-for="(round, index2) in new Array(12).fill(9)" :key="index2">
{{ round }}
</text>
</view>
</view>
<view :style="{ width: '95%', marginTop: '-5%' }">
<BowTarget />
</view>
<view class="score-text"
><text :style="{ color: '#fed847' }">12</text>支箭<text
:style="{ color: '#fed847' }"
>100</text
></view
>
<view class="score-row">
<view
v-for="(score, index) in new Array(12).fill(9)"
:key="index"
class="score-item"
:style="{ width: '13vw', height: '13vw' }"
>
{{ score }}
</view>
</view>
</view>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 10;
}
.container > view:first-child {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 20px 0;
color: #fff;
position: relative;
font-size: 20px;
}
.container > view:first-child > view:last-child {
position: absolute;
left: 5px;
top: 25px;
}
.container > view:first-child > view:last-child > image {
width: 40px;
}
.score-text {
width: 100%;
color: #fff;
text-align: center;
font-size: 16px;
margin-bottom: 6px;
}
.score-row {
margin: 10px;
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
}
.score-item {
background-image: url("../static/score-bg.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
color: #fed847;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
margin: 3px;
}
.rank-rows {
display: flex;
flex-direction: column;
width: 100%;
border-top: 1px solid #fff3;
}
.rank-rows > view {
width: clac(100% - 20px);
color: #fff9;
border-bottom: 1px solid #fff3;
padding: 7px 10px;
display: flex;
align-items: center;
font-size: 14px;
overflow-x: auto;
}
.rank-rows > view::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.rank-rows > view > image:first-child,
.rank-rows > view > view:first-child {
width: 20px;
height: 20px;
line-height: 20px;
text-align: center;
font-size: 12px;
margin-right: 10px;
flex: 0 0 auto;
}
.rank-rows > view > view:first-child {
background-color: #6d6d6d;
border-radius: 50%;
}
.rank-rows > view > text {
margin-left: 10px;
flex: 0 0 auto;
}
.rank-rows > view > text:nth-child(4) {
color: #fed847;
padding-right: 10px;
border-right: 1px solid #fff3;
}
</style>

View File

@@ -0,0 +1,134 @@
<script setup>
import { ref } from "vue";
import BowTarget from "@/components/BowTarget.vue";
import Avatar from "@/components/Avatar.vue";
const props = defineProps({
show: {
type: Boolean,
default: false,
},
onClose: {
type: Function,
default: () => {},
},
});
const selected = ref(0);
const tabs = ["所有轮次", "决金箭", "第三轮", "第二轮", "第一轮"];
</script>
<template>
<view class="container" :style="{ display: show ? 'flex' : 'none' }">
<view>
<text>1v1排位赛</text>
<view @click="onClose">
<image src="../static/close-white.png" mode="widthFix" />
</view>
</view>
<view>
<view
v-for="(tab, index) in tabs"
:key="index"
@click="() => (selected = index)"
:class="selected === index ? 'selected-tab' : ''"
>
{{ tab }}
</view>
</view>
<view :style="{ width: '95%' }">
<BowTarget />
</view>
<view class="score-row">
<Avatar src="../static/avatar.png" :borderColor="1" />
<view
v-for="(score, index) in [7, 9, 7, 3, 8]"
:key="index"
class="score-item"
:style="{ width: '13vw', height: '13vw' }"
>
{{ score }}
</view>
</view>
<view class="score-row">
<Avatar src="../static/avatar.png" :borderColor="2" />
<view
v-for="(score, index) in [7, 9, 7, 3, 8]"
:key="index"
class="score-item"
:style="{ width: '13vw', height: '13vw' }"
>
{{ score }}
</view>
</view>
</view>
</template>
<style scoped>
.container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.8);
flex-direction: column;
justify-content: center;
align-items: center;
z-index: 10;
}
.container > view:first-child {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 40px 0;
color: #fff;
position: relative;
font-size: 20px;
}
.container > view:first-child > view:last-child {
position: absolute;
right: 5px;
top:32px;
}
.container > view:first-child > view:last-child > image {
width: 40px;
}
.container > view:nth-child(2) {
display: flex;
align-items: center;
justify-content: flex-start;
width: 100%;
color: #fff9;
padding-left: 15px;
}
.container > view:nth-child(2) > view {
border: 1px solid #fff9;
border-radius: 20px;
padding: 7px 10px;
margin: 0 5px;
font-size: 14px;
}
.selected-tab {
background-color: #fed847;
border-color: #fed847 !important;
color: #000;
}
.score-row {
margin: 10px;
display: flex;
align-items: center;
justify-content: flex-start;
}
.score-item {
background-image: url("../static/score-bg.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
color: #fed847;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
margin-left: 10px;
}
</style>

View File

@@ -39,25 +39,21 @@ const toUserPage = () => {
<view class="user-details">
<view class="user-name">
<text>{{ user.nickName }}</text>
<image src="../static/vip1.png" mode="widthFix" />
<image class="user-name-image" src="../static/vip1.png" mode="widthFix" />
</view>
<view class="user-stats">
<text class="level-tag">钻石1级</text>
<text class="level-tag">{{ user.lvl }}</text>
<text class="level-tag level-tag-first">钻石1级</text>
<text class="level-tag level-tag-second">{{ user.lvl }}</text>
<view class="rank-tag">
<view :style="{ width: '40%' }" />
<text>{{ user.lvl }}/{{ user.lvlPoints }}</text>
<view class="rank-tag-progress" :style="{ width: '40%' }" />
<text class="rank-tag-text">{{ user.lvl }}/{{ user.lvlPoints }}</text>
</view>
</view>
</view>
<view v-if="showRank === true" class="rank-info">
<image src="../static/global-rank.png" mode="widthFix" />
<image class="rank-info-image" src="../static/global-rank.png" mode="widthFix" />
<text>本赛季全国</text>
<text class="rank-number"
><text :style="{ color: '#ffd700' }"
>{{ user.points }}/{{ user.rankLvl }}</text
></text
>
<text class="rank-number"><text :style="{ color: '#ffd700' }">{{ user.points }}/{{ user.rankLvl }}</text></text>
</view>
</view>
</template>
@@ -83,7 +79,7 @@ const toUserPage = () => {
margin-bottom: 5px;
}
.user-name > image {
.user-name-image {
margin-left: 5px;
width: 20px;
}
@@ -97,11 +93,13 @@ const toUserPage = () => {
text-align: center;
line-height: 16px;
}
.level-tag:first-child {
.level-tag-first {
width: 45px;
background: #5f51ff;
}
.level-tag:nth-child(2) {
.level-tag-second {
width: 30px;
background: #09c504;
}
@@ -115,17 +113,17 @@ const toUserPage = () => {
.rank-tag {
position: relative;
background-color: #00000038;
width: 56px;
width: 55px;
height: 16px;
}
.rank-tag > view:first-child {
.rank-tag-progress {
background: #ffa711;
height: 100%;
border-radius: 12px;
}
.rank-tag > text {
.rank-tag-text {
position: absolute;
top: 0;
left: 5px;
@@ -134,16 +132,16 @@ const toUserPage = () => {
.rank-info {
text-align: left;
font-size: 10px;
font-size: 12px;
position: relative;
color: #b3b3b3;
padding-left: 8px;
}
.rank-info > image {
.rank-info-image {
position: absolute;
top: -8px;
left: -8px;
top: -6px;
left: -9px;
width: 90px;
}