Browse Source

Payment 周期任务的支付,公共的支付页面与支付详情展示

liukai 1 week ago
parent
commit
4bdaf35592
50 changed files with 1151 additions and 436 deletions
  1. 6 0
      packages/cpt_facility/lib/router/component/facility_component_service.dart
  2. 1 1
      packages/cpt_form/lib/modules/apply/vm/apply_view_model.g.dart
  3. 2 2
      packages/cpt_form/lib/modules/detail/detail_approved_fragment.dart
  4. 2 2
      packages/cpt_form/lib/modules/detail/detail_not_approved_fragment.dart
  5. 1 1
      packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart
  6. 1 1
      packages/cpt_form/lib/modules/detail/form_detail_view_model.g.dart
  7. 0 1
      packages/cpt_form/lib/modules/form/apply/form_apply_screen.dart
  8. 1 1
      packages/cpt_form/lib/modules/form/approve/form_approve_view_model.g.dart
  9. 1 1
      packages/cpt_form/lib/modules/form/submit/form_submit_view_model.g.dart
  10. 6 0
      packages/cpt_form/lib/router/component/form_component_service.dart
  11. 1 0
      packages/cpt_main/lib/modules/home/home_page.dart
  12. 3 2
      packages/cpt_payment/lib/modules/payment/history/history_list_state.dart
  13. 50 70
      packages/cpt_payment/lib/modules/payment/history/history_list_view_model.dart
  14. 1 1
      packages/cpt_payment/lib/modules/payment/history/history_list_view_model.g.dart
  15. 46 87
      packages/cpt_payment/lib/modules/payment/history/item_history_list.dart
  16. 55 16
      packages/cpt_payment/lib/modules/payment/payment/item_payment_list.dart
  17. 4 1
      packages/cpt_payment/lib/modules/payment/payment/payment_list_screen.dart
  18. 0 25
      packages/cpt_payment/lib/modules/payment/payment/payment_list_types.dart
  19. 57 2
      packages/cpt_payment/lib/modules/payment/payment/payment_list_view_model.dart
  20. 1 1
      packages/cpt_payment/lib/modules/payment/payment/payment_list_view_model.g.dart
  21. 164 77
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_page.dart
  22. 16 7
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.dart
  23. 1 1
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.g.dart
  24. 1 1
      packages/cpt_payment/lib/modules/payment_info/payment_info_view_model.dart
  25. 1 1
      packages/cpt_payment/lib/modules/payment_info/payment_info_view_model.g.dart
  26. 44 26
      packages/cpt_payment/lib/modules/payment_success/payment_success_page.dart
  27. 16 2
      packages/cpt_payment/lib/modules/payment_success/payment_success_state.dart
  28. 18 0
      packages/cpt_payment/lib/modules/payment_success/payment_success_view_model.dart
  29. 1 1
      packages/cpt_payment/lib/modules/payment_success/payment_success_view_model.g.dart
  30. 103 10
      packages/cpt_payment/lib/router/page/payment_page_router.gr.dart
  31. 4 1
      packages/cs_domain/lib/constants/api_constants.dart
  32. 61 0
      packages/cs_domain/lib/entity/comm_payment_detail_entity.dart
  33. 8 6
      packages/cs_domain/lib/entity/form_detail_entity.dart
  34. 53 7
      packages/cs_domain/lib/entity/payment_page_entity.dart
  35. 13 0
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  36. 150 0
      packages/cs_domain/lib/generated/json/comm_payment_detail_entity.g.dart
  37. 27 20
      packages/cs_domain/lib/generated/json/form_detail_entity.g.dart
  38. 141 24
      packages/cs_domain/lib/generated/json/payment_page_entity.g.dart
  39. 28 0
      packages/cs_domain/lib/repository/payment_repository.dart
  40. BIN
      packages/cs_resources/assets/payment/payment_pending_icon.webp
  41. 1 0
      packages/cs_resources/lib/generated/assets.dart
  42. 15 12
      packages/cs_resources/lib/generated/intl/messages_en.dart
  43. 15 12
      packages/cs_resources/lib/generated/intl/messages_zh_CN.dart
  44. 15 12
      packages/cs_resources/lib/generated/intl/messages_zh_HK.dart
  45. 10 0
      packages/cs_resources/lib/generated/l10n.dart
  46. 1 0
      packages/cs_resources/lib/l10n/intl_en.arb
  47. 1 0
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  48. 1 0
      packages/cs_resources/lib/l10n/intl_zh_HK.arb
  49. 1 0
      packages/cs_router/lib/componentRouter/facility_service.dart
  50. 2 1
      packages/cs_router/lib/componentRouter/form_service.dart

+ 6 - 0
packages/cpt_facility/lib/router/component/facility_component_service.dart

@@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 
+import '../../modules/detail/facility_detail_page.dart';
 import '../../modules/facility/facility_page.dart';
 
 part 'facility_component_service.g.dart';
@@ -21,4 +22,9 @@ class FacilityComponentService extends FacilityService {
   void startFacilityPage() {
     FacilityPage.startInstance();
   }
+
+  @override
+  void startFacilityDetailPage({required String id}) {
+    FacilityDetailPage.startInstance(bookingId: id);
+  }
 }

+ 1 - 1
packages/cpt_form/lib/modules/apply/vm/apply_view_model.g.dart

@@ -6,7 +6,7 @@ part of 'apply_view_model.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$applyViewModelHash() => r'd79f7a3eb669265cc9d4c43850736b215051ef49';
+String _$applyViewModelHash() => r'136d921c884c927c99c05bb134a202325d02e5f2';
 
 /// See also [ApplyViewModel].
 @ProviderFor(ApplyViewModel)

+ 2 - 2
packages/cpt_form/lib/modules/detail/detail_approved_fragment.dart

@@ -57,7 +57,7 @@ class DetailApprovedFragment extends HookConsumerWidget {
                           text: S.current.send_on_sometime(' '),
                         ),
                         TextSpan(
-                          text: state.forDetail?.sentOn ?? "-",
+                          text: state.forDetail?.createdAt ?? "-",
                           style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: context.appColors.textBlack),
                         ),
                       ],
@@ -73,7 +73,7 @@ class DetailApprovedFragment extends HookConsumerWidget {
                           text: S.current.approved_on_sometime(' '),
                         ),
                         TextSpan(
-                          text: state.forDetail?.approvedOn ?? "-",
+                          text: state.forDetail?.updateAt ?? "-",
                           style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: context.appColors.textBlack),
                         ),
                       ],

+ 2 - 2
packages/cpt_form/lib/modules/detail/detail_not_approved_fragment.dart

@@ -57,7 +57,7 @@ class DetailNotApprovedFragment extends HookConsumerWidget {
                           text: S.current.send_on_sometime(' '),
                         ),
                         TextSpan(
-                          text: state.forDetail?.sentOn ?? "-",
+                          text: state.forDetail?.createdAt ?? "-",
                           style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: context.appColors.textBlack),
                         ),
                       ],
@@ -73,7 +73,7 @@ class DetailNotApprovedFragment extends HookConsumerWidget {
                           text: S.current.approved_on_sometime(' '),
                         ),
                         TextSpan(
-                          text: state.forDetail?.rejectedOn ?? "-",
+                          text: state.forDetail?.updateAt ?? "-",
                           style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: context.appColors.textBlack),
                         ),
                       ],

+ 1 - 1
packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart

@@ -81,7 +81,7 @@ class DetailProcessingFragment extends HookConsumerWidget {
                           text: S.current.send_on_sometime(' '),
                         ),
                         TextSpan(
-                          text: state.forDetail?.sentOn ?? "-",
+                          text: state.forDetail?.createdAt ?? "-",
                           style: TextStyle(fontSize: 15, fontWeight: FontWeight.w500, color: context.appColors.textBlack),
                         ),
                       ],

+ 1 - 1
packages/cpt_form/lib/modules/detail/form_detail_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'form_detail_view_model.dart';
 // **************************************************************************
 
 String _$formDetailViewModelHash() =>
-    r'cb3ec02850ae818982d6358f0935b09546515ba1';
+    r'37c7b4f7ba1ce1be7eb0685884724bb086969cbb';
 
 /// See also [FormDetailViewModel].
 @ProviderFor(FormDetailViewModel)

+ 0 - 1
packages/cpt_form/lib/modules/form/apply/form_apply_screen.dart

@@ -45,7 +45,6 @@ class FormApplyScreen extends HookConsumerWidget {
                   //进入申请的协议页面
                   FormTermsPage.startInstance(
                     formType: state.datas[index].typeId!,
-                    estateFormId: null,
                     formItem: state.datas[index],
                     enableEdit: true,
                   );

+ 1 - 1
packages/cpt_form/lib/modules/form/approve/form_approve_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'form_approve_view_model.dart';
 // **************************************************************************
 
 String _$formApproveViewModelHash() =>
-    r'88b513f846a7e885ee951878529e54a0f63d5e67';
+    r'2391b9a8ae2d4f314c65143c839163e1f8823d52';
 
 /// See also [FormApproveViewModel].
 @ProviderFor(FormApproveViewModel)

+ 1 - 1
packages/cpt_form/lib/modules/form/submit/form_submit_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'form_submit_view_model.dart';
 // **************************************************************************
 
 String _$formSubmitViewModelHash() =>
-    r'87ef17cca1f53c2e845733c2d08b3d5e97bc7845';
+    r'e4cf4c2d7dcde81db874fa84d3a1e556b05adb8a';
 
 /// See also [FormSubmitViewModel].
 @ProviderFor(FormSubmitViewModel)

+ 6 - 0
packages/cpt_form/lib/router/component/form_component_service.dart

@@ -1,6 +1,7 @@
 /*
  * Community 组件的组件路由
  */
+import 'package:cpt_form/modules/detail/form_detail_page.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:router/componentRouter/form_service.dart';
 import 'package:flutter/material.dart';
@@ -21,4 +22,9 @@ class FormComponentService extends FormService {
   void startFormPage() {
     FormPage.startInstance();
   }
+
+  @override
+  void startFormDetailPage(String estateFormId, String taskId, String typeId) {
+    FormDetailPage.startInstance(estateFormId: estateFormId, taskId: taskId, type: typeId);
+  }
 }

+ 1 - 0
packages/cpt_main/lib/modules/home/home_page.dart

@@ -133,6 +133,7 @@ class HomePage extends HookConsumerWidget {
                 right: 0,
                 bottom: 0,
                 child: EasyRefresh(
+                  header: const MaterialHeader(),
                   controller: viewModel.refreshController,
                   onRefresh: viewModel.onRefresh,
                   child: CustomScrollView(

+ 3 - 2
packages/cpt_payment/lib/modules/payment/history/history_list_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/payment_page_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class HistoryListState {
@@ -6,7 +7,7 @@ class HistoryListState {
   LoadState loadingState;
   String? errorMessage;
 
-  List<String> datas; //页面列表数据
+  List<PaymentPageList> datas; //页面列表数据
 
   // ===================================  Begin  ↓  ===================================
 
@@ -20,7 +21,7 @@ class HistoryListState {
     LoadState? loadingState,
     String? errorMessage,
     bool? needShowPlaceholder,
-    List<String>? datas,
+    List<PaymentPageList>? datas,
   }) {
     return HistoryListState(
       errorMessage: errorMessage ?? this.errorMessage,

+ 50 - 70
packages/cpt_payment/lib/modules/payment/history/history_list_view_model.dart

@@ -1,25 +1,33 @@
+import 'package:domain/entity/payment_page_entity.dart';
+import 'package:domain/repository/payment_repository.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:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
 import 'history_list_state.dart';
+
 part 'history_list_view_model.g.dart';
 
 @riverpod
-class HistoryListViewModel extends _$HistoryListViewModel {
+class HistoryListViewModel extends _$HistoryListViewModel with DioCancelableMixin {
+  late final PaymentRepository _paymentRepository;
   var _curPage = 1; //请求参数当前的页面
   var _needShowPlaceholder = true; //是否展示LoadingView
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
-    controlFinishRefresh: true,  //允许刷新
-    controlFinishLoad: true,   //允许加载
+    controlFinishRefresh: true, //允许刷新
+    controlFinishLoad: true, //允许加载
   );
 
   @override
   HistoryListState build() {
-    return HistoryListState(datas: []);
+    _paymentRepository = ref.read(paymentRepositoryProvider);
+    final state = HistoryListState(datas: []);
+    registerCancellation();
+    return state;
   }
 
   //刷新页面状态
@@ -52,78 +60,50 @@ class HistoryListViewModel extends _$HistoryListViewModel {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    // 获取 Applied 列表
-    // var listResult = await _jobRepository.fetchJobAppliedList(
-    //   state.jobId,
-    //   state.selectedStatusId,
-    //   state.keyword,
-    //   curPage: _curPage,
-    //   cancelToken: cancelToken,
-    // );
-    //
-    // // 处理数据
-    // if (listResult.isSuccess) {
-    //   handleList(listResult.data?.rows);
-    // } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    // }
-
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-
-    final List<String> list = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"];
-
-    if (_curPage == 1) {
-      //刷新的方式
-      state = state.copyWith(datas: list);
-      refreshController.finishRefresh();
+    // 获取列表
+    var listResult = await _paymentRepository.fetchPaymentList(
+      type: 'history',
+      curPage: _curPage,
+      cancelToken: cancelToken,
+    );
 
-      //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // 处理数据
+    if (listResult.isSuccess) {
+      handleList(listResult.data?.list);
     } else {
-      //加载更多
-      final allList = state.datas;
-      allList.addAll(list);
-      state.datas.addAll(list);
-
-      refreshController.finishLoad();
-
-      state = state.copyWith(datas: allList);
+      changeLoadingState(LoadState.State_Error, listResult.errorMsg);
     }
 
     // 最后赋值
     _needShowPlaceholder = false;
   }
 
-// 处理数据与展示的逻辑
-// void handleList(List<JobAppliedListSGRows>? list) {
-//   if (list != null && list.isNotEmpty) {
-//     //有数据,判断是刷新还是加载更多的数据
-//     if (_curPage == 1) {
-//       //刷新的方式
-//       state.datas.clear();
-//       state.datas.addAll(list);
-//       refreshController.finishRefresh();
-//
-//       //更新展示的状态
-//       changeLoadingState(LoadState.State_Success);
-//     } else {
-//       //加载更多
-//       state.datas.addAll(list);
-//       refreshController.finishLoad();
-//       update();
-//     }
-//   } else {
-//     if (_curPage == 1) {
-//       //展示无数据的布局
-//       state.datas.clear();
-//       changeLoadingState(LoadState.State_Empty);
-//       refreshController.finishRefresh();
-//     } else {
-//       //展示加载完成,没有更多数据了
-//       refreshController.finishLoad(IndicatorResult.noMore);
-//     }
-//   }
-// }
+  // 处理数据与展示的逻辑
+  void handleList(List<PaymentPageList>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_curPage == 1) {
+        //刷新的方式
+        state = state.copyWith(datas: list);
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        state.datas.addAll(List<PaymentPageList>.from(state.datas)..addAll(list));
+        refreshController.finishLoad();
+      }
+    } else {
+      if (_curPage == 1) {
+        //展示无数据的布局
+        state = state.copyWith(datas: []);
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
 }

+ 1 - 1
packages/cpt_payment/lib/modules/payment/history/history_list_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'history_list_view_model.dart';
 // **************************************************************************
 
 String _$historyListViewModelHash() =>
-    r'87eda063f8265a39a0f0ec47b4b1c688ed09b8d1';
+    r'94a8d6dbdc4de5fc3a848ac3f8800575c4200427';
 
 /// See also [HistoryListViewModel].
 @ProviderFor(HistoryListViewModel)

+ 46 - 87
packages/cpt_payment/lib/modules/payment/history/item_history_list.dart

@@ -1,13 +1,14 @@
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/payment_page_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/my_text_view.dart';
 
-///  Condo的History的Item
+/// Payment 的History的Item
 class HistoryListItem extends StatelessWidget {
   final int index;
-  final String item;
+  final PaymentPageList item;
 
   const HistoryListItem({
     required this.index,
@@ -32,67 +33,57 @@ class HistoryListItem extends StatelessWidget {
           ),
         ],
       ),
-      child: Row(
-        mainAxisSize: MainAxisSize.max,
+      child: Column(
         crossAxisAlignment: CrossAxisAlignment.start,
         children: [
-          Column(
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: [
-              //设施
-              MyTextView(
-                "Kids party room",
-                fontSize: 16,
-                maxLines: 3,
-                textColor: context.appColors.textBlack,
-                isFontMedium: true,
-              ),
+          //标题
+          MyTextView(
+            item.title ?? "",
+            fontSize: 16,
+            maxLines: 3,
+            textColor: context.appColors.textBlack,
+            isFontMedium: true,
+          ),
 
-              //预订
-              MyTextView(
-                S.current.booked_by_someone("Wu Bing Bing"),
-                fontSize: 14,
-                marginTop: 3,
-                textColor: context.appColors.textBlack,
-                isFontRegular: true,
-              ),
+          //付款人
+          MyTextView(
+            S.current.booked_by_someone(item.account?.name ?? ""),
+            fontSize: 14,
+            marginTop: 3,
+            textColor: context.appColors.textBlack,
+            isFontRegular: true,
+          ),
 
-              //日期
-              MyTextView(
-                "Tue,24 Oct 2023",
-                fontSize: 14,
-                marginTop: 16,
-                textColor: context.appColors.textBlack,
-                isFontRegular: true,
-              ),
+          //日期
+          MyTextView(
+            item.paidAt ?? "",
+            fontSize: 14,
+            marginTop: 16,
+            marginBottom: 8,
+            textColor: context.appColors.textBlack,
+            isFontRegular: true,
+          ),
 
-              //时间
+          //标签
+          Row(
+            children: [
               MyTextView(
-                "05:00 PM-10:00 PM",
-                fontSize: 14,
-                marginBottom: 7,
-                marginTop: 3,
-                textColor: context.appColors.textBlack,
+                "Fee Paid",
+                textColor: context.appColors.textPrimary,
+                fontSize: 13,
                 isFontRegular: true,
+                backgroundColor: context.appColors.lightBlueDarkBg,
+                cornerRadius: 3,
+                paddingLeft: 7,
+                marginRight: 6,
+                paddingRight: 7,
+                paddingTop: 3,
+                paddingBottom: 3,
               ),
 
-              //标签
-              Row(
-                children: [
-                  MyTextView(
-                    "Fee Paid",
-                    textColor: context.appColors.textPrimary,
-                    fontSize: 13,
-                    isFontRegular: true,
-                    backgroundColor: context.appColors.lightBlueDarkBg,
-                    cornerRadius: 3,
-                    paddingLeft: 7,
-                    marginRight: 6,
-                    paddingRight: 7,
-                    paddingTop: 3,
-                    paddingBottom: 3,
-                  ),
-                  MyTextView(
+              Visibility(
+                  visible: item.refundStatus != 0,
+                  child: MyTextView(
                     "Deposit Released",
                     textColor: context.appColors.textPrimary,
                     fontSize: 13,
@@ -104,39 +95,7 @@ class HistoryListItem extends StatelessWidget {
                     paddingRight: 7,
                     paddingTop: 3,
                     paddingBottom: 3,
-                  )
-                ],
-              )
-            ],
-          ).expanded(),
-          Column(
-            mainAxisSize: MainAxisSize.min,
-            mainAxisAlignment:MainAxisAlignment.start,
-            crossAxisAlignment: CrossAxisAlignment.start,
-            children: [
-              //查看按钮
-              MyTextView(
-                S.current.view,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.btnBgDefault,
-                cornerRadius: 7,
-                paddingTop: 9,
-                paddingBottom: 9,
-                textAlign: TextAlign.center,
-                boxWidth: 60,
-              ),
-
-              MyTextView(
-                S.current.delete,
-                textColor: Colors.white,
-                backgroundColor: context.appColors.orangeBG,
-                cornerRadius: 7,
-                paddingTop: 9,
-                marginTop: 15,
-                paddingBottom: 9,
-                textAlign: TextAlign.center,
-                boxWidth: 60,
-              )
+                  ))
             ],
           )
         ],

+ 55 - 16
packages/cpt_payment/lib/modules/payment/payment/item_payment_list.dart

@@ -1,3 +1,5 @@
+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/payment_page_entity.dart';
 import 'package:flutter/material.dart';
@@ -6,8 +8,6 @@ import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 import 'package:widgets/utils/dark_theme_util.dart';
 
-import 'payment_list_types.dart';
-
 /// Condo Active 的 Item 布局
 class PaymentListItem extends StatelessWidget {
   final int index;
@@ -22,9 +22,8 @@ class PaymentListItem extends StatelessWidget {
   Widget build(BuildContext context) {
     return Container(
       width: double.infinity,
-      height: 80,
       margin: const EdgeInsets.only(left: 15, right: 15, top: 5, bottom: 5),
-      padding: const EdgeInsets.symmetric(horizontal: 20),
+      padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
       decoration: BoxDecoration(
         color: context.appColors.whiteBG,
         borderRadius: BorderRadius.circular(6.0), // 圆角
@@ -42,19 +41,59 @@ class PaymentListItem extends StatelessWidget {
         crossAxisAlignment: CrossAxisAlignment.center,
         children: [
           MyAssetImage(
-            PaymentListTypes.iconMap[item.type]?['icon_path'],
-            width: PaymentListTypes.iconMap[item.type]?['width'],
-            height: PaymentListTypes.iconMap[item.type]?['height'],
-            color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary,darkColor: Colors.white),
+            Assets.paymentPaymentPendingIcon,
+            width: 38.5,
+            height: 36.5,
+            color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
           ),
-
-          MyTextView(
-            PaymentListTypes.iconMap[item.type]?['name'],
-            marginLeft: 17,
-            fontSize: 16,
-            textColor: context.appColors.textBlack,
-            isFontMedium: true,
-          ).expanded(),
+          Column(
+            mainAxisSize: MainAxisSize.max,
+            crossAxisAlignment: CrossAxisAlignment.start,
+            children: [
+              MyTextView(
+                item.title ?? "",
+                fontSize: 16,
+                textColor: context.appColors.textBlack,
+                isFontMedium: true,
+              ),
+              MyTextView(
+                item.type == "property" || item.type == "vehicle" ? "${item.orderable?.startAt} - ${item.orderable?.endAt}" : item.createdAt ?? "",
+                marginTop: 4,
+                fontSize: 11,
+                textColor: context.appColors.textBlack,
+                isFontRegular: true,
+              ),
+              Row(
+                children: [
+                  MyTextView(
+                    "${S.current.amount}:",
+                    fontSize: 11,
+                    textColor: context.appColors.textBlack,
+                    isFontRegular: true,
+                  ),
+                  MyTextView(
+                    "\$${item.orderAmount}",
+                    fontSize: 11,
+                    textColor: context.appColors.textPrimary,
+                    isFontRegular: true,
+                  ),
+                  MyTextView(
+                    "${S.current.deposit}:",
+                    marginLeft: 10,
+                    fontSize: 11,
+                    textColor: context.appColors.textBlack,
+                    isFontRegular: true,
+                  ),
+                  MyTextView(
+                    "\$${item.depositAmount}",
+                    fontSize: 11,
+                    textColor: context.appColors.textPrimary,
+                    isFontRegular: true,
+                  ),
+                ],
+              ).marginOnly(top: 4)
+            ],
+          ).marginOnly(left: 17).expanded(),
         ],
       ),
     );

+ 4 - 1
packages/cpt_payment/lib/modules/payment/payment/payment_list_screen.dart

@@ -7,6 +7,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
+import '../../payment_confirm/payment_confirm_page.dart';
 import 'payment_list_view_model.dart';
 import 'item_payment_list.dart';
 
@@ -44,7 +45,9 @@ class PaymentListScreen extends HookConsumerWidget {
                       (context, index) {
                     return PaymentListItem(index: index, item: state.datas[index]).onTap(() {
                       //去信息页面
-                      PaymentInfoPage.startInstance(context: context);
+                      //根据类型跳转到不同的页面
+                      viewModel.gotoPaymentPage(state.datas[index]);
+
                     });
                   },
                   childCount: state.datas.length,

+ 0 - 25
packages/cpt_payment/lib/modules/payment/payment/payment_list_types.dart

@@ -1,25 +0,0 @@
-
-import 'package:cs_resources/generated/assets.dart';
-import 'package:cs_resources/generated/l10n.dart';
-
-
-class PaymentListTypes {
-  //对应的type类型 对应的icon的图片与宽高
-  static Map<String, Map<String, dynamic>> iconMap = {
-    //物业费
-    'property': {
-      'name': S.current.property_payment,
-      'icon_path': Assets.formCarVehicle,
-      'width': 39.5,
-      'height': 33.5,
-    },
-    //停车费
-    'vehicle': {
-      'name': S.current.parking_fee_payment,
-      'icon_path': Assets.paymentPropertyPaymentIcon,
-      'width': 39.5,
-      'height': 36.0,
-    },
-  };
-
-}

+ 57 - 2
packages/cpt_payment/lib/modules/payment/payment/payment_list_view_model.dart

@@ -1,17 +1,22 @@
 import 'package:domain/entity/payment_page_entity.dart';
 import 'package:domain/repository/payment_repository.dart';
+import 'package:plugin_basic/constants/app_constant.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:router/componentRouter/component_service_manager.dart';
+import 'package:shared/utils/event_bus.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../payment_confirm/payment_confirm_page.dart';
 import 'payment_list_state.dart';
 
 part 'payment_list_view_model.g.dart';
 
 @riverpod
-class PaymentListViewModel extends _$PaymentListViewModel with DioCancelableMixin{
+class PaymentListViewModel extends _$PaymentListViewModel with DioCancelableMixin {
   late final PaymentRepository _paymentRepository;
   var _curPage = 1; //请求参数当前的页面
   var _needShowPlaceholder = true; //是否展示LoadingView
@@ -26,7 +31,12 @@ class PaymentListViewModel extends _$PaymentListViewModel with DioCancelableMixi
   PaymentListState build() {
     _paymentRepository = ref.read(paymentRepositoryProvider);
     final state = PaymentListState(datas: []);
-    registerCancellation();
+
+    registerEventBus();
+    registerCancellation(callback: () {
+      unregisterEventBus();
+    });
+
     return state;
   }
 
@@ -106,4 +116,49 @@ class PaymentListViewModel extends _$PaymentListViewModel with DioCancelableMixi
       }
     }
   }
+
+  /// 根据类型跳转到不同的支付页面去支付
+  void gotoPaymentPage(PaymentPageList data) {
+    switch (data.type) {
+      case 'facility_booking':
+        //设施预定订单
+        ComponentServiceManager().facilityService.startFacilityDetailPage(id: data.orderable?.id ?? "");
+        break;
+      case 'online_form_apply':
+        //在线表单订单
+        ComponentServiceManager().formService.startFormDetailPage(
+              data.orderable?.estateOnlineFormId ?? "",
+              data.orderable?.id ?? "",
+              data.orderable?.onlineFormTypeId ?? "",
+            );
+        break;
+      case 'paid_service_order':
+        //服务订单
+        ToastEngine.show("Service 的订单,自己写路由跳转到支付确认页面");
+        break;
+      default:
+        //默认周期订单的支付 (通用支付页面)
+        PaymentConfirmPage.startInstance(
+          title: data.title,
+          orderId: data.id,
+          amount: data.orderAmount,
+          deposit: data.depositAmount,
+        );
+        break;
+    }
+  }
+
+  // EventBus 的事件接收
+  Subscription? subscribe;
+
+  void registerEventBus() {
+    subscribe = bus.on(AppConstant.eventStripePaymentSuccess, (arg) {
+      //用户支付成功的通知
+      refreshController.callRefresh();
+    });
+  }
+
+  void unregisterEventBus() {
+    bus.off(AppConstant.eventStripePaymentSuccess, subscribe);
+  }
 }

+ 1 - 1
packages/cpt_payment/lib/modules/payment/payment/payment_list_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'payment_list_view_model.dart';
 // **************************************************************************
 
 String _$paymentListViewModelHash() =>
-    r'aac4515525c2ec4c013bb07ad3da281258cef311';
+    r'b3d776c00199744d687fa0df87874ea4c5e6c84a';
 
 /// See also [PaymentListViewModel].
 @ProviderFor(PaymentListViewModel)

+ 164 - 77
packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_page.dart

@@ -17,14 +17,31 @@ import 'payment_confirm_view_model.dart';
 
 @RoutePage()
 class PaymentConfirmPage extends HookConsumerWidget {
-  const PaymentConfirmPage({Key? key}) : super(key: key);
+  final String? title;
+  final String? orderId;
+  final String? amount;
+  final String? deposit;
+
+  const PaymentConfirmPage({
+    Key? key,
+    @PathParam() required this.title,
+    @PathParam() required this.orderId,
+    @PathParam() required this.amount,
+    @PathParam() this.deposit,
+  }) : super(key: key);
 
   //启动当前页面
-  static void startInstance({BuildContext? context}) {
+  static void startInstance({
+    BuildContext? context,
+    required String? title,
+    required String? orderId,
+    required String? amount,
+    String? deposit,
+  }) {
     if (context != null) {
-      context.router.push(const PaymentConfirmPageRoute());
+      context.router.push(PaymentConfirmPageRoute(title: title, orderId: orderId, amount: amount, deposit: deposit));
     } else {
-      appRouter.push(const PaymentConfirmPageRoute());
+      appRouter.push(PaymentConfirmPageRoute(title: title, orderId: orderId, amount: amount, deposit: deposit));
     }
   }
 
@@ -34,7 +51,7 @@ class PaymentConfirmPage extends HookConsumerWidget {
     final state = ref.watch(paymentConfirmViewModelProvider);
 
     return Scaffold(
-      appBar: MyAppBar.appBar(context, "付款的标题"),
+      appBar: MyAppBar.appBar(context, title ?? "Payment"),
       backgroundColor: context.appColors.backgroundWhite,
       body: Column(
         mainAxisSize: MainAxisSize.max,
@@ -46,87 +63,158 @@ class PaymentConfirmPage extends HookConsumerWidget {
             child: Column(
               crossAxisAlignment: CrossAxisAlignment.start,
               children: [
-                //金额
-                Row(
-                  children: [
-                    MyAssetImage(
-                      Assets.paymentInfoDetails,
-                      width: 27,
-                      height: 27,
-                      color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
-                    ),
-                    MyTextView(
-                      S.current.payment_details,
-                      textColor: context.appColors.textBlack,
-                      fontSize: 17,
-                      marginLeft: 14,
-                      isFontMedium: true,
-                    ).expanded(),
-                  ],
-                ).marginOnly(top: 15, left: 15, right: 15),
-
-                Row(
-                  children: [
-                    MyTextView(
-                      "SGD",
-                      textColor: context.appColors.textBlack,
-                      fontSize: 18,
-                      isFontRegular: true,
-                    ),
-                    MyTextView(
-                      "\$21.80",
-                      textColor: context.appColors.textPrimary,
-                      fontSize: 22,
-                      marginLeft: 12,
-                      isFontMedium: true,
-                    ).expanded(),
-                  ],
-                ).marginOnly(top: 20, left: 15, right: 15),
-
-                Container(
-                  height: 0.5,
-                  margin: const EdgeInsets.only(top: 22, bottom: 13.5, left: 15, right: 15),
-                  color: context.appColors.dividerDefault,
+                //支付
+                Visibility(
+                  visible: true,
+                  child: Row(
+                    children: [
+                      MyAssetImage(
+                        Assets.paymentInfoDetails,
+                        width: 27,
+                        height: 27,
+                        color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
+                      ),
+                      MyTextView(
+                        S.current.payment,
+                        textColor: context.appColors.textBlack,
+                        fontSize: 17,
+                        marginLeft: 14,
+                        isFontMedium: true,
+                      ).expanded(),
+                    ],
+                  ).marginOnly(top: 15, left: 15, right: 15),
+                ),
+
+                //支付金额
+                Visibility(
+                  visible: true,
+                  child: Row(
+                    mainAxisSize: MainAxisSize.max,
+                    children: [
+                      MyTextView(
+                        S.current.fee,
+                        textColor: context.appColors.textBlack,
+                        fontSize: 18,
+                        isFontRegular: true,
+                      ),
+                      const Spacer(),
+                      MyTextView(
+                        "SGD",
+                        textColor: context.appColors.textBlack,
+                        fontSize: 18,
+                        isFontRegular: true,
+                      ),
+                      MyTextView(
+                        "\$${amount ?? "0.00"}",
+                        textColor: context.appColors.textPrimary,
+                        fontSize: 22,
+                        marginLeft: 8,
+                        isFontMedium: true,
+                      ),
+                    ],
+                  ).marginOnly(top: 20, left: 15, right: 15, bottom: 20),
+                ),
+
+                //分割线
+                Visibility(
+                  visible: deposit != null && int.parse(deposit!) > 0,
+                  child: Divider(
+                    color: context.appColors.dividerDefault,
+                    height: 0.5,
+                  ),
                 ),
 
-                // DESC
-                Row(
-                  children: [
-                    MyAssetImage(
-                      Assets.paymentInfoNotes,
-                      width: 27,
-                      height: 27,
-                      color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
-                    ),
-                    MyTextView(
-                      S.current.notes_to_recipient,
-                      textColor: context.appColors.textBlack,
-                      fontSize: 17,
-                      marginLeft: 14,
-                      isFontMedium: true,
-                    ).expanded(),
-                  ],
-                ).marginOnly(left: 15, right: 15),
-
-                MyTextView(
-                  "The money has already been paid",
-                  textColor: context.appColors.textPrimary,
-                  fontSize: 16,
-                  marginTop: 15,
-                  marginBottom: 20,
-                  marginLeft: 15,
-                  marginRight: 15,
-                  isFontRegular: true,
+                //押金
+                Visibility(
+                  visible: deposit != null && int.parse(deposit!) > 0,
+                  child: Row(
+                    children: [
+                      MyAssetImage(
+                        Assets.paymentInfoDetails,
+                        width: 27,
+                        height: 27,
+                        color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
+                      ),
+                      MyTextView(
+                        S.current.deposit,
+                        textColor: context.appColors.textBlack,
+                        fontSize: 17,
+                        marginLeft: 14,
+                        isFontMedium: true,
+                      ).expanded(),
+                    ],
+                  ).marginOnly(top: 15, left: 15, right: 15),
                 ),
 
-                _paymentInfo(context, ref),
+                //押金金额
+                Visibility(
+                  visible: deposit != null && int.parse(deposit!) > 0,
+                  child: Row(
+                    children: [
+                      MyTextView(
+                        S.current.deposit_hold,
+                        textColor: context.appColors.textBlack,
+                        fontSize: 18,
+                        isFontRegular: true,
+                      ),
+                      const Spacer(),
+                      MyTextView(
+                        "SGD",
+                        textColor: context.appColors.textBlack,
+                        fontSize: 18,
+                        isFontRegular: true,
+                      ),
+                      MyTextView(
+                        "\$${deposit ?? "0.00"}",
+                        textColor: context.appColors.textPrimary,
+                        fontSize: 22,
+                        marginLeft: 8,
+                        isFontMedium: true,
+                      ),
+                    ],
+                  ).marginOnly(top: 20, left: 15, right: 15, bottom: 20),
+                ),
+
+                // // DESC
+                // Row(
+                //   children: [
+                //     MyAssetImage(
+                //       Assets.paymentInfoNotes,
+                //       width: 27,
+                //       height: 27,
+                //       color: DarkThemeUtil.multiColors(context, AppColorsTheme.colorPrimary, darkColor: Colors.white),
+                //     ),
+                //     MyTextView(
+                //       S.current.notes_to_recipient,
+                //       textColor: context.appColors.textBlack,
+                //       fontSize: 17,
+                //       marginLeft: 14,
+                //       isFontMedium: true,
+                //     ).expanded(),
+                //   ],
+                // ).marginOnly(left: 15, right: 15),
+
+                // MyTextView(
+                //   "The money has already been paid",
+                //   textColor: context.appColors.textPrimary,
+                //   fontSize: 16,
+                //   marginTop: 15,
+                //   marginBottom: 20,
+                //   marginLeft: 15,
+                //   marginRight: 15,
+                //   isFontRegular: true,
+                // ),
+
+                // _paymentInfo(context, ref),
               ],
             ),
           ).expanded(),
 
           // 底部按钮
           MyButton(
-            onPressed: viewModel.doPayment,
+            onPressed: () {
+              viewModel.doPaymentOrder(orderId ?? "");
+            },
             text: S.current.proceed_with_payment,
             textColor: Colors.white,
             backgroundColor: context.appColors.btnBgDefault,
@@ -171,7 +259,6 @@ class PaymentConfirmPage extends HookConsumerWidget {
               paddingRight: 16,
               paddingLeft: 16,
               paddingTop: 8,
-              onClick: viewModel.gotoChooseCardPage,
               paddingBottom: 8,
               cornerRadius: 7,
               fontSize: 15,

+ 16 - 7
packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.dart

@@ -1,5 +1,7 @@
 import 'package:cpt_payment/modules/choose_card/choose_card_page.dart';
+import 'package:plugin_platform/engine/loading/loading_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
 
 import '../payment_success/payment_success_page.dart';
 import 'payment_confirm_state.dart';
@@ -13,13 +15,20 @@ class PaymentConfirmViewModel extends _$PaymentConfirmViewModel {
     return PaymentConfirmState();
   }
 
-  //执行支付
-  void doPayment() {
-    PaymentSuccessPage.startWithPop();
-  }
+  //根据OrderId继续支付订单
+  void doPaymentOrder(String orderId) async {
+    //支付流程 Loading 开始
+    LoadingEngine.show();
+
+    //调用支付服务
+    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+
+    //支付流程 Loading 结束
+    LoadingEngine.dismiss();
 
-  //去设置银行卡页面
-  void gotoChooseCardPage() {
-    ChooseCardPage.startInstance();
+    //如果成功,返回页面
+    if (success) {
+      PaymentSuccessPage.startWithPop(orderId: orderId);
+    }
   }
 }

+ 1 - 1
packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'payment_confirm_view_model.dart';
 // **************************************************************************
 
 String _$paymentConfirmViewModelHash() =>
-    r'd49571f12210320ab33926074746f9d30710dfbc';
+    r'bd9a0a264d5db7db1b31fa48c82a6ee42f7d9a50';
 
 /// See also [PaymentConfirmViewModel].
 @ProviderFor(PaymentConfirmViewModel)

+ 1 - 1
packages/cpt_payment/lib/modules/payment_info/payment_info_view_model.dart

@@ -14,6 +14,6 @@ class PaymentInfoViewModel extends _$PaymentInfoViewModel {
 
   //去确定页面
   void gotoConfirmPage() {
-    PaymentConfirmPage.startInstance();
+
   }
 }

+ 1 - 1
packages/cpt_payment/lib/modules/payment_info/payment_info_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'payment_info_view_model.dart';
 // **************************************************************************
 
 String _$paymentInfoViewModelHash() =>
-    r'24cf0498be6ba7ed9cff855d084e4376b1db3613';
+    r'fdd42abc9ffbcd5ef82c592459232782ba913a13';
 
 /// See also [PaymentInfoViewModel].
 @ProviderFor(PaymentInfoViewModel)

+ 44 - 26
packages/cpt_payment/lib/modules/payment_success/payment_success_page.dart

@@ -1,8 +1,10 @@
+import 'package:cpt_payment/modules/payment_success/payment_success_state.dart';
 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: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:widgets/ext/ex_widget.dart';
@@ -16,12 +18,17 @@ import 'payment_success_view_model.dart';
 
 @RoutePage()
 class PaymentSuccessPage extends HookConsumerWidget {
-  const PaymentSuccessPage({Key? key}) : super(key: key);
+  final String? orderId;
+
+  const PaymentSuccessPage({
+    Key? key,
+    @PathParam() required this.orderId,
+  }) : super(key: key);
 
   //启动并关闭其他栈
-  static void startWithPop() {
+  static void startWithPop({required String? orderId}) {
     appRouter.pushAndPopUntil(
-      const PaymentSuccessPageRoute(),
+      PaymentSuccessPageRoute(orderId: orderId),
       predicate: (route) {
         return route.settings.name == 'PaymentPageRoute';
       },
@@ -30,10 +37,21 @@ class PaymentSuccessPage extends HookConsumerWidget {
 
   @override
   Widget build(BuildContext context, WidgetRef ref) {
-    final viewModel = ref.watch(paymentSuccessViewModelProvider.notifier);
+    final viewModel = ref.read(paymentSuccessViewModelProvider.notifier);
+    final PaymentSuccessState state = ref.watch(paymentSuccessViewModelProvider);
+
+    useEffect(() {
+      // 组件挂载时执行 - 执行接口请求
+      Future.microtask(() {
+        viewModel.fetchFormDetail(orderId);
+      });
+      return () {
+        // 组件卸载时执行
+      };
+    }, []);
 
     return Scaffold(
-      appBar: MyAppBar.appBar(context, "付款的标题"),
+      appBar: MyAppBar.appBar(context, state?.paymentDetail?.title ?? "Payment Detail"),
       backgroundColor: context.appColors.backgroundWhite,
       body: SizedBox(
         width: double.infinity,
@@ -49,7 +67,7 @@ class PaymentSuccessPage extends HookConsumerWidget {
 
             //支付成功
             MyTextView(
-              S.current.booking_successful,
+              S.current.payment_successful,
               fontSize: 18,
               marginBottom: 3,
               isFontMedium: true,
@@ -65,30 +83,30 @@ class PaymentSuccessPage extends HookConsumerWidget {
               textColor: context.appColors.textBlack,
             ),
             MyTextView(
-              "\$10.80",
+              "\$${state.paymentDetail?.totalAmount ?? ""}",
               fontSize: 15,
               isFontRegular: true,
               textColor: context.appColors.textPrimary,
             ),
 
-            //付款类型与时间
-            Row(
-              mainAxisSize: MainAxisSize.min,
-              children: [
-                MyTextView(
-                  "Master card ending",
-                  fontSize: 15,
-                  isFontRegular: true,
-                  textColor: context.appColors.textBlack,
-                ),
-                MyTextView(
-                  "9423",
-                  fontSize: 15,
-                  isFontMedium: true,
-                  textColor: context.appColors.textBlack,
-                ),
-              ],
-            ).marginOnly(top: 12),
+            // //付款类型与时间
+            // Row(
+            //   mainAxisSize: MainAxisSize.min,
+            //   children: [
+            //     MyTextView(
+            //       "Master card ending",
+            //       fontSize: 15,
+            //       isFontRegular: true,
+            //       textColor: context.appColors.textBlack,
+            //     ),
+            //     MyTextView(
+            //       "9423",
+            //       fontSize: 15,
+            //       isFontMedium: true,
+            //       textColor: context.appColors.textBlack,
+            //     ),
+            //   ],
+            // ).marginOnly(top: 12),
 
             Row(
               mainAxisSize: MainAxisSize.min,
@@ -100,7 +118,7 @@ class PaymentSuccessPage extends HookConsumerWidget {
                   textColor: context.appColors.textBlack,
                 ),
                 MyTextView(
-                  "24 Oct 2023 at 02:19 PM",
+                  state.paymentDetail?.paidAt ?? "",
                   fontSize: 15,
                   isFontMedium: true,
                   textColor: context.appColors.textBlack,

+ 16 - 2
packages/cpt_payment/lib/modules/payment_success/payment_success_state.dart

@@ -1,3 +1,17 @@
-class PaymentSuccessState{
+import 'package:domain/entity/comm_payment_detail_entity.dart';
 
-}
+class PaymentSuccessState {
+  CommPaymentDetailEntity? paymentDetail;
+
+  PaymentSuccessState({
+    this.paymentDetail,
+  });
+
+  PaymentSuccessState copyWith({
+    CommPaymentDetailEntity? detail,
+  }) {
+    return PaymentSuccessState(
+      paymentDetail: detail ?? this.paymentDetail,
+    );
+  }
+}

+ 18 - 0
packages/cpt_payment/lib/modules/payment_success/payment_success_view_model.dart

@@ -1,3 +1,5 @@
+import 'package:domain/repository/payment_repository.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 
 import 'payment_success_state.dart';
@@ -6,8 +8,24 @@ part 'payment_success_view_model.g.dart';
 
 @riverpod
 class PaymentSuccessViewModel extends _$PaymentSuccessViewModel {
+  late final PaymentRepository _paymentRepository;
+
   @override
   PaymentSuccessState build() {
+    _paymentRepository = ref.read(paymentRepositoryProvider);
     return PaymentSuccessState();
   }
+
+  //获取表单的详情数据
+  void fetchFormDetail(String? orderId) async {
+    final result = await _paymentRepository.fetchPaymentDetail(orderId: orderId ?? "");
+
+    //根据后端返回的数据赋值状态
+    if (result.isSuccess) {
+      state = state.copyWith(detail: result.data);
+    } else {
+      ToastEngine.show(result.errorMsg ?? "Unknown Error");
+    }
+  }
+
 }

+ 1 - 1
packages/cpt_payment/lib/modules/payment_success/payment_success_view_model.g.dart

@@ -7,7 +7,7 @@ part of 'payment_success_view_model.dart';
 // **************************************************************************
 
 String _$paymentSuccessViewModelHash() =>
-    r'ac260fa59e53f82ebd16ac2050134cd1991ca395';
+    r'94eca61fc9cdcc7f14120b660e3918747ba87372';
 
 /// See also [PaymentSuccessViewModel].
 @ProviderFor(PaymentSuccessViewModel)

+ 103 - 10
packages/cpt_payment/lib/router/page/payment_page_router.gr.dart

@@ -46,9 +46,23 @@ abstract class _$PaymentPageRouter extends RootStackRouter {
       );
     },
     PaymentConfirmPageRoute.name: (routeData) {
+      final pathParams = routeData.inheritedPathParams;
+      final args = routeData.argsAs<PaymentConfirmPageRouteArgs>(
+          orElse: () => PaymentConfirmPageRouteArgs(
+                title: pathParams.optString('title'),
+                orderId: pathParams.optString('orderId'),
+                amount: pathParams.optString('amount'),
+                deposit: pathParams.optString('deposit'),
+              ));
       return AutoRoutePage<dynamic>(
         routeData: routeData,
-        child: const PaymentConfirmPage(),
+        child: PaymentConfirmPage(
+          key: args.key,
+          title: args.title,
+          orderId: args.orderId,
+          amount: args.amount,
+          deposit: args.deposit,
+        ),
       );
     },
     PaymentInfoPageRoute.name: (routeData) {
@@ -70,9 +84,16 @@ abstract class _$PaymentPageRouter extends RootStackRouter {
       );
     },
     PaymentSuccessPageRoute.name: (routeData) {
+      final pathParams = routeData.inheritedPathParams;
+      final args = routeData.argsAs<PaymentSuccessPageRouteArgs>(
+          orElse: () => PaymentSuccessPageRouteArgs(
+              orderId: pathParams.optString('orderId')));
       return AutoRoutePage<dynamic>(
         routeData: routeData,
-        child: const PaymentSuccessPage(),
+        child: PaymentSuccessPage(
+          key: args.key,
+          orderId: args.orderId,
+        ),
       );
     },
   };
@@ -150,16 +171,62 @@ class ManagePageRoute extends PageRouteInfo<void> {
 
 /// generated route for
 /// [PaymentConfirmPage]
-class PaymentConfirmPageRoute extends PageRouteInfo<void> {
-  const PaymentConfirmPageRoute({List<PageRouteInfo>? children})
-      : super(
+class PaymentConfirmPageRoute
+    extends PageRouteInfo<PaymentConfirmPageRouteArgs> {
+  PaymentConfirmPageRoute({
+    Key? key,
+    required String? title,
+    required String? orderId,
+    required String? amount,
+    String? deposit,
+    List<PageRouteInfo>? children,
+  }) : super(
           PaymentConfirmPageRoute.name,
+          args: PaymentConfirmPageRouteArgs(
+            key: key,
+            title: title,
+            orderId: orderId,
+            amount: amount,
+            deposit: deposit,
+          ),
+          rawPathParams: {
+            'title': title,
+            'orderId': orderId,
+            'amount': amount,
+            'deposit': deposit,
+          },
           initialChildren: children,
         );
 
   static const String name = 'PaymentConfirmPageRoute';
 
-  static const PageInfo<void> page = PageInfo<void>(name);
+  static const PageInfo<PaymentConfirmPageRouteArgs> page =
+      PageInfo<PaymentConfirmPageRouteArgs>(name);
+}
+
+class PaymentConfirmPageRouteArgs {
+  const PaymentConfirmPageRouteArgs({
+    this.key,
+    required this.title,
+    required this.orderId,
+    required this.amount,
+    this.deposit,
+  });
+
+  final Key? key;
+
+  final String? title;
+
+  final String? orderId;
+
+  final String? amount;
+
+  final String? deposit;
+
+  @override
+  String toString() {
+    return 'PaymentConfirmPageRouteArgs{key: $key, title: $title, orderId: $orderId, amount: $amount, deposit: $deposit}';
+  }
 }
 
 /// generated route for
@@ -206,14 +273,40 @@ class PaymentPageRoute extends PageRouteInfo<void> {
 
 /// generated route for
 /// [PaymentSuccessPage]
-class PaymentSuccessPageRoute extends PageRouteInfo<void> {
-  const PaymentSuccessPageRoute({List<PageRouteInfo>? children})
-      : super(
+class PaymentSuccessPageRoute
+    extends PageRouteInfo<PaymentSuccessPageRouteArgs> {
+  PaymentSuccessPageRoute({
+    Key? key,
+    required String? orderId,
+    List<PageRouteInfo>? children,
+  }) : super(
           PaymentSuccessPageRoute.name,
+          args: PaymentSuccessPageRouteArgs(
+            key: key,
+            orderId: orderId,
+          ),
+          rawPathParams: {'orderId': orderId},
           initialChildren: children,
         );
 
   static const String name = 'PaymentSuccessPageRoute';
 
-  static const PageInfo<void> page = PageInfo<void>(name);
+  static const PageInfo<PaymentSuccessPageRouteArgs> page =
+      PageInfo<PaymentSuccessPageRouteArgs>(name);
+}
+
+class PaymentSuccessPageRouteArgs {
+  const PaymentSuccessPageRouteArgs({
+    this.key,
+    required this.orderId,
+  });
+
+  final Key? key;
+
+  final String? orderId;
+
+  @override
+  String toString() {
+    return 'PaymentSuccessPageRouteArgs{key: $key, orderId: $orderId}';
+  }
 }

+ 4 - 1
packages/cs_domain/lib/constants/api_constants.dart

@@ -146,7 +146,10 @@ class ApiConstants {
   // =========================== Payment ↓=========================================
 
   //可支付列表
-  static const apiPaymentList = "/api/v1/user/payment/bill/index";
+  static const apiPaymentList = "/api/v1/user/payment/order/index";
+
+  //已支付详情
+  static const apiPaymentDetail = "/api/v1/user/payment/order/detail";
 
   //生成支付意图
   static const apiPaymentIntent = "/api/v1/user/payment/create-payment-intent";

+ 61 - 0
packages/cs_domain/lib/entity/comm_payment_detail_entity.dart

@@ -0,0 +1,61 @@
+import 'package:domain/entity/id_name_entity.dart';
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/comm_payment_detail_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/comm_payment_detail_entity.g.dart';
+
+@JsonSerializable()
+class CommPaymentDetailEntity {
+	String? id;
+	String? type;
+	String? title;
+	@JSONField(name: "total_amount")
+	String? totalAmount;
+	@JSONField(name: "order_amount")
+	String? orderAmount;
+	@JSONField(name: "refund_order_amount")
+	String? refundOrderAmount;
+	@JSONField(name: "deposit_amount")
+	String? depositAmount;
+	@JSONField(name: "refund_deposit_amount")
+	String? refundDepositAmount;
+	@JSONField(name: "payment_status")
+	int paymentStatus = 0;
+	@JSONField(name: "refund_status")
+	int refundStatus = 0;
+	@JSONField(name: "paid_at")
+	String? paidAt;
+	@JSONField(name: "refunded_at")
+	String? refundedAt;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	IdNameEntity? account;
+	CommPaymentDetailOrderable? orderable;
+
+	CommPaymentDetailEntity();
+
+	factory CommPaymentDetailEntity.fromJson(Map<String, dynamic> json) => $CommPaymentDetailEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $CommPaymentDetailEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class CommPaymentDetailOrderable {
+	int? id;
+
+	CommPaymentDetailOrderable();
+
+	factory CommPaymentDetailOrderable.fromJson(Map<String, dynamic> json) => $CommPaymentDetailOrderableFromJson(json);
+
+	Map<String, dynamic> toJson() => $CommPaymentDetailOrderableToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 8 - 6
packages/cs_domain/lib/entity/form_detail_entity.dart

@@ -11,12 +11,10 @@ class FormDetailEntity {
 	String? userId;
 	FormContentEntity? content;  //详情内容
 	int status = 0;  //0-已提交未审核,1-已审核通过,2-审核失败
-	@JSONField(name: "sent_on")
-	String? sentOn;
-	@JSONField(name: "rejected_on")
-	String? rejectedOn;
-	@JSONField(name: "approved_on")
-	String? approvedOn;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	@JSONField(name: "update_at")
+	String? updateAt;
 	FormOrder? order;
 
 	FormDetailEntity();
@@ -44,6 +42,10 @@ class FormOrder {
 	int paymentStatus = 0;  //0=未支付,1=已支付,2=支付失败
 	@JSONField(name: "refund_status")
 	int refundStatus = 0;   //0=末退歌,1=部分退歌,2=己退款
+	@JSONField(name: "paid_at")
+	String? paidAt;
+	@JSONField(name: "refunded_at")
+	String? refundedAt;
 
 	FormOrder();
 

+ 53 - 7
packages/cs_domain/lib/entity/payment_page_entity.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/generated/json/base/json_field.dart';
 import 'package:domain/generated/json/payment_page_entity.g.dart';
 import 'dart:convert';
@@ -28,15 +29,34 @@ class PaymentPageEntity {
 class PaymentPageList {
   String? id;
   String? type;
-  @JSONField(name: "start_at")
-  String? startAt;
-  @JSONField(name: "end_at")
-  String? endAt;
-  String? amount;
-  @JSONField(name: "paid_by")
-  dynamic paidBy;
+  //property  五种
+  //vehicle
+  //online_form_apply
+  //facility_booking
+  //paid_service_order
+  String? title;
+  @JSONField(name: "total_amount")
+  String? totalAmount;
+  @JSONField(name: "order_amount")
+  String? orderAmount;
+  @JSONField(name: "deposit_amount")
+  String? depositAmount;
+  @JSONField(name: "refund_order_amount")
+  String? refundOrderAmount;
+  @JSONField(name: "refund_deposit_amount")
+  String? refundDepositAmount;
+  @JSONField(name: "payment_status")
+  int paymentStatus = 0;
+  @JSONField(name: "refund_status")
+  int refundStatus = 0;
+  @JSONField(name: "paid_at")
+  String? paidAt;
+  @JSONField(name: "refund_at")
+  String? refundAt;
   @JSONField(name: "created_at")
   String? createdAt;
+  IdNameEntity? account;
+  OrderableEntity? orderable;
 
   PaymentPageList();
 
@@ -49,3 +69,29 @@ class PaymentPageList {
     return jsonEncode(this);
   }
 }
+
+
+@JsonSerializable()
+class OrderableEntity {
+  String? id;
+  String? name;
+  @JSONField(name: "estate_online_form_id")
+  String? estateOnlineFormId;
+  @JSONField(name: "online_form_type_id")
+  String? onlineFormTypeId;
+  @JSONField(name: "start_at")
+  String? startAt;
+  @JSONField(name: "end_at")
+  String? endAt;
+
+  OrderableEntity();
+
+  factory OrderableEntity.fromJson(Map<String, dynamic> json) => $OrderableEntityFromJson(json);
+
+  Map<String, dynamic> toJson() => $OrderableEntityToJson(this);
+
+  @override
+  String toString() {
+    return jsonEncode(this);
+  }
+}

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

@@ -6,6 +6,7 @@
 import 'package:flutter/material.dart' show debugPrint;
 import 'package:domain/entity/auth_login_entity.dart';
 import 'package:domain/entity/captcha_img_entity.dart';
+import 'package:domain/entity/comm_payment_detail_entity.dart';
 import 'package:domain/entity/facility_book_entity.dart';
 import 'package:domain/entity/facility_index_entity.dart';
 import 'package:domain/entity/facility_page_entity.dart';
@@ -209,6 +210,12 @@ class JsonConvert {
     if (<CaptchaImgEntity>[] is M) {
       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;
+    }
+    if (<CommPaymentDetailOrderable>[] is 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;
     }
@@ -485,6 +492,9 @@ class JsonConvert {
     if (<PaymentPageList>[] is M) {
       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;
+    }
     if (<PropertyNewsDetailEntity>[] is M) {
       return data.map<PropertyNewsDetailEntity>((Map<String, dynamic> e) => PropertyNewsDetailEntity.fromJson(e)).toList() as M;
     }
@@ -723,6 +733,8 @@ class JsonConvertClassCollection {
   Map<String, JsonConvertFunction> convertFuncMap = {
     (AuthLoginEntity).toString(): AuthLoginEntity.fromJson,
     (CaptchaImgEntity).toString(): CaptchaImgEntity.fromJson,
+    (CommPaymentDetailEntity).toString(): CommPaymentDetailEntity.fromJson,
+    (CommPaymentDetailOrderable).toString(): CommPaymentDetailOrderable.fromJson,
     (FacilityBookEntity).toString(): FacilityBookEntity.fromJson,
     (FacilityBookFacilityType).toString(): FacilityBookFacilityType.fromJson,
     (FacilityBookFacilities).toString(): FacilityBookFacilities.fromJson,
@@ -815,6 +827,7 @@ class JsonConvertClassCollection {
     (PaymentIntentEntity).toString(): PaymentIntentEntity.fromJson,
     (PaymentPageEntity).toString(): PaymentPageEntity.fromJson,
     (PaymentPageList).toString(): PaymentPageList.fromJson,
+    (OrderableEntity).toString(): OrderableEntity.fromJson,
     (PropertyNewsDetailEntity).toString(): PropertyNewsDetailEntity.fromJson,
     (PropertyNewsEntity).toString(): PropertyNewsEntity.fromJson,
     (PropertyNewsList).toString(): PropertyNewsList.fromJson,

+ 150 - 0
packages/cs_domain/lib/generated/json/comm_payment_detail_entity.g.dart

@@ -0,0 +1,150 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/comm_payment_detail_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
+
+CommPaymentDetailEntity $CommPaymentDetailEntityFromJson(Map<String, dynamic> json) {
+  final CommPaymentDetailEntity commPaymentDetailEntity = CommPaymentDetailEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    commPaymentDetailEntity.id = id;
+  }
+  final String? type = jsonConvert.convert<String>(json['type']);
+  if (type != null) {
+    commPaymentDetailEntity.type = type;
+  }
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    commPaymentDetailEntity.title = title;
+  }
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    commPaymentDetailEntity.totalAmount = totalAmount;
+  }
+  final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
+  if (orderAmount != null) {
+    commPaymentDetailEntity.orderAmount = orderAmount;
+  }
+  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']);
+  if (depositAmount != null) {
+    commPaymentDetailEntity.depositAmount = depositAmount;
+  }
+  final String? refundDepositAmount = jsonConvert.convert<String>(json['refund_deposit_amount']);
+  if (refundDepositAmount != null) {
+    commPaymentDetailEntity.refundDepositAmount = refundDepositAmount;
+  }
+  final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
+  if (paymentStatus != null) {
+    commPaymentDetailEntity.paymentStatus = paymentStatus;
+  }
+  final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
+  if (refundStatus != null) {
+    commPaymentDetailEntity.refundStatus = refundStatus;
+  }
+  final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
+  if (paidAt != null) {
+    commPaymentDetailEntity.paidAt = paidAt;
+  }
+  final String? refundedAt = jsonConvert.convert<String>(json['refunded_at']);
+  if (refundedAt != null) {
+    commPaymentDetailEntity.refundedAt = refundedAt;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    commPaymentDetailEntity.createdAt = createdAt;
+  }
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
+  if (account != null) {
+    commPaymentDetailEntity.account = account;
+  }
+  final CommPaymentDetailOrderable? orderable = jsonConvert.convert<CommPaymentDetailOrderable>(json['orderable']);
+  if (orderable != null) {
+    commPaymentDetailEntity.orderable = orderable;
+  }
+  return commPaymentDetailEntity;
+}
+
+Map<String, dynamic> $CommPaymentDetailEntityToJson(CommPaymentDetailEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['type'] = entity.type;
+  data['title'] = entity.title;
+  data['total_amount'] = entity.totalAmount;
+  data['order_amount'] = entity.orderAmount;
+  data['refund_order_amount'] = entity.refundOrderAmount;
+  data['deposit_amount'] = entity.depositAmount;
+  data['refund_deposit_amount'] = entity.refundDepositAmount;
+  data['payment_status'] = entity.paymentStatus;
+  data['refund_status'] = entity.refundStatus;
+  data['paid_at'] = entity.paidAt;
+  data['refunded_at'] = entity.refundedAt;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  data['orderable'] = entity.orderable?.toJson();
+  return data;
+}
+
+extension CommPaymentDetailEntityExtension on CommPaymentDetailEntity {
+  CommPaymentDetailEntity copyWith({
+    String? id,
+    String? type,
+    String? title,
+    String? totalAmount,
+    String? orderAmount,
+    String? refundOrderAmount,
+    String? depositAmount,
+    String? refundDepositAmount,
+    int? paymentStatus,
+    int? refundStatus,
+    String? paidAt,
+    String? refundedAt,
+    String? createdAt,
+    IdNameEntity? account,
+    CommPaymentDetailOrderable? orderable,
+  }) {
+    return CommPaymentDetailEntity()
+      ..id = id ?? this.id
+      ..type = type ?? this.type
+      ..title = title ?? this.title
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..orderAmount = orderAmount ?? this.orderAmount
+      ..refundOrderAmount = refundOrderAmount ?? this.refundOrderAmount
+      ..depositAmount = depositAmount ?? this.depositAmount
+      ..refundDepositAmount = refundDepositAmount ?? this.refundDepositAmount
+      ..paymentStatus = paymentStatus ?? this.paymentStatus
+      ..refundStatus = refundStatus ?? this.refundStatus
+      ..paidAt = paidAt ?? this.paidAt
+      ..refundedAt = refundedAt ?? this.refundedAt
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account
+      ..orderable = orderable ?? this.orderable;
+  }
+}
+
+CommPaymentDetailOrderable $CommPaymentDetailOrderableFromJson(Map<String, dynamic> json) {
+  final CommPaymentDetailOrderable commPaymentDetailOrderable = CommPaymentDetailOrderable();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    commPaymentDetailOrderable.id = id;
+  }
+  return commPaymentDetailOrderable;
+}
+
+Map<String, dynamic> $CommPaymentDetailOrderableToJson(CommPaymentDetailOrderable entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  return data;
+}
+
+extension CommPaymentDetailOrderableExtension on CommPaymentDetailOrderable {
+  CommPaymentDetailOrderable copyWith({
+    int? id,
+  }) {
+    return CommPaymentDetailOrderable()
+      ..id = id ?? this.id;
+  }
+}

+ 27 - 20
packages/cs_domain/lib/generated/json/form_detail_entity.g.dart

@@ -21,17 +21,13 @@ FormDetailEntity $FormDetailEntityFromJson(Map<String, dynamic> json) {
   if (status != null) {
     formDetailEntity.status = status;
   }
-  final String? sentOn = jsonConvert.convert<String>(json['sent_on']);
-  if (sentOn != null) {
-    formDetailEntity.sentOn = sentOn;
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    formDetailEntity.createdAt = createdAt;
   }
-  final String? rejectedOn = jsonConvert.convert<String>(json['rejected_on']);
-  if (rejectedOn != null) {
-    formDetailEntity.rejectedOn = rejectedOn;
-  }
-  final String? approvedOn = jsonConvert.convert<String>(json['approved_on']);
-  if (approvedOn != null) {
-    formDetailEntity.approvedOn = approvedOn;
+  final String? updateAt = jsonConvert.convert<String>(json['update_at']);
+  if (updateAt != null) {
+    formDetailEntity.updateAt = updateAt;
   }
   final FormOrder? order = jsonConvert.convert<FormOrder>(json['order']);
   if (order != null) {
@@ -46,9 +42,8 @@ Map<String, dynamic> $FormDetailEntityToJson(FormDetailEntity entity) {
   data['user_id'] = entity.userId;
   data['content'] = entity.content?.toJson();
   data['status'] = entity.status;
-  data['sent_on'] = entity.sentOn;
-  data['rejected_on'] = entity.rejectedOn;
-  data['approved_on'] = entity.approvedOn;
+  data['created_at'] = entity.createdAt;
+  data['update_at'] = entity.updateAt;
   data['order'] = entity.order?.toJson();
   return data;
 }
@@ -59,9 +54,8 @@ extension FormDetailEntityExtension on FormDetailEntity {
     String? userId,
     FormContentEntity? content,
     int? status,
-    String? sentOn,
-    String? rejectedOn,
-    String? approvedOn,
+    String? createdAt,
+    String? updateAt,
     FormOrder? order,
   }) {
     return FormDetailEntity()
@@ -69,9 +63,8 @@ extension FormDetailEntityExtension on FormDetailEntity {
       ..userId = userId ?? this.userId
       ..content = content ?? this.content
       ..status = status ?? this.status
-      ..sentOn = sentOn ?? this.sentOn
-      ..rejectedOn = rejectedOn ?? this.rejectedOn
-      ..approvedOn = approvedOn ?? this.approvedOn
+      ..createdAt = createdAt ?? this.createdAt
+      ..updateAt = updateAt ?? this.updateAt
       ..order = order ?? this.order;
   }
 }
@@ -102,6 +95,14 @@ FormOrder $FormOrderFromJson(Map<String, dynamic> json) {
   if (refundStatus != null) {
     formOrder.refundStatus = refundStatus;
   }
+  final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
+  if (paidAt != null) {
+    formOrder.paidAt = paidAt;
+  }
+  final String? refundedAt = jsonConvert.convert<String>(json['refunded_at']);
+  if (refundedAt != null) {
+    formOrder.refundedAt = refundedAt;
+  }
   return formOrder;
 }
 
@@ -113,6 +114,8 @@ Map<String, dynamic> $FormOrderToJson(FormOrder entity) {
   data['deposit_amount'] = entity.depositAmount;
   data['payment_status'] = entity.paymentStatus;
   data['refund_status'] = entity.refundStatus;
+  data['paid_at'] = entity.paidAt;
+  data['refunded_at'] = entity.refundedAt;
   return data;
 }
 
@@ -124,6 +127,8 @@ extension FormOrderExtension on FormOrder {
     String? depositAmount,
     int? paymentStatus,
     int? refundStatus,
+    String? paidAt,
+    String? refundedAt,
   }) {
     return FormOrder()
       ..id = id ?? this.id
@@ -131,6 +136,8 @@ extension FormOrderExtension on FormOrder {
       ..orderAmount = orderAmount ?? this.orderAmount
       ..depositAmount = depositAmount ?? this.depositAmount
       ..paymentStatus = paymentStatus ?? this.paymentStatus
-      ..refundStatus = refundStatus ?? this.refundStatus;
+      ..refundStatus = refundStatus ?? this.refundStatus
+      ..paidAt = paidAt ?? this.paidAt
+      ..refundedAt = refundedAt ?? this.refundedAt;
   }
 }

+ 141 - 24
packages/cs_domain/lib/generated/json/payment_page_entity.g.dart

@@ -1,5 +1,7 @@
 import 'package:domain/generated/json/base/json_convert_content.dart';
 import 'package:domain/entity/payment_page_entity.dart';
+import 'package:domain/entity/id_name_entity.dart';
+
 
 PaymentPageEntity $PaymentPageEntityFromJson(Map<String, dynamic> json) {
   final PaymentPageEntity paymentPageEntity = PaymentPageEntity();
@@ -64,26 +66,58 @@ PaymentPageList $PaymentPageListFromJson(Map<String, dynamic> json) {
   if (type != null) {
     paymentPageList.type = type;
   }
-  final String? startAt = jsonConvert.convert<String>(json['start_at']);
-  if (startAt != null) {
-    paymentPageList.startAt = startAt;
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    paymentPageList.title = title;
   }
-  final String? endAt = jsonConvert.convert<String>(json['end_at']);
-  if (endAt != null) {
-    paymentPageList.endAt = endAt;
+  final String? totalAmount = jsonConvert.convert<String>(json['total_amount']);
+  if (totalAmount != null) {
+    paymentPageList.totalAmount = totalAmount;
+  }
+  final String? orderAmount = jsonConvert.convert<String>(json['order_amount']);
+  if (orderAmount != null) {
+    paymentPageList.orderAmount = orderAmount;
   }
-  final String? amount = jsonConvert.convert<String>(json['amount']);
-  if (amount != null) {
-    paymentPageList.amount = amount;
+  final String? depositAmount = jsonConvert.convert<String>(json['deposit_amount']);
+  if (depositAmount != null) {
+    paymentPageList.depositAmount = depositAmount;
   }
-  final dynamic paidBy = json['paid_by'];
-  if (paidBy != null) {
-    paymentPageList.paidBy = paidBy;
+  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']);
+  if (refundDepositAmount != null) {
+    paymentPageList.refundDepositAmount = refundDepositAmount;
+  }
+  final int? paymentStatus = jsonConvert.convert<int>(json['payment_status']);
+  if (paymentStatus != null) {
+    paymentPageList.paymentStatus = paymentStatus;
+  }
+  final int? refundStatus = jsonConvert.convert<int>(json['refund_status']);
+  if (refundStatus != null) {
+    paymentPageList.refundStatus = refundStatus;
+  }
+  final String? paidAt = jsonConvert.convert<String>(json['paid_at']);
+  if (paidAt != null) {
+    paymentPageList.paidAt = paidAt;
+  }
+  final String? refundAt = jsonConvert.convert<String>(json['refund_at']);
+  if (refundAt != null) {
+    paymentPageList.refundAt = refundAt;
   }
   final String? createdAt = jsonConvert.convert<String>(json['created_at']);
   if (createdAt != null) {
     paymentPageList.createdAt = createdAt;
   }
+  final IdNameEntity? account = jsonConvert.convert<IdNameEntity>(json['account']);
+  if (account != null) {
+    paymentPageList.account = account;
+  }
+  final OrderableEntity? orderable = jsonConvert.convert<OrderableEntity>(json['orderable']);
+  if (orderable != null) {
+    paymentPageList.orderable = orderable;
+  }
   return paymentPageList;
 }
 
@@ -91,11 +125,19 @@ Map<String, dynamic> $PaymentPageListToJson(PaymentPageList entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['type'] = entity.type;
-  data['start_at'] = entity.startAt;
-  data['end_at'] = entity.endAt;
-  data['amount'] = entity.amount;
-  data['paid_by'] = entity.paidBy;
+  data['title'] = entity.title;
+  data['total_amount'] = entity.totalAmount;
+  data['order_amount'] = entity.orderAmount;
+  data['deposit_amount'] = entity.depositAmount;
+  data['refund_order_amount'] = entity.refundOrderAmount;
+  data['refund_deposit_amount'] = entity.refundDepositAmount;
+  data['payment_status'] = entity.paymentStatus;
+  data['refund_status'] = entity.refundStatus;
+  data['paid_at'] = entity.paidAt;
+  data['refund_at'] = entity.refundAt;
   data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  data['orderable'] = entity.orderable?.toJson();
   return data;
 }
 
@@ -103,19 +145,94 @@ extension PaymentPageListExtension on PaymentPageList {
   PaymentPageList copyWith({
     String? id,
     String? type,
-    String? startAt,
-    String? endAt,
-    String? amount,
-    dynamic paidBy,
+    String? title,
+    String? totalAmount,
+    String? orderAmount,
+    String? depositAmount,
+    String? refundOrderAmount,
+    String? refundDepositAmount,
+    int? paymentStatus,
+    int? refundStatus,
+    String? paidAt,
+    String? refundAt,
     String? createdAt,
+    IdNameEntity? account,
+    OrderableEntity? orderable,
   }) {
     return PaymentPageList()
       ..id = id ?? this.id
       ..type = type ?? this.type
+      ..title = title ?? this.title
+      ..totalAmount = totalAmount ?? this.totalAmount
+      ..orderAmount = orderAmount ?? this.orderAmount
+      ..depositAmount = depositAmount ?? this.depositAmount
+      ..refundOrderAmount = refundOrderAmount ?? this.refundOrderAmount
+      ..refundDepositAmount = refundDepositAmount ?? this.refundDepositAmount
+      ..paymentStatus = paymentStatus ?? this.paymentStatus
+      ..refundStatus = refundStatus ?? this.refundStatus
+      ..paidAt = paidAt ?? this.paidAt
+      ..refundAt = refundAt ?? this.refundAt
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account
+      ..orderable = orderable ?? this.orderable;
+  }
+}
+
+OrderableEntity $OrderableEntityFromJson(Map<String, dynamic> json) {
+  final OrderableEntity orderableEntity = OrderableEntity();
+  final String? id = jsonConvert.convert<String>(json['id']);
+  if (id != null) {
+    orderableEntity.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    orderableEntity.name = name;
+  }
+  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']);
+  if (onlineFormTypeId != null) {
+    orderableEntity.onlineFormTypeId = onlineFormTypeId;
+  }
+  final String? startAt = jsonConvert.convert<String>(json['start_at']);
+  if (startAt != null) {
+    orderableEntity.startAt = startAt;
+  }
+  final String? endAt = jsonConvert.convert<String>(json['end_at']);
+  if (endAt != null) {
+    orderableEntity.endAt = endAt;
+  }
+  return orderableEntity;
+}
+
+Map<String, dynamic> $OrderableEntityToJson(OrderableEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['estate_online_form_id'] = entity.estateOnlineFormId;
+  data['online_form_type_id'] = entity.onlineFormTypeId;
+  data['start_at'] = entity.startAt;
+  data['end_at'] = entity.endAt;
+  return data;
+}
+
+extension OrderableEntityExtension on OrderableEntity {
+  OrderableEntity copyWith({
+    String? id,
+    String? name,
+    String? estateOnlineFormId,
+    String? onlineFormTypeId,
+    String? startAt,
+    String? endAt,
+  }) {
+    return OrderableEntity()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..estateOnlineFormId = estateOnlineFormId ?? this.estateOnlineFormId
+      ..onlineFormTypeId = onlineFormTypeId ?? this.onlineFormTypeId
       ..startAt = startAt ?? this.startAt
-      ..endAt = endAt ?? this.endAt
-      ..amount = amount ?? this.amount
-      ..paidBy = paidBy ?? this.paidBy
-      ..createdAt = createdAt ?? this.createdAt;
+      ..endAt = endAt ?? this.endAt;
   }
 }

+ 28 - 0
packages/cs_domain/lib/repository/payment_repository.dart

@@ -1,5 +1,6 @@
 import 'dart:typed_data';
 
+import 'package:domain/entity/comm_payment_detail_entity.dart';
 import 'package:domain/entity/payment_intent_entity.dart';
 import 'package:domain/entity/payment_page_entity.dart';
 import 'package:plugin_platform/platform_export.dart';
@@ -53,6 +54,33 @@ class PaymentRepository {
     return result.convert();
   }
 
+  /// 获取支付列表
+  Future<HttpResult<CommPaymentDetailEntity>> fetchPaymentDetail({
+    required String orderId,
+    CancelToken? cancelToken,
+  }) async {
+    Map<String, String> params = {};
+    params['order_id'] = orderId;
+
+    final result = await dioEngine.requestNetResult(
+      ApiConstants.apiPaymentDetail,
+      params: params,
+      method: HttpMethod.GET,
+      networkDebounce: true,
+      isShowLoadingDialog: true,
+      cancelToken: cancelToken,
+    );
+
+    if (result.isSuccess) {
+      final json = result.getDataJson();
+      var data = CommPaymentDetailEntity.fromJson(json!);
+      return result.convert<CommPaymentDetailEntity>(data: data);
+    }
+    return result.convert();
+  }
+
+
+
   /// 根据 OrderId 生成对应的 PaymentIntent
   Future<HttpResult<PaymentIntentEntity>> obtainPaymentIntent({
     required String orderId,

BIN
packages/cs_resources/assets/payment/payment_pending_icon.webp


+ 1 - 0
packages/cs_resources/lib/generated/assets.dart

@@ -172,6 +172,7 @@ class Assets {
   static const String paymentManageIcon = 'assets/payment/manage_icon.webp';
   static const String paymentMasterCardIcon = 'assets/payment/master_card_icon.webp';
   static const String paymentPaymentIcon = 'assets/payment/payment_icon.webp';
+  static const String paymentPaymentPendingIcon = 'assets/payment/payment_pending_icon.webp';
   static const String paymentPropertyPaymentIcon = 'assets/payment/property_payment_icon.webp';
   static const String paymentTitleQuestionIcon = 'assets/payment/title_question_icon.webp';
   static const String paymentVisaIcon = 'assets/payment/visa_icon.webp';

File diff suppressed because it is too large
+ 15 - 12
packages/cs_resources/lib/generated/intl/messages_en.dart


File diff suppressed because it is too large
+ 15 - 12
packages/cs_resources/lib/generated/intl/messages_zh_CN.dart


File diff suppressed because it is too large
+ 15 - 12
packages/cs_resources/lib/generated/intl/messages_zh_HK.dart


+ 10 - 0
packages/cs_resources/lib/generated/l10n.dart

@@ -4550,6 +4550,16 @@ class S {
     );
   }
 
+  /// `Paid on {time}`
+  String paid_on_sometime(Object time) {
+    return Intl.message(
+      'Paid on $time',
+      name: 'paid_on_sometime',
+      desc: '',
+      args: [time],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

+ 1 - 0
packages/cs_resources/lib/l10n/intl_en.arb

@@ -450,5 +450,6 @@
   "paid": "Paid",
   "unpaid": "Unpaid",
   "refunded": "Refunded",
+  "paid_on_sometime": "Paid on {time}",
   "other": "Other"
 }

+ 1 - 0
packages/cs_resources/lib/l10n/intl_zh_CN.arb

@@ -447,5 +447,6 @@
   "paid": "已支付",
   "unpaid": "待支付",
   "refunded": "已退款",
+  "paid_on_sometime": "付款时间 {time}",
   "other": "其他"
 }

+ 1 - 0
packages/cs_resources/lib/l10n/intl_zh_HK.arb

@@ -433,5 +433,6 @@
   "paid": "已支付",
   "unpaid": "待支付",
   "refunded": "已退款",
+  "paid_on_sometime": "付款时间 {time}",
   "other": "其他"
 }

+ 1 - 0
packages/cs_router/lib/componentRouter/facility_service.dart

@@ -5,4 +5,5 @@ abstract class FacilityService {
 
   void startFacilityPage();
 
+  void startFacilityDetailPage({required String id});
 }

+ 2 - 1
packages/cs_router/lib/componentRouter/form_service.dart

@@ -2,6 +2,7 @@
  * Form 组件对应的路由抽象接口
  */
 abstract class FormService {
-
   void startFormPage();
+
+  void startFormDetailPage(String estateFormId, String taskId, String typeId);
 }