退出登陆的重新设计到我的页面;优化高清地图的加载和显示(冷启动稍慢,再次秒开);声网通用组件遗漏文件;

This commit is contained in:
2026-09-10 09:02:23 +08:00
parent b4bedd9737
commit 85e9632326
6 changed files with 276 additions and 90 deletions

View File

@@ -17,6 +17,7 @@ import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/power_tre
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/plant_overview_card.dart';
import 'package:maibu_satabot_v2/features/v2/home/presentation/widgets/tcp_status_indicator.dart';
import 'package:maibu_satabot_v2/components/device_status_modal.dart';
import 'package:maibu_satabot_v2/components/agora_video_player.dart';
import 'package:maibu_satabot_v2/features/devices/presentation/bloc/device_status_bloc.dart';
import '../../../../remote_control/presentation/bloc/remote_control_cubit.dart';
@@ -31,6 +32,14 @@ class HomeV2Page extends StatefulWidget {
class _HomeV2PageState extends State<HomeV2Page> {
late HomeV2Bloc _bloc;
// ===== 电站实时视频(声网)默认测试配置 =====
// 弹窗打开就用这组值自动开播,输入框仍保留,可随时改完点「重新加载」
// TODO: 接口对接后改为后端下发的真实值
static const String _agoraAppId = '875f6494d87548e783fefbf33f598c97';
static const String _agoraChannel = '36test-01';
static const String _agoraToken =
'007eJxTYLhsYtaz3e2gTMKZ27JzrOs/KB3OTFaYKfGX2+/Y6zem5TMUGCzMTdPMTCxNUoAME4tUcwvjtNS0pDRj4zRTS4tkS3P55PlZDYGMDGsfyTEyMkAgiM/JYGxWklpcomtgyMAAAN9rIEI=';
@override
void initState() {
super.initState();
@@ -203,6 +212,7 @@ class _HomeV2PageState extends State<HomeV2Page> {
const SizedBox(height: 10),
PlantOverviewCard(
overview: state.homeData.plantOverview,
onTap: _showPlantVideo,
),
const SizedBox(height: 10),
WorkOrderCard(stats: state.homeData.workOrderStats),
@@ -247,6 +257,19 @@ class _HomeV2PageState extends State<HomeV2Page> {
}
}
/// 点击「电站概览」卡片 → 弹出声网视频组件
///
/// 默认带上测试配置自动开播,同时保留三个输入框可手动修改
void _showPlantVideo() {
AgoraVideoPlayer.showManualInput(
context,
title: '电站实时视频',
initialAppId: _agoraAppId,
initialChannelId: _agoraChannel,
initialToken: _agoraToken,
);
}
void _showPlantSelector() {
if (_bloc.state is! HomeV2Loaded) return;

View File

@@ -6,10 +6,21 @@ import 'package:maibu_satabot_v2/features/v2/home/domain/entities/home_entity.da
class PlantOverviewCard extends StatelessWidget {
final PlantOverview overview;
const PlantOverviewCard({super.key, required this.overview});
/// 点击整张卡片的回调(如弹出电站实时视频)
final VoidCallback? onTap;
const PlantOverviewCard({super.key, required this.overview, this.onTap});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onTap,
behavior: HitTestBehavior.opaque,
child: _buildContent(context),
);
}
Widget _buildContent(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [