杨锴
2025-05-11 7453d2d0cef415b34323d1b91e6cfa4a6ba31178
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//
//  MeQRCodeVC.swift
//  WanPai
//
//  Created by 无故事王国 on 2024/2/26.
//
 
import UIKit
import JQTools
 
class MeQRCodeVC: BaseVC {
 
                @IBOutlet weak var tableView: UITableView!
                @IBOutlet weak var label_content: UILabel!
                private let viewModel = ActivityStudentViewModel()
 
                override func viewDidLoad() {
                                super.viewDidLoad()
                                title = "我的二维码"
 
 
                                Services.queryProtocol(.useStore, progress: false).subscribe(onNext: {[weak self] text in
                                                self?.label_content.attributedText = AttributedStringbuilder.build().add(string: (text.data ?? ""), withFont: .systemFont(ofSize: 14, weight: .medium), withColor: .black.withAlphaComponent(0.6), lineSpace: 5).mutableAttributedString
                                }).disposed(by: disposeBag)
                }
 
                override func setUI() {
                                viewModel.isAuth.accept(1)
                                tableView.delegate = self
                                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) {
                                let model = viewModel.dataSource.value[indexPath.row]
                                if let qrCode = WorldCupUserInfoQRCodel(id: model.id, isStudent: model.isStudent).toJSONString(){
                                                QRWithTitlePreview.show(qrCode,title: model.name)
                                }
                }
 
                func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
                                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.activityDetailPartModel = model
                                return cell
                }
 
                func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
                                return 90
                }
}