| | |
| | | self.models = models |
| | | self.tableView.reloadData() |
| | | } |
| | | }) { [weak self] error in |
| | | guard let weakSelf = self else { return } |
| | | }) { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | | case .Other(_,let string): |
| | | let vc = PaymentResultVC(result: .fail(string), objType: .yard,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | JQ_currentViewController().present(vc, animated: true) |
| | | case .Other(let code,let string): |
| | | let vc = PaymentResultVC(result: .fail(string,code), objType: .yard,handleVC: nil) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | default: |
| | | let vc = PaymentResultVC(result: .fail("支付失败"), objType: .yard,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | JQ_currentViewController().present(vc, animated: true) |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .yard,handleVC: nil) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | }.disposed(by: disposeBag) |
| | |
| | | |
| | | extension PaymentCourseView:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | let model = models[indexPath.row] |
| | | guard model.courseNum != 0 else {return} |
| | | selectIndex = indexPath.row |
| | | tableView.reloadData() |
| | | } |
| | |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_PaymentCourseTCell") as! PaymentCourseTCell |
| | | cell.courseListSubModel = model |
| | | cell.isselect(indexPath.row == selectIndex) |
| | | if model.courseNum == 0{ |
| | | cell.contentView.alpha = 0.3 |
| | | }else{ |
| | | cell.contentView.alpha = 1.0 |
| | | } |
| | | return cell |
| | | } |
| | | |