diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index f113a454..9b599f46 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -263,11 +263,19 @@ class _Pay { ///app商品 向支付宝发起订单查询请求 String get jcookOrderCheckAlipay => '/app/user/alipay/jcookOrderCheckAlipay'; - ///创建缴费订单 + ///创建预缴费订单 String get createPrepaymentOrder => '/app/user/alipay/createPrepaymentOrder'; - ///app商品 向支付宝发起订单查询请求 + ///创建预缴费订单 向支付宝发起订单查询请求 String get prepaymentOrderCheckAlipay => '/app/user/alipay/prepaymentOrderCheckAlipay'; + + ///创建缴费订单 + String get createLivingExpensesOrder => '/app/user/alipay/createLivingExpensesOrder'; + + ///创建缴费订单 向支付宝发起订单查询请求 + String get livingExpensesOrderCheckAlipay => '/app/user/alipay/livingExpensesOrderCheckAlipay'; + + } @@ -282,5 +290,4 @@ class _LifePay{ String get findEstateBalance => '/app/user/livingExpenses/findEstateBalance'; - } diff --git a/lib/pages/life_pay/life_pay_page_new.dart b/lib/pages/life_pay/life_pay_page_new.dart index 0748fe30..a122b896 100644 --- a/lib/pages/life_pay/life_pay_page_new.dart +++ b/lib/pages/life_pay/life_pay_page_new.dart @@ -308,21 +308,24 @@ class _LifePayPageNewState extends State { color: kPrimaryColor, padding: EdgeInsets.symmetric(horizontal: 50.w, vertical: 15.w), onPressed: () async { - // Function cancel = BotToast.showLoading(); - // BaseModel baseModel = - // await NetUtil().post('/user/alipay/dailyPaymentAlipay', params: { - // "ids": total.ids, - // "payType": 1, //暂时写死 等待后续补充 - // "payPrice": total.payTotal.toDoubleStringAsFixed() - // }); - // if (baseModel.success) { - // bool result = await PayUtil() - // .callAliPay(baseModel.msg, API.pay.dailPayMentCheck); - // if (result) { - // Get.off(() => PayFinishPage()); - // } - // } - // cancel(); + Function cancel = BotToast.showLoading(); + BaseModel baseModel = + await NetUtil().post(SAASAPI.pay.createLivingExpensesOrder, params: { + "chargesBillId": total.ids, + "paymentAmount": total.payTotal + }); + if (baseModel.success) { + bool result = await PayUtil().callAliPay( + (baseModel.data as String), + SAASAPI.pay.livingExpensesOrderCheckAlipay); + if (result) { + Get.off(() => PayFinishPage()); + } else { + ///跳到待付款页面 + BotToast.showText(text: '缴费失败'); + } + } + cancel(); }, child: '去缴费'.text.black.size(32.sp).bold.make(), );