feat(admin,player,api): 玩家账号密码管理与代理上下分
新增玩家头像、可查密码与全局改密/改账号开关;玩家资料页合并账号密码展示;代理直属玩家列表支持自定义上下分。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
162
apps/player/src/components/PlayerAvatarPicker.vue
Normal file
162
apps/player/src/components/PlayerAvatarPicker.vue
Normal file
@@ -0,0 +1,162 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { BUILTIN_PLAYERS, playerAvatarUrl } from '@thebet365/shared';
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: string | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: string | null];
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const keyword = ref('');
|
||||
|
||||
const filtered = computed(() => {
|
||||
const q = keyword.value.trim().toLowerCase();
|
||||
if (!q) return BUILTIN_PLAYERS;
|
||||
return BUILTIN_PLAYERS.filter(
|
||||
(p) =>
|
||||
p.name.toLowerCase().includes(q) ||
|
||||
p.country.toLowerCase().includes(q) ||
|
||||
p.position.toLowerCase().includes(q),
|
||||
);
|
||||
});
|
||||
|
||||
function select(key: string) {
|
||||
emit('update:modelValue', props.modelValue === key ? null : key);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="picker">
|
||||
<div class="picker-head">
|
||||
<label class="picker-label">{{ t('profile.avatar') }}</label>
|
||||
<input
|
||||
v-model="keyword"
|
||||
type="search"
|
||||
class="picker-search"
|
||||
:placeholder="t('profile.avatar_search')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="picker-grid">
|
||||
<button
|
||||
v-for="player in filtered"
|
||||
:key="player.id"
|
||||
type="button"
|
||||
class="picker-item"
|
||||
:class="{ active: modelValue === player.id }"
|
||||
@click="select(player.id)"
|
||||
>
|
||||
<img :src="playerAvatarUrl(player.id) ?? ''" :alt="player.name" class="picker-photo" />
|
||||
<span class="picker-name">{{ player.name }}</span>
|
||||
<span class="picker-meta">{{ player.position }} · {{ player.country }}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<p v-if="!filtered.length" class="picker-empty">{{ t('profile.avatar_empty') }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.picker {
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.picker-head {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.picker-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.picker-search {
|
||||
width: 100%;
|
||||
padding: 8px 10px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
color: var(--text);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.picker-search:focus {
|
||||
outline: none;
|
||||
border-color: var(--border-gold-soft);
|
||||
}
|
||||
|
||||
.picker-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 8px;
|
||||
max-height: 280px;
|
||||
overflow-y: auto;
|
||||
padding-right: 2px;
|
||||
}
|
||||
|
||||
.picker-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
padding: 8px 4px 6px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border);
|
||||
background: #0a0a0a;
|
||||
cursor: pointer;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.picker-item.active {
|
||||
border-color: var(--border-gold-soft);
|
||||
box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.18);
|
||||
background: rgba(212, 175, 55, 0.08);
|
||||
}
|
||||
|
||||
.picker-photo {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
object-position: top;
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.picker-name {
|
||||
width: 100%;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
color: var(--text);
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.picker-meta {
|
||||
width: 100%;
|
||||
font-size: 9px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.picker-empty {
|
||||
margin: 8px 0 0;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user