From 120e8f8e12908744c852189660c449f7ef63ca63 Mon Sep 17 00:00:00 2001 From: tanlongsheng <252620078@qq.com> Date: Thu, 17 Apr 2025 01:06:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=A9=E6=B0=94=E5=8D=A1?= =?UTF-8?q?=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .mcp.json | 6 +- .../chat/controllers/chat_controller.dart | 4 +- .../chat/views/chat_navigation_card.dart | 2 +- lib/modules/chat/views/chat_view.dart | 2 +- lib/modules/chat/views/weather_day_card.dart | 82 +++++++++---------- 5 files changed, 48 insertions(+), 48 deletions(-) diff --git a/.mcp.json b/.mcp.json index dddcc8d13..2e07dbf0a 100644 --- a/.mcp.json +++ b/.mcp.json @@ -2,7 +2,9 @@ "mcpServers": { "deepsound-mcp": { "url": "https://api.deapsound.com/sse" + }, + "voitrans-mcp": { + "url": "https://www.voitrans.net/sse" } - } - } \ No newline at end of file +} \ No newline at end of file diff --git a/lib/modules/chat/controllers/chat_controller.dart b/lib/modules/chat/controllers/chat_controller.dart index c9c5f0177..6a58b3044 100644 --- a/lib/modules/chat/controllers/chat_controller.dart +++ b/lib/modules/chat/controllers/chat_controller.dart @@ -36,7 +36,7 @@ class ChatController extends GetxController { final _amapFlutter = AmapFlutter(); StreamSubscription? _locationStream; String _latLng = ''; - String _city = ''; + String _city = '深圳市'; // Agent 信息 late final Agent agent; @@ -456,7 +456,7 @@ class ChatController extends GetxController { if (i == recentMessages.length - 2) { messageHistory.add({ 'role': 'user', - 'content': '我当前在$_city,我的经纬度是$_latLng', + 'content': '当需要获取我的位置时,我当前在$_city,我的经纬度是$_latLng', }); } } diff --git a/lib/modules/chat/views/chat_navigation_card.dart b/lib/modules/chat/views/chat_navigation_card.dart index 4a01a71d8..b9ee31ab4 100644 --- a/lib/modules/chat/views/chat_navigation_card.dart +++ b/lib/modules/chat/views/chat_navigation_card.dart @@ -41,7 +41,7 @@ class _ChatNavigationCardState extends State { } void _getLocation() async { - List endPointList = widget.data?['location'].split(','); + List endPointList = widget.data?['companyName'].split(','); endPoint = LatLng( double.parse(endPointList[0]), double.parse(endPointList[1]), diff --git a/lib/modules/chat/views/chat_view.dart b/lib/modules/chat/views/chat_view.dart index 605524c12..0832d70a6 100644 --- a/lib/modules/chat/views/chat_view.dart +++ b/lib/modules/chat/views/chat_view.dart @@ -357,7 +357,7 @@ class ChatView extends GetView { } if (message.data != null) { if (message.data?['card_weather'] != null) { - box = WeatherDayCard(message.data, isDarkMode); + box = WeatherDayCard(message.data?['card_weather'], isDarkMode); } if (message.data?['card_spotify'] != null) { box = ChatMusicCard(message.data?['card_spotify'], isDarkMode); diff --git a/lib/modules/chat/views/weather_day_card.dart b/lib/modules/chat/views/weather_day_card.dart index 72d7c0f10..8773145b2 100644 --- a/lib/modules/chat/views/weather_day_card.dart +++ b/lib/modules/chat/views/weather_day_card.dart @@ -9,8 +9,6 @@ class WeatherDayCard extends StatelessWidget { @override Widget build(BuildContext context) { - final Map weatherDays = data?['weatherDays'].first; - return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, @@ -19,14 +17,14 @@ class WeatherDayCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - weatherDays['date'], + data?['date'], style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 10.sp, ), ), Text( - '${weatherDays['maxTemperature']}°', + '${data?['temperature']}°', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 30.sp, @@ -43,49 +41,49 @@ class WeatherDayCard extends StatelessWidget { size: 18.w, ), Text( - '${weatherDays['weatherCondition']},${weatherDays['windDirection']}', + '${data?['weatherCondition']},${data?['windDirection']}', style: TextStyle( color: isDarkMode ? Colors.white : Colors.black, fontSize: 14.sp, ), ), - Row( - children: [ - Text( - '最\n高', - style: TextStyle( - color: isDarkMode ? Colors.white : Colors.black, - fontSize: 10.sp, - height: 1, - ), - ), - 5.horizontalSpace, - Text( - '${weatherDays['maxTemperature']}°', - style: TextStyle( - color: isDarkMode ? Colors.white : Colors.black, - fontSize: 20.sp, - ), - ), - 10.horizontalSpace, - Text( - '最\n低', - style: TextStyle( - color: isDarkMode ? Colors.white : Colors.black, - fontSize: 10.sp, - height: 1, - ), - ), - 5.horizontalSpace, - Text( - '${weatherDays['minTemperature']}°', - style: TextStyle( - color: isDarkMode ? Colors.white : Colors.black, - fontSize: 20.sp, - ), - ), - ], - ), + // Row( + // children: [ + // Text( + // '最\n高', + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black, + // fontSize: 10.sp, + // height: 1, + // ), + // ), + // 5.horizontalSpace, + // Text( + // '${data?['maxTemperature']}°', + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black, + // fontSize: 20.sp, + // ), + // ), + // 10.horizontalSpace, + // Text( + // '最\n低', + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black, + // fontSize: 10.sp, + // height: 1, + // ), + // ), + // 5.horizontalSpace, + // Text( + // '${data?['minTemperature']}°', + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black, + // fontSize: 20.sp, + // ), + // ), + // ], + // ), ], ), ],