| | |
| | | @IBOutlet weak var btn_agreement: UIButton! |
| | | @IBOutlet weak var cons_tableHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_addStudent: QMUIButton! |
| | | @IBOutlet weak var btn_enroll: UIButton! |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | bannerView.setItems(items: items) |
| | | |
| | | btn_moreStore.isHidden = detailModel.storeInfos.count > 1 |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(detailModel.registrationClosingTime, "yyyy-MM-dd HH:mm") |
| | | if endDateTimeInterval < Date().timeIntervalSince1970{ |
| | | btn_enroll.setTitle("报名已截止", for: .normal) |
| | | btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | } |
| | | |
| | | |
| | | btn_moreStore.isHidden = detailModel.storeInfos.count == 1 |
| | | |
| | | label_title.text = detailModel.name |
| | | label_hot.text = "\(detailModel.heat)" |
| | |
| | | label_city.text = "" |
| | | label_address.text = detailModel.address |
| | | label_matchPoint.text = detailModel.storeInfos.map({$0.name}).joined(separator: "、") |
| | | label_pay_money.text = "¥\(detailModel.cash)/人" |
| | | label_pay_coin.text = "\(detailModel.paiCoin)币/人" |
| | | label_pay_course.text = "\(detailModel.classHour)课时/人" |
| | | |
| | | label_pay_money.text = detailModel.cash == 0 ? "免费":"¥\(detailModel.cash)/人" |
| | | label_pay_coin.text = detailModel.paiCoin == 0 ? "免费":"\(detailModel.paiCoin)币/人" |
| | | label_pay_course.text = detailModel.classHour == 0 ? "免费":"\(detailModel.classHour)课时/人" |
| | | |
| | | } |
| | | |
| | |
| | | for v in weakSelf.students{ |
| | | result.append(["id":v.id,"isStudent":v.isStudent]) |
| | | } |
| | | Services.worldCupPaymentCheck(id: weakSelf.detailModel.id, ids: result.jq_toJson1(), uid: nil).subscribe(onNext: {data in |
| | | if let model = data.data{ |
| | | |
| | | var money:Double? |
| | | var paiCoin:Int? |
| | | var classHour:Int? |
| | | var money:Double = 0 |
| | | var paiCoin:Int = 0 |
| | | var classHour:Int = 0 |
| | | |
| | | money = weakSelf.detailModel.cash.double |
| | | |
| | | if model.paiCoin == 1{ |
| | | money = weakSelf.detailModel.cash |
| | | paiCoin = weakSelf.detailModel.paiCoin |
| | | } |
| | | |
| | | if model.classHour == 1{ |
| | | classHour = weakSelf.detailModel.classHour |
| | | } |
| | | |
| | | if money == 0 && paiCoin == 0 && classHour == 0{ |
| | | weakSelf.payment(payType: .free, result: result) |
| | | }else{ |
| | | PaymentView.show(enumType: .worldCup, money: (ali: money, wx: money, coin: paiCoin, course:classHour, integral: nil)) {[weak self] payType in |
| | | guard let weakSelf = self else { return } |
| | | Services.worldCupPayment(id: weakSelf.detailModel.id, ids: result.jq_toJson1(), payType: payType, uid: nil).subscribe(onNext: {data in |
| | | weakSelf.payment(payType: payType, result: result) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private func payment(payType:PayType,result:[Dictionary<String,Int>]){ |
| | | Services.worldCupPayment(id: detailModel.id, ids: result.jq_toJson1(), payType: payType, uid: nil).subscribe(onNext: {[weak self]data in |
| | | if let m = data.data{ |
| | | switch payType { |
| | | case .aliPay: |
| | |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |