| | |
| | | self?.bannerView.setItems(items: items) |
| | | self?.label_title.text = model.name |
| | | self?.label_hot.text = "\(model.heat)" |
| | | self?.label_duetime.text = model.registrationClosingTime |
| | | if model.registrationClosingTime == nil{ |
| | | self?.label_duetime.text = "无截止时间" |
| | | }else{ |
| | | self?.label_duetime.text = model.registrationClosingTime |
| | | } |
| | | |
| | | self?.label_starttime.text = model.startTime |
| | | self?.label_endtime.text = model.endTime |
| | | self?.label_ageScope.text = model.age + "岁" |
| | |
| | | self?.label_joinCondition.text = "仅限女生" |
| | | } |
| | | self?.label_introducion.text = model.intro |
| | | self?.label_money.text = "¥\(model.unitPrice.jq_formatFloat)/人" |
| | | self?.label_money_total.text = String(format: "合计:¥%.2f", model.expense) |
| | | |
| | | |
| | | switch model.payType { |
| | | case .aliPay,.wechat: |
| | | self?.label_money.text = "¥\(model.unitPrice.jq_formatFloat)/人" |
| | | self?.label_money_total.text = String(format: "合计:¥%.2f", model.expense) |
| | | case .coin: |
| | | self?.label_money.text = "\(model.unitPrice.jq_formatFloat) 玩湃币/人" |
| | | self?.label_money_total.text = String(format: "合计:%.2f 玩湃币", model.expense) |
| | | case .courseNum: |
| | | self?.label_money.text = "\(model.unitPrice.jq_formatFloat) 课时/人" |
| | | self?.label_money_total.text = String(format: "合计:%.2f 课时", model.expense) |
| | | case .free: |
| | | self?.label_money.text = "免费" |
| | | self?.label_money_total.text = "免费" |
| | | default: |
| | | self?.label_money.text = "未知" |
| | | self?.label_money_total.text = "未知" |
| | | } |
| | | |
| | | |
| | | self?.label_address.text = model.address |
| | | self?.label_city.text = "" |
| | | self?.label_city.text = [model.province,model.city].joined(separator: "|") |
| | | self?.label_matchStore.text = model.storeInfos.map({$0.name}).joined(separator: "、") |
| | | self?.btn_moreMatchStore.isHidden = model.storeInfos.count == 1 |
| | | self?.tableView.reloadData() |
| | |
| | | self?.btn_cancel.isHidden = model.revocable == 0 |
| | | self?.cons__cancelBtnHei.constant = model.revocable == 0 ? 0:40 |
| | | |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(model.registrationClosingTime, "yyyy-MM-dd HH:mm") |
| | | if endDateTimeInterval < Date().timeIntervalSince1970{ |
| | | self?.btn_enroll.setTitle("报名已截止", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | |
| | | switch model.status { |
| | | case .cancel: |
| | | self?.btn_enroll.setTitle("已取消", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | case .over: |
| | | self?.btn_enroll.setTitle("已结束", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | default:break |
| | | } |
| | | |
| | | if let endDate = model.registrationClosingTime{ |
| | | let endDateTimeInterval = Date.jq_StringToTimeInterval(endDate, "yyyy-MM-dd HH:mm") |
| | | |
| | | if Date.jq_CalByDays(startDate: Date(), endDate: Date(timeIntervalSince1970: endDateTimeInterval)) <= 1{ |
| | | self?.btn_enroll.setTitle("取消", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | } |
| | | |
| | | |
| | | if endDateTimeInterval < Date().timeIntervalSince1970{ |
| | | self?.btn_enroll.setTitle("报名已截止", for: .normal) |
| | | self?.btn_enroll.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | self?.btn_enroll.isEnabled = false |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | |
| | | let text = detailModel.storeInfos.map({$0.name}).joined(separator: "、") |
| | | AgreentView.show(type: .matchPoint, content: text) |
| | | } |
| | | |
| | | @IBAction func cancelAction(_ sender: UIButton) { |
| | | guard let m = detailModel else { return } |
| | | CommonAlertView.show(title: "提示", content: "是否确认取消?") {[weak self] state in |
| | | guard let weakSelf = self else { return } |
| | | if state{ |
| | | Services.cancelMyWorldCup(id: m.id).subscribe(onNext: { data in |
| | | sender.setTitle("已取消", for: .normal) |
| | | sender.backgroundColor = .gray.withAlphaComponent(0.5) |
| | | sender.isEnabled = false |
| | | NotificationCenter.default.post(name: WorldCupRefresh_Noti, object: nil) |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension WorldCupContentDetailVC:UITableViewDelegate{ |