浏览代码

修改加入社区的展示与电话邮箱逻辑

liukai 1 月之前
父节点
当前提交
3ecf701b24
共有 18 个文件被更改,包括 442 次插入38 次删除
  1. 1 1
      packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.g.dart
  2. 54 7
      packages/cpt_auth/lib/modules/estate_upload_success/estate_upload_success_page.dart
  3. 39 6
      packages/cpt_auth/lib/modules/estate_upload_success/estate_upload_success_view_model.dart
  4. 1 1
      packages/cpt_auth/lib/modules/forgot_input/forgot_input_view_model.g.dart
  5. 1 1
      packages/cpt_auth/lib/modules/forgot_verify/forgot_verify_view_model.g.dart
  6. 1 1
      packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.g.dart
  7. 1 1
      packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.g.dart
  8. 1 1
      packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.g.dart
  9. 1 1
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_page.dart
  10. 1 1
      packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.g.dart
  11. 6 2
      packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart
  12. 1 1
      packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.g.dart
  13. 63 11
      packages/cpt_auth/lib/router/page/auth_page_router.gr.dart
  14. 1 1
      packages/cpt_profile/lib/modules/my_estate/my_estate_view_model.dart
  15. 72 0
      packages/cs_domain/lib/entity/join_estate_success_entity.dart
  16. 13 0
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  17. 180 0
      packages/cs_domain/lib/generated/json/join_estate_success_entity.g.dart
  18. 5 2
      packages/cs_domain/lib/repository/profile_repository.dart

+ 1 - 1
packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'auth_login_view_model.dart';
 // **************************************************************************
 
 String _$authLoginViewModelHash() =>
-    r'a3e88f9aa351b658190e033c598003af7c274212';
+    r'6274cb6f3a2f8167e0d3dcf0c5cb4e81e76e6bd4';
 
 /// See also [AuthLoginViewModel].
 @ProviderFor(AuthLoginViewModel)

+ 54 - 7
packages/cpt_auth/lib/modules/estate_upload_success/estate_upload_success_page.dart

@@ -17,12 +17,25 @@ import 'estate_upload_success_view_model.dart';
 
 @RoutePage()
 class EstateUploadSuccessPage extends HookConsumerWidget {
-  const EstateUploadSuccessPage({Key? key}) : super(key: key);
+  final String? sm;
+  final String? contactNumber;
+  final String? email;
+
+  const EstateUploadSuccessPage({
+    Key? key,
+    @PathParam() required this.sm,
+    @PathParam() required this.contactNumber,
+    @PathParam() required this.email,
+  }) : super(key: key);
 
   //登录页面进入
-  static void startPop2Login() {
+  static void startPop2Login({
+    required String? sm,
+    required String? contactNumber,
+    required String? email,
+  }) {
     appRouter.pushAndPopUntil(
-      const EstateUploadSuccessPageRoute(),
+      EstateUploadSuccessPageRoute(sm: sm, contactNumber: contactNumber, email: email),
       predicate: (route) {
         return route.settings.name == "AuthLoginPageRoute";
       },
@@ -30,9 +43,13 @@ class EstateUploadSuccessPage extends HookConsumerWidget {
   }
 
   //Me页面进入
-  static void startPop2Estate() {
+  static void startPop2Estate({
+    required String? sm,
+    required String? contactNumber,
+    required String? email,
+  }) {
     appRouter.pushAndPopUntil(
-      const EstateUploadSuccessPageRoute(),
+      EstateUploadSuccessPageRoute(sm: sm, contactNumber: contactNumber, email: email),
       predicate: (route) {
         return route.settings.name == "MyEstatePageRoute";
       },
@@ -74,6 +91,32 @@ class EstateUploadSuccessPage extends HookConsumerWidget {
                       textColor: context.appColors.textBlack,
                     ),
 
+                    RichText(
+                      text: TextSpan(
+                        children: [
+                          // "SN: " 部分(黑色文本)
+                          TextSpan(
+                            text: "SN: ",
+                            style: TextStyle(
+                              fontSize: 15,
+                              fontWeight: FontWeight.w500,
+                              color: context.appColors.textBlack,
+                            ),
+                          ),
+                          // 后面的值部分(红色文本)
+                          TextSpan(
+                            text: sm, // 假设 sm 是 String 类型的变量
+                            style: const TextStyle(
+                              fontSize: 15,
+                              fontWeight: FontWeight.w500, // 保持与前面一致的字重
+                              color: Colors.red, // 红色
+                            ),
+                          ),
+                        ],
+                      ),
+                      textAlign: TextAlign.start,
+                    ),
+
                     MyTextView(
                       S.current.estate_upload_success_desc,
                       fontSize: 15,
@@ -86,7 +129,9 @@ class EstateUploadSuccessPage extends HookConsumerWidget {
             Row(
               children: [
                 MyButton(
-                  onPressed: viewModel.callEmail,
+                  onPressed: () {
+                    viewModel.callEmail(email);
+                  },
                   text: S.current.send_email,
                   textColor: Colors.white,
                   backgroundColor: context.appColors.btnBgDefault,
@@ -97,7 +142,9 @@ class EstateUploadSuccessPage extends HookConsumerWidget {
                   radius: 5,
                 ).expanded(),
                 MyButton(
-                  onPressed: viewModel.callPhone,
+                  onPressed: () {
+                    viewModel.callPhone(contactNumber);
+                  },
                   text: S.current.call_phone,
                   textColor: Colors.white,
                   backgroundColor: context.appColors.btnBgDefault,

+ 39 - 6
packages/cpt_auth/lib/modules/estate_upload_success/estate_upload_success_view_model.dart

@@ -1,6 +1,8 @@
+import 'package:plugin_basic/basic_export.dart';
+import 'package:plugin_platform/engine/notify/notify_engine.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
-
-import '../select_estate/select_estate_page.dart';
+import 'package:shared/utils/log_utils.dart';
 
 part 'estate_upload_success_view_model.g.dart';
 
@@ -10,13 +12,44 @@ class EstateUploadSuccessViewModel extends _$EstateUploadSuccessViewModel {
   void build() {}
 
   //拨打电话
-  void callPhone() {
-
+  void callPhone(String? phone) async {
+    if (phone == null || phone.trim().isEmpty) {
+      // 处理手机号为空的情况(如提示用户)
+      ToastEngine.show("The contact number for this community has not been set up yet");
+      return;
+    }
+
+    // 构造电话URL(tel:开头)
+    final Uri phoneUri = Uri.parse('tel:${phone.trim()}');
+
+    try {
+      // 启动系统电话应用(externalApplication:打开外部应用)
+      await launchUrl(phoneUri, mode: LaunchMode.externalApplication);
+    } catch (e) {
+      Log.e('无法拨打电话:$e');
+      NotifyEngine.showFailure('Unable to make a phone call');
+    }
   }
 
   //发送邮件
-  void callEmail() {
 
+  void callEmail(String? email) async {
+    if (email == null || email.trim().isEmpty) {
+      // 处理邮箱为空的情况
+      ToastEngine.show("The email for this community has not been set up yet");
+      return;
+    }
+
+    // 构造邮件URL(mailto:开头)
+    final Uri emailUri = Uri.parse('mailto:${email.trim()}');
+
+    try {
+      // 启动系统邮件应用
+      await launchUrl(emailUri, mode: LaunchMode.externalApplication);
+    } catch (e) {
+      // 处理异常(如未安装邮件应用)
+      Log.e('无法发送邮件:$e');
+      NotifyEngine.showFailure('Unable to send email');
+    }
   }
-
 }

+ 1 - 1
packages/cpt_auth/lib/modules/forgot_input/forgot_input_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'forgot_input_view_model.dart';
 // **************************************************************************
 
 String _$forgotInputViewModelHash() =>
-    r'd3f941cb656ba085b920cfb68cc80c597e5b97f1';
+    r'd1d505daf6f06534138d33aa3f96e0e3d486ff5d';
 
 /// See also [ForgotInputViewModel].
 @ProviderFor(ForgotInputViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/forgot_verify/forgot_verify_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'forgot_verify_view_model.dart';
 // **************************************************************************
 
 String _$forgotVerifyViewModelHash() =>
-    r'8b8ca850496d1176fa0eb77104d3fedf026e3bc3';
+    r'3ac63fee91ee572f459ea614a0946e53fe30f55e';
 
 /// See also [ForgotVerifyViewModel].
 @ProviderFor(ForgotVerifyViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/select_estate/select_estate_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'select_estate_view_model.dart';
 // **************************************************************************
 
 String _$selectEstateViewModelHash() =>
-    r'aba0d6d52228a8b0cdfb7fb1e4fb1009fb33df94';
+    r'6c84efa342efc1649de168688629fd98218c6f45';
 
 /// See also [SelectEstateViewModel].
 @ProviderFor(SelectEstateViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/select_unit/select_unit_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'select_unit_view_model.dart';
 // **************************************************************************
 
 String _$selectUnitViewModelHash() =>
-    r'04669c8553c295069d6cc1fb0f7e771cbbc72672';
+    r'84fd03b5d08ebfa027bb77ee3153a60ce13409a4';
 
 /// See also [SelectUnitViewModel].
 @ProviderFor(SelectUnitViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/sign_up/sign_up_view_model.g.dart

@@ -6,7 +6,7 @@ part of 'sign_up_view_model.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$signUpViewModelHash() => r'47850a34e661455a7b752fc95c1ddb0ba30c3b4c';
+String _$signUpViewModelHash() => r'0e915b12ed75ab6fdb83363115fa5a16d1bbadf7';
 
 /// See also [SignUpViewModel].
 @ProviderFor(SignUpViewModel)

+ 1 - 1
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_page.dart

@@ -54,7 +54,7 @@ class SignUpVerifyPage extends HookConsumerWidget {
       firstName: firstName,
       lastName: lastName,
       email: email,
-      phone: phone,
+      fullPhone: phone,
       password: password,
       confirmPassword: confirmPassword,
       verifyKey: verifyKey,

+ 1 - 1
packages/cpt_auth/lib/modules/sing_up_verify/sign_up_verify_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'sign_up_verify_view_model.dart';
 // **************************************************************************
 
 String _$signUpVerifyViewModelHash() =>
-    r'ad1cb9a410068dac7bf1311d777f3fe0baa1a938';
+    r'cabd355ed5ca0e4319662f6491562efed6846dd4';
 
 /// See also [SignUpVerifyViewModel].
 @ProviderFor(SignUpVerifyViewModel)

+ 6 - 2
packages/cpt_auth/lib/modules/tenant_doc/tenant_doc_view_model.dart

@@ -45,17 +45,21 @@ class TenantDocViewModel extends _$TenantDocViewModel {
     );
 
     if (result.isSuccess) {
+      final data = result.data;
+      final String? sm = data?.sn;
+      final String? contactNumber = data?.estate?.information?.contactNumber;
+      final String? email = data?.estate?.information?.email;
       //如果有用户信息,说明是在Me页面添加的
       if (UserConfigService.getState().user != null) {
         //刷新Estate页面
         bus.emit(AppConstant.eventEstateRefresh, true);
         //去成功页面
         Log.d("Estate页面");
-        EstateUploadSuccessPage.startPop2Estate();
+        EstateUploadSuccessPage.startPop2Estate(sm: sm, contactNumber: contactNumber, email: email);
       } else {
         Log.d("登录页面");
         //如果没有用户信息,说明是在登录页面添加的。
-        EstateUploadSuccessPage.startPop2Login();
+        EstateUploadSuccessPage.startPop2Login(sm: sm, contactNumber: contactNumber, email: email);
       }
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");

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

@@ -7,7 +7,7 @@ part of 'tenant_doc_view_model.dart';
 // **************************************************************************
 
 String _$tenantDocViewModelHash() =>
-    r'92e8fc2e3d5b1e9f7a709ca06a17adb6a28c76ff';
+    r'30ceaa5cb8b44318b44a3bfe176c0b2147a733cd';
 
 /// See also [TenantDocViewModel].
 @ProviderFor(TenantDocViewModel)

+ 63 - 11
packages/cpt_auth/lib/router/page/auth_page_router.gr.dart

@@ -22,9 +22,21 @@ abstract class _$AuthPageRouter extends RootStackRouter {
       );
     },
     EstateUploadSuccessPageRoute.name: (routeData) {
+      final pathParams = routeData.inheritedPathParams;
+      final args = routeData.argsAs<EstateUploadSuccessPageRouteArgs>(
+          orElse: () => EstateUploadSuccessPageRouteArgs(
+                sm: pathParams.optString('sm'),
+                contactNumber: pathParams.optString('contactNumber'),
+                email: pathParams.optString('email'),
+              ));
       return AutoRoutePage<dynamic>(
         routeData: routeData,
-        child: const EstateUploadSuccessPage(),
+        child: EstateUploadSuccessPage(
+          key: args.key,
+          sm: args.sm,
+          contactNumber: args.contactNumber,
+          email: args.email,
+        ),
       );
     },
     ForgotInputPageRoute.name: (routeData) {
@@ -84,7 +96,7 @@ abstract class _$AuthPageRouter extends RootStackRouter {
           firstName: args.firstName,
           lastName: args.lastName,
           email: args.email,
-          fullPhone: args.phone,
+          fullPhone: args.fullPhone,
           password: args.password,
           confirmPassword: args.confirmPassword,
           verifyKey: args.verifyKey,
@@ -119,16 +131,56 @@ class AuthLoginPageRoute extends PageRouteInfo<void> {
 
 /// generated route for
 /// [EstateUploadSuccessPage]
-class EstateUploadSuccessPageRoute extends PageRouteInfo<void> {
-  const EstateUploadSuccessPageRoute({List<PageRouteInfo>? children})
-      : super(
+class EstateUploadSuccessPageRoute
+    extends PageRouteInfo<EstateUploadSuccessPageRouteArgs> {
+  EstateUploadSuccessPageRoute({
+    Key? key,
+    required String? sm,
+    required String? contactNumber,
+    required String? email,
+    List<PageRouteInfo>? children,
+  }) : super(
           EstateUploadSuccessPageRoute.name,
+          args: EstateUploadSuccessPageRouteArgs(
+            key: key,
+            sm: sm,
+            contactNumber: contactNumber,
+            email: email,
+          ),
+          rawPathParams: {
+            'sm': sm,
+            'contactNumber': contactNumber,
+            'email': email,
+          },
           initialChildren: children,
         );
 
   static const String name = 'EstateUploadSuccessPageRoute';
 
-  static const PageInfo<void> page = PageInfo<void>(name);
+  static const PageInfo<EstateUploadSuccessPageRouteArgs> page =
+      PageInfo<EstateUploadSuccessPageRouteArgs>(name);
+}
+
+class EstateUploadSuccessPageRouteArgs {
+  const EstateUploadSuccessPageRouteArgs({
+    this.key,
+    required this.sm,
+    required this.contactNumber,
+    required this.email,
+  });
+
+  final Key? key;
+
+  final String? sm;
+
+  final String? contactNumber;
+
+  final String? email;
+
+  @override
+  String toString() {
+    return 'EstateUploadSuccessPageRouteArgs{key: $key, sm: $sm, contactNumber: $contactNumber, email: $email}';
+  }
 }
 
 /// generated route for
@@ -276,7 +328,7 @@ class SignUpVerifyPageRoute extends PageRouteInfo<SignUpVerifyPageRouteArgs> {
     required String firstName,
     required String lastName,
     required String email,
-    required String phone,
+    required String fullPhone,
     required String password,
     required String confirmPassword,
     required String? verifyKey,
@@ -289,7 +341,7 @@ class SignUpVerifyPageRoute extends PageRouteInfo<SignUpVerifyPageRouteArgs> {
             firstName: firstName,
             lastName: lastName,
             email: email,
-            phone: phone,
+            fullPhone: fullPhone,
             password: password,
             confirmPassword: confirmPassword,
             verifyKey: verifyKey,
@@ -310,7 +362,7 @@ class SignUpVerifyPageRouteArgs {
     required this.firstName,
     required this.lastName,
     required this.email,
-    required this.phone,
+    required this.fullPhone,
     required this.password,
     required this.confirmPassword,
     required this.verifyKey,
@@ -325,7 +377,7 @@ class SignUpVerifyPageRouteArgs {
 
   final String email;
 
-  final String phone;
+  final String fullPhone;
 
   final String password;
 
@@ -337,7 +389,7 @@ class SignUpVerifyPageRouteArgs {
 
   @override
   String toString() {
-    return 'SignUpVerifyPageRouteArgs{key: $key, firstName: $firstName, lastName: $lastName, email: $email, phone: $phone, password: $password, confirmPassword: $confirmPassword, verifyKey: $verifyKey, verifyCode: $verifyCode}';
+    return 'SignUpVerifyPageRouteArgs{key: $key, firstName: $firstName, lastName: $lastName, email: $email, fullPhone: $fullPhone, password: $password, confirmPassword: $confirmPassword, verifyKey: $verifyKey, verifyCode: $verifyCode}';
   }
 }
 

+ 1 - 1
packages/cpt_profile/lib/modules/my_estate/my_estate_view_model.dart

@@ -97,7 +97,7 @@ class MyEstateViewModel extends _$MyEstateViewModel with DioCancelableMixin {
   void showRemoveEstateDialog(String? unitId) {
     DialogEngine.show(widget: RemoveAccountDialog(
       confirmAction: () {
-        // _doDeleteEstateUnit(unitId);
+        _doDeleteEstateUnit(unitId);
       },
     ));
   }

+ 72 - 0
packages/cs_domain/lib/entity/join_estate_success_entity.dart

@@ -0,0 +1,72 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/join_estate_success_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/join_estate_success_entity.g.dart';
+
+@JsonSerializable()
+class JoinEstateSuccessEntity {
+	String? sn;
+	@JSONField(name: "user_id")
+	String? userId;
+	@JSONField(name: "state_id")
+	String? stateId;
+	String? type;
+	int status = 0;
+	List<String> files = [];
+	@JSONField(name: "updated_at")
+	String? updatedAt;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	String? id;
+	JoinEstateSuccessEstate? estate;
+
+	JoinEstateSuccessEntity();
+
+	factory JoinEstateSuccessEntity.fromJson(Map<String, dynamic> json) => $JoinEstateSuccessEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $JoinEstateSuccessEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class JoinEstateSuccessEstate {
+	String? id;
+	String? name;
+	JoinEstateSuccessEstateInformation? information;
+
+	JoinEstateSuccessEstate();
+
+	factory JoinEstateSuccessEstate.fromJson(Map<String, dynamic> json) => $JoinEstateSuccessEstateFromJson(json);
+
+	Map<String, dynamic> toJson() => $JoinEstateSuccessEstateToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class JoinEstateSuccessEstateInformation {
+	String? id;
+	String? name;
+	String? email;
+	String? address;
+	@JSONField(name: "contact_number")
+	String? contactNumber;
+
+	JoinEstateSuccessEstateInformation();
+
+	factory JoinEstateSuccessEstateInformation.fromJson(Map<String, dynamic> json) => $JoinEstateSuccessEstateInformationFromJson(json);
+
+	Map<String, dynamic> toJson() => $JoinEstateSuccessEstateInformationToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 13 - 0
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -25,6 +25,7 @@ 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/join_estate_success_entity.dart';
 import 'package:domain/entity/latest_news_detail_entity.dart';
 import 'package:domain/entity/latest_news_page_entity.dart';
 import 'package:domain/entity/myfollowing_list_entity.dart';
@@ -338,6 +339,15 @@ class JsonConvert {
     if (<IdNameEntity>[] is M) {
       return data.map<IdNameEntity>((Map<String, dynamic> e) => IdNameEntity.fromJson(e)).toList() as M;
     }
+    if (<JoinEstateSuccessEntity>[] is M) {
+      return data.map<JoinEstateSuccessEntity>((Map<String, dynamic> e) => JoinEstateSuccessEntity.fromJson(e)).toList() as M;
+    }
+    if (<JoinEstateSuccessEstate>[] is M) {
+      return data.map<JoinEstateSuccessEstate>((Map<String, dynamic> e) => JoinEstateSuccessEstate.fromJson(e)).toList() as M;
+    }
+    if (<JoinEstateSuccessEstateInformation>[] is M) {
+      return data.map<JoinEstateSuccessEstateInformation>((Map<String, dynamic> e) => JoinEstateSuccessEstateInformation.fromJson(e)).toList() as M;
+    }
     if (<LatestNewsDetailEntity>[] is M) {
       return data.map<LatestNewsDetailEntity>((Map<String, dynamic> e) => LatestNewsDetailEntity.fromJson(e)).toList() as M;
     }
@@ -795,6 +805,9 @@ class JsonConvertClassCollection {
     (HomeListPropertyNews).toString(): HomeListPropertyNews.fromJson,
     (IdAddressEntity).toString(): IdAddressEntity.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
+    (JoinEstateSuccessEntity).toString(): JoinEstateSuccessEntity.fromJson,
+    (JoinEstateSuccessEstate).toString(): JoinEstateSuccessEstate.fromJson,
+    (JoinEstateSuccessEstateInformation).toString(): JoinEstateSuccessEstateInformation.fromJson,
     (LatestNewsDetailEntity).toString(): LatestNewsDetailEntity.fromJson,
     (LatestNewsPageEntity).toString(): LatestNewsPageEntity.fromJson,
     (LatestNewsList).toString(): LatestNewsList.fromJson,

+ 180 - 0
packages/cs_domain/lib/generated/json/join_estate_success_entity.g.dart

@@ -0,0 +1,180 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/join_estate_success_entity.dart';
+
+JoinEstateSuccessEntity $JoinEstateSuccessEntityFromJson(Map<String, dynamic> json) {
+  final JoinEstateSuccessEntity joinEstateSuccessEntity = JoinEstateSuccessEntity();
+  final String? sn = jsonConvert.convert<String>(json['sn']);
+  if (sn != null) {
+    joinEstateSuccessEntity.sn = sn;
+  }
+  final String? userId = jsonConvert.convert<String>(json['user_id']);
+  if (userId != null) {
+    joinEstateSuccessEntity.userId = userId;
+  }
+  final String? stateId = jsonConvert.convert<String>(json['state_id']);
+  if (stateId != null) {
+    joinEstateSuccessEntity.stateId = stateId;
+  }
+  final String? type = jsonConvert.convert<String>(json['type']);
+  if (type != null) {
+    joinEstateSuccessEntity.type = type;
+  }
+  final int? status = jsonConvert.convert<int>(json['status']);
+  if (status != null) {
+    joinEstateSuccessEntity.status = status;
+  }
+  final List<String>? files = (json['files'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (files != null) {
+    joinEstateSuccessEntity.files = files;
+  }
+  final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
+  if (updatedAt != null) {
+    joinEstateSuccessEntity.updatedAt = updatedAt;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    joinEstateSuccessEntity.createdAt = createdAt;
+  }
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    joinEstateSuccessEntity.id = id;
+  }
+  final JoinEstateSuccessEstate? estate = jsonConvert.convert<JoinEstateSuccessEstate>(json['estate']);
+  if (estate != null) {
+    joinEstateSuccessEntity.estate = estate;
+  }
+  return joinEstateSuccessEntity;
+}
+
+Map<String, dynamic> $JoinEstateSuccessEntityToJson(JoinEstateSuccessEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['sn'] = entity.sn;
+  data['user_id'] = entity.userId;
+  data['state_id'] = entity.stateId;
+  data['type'] = entity.type;
+  data['status'] = entity.status;
+  data['files'] = entity.files;
+  data['updated_at'] = entity.updatedAt;
+  data['created_at'] = entity.createdAt;
+  data['id'] = entity.id;
+  data['estate'] = entity.estate?.toJson();
+  return data;
+}
+
+extension JoinEstateSuccessEntityExtension on JoinEstateSuccessEntity {
+  JoinEstateSuccessEntity copyWith({
+    String? sn,
+    String? userId,
+    String? stateId,
+    String? type,
+    int? status,
+    List<String>? files,
+    String? updatedAt,
+    String? createdAt,
+    String? id,
+    JoinEstateSuccessEstate? estate,
+  }) {
+    return JoinEstateSuccessEntity()
+      ..sn = sn ?? this.sn
+      ..userId = userId ?? this.userId
+      ..stateId = stateId ?? this.stateId
+      ..type = type ?? this.type
+      ..status = status ?? this.status
+      ..files = files ?? this.files
+      ..updatedAt = updatedAt ?? this.updatedAt
+      ..createdAt = createdAt ?? this.createdAt
+      ..id = id ?? this.id
+      ..estate = estate ?? this.estate;
+  }
+}
+
+JoinEstateSuccessEstate $JoinEstateSuccessEstateFromJson(Map<String, dynamic> json) {
+  final JoinEstateSuccessEstate joinEstateSuccessEstate = JoinEstateSuccessEstate();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    joinEstateSuccessEstate.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    joinEstateSuccessEstate.name = name;
+  }
+  final JoinEstateSuccessEstateInformation? information = jsonConvert.convert<JoinEstateSuccessEstateInformation>(json['information']);
+  if (information != null) {
+    joinEstateSuccessEstate.information = information;
+  }
+  return joinEstateSuccessEstate;
+}
+
+Map<String, dynamic> $JoinEstateSuccessEstateToJson(JoinEstateSuccessEstate entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['information'] = entity.information?.toJson();
+  return data;
+}
+
+extension JoinEstateSuccessEstateExtension on JoinEstateSuccessEstate {
+  JoinEstateSuccessEstate copyWith({
+    String? id,
+    String? name,
+    JoinEstateSuccessEstateInformation? information,
+  }) {
+    return JoinEstateSuccessEstate()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..information = information ?? this.information;
+  }
+}
+
+JoinEstateSuccessEstateInformation $JoinEstateSuccessEstateInformationFromJson(Map<String, dynamic> json) {
+  final JoinEstateSuccessEstateInformation joinEstateSuccessEstateInformation = JoinEstateSuccessEstateInformation();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    joinEstateSuccessEstateInformation.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    joinEstateSuccessEstateInformation.name = name;
+  }
+  final String? email = jsonConvert.convert<String>(json['email']);
+  if (email != null) {
+    joinEstateSuccessEstateInformation.email = email;
+  }
+  final String? address = jsonConvert.convert<String>(json['address']);
+  if (address != null) {
+    joinEstateSuccessEstateInformation.address = address;
+  }
+  final String? contactNumber = jsonConvert.convert<String>(json['contact_number']);
+  if (contactNumber != null) {
+    joinEstateSuccessEstateInformation.contactNumber = contactNumber;
+  }
+  return joinEstateSuccessEstateInformation;
+}
+
+Map<String, dynamic> $JoinEstateSuccessEstateInformationToJson(JoinEstateSuccessEstateInformation entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['email'] = entity.email;
+  data['address'] = entity.address;
+  data['contact_number'] = entity.contactNumber;
+  return data;
+}
+
+extension JoinEstateSuccessEstateInformationExtension on JoinEstateSuccessEstateInformation {
+  JoinEstateSuccessEstateInformation copyWith({
+    String? id,
+    String? name,
+    String? email,
+    String? address,
+    String? contactNumber,
+  }) {
+    return JoinEstateSuccessEstateInformation()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..email = email ?? this.email
+      ..address = address ?? this.address
+      ..contactNumber = contactNumber ?? this.contactNumber;
+  }
+}

+ 5 - 2
packages/cs_domain/lib/repository/profile_repository.dart

@@ -10,6 +10,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
 import '../entity/id_address_entity.dart';
+import '../entity/join_estate_success_entity.dart';
 
 part 'profile_repository.g.dart';
 
@@ -282,7 +283,7 @@ class ProfileRepository {
   }
 
   /// 加入房产的单元
-  Future<HttpResult> joinEstateUnit({
+  Future<HttpResult<JoinEstateSuccessEntity>> joinEstateUnit({
     required String? unitId,
     required String? type,
     required List<String>? paths,
@@ -310,7 +311,9 @@ class ProfileRepository {
     );
 
     if (result.isSuccess) {
-      return result.convert();
+      final json = result.getDataJson();
+      var data = JoinEstateSuccessEntity.fromJson(json!);
+      return result.convert<JoinEstateSuccessEntity>(data: data);
     }
     return result.convert();
   }