|
|
|
@ -13,6 +13,7 @@ import 'package:voitrans/data/services/bluetooth_manager.dart'; |
|
|
|
import 'package:voitrans/data/services/qq_music.dart'; |
|
|
|
import 'package:flutter_intro/flutter_intro.dart'; |
|
|
|
import '../../../data/services/novice_guide_service.dart'; |
|
|
|
import '../../../routes/app_routes.dart'; |
|
|
|
import '/core/utils/upload_oss.dart'; |
|
|
|
import '/data/models/user_Info.dart'; |
|
|
|
import '/data/services/music_manager.dart'; |
|
|
|
@ -782,9 +783,9 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
case AgentServiceEventType.error: |
|
|
|
final sessionid = event.data['sessionid'] ?? ''; |
|
|
|
final message = event.data['message'] ?? ''; |
|
|
|
|
|
|
|
final code = event.data['code'] ?? 0; |
|
|
|
// //验证错误码 |
|
|
|
if (event.data['code'] == 1000) { |
|
|
|
if (code == 1000) { |
|
|
|
isListening.value = false; |
|
|
|
isSpeaking.value = false; |
|
|
|
isProcessing.value = false; |
|
|
|
@ -798,6 +799,65 @@ class AgentController extends GetxController with WidgetsBindingObserver { |
|
|
|
} |
|
|
|
} |
|
|
|
Get.snackbar('error'.tr, '${event.data['message']}'); |
|
|
|
} else if (code == 2001) { |
|
|
|
// 余额不足或需要充值,给出弹窗确认是否跳转充值界面 |
|
|
|
final msg = '${event.data['message'] ?? '余额不足,请前往充值'}'; |
|
|
|
Get.snackbar('error'.tr, msg); |
|
|
|
Get.dialog( |
|
|
|
Dialog( |
|
|
|
shape: RoundedRectangleBorder( |
|
|
|
borderRadius: BorderRadius.circular(12), |
|
|
|
), |
|
|
|
child: Stack( |
|
|
|
children: [ |
|
|
|
Padding( |
|
|
|
padding: const EdgeInsets.fromLTRB(16, 20, 16, 16), |
|
|
|
child: Column( |
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
children: [ |
|
|
|
const Text( |
|
|
|
'提示', |
|
|
|
style: const TextStyle( |
|
|
|
fontSize: 18, |
|
|
|
fontWeight: FontWeight.bold, |
|
|
|
), |
|
|
|
), |
|
|
|
const SizedBox(height: 12), |
|
|
|
Text( |
|
|
|
'$msg\n是否前往充值界面?', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
), |
|
|
|
const SizedBox(height: 20), |
|
|
|
SizedBox( |
|
|
|
width: double.infinity, |
|
|
|
child: ElevatedButton( |
|
|
|
style: ElevatedButton.styleFrom( |
|
|
|
backgroundColor: Colors.orangeAccent, |
|
|
|
foregroundColor: Colors.white, |
|
|
|
), |
|
|
|
onPressed: () { |
|
|
|
Get.back(); |
|
|
|
Get.toNamed(Routes.goodsai); |
|
|
|
}, |
|
|
|
child: const Text('去充值'), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
Positioned( |
|
|
|
right: 8, |
|
|
|
top: 8, |
|
|
|
child: IconButton( |
|
|
|
icon: const Icon(Icons.close), |
|
|
|
onPressed: () => Get.back(), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
barrierDismissible: true, |
|
|
|
); |
|
|
|
} |
|
|
|
Logger.e(TAG, '代理服务错误: ${event.data['message']}'); |
|
|
|
break; |
|
|
|
|