1v1流程调试完成
This commit is contained in:
@@ -12,15 +12,22 @@ defineProps({
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
currentShooterId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view class="container">
|
||||
<image v-if="avatar" class="avatar" :src="avatar" mode="widthFix" />
|
||||
<view v-if="!avatar" :style="{ height: 20 + blueTeam.length * 20 + 'px' }">
|
||||
<view
|
||||
v-if="blueTeam.length && redTeam.length"
|
||||
:style="{ height: 20 + blueTeam.length * 20 + 'px' }"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in blueTeam"
|
||||
v-for="(player, index) in blueTeam"
|
||||
:key="index"
|
||||
:style="{
|
||||
top: index * 20 + 'px',
|
||||
@@ -30,51 +37,52 @@ defineProps({
|
||||
>
|
||||
<image
|
||||
class="avatar"
|
||||
:src="item.avatar"
|
||||
:src="player.avatar"
|
||||
mode="widthFix"
|
||||
:style="{
|
||||
borderColor: index === 0 ? '#5fadff' : '#fff',
|
||||
borderColor: currentShooterId === player.id ? '#5fadff' : '#fff',
|
||||
}"
|
||||
/>
|
||||
<text
|
||||
:style="{
|
||||
color: index === 0 ? '#5fadff' : '#fff',
|
||||
fontSize: index === 0 ? 16 : 12 + 'px',
|
||||
color: currentShooterId === player.id ? '#5fadff' : '#fff',
|
||||
fontSize: currentShooterId === player.id ? 16 : 12 + 'px',
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
{{ player.name }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
v-if="!avatar"
|
||||
:style="{
|
||||
height: 20 + blueTeam.length * 20 + 'px',
|
||||
height: 20 + redTeam.length * 20 + 'px',
|
||||
}"
|
||||
>
|
||||
<view
|
||||
v-for="(item, index) in blueTeam"
|
||||
v-for="(player, index) in redTeam"
|
||||
:key="index"
|
||||
:style="{
|
||||
top: index * 20 + 'px',
|
||||
zIndex: blueTeam.length - index,
|
||||
zIndex: redTeam.length - index,
|
||||
right: 0,
|
||||
}"
|
||||
>
|
||||
<text
|
||||
:style="{
|
||||
color: index === 0 ? '#ff6060' : '#fff',
|
||||
fontSize: index === 0 ? 16 : 12 + 'px',
|
||||
color: currentShooterId === player.id ? '#ff6060' : '#fff',
|
||||
fontSize: currentShooterId === player.id ? 16 : 12 + 'px',
|
||||
textAlign: 'right',
|
||||
}"
|
||||
>
|
||||
{{ item.name }}
|
||||
{{ player.name }}
|
||||
</text>
|
||||
<image
|
||||
class="avatar"
|
||||
:src="item.avatar"
|
||||
:src="player.avatar"
|
||||
mode="widthFix"
|
||||
:style="{
|
||||
borderColor: index === 0 ? '#ff6060' : '#fff',
|
||||
borderColor: currentShooterId === player.id ? '#ff6060' : '#fff',
|
||||
}"
|
||||
/>
|
||||
</view>
|
||||
@@ -104,6 +112,8 @@ defineProps({
|
||||
}
|
||||
.container > view > view > text {
|
||||
margin: 0 10px;
|
||||
overflow: hidden;
|
||||
width: 100px;
|
||||
}
|
||||
.avatar {
|
||||
width: 40px;
|
||||
|
||||
Reference in New Issue
Block a user