Browse Source

[feat]亲密度分析,报告加载中,改用Lottie动画

hezihao 7 months ago
parent
commit
ee06912b39

File diff suppressed because it is too large
+ 1 - 0
assets/anim/anim_intimacy_analyse_creating_report_data.json


BIN
assets/anim/images/img_0.png


BIN
assets/anim/images/img_1.png


+ 6 - 6
lib/di/get_it.config.dart

@@ -93,6 +93,9 @@ extension GetItInjectableX on _i174.GetIt {
     gh.factory<_i987.IntimacyAnalyseReportController>(
       () => _i987.IntimacyAnalyseReportController(),
     );
+    gh.factory<_i1071.ImageViewerController>(
+      () => _i1071.ImageViewerController(),
+    );
     gh.factory<_i977.IntimacyAnalyseController>(
       () => _i977.IntimacyAnalyseController(),
     );
@@ -117,9 +120,6 @@ extension GetItInjectableX on _i174.GetIt {
     gh.factory<_i415.KeyboardMethodHandler>(
       () => _i415.KeyboardMethodHandler(),
     );
-    gh.factory<_i1071.ImageViewerController>(
-      () => _i1071.ImageViewerController(),
-    );
     gh.singleton<_i361.Dio>(
       () => networkModule.createStreamDio(),
       instanceName: 'streamDio',
@@ -235,15 +235,15 @@ extension GetItInjectableX on _i174.GetIt {
         currentKeyboardInfo: currentKeyboardInfo,
       ),
     );
-    gh.factory<_i15.CharacterCustomController>(
-      () => _i15.CharacterCustomController(gh<_i50.ConfigRepository>()),
-    );
     gh.factory<_i84.ChangeCharacterController>(
       () => _i84.ChangeCharacterController(gh<_i50.ConfigRepository>()),
     );
     gh.factory<_i765.ChangeHobbiesController>(
       () => _i765.ChangeHobbiesController(gh<_i50.ConfigRepository>()),
     );
+    gh.factory<_i15.CharacterCustomController>(
+      () => _i15.CharacterCustomController(gh<_i50.ConfigRepository>()),
+    );
     gh.factory<_i888.CharacterController>(
       () => _i888.CharacterController(
         gh<_i421.CharactersRepository>(),

+ 23 - 23
lib/module/intimacy_analyse/intimacy_analyse_upload/intimacy_analyse_upload_controller.dart

@@ -29,31 +29,31 @@ class IntimacyAnalyseUploadController extends BaseController {
       <OptionSelectConfig>[].obs;
 
   /// 是否上传页
-  RxBool isUploadPage = true.obs;
-
-  /// 报告的markdown数据
-  RxString reportMarkdownData =
-      '''
-  **性格匹配度**
-
-  ● 互补型:一方外向活泼,另一方沉稳内敛,形成动态平衡。
-  ● 相似型:三观一致,兴趣重叠,减少摩擦但需警惕新鲜感流失。
-  ● 关键结论:差异是火花的来源,但核心价值观需一致(如家庭观、金钱观)。
-
-  **沟通模式分析**
-
-  ● 语言风格:幽默调侃型 vs 理性分析型 → 需找到共同表达方式。
-  ● 冲突解决:回避型 vs 直面型 → 建议建立“冷静-沟通”机制。
-  ● 情感需求:一方需要高频互动,另一方偏好独立空间 → 需协商平衡点。
-
-  **爱情语言测试**
-
-  ● 根据盖瑞·查普曼的“五种爱之语”理论,分析双方的情感表达偏好:
-  ● 你的主要爱语:肯定的言辞(如情话、鼓励)
-  '''.obs;
+  RxBool isUploadPage = false.obs;
+
+  // /// 报告的markdown数据
+  // RxString reportMarkdownData =
+  //     '''
+  // **性格匹配度**
+  //
+  // ● 互补型:一方外向活泼,另一方沉稳内敛,形成动态平衡。
+  // ● 相似型:三观一致,兴趣重叠,减少摩擦但需警惕新鲜感流失。
+  // ● 关键结论:差异是火花的来源,但核心价值观需一致(如家庭观、金钱观)。
+  //
+  // **沟通模式分析**
+  //
+  // ● 语言风格:幽默调侃型 vs 理性分析型 → 需找到共同表达方式。
+  // ● 冲突解决:回避型 vs 直面型 → 建议建立“冷静-沟通”机制。
+  // ● 情感需求:一方需要高频互动,另一方偏好独立空间 → 需协商平衡点。
+  //
+  // **爱情语言测试**
+  //
+  // ● 根据盖瑞·查普曼的“五种爱之语”理论,分析双方的情感表达偏好:
+  // ● 你的主要爱语:肯定的言辞(如情话、鼓励)
+  // '''.obs;
 
   // TODO hezihao,测试报告生成中
-  // RxString reportMarkdownData = "".obs;
+  RxString reportMarkdownData = "".obs;
 
   /// 报告是否已解锁
   Rx<bool> isReportUnlock = true.obs;

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

@@ -257,7 +257,7 @@ class IntimacyAnalyseUploadPage
           SizedBox(height: 12.h),
           IntimacyAnalyseReportWidget(
             reportContent: controller.reportMarkdownData.value,
-            unlock: controller.isReportUnlock.obs.value.value,
+            unlock: controller.isReportUnlock.value,
           ),
         ],
       );

+ 7 - 3
lib/module/intimacy_analyse/widget/intimacy_analyse_report_widget.dart

@@ -1,6 +1,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'package:keyboard/resource/string.gen.dart';
+import 'package:lottie/lottie.dart';
 
 import '../../../resource/assets.gen.dart';
 import '../../../resource/colors.gen.dart';
@@ -327,6 +328,7 @@ class CreatingReportCardWidget extends StatelessWidget {
   Widget build(BuildContext context) {
     return ReportCardFrameWidget(
       child: Container(
+        padding: EdgeInsets.only(top: 33.h, bottom: 52.h),
         decoration: ShapeDecoration(
           color: ColorName.white,
           shape: RoundedRectangleBorder(
@@ -340,9 +342,11 @@ class CreatingReportCardWidget extends StatelessWidget {
             crossAxisAlignment: CrossAxisAlignment.center,
             children: [
               // 图标
-              Assets.images.iconIntimacyAnalysisReportCreating.image(
-                width: 82,
-                height: 82,
+              Lottie.asset(
+                Assets.anim.animIntimacyAnalyseCreatingReportData,
+                repeat: true,
+                width: 82.w,
+                height: 82.w,
               ),
               SizedBox(height: 3.h),
               // 文字

+ 21 - 0
lib/resource/assets.gen.dart

@@ -16,6 +16,10 @@ class $AssetsAnimGen {
   String get animDiscountTicketDialogData =>
       'assets/anim/anim_discount_ticket_dialog_data.json';
 
+  /// File path: assets/anim/anim_intimacy_analyse_creating_report_data.json
+  String get animIntimacyAnalyseCreatingReportData =>
+      'assets/anim/anim_intimacy_analyse_creating_report_data.json';
+
   /// File path: assets/anim/anim_surprise_dialog_data.json
   String get animSurpriseDialogData =>
       'assets/anim/anim_surprise_dialog_data.json';
@@ -32,9 +36,13 @@ class $AssetsAnimGen {
   String get animTabMineSelectedData =>
       'assets/anim/anim_tab_mine_selected_data.json';
 
+  /// Directory path: assets/anim/images
+  $AssetsAnimImagesGen get images => const $AssetsAnimImagesGen();
+
   /// List of all assets
   List<String> get values => [
     animDiscountTicketDialogData,
+    animIntimacyAnalyseCreatingReportData,
     animSurpriseDialogData,
     animTabCharacterSelectedData,
     animTabKeyboardSelectedData,
@@ -1138,6 +1146,19 @@ class $AssetsImagesGen {
   ];
 }
 
+class $AssetsAnimImagesGen {
+  const $AssetsAnimImagesGen();
+
+  /// File path: assets/anim/images/img_0.png
+  AssetGenImage get img0 => const AssetGenImage('assets/anim/images/img_0.png');
+
+  /// File path: assets/anim/images/img_1.png
+  AssetGenImage get img1 => const AssetGenImage('assets/anim/images/img_1.png');
+
+  /// List of all assets
+  List<AssetGenImage> get values => [img0, img1];
+}
+
 class Assets {
   const Assets._();
 

+ 1 - 0
pubspec.yaml

@@ -172,6 +172,7 @@ flutter:
 
   assets:
     - assets/anim/
+    - assets/anim/images/
     - assets/images/