Commit 66f4791b authored by lujunye's avatar lujunye

31

parent 25b9b284
......@@ -14,12 +14,16 @@ protocol DZGLViewControllerDelegate {
}
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{
@IBOutlet weak var holder_view: UIView!
var is_keHu_list = false
var kehu_adrArr:Array<GetAddrsInfoDataModel> = []
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String, data: AddAddressDataModel?,province_name:String,city_name:String,district_name:String) {
listView.mj_header?.beginRefreshing()
}
func sureGeliAlertViewAction(sender: UIButton) {
let model = adrArrs[sender.tag]
AddressDel(["user_token":UserToken as Any,"address_id":model.address_id as Any], success: { (data) in
self.listView.mj_header?.beginRefreshing()
......@@ -220,6 +224,9 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
self.navigationController?.pushViewController(vc, animated: true)
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if is_keHu_list {
return kehu_adrArr.count
}
if isSelectlogAddress{
if adrInfo != nil {
return (adrInfo?.data!.count)!
......@@ -236,6 +243,17 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
cell.delegate = self
if is_keHu_list {
let model = kehu_adrArr[indexPath.row]
cell.nameLbl.text = model.consignee
cell.phoneLbl.text = model.mobile
cell.adrLbl.text = model.addr_cn
cell.btnH.constant = 0
cell.xValue.constant = 0
cell.blueLbl.isHidden = true
cell.yellowLbl.isHidden = true
return cell
}
if isSelectlogAddress {
let model = adrInfo?.data![indexPath.row]
cell.nameLbl.text = model?.consignee
......@@ -307,6 +325,42 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
print(indexPath.row)
if is_keHu_list {
if kehu_adrArr.count > 0 {
let model = kehu_adrArr[indexPath.row]
let vc = XinZengDiZhiViewController()
vc.delegate = self
vc.navTitle = "编辑地址"
vc.provinceIndex = model.province!
vc.cityIndex = model.city!
vc.areaIndex = model.district!
// vc.address_id = model.address_id!
vc.adrStr = model.address!
vc.nameStr = model.consignee!
vc.phone = model.mobile!
// vc.tel = model.tel!
// vc.zip = model.zipcode!
vc.is_send_default = false
// vc.pcdStr = model.province_cn!
// if model.city_cn != nil {
// vc.pcdStr = model.province_cn! + "-" + model.city_cn!
// if model.district_cn != nil {
// vc.pcdStr = model.province_cn! + "-" + model.city_cn! + "-" + model.district_cn!
// }
// }
// if model.is_send_default == 1 {
// vc.is_send_default = true
// }
vc.is_default = false
if model.is_default == 1 {
vc.is_default = true
}
self.navigationController?.pushViewController(vc, animated: true)
}
return
}
if isSelectMotion == false {
if adrArrs.count > 0 {
let model = adrArrs[indexPath.row]
......
......@@ -35,8 +35,6 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
selectListRecord.append(0)
selectListRecord.append(0)
navbar.title = "客户管理"
self.view.addSubview(navbar)
......
......@@ -186,8 +186,9 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.row == 6 {
print("abc == ")
let vc = DZGLViewController()
vc.is_keHu_list = true
vc.kehu_adrArr = adrArr
self.navigationController?.pushViewController(vc, animated: true )
}
if indexPath.row == 3 {
......
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