|
@@ -74,7 +74,7 @@ class ShoppingCartPayOrderController: BaseViewController {
|
|
|
orderPayView.totalProductPrice = self.totalProductPrice!
|
|
|
orderPayView.commitOrderTransBlock = {
|
|
|
[weak self] (paraMdl) in
|
|
|
- self?.orderCreateApi(paraMdl: paraMdl)
|
|
|
+ self?.orderCreateApi(paraMdl: paraMdl)
|
|
|
}
|
|
|
orderPayView.jumpNavBlock = {
|
|
|
[weak self] (jumpType) in
|
|
@@ -116,12 +116,45 @@ class ShoppingCartPayOrderController: BaseViewController {
|
|
|
|
|
|
// 创建订单
|
|
|
func orderCreateApi(paraMdl: OrderCreateParameterModel) {
|
|
|
- SwiftMoyaNetWorkServiceOrder.shared().orderCreateApi(paraMdl: paraMdl) { (data) -> (Void) in
|
|
|
+ SwiftMoyaNetWorkServiceOrder.shared().orderCreateApi(paraMdl: paraMdl) { (orderBackModel) -> (Void) in
|
|
|
+ // 弹出支付方式View
|
|
|
+ AlertSheetView.payAlertSheetView(cancelClosure: {
|
|
|
+ [weak self] in
|
|
|
+ let vc = ShoppingCartFinishPayController()
|
|
|
+ vc.payStatus = false
|
|
|
+ self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ }, sureClosure: { [weak self] (payType) in
|
|
|
+ switch payType {
|
|
|
+ case .wechatPay:
|
|
|
+ self?.payWeixinpayApi(orderPayModel: orderBackModel as! OrderCreateBackModel)
|
|
|
+ case .aliPay:
|
|
|
+ self?.payAlipayApi(orderPayModel: orderBackModel as! OrderCreateBackModel)
|
|
|
+ }
|
|
|
+ })
|
|
|
|
|
|
- // 支付弹窗调用
|
|
|
- AlertSheetView.payAlertSheetView {
|
|
|
-
|
|
|
- }
|
|
|
+ self.payWeixinpayApi(orderPayModel: orderBackModel as! OrderCreateBackModel)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 微信支付
|
|
|
+ func payWeixinpayApi(orderPayModel: OrderCreateBackModel) {
|
|
|
+ SwiftMoyaNetWorkServicePay.shared().payWeixinpayApi(paraMdl: orderPayModel) { [weak self] (data) -> (Void) in
|
|
|
+ print(data)
|
|
|
+
|
|
|
+ let vc = ShoppingCartFinishPayController()
|
|
|
+ vc.payStatus = true
|
|
|
+ self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 支付宝支付
|
|
|
+ func payAlipayApi(orderPayModel: OrderCreateBackModel) {
|
|
|
+ SwiftMoyaNetWorkServicePay.shared().payAlipayApi(paraMdl: orderPayModel) { [weak self] (data) -> (Void) in
|
|
|
+ print(data)
|
|
|
+
|
|
|
+ let vc = ShoppingCartFinishPayController()
|
|
|
+ vc.payStatus = true
|
|
|
+ self?.navigationController?.pushViewController(vc, animated: true)
|
|
|
}
|
|
|
}
|
|
|
|