| | |
| | | @IBOutlet weak var view_packageList: UIView! |
| | | @IBOutlet weak var btn_handleBtn: UIButton! |
| | | @IBOutlet weak var view_teach: UIView! |
| | | @IBOutlet weak var label_couponInfo: UILabel! |
| | | |
| | | private var detailModel:CourseDetailModel? |
| | | private var selectClassIndex:Int = 0 |
| | |
| | | //重新唤起添加学生 |
| | | weakSelf.studentAction(weakSelf.btn_addStudent) |
| | | }.disposed(by: disposeBag) |
| | | |
| | | NotificationCenter.default.rx.notification(UIApplication.didBecomeActiveNotification).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | self?.selectCouponModel = nil |
| | | self?.btn_couponInfo.setTitle("去选择", for: .normal) |
| | | self?.queryCouponInfo {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | | @IBAction func couponAction(_ sender: TapBtn) { |
| | |
| | | guard let weakSelf = self else { return } |
| | | self?.btn_hasCoupon.isHidden = (data.data?.count ?? 0) == 0 |
| | | self?.couponModels = data.data ?? [] |
| | | self?.label_couponInfo.isHidden = (data.data?.count ?? 0) == 0 |
| | | |
| | | self?.label_couponInfo.text = String(format: "(%ld张可用)",data.data?.count ?? 0) |
| | | //重新获取优惠券,在切换套餐时触发 |
| | | if let selectCoupon = self?.selectCouponModel{ |
| | | if !weakSelf.couponModels.contains(where: {$0.id == selectCoupon.id}){ |