Fix: 修正名片资产格子在部分环境下垂直堆叠的BUG改为Flex布局,并修复省市所在地因为缓存匹配不上导致不显示的问题

This commit is contained in:
2026-02-27 12:05:57 +08:00
parent 006da4f5d6
commit 1834a8e9ff
2 changed files with 6 additions and 5 deletions
+2 -1
View File
@@ -74,7 +74,8 @@ class UserController extends Controller
try {
$position = Location::get($ipToLookup);
if ($position) {
$data['location'] = ($position->countryName === '中国' || $position->countryName === 'Local') ?
$isChinaOrLocal = in_array($position->countryCode ?? $position->isoCode ?? '', ['CN', 'TW', 'HK', 'MO']) || $position->countryName === 'Local';
$data['location'] = $isChinaOrLocal ?
trim(($position->regionName ?? '') . ' ' . ($position->cityName ?? '')) :
($position->countryName ?? '未知区域');
@@ -332,23 +332,23 @@
{{-- 详细信息区 (等级高看等级低,或自己看自己时才有这些字段) --}}
<div x-show="userInfo.exp_num !== undefined"
style="margin-top: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;">
style="margin-top: 12px; display: flex; flex-direction: row; gap: 8px;">
<!-- 经验 -->
<div
style="background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
style="flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
<span style="color: #64748b; font-size: 11px; margin-bottom: 2px;">经验</span>
<span x-text="userInfo.exp_num"
style="font-weight: 700; color: #4f46e5; font-size: 14px;"></span>
</div>
<!-- 金币 -->
<div
style="background: #fdfae8; border: 1px solid #fef08a; border-radius: 8px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
style="flex: 1; background: #fdfae8; border: 1px solid #fef08a; border-radius: 6px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
<span style="color: #b45309; font-size: 11px; margin-bottom: 2px;">金币</span>
<span x-text="userInfo.jjb" style="font-weight: 700; color: #d97706; font-size: 14px;"></span>
</div>
<!-- 魅力 -->
<div
style="background: #fdf2f8; border: 1px solid #fbcfe8; border-radius: 8px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
style="flex: 1; background: #fdf2f8; border: 1px solid #fbcfe8; border-radius: 6px; padding: 6px 0; display: flex; flex-direction: column; align-items: center; justify-content: center;">
<span style="color: #be185d; font-size: 11px; margin-bottom: 2px;">魅力</span>
<span x-text="userInfo.meili" style="font-weight: 700; color: #db2777; font-size: 14px;"></span>
</div>