|
@@ -1,5 +1,6 @@
|
|
|
import 'dart:ui';
|
|
|
|
|
|
+import 'package:cpt_form/router/page/form_page_router.dart';
|
|
|
import 'package:cs_resources/generated/l10n.dart';
|
|
|
import 'package:domain/entity/form_content_entity.dart';
|
|
|
import 'package:domain/entity/form_list_entity.dart';
|
|
@@ -13,6 +14,7 @@ import 'package:plugin_platform/http/dio/dio_cancelable_mixin.dart';
|
|
|
import 'package:plugin_platform/platform_export.dart';
|
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
import 'package:router/componentRouter/component_service_manager.dart';
|
|
|
+import 'package:router/ext/auto_router_extensions.dart';
|
|
|
import 'package:shared/utils/log_utils.dart';
|
|
|
import 'package:widgets/picker/date_picker_util.dart';
|
|
|
import '../../form/form_page.dart';
|
|
@@ -155,7 +157,7 @@ class ApplyViewModel extends _$ApplyViewModel with DioCancelableMixin {
|
|
|
state = state.copyWith(formContentDetail: updatedDetail);
|
|
|
}
|
|
|
|
|
|
- /// 提交Form表单
|
|
|
+ /// 提交Form表单 - 直接支付
|
|
|
void submitForm() async {
|
|
|
//支付流程 Loading 开始
|
|
|
LoadingEngine.show();
|
|
@@ -178,9 +180,17 @@ class ApplyViewModel extends _$ApplyViewModel with DioCancelableMixin {
|
|
|
//支付流程 Loading 结束
|
|
|
LoadingEngine.dismiss();
|
|
|
|
|
|
- //如果成功,走下一步流程
|
|
|
- if (success){
|
|
|
+ //如果支付成功,走下一步流程
|
|
|
+ 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");
|