Commit ca5b8bb8 authored by lujunye's avatar lujunye

供应商列表系列完成

parent eaec96f5
...@@ -13,14 +13,25 @@ import Photos ...@@ -13,14 +13,25 @@ import Photos
protocol GYSGLViewControllerDelegate { protocol GYSGLViewControllerDelegate {
func GYSGLViewControllerFinish() func GYSGLViewControllerFinish()
} }
class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate,TitleAndOnlyBtnCellDelegate,SJMapViewControllerDelegate, UIPickerViewDelegate, UIPickerViewDataSource,GeliAlertViewDelegate{ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate,TitleAndOnlyBtnCellDelegate,SJMapViewControllerDelegate, UIPickerViewDelegate, UIPickerViewDataSource,GeliAlertViewDelegate,UITextFieldDelegate{
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
HUD.flash(.progress) HUD.flash(.progress)
let proDict = addressArray[provinceIndex] as! Dictionary<String,Any>
var cityDict:Dictionary<String,Any> = Dictionary()
var areaDict:Dictionary<String,Any> = Dictionary()
cityDict["area_id"] = ""
areaDict["area_id"] = ""
if (proDict["city_list"] as! NSArray).count > 0 {
cityDict = (proDict["city_list"] as! NSArray)[cityIndex] as! Dictionary<String, Any>
if (cityDict["district_list"] as! NSArray).count > 0 {
areaDict = (cityDict["district_list"] as! NSArray)[areaIndex] as! Dictionary<String,Any>
}
}
var dict = ["user_token":UserToken as Any, var dict = ["user_token":UserToken as Any,
"ven_name":gysName as Any, "ven_name":gysName as Any,
"province":provinceIndex as Any, "province":proDict["area_id"] as Any,
"city":cityIndex as Any, "city":cityDict["area_id"] as Any,
"district":areaIndex as Any, "district":areaDict["area_id"] as Any,
"address":detailDzStr as Any, "address":detailDzStr as Any,
"contacts_name":nameStr as Any, "contacts_name":nameStr as Any,
"contacts_phone":telNum as Any, "contacts_phone":telNum as Any,
...@@ -186,6 +197,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -186,6 +197,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFAndBtnCell") as! TitleAndTFAndBtnCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFAndBtnCell") as! TitleAndTFAndBtnCell
cell.titleLbl.text = sec1Arr[indexPath.row] cell.titleLbl.text = sec1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row] cell.textTF.placeholder = hold1Arr[indexPath.row]
cell.textTF.delegate = self
cell.textTF.tag = 2
if barT.contains("编辑"){ if barT.contains("编辑"){
cell.textTF.clearButtonMode = .always cell.textTF.clearButtonMode = .always
}else{ }else{
...@@ -200,6 +213,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -200,6 +213,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = sec1Arr[indexPath.row] cell.nameLbl.text = sec1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row] cell.textTF.placeholder = hold1Arr[indexPath.row]
cell.textTF.delegate = self
cell.textTF.tag = indexPath.row
if indexPath.row == 0 { if indexPath.row == 0 {
if barT.contains("编辑"){ if barT.contains("编辑"){
cell.textTF.clearButtonMode = .always cell.textTF.clearButtonMode = .always
...@@ -225,6 +240,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -225,6 +240,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
}else{ }else{
cell.textTF.clearButtonMode = .whileEditing cell.textTF.clearButtonMode = .whileEditing
} }
cell.textTF.delegate = self
cell.textTF.tag = indexPath.row + 100
switch indexPath.row { switch indexPath.row {
case 0: case 0:
if nameStr.count > 0 { if nameStr.count > 0 {
...@@ -636,6 +653,10 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -636,6 +653,10 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
HUD.flash(.label("请填写手机号码"), delay: 1.2) HUD.flash(.label("请填写手机号码"), delay: 1.2)
return return
} }
if isTelNumber(num: phoneNum as NSString) == false{
HUD.flash(.label("请填写正确的手机号码"), delay: 1.2)
return
}
if zhizhao.count == 0 { if zhizhao.count == 0 {
HUD.flash(.label("请上传营业资格证"), delay: 1.2) HUD.flash(.label("请上传营业资格证"), delay: 1.2)
return return
...@@ -657,4 +678,31 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat ...@@ -657,4 +678,31 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
} }
self.view.window?.addSubview(alertView) self.view.window?.addSubview(alertView)
} }
func textFieldDidEndEditing(_ textField: UITextField) {
if textField.text!.containsEmoji {
HUD.flash(.label("输入不可包含表情符号"), delay: 1.2)
return
}
switch textField.tag {
case 0:
gysName = textField.text!
break
case 2:
detailDzStr = textField.text!
break
case 100:
nameStr = textField.text!
break
case 101:
phoneNum = textField.text!
break
case 102:
telNum = textField.text!
break
default:
break
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment