| | |
| | | // |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | |
| | | class MeQRCodeVC: BaseVC { |
| | | |
| | | @IBOutlet weak var tableView: UITableView! |
| | | @IBOutlet weak var label_content: UILabel! |
| | | private let viewModel = StudentExchangeViewModel() |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "我的二维码" |
| | | |
| | | Services.queryProtocol(.matchStore, progress: false).subscribe(onNext: {[weak self] text in |
| | | self?.label_content.text = (text.data ?? "").jq_filterFromHTML_1() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.register(UINib(nibName: "MyQRCodeTCell", bundle: nil), forCellReuseIdentifier: "_MyQRCodeTCell") |
| | | viewModel.configure(tableView,needMore: false) |
| | | viewModel.beginRefresh() |
| | | } |
| | | } |
| | | |
| | | extension MeQRCodeVC:UITableViewDelegate,UITableViewDataSource{ |
| | | |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | QRPreview.show("123") |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | QRPreview.show("\(model.stuId)") |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | return 2 |
| | | return viewModel.dataSource.value.count |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | let model = viewModel.dataSource.value[indexPath.row] |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_MyQRCodeTCell") as! MyQRCodeTCell |
| | | cell.studentProfile1Model = model |
| | | return cell |
| | | } |
| | | |