瀏覽代碼

路由跳转

liukai 2 天之前
父節點
當前提交
192bc9adc1

+ 5 - 2
packages/cpt_facility/lib/modules/book_confirm/book_confirm_page.dart

@@ -116,7 +116,7 @@ class BookConfirmPage extends HookConsumerWidget {
           ),
 
           // 显示支付信息
-          _paymentInfo(context),
+          _paymentInfo(context,ref),
 
           // 底部按钮
           MyButton(
@@ -235,7 +235,9 @@ class BookConfirmPage extends HookConsumerWidget {
   }
 
   //底部的支付信息
-  Widget _paymentInfo(BuildContext context) {
+  Widget _paymentInfo(BuildContext context,WidgetRef ref) {
+    final viewModel = ref.watch(bookConfirmViewModelProvider.notifier);
+
     return Container(
       padding: const EdgeInsets.symmetric(vertical: 17.5, horizontal: 23),
       color: context.appColors.whiteBG,
@@ -268,6 +270,7 @@ class BookConfirmPage extends HookConsumerWidget {
                 textColor: Colors.white,
                 backgroundColor: context.appColors.btnBgDefault,
                 paddingRight: 16,
+                onClick: viewModel.gotoChooseCardPage,
                 paddingLeft: 16,
                 paddingTop: 8,
                 paddingBottom: 8,

+ 7 - 3
packages/cpt_facility/lib/modules/book_confirm/book_confirm_view_model.dart

@@ -1,6 +1,6 @@
 import 'package:cpt_facility/modules/detail/facility_detail_page.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:widgets/widget_export.dart';
+import 'package:router/componentRouter/component_service_manager.dart';
 
 import 'book_confirm_state.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -15,11 +15,15 @@ class BookConfirmViewModel extends _$BookConfirmViewModel {
   }
 
   //执行支付
-  void doPayment(){
-
+  void doPayment() {
     ToastEngine.show("点击了确定");
 
     FacilityDetailPage.startWithPop2Main();
   }
 
+  //选择银行卡页面
+  void gotoChooseCardPage() {
+    ComponentServiceManager().paymentService.startChooseCardPage();
+  }
+
 }