liukai пре 4 дана
родитељ
комит
6c83bfcf58
25 измењених фајлова са 514 додато и 296 уклоњено
  1. 8 12
      packages/cpt_auth/lib/modules/select_estate/select_estate_state.dart
  2. 2 2
      packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.dart
  3. 71 0
      packages/cpt_auth/lib/modules/select_unit/attach_search_unit_dialog.dart
  4. 153 130
      packages/cpt_auth/lib/modules/select_unit/select_unit_page.dart
  5. 46 28
      packages/cpt_auth/lib/modules/select_unit/select_unit_state.dart
  6. 72 26
      packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.dart
  7. 1 3
      packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart
  8. 9 3
      packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_page.dart
  9. 1 1
      packages/cpt_form/lib/modules/apply/guest_vehicle_page.dart
  10. 3 3
      packages/cpt_form/lib/modules/apply/moving_date_page.dart
  11. 4 4
      packages/cpt_form/lib/modules/apply/renovation_date_page.dart
  12. 1 1
      packages/cpt_form/lib/modules/apply/type_of_application_page.dart
  13. 2 2
      packages/cpt_form/lib/modules/apply/vehicle_info_page.dart
  14. 3 1
      packages/cpt_main/lib/modules/feedback/create/feedback_create_page.dart
  15. 3 1
      packages/cpt_main/lib/modules/visitor/register/visitor_register_page.dart
  16. 3 0
      packages/cs_domain/lib/constants/api_constants.dart
  17. 21 0
      packages/cs_domain/lib/entity/id_address_entity.dart
  18. 11 12
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  19. 9 18
      packages/cs_domain/lib/generated/json/comm_payment_detail_entity.g.dart
  20. 33 0
      packages/cs_domain/lib/generated/json/id_address_entity.g.dart
  21. 3 8
      packages/cs_domain/lib/generated/json/paid_service_pay_success_info_entity.g.dart
  22. 7 14
      packages/cs_domain/lib/generated/json/payment_page_entity.g.dart
  23. 6 13
      packages/cs_domain/lib/generated/json/service_order_detail_entity.g.dart
  24. 40 12
      packages/cs_domain/lib/repository/profile_repository.dart
  25. 2 2
      packages/cs_widgets/lib/shatter/picker_container.dart

+ 8 - 12
packages/cpt_auth/lib/modules/select_estate/select_estate_state.dart

@@ -10,9 +10,8 @@ class SelectEstateState {
 
   IdNameEntity? selectedEstate; //第一步数据:已经选中的房产
 
-  String? block; //第二步数据:已经选中的Block
-  String? unit; //第二步数据:已经选中的单元
-  String? room; //第二步数据:已经选中的单元-房间
+  String? address; //第二步选择的数据
+  String? unitId; //第二步选择的数据
 
   String? type; //第三步数据:已经选中的类型
 
@@ -21,9 +20,8 @@ class SelectEstateState {
   SelectEstateState({
     this.estateList,
     this.selectedEstate,
-    this.block,
-    this.unit,
-    this.room,
+    this.address,
+    this.unitId,
     this.type,
     Map<String, Map<String, dynamic>>? formData,
   }) : formData = formData ??
@@ -41,17 +39,15 @@ class SelectEstateState {
     double? remainingSpace,
     List<IdNameEntity>? estateList,
     IdNameEntity? selectedEstate,
-    String? block,
-    String? unit,
-    String? room,
+    String? address,
+    String? unitId,
     String? type,
   }) {
     return SelectEstateState(
       estateList: estateList ?? this.estateList,
       selectedEstate: selectedEstate ?? this.selectedEstate,
-      block: block ?? this.block,
-      unit: unit ?? this.unit,
-      room: room ?? this.room,
+      address: address ?? this.address,
+      unitId: unitId ?? this.unitId,
       type: type ?? this.type,
       formData: this.formData,
     );

+ 2 - 2
packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.dart

@@ -80,8 +80,8 @@ class SelectEstateViewModel extends _$SelectEstateViewModel with DioCancelableMi
   }
 
   /// 保存第二步的单元等信息
-  void saveUnit({required String block, required String unit, required String room}) {
-    state = state.copyWith(block: block, unit: unit, room: room);
+  void saveUnit({required String? address, required String? unitId}) {
+    state = state.copyWith(address: address,unitId: unitId);
   }
 
   /// 保存第三步的角色信息

+ 71 - 0
packages/cpt_auth/lib/modules/select_unit/attach_search_unit_dialog.dart

@@ -0,0 +1,71 @@
+
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/id_address_entity.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter/src/widgets/framework.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/widget_export.dart';
+
+
+//输入文本框
+class AttachSearchUnitDialog extends HookConsumerWidget {
+  List<IdAddressEntity>? unitList;
+  final ValueChanged<IdAddressEntity?> onSelected;
+
+  AttachSearchUnitDialog({
+    required this.unitList,
+    required this.onSelected,
+  });
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+
+    return Container(
+      margin: const EdgeInsets.symmetric(horizontal: 38),
+      padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
+      decoration: BoxDecoration(
+        color: context.appColors.whiteBG,
+        borderRadius: BorderRadius.circular(5.0), // 5个圆角
+        boxShadow: [
+          BoxShadow(
+            color: const Color(0xFF656565).withOpacity(0.1), // 阴影颜色,并且设置透明度
+            offset: const Offset(0, 1.5), // 阴影的偏移量
+            blurRadius: 2.5, // 模糊半径
+            spreadRadius: 1.5, // 扩散半径
+          ),
+        ],
+      ),
+      constraints: const BoxConstraints(
+        maxHeight: 300, // 设置最大高度
+      ),
+      child: ListView.builder(
+        padding: EdgeInsets.zero,
+        shrinkWrap: true,
+        physics: const AlwaysScrollableScrollPhysics(),
+        itemCount: unitList?.length ?? 0,
+        itemBuilder: (context, index) {
+          final item = unitList?[index];
+          return MyTextView(
+            item?.address ?? "",
+            fontSize: 15,
+            paddingTop: 10,
+            paddingBottom: 10,
+            isFontRegular: true,
+            onClick: () {
+              onSelected(item); // 选中回调
+              onCancel();
+            },
+            textColor: context.appColors.textBlack,
+          );
+        },
+      ),
+    );
+  }
+}
+
+//取消弹框
+void onCancel() async {
+  SmartDialog.dismiss();
+}

+ 153 - 130
packages/cpt_auth/lib/modules/select_unit/select_unit_page.dart

@@ -1,19 +1,17 @@
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
-import 'package:domain/entity/id_name_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
-import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:router/ext/auto_router_extensions.dart';
-import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_appbar.dart';
 import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_field.dart';
 import 'package:widgets/my_text_view.dart';
+import 'package:widgets/shatter/picker_container.dart';
 import 'package:widgets/widget_export.dart';
 
 import '../../router/page/auth_page_router.dart';
@@ -62,93 +60,118 @@ class SelectUnitPage extends HookConsumerWidget {
                       height: 162,
                     ).marginOnly(top: 28, bottom: 18),
 
-                    Row(
-                      mainAxisSize: MainAxisSize.min,
-                      children: [
-                        //街区
-                        Column(
-                          crossAxisAlignment: CrossAxisAlignment.start,
-                          children: [
-                            MyTextView(
-                              S.current.block,
-                              marginBottom: 9,
-                              textColor: context.appColors.textBlack,
-                              fontSize: 16,
-                              isFontMedium: true,
-                            ),
-
-                            // 表单 - 街区
-                            _buildInputLayout(
-                              context,
-                              state,
-                              "block",
-                              textInputType: TextInputType.text,
-                              textInputAction: TextInputAction.next,
-                              onSubmit: (formKey, value) {
-                                state.formData[formKey]!['focusNode'].unfocus();
-                                FocusScope.of(context).requestFocus(state.formData['unit']!['focusNode']);
-                              },
-                            ).constrained(width: 88),
-                          ],
-                        ),
+                    // Row(
+                    //   mainAxisSize: MainAxisSize.min,
+                    //   children: [
+                    //     //街区
+                    //     Column(
+                    //       crossAxisAlignment: CrossAxisAlignment.start,
+                    //       children: [
+                    //         MyTextView(
+                    //           S.current.block,
+                    //           marginBottom: 9,
+                    //           textColor: context.appColors.textBlack,
+                    //           fontSize: 16,
+                    //           isFontMedium: true,
+                    //         ),
+                    //
+                    //         // 表单 - 街区
+                    //         _buildInputLayout(
+                    //           context,
+                    //           state,
+                    //           "block",
+                    //           textInputType: TextInputType.text,
+                    //           textInputAction: TextInputAction.next,
+                    //           onSubmit: (formKey, value) {
+                    //             state.formData[formKey]!['focusNode'].unfocus();
+                    //             FocusScope.of(context).requestFocus(state.formData['unit']!['focusNode']);
+                    //           },
+                    //         ).constrained(width: 88),
+                    //       ],
+                    //     ),
+                    //
+                    //     MyTextView(
+                    //       "#",
+                    //       marginTop: 20,
+                    //       marginLeft: 8.5,
+                    //       marginRight: 8.5,
+                    //       textColor: context.appColors.textBlack,
+                    //       fontSize: 16,
+                    //       isFontMedium: true,
+                    //     ),
+                    //
+                    //     //单元
+                    //     Column(
+                    //       crossAxisAlignment: CrossAxisAlignment.start,
+                    //       children: [
+                    //         MyTextView(
+                    //           S.current.unit_number,
+                    //           marginBottom: 9,
+                    //           textColor: context.appColors.textBlack,
+                    //           fontSize: 16,
+                    //           isFontMedium: true,
+                    //         ),
+                    //         Row(
+                    //           children: [
+                    //             // 表单 - 单元
+                    //             _buildInputLayout(
+                    //               context,
+                    //               state,
+                    //               "unit",
+                    //               textInputAction: TextInputAction.next,
+                    //               onSubmit: (formKey, value) {
+                    //                 state.formData[formKey]!['focusNode'].unfocus();
+                    //                 FocusScope.of(context).requestFocus(state.formData['room']!['focusNode']);
+                    //               },
+                    //             ).constrained(width: 83),
+                    //
+                    //             MyTextView(
+                    //               "-",
+                    //               textColor: context.appColors.textBlack,
+                    //               marginLeft: 4,
+                    //               marginRight: 4,
+                    //               isFontMedium: true,
+                    //             ),
+                    //
+                    //             // 表单 - 房号
+                    //             _buildInputLayout(
+                    //               context,
+                    //               state,
+                    //               "room",
+                    //               textInputAction: TextInputAction.done,
+                    //               onSubmit: (formKey, value) {
+                    //                 state.formData[formKey]!['focusNode'].unfocus();
+                    //               },
+                    //             ).constrained(width: 83),
+                    //           ],
+                    //         ),
+                    //       ],
+                    //     ),
+                    //   ],
+                    // ),
 
+                    //选择
+                    Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      children: [
                         MyTextView(
-                          "#",
-                          marginTop: 20,
-                          marginLeft: 8.5,
-                          marginRight: 8.5,
+                          S.current.unit_number,
+                          marginBottom: 9,
+                          marginLeft: 17,
                           textColor: context.appColors.textBlack,
                           fontSize: 16,
                           isFontMedium: true,
                         ),
 
-                        //单元
-                        Column(
-                          crossAxisAlignment: CrossAxisAlignment.start,
-                          children: [
-                            MyTextView(
-                              S.current.unit_number,
-                              marginBottom: 9,
-                              textColor: context.appColors.textBlack,
-                              fontSize: 16,
-                              isFontMedium: true,
-                            ),
-                            Row(
-                              children: [
-                                // 表单 - 单元
-                                _buildInputLayout(
-                                  context,
-                                  state,
-                                  "unit",
-                                  textInputAction: TextInputAction.next,
-                                  onSubmit: (formKey, value) {
-                                    state.formData[formKey]!['focusNode'].unfocus();
-                                    FocusScope.of(context).requestFocus(state.formData['room']!['focusNode']);
-                                  },
-                                ).constrained(width: 83),
-
-                                MyTextView(
-                                  "-",
-                                  textColor: context.appColors.textBlack,
-                                  marginLeft: 4,
-                                  marginRight: 4,
-                                  isFontMedium: true,
-                                ),
+                        PickerContainer(
+                          hint: 'Please Select',
+                          enable: true,
+                          content: state.selectedUnitName ?? "",
+                          onClick: (context) {
+                            viewModel.pickUnit(context);
+                          },
+                        ).marginOnly(left: 17, right: 17),
 
-                                // 表单 - 房号
-                                _buildInputLayout(
-                                  context,
-                                  state,
-                                  "room",
-                                  textInputAction: TextInputAction.done,
-                                  onSubmit: (formKey, value) {
-                                    state.formData[formKey]!['focusNode'].unfocus();
-                                  },
-                                ).constrained(width: 83),
-                              ],
-                            ),
-                          ],
-                        ),
                       ],
                     ),
 
@@ -199,52 +222,52 @@ class SelectUnitPage extends HookConsumerWidget {
     );
   }
 
-  /// 输入框
-  Widget _buildInputLayout(
-    BuildContext context,
-    SelectUnitState state,
-    String key, {
-    double marginTop = 0,
-    bool? showRightIcon = false, //是否展示右侧的布局
-    Widget? rightWidget, //右侧的布局
-    TextInputType textInputType = TextInputType.number,
-    String? errorText,
-    bool obscureText = false,
-    TextInputAction textInputAction = TextInputAction.done,
-    Function? onSubmit,
-  }) {
-    return IgnoreKeyboardDismiss(
-      child: MyTextField(
-        key,
-        fillBackgroundColor: context.appColors.authFiledBG,
-        state.formData[key]!['value'],
-        hintText: state.formData[key]!['hintText'],
-        hintStyle: TextStyle(
-          color: context.appColors.authFiledHint,
-          fontSize: 16.0,
-          fontWeight: FontWeight.w500,
-        ),
-        controller: state.formData[key]!['controller'],
-        focusNode: state.formData[key]!['focusNode'],
-        margin: EdgeInsets.only(top: marginTop),
-        padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
-        showDivider: false,
-        height: 44,
-        style: TextStyle(
-          color: context.appColors.authFiledText,
-          fontSize: 16.0,
-          fontWeight: FontWeight.w500,
-        ),
-        inputType: textInputType,
-        textInputAction: textInputAction,
-        onSubmit: onSubmit,
-        cursorColor: context.appColors.authFiledText,
-        obscureText: obscureText,
-        errorText: errorText,
-        showLeftIcon: true,
-        showRightIcon: showRightIcon,
-        rightWidget: rightWidget,
-      ),
-    );
-  }
+  // /// 输入框
+  // Widget _buildInputLayout(
+  //   BuildContext context,
+  //   SelectUnitState state,
+  //   String key, {
+  //   double marginTop = 0,
+  //   bool? showRightIcon = false, //是否展示右侧的布局
+  //   Widget? rightWidget, //右侧的布局
+  //   TextInputType textInputType = TextInputType.number,
+  //   String? errorText,
+  //   bool obscureText = false,
+  //   TextInputAction textInputAction = TextInputAction.done,
+  //   Function? onSubmit,
+  // }) {
+  //   return IgnoreKeyboardDismiss(
+  //     child: MyTextField(
+  //       key,
+  //       fillBackgroundColor: context.appColors.authFiledBG,
+  //       state.formData[key]!['value'],
+  //       hintText: state.formData[key]!['hintText'],
+  //       hintStyle: TextStyle(
+  //         color: context.appColors.authFiledHint,
+  //         fontSize: 16.0,
+  //         fontWeight: FontWeight.w500,
+  //       ),
+  //       controller: state.formData[key]!['controller'],
+  //       focusNode: state.formData[key]!['focusNode'],
+  //       margin: EdgeInsets.only(top: marginTop),
+  //       padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3),
+  //       showDivider: false,
+  //       height: 44,
+  //       style: TextStyle(
+  //         color: context.appColors.authFiledText,
+  //         fontSize: 16.0,
+  //         fontWeight: FontWeight.w500,
+  //       ),
+  //       inputType: textInputType,
+  //       textInputAction: textInputAction,
+  //       onSubmit: onSubmit,
+  //       cursorColor: context.appColors.authFiledText,
+  //       obscureText: obscureText,
+  //       errorText: errorText,
+  //       showLeftIcon: true,
+  //       showRightIcon: showRightIcon,
+  //       rightWidget: rightWidget,
+  //     ),
+  //   );
+  // }
 }

+ 46 - 28
packages/cpt_auth/lib/modules/select_unit/select_unit_state.dart

@@ -1,35 +1,53 @@
 import 'package:flutter/material.dart';
 
 class SelectUnitState {
-  //表单的校验与数据
-  final Map<String, Map<String, dynamic>> formData;
+//   //表单的校验与数据
+//   final Map<String, Map<String, dynamic>> formData;
+//
+//   // ===================================  Begin  ↓  ===================================
+//
+//   SelectUnitState({
+//     Map<String, Map<String, dynamic>>? formData,
+//   }) : formData = formData ??
+//             {
+//               'block': {
+//                 'value': '',
+//                 'controller': TextEditingController(),
+//                 'hintText': '',
+//                 'focusNode': FocusNode(),
+//                 'obsecure': false,
+//               },
+//               'unit': {
+//                 'value': '',
+//                 'controller': TextEditingController(),
+//                 'hintText': '',
+//                 'focusNode': FocusNode(),
+//                 'obsecure': false,
+//               },
+//               'room': {
+//                 'value': '',
+//                 'controller': TextEditingController(),
+//                 'hintText': '',
+//                 'focusNode': FocusNode(),
+//                 'obsecure': false,
+//               },
+//             };
 
-  // ===================================  Begin  ↓  ===================================
+  String? selectedUnitId;
+  String? selectedUnitName;
 
   SelectUnitState({
-    Map<String, Map<String, dynamic>>? formData,
-  }) : formData = formData ??
-            {
-              'block': {
-                'value': '',
-                'controller': TextEditingController(),
-                'hintText': '',
-                'focusNode': FocusNode(),
-                'obsecure': false,
-              },
-              'unit': {
-                'value': '',
-                'controller': TextEditingController(),
-                'hintText': '',
-                'focusNode': FocusNode(),
-                'obsecure': false,
-              },
-              'room': {
-                'value': '',
-                'controller': TextEditingController(),
-                'hintText': '',
-                'focusNode': FocusNode(),
-                'obsecure': false,
-              },
-            };
+    this.selectedUnitId,
+    this.selectedUnitName,
+  });
+
+  SelectUnitState copyWith({
+    String? selectedUnitId,
+    String? selectedUnitName,
+  }) {
+    return SelectUnitState(
+      selectedUnitId: selectedUnitId ?? this.selectedUnitId,
+      selectedUnitName: selectedUnitName ?? this.selectedUnitName,
+    );
+  }
 }

+ 72 - 26
packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.dart

@@ -1,14 +1,18 @@
 import 'package:cpt_auth/modules/select_estate/select_estate_view_model.dart';
 import 'package:cpt_auth/modules/select_role/select_role_page.dart';
 import 'package:cpt_auth/modules/select_unit/select_unit_state.dart';
+import 'package:domain/entity/id_address_entity.dart';
 import 'package:domain/repository/profile_repository.dart';
 import 'package:flutter/material.dart';
+import 'package:plugin_platform/engine/dialog/dialog_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
 import 'package:shared/utils/util.dart';
 
 import '../select_estate/select_estate_state.dart';
+import 'attach_search_unit_dialog.dart';
 
 part 'select_unit_view_model.g.dart';
 
@@ -17,6 +21,9 @@ class SelectUnitViewModel extends _$SelectUnitViewModel with DioCancelableMixin
   late final ProfileRepository _profileRepository;
   late final SelectEstateViewModel _selectEstateViewModel;
   late final SelectEstateState _selectEstateState;
+  BuildContext? _targetContext;
+
+  final unitList = <IdAddressEntity>[];
 
   @override
   SelectUnitState build() {
@@ -31,45 +38,84 @@ class SelectUnitViewModel extends _$SelectUnitViewModel with DioCancelableMixin
 
   /// 提交选择的街道与单元
   void submitUnit() async {
-    final FocusNode blockFocusNode = state.formData['block']!['focusNode'];
-    final FocusNode unitFocusNode = state.formData['unit']!['focusNode'];
-    final FocusNode roomFocusNode = state.formData['room']!['focusNode'];
-
-    blockFocusNode.unfocus();
-    unitFocusNode.unfocus();
-    roomFocusNode.unfocus();
+    // final FocusNode blockFocusNode = state.formData['block']!['focusNode'];
+    // final FocusNode unitFocusNode = state.formData['unit']!['focusNode'];
+    // final FocusNode roomFocusNode = state.formData['room']!['focusNode'];
+    //
+    // blockFocusNode.unfocus();
+    // unitFocusNode.unfocus();
+    // roomFocusNode.unfocus();
 
-    final TextEditingController blockController = state.formData['block']!['controller'];
-    final TextEditingController unitController = state.formData['unit']!['controller'];
-    final TextEditingController roomController = state.formData['room']!['controller'];
+    // final TextEditingController blockController = state.formData['block']!['controller'];
+    // final TextEditingController unitController = state.formData['unit']!['controller'];
+    // final TextEditingController roomController = state.formData['room']!['controller'];
 
-    final block = blockController.text;
-    final unit = unitController.text;
-    final room = roomController.text;
-
-    if (Utils.isEmpty(block)) {
-      ToastEngine.show("Block cannot be empty!");
-      return;
-    }
+    // final block = blockController.text;
+    // final unit = unitController.text;
+    // final room = roomController.text;
 
-    if (Utils.isEmpty(unit)) {
-      ToastEngine.show("Unit Number cannot be empty!");
-      return;
-    }
+    // if (Utils.isEmpty(block)) {
+    //   ToastEngine.show("Block cannot be empty!");
+    //   return;
+    // }
+    //
+    // if (Utils.isEmpty(unit)) {
+    //   ToastEngine.show("Unit Number cannot be empty!");
+    //   return;
+    // }
 
-    if (Utils.isEmpty(room)) {
-      ToastEngine.show("Unit Number cannot be empty!");
+    if (Utils.isEmpty(state.selectedUnitId)) {
+      ToastEngine.show("Select Unit First!");
       return;
     }
 
-    final result = await _profileRepository.estateJoinCheck(estateId: _selectEstateState.selectedEstate?.id, block: block, unit: "$unit-$room");
+    final result = await _profileRepository.estateJoinCheck(unitId: state.selectedUnitId);
 
     if (result.isSuccess) {
       //存入内存数据
-      _selectEstateViewModel.saveUnit(block: block, unit: unit, room: room);
+      _selectEstateViewModel.saveUnit(address: state.selectedUnitName, unitId: state.selectedUnitId);
       SelectRolePage.startInstance();
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }
+
+  }
+
+  void pickUnit(BuildContext targetContext) async{
+    _targetContext = targetContext;
+    if (unitList.isNotEmpty){
+      //尝试展示下拉选选项
+      showDropDownDialog();
+    }else {
+      final result = await _profileRepository.searchEstateUnits(estateId: _selectEstateState.selectedEstate?.id, cancelToken: cancelToken);
+
+      if (result.isSuccess) {
+        final list = result.list;
+
+        if (list != null && list.isNotEmpty) {
+          unitList.clear();
+          unitList.addAll(list);
+          //尝试展示下拉选选项
+          showDropDownDialog();
+        }
+      } else {
+        Log.e(result.errorMsg ?? "UnKnow Error");
+      }
+    }
+
+  }
+
+  void showDropDownDialog() {
+    DialogEngine.showAttach(
+      tag: 'unit',
+      targetContext: _targetContext!,
+      position: DialogPosition.bottom,
+      widget: AttachSearchUnitDialog(
+        unitList: unitList,
+        onSelected: (item) {
+          state = state.copyWith(selectedUnitName: item?.address,selectedUnitId: item?.id);
+        },
+      ),
+    );
   }
 }

+ 1 - 3
packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart

@@ -39,9 +39,7 @@ class TenantDocViewModel extends _$TenantDocViewModel {
     }
 
     final result = await _profileRepository.joinEstateUnit(
-      estateId: _selectEstateState.selectedEstate?.id,
-      block: _selectEstateState.block,
-      unit: "${_selectEstateState.unit}-${_selectEstateState.room}",
+      unitId: _selectEstateState.unitId,
       type: _selectEstateState.type,
       paths: state.docList,
     );

+ 9 - 3
packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_page.dart

@@ -331,7 +331,9 @@ class GaragesalePostPage extends HookConsumerWidget {
     return PickerContainer(
       content: state.contactTypeSelectedOption ?? "",
       hint: S.current.choose_category,
-      onClick: vm.pickContactTypeCallback,
+      onClick: (context){
+        vm.pickContactTypeCallback();
+      },
     );
   }
 
@@ -343,7 +345,9 @@ class GaragesalePostPage extends HookConsumerWidget {
       content: state.saleSelectedOption ?? "",
       hint: S.current.choose_category,
       margin: const EdgeInsets.only(top: 16),
-      onClick: vm.pickSaleCallback,
+      onClick: (context){
+        vm.pickSaleCallback();
+      },
     );
   }
 
@@ -355,7 +359,9 @@ class GaragesalePostPage extends HookConsumerWidget {
       content: state.categorySelectedOption ?? "",
       hint: S.current.choose_category,
       margin: const EdgeInsets.only(top: 16),
-      onClick: vm.pickCategoryCallback,
+      onClick: (context){
+        vm.pickCategoryCallback();
+      },
     );
   }
 

+ 1 - 1
packages/cpt_form/lib/modules/apply/guest_vehicle_page.dart

@@ -87,7 +87,7 @@ class GuestVehiclePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.dateOfEntry,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.dateOfEntry = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');

+ 3 - 3
packages/cpt_form/lib/modules/apply/moving_date_page.dart

@@ -72,7 +72,7 @@ class MovingDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.startDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.startDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');
@@ -93,7 +93,7 @@ class MovingDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.endDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.endDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');
@@ -117,7 +117,7 @@ class MovingDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.timeOrArrival,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickTime(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.timeOrArrival = DateTimeUtils.formatDate(date, format: 'HH:mm');

+ 4 - 4
packages/cpt_form/lib/modules/apply/renovation_date_page.dart

@@ -72,7 +72,7 @@ class RenovationDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.renovationStartDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.renovationStartDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');
@@ -93,7 +93,7 @@ class RenovationDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.renovationEndDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.renovationEndDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');
@@ -117,7 +117,7 @@ class RenovationDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.hackingStartDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.hackingStartDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');
@@ -141,7 +141,7 @@ class RenovationDatePage extends HookConsumerWidget {
                           hint: S.current.choose_date,
                           enable: state.enableEdit,
                           content: state.formContentDetail.hackingEndDate,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickDate(null, (date) {
                               viewModel.updateFormContentDetail((content) {
                                 content.hackingEndDate = DateTimeUtils.formatDate(date, format: 'yyyy-MM-dd');

+ 1 - 1
packages/cpt_form/lib/modules/apply/type_of_application_page.dart

@@ -54,7 +54,7 @@ class TypeOfApplicationPage extends HookConsumerWidget {
                   hint: S.current.choose_an_option,
                   enable: state.enableEdit,
                   content: state.formContentDetail.typeOfApplication,
-                  onClick: () {
+                  onClick: (context) {
                     viewModel.pickOption(true);
                   },
                 ).marginOnly(left: 15, right: 15),

+ 2 - 2
packages/cpt_form/lib/modules/apply/vehicle_info_page.dart

@@ -83,7 +83,7 @@ class VehicleInfoPage extends HookConsumerWidget {
                           hint: S.current.choose_an_option,
                           enable: state.enableEdit,
                           content: state.formContentDetail.typeOfApplication,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickOption(true);
                           },
                         ).marginOnly(left: 15, right: 15),
@@ -100,7 +100,7 @@ class VehicleInfoPage extends HookConsumerWidget {
                           hint: S.current.choose_an_option,
                           enable: state.enableEdit,
                           content: state.formContentDetail.ownershipStatus,
-                          onClick: () {
+                          onClick: (context) {
                             viewModel.pickOption(false);
                           },
                         ).marginOnly(left: 15, right: 15),

+ 3 - 1
packages/cpt_main/lib/modules/feedback/create/feedback_create_page.dart

@@ -61,7 +61,9 @@ class FeedbackCreatePage extends HookConsumerWidget {
                 content: state.selectedOption?.name ?? "",
                 hint: S.current.choose_an_option,
                 margin: const EdgeInsets.only(top: 16),
-                onClick: viewModel.pickCategory,
+                onClick: (context){
+                  viewModel.pickCategory();
+                },
               ),
 
               //Title

+ 3 - 1
packages/cpt_main/lib/modules/visitor/register/visitor_register_page.dart

@@ -156,7 +156,9 @@ class VisitorRegisterPage extends HookConsumerWidget {
                   height: 20,
                   color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary,darkColor: Colors.white),
                 ),
-                onClick: viewModel.pickAccessDate,
+                onClick: (context){
+                  viewModel.pickAccessDate();
+                },
               ),
 
               // 备注

+ 3 - 0
packages/cs_domain/lib/constants/api_constants.dart

@@ -100,6 +100,9 @@ class ApiConstants {
   //搜索房产
   static const apiEstateSearch = "/api/v1/user/estate/estate/index";
 
+  //搜索房产的单元
+  static const apiEstateUnitSearch = "/api/v1/user/estate/unit/index";
+
   //加入房产的单元校验
   static const apiEstateUnitCheck = "/api/v1/user/estate/unit-user/join-check";
 

+ 21 - 0
packages/cs_domain/lib/entity/id_address_entity.dart

@@ -0,0 +1,21 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/id_address_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/id_address_entity.g.dart';
+
+@JsonSerializable()
+class IdAddressEntity {
+	String? id;
+	String? address;
+
+	IdAddressEntity();
+
+	factory IdAddressEntity.fromJson(Map<String, dynamic> json) => $IdAddressEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $IdAddressEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 11 - 12
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -23,6 +23,7 @@ import 'package:domain/entity/garage_sale_history_entity.dart';
 import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/home_list_entity.dart';
+import 'package:domain/entity/id_address_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/entity/latest_news_detail_entity.dart';
 import 'package:domain/entity/latest_news_page_entity.dart';
@@ -212,12 +213,10 @@ class JsonConvert {
       return data.map<CaptchaImgEntity>((Map<String, dynamic> e) => CaptchaImgEntity.fromJson(e)).toList() as M;
     }
     if (<CommPaymentDetailEntity>[] is M) {
-      return data.map<CommPaymentDetailEntity>((Map<String, dynamic> e) =>
-          CommPaymentDetailEntity.fromJson(e)).toList() as M;
+      return data.map<CommPaymentDetailEntity>((Map<String, dynamic> e) => CommPaymentDetailEntity.fromJson(e)).toList() as M;
     }
     if (<CommPaymentDetailOrderable>[] is M) {
-      return data.map<CommPaymentDetailOrderable>((Map<String, dynamic> e) =>
-          CommPaymentDetailOrderable.fromJson(e)).toList() as M;
+      return data.map<CommPaymentDetailOrderable>((Map<String, dynamic> e) => CommPaymentDetailOrderable.fromJson(e)).toList() as M;
     }
     if (<FacilityBookEntity>[] is M) {
       return data.map<FacilityBookEntity>((Map<String, dynamic> e) => FacilityBookEntity.fromJson(e)).toList() as M;
@@ -333,6 +332,9 @@ class JsonConvert {
     if (<HomeListPropertyNews>[] is M) {
       return data.map<HomeListPropertyNews>((Map<String, dynamic> e) => HomeListPropertyNews.fromJson(e)).toList() as M;
     }
+    if (<IdAddressEntity>[] is M) {
+      return data.map<IdAddressEntity>((Map<String, dynamic> e) => IdAddressEntity.fromJson(e)).toList() as M;
+    }
     if (<IdNameEntity>[] is M) {
       return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
     }
@@ -508,8 +510,7 @@ class JsonConvert {
       return data.map<PaymentPageList>((Map<String, dynamic> e) => PaymentPageList.fromJson(e)).toList() as M;
     }
     if (<OrderableEntity>[] is M) {
-      return data.map<OrderableEntity>((Map<String, dynamic> e) =>
-          OrderableEntity.fromJson(e)).toList() as M;
+      return data.map<OrderableEntity>((Map<String, dynamic> e) => OrderableEntity.fromJson(e)).toList() as M;
     }
     if (<PropertyNewsDetailEntity>[] is M) {
       return data.map<PropertyNewsDetailEntity>((Map<String, dynamic> e) => PropertyNewsDetailEntity.fromJson(e)).toList() as M;
@@ -686,8 +687,7 @@ class JsonConvert {
       return data.map<ServiceOrderDetailEstateUnit>((Map<String, dynamic> e) => ServiceOrderDetailEstateUnit.fromJson(e)).toList() as M;
     }
     if (<ServiceOrderDetailOrder>[] is M) {
-      return data.map<ServiceOrderDetailOrder>((Map<String, dynamic> e) =>
-          ServiceOrderDetailOrder.fromJson(e)).toList() as M;
+      return data.map<ServiceOrderDetailOrder>((Map<String, dynamic> e) => ServiceOrderDetailOrder.fromJson(e)).toList() as M;
     }
     if (<ServiceRepairDetailEntity>[] is M) {
       return data.map<ServiceRepairDetailEntity>((Map<String, dynamic> e) => ServiceRepairDetailEntity.fromJson(e)).toList() as M;
@@ -754,8 +754,7 @@ class JsonConvertClassCollection {
     (AuthLoginEntity).toString(): AuthLoginEntity.fromJson,
     (CaptchaImgEntity).toString(): CaptchaImgEntity.fromJson,
     (CommPaymentDetailEntity).toString(): CommPaymentDetailEntity.fromJson,
-    (CommPaymentDetailOrderable).toString(): CommPaymentDetailOrderable
-        .fromJson,
+    (CommPaymentDetailOrderable).toString(): CommPaymentDetailOrderable.fromJson,
     (FacilityBookEntity).toString(): FacilityBookEntity.fromJson,
     (FacilityBookFacilityType).toString(): FacilityBookFacilityType.fromJson,
     (FacilityBookFacilities).toString(): FacilityBookFacilities.fromJson,
@@ -794,6 +793,7 @@ class JsonConvertClassCollection {
     (HomeListBanners).toString(): HomeListBanners.fromJson,
     (HomeListLatestTransactions).toString(): HomeListLatestTransactions.fromJson,
     (HomeListPropertyNews).toString(): HomeListPropertyNews.fromJson,
+    (IdAddressEntity).toString(): IdAddressEntity.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
     (LatestNewsDetailEntity).toString(): LatestNewsDetailEntity.fromJson,
     (LatestNewsPageEntity).toString(): LatestNewsPageEntity.fromJson,
@@ -910,8 +910,7 @@ class JsonConvertClassCollection {
     (ServiceOrderDetailStaff).toString(): ServiceOrderDetailStaff.fromJson,
     (ServiceOrderDetailOrderProducts).toString(): ServiceOrderDetailOrderProducts.fromJson,
     (ServiceOrderDetailEstate).toString(): ServiceOrderDetailEstate.fromJson,
-    (ServiceOrderDetailEstateUnit).toString(): ServiceOrderDetailEstateUnit
-        .fromJson,
+    (ServiceOrderDetailEstateUnit).toString(): ServiceOrderDetailEstateUnit.fromJson,
     (ServiceOrderDetailOrder).toString(): ServiceOrderDetailOrder.fromJson,
     (ServiceRepairDetailEntity).toString(): ServiceRepairDetailEntity.fromJson,
     (ServiceRepairDetailMerchant).toString(): ServiceRepairDetailMerchant.fromJson,

+ 9 - 18
packages/cs_domain/lib/generated/json/comm_payment_detail_entity.g.dart

@@ -3,8 +3,7 @@ import 'package:domain/entity/comm_payment_detail_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
 
 
-CommPaymentDetailEntity $CommPaymentDetailEntityFromJson(
-    Map<String, dynamic> json) {
+CommPaymentDetailEntity $CommPaymentDetailEntityFromJson(Map<String, dynamic> json) {
   final CommPaymentDetailEntity commPaymentDetailEntity = CommPaymentDetailEntity();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -26,18 +25,15 @@ CommPaymentDetailEntity $CommPaymentDetailEntityFromJson(
   if (orderAmount != null) {
     commPaymentDetailEntity.orderAmount = orderAmount;
   }
-  final String? refundOrderAmount = jsonConvert.convert<String>(
-      json['refund_order_amount']);
+  final String? refundOrderAmount = jsonConvert.convert<String>(json['refund_order_amount']);
   if (refundOrderAmount != null) {
     commPaymentDetailEntity.refundOrderAmount = refundOrderAmount;
   }
-  final String? depositAmount = jsonConvert.convert<String>(
-      json['deposit_amount']);
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
   if (depositAmount != null) {
     commPaymentDetailEntity.depositAmount = depositAmount;
   }
-  final String? refundDepositAmount = jsonConvert.convert<String>(
-      json['refund_deposit_amount']);
+  final String? refundDepositAmount = jsonConvert.convert<String>(json['refund_deposit_amount']);
   if (refundDepositAmount != null) {
     commPaymentDetailEntity.refundDepositAmount = refundDepositAmount;
   }
@@ -61,21 +57,18 @@ CommPaymentDetailEntity $CommPaymentDetailEntityFromJson(
   if (createdAt != null) {
     commPaymentDetailEntity.createdAt = createdAt;
   }
-  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(
-      json['account']);
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
   if (account != null) {
     commPaymentDetailEntity.account = account;
   }
-  final CommPaymentDetailOrderable? orderable = jsonConvert.convert<
-      CommPaymentDetailOrderable>(json['orderable']);
+  final CommPaymentDetailOrderable? orderable = jsonConvert.convert<CommPaymentDetailOrderable>(json['orderable']);
   if (orderable != null) {
     commPaymentDetailEntity.orderable = orderable;
   }
   return commPaymentDetailEntity;
 }
 
-Map<String, dynamic> $CommPaymentDetailEntityToJson(
-    CommPaymentDetailEntity entity) {
+Map<String, dynamic> $CommPaymentDetailEntityToJson(CommPaymentDetailEntity entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['type'] = entity.type;
@@ -132,8 +125,7 @@ extension CommPaymentDetailEntityExtension on CommPaymentDetailEntity {
   }
 }
 
-CommPaymentDetailOrderable $CommPaymentDetailOrderableFromJson(
-    Map<String, dynamic> json) {
+CommPaymentDetailOrderable $CommPaymentDetailOrderableFromJson(Map<String, dynamic> json) {
   final CommPaymentDetailOrderable commPaymentDetailOrderable = CommPaymentDetailOrderable();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -142,8 +134,7 @@ CommPaymentDetailOrderable $CommPaymentDetailOrderableFromJson(
   return commPaymentDetailOrderable;
 }
 
-Map<String, dynamic> $CommPaymentDetailOrderableToJson(
-    CommPaymentDetailOrderable entity) {
+Map<String, dynamic> $CommPaymentDetailOrderableToJson(CommPaymentDetailOrderable entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   return data;

+ 33 - 0
packages/cs_domain/lib/generated/json/id_address_entity.g.dart

@@ -0,0 +1,33 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/id_address_entity.dart';
+
+IdAddressEntity $IdAddressEntityFromJson(Map<String, dynamic> json) {
+  final IdAddressEntity idAddressEntity = IdAddressEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    idAddressEntity.id = id;
+  }
+  final String? address = jsonConvert.convert<String>(json['address']);
+  if (address != null) {
+    idAddressEntity.address = address;
+  }
+  return idAddressEntity;
+}
+
+Map<String, dynamic> $IdAddressEntityToJson(IdAddressEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['address'] = entity.address;
+  return data;
+}
+
+extension IdAddressEntityExtension on IdAddressEntity {
+  IdAddressEntity copyWith({
+    String? id,
+    String? address,
+  }) {
+    return IdAddressEntity()
+      ..id = id ?? this.id
+      ..address = address ?? this.address;
+  }
+}

+ 3 - 8
packages/cs_domain/lib/generated/json/paid_service_pay_success_info_entity.g.dart

@@ -39,12 +39,8 @@ PaidServicePaySuccessInfoEntity $PaidServicePaySuccessInfoEntityFromJson(Map<Str
   if (staff != null) {
     paidServicePaySuccessInfoEntity.staff = staff;
   }
-  final List<
-      PaidServicePaySuccessInfoOrderProducts>? orderProducts = (json['order_products'] as List<
-      dynamic>?)?.map(
-          (e) =>
-      jsonConvert.convert<PaidServicePaySuccessInfoOrderProducts>(
-          e) as PaidServicePaySuccessInfoOrderProducts).toList();
+  final List<PaidServicePaySuccessInfoOrderProducts>? orderProducts = (json['order_products'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<PaidServicePaySuccessInfoOrderProducts>(e) as PaidServicePaySuccessInfoOrderProducts).toList();
   if (orderProducts != null) {
     paidServicePaySuccessInfoEntity.orderProducts = orderProducts;
   }
@@ -74,8 +70,7 @@ Map<String, dynamic> $PaidServicePaySuccessInfoEntityToJson(PaidServicePaySucces
   data['order_service'] = entity.orderService?.toJson();
   data['merchant'] = entity.merchant?.toJson();
   data['staff'] = entity.staff?.toJson();
-  data['order_products'] =
-      entity.orderProducts?.map((v) => v.toJson()).toList();
+  data['order_products'] = entity.orderProducts?.map((v) => v.toJson()).toList();
   data['estate'] = entity.estate?.toJson();
   data['estate_unit'] = entity.estateUnit?.toJson();
   data['order'] = entity.order?.toJson();

+ 7 - 14
packages/cs_domain/lib/generated/json/payment_page_entity.g.dart

@@ -78,18 +78,15 @@ PaymentPageList $PaymentPageListFromJson(Map<String, dynamic> json) {
   if (orderAmount != null) {
     paymentPageList.orderAmount = orderAmount;
   }
-  final String? depositAmount = jsonConvert.convert<String>(
-      json['deposit_amount']);
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
   if (depositAmount != null) {
     paymentPageList.depositAmount = depositAmount;
   }
-  final String? refundOrderAmount = jsonConvert.convert<String>(
-      json['refund_order_amount']);
+  final String? refundOrderAmount = jsonConvert.convert<String>(json['refund_order_amount']);
   if (refundOrderAmount != null) {
     paymentPageList.refundOrderAmount = refundOrderAmount;
   }
-  final String? refundDepositAmount = jsonConvert.convert<String>(
-      json['refund_deposit_amount']);
+  final String? refundDepositAmount = jsonConvert.convert<String>(json['refund_deposit_amount']);
   if (refundDepositAmount != null) {
     paymentPageList.refundDepositAmount = refundDepositAmount;
   }
@@ -113,13 +110,11 @@ PaymentPageList $PaymentPageListFromJson(Map<String, dynamic> json) {
   if (createdAt != null) {
     paymentPageList.createdAt = createdAt;
   }
-  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(
-      json['account']);
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
   if (account != null) {
     paymentPageList.account = account;
   }
-  final OrderableEntity? orderable = jsonConvert.convert<OrderableEntity>(
-      json['orderable']);
+  final OrderableEntity? orderable = jsonConvert.convert<OrderableEntity>(json['orderable']);
   if (orderable != null) {
     paymentPageList.orderable = orderable;
   }
@@ -193,13 +188,11 @@ OrderableEntity $OrderableEntityFromJson(Map<String, dynamic> json) {
   if (name != null) {
     orderableEntity.name = name;
   }
-  final String? estateOnlineFormId = jsonConvert.convert<String>(
-      json['estate_online_form_id']);
+  final String? estateOnlineFormId = jsonConvert.convert<String>(json['estate_online_form_id']);
   if (estateOnlineFormId != null) {
     orderableEntity.estateOnlineFormId = estateOnlineFormId;
   }
-  final String? onlineFormTypeId = jsonConvert.convert<String>(
-      json['online_form_type_id']);
+  final String? onlineFormTypeId = jsonConvert.convert<String>(json['online_form_type_id']);
   if (onlineFormTypeId != null) {
     orderableEntity.onlineFormTypeId = onlineFormTypeId;
   }

+ 6 - 13
packages/cs_domain/lib/generated/json/service_order_detail_entity.g.dart

@@ -19,8 +19,7 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(Map<String, dynamic>
   if (orderStatus != null) {
     serviceOrderDetailEntity.orderStatus = orderStatus;
   }
-  final String? cancelStatus = jsonConvert.convert<String>(
-      json['cancel_status']);
+  final String? cancelStatus = jsonConvert.convert<String>(json['cancel_status']);
   if (cancelStatus != null) {
     serviceOrderDetailEntity.cancelStatus = cancelStatus;
   }
@@ -61,8 +60,7 @@ ServiceOrderDetailEntity $ServiceOrderDetailEntityFromJson(Map<String, dynamic>
   if (estateUnit != null) {
     serviceOrderDetailEntity.estateUnit = estateUnit;
   }
-  final ServiceOrderDetailOrder? order = jsonConvert.convert<
-      ServiceOrderDetailOrder>(json['order']);
+  final ServiceOrderDetailOrder? order = jsonConvert.convert<ServiceOrderDetailOrder>(json['order']);
   if (order != null) {
     serviceOrderDetailEntity.order = order;
   }
@@ -181,8 +179,7 @@ ServiceOrderDetailOrderService $ServiceOrderDetailOrderServiceFromJson(Map<Strin
   if (name != null) {
     serviceOrderDetailOrderService.name = name;
   }
-  final int? evaluationsAvgScore = jsonConvert.convert<int>(
-      json['evaluations_avg_score']);
+  final int? evaluationsAvgScore = jsonConvert.convert<int>(json['evaluations_avg_score']);
   if (evaluationsAvgScore != null) {
     serviceOrderDetailOrderService.evaluationsAvgScore = evaluationsAvgScore;
   }
@@ -296,7 +293,6 @@ ServiceOrderDetailOrderProducts $ServiceOrderDetailOrderProductsFromJson(Map<Str
   if (productName != null) {
     serviceOrderDetailOrderProducts.productName = productName;
   }
-
   final int? quantity = jsonConvert.convert<int>(json['quantity']);
   if (quantity != null) {
     serviceOrderDetailOrderProducts.quantity = quantity;
@@ -408,8 +404,7 @@ extension ServiceOrderDetailEstateUnitExtension on ServiceOrderDetailEstateUnit
   }
 }
 
-ServiceOrderDetailOrder $ServiceOrderDetailOrderFromJson(
-    Map<String, dynamic> json) {
+ServiceOrderDetailOrder $ServiceOrderDetailOrderFromJson(Map<String, dynamic> json) {
   final ServiceOrderDetailOrder serviceOrderDetailOrder = ServiceOrderDetailOrder();
   final int? id = jsonConvert.convert<int>(json['id']);
   if (id != null) {
@@ -423,8 +418,7 @@ ServiceOrderDetailOrder $ServiceOrderDetailOrderFromJson(
   if (orderAmount != null) {
     serviceOrderDetailOrder.orderAmount = orderAmount;
   }
-  final String? depositAmount = jsonConvert.convert<String>(
-      json['deposit_amount']);
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
   if (depositAmount != null) {
     serviceOrderDetailOrder.depositAmount = depositAmount;
   }
@@ -447,8 +441,7 @@ ServiceOrderDetailOrder $ServiceOrderDetailOrderFromJson(
   return serviceOrderDetailOrder;
 }
 
-Map<String, dynamic> $ServiceOrderDetailOrderToJson(
-    ServiceOrderDetailOrder entity) {
+Map<String, dynamic> $ServiceOrderDetailOrderToJson(ServiceOrderDetailOrder entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['total_amount'] = entity.totalAmount;

+ 40 - 12
packages/cs_domain/lib/repository/profile_repository.dart

@@ -9,6 +9,8 @@ import '../constants/api_constants.dart';
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
+import '../entity/id_address_entity.dart';
+
 part 'profile_repository.g.dart';
 
 @Riverpod(keepAlive: true)
@@ -222,17 +224,47 @@ class ProfileRepository {
     return result.convert<IdNameEntity>();
   }
 
+  /// 搜索房产的单元
+  Future<HttpResult<IdAddressEntity>> searchEstateUnits({
+    required String? estateId,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['estate_id'] = estateId ?? "";
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiEstateUnitSearch,
+      params: params,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: true,
+      networkDebounce: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final jsonList = result.getListJson();
+
+      //获取List数据 需要转换一次
+      var list = jsonList?.map((value) {
+        if (value is Map<String, dynamic>) {
+          return IdAddressEntity.fromJson(value);
+        } else {
+          return null;
+        }
+      }).where((item) => item != null).cast<IdAddressEntity>().toList();
+
+      return result.convert<IdAddressEntity>(list: list);
+    }
+    return result.convert<IdAddressEntity>();
+  }
+
   /// 加入房产之前的单元验证
   Future<HttpResult> estateJoinCheck({
-    required String? estateId,
-    required String? block,
-    required String? unit,
+    required String? unitId,
     CancelToken? cancelToken,
   }) async {
     Map<String, String> params = {};
-    params['estate_id'] = estateId!;
-    params['block'] = block!;
-    params['unit'] = unit!;
+    params['unit_id'] = unitId!;
 
     final result = await dioEngine.requestNetResult(
       ApiConstants.apiEstateUnitCheck,
@@ -251,17 +283,13 @@ class ProfileRepository {
 
   /// 加入房产的单元
   Future<HttpResult> joinEstateUnit({
-    required String? estateId,
-    required String? block,
-    required String? unit,
+    required String? unitId,
     required String? type,
     required List<String>? paths,
     CancelToken? cancelToken,
   }) async {
     Map<String, String> params = {};
-    params['estate_id'] = estateId!;
-    params['block'] = block!;
-    params['unit'] = unit!;
+    params['unit_id'] = unitId!;
     params['type'] = type!;
 
     Map<String,String> files = {};

+ 2 - 2
packages/cs_widgets/lib/shatter/picker_container.dart

@@ -14,7 +14,7 @@ class PickerContainer extends StatelessWidget {
   final double height;
   final Color? bgColor;
   final EdgeInsetsGeometry? margin;
-  final VoidCallback onClick;
+  final void Function(BuildContext targetContext) onClick;
 
   const PickerContainer({
     required this.onClick,
@@ -57,7 +57,7 @@ class PickerContainer extends StatelessWidget {
           ],
         )).onTap(() {
       if (enable) {
-        onClick.call();
+        onClick.call(context);
       }
     });
   }