| | |
| | | import UIKit |
| | | import QMUIKit |
| | | import JQTools |
| | | import RxRelay |
| | | |
| | | class WorldCupHeaderVC: BaseVC { |
| | | |
| | |
| | | @IBOutlet weak var label_loseNum: UILabel! |
| | | @IBOutlet weak var label_winRate: UILabel! |
| | | |
| | | var currentPartModel:ActivityDetailPartModel?{ |
| | | didSet{ |
| | | if let m = currentPartModel{ |
| | | label_name.text = m.name |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: m.id, isStudent: m.isStudent).toJSONString(){ |
| | | img_QR.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 76) |
| | | } |
| | | getData(id: m.id, isStudent: m.isStudent) |
| | | } |
| | | // var currentPartModel:ActivityDetailPartModel?{ |
| | | // didSet{ |
| | | // if let m = currentPartModel{ |
| | | // label_name.text = m.name |
| | | // if let qrCode = WorldCupUserInfoQRCodel(id: m.id, isStudent: m.isStudent).toJSONString(){ |
| | | // img_QR.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 76) |
| | | // } |
| | | // getData(id: m.id, isStudent: m.isStudent) |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | |
| | | } |
| | | } |
| | | var partModel:BehaviorRelay<ActivityDetailPartModel?>? |
| | | |
| | | var partModels = [ActivityDetailPartModel](){ |
| | | didSet{ |
| | | btn_exchange.isHidden = partModels.count <= 1 |
| | |
| | | |
| | | setProvince(rank: 0) |
| | | setCity(cityName: "", rank: 0) |
| | | } |
| | | |
| | | override func setRx() { |
| | | partModel?.subscribe(onNext: {[weak self]model in |
| | | if let m = model{ |
| | | self?.label_name.text = m.name |
| | | if let qrCode = WorldCupUserInfoQRCodel(id: m.id, isStudent: m.isStudent).toJSONString(){ |
| | | self?.img_QR.image = UIImage.jq_GenerateQRCode(with: "\(qrCode)", width: 76) |
| | | } |
| | | self?.getData(id: m.id, isStudent: m.isStudent) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func getData(id:Int,isStudent:Int){ |
| | |
| | | |
| | | @IBAction func exchangeAction(_ sender: Any) { |
| | | |
| | | StudentChoose2View.show { items in |
| | | |
| | | StudentChoose2View.show {[weak self] item in |
| | | self?.partModel?.accept(item) |
| | | } |
| | | } |
| | | } |