diff --git a/lib/modules/agent/views/message_bubble.dart b/lib/modules/agent/views/message_bubble.dart index ee6af73c5..c72c22ee5 100644 --- a/lib/modules/agent/views/message_bubble.dart +++ b/lib/modules/agent/views/message_bubble.dart @@ -249,12 +249,12 @@ class MessageBubble extends GetView { rawList.map((e) => Map.from(e)).toList(); //音乐播放列表 return buildMusicContent(context, playlist); - } else if (meta!.keys.contains('card_weather')) { - final city = meta!['card_weather']['city'] as String; - final rawList = meta!['card_weather']['dayweather'] as List; + } else if (meta!.keys.contains('maps_weather')) { + final city = meta!['maps_weather']['city'] as String; + final rawList = meta!['maps_weather']['forecasts'] as List; final daylist = rawList.map((e) => Map.from(e)).toList(); - final now = meta!['card_weather']['day'] as Map; + final now = daylist[0] as Map; //天气 return buildWeatherContent( context, diff --git a/lib/modules/agent/views/weather_card.dart b/lib/modules/agent/views/weather_card.dart index aba39038e..323a4a483 100644 --- a/lib/modules/agent/views/weather_card.dart +++ b/lib/modules/agent/views/weather_card.dart @@ -62,7 +62,7 @@ Widget buildWeatherContent(BuildContext context, String city, ), SizedBox(height: 4), Text( - now["weatherCondition"], + now["dayweather"], style: TextStyle( fontSize: 14, color: Colors.white.withOpacity(0.9), @@ -72,7 +72,7 @@ Widget buildWeatherContent(BuildContext context, String city, Row( children: [ Text( - "${now["temperature"]}°", + "${now["daytemp"]}°", style: const TextStyle( fontSize: 36, fontWeight: FontWeight.bold, @@ -84,14 +84,14 @@ Widget buildWeatherContent(BuildContext context, String city, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - '最高: ${now["maxTemperature"]}°', + '最高: ${now["daytemp"]}°', style: TextStyle( fontSize: 12, color: Colors.white.withOpacity(0.9), ), ), Text( - '最低: ${now["minTemperature"]}°', + '最低: ${now["nighttemp"]}°', style: TextStyle( fontSize: 12, color: Colors.white.withOpacity(0.9), @@ -103,8 +103,8 @@ Widget buildWeatherContent(BuildContext context, String city, ), ], ), - const Icon( - Icons.wb_sunny, + Icon( + getWeatherIcon(now['dayweather']), size: 48, color: Colors.white, ), @@ -133,10 +133,10 @@ Widget buildWeatherContent(BuildContext context, String city, String dateStr = days[index]['date']; DateTime? date = DateUtil.getDateTime(dateStr); IconData weatherIcon = - getWeatherIcon(days[index]['weatherCondition']); + getWeatherIcon(days[index]['dayweather']); String weekday = DateUtil.getWeekday(date, languageCode: "zh", short: true); - String temp = "${days[index]['temperature']}°"; + String temp = "${days[index]['daytemp']}°"; return _buildForecastDay( weekday, weatherIcon,