Преглед изворни кода

修改Payment相关的逻辑

liukai пре 2 дана
родитељ
комит
03c7f59079
35 измењених фајлова са 383 додато и 142 уклоњено
  1. 3 1
      packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart
  2. 5 3
      packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart
  3. 24 19
      packages/cpt_facility/lib/modules/booking/facility_booking_view_model.dart
  4. 17 16
      packages/cpt_facility/lib/modules/detail/facility_detail_page.dart
  5. 15 15
      packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart
  6. 23 17
      packages/cpt_form/lib/modules/apply/vm/apply_view_model.dart
  7. 15 14
      packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart
  8. 15 15
      packages/cpt_form/lib/modules/detail/form_detail_view_model.dart
  9. 18 0
      packages/cpt_form/lib/modules/form/form_types.dart
  10. 4 4
      packages/cpt_main/lib/modules/home/home_state.dart
  11. 1 1
      packages/cpt_main/lib/modules/main/main_view_model.dart
  12. 68 0
      packages/cpt_payment/lib/modules/offline_payment/offline_payment_page.dart
  13. 4 0
      packages/cpt_payment/lib/modules/offline_payment/offline_payment_state.dart
  14. 18 0
      packages/cpt_payment/lib/modules/offline_payment/offline_payment_view_model.dart
  15. 27 0
      packages/cpt_payment/lib/modules/offline_payment/offline_payment_view_model.g.dart
  16. 1 1
      packages/cpt_payment/lib/modules/payment/history/history_list_view_model.g.dart
  17. 1 1
      packages/cpt_payment/lib/modules/payment/payment/payment_list_view_model.g.dart
  18. 13 13
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_page.dart
  19. 15 15
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.dart
  20. 1 1
      packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.g.dart
  21. 6 0
      packages/cpt_payment/lib/router/component/payment_component_service.dart
  22. 2 0
      packages/cpt_payment/lib/router/page/payment_page_router.dart
  23. 53 0
      packages/cpt_payment/lib/router/page/payment_page_router.gr.dart
  24. 7 2
      packages/cpt_profile/lib/modules/setting/setting_page.dart
  25. BIN
      packages/cs_resources/assets/payment/offline_payment_icon.webp
  26. 1 0
      packages/cs_resources/lib/generated/assets.dart
  27. 2 0
      packages/cs_resources/lib/generated/intl/messages_en.dart
  28. 2 0
      packages/cs_resources/lib/generated/intl/messages_zh_CN.dart
  29. 2 0
      packages/cs_resources/lib/generated/intl/messages_zh_HK.dart
  30. 10 0
      packages/cs_resources/lib/generated/l10n.dart
  31. 5 4
      packages/cs_resources/lib/l10n/intl_en.arb
  32. 1 0
      packages/cs_resources/lib/l10n/intl_zh_CN.arb
  33. 1 0
      packages/cs_resources/lib/l10n/intl_zh_HK.arb
  34. 2 0
      packages/cs_router/lib/componentRouter/payment_service.dart
  35. 1 0
      packages/cs_router/lib/path/router_path.dart

+ 3 - 1
packages/cpt_auth/lib/modules/auth_login/auth_login_page.dart

@@ -196,7 +196,9 @@ class AuthLoginPage extends HookConsumerWidget {
                         TextSpan(
                           text: S.current.terms_of_service,
                           style: TextStyle(color: context.appColors.textPrimary, fontWeight: FontWeight.w500, fontSize: 15), // 蓝色文本
-                          recognizer: TapGestureRecognizer()..onTap = viewModel.gotoTermsPage,
+                          recognizer: TapGestureRecognizer()..onTap = (){
+                            viewModel.gotoTermsPage(context);
+                          } ,
                         ),
                       ],
                     ),

+ 5 - 3
packages/cpt_auth/lib/modules/auth_login/auth_login_view_model.dart

@@ -1,7 +1,9 @@
 import 'package:cpt_auth/modules/sign_up/sign_up_page.dart';
+import 'package:cs_resources/generated/l10n.dart';
 import 'package:domain/repository/auth_repository.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_basic/constants/app_constant.dart';
+import 'package:plugin_basic/modules/global_web_page.dart';
 import 'package:plugin_basic/provider/user_config/user_config_service.dart';
 import 'package:plugin_platform/engine/notify/notify_engine.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -73,9 +75,9 @@ class AuthLoginViewModel extends _$AuthLoginViewModel {
     }
   }
 
-  //去协议页面
-  void gotoTermsPage() {
-    ToastEngine.show("去协议页面");
+  //去用户协议页面
+  void gotoTermsPage(BuildContext context) {
+    GlobalWebPage.startInstance(context: context, title: S.current.terms_of_service, url: 'https://24ifm.com/terms-and-conditions');
   }
 
   //去忘记密码页面

+ 24 - 19
packages/cpt_facility/lib/modules/booking/facility_booking_view_model.dart

@@ -154,30 +154,35 @@ class FacilityBookingViewModel extends _$FacilityBookingViewModel with DioCancel
       cancelToken: cancelToken,
     );
 
+    LoadingEngine.dismiss();
+
     if (result.isSuccess) {
       final bookingId = result.data?.booking?.id;
       String orderId = result.data?.order?.id ?? "";
 
       Log.d("当前 Facility 生成的订单ID:$orderId");
-
-      //调用支付服务
-      bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
-
-      //支付流程 Loading 结束
-      LoadingEngine.dismiss();
-
-      //如果成功,走下一步流程
-      if (success) {
-        FacilityDetailPage.startWithPop2Main(bookingId: bookingId);
-      }else{
-        //如果失败需要关闭到跟页面,并且跳转到详情的支付页面
-        appRouter.pushAndPopUntil(
-          FacilityDetailPageRoute(bookingId: bookingId),
-          predicate: (route) {
-            return route.settings.name == 'FacilityPageRoute';
-          },
-        );
-      }
+      // 暂时直接进入线下支付页面
+      ComponentServiceManager().paymentService.startWithPopOfflinePaymentPage('FacilityPageRoute');
+
+
+      // //调用支付服务
+      // bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+      //
+      // //支付流程 Loading 结束
+      // LoadingEngine.dismiss();
+      //
+      // //如果成功,走下一步流程
+      // if (success) {
+      //   FacilityDetailPage.startWithPop2Main(bookingId: bookingId);
+      // }else{
+      //   //如果失败需要关闭到跟页面,并且跳转到详情的支付页面
+      //   appRouter.pushAndPopUntil(
+      //     FacilityDetailPageRoute(bookingId: bookingId),
+      //     predicate: (route) {
+      //       return route.settings.name == 'FacilityPageRoute';
+      //     },
+      //   );
+      // }
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }

+ 17 - 16
packages/cpt_facility/lib/modules/detail/facility_detail_page.dart

@@ -127,22 +127,23 @@ class FacilityDetailPage extends HookConsumerWidget {
         ).expanded(),
 
         // 底部按钮
-        Visibility(
-          visible: state.detail?.order?.paymentStatus != 1,
-          child: MyButton(
-            onPressed: () {
-              viewModel.doPaymentOrder(state.detail?.order?.id ?? "");
-            },
-            text: S.current.proceed_with_payment,
-            textColor: Colors.white,
-            backgroundColor: context.appColors.btnBgDefault,
-            fontWeight: FontWeight.w500,
-            type: ClickType.throttle,
-            fontSize: 16,
-            minHeight: 50,
-            radius: 0,
-          ).marginOnly(top: 15),
-        ),
+        // Visibility(
+        //   visible: state.detail?.order?.paymentStatus != 1,
+        //   child: MyButton(
+        //     onPressed: () {
+        //       viewModel.doPaymentOrder(state.detail?.order?.id ?? "");
+        //     },
+        //     text: S.current.proceed_with_payment,
+        //     textColor: Colors.white,
+        //     backgroundColor: context.appColors.btnBgDefault,
+        //     fontWeight: FontWeight.w500,
+        //     type: ClickType.throttle,
+        //     fontSize: 16,
+        //     minHeight: 50,
+        //     radius: 0,
+        //   ).marginOnly(top: 15),
+        // ),
+
       ]),
     );
   }

+ 15 - 15
packages/cpt_facility/lib/modules/detail/facility_detail_view_model.dart

@@ -34,20 +34,20 @@ class FacilityDetailViewModel extends _$FacilityDetailViewModel with DioCancelab
   }
 
   //根据OrderId继续支付订单
-  void doPaymentOrder(String orderId) async {
-    //支付流程 Loading 开始
-    LoadingEngine.show();
-
-    //调用支付服务
-    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
-
-    //支付流程 Loading 结束
-    LoadingEngine.dismiss();
-
-    //如果成功,返回页面
-    if (success) {
-      appRouter.maybePop();
-    }
-  }
+  // void doPaymentOrder(String orderId) async {
+  //   //支付流程 Loading 开始
+  //   LoadingEngine.show();
+  //
+  //   //调用支付服务
+  //   bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+  //
+  //   //支付流程 Loading 结束
+  //   LoadingEngine.dismiss();
+  //
+  //   //如果成功,返回页面
+  //   if (success) {
+  //     appRouter.maybePop();
+  //   }
+  // }
 
 }

+ 23 - 17
packages/cpt_form/lib/modules/apply/vm/apply_view_model.dart

@@ -171,28 +171,34 @@ class ApplyViewModel extends _$ApplyViewModel with DioCancelableMixin {
       cancelToken: cancelToken,
     );
 
+    LoadingEngine.dismiss();
+
     if (result.isSuccess) {
       String orderId = result.data?.order?.id ?? "";
       Log.d("当前Form生成的订单ID:$orderId");
 
-      //调用支付服务
-      bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
-
-      //支付流程 Loading 结束
-      LoadingEngine.dismiss();
+      // 暂时直接进入线下支付页面
+      gotoNextPage();
+
+      // //调用支付服务
+      // bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+      //
+      // //支付流程 Loading 结束
+      // LoadingEngine.dismiss();
+      //
+      // //如果支付成功,走下一步流程
+      // if (success) {
+      //   gotoNextPage();
+      // } else {
+      //   //如果失败需要关闭到跟页面,并且跳转到详情的支付页面
+      //   appRouter.pushAndPopUntil(
+      //     FormDetailPageRoute(estateFormId: state.estateFormId ?? "", taskId: result.data?.id ?? "", type: state.formType ?? ""),
+      //     predicate: (route) {
+      //       return route.settings.name == 'FormPageRoute';
+      //     },
+      //   );
+      // }
 
-      //如果支付成功,走下一步流程
-      if (success) {
-        gotoNextPage();
-      } else {
-        //如果失败需要关闭到跟页面,并且跳转到详情的支付页面
-        appRouter.pushAndPopUntil(
-          FormDetailPageRoute(estateFormId: state.estateFormId ?? "", taskId: result.data?.id ?? "", type: state.formType ?? ""),
-          predicate: (route) {
-            return route.settings.name == 'FormPageRoute';
-          },
-        );
-      }
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }

+ 15 - 14
packages/cpt_form/lib/modules/detail/detail_processing_fragment.dart

@@ -183,20 +183,21 @@ class DetailProcessingFragment extends HookConsumerWidget {
               ).expanded(),
             ],
           ).marginOnly(left: 15, right: 15),
-          Visibility(
-            visible: state.forDetail?.order?.refundStatus != 0 || state.forDetail?.order?.paymentStatus != 1,
-            child: MyButton(
-              onPressed: () {
-                viewModel.doPaymentOrder(state.forDetail?.order?.id ?? "");
-              },
-              text: S.current.payment,
-              textColor: Colors.white,
-              fontSize: 15,
-              fontWeight: FontWeight.w400,
-              radius: 7,
-              backgroundColor: context.appColors.orangeBG,
-            ).marginOnly(top: 6, left: 15, right: 15),
-          ),
+
+          // Visibility(
+          //   visible: state.forDetail?.order?.refundStatus != 0 || state.forDetail?.order?.paymentStatus != 1,
+          //   child: MyButton(
+          //     onPressed: () {
+          //       viewModel.doPaymentOrder(state.forDetail?.order?.id ?? "");
+          //     },
+          //     text: S.current.payment,
+          //     textColor: Colors.white,
+          //     fontSize: 15,
+          //     fontWeight: FontWeight.w400,
+          //     radius: 7,
+          //     backgroundColor: context.appColors.orangeBG,
+          //   ).marginOnly(top: 6, left: 15, right: 15),
+          // ),
           const SizedBox(height: 17.5),
         ],
       ),

+ 15 - 15
packages/cpt_form/lib/modules/detail/form_detail_view_model.dart

@@ -46,19 +46,19 @@ class FormDetailViewModel extends _$FormDetailViewModel with DioCancelableMixin
   }
 
   //根据OrderId继续支付订单
-  void doPaymentOrder(String orderId) async {
-    //支付流程 Loading 开始
-    LoadingEngine.show();
-
-    //调用支付服务
-    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
-
-    //支付流程 Loading 结束
-    LoadingEngine.dismiss();
-
-    //如果成功,返回页面
-    if (success) {
-      appRouter.maybePop();
-    }
-  }
+  // void doPaymentOrder(String orderId) async {
+  //   //支付流程 Loading 开始
+  //   LoadingEngine.show();
+  //
+  //   //调用支付服务
+  //   bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+  //
+  //   //支付流程 Loading 结束
+  //   LoadingEngine.dismiss();
+  //
+  //   //如果成功,返回页面
+  //   if (success) {
+  //     appRouter.maybePop();
+  //   }
+  // }
 }

+ 18 - 0
packages/cpt_form/lib/modules/form/form_types.dart

@@ -13,6 +13,8 @@ import 'package:cpt_form/modules/apply/vehicle_info_page.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/generated/l10n.dart';
 import 'package:plugin_basic/provider/user_config/user_config_service.dart';
+import 'package:router/componentRouter/community_service.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
 
 //每一种 formType 对应的详情页面类型
 enum DetailPageType {
@@ -28,6 +30,7 @@ enum DetailPageType {
   renovationCompany, //装修公司信息
   largeTextBox, //大说明文本框
   payment, //支付页面
+  offlinePayment, //线下支付
 }
 
 class FormTypes {
@@ -132,6 +135,7 @@ class FormTypes {
           DetailPageType.typeOfApplication,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'note_management_txt': S.current.access_card_desc,
@@ -147,6 +151,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': S.current.access_card_tenant_letter,
@@ -162,6 +167,7 @@ class FormTypes {
           DetailPageType.vehicleInfo,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'note_management_txt': '${S.current.car_cancel_txt}\n\n${S.current.car_cancel_txt_1}\n${S.current.car_cancel_txt_2}',
@@ -177,6 +183,7 @@ class FormTypes {
           DetailPageType.movingCompany,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'note_management_txt': S.current.moving_in_msg,
@@ -192,6 +199,7 @@ class FormTypes {
           DetailPageType.movingCompany,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'note_management_txt': S.current.moving_in_msg,
@@ -206,6 +214,7 @@ class FormTypes {
           DetailPageType.guestVehicleInfo,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'note_management_txt': S.current.overnight_parking_msg,
@@ -221,6 +230,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': '${S.current.label_txt}\n\n${S.current.label_txt_1}\n\n${S.current.label_txt_2}\n\n${S.current.label_txt_3}',
@@ -239,6 +249,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'large_txt': S.current.list_of_renovation_works,
@@ -256,6 +267,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': '${S.current.label_txt}\n\n${S.current.label_txt_1}\n\n${S.current.label_txt_2}\n\n${S.current.label_txt_3}',
@@ -272,6 +284,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': '${S.current.label_txt}\n\n${S.current.label_txt_1}\n\n${S.current.label_txt_2}\n\n${S.current.label_txt_3}',
@@ -288,6 +301,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': S.current.bicycle_desc,
@@ -304,6 +318,7 @@ class FormTypes {
           DetailPageType.attachment,
           DetailPageType.note2Management,
           enableEdit ? DetailPageType.payment : DetailPageType.signature,
+          if (enableEdit) DetailPageType.offlinePayment,
         ],
         'detail_data': {
           'attachment_txt': '${S.current.label_txt}\n\n${S.current.label_txt_1}\n\n${S.current.label_txt_2}\n\n${S.current.label_txt_3}',
@@ -360,6 +375,9 @@ class FormTypes {
       case DetailPageType.payment:
         FormPaymentPage.startInstance();
         break;
+      case DetailPageType.offlinePayment:
+        ComponentServiceManager().paymentService.startWithPopOfflinePaymentPage('FormPageRoute');
+        break;
     }
 
     //移除数组的第0索引,避免重复跳转页面

+ 4 - 4
packages/cpt_main/lib/modules/home/home_state.dart

@@ -29,10 +29,10 @@ class HomeState {
                 'category_name': S.current.property,
                 'category_icon': Assets.mainHomePropertyIcon,
               },
-              {
-                'category_name': S.current.service,
-                'category_icon': Assets.mainHomeServiceIcon,
-              },
+              // {
+              //   'category_name': S.current.service,
+              //   'category_icon': Assets.mainHomeServiceIcon,
+              // },
               {
                 'category_name': S.current.community,
                 'category_icon': Assets.mainHomeCommunityIcon,

+ 1 - 1
packages/cpt_main/lib/modules/main/main_view_model.dart

@@ -62,7 +62,7 @@ class MainViewModel extends _$MainViewModel with DioCancelableMixin {
 
     //请求成功去首页
     if (result.isSuccess) {
-      Log.d("注册 FMC Token 成功!");
+      Log.d("注册FCM Token 成功!");
     } else {
       ToastEngine.show(result.errorMsg ?? "UnKnow Error");
     }

+ 68 - 0
packages/cpt_payment/lib/modules/offline_payment/offline_payment_page.dart

@@ -0,0 +1,68 @@
+import 'package:cpt_payment/router/page/payment_page_router.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:hooks_riverpod/hooks_riverpod.dart';
+import 'package:router/ext/auto_router_extensions.dart';
+import 'package:widgets/ext/ex_widget.dart';
+import 'package:widgets/my_appbar.dart';
+import 'package:widgets/my_load_image.dart';
+import 'package:widgets/my_text_view.dart';
+import 'package:widgets/utils/dark_theme_util.dart';
+
+import 'offline_payment_view_model.dart';
+
+@RoutePage()
+class OfflinePaymentPage extends HookConsumerWidget {
+  final String? popTargetRouter;
+
+  const OfflinePaymentPage({
+    Key? key,
+    @PathParam() required this.popTargetRouter,
+  }) : super(key: key);
+
+  //启动并关闭其他栈
+  static void startWithPop({required String? popTargetRouter}) {
+    appRouter.pushAndPopUntil(
+      OfflinePaymentPageRoute(popTargetRouter: popTargetRouter),
+      predicate: (route) {
+        return route.settings.name == popTargetRouter;
+      },
+    );
+  }
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final viewModel = ref.read(offlinePaymentViewModelProvider.notifier);
+
+    return Scaffold(
+      appBar: MyAppBar.appBar(context, S.current.payment),
+      backgroundColor: context.appColors.backgroundWhite,
+      body: SizedBox(
+        width: double.infinity,
+        child: Column(
+          children: [
+            //图片
+            const MyAssetImage(
+              Assets.paymentOfflinePaymentIcon,
+              width: 236.5,
+              height: 182,
+            ).marginOnly(top: 60),
+
+            //支付成功
+            MyTextView(
+              S.current.offline_payment,
+              fontSize: 16,
+              marginBottom: 30,
+              marginTop: 30,
+              isFontMedium: true,
+              textColor: context.appColors.textBlack,
+            ),
+          ],
+        ),
+      ),
+    );
+  }
+}

+ 4 - 0
packages/cpt_payment/lib/modules/offline_payment/offline_payment_state.dart

@@ -0,0 +1,4 @@
+
+class OfflinePaymentState {
+
+}

+ 18 - 0
packages/cpt_payment/lib/modules/offline_payment/offline_payment_view_model.dart

@@ -0,0 +1,18 @@
+import 'package:domain/repository/payment_repository.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+
+import 'offline_payment_state.dart';
+
+part 'offline_payment_view_model.g.dart';
+
+@riverpod
+class OfflinePaymentViewModel extends _$OfflinePaymentViewModel {
+
+
+  @override
+  OfflinePaymentState build() {
+    return OfflinePaymentState();
+  }
+
+}

+ 27 - 0
packages/cpt_payment/lib/modules/offline_payment/offline_payment_view_model.g.dart

@@ -0,0 +1,27 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'offline_payment_view_model.dart';
+
+// **************************************************************************
+// RiverpodGenerator
+// **************************************************************************
+
+String _$offlinePaymentViewModelHash() =>
+    r'424103c67724e2afbbd237228c844507504b0b17';
+
+/// See also [OfflinePaymentViewModel].
+@ProviderFor(OfflinePaymentViewModel)
+final offlinePaymentViewModelProvider = AutoDisposeNotifierProvider<
+    OfflinePaymentViewModel, OfflinePaymentState>.internal(
+  OfflinePaymentViewModel.new,
+  name: r'offlinePaymentViewModelProvider',
+  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
+      ? null
+      : _$offlinePaymentViewModelHash,
+  dependencies: null,
+  allTransitiveDependencies: null,
+);
+
+typedef _$OfflinePaymentViewModel = AutoDisposeNotifier<OfflinePaymentState>;
+// ignore_for_file: type=lint
+// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 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'94a8d6dbdc4de5fc3a848ac3f8800575c4200427';
+    r'ad6460003d61fc646a4e1d26ddd39d0721a0a424';
 
 /// See also [HistoryListViewModel].
 @ProviderFor(HistoryListViewModel)

+ 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'b3d776c00199744d687fa0df87874ea4c5e6c84a';
+    r'e8a213d88692e4d50cb166584de87c4c208dd811';
 
 /// See also [PaymentListViewModel].
 @ProviderFor(PaymentListViewModel)

+ 13 - 13
packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_page.dart

@@ -211,19 +211,19 @@ class PaymentConfirmPage extends HookConsumerWidget {
           ).expanded(),
 
           // 底部按钮
-          MyButton(
-            onPressed: () {
-              viewModel.doPaymentOrder(orderId ?? "");
-            },
-            text: S.current.proceed_with_payment,
-            textColor: Colors.white,
-            backgroundColor: context.appColors.btnBgDefault,
-            fontWeight: FontWeight.w500,
-            type: ClickType.throttle,
-            fontSize: 16,
-            minHeight: 50,
-            radius: 0,
-          ).marginOnly(top: 15),
+          // MyButton(
+          //   onPressed: () {
+          //     viewModel.doPaymentOrder(orderId ?? "");
+          //   },
+          //   text: S.current.proceed_with_payment,
+          //   textColor: Colors.white,
+          //   backgroundColor: context.appColors.btnBgDefault,
+          //   fontWeight: FontWeight.w500,
+          //   type: ClickType.throttle,
+          //   fontSize: 16,
+          //   minHeight: 50,
+          //   radius: 0,
+          // ).marginOnly(top: 15),
         ],
       ),
     );

+ 15 - 15
packages/cpt_payment/lib/modules/payment_confirm/payment_confirm_view_model.dart

@@ -16,19 +16,19 @@ class PaymentConfirmViewModel extends _$PaymentConfirmViewModel {
   }
 
   //根据OrderId继续支付订单
-  void doPaymentOrder(String orderId) async {
-    //支付流程 Loading 开始
-    LoadingEngine.show();
-
-    //调用支付服务
-    bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
-
-    //支付流程 Loading 结束
-    LoadingEngine.dismiss();
-
-    //如果成功,返回页面
-    if (success) {
-      PaymentSuccessPage.startWithPop(orderId: orderId);
-    }
-  }
+  // void doPaymentOrder(String orderId) async {
+  //   //支付流程 Loading 开始
+  //   LoadingEngine.show();
+  //
+  //   //调用支付服务
+  //   bool success = await ComponentServiceManager().paymentService.executePayment(orderId: orderId);
+  //
+  //   //支付流程 Loading 结束
+  //   LoadingEngine.dismiss();
+  //
+  //   //如果成功,返回页面
+  //   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'bd9a0a264d5db7db1b31fa48c82a6ee42f7d9a50';
+    r'b1fe785fa63987242b53cea98dc80cc2f0a9dfbc';
 
 /// See also [PaymentConfirmViewModel].
 @ProviderFor(PaymentConfirmViewModel)

+ 6 - 0
packages/cpt_payment/lib/router/component/payment_component_service.dart

@@ -2,6 +2,7 @@
  * Community 组件的组件路由
  */
 import 'package:cpt_payment/modules/add_card/add_card_page.dart';
+import 'package:cpt_payment/modules/offline_payment/offline_payment_page.dart';
 import 'package:cpt_payment/provider/stripe_service.dart';
 import 'package:plugin_basic/provider/global_provider_container.dart';
 import 'package:router/componentRouter/payment_service.dart';
@@ -37,4 +38,9 @@ class PaymentComponentService extends PaymentService {
   Future<bool> executePayment({required String orderId}) {
     return globalContainer.read(stripeServiceProvider).executePayment(orderId: orderId);
   }
+
+  @override
+  void startWithPopOfflinePaymentPage(String? popTargetRouter) {
+    OfflinePaymentPage.startWithPop(popTargetRouter: popTargetRouter);
+  }
 }

+ 2 - 0
packages/cpt_payment/lib/router/page/payment_page_router.dart

@@ -13,6 +13,7 @@ import '../../modules/payment_confirm/payment_confirm_page.dart';
 import '../../modules/payment_success/payment_success_page.dart';
 import '../../modules/add_card/add_card_page.dart';
 import '../../modules/choose_card/choose_card_page.dart';
+import '../../modules/offline_payment/offline_payment_page.dart';
 import '../../modules/payment/payment/payment_list_screen.dart';
 import '../../modules/payment/history/history_list_screen.dart';
 
@@ -41,5 +42,6 @@ class PaymentPageRouter extends _$PaymentPageRouter {
         CustomRoute(page: PaymentSuccessPageRoute.page, path: RouterPath.paymentSuccess, transitionsBuilder: applySlideTransition),
         CustomRoute(page: AddCardPageRoute.page, path: RouterPath.paymentAddCard, transitionsBuilder: applySlideTransition),
         CustomRoute(page: ChooseCardPageRoute.page, path: RouterPath.paymentChooseCard, transitionsBuilder: applySlideTransition),
+        CustomRoute(page: OfflinePaymentPageRoute.page, path: RouterPath.paymentOffline, transitionsBuilder: applySlideTransition),
       ];
 }

+ 53 - 0
packages/cpt_payment/lib/router/page/payment_page_router.gr.dart

@@ -45,6 +45,19 @@ abstract class _$PaymentPageRouter extends RootStackRouter {
         child: ManageScreen(),
       );
     },
+    OfflinePaymentPageRoute.name: (routeData) {
+      final pathParams = routeData.inheritedPathParams;
+      final args = routeData.argsAs<OfflinePaymentPageRouteArgs>(
+          orElse: () => OfflinePaymentPageRouteArgs(
+              popTargetRouter: pathParams.optString('popTargetRouter')));
+      return AutoRoutePage<dynamic>(
+        routeData: routeData,
+        child: OfflinePaymentPage(
+          key: args.key,
+          popTargetRouter: args.popTargetRouter,
+        ),
+      );
+    },
     PaymentConfirmPageRoute.name: (routeData) {
       final pathParams = routeData.inheritedPathParams;
       final args = routeData.argsAs<PaymentConfirmPageRouteArgs>(
@@ -170,6 +183,46 @@ class ManagePageRoute extends PageRouteInfo<void> {
 }
 
 /// generated route for
+/// [OfflinePaymentPage]
+class OfflinePaymentPageRoute
+    extends PageRouteInfo<OfflinePaymentPageRouteArgs> {
+  OfflinePaymentPageRoute({
+    Key? key,
+    required String? popTargetRouter,
+    List<PageRouteInfo>? children,
+  }) : super(
+          OfflinePaymentPageRoute.name,
+          args: OfflinePaymentPageRouteArgs(
+            key: key,
+            popTargetRouter: popTargetRouter,
+          ),
+          rawPathParams: {'popTargetRouter': popTargetRouter},
+          initialChildren: children,
+        );
+
+  static const String name = 'OfflinePaymentPageRoute';
+
+  static const PageInfo<OfflinePaymentPageRouteArgs> page =
+      PageInfo<OfflinePaymentPageRouteArgs>(name);
+}
+
+class OfflinePaymentPageRouteArgs {
+  const OfflinePaymentPageRouteArgs({
+    this.key,
+    required this.popTargetRouter,
+  });
+
+  final Key? key;
+
+  final String? popTargetRouter;
+
+  @override
+  String toString() {
+    return 'OfflinePaymentPageRouteArgs{key: $key, popTargetRouter: $popTargetRouter}';
+  }
+}
+
+/// generated route for
 /// [PaymentConfirmPage]
 class PaymentConfirmPageRoute
     extends PageRouteInfo<PaymentConfirmPageRouteArgs> {

+ 7 - 2
packages/cpt_profile/lib/modules/setting/setting_page.dart

@@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:plugin_basic/modules/global_web_page.dart';
 import 'package:plugin_basic/provider/app_config/app_config_service.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:widgets/ext/ex_widget.dart';
@@ -64,10 +65,14 @@ class SettingPage extends HookConsumerWidget {
             SettingItemContainer(title: S.current.reset_password).onTap(viewModel.gotoResetPasswordPage),
 
             //隐私协议
-            SettingItemContainer(title: S.current.privacy_policy),
+            SettingItemContainer(title: S.current.privacy_policy).onTap((){
+              GlobalWebPage.startInstance(context: context, title: S.current.privacy_policy, url: 'https://24ifm.com/privacy-policy');
+            }),
 
             //服务条款
-            SettingItemContainer(title: S.current.terms_conditions),
+            SettingItemContainer(title: S.current.terms_conditions).onTap((){
+              GlobalWebPage.startInstance(context: context, title: S.current.terms_conditions, url: 'https://24ifm.com/terms-and-conditions');
+            }),
 
             //删除账号
             SettingItemContainer(title: S.current.account_deactivation).onTap(viewModel.doDeleteAccount),

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


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

@@ -171,6 +171,7 @@ class Assets {
   static const String paymentInfoTopImage = 'assets/payment/info_top_image.webp';
   static const String paymentManageIcon = 'assets/payment/manage_icon.webp';
   static const String paymentMasterCardIcon = 'assets/payment/master_card_icon.webp';
+  static const String paymentOfflinePaymentIcon = 'assets/payment/offline_payment_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';

+ 2 - 0
packages/cs_resources/lib/generated/intl/messages_en.dart

@@ -428,6 +428,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "notice_board": MessageLookupByLibrary.simpleMessage("Notice Board"),
         "notification": MessageLookupByLibrary.simpleMessage("Notification"),
         "nric_fin": MessageLookupByLibrary.simpleMessage("NRIC/FIN"),
+        "offline_payment": MessageLookupByLibrary.simpleMessage(
+            "Please make your payment in person at the Property Management office. Thank you!"),
         "old_mobile_phone":
             MessageLookupByLibrary.simpleMessage("Old Mobile Phone"),
         "on_hold": MessageLookupByLibrary.simpleMessage("On Hold"),

+ 2 - 0
packages/cs_resources/lib/generated/intl/messages_zh_CN.dart

@@ -348,6 +348,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "notice_board": MessageLookupByLibrary.simpleMessage("消息板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "nric_fin": MessageLookupByLibrary.simpleMessage("身份证/签证"),
+        "offline_payment":
+            MessageLookupByLibrary.simpleMessage("请亲自到物业管理办公室付款。非常感谢。"),
         "old_mobile_phone": MessageLookupByLibrary.simpleMessage("旧的手机号码"),
         "on_hold": MessageLookupByLibrary.simpleMessage("持有"),
         "open_folder": MessageLookupByLibrary.simpleMessage("打开文件夹"),

+ 2 - 0
packages/cs_resources/lib/generated/intl/messages_zh_HK.dart

@@ -348,6 +348,8 @@ class MessageLookup extends MessageLookupByLibrary {
         "notice_board": MessageLookupByLibrary.simpleMessage("通知板"),
         "notification": MessageLookupByLibrary.simpleMessage("通知"),
         "nric_fin": MessageLookupByLibrary.simpleMessage("身份证/签证"),
+        "offline_payment":
+            MessageLookupByLibrary.simpleMessage("请亲自到物业管理办公室付款。非常感谢。"),
         "old_mobile_phone": MessageLookupByLibrary.simpleMessage("旧的手机号码"),
         "on_hold": MessageLookupByLibrary.simpleMessage("持有"),
         "open_folder": MessageLookupByLibrary.simpleMessage("打开文件夹"),

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

@@ -4640,6 +4640,16 @@ class S {
     );
   }
 
+  /// `Please make your payment in person at the Property Management office. Thank you!`
+  String get offline_payment {
+    return Intl.message(
+      'Please make your payment in person at the Property Management office. Thank you!',
+      name: 'offline_payment',
+      desc: '',
+      args: [],
+    );
+  }
+
   /// `Other`
   String get other {
     return Intl.message(

+ 5 - 4
packages/cs_resources/lib/l10n/intl_en.arb

@@ -367,7 +367,7 @@
   "for_rent": "For Rent",
   "what_on_your_mind": "What’s on your mind?",
   "sell_item": "Sell Item",
-    "rent_item": "Rent Item",
+  "rent_item": "Rent Item",
   "followed": "Followed",
   "to_follow": "+Follow",
   "like_count": "Like ({count})",
@@ -383,9 +383,9 @@
   "contact_information": "Contact Information",
   "price": "Price",
   "description": "Description",
-    "most_likes":  "Most Likes",
-    "most_bookmarked": "Most Bookmarked",
-    "view_at_most": "View At Most",
+  "most_likes": "Most Likes",
+  "most_bookmarked": "Most Bookmarked",
+  "view_at_most": "View At Most",
   "house_cleaning": "House Cleaning",
   "air_conditioning_cleaning": "Air Conditioning Cleaning",
   "order_detail_id_is_invalid": "Order Detail ID is invalid",
@@ -459,5 +459,6 @@
   "paid_on_sometime": "Paid on {time}",
   "read_all_msg": "Are you sure you want to mark all notifications?",
   "today": "Today",
+  "offline_payment": "Please make your payment in person at the Property Management office. Thank you!",
   "other": "Other"
 }

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

@@ -458,5 +458,6 @@
   "paid_on_sometime": "付款时间 {time}",
   "read_all_msg": "您确定要标记所有的消息通知为已读吗?",
   "today": "今天",
+  "offline_payment": "请亲自到物业管理办公室付款。非常感谢。",
   "other": "其他"
 }

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

@@ -444,5 +444,6 @@
   "paid_on_sometime": "付款时间 {time}",
   "read_all_msg": "您确定要标记所有的消息通知为已读吗?",
   "today": "今天",
+  "offline_payment": "请亲自到物业管理办公室付款。非常感谢。",
   "other": "其他"
 }

+ 2 - 0
packages/cs_router/lib/componentRouter/payment_service.dart

@@ -9,6 +9,8 @@ abstract class PaymentService {
 
   void startAddCardPage();
 
+  void startWithPopOfflinePaymentPage(String? popTargetRouter);
+
   Future<bool> executePayment({
     required String orderId,
   });

+ 1 - 0
packages/cs_router/lib/path/router_path.dart

@@ -103,6 +103,7 @@ class RouterPath {
   static const paymentSuccess = '/payment/success';
   static const paymentAddCard = '/payment/add';
   static const paymentChooseCard = '/payment/choose';
+  static const paymentOffline = '/payment/offline';
 
   //房屋资产
   static const property = '/property';