Commit c23755ed authored by lujunye's avatar lujunye

34

parent f988f954
...@@ -16,7 +16,11 @@ import IQKeyboardManagerSwift ...@@ -16,7 +16,11 @@ import IQKeyboardManagerSwift
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate,OtherDemandViewControllerDelegate,OnlyViewCellDelegate, XiaDanUserInfoViewControllerDelegate, P_P_H_Time_Select_View_Delegate,P_P_H_Adr_VC_Delegate, Suc_LOG_Cell_Delegate,PaymentViewDelegate{ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate,TitleAndTFBtnCellDelegate,WenDuCellDelegate,LogisticalSelectViewDelegate, UIPickerViewDataSource, UIPickerViewDelegate, GLAlertSelectViewDelegate,CLLocationManagerDelegate, CityListViewControllerDelegate,ToAndFormSelectViewControllerDelegate,WayBillAddressCanDelItemCellDelegate,HLLTopCellDelegate,OtherDemandViewControllerDelegate,OnlyViewCellDelegate, XiaDanUserInfoViewControllerDelegate, P_P_H_Time_Select_View_Delegate,P_P_H_Adr_VC_Delegate, Suc_LOG_Cell_Delegate,PaymentViewDelegate{
func DZGLViewController_adr(adr_id: String) { func DZGLViewController_back(count: Int) {
//此处无用
}
func DZGLViewController_adr(adr_id: String,count:Int) {
//此处无用 //此处无用
} }
......
...@@ -10,7 +10,11 @@ import UIKit ...@@ -10,7 +10,11 @@ import UIKit
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate, GeliAlertViewDelegate,UITextFieldDelegate{ class DaiKeXiaDanGouWuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,DaiKeXiaDanFooterViewDelegate,TitleAndBtnCellDelegate,GLAlertSelectViewDelegate,DZGLViewControllerDelegate,XuanZeShangPinViewControllerDelegate,DaiKeXiaDanGouWuCellDelegate,GuanLianKehuVCDelegate,XiuGaiYuShouJiaViewControllerDelegate,TitleAndTFCellDelegate, GeliAlertViewDelegate,UITextFieldDelegate{
func DZGLViewController_adr(adr_id: String) { func DZGLViewController_back(count: Int) {
//此处无用
}
func DZGLViewController_adr(adr_id: String,count:Int) {
//此处无用 //此处无用
} }
......
...@@ -11,22 +11,33 @@ import SwipeCellKit ...@@ -11,22 +11,33 @@ import SwipeCellKit
import LGButton import LGButton
protocol DZGLViewControllerDelegate { protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:GetAddrsInfoDataModel) func DZGLViewControllerSelect(data:GetAddrsInfoDataModel)
func DZGLViewController_adr(adr_id:String) func DZGLViewController_adr(adr_id:String,count:Int)
func DZGLViewController_back(count:Int)
} }
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{
func XinZengDiZhiViewControllerFinishAction_kehu(adr_id: String) { func XinZengDiZhiViewControllerFinishAction_kehu(adr_id: String) {
if adr_id.count > 0 { if adr_id.count > 0 {
address_id_arr.append(adr_id) address_id_arr.append(adr_id)
listView.mj_header?.beginRefreshing()
if address_id_arr.count > 1 { if address_id_arr.count > 1 {
delegate?.DZGLViewController_adr(adr_id: address_id_arr.joined(separator: ",")) delegate?.DZGLViewController_adr(adr_id: address_id_arr.joined(separator: ","),count: kehu_adrArr.count)
print("jcount = ",kehu_adrArr.count)
}else{ }else{
delegate?.DZGLViewController_adr(adr_id: adr_id) listView.mj_header?.beginRefreshing()
delegate?.DZGLViewController_adr(adr_id: adr_id,count: kehu_adrArr.count)
print("jcount1 = ",kehu_adrArr.count)
} }
}else{
delegate?.DZGLViewController_adr(adr_id: adr_id,count: kehu_adrArr.count)
print("jcount12 = ",kehu_adrArr.count)
listView.mj_header?.beginRefreshing()
} }
listView.mj_header?.beginRefreshing()
} }
@IBOutlet weak var holder_view: UIView! @IBOutlet weak var holder_view: UIView!
...@@ -251,7 +262,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -251,7 +262,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
} }
override func backAction() {
delegate?.DZGLViewController_back(count: kehu_adrArr.count)
self.navigationController?.popViewController(animated: true)
}
func rightBtnClick() { func rightBtnClick() {
let vc = XinZengDiZhiViewController() let vc = XinZengDiZhiViewController()
vc.navTitle = "新增地址" vc.navTitle = "新增地址"
......
...@@ -28,7 +28,6 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -28,7 +28,6 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
} failture: { err in } failture: { err in
} }
}else{ }else{
AddressDel(["user_token":UserToken as Any,"address_id":address_id as Any], success: { (data) in AddressDel(["user_token":UserToken as Any,"address_id":address_id as Any], success: { (data) in
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil,province_name:"",city_name:"",district_name:"") self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil,province_name:"",city_name:"",district_name:"")
......
...@@ -29,7 +29,10 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView ...@@ -29,7 +29,10 @@ class KeHuListViewController: BaseViewController,UITableViewDelegate,UITableView
@IBOutlet weak var rightSelectView: UITableView! @IBOutlet weak var rightSelectView: UITableView!
var selectListRecord:Array<Int> = [] var selectListRecord:Array<Int> = []
// override func viewWillAppear(_ animated: Bool) {
// super.viewWillAppear(animated)
//
// }
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
selectListRecord.append(0) selectListRecord.append(0)
......
...@@ -12,13 +12,19 @@ protocol XinZengAndBianJiKeHuViewControllerDelegate { ...@@ -12,13 +12,19 @@ protocol XinZengAndBianJiKeHuViewControllerDelegate {
func XinZengAndBianJiKeHuViewControllerFinish() func XinZengAndBianJiKeHuViewControllerFinish()
} }
class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,BingDingKeHuViewControllerDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate,GeliAlertViewDelegate, DZGLViewControllerDelegate{ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSource,UITableViewDelegate,BingDingKeHuViewControllerDelegate,GLAlertSelectViewDelegate,UITextFieldDelegate,GeliAlertViewDelegate, DZGLViewControllerDelegate{
var count = 0
func DZGLViewController_back(count: Int) {
print("count =",count)
self.count = count
listView.reloadData()
}
func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) { func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) {
//此处无用 //此处无用
} }
func DZGLViewController_adr(adr_id: String) { func DZGLViewController_adr(adr_id: String,count:Int) {
address_id = adr_id address_id = adr_id
print("abc = ",address_id)
} }
var delegate:XinZengAndBianJiKeHuViewControllerDelegate? var delegate:XinZengAndBianJiKeHuViewControllerDelegate?
...@@ -143,8 +149,6 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -143,8 +149,6 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
} }
var adrArr:Array<GetAddrsInfoDataModel> = []
var titleStr:String? var titleStr:String?
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
let titleArr = ["客户名称","客户手机号码 ","客户公司名称","绑定用户","客户类型","客户折扣","客户地址管理"] let titleArr = ["客户名称","客户手机号码 ","客户公司名称","绑定用户","客户类型","客户折扣","客户地址管理"]
...@@ -173,11 +177,8 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -173,11 +177,8 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
listView.register(UINib(nibName: "Title_Btn_Cell", bundle: nil), forCellReuseIdentifier: "Title_Btn_Cell") listView.register(UINib(nibName: "Title_Btn_Cell", bundle: nil), forCellReuseIdentifier: "Title_Btn_Cell")
getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any]) { data in getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any]) { data in
self.adrArr.removeAll()
let model = data as! GetAddrsInfoModel let model = data as! GetAddrsInfoModel
model.data?.forEach({ item in self.count = model.data!.count
self.adrArr.append(item)
})
self.listView.reloadData() self.listView.reloadData()
} failture: { err in } failture: { err in
...@@ -196,7 +197,7 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -196,7 +197,7 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
if indexPath.row == 6 { if indexPath.row == 6 {
let vc = DZGLViewController() let vc = DZGLViewController()
vc.is_keHu_list = true vc.is_keHu_list = true
// vc.kehu_adrArr = adrArr
vc.cus_id = cus_id vc.cus_id = cus_id
print("vc.cus = ",vc.cus_id) print("vc.cus = ",vc.cus_id)
vc.delegate = self vc.delegate = self
...@@ -264,9 +265,12 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour ...@@ -264,9 +265,12 @@ class XinZengAndBianJiKeHuViewController: BaseViewController,UITableViewDataSour
if indexPath.row == 6 { if indexPath.row == 6 {
let cell = tableView.dequeueReusableCell(withIdentifier: "Title_Btn_Cell") as! Title_Btn_Cell let cell = tableView.dequeueReusableCell(withIdentifier: "Title_Btn_Cell") as! Title_Btn_Cell
cell.title_lbl.text = titleArr[indexPath.row] cell.title_lbl.text = titleArr[indexPath.row]
if adrArr.count != 0 { if count != 0 {
cell.add_adr_lbl.isHidden = true cell.add_adr_lbl.isHidden = true
cell.arrow_img.isHidden = false cell.arrow_img.isHidden = false
}else{
cell.add_adr_lbl.isHidden = false
cell.arrow_img.isHidden = true
} }
return cell return cell
} }
......
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