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';

part 'payment_confirm_view_model.g.dart';

@riverpod
class PaymentConfirmViewModel extends _$PaymentConfirmViewModel {
  @override
  PaymentConfirmState build() {
    return PaymentConfirmState();
  }

  //根据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);
  //   }
  // }
}
