//
|
// StudentInfo_5_TCell.swift
|
// WanPai
|
//
|
// Created by 无故事王国 on 2024/3/1.
|
//
|
|
import UIKit
|
import QMUIKit
|
import JQTools
|
|
class StudentInfo_5_TCell: UITableViewCell {
|
|
@IBOutlet weak var btn_delete: UIButton!
|
@IBOutlet weak var btn_edit: UIButton!
|
|
@IBOutlet weak var label_name: UILabel!
|
@IBOutlet weak var label_idCard: UILabel!
|
@IBOutlet weak var label_age: UILabel!
|
@IBOutlet weak var label_phone: UILabel!
|
@IBOutlet weak var view_container: UIView!
|
@IBOutlet weak var btn_verifiy: UIButton!
|
@IBOutlet weak var img_QRCode: UIImageView!
|
|
var indexPath:IndexPath?
|
|
var delClouse:((IndexPath)->Void)?
|
// var editClouse:((IndexPath)->Void)?
|
|
var activityDetailPartModel:ActivityDetailPartModel!{
|
didSet{
|
label_name.text = activityDetailPartModel.name
|
label_idCard.text = activityDetailPartModel.idcard
|
label_age.text = "\(activityDetailPartModel.age)岁"
|
label_phone.text = activityDetailPartModel.phone
|
|
if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){
|
img_QRCode.image = UIImage.jq_GenerateQRCode(with: qrCode, width: 80)
|
}
|
}
|
}
|
|
override func awakeFromNib() {
|
super.awakeFromNib()
|
selectionStyle = .none
|
|
let tap = UITapGestureRecognizer(target: self, action: #selector(showQRAction))
|
img_QRCode.addGestureRecognizer(tap)
|
img_QRCode.isUserInteractionEnabled = true
|
}
|
|
@objc func showQRAction(){
|
if let qrCode = WorldCupUserInfoQRCodel(id: activityDetailPartModel.id, isStudent: activityDetailPartModel.isStudent).toJSONString(){
|
QRWithTitlePreview.show(qrCode,title: activityDetailPartModel.name)
|
}
|
}
|
|
@IBAction func editAction(_ sender: UIButton) {
|
StudentUpdateInfoView.show(activityDetailPartModel,updateUserProfile: true)
|
}
|
|
|
@IBAction func delAction(_ sender: UIButton) {
|
if let index = indexPath{
|
delClouse?(index)
|
}
|
}
|
|
@IBAction func verifyAction(_ sender: UIButton) {
|
let vc = AddStudentVC(type:.worldCup,activityDetailPartModel: activityDetailPartModel,identity: true,identityPhone: true)
|
JQ_currentViewController().jq_push(vc: vc)
|
}
|
|
}
|