站点增加消息入口

This commit is contained in:
2026-01-16 13:06:35 +08:00
parent 9a97b56505
commit fbcc85af2a
3 changed files with 86 additions and 25 deletions

View File

@@ -296,10 +296,14 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -372,10 +376,14 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";

View File

@@ -151,7 +151,7 @@ class SiteController extends GetxController with BaseControllerMixin {
void onInit() { void onInit() {
super.onInit(); super.onInit();
renderData(); renderData();
msgNotice();
startAutoRefresh(); startAutoRefresh();
} }
@@ -167,6 +167,27 @@ class SiteController extends GetxController with BaseControllerMixin {
searchController.dispose(); searchController.dispose();
super.onClose(); super.onClose();
} }
bool isNotice = false;
Future<void> msgNotice() async {
final Map<String, dynamic> requestData = {
'appFlag': 1,
'isRead': 1,
'pageNum': 1,
'pageSize': 5,
};
final response = await HttpService.to.get(
'appointment/unread_notice/page',
params: requestData,
);
if (response != null) {
final result = BaseModel.fromJson(response.data);
if (result.code == 0 && result.data != null) {
String total = result.data["total"].toString();
isNotice = int.parse(total) > 0;
updateUi();
}
}
}
void startAutoRefresh() { void startAutoRefresh() {
// 先停止已存在的定时器,防止重复启动 // 先停止已存在的定时器,防止重复启动

View File

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:getx_scaffold/getx_scaffold.dart'; import 'package:getx_scaffold/getx_scaffold.dart';
import 'package:ln_jq_app/common/styles/theme.dart'; import 'package:ln_jq_app/common/styles/theme.dart';
import 'package:ln_jq_app/pages/b_page/history/view.dart'; import 'package:ln_jq_app/pages/b_page/history/view.dart';
import 'package:ln_jq_app/pages/c_page/message/view.dart' show MessagePage;
import 'controller.dart'; import 'controller.dart';
@@ -42,16 +43,39 @@ class SitePage extends GetView<SiteController> {
children: [ children: [
const Icon(Icons.calendar_today, color: Colors.blue, size: 32), const Icon(Icons.calendar_today, color: Colors.blue, size: 32),
const SizedBox(width: 12), const SizedBox(width: 12),
const Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Row(
'今日预约统计', children: [
style: TextStyle( Text(
fontSize: 16, '今日预约统计',
fontWeight: FontWeight.bold, style: TextStyle(
), fontSize: 16,
fontWeight: FontWeight.bold,
),
),
SizedBox(width: 5.w,),
Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 4,
),
decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
),
child: Text(
'实时',
style: TextStyle(
color: Colors.blue,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
),
],
), ),
Text( Text(
"Today's Reservation Statistics", "Today's Reservation Statistics",
@@ -60,21 +84,31 @@ class SitePage extends GetView<SiteController> {
], ],
), ),
), ),
Container( IconButton(
padding: const EdgeInsets.symmetric( onPressed: () async {
horizontal: 10, // 跳转消息中心
vertical: 4, var scanResult = await Get.to(() => const MessagePage());
if (scanResult == null) {
controller.msgNotice();
}
},
// 这里的 style 是为了模拟你图片里的灰色圆形背景
style: IconButton.styleFrom(
backgroundColor: Colors.grey[100],
padding: const EdgeInsets.all(8),
), ),
decoration: BoxDecoration( icon: Badge(
color: Colors.blue.withOpacity(0.1), // label: Text('3'), // 如果你想显示数字,就加 label
borderRadius: BorderRadius.circular(12), smallSize: 8,
), // 红点的大小
child: const Text( backgroundColor: controller.isNotice
'实时', ? Colors.red
style: TextStyle( : Colors.white,
color: Colors.blue, // 红点颜色
fontSize: 12, child: Icon(
fontWeight: FontWeight.bold, Icons.notifications_outlined,
color: Colors.black87,
size: 25,
), ),
), ),
), ),
@@ -156,9 +190,7 @@ class SitePage extends GetView<SiteController> {
onPressed: () { onPressed: () {
Get.to( Get.to(
() => HistoryPage(), () => HistoryPage(),
arguments: { arguments: {'stationName': controller.name},
'stationName': controller.name,
},
); );
}, },
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(