| | |
| | | title = "课程详情" |
| | | |
| | | if let m = detailModel{ |
| | | img_cover.sd_setImage(with: URL(string: m.coverDrawing)) |
| | | img_cover.sd_setImage(with: URL(string: m.storeCoverDrawing)) |
| | | label_title.text = m.name |
| | | label_listenWeek.text = "每" + m.weeks.joined(separator: "、") |
| | | label_listenTime.text = m.times.joined(separator: "|") |
| | |
| | | case .vocation: |
| | | label_vaild.text = m.time |
| | | view_vaildTime.isHidden = false |
| | | view_packageList.isHidden = true |
| | | case .experience: |
| | | label_vaild.text = "购买当天有效" |
| | | view_vaildTime.isHidden = false |
| | |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe {[weak self] noti in |
| | | guard let weakSelf = self else { return } |
| | | //重新唤起添加学生 |
| | | weakSelf.studentAction(weakSelf.btn_addStudent) |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func couponAction(_ sender: TapBtn) { |
| | | CouponChooseView.show(couponModels,defaultModel: selectCouponModel) {[weak self] m in |
| | |
| | | cell.studentModel = studentModels[indexPath.row] |
| | | cell.deleClouse = { [weak self] index in |
| | | guard let weakSelf = self else { return } |
| | | tableView.beginUpdates() |
| | | weakSelf.studentModels.remove(at: index) |
| | | tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .right) |
| | | tableView.endUpdates() |
| | | weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87) |
| | | tableView.reloadData() |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | if weakSelf.studentModels.count > 1{ |
| | | tableView.beginUpdates() |
| | | weakSelf.studentModels.remove(at: index) |
| | | tableView.deleteRows(at: [IndexPath(row: index, section: 0)], with: .right) |
| | | tableView.endUpdates() |
| | | weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87) |
| | | tableView.reloadData() |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | }else{ |
| | | alert(msg: "至少选择一位学员") |
| | | } |
| | | |
| | | } |
| | | return cell |
| | | } |