feat: 支持上传及查看高清原图自定义头像

This commit is contained in:
2026-04-02 17:07:24 +08:00
parent caf4742dd8
commit b4d6e0e23b
5 changed files with 44 additions and 9 deletions
+1
View File
@@ -56,6 +56,7 @@
'username' => $botUser->username,
'level' => $botUser->user_level,
'sex' => $botUser->sex,
'headface' => $botUser->headface,
'headfaceUrl' => $botUser->headfaceUrl,
'vip_icon' => $botUser->vipIcon(),
'vip_name' => $botUser->vipName(),
@@ -87,6 +87,7 @@
function userCardComponent() {
return {
showUserModal: false,
showOriginalLightbox: false,
userInfo: {
position_history: []
},
@@ -605,7 +606,12 @@
<div class="profile-row">
<img class="profile-avatar" x-show="userInfo.headface"
:src="(userInfo.headface || '1.gif').startsWith('storage/') ? '/' + (userInfo.headface || '1.gif') : '/images/headface/' + (userInfo.headface || '1.gif')"
x-on:error="$el.style.display='none'">
x-on:error="$el.style.display='none'"
style="cursor: pointer; transition: transform 0.2s;"
x-on:click="if(userInfo.headface) showOriginalLightbox = true"
title="点击查看大图"
onmouseover="this.style.transform='scale(1.05)'"
onmouseout="this.style.transform='scale(1)'">
<div class="profile-info">
<h4>
<span x-text="userInfo.username"></span>
@@ -1071,6 +1077,15 @@
</div>
</div>
</div>
{{-- 头像原图全屏大图预览灯箱 --}}
<template x-if="userInfo">
<div x-show="showOriginalLightbox" style="display: none; z-index: 10000; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px);" class="modal-overlay" x-on:click.self="showOriginalLightbox = false" x-transition.opacity>
<div style="position: absolute; top: 20px; right: 26px; color: rgba(255,255,255,0.7); font-size: 36px; cursor: pointer; transition: color 0.2s;" x-on:click="showOriginalLightbox = false" onmouseover="this.style.color='white'" onmouseout="this.style.color='rgba(255,255,255,0.7)'">&times;</div>
<img :src="userInfo.headface_original ? userInfo.headface_original : ((userInfo.headface || '1.gif').startsWith('storage/') ? '/' + (userInfo.headface || '1.gif') : '/images/headface/' + (userInfo.headface || '1.gif'))"
style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.5);">
</div>
</template>
</div>
{{-- ═══════════ 奖励金币独立弹窗 ═══════════ --}}