| | |
| | | @IBOutlet weak var tf_weight: QMUITextField! |
| | | @IBOutlet weak var tf_phone: QMUITextField! |
| | | @IBOutlet weak var tf_birthday: UITextField! |
| | | @IBOutlet weak var img_idCardSingle: UIImageView! |
| | | |
| | | var profileImg:UIImage? |
| | | |
| | |
| | | var type:ItemType! |
| | | |
| | | var verifyIdCard:Bool = false |
| | | var identity:Bool = false //是否需要实名 |
| | | |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil) { |
| | | init(type:ItemType,studentInfo:StudentProfile1Model? = nil,identity:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = type |
| | | self.studentInfo = studentInfo |
| | | self.identity = identity |
| | | } |
| | | |
| | | init(activityDetailPartModel:ActivityDetailPartModel? = nil) { |
| | | init(type:ItemType,activityDetailPartModel:ActivityDetailPartModel? = nil,identity:Bool = false) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.type = .activity |
| | | self.type = type |
| | | self.activityDetailPartModel = activityDetailPartModel |
| | | self.identity = identity |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | img_idCardSingle.isHidden = !identity |
| | | |
| | | if type == .course{ |
| | | title = "添加运动营成员" |
| | | view_profile.isHidden = false |
| | |
| | | tf_idCard.placeholder = "请输入身份证号" |
| | | if let m = activityDetailPartModel{ |
| | | title = "编辑人员" |
| | | view_profile.isHidden = identity |
| | | tf_name.text = m.name |
| | | tf_idCard.text = m.idcard |
| | | tf_height.text = String(format: "%.0lf", m.height) |
| | |
| | | |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | | if studentInfo == nil{ |
| | | |
| | | if !view_profile.isHidden{ |
| | | guard profileImg != nil else { |
| | | |
| | | if type == .course{ |
| | |
| | | alertError(msg: "请上传人员头像"); |
| | | } |
| | | |
| | | return} |
| | | return |
| | | } |
| | | } |
| | | |
| | | guard !tf_name.text!.isEmpty else {alertError(msg: tf_name.placeholder!);return} |
| | |
| | | guard tf_phone.text!.jq_isPhone else {alertError(msg: "请输入正确的手机号");return} |
| | | } |
| | | |
| | | if !tf_idCard.isEmpty || activityDetailPartModel != nil{ |
| | | if !tf_idCard.isEmpty || identity{ |
| | | guard tf_idCard.text!.jq_idCard() else {alertError(msg: "请输入正确的身份证号码");return} |
| | | } |
| | | |