From 88d772e53a82147ef7b07a79826cd99c6c5800a1 Mon Sep 17 00:00:00 2001 From: lkddi Date: Fri, 27 Feb 2026 02:11:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E5=8C=96=EF=BC=9A=E7=95=99=E8=A8=80?= =?UTF-8?q?=E6=9D=BF=E6=B6=88=E6=81=AF=E5=8D=A1=E7=89=87=E9=87=8D=E6=9E=84?= =?UTF-8?q?=E4=B8=BA=E6=A0=87=E9=A2=98=E6=A0=8F+=E6=AD=A3=E6=96=87?= =?UTF-8?q?=E7=9A=84=E4=B8=A4=E6=AE=B5=E5=BC=8F=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 头部区域:显示发件人首字符圆形头像、两端收发信息、时间戳 - 正文区域:靠左对齐、高度随内容自适应、去掉多余上下空白 - 私密信件用粉色背景条和徽标标识 - 悬停时出现删除按钮,hover 阴影微增 --- resources/views/guestbook/index.blade.php | 60 +++++++++++++---------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/resources/views/guestbook/index.blade.php b/resources/views/guestbook/index.blade.php index e03e4e6..5039b5d 100644 --- a/resources/views/guestbook/index.blade.php +++ b/resources/views/guestbook/index.blade.php @@ -180,34 +180,39 @@ $isFromMe = Auth::check() && $msg->who === Auth::user()->username; @endphp + {{-- 消息卡片 --}}
+ class="bg-white rounded-2xl border {{ $isSecret ? 'border-pink-200 bg-pink-50/20' : 'border-gray-100' }} shadow-sm hover:shadow-md transition-shadow duration-200 overflow-hidden"> - @if ($isSecret) -
- 🔒 私密信件 + {{-- 卡片头部:发件人 / 收件人 / 时间 --}} +
+
+ {{-- 发件人头像占位 --}} +
+ {{ mb_substr($msg->who, 0, 1) }} +
+ {{ $msg->who }} + + + {{ $msg->towho ?: '大家' }} + + @if ($isSecret) + 🔒 + 您您话 + @endif
- @endif - -
-
- {{ $msg->who }} - - {{ $msg->towho ?: '大家' }} - 留言: -
-
+
{{ \Carbon\Carbon::parse($msg->post_time)->diffForHumans() }} - @if ($isFromMe || $isToMe || (Auth::check() && Auth::user()->user_level >= 15))
+ onsubmit="return confirm('确定要抓除这条留言吗?');" class="inline"> @csrf @method('DELETE')
@@ -215,18 +220,19 @@
-
- {!! nl2br(e($msg->text_body)) !!} + {{-- 正文内容 --}} +
+

+ {!! nl2br(e($msg->text_body)) !!}

+ {{-- 回复TA按钒 --}} @if (!Auth::check() || $msg->who !== Auth::user()->username) -
+