无故事王国
2023-10-20 6382df7f214503697f041631bd7fdbc5db2c6149
WanPai/Root/Activity/VC/ActivityDetailApplyVC.swift
@@ -34,6 +34,10 @@
   @IBOutlet weak var label_matchStore: UILabel!
   @IBOutlet weak var btn_moreMatchStore: UIButton!
   @IBOutlet weak var view_money: UIView!
   @IBOutlet weak var view_coin: UIView!
   @IBOutlet weak var view_courseNum: UIView!
    private lazy var bannerView:CommonBannerView = {
        let v = CommonBannerView()
        return v
@@ -72,6 +76,10 @@
        label_money.text = String(format: "%@/人", activityDetailModel.cashPrice.currency())
        label_coin.text = String(format: "%ld币/人", activityDetailModel.playPaiCoin)
        label_courseNum.text = String(format: "%ld课时/人", activityDetailModel.classPrice)
      view_money.isHidden = activityDetailModel.cashPrice == 0
      view_courseNum.isHidden = activityDetailModel.classPrice == 0
      view_coin.isHidden = activityDetailModel.playPaiCoin == 0
        students.append(contentsOf: activityDetailModel.participant)
        cons_tableHei.constant = Double(students.count) * 100
@@ -155,40 +163,33 @@
                     switch result {
                        case .success:
                           let vc = PaymentResultVC(result: .success, objType: .activityApply)
                           vc.modalPresentationStyle = .fullScreen
                           weakSelf.present(vc, animated: true)
//                           weakSelf.btn_enroll.setTitle("已报名", for: .normal)
//                           weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
                           self?.push(vc: vc)
                        case .cancel:
                           alert(msg: "已取消")
                        case .failure(let error):
                           let vc = PaymentResultVC(result: .fail(error.localizedDescription), objType: .activityApply)
                           vc.modalPresentationStyle = .fullScreen
                           weakSelf.present(vc, animated: true)
                        case .failure(_):
                           let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .activityApply)
                           self?.push(vc: vc)
                     }
                  }
               case .wechat:break
               case .coin:
                  let vc = PaymentResultVC(result: .success, objType: .activityApply)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
//                  weakSelf.btn_enroll.setTitle("已报名", for: .normal)
//                  weakSelf.btn_enroll.backgroundColor = UIColor.gray.withAlphaComponent(0.5)
                  self?.push(vc: vc)
               case .courseNum:
                  let vc = PaymentResultVC(result: .success, objType: .activityApply)
                  self?.push(vc: vc)
               default:break
            }
         }
      },onError: {[weak self] error in
         guard let weakSelf = self else { return }
         if let er = error as? NetworkRequest.NetRequestError{
            switch er {
               case .Other(_,let string):
                  let vc = PaymentResultVC(result: .fail(string), objType: .yard,handleVC: nil)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
               case .Other(let code,let string):
                  let vc = PaymentResultVC(result: .fail(string,code), objType: .yard,handleVC: nil)
                  self?.push(vc: vc)
               default:
                  let vc = PaymentResultVC(result: .fail("支付失败"), objType: .yard,handleVC: nil)
                  vc.modalPresentationStyle = .fullScreen
                  weakSelf.present(vc, animated: true)
                  let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .yard,handleVC: nil)
                  self?.push(vc: vc)
            }
         }
      }).disposed(by: disposeBag)