From af1f510864fffa521ff49339e5ac692365fad385 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sat, 20 Sep 2025 19:36:07 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor(settings):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E8=AE=BE=E7=BD=AE=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5=E4=BD=BF=E7=94=A8Get.deviceLocale=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20fix(permissions):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=88=90=E5=8A=9F=E6=97=B6=E7=9A=84=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chore(splash): 注释掉隐私协议和用户协议的点击事件 --- lib/core/translations/app_translations.dart | 4 +- .../controllers/permissions_controller.dart | 2 +- .../controllers/settings_controller.dart | 8 +++- lib/modules/splash/views/splash_view.dart | 46 +++++++++---------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/lib/core/translations/app_translations.dart b/lib/core/translations/app_translations.dart index cf89b513a..1d8c86957 100644 --- a/lib/core/translations/app_translations.dart +++ b/lib/core/translations/app_translations.dart @@ -186,11 +186,11 @@ class AppTranslations extends Translations { return fallbackLocale; } - return _getMatchedLocale(systemLocale); + return getMatchedLocale(systemLocale); } /// 智能匹配系统语言到支持的语言 - static Locale _getMatchedLocale(Locale systemLocale) { + static Locale getMatchedLocale(Locale systemLocale) { String languageCode = systemLocale.languageCode.toLowerCase(); String? countryCode = systemLocale.countryCode?.toUpperCase(); String? scriptCode = systemLocale.scriptCode; diff --git a/lib/modules/permissions/controllers/permissions_controller.dart b/lib/modules/permissions/controllers/permissions_controller.dart index 95013946f..fb69e9b1d 100644 --- a/lib/modules/permissions/controllers/permissions_controller.dart +++ b/lib/modules/permissions/controllers/permissions_controller.dart @@ -184,7 +184,7 @@ class PermissionsController extends GetxController { ); if (hasPermission) { - _showSuccessMessage(); + // _showSuccessMessage(); if (Platform.isIOS && permission == Permission.calendarFullAccess) { if (_isCalendarFullAccess == null) { _storage.write('record_permission_calendar', true); diff --git a/lib/modules/settings/controllers/settings_controller.dart b/lib/modules/settings/controllers/settings_controller.dart index 2508f928d..2011eccfa 100644 --- a/lib/modules/settings/controllers/settings_controller.dart +++ b/lib/modules/settings/controllers/settings_controller.dart @@ -301,9 +301,11 @@ class SettingsController extends GetxController { } } + /// 设置语言 Future setLanguage(LanguageModel data) async { try { Locale? targetLocale; + // print('lxm--设置语言: ${data.value}'); if (data.value != 'system') { // 用户手动选择的语言 @@ -311,7 +313,11 @@ class SettingsController extends GetxController { targetLocale = Locale(languageList[0], languageList[1]); } else { // 跟随系统语言,使用智能匹配 - targetLocale = AppTranslations.deviceLocale(); + targetLocale = Get.deviceLocale; + if (targetLocale != null) { + // 智能匹配系统语言到支持的语言 + targetLocale = AppTranslations.getMatchedLocale(targetLocale); + } } if (targetLocale != null) { diff --git a/lib/modules/splash/views/splash_view.dart b/lib/modules/splash/views/splash_view.dart index 71457e362..175606b35 100644 --- a/lib/modules/splash/views/splash_view.dart +++ b/lib/modules/splash/views/splash_view.dart @@ -225,7 +225,7 @@ class SplashView extends GetView { children: [ // 将勾选框和文本包装在 GestureDetector 中 GestureDetector( - onTap: () => controller.togglePrivacyAcceptance(), + //onTap: () => controller.togglePrivacyAcceptance(), behavior: HitTestBehavior.opaque, // 确保透明区域也能响应点击 child: Row( children: [ @@ -267,17 +267,17 @@ class SplashView extends GetView { mainAxisAlignment: MainAxisAlignment.center, children: [ GestureDetector( - onTap: () { - String url = 'https://www.voitrans.net/doc/yhxy.html'; // 用户协议链接 - if (Get.locale?.languageCode != 'zh' || - Get.locale?.countryCode != 'CN') { - url = 'https://www.voitrans.net/doc/yhxy_en.html'; // 用户协议英文链接 - } - Get.to(() => WebViewPage( - url: url, - title: 'userAgreement'.tr, - )); - }, + // onTap: () { + // String url = 'https://www.voitrans.net/doc/yhxy.html'; // 用户协议链接 + // if (Get.locale?.languageCode != 'zh' || + // Get.locale?.countryCode != 'CN') { + // url = 'https://www.voitrans.net/doc/yhxy_en.html'; // 用户协议英文链接 + // } + // Get.to(() => WebViewPage( + // url: url, + // title: 'userAgreement'.tr, + // )); + // }, child: Text( 'userAgreement'.tr, // 《用户协议》 style: TextStyle( @@ -294,19 +294,19 @@ class SplashView extends GetView { ), ), GestureDetector( - onTap: () { - String url = 'https://www.voitrans.net/doc/ysxy.html'; // 隐私政策链接 + // onTap: () { + // String url = 'https://www.voitrans.net/doc/ysxy.html'; // 隐私政策链接 - if (Get.locale?.languageCode != 'zh' || - Get.locale?.countryCode != 'CN') { - url = 'https://www.voitrans.net/doc/ysxy_en.html'; // 隐私政策英文链接 - } + // if (Get.locale?.languageCode != 'zh' || + // Get.locale?.countryCode != 'CN') { + // url = 'https://www.voitrans.net/doc/ysxy_en.html'; // 隐私政策英文链接 + // } - Get.to(() => WebViewPage( - url: url, - title: 'privacyPolicy'.tr, - )); - }, + // Get.to(() => WebViewPage( + // url: url, + // title: 'privacyPolicy'.tr, + // )); + // }, child: Text( 'privacyPolicy'.tr, // 《隐私政策》 style: TextStyle( From 1fca554bdaa20889f4860f276c8563a004545a23 Mon Sep 17 00:00:00 2001 From: fdp <1286779656@qq.com> Date: Sat, 20 Sep 2025 19:43:43 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E5=BD=95=E9=9F=B3=E4=B8=8D=E4=BA=86=EF=BC=8C=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../azure_speech/AzureAsrHelper.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt index 8fc25365a..630abbdf3 100644 --- a/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt +++ b/local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt @@ -547,19 +547,20 @@ class AzureAsrHelper(private val context: Context) { Log.e(tag, "启动录音前台服务失败: ${e.message}") } } - - // Initialize if not already done - if (!audioStream.isInitialized()) { - audioStream.initAudioRecord() - } - audioStream.setupStream() if (audioStream.recordfile == null) { audioStream.recordfile = RecordFile() } - + if (!audioStream.isContinuousRecognitionActive) { // 启动音频处理 Log.i(tag, "开启录音:audioSourceType${audioSourceType}") + // Initialize if not already done + if (!audioStream.isInitialized()) { + audioStream.initAudioRecord() + } + audioStream.setupStream() + + audioStream.startAudioRecord( when (audioSourceType) { AudioSourceType.MICROPHONE -> SimpleAudioReceiver.AudioSourceType.MICROPHONE AudioSourceType.EXTERNAL -> SimpleAudioReceiver.AudioSourceType.EXTERNAL @@ -635,7 +636,7 @@ class AzureAsrHelper(private val context: Context) { } Log.i(tag, "关闭录音:") audioStream.recordfile ?: return - + if (!audioStream.isContinuousRecognitionActive) { audioStream.stopMicrophoneCapture() From f25f6746b83649af9645a9f430c0557bc8aa68e5 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sat, 20 Sep 2025 20:08:33 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix(bluetooth=5Fmanager):=20=E5=9C=A8?= =?UTF-8?q?=E9=85=8D=E5=AF=B9=E9=A1=B5=E9=9D=A2=E6=97=B6=E4=B8=8D=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E8=87=B3=E9=85=8D=E5=AF=B9=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加对当前路由是否为配对页面的检查,防止在已处于配对页面时重复跳转 --- lib/data/services/bluetooth_manager.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/data/services/bluetooth_manager.dart b/lib/data/services/bluetooth_manager.dart index 08fff314c..ee28c94fa 100644 --- a/lib/data/services/bluetooth_manager.dart +++ b/lib/data/services/bluetooth_manager.dart @@ -76,7 +76,9 @@ class BluetoothManager extends GetxService { currentDeviceRx.value = newDevice; // 检查当前是否在OTA升级界面,如果是则不跳转 - if (!_isInOtaUpgradePage() && !_bleManager.isConnected) { + if (!_isInOtaUpgradePage() && + !_bleManager.isConnected && + Get.currentRoute != Routes.pairing) { Get.toNamed(Routes.pairing, arguments: newDevice); } else { Logger.info('当前在OTA升级界面,跳过配对页面跳转');