SPSBOrderBalancePayViewController.m 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // SPSBOrderBalancePayViewController.m
  3. // 我的社保
  4. //
  5. // Created by shanp on 2021/6/21.
  6. //
  7. #import "SPSBOrderBalancePayViewController.h"
  8. #import "SPSBOrderBalanceModel.h"
  9. #import "UIViewController+SPSBNetworkManager.h"
  10. #import "SPSBAppDifferenceProfile.h"
  11. @interface SPSBOrderBalancePayViewController ()
  12. @end
  13. @implementation SPSBOrderBalancePayViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view.
  17. }
  18. #pragma mark - Action
  19. #pragma mark - Network Action
  20. - (void)payAction {
  21. @weakify(self)
  22. [self networkUseMethod:SPSBNetworkMethodPOST loadingTips:@"正在支付" isLogin:true url:spsb_appUrl(SPSBUrlCreatePriceDifferencePaymentOrder) urlParameters:nil parameters:^NSDictionary * _Nonnull{
  23. return @{@"added_no" : self->_spsb_data.spsb_added_no, @"pay_channel" : self.spsb_orderBase.spsb_chosePay == 0 ? SPSBAlipayChannel : SPSBWeChatPayChannel};;
  24. } success:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) {
  25. @strongify(self)
  26. [self payActionWithOrderType:SPSBOrderTypeOrderBalance serveyType:SPSBResultServeyTypeNo payData:data[@"data"] argumentData:nil];
  27. return nil;
  28. } failure:^NSString * _Nullable(NSError * _Nonnull error, id _Nullable data) {
  29. @strongify(self)
  30. if (self.spsb_orderBase.spsb_payFailure) {
  31. self.spsb_orderBase.spsb_payFailure(error);
  32. }
  33. return nil;
  34. }];
  35. }
  36. #pragma mark - UI
  37. - (void)setupUI {
  38. [super setupUI];
  39. [self setOrderBaseWithOrderType:SPSBOrderTypeOrderBalance totalFee:_spsb_data.spsb_amount.floatValue discountCount:0 orderNumber:0 showData:nil buttonType:SPSBOrderListPayButtonTypePay];
  40. [self createPayView];
  41. }
  42. @end