| | |
| | | @IBOutlet weak var cons_tableHei: NSLayoutConstraint! |
| | | @IBOutlet weak var btn_coupon: TapBtn! |
| | | |
| | | @IBOutlet weak var img_cover: UIImageView! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var view_banner: CommonBannerView! |
| | | @IBOutlet weak var label_title: UILabel! |
| | | @IBOutlet weak var label_listenWeek: UILabel! |
| | | @IBOutlet weak var label_listenTime: UILabel! |
| | | @IBOutlet weak var label_store: UILabel! |
| | |
| | | title = "课程详情" |
| | | |
| | | if let m = detailModel{ |
| | | img_cover.sd_setImage(with: URL(string: m.detailDrawing)) |
| | | view_banner.setImages(images: m.detailDrawing.components(separatedBy: ","), type: .URL) { index in |
| | | |
| | | } |
| | | |
| | | label_title.text = m.name |
| | | label_listenWeek.text = "每" + m.weeks.joined(separator: "、") |
| | | label_listenTime.text = m.times.joined(separator: "|") |
| | |
| | | changePrice(selectClassIndex) |
| | | } |
| | | |
| | | |
| | | btn_addStudent.isHidden = isExtend |
| | | if isExtend{ |
| | | btn_handleBtn.setTitle("续课", for: .normal) |
| | | }else{ |
| | |
| | | |
| | | @IBAction func paymentAction(_ sender: UIButton) { |
| | | guard detailModel != nil else {return} |
| | | guard studentModels.count != 0 else {alertError(msg: "请选择学员");return} |
| | | guard studentModels.count != 0 else {alertError(msg: "请选择运动营成员");return} |
| | | StoresInfoView.show(detailModel!) { [weak self] status in |
| | | guard let weakSelf = self else { return } |
| | | if status{ |
| | |
| | | |
| | | let coin = (model.playPaiCoin ?? 0) * weakSelf.studentModels.count |
| | | |
| | | PaymentView.show(money: (ali:discountPrice,wx:discountPrice,coin:coin,course:nil)) { [weak self] payType in |
| | | PaymentView.show(money: (ali:discountPrice,wx:discountPrice,coin:coin,course:nil,integral:nil)) { [weak self] payType in |
| | | guard let weakSelf = self else { return } |
| | | |
| | | var paymentPrice:Double = 0 |
| | |
| | | paymentPrice = discountPrice |
| | | case .coin: |
| | | paymentPrice = Double(coin) |
| | | case .courseNum:break |
| | | case .courseNum,.integral:break |
| | | } |
| | | |
| | | Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: paymentPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id})).subscribe(onNext: { data in |
| | |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | self?.present(vc, animated: true) |
| | | case .courseNum:break |
| | | case .courseNum,.integral:break |
| | | } |
| | | }else{ |
| | | alertError(msg: data.msg) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | },onError: { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | | case .Other(_,let string): |
| | | let vc = PaymentResultVC(result: .fail(string), objType: .courseApply,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | weakSelf.present(vc, animated: true) |
| | | default: |
| | | let vc = PaymentResultVC(result: .fail("支付失败"), objType: .courseApply,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | weakSelf.present(vc, animated: true) |
| | | } |
| | | } |
| | | |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | }else{ |
| | |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_Common_1_CCell", for: indexPath) as! Common_1_CCell |
| | | cell.isSelected = indexPath.row == selectClassIndex |
| | | cell.courseDetailListModel = m |
| | | |
| | | return cell |
| | | } |
| | | |
| | |
| | | tableView.reloadData() |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | }else{ |
| | | alert(msg: "至少选择一位学员") |
| | | alert(msg: "至少选择一位运动营成员") |
| | | } |
| | | |
| | | } |
| | | cell.btn_handle.isHidden = isExtend |
| | | return cell |
| | | } |
| | | } |