无故事王国
2023-10-12 d587fb260c6118de4707c35a1e312af6a4cfd28c
WanPai/Root/Course/VC/AddStudentVC.swift
@@ -89,6 +89,7 @@
        guard !tf_name.text!.isEmpty else {alertError(msg: tf_name.placeholder!);return}
        guard !tf_birthday.text!.isEmpty else {alertError(msg: "请选择生日");return}
      guard !tf_gender.text!.isEmpty else {alertError(msg: "请选择性别");return}
        guard !tf_height.text!.isEmpty else {alertError(msg: tf_height.placeholder!);return}
        guard !tf_weight.text!.isEmpty else {alertError(msg: tf_weight.placeholder!);return}
        guard tf_height.text != "0" else {alertError(msg: "请输入正确的身高");return}
@@ -163,6 +164,7 @@
extension AddStudentVC:UITextFieldDelegate{
    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        if textField == tf_birthday{
         view.endEditing(true)
            CommonDatePickerView.show(before: 18, after: 0, type: .YMD) { year, month, day,_,_ in
                textField.text = String(format: "%ld-%02ld-%02ld", year!,month!,day!)
            }