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