Forráskód Böngészése

[feat]亲密度分析,对接当前键盘信息数据

hezihao 7 hónapja
szülő
commit
26249be518

+ 16 - 14
lib/di/get_it.config.dart

@@ -198,6 +198,13 @@ extension GetItInjectableX on _i174.GetIt {
         gh<_i243.AtmobApi>(),
       ),
     );
+    gh.factory<_i987.IntimacyAnalyseReportController>(
+      () => _i987.IntimacyAnalyseReportController(
+        gh<_i283.IntimacyAnalyzeRepository>(),
+        gh<_i738.IntimacyAnalyzeConfigHelper>(),
+        gh<_i274.KeyboardRepository>(),
+      ),
+    );
     gh.factory<_i922.KeyboardManageController>(
       () => _i922.KeyboardManageController(
         gh<_i274.KeyboardRepository>(),
@@ -248,14 +255,6 @@ extension GetItInjectableX on _i174.GetIt {
         gh<_i274.KeyboardRepository>(),
       ),
     );
-    gh.factory<_i666.IntimacyAnalyseUploadController>(
-      () => _i666.IntimacyAnalyseUploadController(
-        gh<_i283.IntimacyAnalyzeRepository>(),
-        gh<_i738.IntimacyAnalyzeConfigHelper>(),
-        gh<_i428.UploadFileManager>(),
-        gh<_i83.AccountRepository>(),
-      ),
-    );
     gh.factory<_i970.CharacterGroupContentController>(
       () => _i970.CharacterGroupContentController(
         gh<_i421.CharactersRepository>(),
@@ -271,6 +270,15 @@ extension GetItInjectableX on _i174.GetIt {
     gh.factory<_i866.UserInfoController>(
       () => _i866.UserInfoController(gh<_i83.AccountRepository>()),
     );
+    gh.factory<_i666.IntimacyAnalyseUploadController>(
+      () => _i666.IntimacyAnalyseUploadController(
+        gh<_i283.IntimacyAnalyzeRepository>(),
+        gh<_i738.IntimacyAnalyzeConfigHelper>(),
+        gh<_i428.UploadFileManager>(),
+        gh<_i83.AccountRepository>(),
+        gh<_i274.KeyboardRepository>(),
+      ),
+    );
     gh.factoryParam<
       _i991.CharacterAddTabController,
       _i497.KeyboardInfo,
@@ -337,12 +345,6 @@ extension GetItInjectableX on _i174.GetIt {
         gh<_i83.AccountRepository>(),
       ),
     );
-    gh.factory<_i987.IntimacyAnalyseReportController>(
-      () => _i987.IntimacyAnalyseReportController(
-        gh<_i283.IntimacyAnalyzeRepository>(),
-        gh<_i738.IntimacyAnalyzeConfigHelper>(),
-      ),
-    );
     gh.factory<_i1008.LoginController>(
       () => _i1008.LoginController(
         gh<_i83.AccountRepository>(),

+ 6 - 2
lib/module/intimacy_analyse/analyse_report/intimacy_analyse_report_view_controller.dart

@@ -6,6 +6,7 @@ import 'package:wechat_assets_picker/wechat_assets_picker.dart';
 import '../../../data/api/response/intimacy_analyze_config_response.dart';
 import '../../../data/bean/keyboard_info.dart';
 import '../../../data/repository/intimacy_analyze_repository.dart';
+import '../../../data/repository/keyboard_repository.dart';
 import '../../../utils/atmob_log.dart';
 import '../../../utils/image_picker_util.dart';
 import '../../../utils/intimacy_analyze_config_helper.dart';
@@ -23,12 +24,15 @@ class IntimacyAnalyseReportController extends BaseController {
   /// 亲密度分析帮助类
   IntimacyAnalyzeConfigHelper intimacyAnalyzeConfigHelper;
 
+  /// 键盘信息
+  KeyboardRepository keyboardRepository;
+
   /// 亲密度配置
   Rxn<IntimacyAnalyzeConfigResponse> get intimacyAnalyzeConfig =>
       intimacyAnalyzeRepository.intimacyAnalyzeConfig;
 
   /// 当前键盘信息
-  Rxn<KeyboardInfo> currentKeyboardInfo = Rxn();
+  Rxn<KeyboardInfo> get currentKeyboardInfo => keyboardRepository.chooseKeyboardInfo;
 
   /// 报告预览数据
   RxString reportPreviewData = "".obs;
@@ -36,6 +40,7 @@ class IntimacyAnalyseReportController extends BaseController {
   IntimacyAnalyseReportController(
     this.intimacyAnalyzeRepository,
     this.intimacyAnalyzeConfigHelper,
+    this.keyboardRepository,
   );
 
   @override
@@ -63,7 +68,6 @@ class IntimacyAnalyseReportController extends BaseController {
     // 跳转到档案选择页,获取当前的键盘Id
     KeyboardInfo? keyboardInfo = await ProfilePage.start() as KeyboardInfo?;
     AtmobLog.d(tag, "switchTaTest result:=> ${keyboardInfo?.toJson() ?? ""}");
-    currentKeyboardInfo.value = keyboardInfo;
   }
 
   /// 解锁

+ 6 - 1
lib/module/intimacy_analyse/intimacy_analyse_upload/intimacy_analyse_upload_controller.dart

@@ -19,6 +19,7 @@ import '../../../data/bean/keyboard_info.dart';
 import '../../../data/bean/option_select_config.dart';
 import '../../../data/bean/option_select_item.dart';
 import '../../../data/repository/intimacy_analyze_repository.dart';
+import '../../../data/repository/keyboard_repository.dart';
 import '../../../dialog/loading_dialog.dart';
 import '../../../router/app_page_arguments.dart';
 import '../../../utils/atmob_log.dart';
@@ -44,6 +45,9 @@ class IntimacyAnalyseUploadController extends BaseController {
   /// 亲密度分析Repository
   IntimacyAnalyzeRepository intimacyAnalyzeRepository;
 
+  /// 键盘信息Repository
+  KeyboardRepository keyboardRepository;
+
   /// 亲密度分析帮助类
   IntimacyAnalyzeConfigHelper intimacyAnalyzeConfigHelper;
 
@@ -80,7 +84,7 @@ class IntimacyAnalyseUploadController extends BaseController {
   Rx<bool> isReportCreating = false.obs;
 
   /// 当前键盘信息
-  Rxn<KeyboardInfo> currentKeyboardInfo = Rxn();
+  Rxn<KeyboardInfo> get currentKeyboardInfo => keyboardRepository.chooseKeyboardInfo;
 
   /// 当前选择的预测方向
   Rx<String> currentDirectionOption = "".obs;
@@ -93,6 +97,7 @@ class IntimacyAnalyseUploadController extends BaseController {
     this.intimacyAnalyzeConfigHelper,
     this.uploadFileManager,
     this.accountRepository,
+    this.keyboardRepository,
   );
 
   @override

+ 1 - 1
lib/module/intimacy_analyse/intimacy_analyse_upload/intimacy_analyse_upload_page.dart

@@ -524,7 +524,7 @@ class IntimacyAnalyseUploadPage
               ),
               SizedBox(width: 4.w),
               Text(
-                "小瑞",
+                controller.currentKeyboardInfo.value?.name ?? "",
                 style: TextStyle(
                   color: ColorName.black80,
                   fontSize: 11.sp,