From 26c5f9d67a7b4f2878fbbd1bef5d60627724dbe4 Mon Sep 17 00:00:00 2001 From: userGyl Date: Mon, 9 Feb 2026 17:57:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/pages/b_page/reservation/view.dart | 2 +- .../lib/pages/c_page/mall/mall_view.dart | 4 +- ln_jq_app/lib/pages/c_page/message/view.dart | 237 +++++++++++------- 3 files changed, 152 insertions(+), 91 deletions(-) diff --git a/ln_jq_app/lib/pages/b_page/reservation/view.dart b/ln_jq_app/lib/pages/b_page/reservation/view.dart index 2689dd9..ae6d7a5 100644 --- a/ln_jq_app/lib/pages/b_page/reservation/view.dart +++ b/ln_jq_app/lib/pages/b_page/reservation/view.dart @@ -36,7 +36,7 @@ class ReservationPage extends GetView { _buildSystemTips(), SizedBox(height: 24), _buildLogoutButton(), - SizedBox(height: 75.h), + SizedBox(height: 95.h), ], ), ), diff --git a/ln_jq_app/lib/pages/c_page/mall/mall_view.dart b/ln_jq_app/lib/pages/c_page/mall/mall_view.dart index be9b622..edc480d 100644 --- a/ln_jq_app/lib/pages/c_page/mall/mall_view.dart +++ b/ln_jq_app/lib/pages/c_page/mall/mall_view.dart @@ -80,10 +80,10 @@ class MallPage extends GetView { ], ), ), - IconButton( + /*IconButton( onPressed: () {}, icon: const Icon(Icons.notifications_none, color: Color(0xFF333333)), - ), + ),*/ ], ), ); diff --git a/ln_jq_app/lib/pages/c_page/message/view.dart b/ln_jq_app/lib/pages/c_page/message/view.dart index 18b376b..6105b3b 100644 --- a/ln_jq_app/lib/pages/c_page/message/view.dart +++ b/ln_jq_app/lib/pages/c_page/message/view.dart @@ -12,40 +12,63 @@ class MessagePage extends GetView { Get.put(MessageController()); return Scaffold( - backgroundColor: const Color(0xFFF5F5F5), - appBar: AppBar(title: const Text('消息通知'), centerTitle: true), - body: Column( + backgroundColor: const Color(0xFFF7F9FB), + appBar: AppBar( + title: const Text('消息通知'), + centerTitle: true, + backgroundColor: Colors.white, + foregroundColor: Colors.black, + elevation: 0, + leading: IconButton( + icon: const Icon(Icons.arrow_back_ios, size: 20), + onPressed: () => Get.back(), + ), + ), + body: Stack( children: [ - Expanded( - child: Obx(() => SmartRefresher( - controller: controller.refreshController, - enablePullUp: true, - onRefresh: controller.onRefresh, - onLoading: controller.onLoading, - child: ListView.separated( - padding: const EdgeInsets.all(12), - itemCount: controller.messageList.length, - separatorBuilder: (_, __) => const SizedBox(height: 12), - itemBuilder: (context, index) { - return _buildMessageItem(context, controller.messageList[index]); - }, - ), - )), - ), + Obx(() => SmartRefresher( + controller: controller.refreshController, + enablePullUp: true, + onRefresh: controller.onRefresh, + onLoading: controller.onLoading, + child: ListView.builder( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20), + itemCount: controller.messageList.length, + itemBuilder: (context, index) { + return _buildMessageItem(context, controller.messageList[index]); + }, + ), + )), Obx(() => !controller.allRead.value - ? Container( - padding: const EdgeInsets.all(16), - color: Colors.white, - child: ElevatedButton( - onPressed: controller.markAllRead, - style: ElevatedButton.styleFrom( - backgroundColor: Colors.blue, - minimumSize: const Size(double.infinity, 44), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), - ), - child: const Text('全部标为已读', style: TextStyle(fontSize: 16, color: Colors.white)), - ), - ) + ? Positioned( + right: 20, + bottom: 50, + child: GestureDetector( + onTap: controller.markAllRead, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 14), + decoration: BoxDecoration( + color: const Color(0xFF007A45), + borderRadius: BorderRadius.circular(30), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.1), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: const Text( + '全部已读', + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), + ), + ), + ) : const SizedBox.shrink()), ], ), @@ -53,54 +76,92 @@ class MessagePage extends GetView { } Widget _buildMessageItem(BuildContext context, MessageModel item) { - return GestureDetector( - onTap: () { - controller.markRead(item); - _showMessageDialog(context, item); - }, - child: Container( - padding: const EdgeInsets.all(16), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - ), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - margin: const EdgeInsets.only(top: 6, right: 12), - width: 8, - height: 8, - decoration: BoxDecoration( - color: item.isRead == 1 ? Colors.grey[300] : const Color(0xFFFAAD14), - shape: BoxShape.circle, + return IntrinsicHeight( + child: Row( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // 左侧时间轴线条和圆点 + SizedBox( + width: 40, + child: Stack( + alignment: Alignment.topCenter, + children: [ + Container( + width: 1.5, + color: const Color(0xFFD8E2EE), + ), + Positioned( + top: 25, + child: Container( + width: 12, + height: 12, + decoration: BoxDecoration( + color: item.isRead == 1 + ? const Color(0xFFAAB6C3) + : const Color(0xFF4CAF50), + shape: BoxShape.circle, + border: Border.all(color: Colors.white, width: 2), + ), + ), + ), + ], + ), + ), + // 右侧内容卡片 + Expanded( + child: GestureDetector( + onTap: () { + controller.markRead(item); + _showMessageDialog(context, item); + }, + child: Container( + margin: const EdgeInsets.only(bottom: 16), + padding: const EdgeInsets.all(20), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(24), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.02), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + item.title, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + color: Color(0xFF333333), + ), + ), + const SizedBox(height: 10), + Text( + item.content, + style: const TextStyle( + fontSize: 14, + color: Color(0xFF666666), + height: 1.4, + ), + ), + const SizedBox(height: 12), + Text( + item.createTime, + style: const TextStyle( + fontSize: 12, + color: Color(0xFFCCCCCC), + ), + ), + ], + ), ), ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - item.title, - style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color: Colors.black87), - ), - const SizedBox(height: 8), - Text( - item.content, - style: TextStyle(fontSize: 14, color: Colors.grey[600]), - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - const SizedBox(height: 8), - Text( - item.createTime, - style: TextStyle(fontSize: 12, color: Colors.grey[400]), - ), - ], - ), - ), - ], - ), + ), + ], ), ); } @@ -111,7 +172,7 @@ class MessagePage extends GetView { barrierDismissible: true, builder: (context) { return Dialog( - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)), + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), child: Container( padding: const EdgeInsets.all(24), child: Column( @@ -122,22 +183,22 @@ class MessagePage extends GetView { item.title, style: const TextStyle(fontSize: 18, fontWeight: FontWeight.bold), ), - const SizedBox(height: 12), + const SizedBox(height: 16), Text( item.content, - style: const TextStyle(fontSize: 15, height: 1.5, color: Colors.black87), + style: const TextStyle( + fontSize: 15, height: 1.5, color: Color(0xFF333333)), ), const SizedBox(height: 24), Align( alignment: Alignment.centerRight, - child: OutlinedButton( + child: TextButton( onPressed: () => Navigator.pop(context), - style: OutlinedButton.styleFrom( - side: const BorderSide(color: Colors.blue), - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)), - padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8), + style: TextButton.styleFrom( + foregroundColor: const Color(0xFF007A45), ), - child: const Text('确认', style: TextStyle(color: Colors.blue)), + child: const Text('确认', + style: TextStyle(fontWeight: FontWeight.bold)), ), ), ], @@ -147,4 +208,4 @@ class MessagePage extends GetView { }, ); } -} \ No newline at end of file +}