Commit ca5b8bb8 authored by lujunye's avatar lujunye

供应商列表系列完成

parent eaec96f5
......@@ -13,14 +13,25 @@ import Photos
protocol GYSGLViewControllerDelegate {
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) {
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,
"ven_name":gysName as Any,
"province":provinceIndex as Any,
"city":cityIndex as Any,
"district":areaIndex as Any,
"province":proDict["area_id"] as Any,
"city":cityDict["area_id"] as Any,
"district":areaDict["area_id"] as Any,
"address":detailDzStr as Any,
"contacts_name":nameStr as Any,
"contacts_phone":telNum as Any,
......@@ -121,7 +132,7 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
listView.register(UINib(nibName: "TitleAndTFCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFCell")
listView.register(UINib(nibName: "TitleAndOnlyBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndOnlyBtnCell")
listView.register(UINib(nibName: "TitleAndTFAndBtnCell", bundle: nil), forCellReuseIdentifier: "TitleAndTFAndBtnCell")
}
let titleArr = ["基本信息","联系人信息","其它信息"]
//MARK: - cell delegate
......@@ -186,6 +197,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFAndBtnCell") as! TitleAndTFAndBtnCell
cell.titleLbl.text = sec1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row]
cell.textTF.delegate = self
cell.textTF.tag = 2
if barT.contains("编辑"){
cell.textTF.clearButtonMode = .always
}else{
......@@ -200,6 +213,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFCell") as! TitleAndTFCell
cell.nameLbl.text = sec1Arr[indexPath.row]
cell.textTF.placeholder = hold1Arr[indexPath.row]
cell.textTF.delegate = self
cell.textTF.tag = indexPath.row
if indexPath.row == 0 {
if barT.contains("编辑"){
cell.textTF.clearButtonMode = .always
......@@ -225,6 +240,8 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
}else{
cell.textTF.clearButtonMode = .whileEditing
}
cell.textTF.delegate = self
cell.textTF.tag = indexPath.row + 100
switch indexPath.row {
case 0:
if nameStr.count > 0 {
......@@ -636,6 +653,10 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
HUD.flash(.label("请填写手机号码"), delay: 1.2)
return
}
if isTelNumber(num: phoneNum as NSString) == false{
HUD.flash(.label("请填写正确的手机号码"), delay: 1.2)
return
}
if zhizhao.count == 0 {
HUD.flash(.label("请上传营业资格证"), delay: 1.2)
return
......@@ -657,4 +678,31 @@ class GYSGLViewController: BaseViewController,UITableViewDelegate,UITableViewDat
}
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