集成接口 开始执行任务的领域层和数据层和UI层的开发啊(待测试)
集成功能 暂停 取消功能 恢复功能的接口的领域层和数据层的开发 下一步待集成到页面上 优化功能,优化了接口异常和未知异常对页面渲染的影响对用户的体验的不好情况。具体通过弹窗友好提示! 优化更新了tcp指示灯点击出现机器状态中添加选中设备的编号 方便用户使用的明白明了!。 优化更新关闭了tcp重连操作内链条中的获取用户设备和切换设备操作项。 调整了获取无人机状态信息的更新频率 为14秒一次
This commit is contained in:
@@ -185,18 +185,19 @@ class UpdateCubit extends Cubit<UpdateState> {
|
||||
}
|
||||
}
|
||||
|
||||
/// 在浏览器中打开下载链接(手动下载)
|
||||
Future<void> openInBrowser(String apkUrl) async {
|
||||
/// 整包更新:浏览器下载 + 引导弹窗
|
||||
Future<void> fullApkUpdateWithBrowser(String apkUrl) async {
|
||||
try {
|
||||
_logger.i('🌐 在浏览器中打开 APK 下载链接');
|
||||
_logger.i('🌐 整包更新:打开浏览器下载');
|
||||
|
||||
final uri = Uri.parse(apkUrl);
|
||||
if (await canLaunchUrl(uri)) {
|
||||
await launchUrl(uri, mode: LaunchMode.externalApplication);
|
||||
_logger.i('✅ 已打开浏览器下载');
|
||||
|
||||
// 🔥 整包更新后,清除补丁版本记录
|
||||
// 🔥 整包更新后,立即清除补丁版本记录(避免死循环)
|
||||
await _versionService.clearPatchVersionInfo();
|
||||
_logger.i('🗑️ 已清除补丁版本记录');
|
||||
|
||||
emit(UpdateSuccess());
|
||||
} else {
|
||||
|
||||
@@ -126,14 +126,14 @@ class UpdateDialog extends StatelessWidget {
|
||||
label: const Text('去安装'),
|
||||
);
|
||||
} else if (state is UpdateInstalling) {
|
||||
return const Column(
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text('📦 正在打开安装页面...', style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
SizedBox(height: 4),
|
||||
Text('请在系统安装界面确认安装', style: TextStyle(fontSize: 12)),
|
||||
SizedBox(height: 8),
|
||||
CircularProgressIndicator(),
|
||||
const Text('📦 正在打开安装页面...', style: TextStyle(fontSize: 13, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 4),
|
||||
const Text('请在系统安装界面确认安装', style: TextStyle(fontSize: 12)),
|
||||
const SizedBox(height: 8),
|
||||
const CircularProgressIndicator(),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
@@ -259,23 +259,25 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.shade50,
|
||||
color: Colors.orange.shade50,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.blue.shade200),
|
||||
border: Border.all(color: Colors.orange.shade200),
|
||||
),
|
||||
child: const Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'📱 整包更新说明',
|
||||
'📱 整包更新步骤',
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
'• 点击"立即下载"将在浏览器中打开下载链接\n'
|
||||
'• 下载完成后请手动安装 APK\n'
|
||||
'• 安装完成后重启应用即可',
|
||||
style: TextStyle(fontSize: 13, height: 1.5),
|
||||
'1️⃣ 点击"立即下载"打开浏览器\n'
|
||||
'2️⃣ 等待 APK 下载完成\n'
|
||||
'3️⃣ 手动安装新版本的 APK\n'
|
||||
'4️⃣ 安装完成后,卸载旧版本 APP\n'
|
||||
'5️⃣ 重新打开新版本 APP',
|
||||
style: TextStyle(fontSize: 13, height: 1.6),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -301,15 +303,12 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
if (versionInfo.apkUrl != null) {
|
||||
context.read<UpdateCubit>().downloadAndInstallApk(versionInfo.apkUrl!);
|
||||
// 🔥 调用新方法:浏览器下载 + 清除补丁记录
|
||||
context.read<UpdateCubit>().fullApkUpdateWithBrowser(versionInfo.apkUrl!);
|
||||
Navigator.of(context).pop();
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('正在浏览器中打开下载链接...'),
|
||||
duration: Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
// 显示后续引导弹窗
|
||||
_showManualInstallGuide(context);
|
||||
}
|
||||
},
|
||||
child: const Text('立即下载'),
|
||||
@@ -317,4 +316,57 @@ class FullApkUpdateDialog extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// 显示手动安装引导弹窗
|
||||
void _showManualInstallGuide(BuildContext context) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (ctx) => AlertDialog(
|
||||
title: const Text('🔔 重要提示'),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'请在浏览器中完成以下操作:',
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
const Text('✅ 等待 APK 下载完成'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 点击 APK 文件进行安装'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 安装完成后,卸载当前旧版本'),
|
||||
const SizedBox(height: 8),
|
||||
const Text('✅ 重新打开新版本 APP'),
|
||||
const SizedBox(height: 12),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red.shade50,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(color: Colors.red.shade200),
|
||||
),
|
||||
child: const Text(
|
||||
'⚠️ 注意:必须先卸载旧版本,否则无法正常使用新功能!',
|
||||
style: TextStyle(color: Colors.red, fontSize: 12),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
actions: [
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
},
|
||||
child: const Text('我知道了'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,14 @@ class VersionCheckService {
|
||||
|
||||
_logger.i('🚀 请求后端版本: $requestVersion ($requestVersionCode)');
|
||||
|
||||
// 🔥 打印完整的请求参数
|
||||
_logger.i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
_logger.i('📤 App 发送的请求参数:');
|
||||
_logger.i(' URL: $apiUrl');
|
||||
_logger.i(' version: $requestVersion');
|
||||
_logger.i(' versionCode: $requestVersionCode');
|
||||
_logger.i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
final response = await _dio.get(
|
||||
apiUrl,
|
||||
queryParameters: {
|
||||
@@ -91,6 +99,13 @@ class VersionCheckService {
|
||||
},
|
||||
);
|
||||
|
||||
// 🔥 打印完整的后端返回数据
|
||||
_logger.i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
_logger.i('📥 后端返回的完整数据:');
|
||||
_logger.i(' statusCode: ${response.statusCode}');
|
||||
_logger.i(' 原始响应: ${response.data}');
|
||||
_logger.i('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = response.data['data'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user