Commit 0ceeeaff authored by 刘俊宏's avatar 刘俊宏

旧物流下单选择填写地址完成

parent 6f53c7b0
...@@ -220,5 +220,7 @@ ...@@ -220,5 +220,7 @@
<string>Order/confirmReceiving</string> <string>Order/confirmReceiving</string>
<key>商品上下/架</key> <key>商品上下/架</key>
<string>Goods/onOff</string> <string>Goods/onOff</string>
<key>下运单收发地址信息</key>
<string>Logistics/getAddr</string>
</dict> </dict>
</plist> </plist>
...@@ -60,7 +60,7 @@ consignee 联系人 ...@@ -60,7 +60,7 @@ consignee 联系人
is_send_default 是否默发收货地址,1是0非 is_send_default 是否默发收货地址,1是0非
*/ */
func AddAddress(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) { func AddAddress(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("新增地址", params, { (rep:DataResponse<AddAddressDataModel>) in NetworkRequest.sharedInstance.postRequest("新增地址", params, { (rep:DataResponse<AddAddressModel>) in
}, success: { (data) in }, success: { (data) in
success(data) success(data)
}) { (error) in }) { (error) in
......
...@@ -81,3 +81,16 @@ func logisticsOrderDetails(_ params:[String:Any],success:@escaping (_ res:Any)-> ...@@ -81,3 +81,16 @@ func logisticsOrderDetails(_ params:[String:Any],success:@escaping (_ res:Any)->
} }
} }
//MARK:-- 下运单收发地址信息
/*
user_token 验证token
*/
func getAddr(_ params:[String:Any],success:@escaping (_ res:Any)->(),failture:@escaping(_ error:Error)->()) {
NetworkRequest.sharedInstance.postRequest("下运单收发地址信息", params, { (rep:DataResponse<GetAddrsInfoModel>) in
}, success: { (data) in
success(data)
}) { (error) in
failture(error)
}
}
...@@ -37,7 +37,8 @@ class GetAddrsInfoDataModel: Mappable { ...@@ -37,7 +37,8 @@ class GetAddrsInfoDataModel: Mappable {
var mobile:String? //联系方式 var mobile:String? //联系方式
var is_default:Int? var is_default:Int?
var addr_cn:String? //联系人详细地址 var addr_cn:String? //联系人详细地址
var addr_name:String? ////完整地址信息(下单收发货才有)
required init?( map: Map) { required init?( map: Map) {
} }
...@@ -53,5 +54,7 @@ class GetAddrsInfoDataModel: Mappable { ...@@ -53,5 +54,7 @@ class GetAddrsInfoDataModel: Mappable {
mobile <- map["mobile"] mobile <- map["mobile"]
is_default <- map["is_default"] is_default <- map["is_default"]
addr_cn <- map["addr_cn"] addr_cn <- map["addr_cn"]
addr_name <- map["addr_name"]
} }
} }
...@@ -11,39 +11,70 @@ import WebKit ...@@ -11,39 +11,70 @@ import WebKit
class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate{ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,JiTuoWuXinXiViewDelegate,JiPaiFangShiViewControllerDelegate,ZengZhiServicesViewControllerDelegate,AdressSelectCellDelegate,DZGLViewControllerDelegate,XinZengDiZhiViewControllerDelegate{
var sender:String? var sender:String?
var sendPhone:String? var sendPhone:String?
var sendAdr:String? var sendAdr:String?
var sendAddressModel:AddAddressDataModel?
var sendAddressSelectModel:GetAddrsInfoDataModel?
var isSelectSendAddressModel = false
var receiver:String? var receiver:String?
var receivePhone:String? var receivePhone:String?
var receiveAdr:String? var receiveAdr:String?
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String) { var receiveAddressModel:AddAddressDataModel?
var receiveAddressSelectModel:GetAddrsInfoDataModel?
var isSelectReceiveAddressModel = false
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String, data: AddAddressDataModel?) {
if isSend { if isSend {
sender = name sender = name
sendPhone = phone sendPhone = phone
sendAdr = adr sendAdr = adr
sendAddressModel = data
isSelectSendAddressModel = false
}else{ }else{
receiver = name receiver = name
receivePhone = phone receivePhone = phone
receiveAdr = adr receiveAdr = adr
receiveAddressModel = data
isSelectReceiveAddressModel = false
} }
listView.reloadData() listView.reloadData()
} }
func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) { func DZGLViewControllerSelect(data: GetAddrsInfoDataModel) {
print("已选的收发货地址\(data.addr_name!)")
if isSend {
sender = data.consignee
sendPhone = data.mobile
sendAdr = data.addr_name
isSelectSendAddressModel = true
sendAddressSelectModel = data
}else{
receiver = data.consignee
receivePhone = data.mobile
receiveAdr = data.addr_name
receiveAddressSelectModel = data
isSelectReceiveAddressModel = true
}
listView.reloadData()
} }
func AdressSelectCellBtnCLick(row: Int) { func AdressSelectCellBtnCLick(row: Int) {
let vc = DZGLViewController() let vc = DZGLViewController()
vc.cus_id = 365 vc.isSelectlogAddress = true
vc.isSelectMotion = true vc.isSelectMotion = true
vc.delegate = self vc.delegate = self
isSend = true
if row == 1 {
isSend = false
}
self.navigationController?.pushViewController(vc, animated: true ) self.navigationController?.pushViewController(vc, animated: true )
} }
var isSend = true var isSend = true
...@@ -108,58 +139,17 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -108,58 +139,17 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let vc = XiaDanChengGongViewController() let vc = XiaDanChengGongViewController()
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
@IBOutlet weak var topBtnView: UIView!
@IBOutlet weak var bottomView: UIView! @IBOutlet weak var bottomView: UIView!
@IBOutlet weak var listView: UITableView! @IBOutlet weak var listView: UITableView!
var locBtn = UIButton()
@IBOutlet weak var hListView: UITableView!
@IBAction func selectAction(_ sender: UIButton) {
if rightBtn == sender {
rightBtn.isSelected = true
leftBtn.isSelected = false
lineV.frame.origin.x = fullScreenWidth * 0.5
hllView.isHidden = false
if fullScreenHeight > 736 {
hBtnViewH.constant = 83
}else{
hBtnViewH.constant = 49
}
}else{
rightBtn.isSelected = false
leftBtn.isSelected = true
lineV.frame.origin.x = 0
hllView.isHidden = true
}
}
@IBOutlet weak var lineV: UIView!
@IBOutlet weak var leftBtn: UIButton!
@IBOutlet weak var hBtnViewH: NSLayoutConstraint!
@IBOutlet weak var hllView: UIView!
@IBOutlet weak var rightBtn: UIButton!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
navbar.title = "运单列表" navbar.title = "运单列表"
self.view.addSubview(navbar) self.view.addSubview(navbar)
listView.snp.makeConstraints { (make) in
locBtn.backgroundColor = UIColor.red make.top.equalTo(NavCGRect.height)
self.view.addSubview(locBtn) make.left.right.equalTo(0)
locBtn.snp_makeConstraints({ (make) in make.bottom.equalTo(bottomView.snp_top)
make.right.equalTo(-15) }
make.centerY.equalTo(navbar.snp_centerY).offset(10)
make.height.equalTo(30)
make.width.equalTo(100)
})
SetTopFrame(view: topBtnView, height: 44)
listView.separatorStyle = .none listView.separatorStyle = .none
listView.register(UINib(nibName: "AdressSelectCell", bundle: nil), forCellReuseIdentifier: "AdressSelect") listView.register(UINib(nibName: "AdressSelectCell", bundle: nil), forCellReuseIdentifier: "AdressSelect")
listView.register(UINib(nibName: "PersonCenterCell", bundle: nil), forCellReuseIdentifier: "PersonCenter") listView.register(UINib(nibName: "PersonCenterCell", bundle: nil), forCellReuseIdentifier: "PersonCenter")
...@@ -308,79 +298,77 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie ...@@ -308,79 +298,77 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
return 49 return 49
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
// if tableView == listView { switch indexPath.section {
switch indexPath.section { case 0:
case 0: let cell = tableView.dequeueReusableCell(withIdentifier: "AdressSelect") as! AdressSelectCell
let cell = tableView.dequeueReusableCell(withIdentifier: "AdressSelect") as! AdressSelectCell cell.titleLbl.text = "寄"
cell.titleLbl.text = "寄"
cell.tag = indexPath.row
cell.tag = indexPath.row cell.delegate = self
cell.delegate = self cell.contentLbl.isHidden = false
cell.contentLbl.isHidden = false cell.contentV.isHidden = true
cell.contentV.isHidden = true if indexPath.row == 0 {
if indexPath.row == 0 { if sender != nil {
if sender != nil { cell.contentLbl.isHidden = true
cell.contentLbl.isHidden = true cell.contentV.isHidden = false
cell.contentV.isHidden = false cell.nameLbl.text = sender!
cell.nameLbl.text = sender! cell.phoneLbl.text = sendPhone!
cell.phoneLbl.text = sendPhone! cell.adrLbl.text = sendAdr!
cell.adrLbl.text = sendAdr!
}
} }
if indexPath.row == 1 { }
cell.titleLbl.backgroundColor = UIColor(named: "企业、预售字体") if indexPath.row == 1 {
cell.titleLbl.text = "收" cell.titleLbl.backgroundColor = UIColor(named: "企业、预售字体")
if receiver != nil { cell.titleLbl.text = "收"
cell.contentLbl.isHidden = true if receiver != nil {
cell.contentV.isHidden = false cell.contentLbl.isHidden = true
cell.nameLbl.text = receiver! cell.contentV.isHidden = false
cell.phoneLbl.text = receivePhone! cell.nameLbl.text = receiver!
cell.adrLbl.text = receiveAdr! cell.phoneLbl.text = receivePhone!
} cell.adrLbl.text = receiveAdr!
} }
return cell }
case 1: return cell
let cell = tableView.dequeueReusableCell(withIdentifier: "PersonCenter") as! PersonCenterCell case 1:
cell.titleLbl.text = titleArr[indexPath.row] let cell = tableView.dequeueReusableCell(withIdentifier: "PersonCenter") as! PersonCenterCell
if indexPath.row == 0 { cell.titleLbl.text = titleArr[indexPath.row]
cell.introLbl.text = "(必填)" if indexPath.row == 0 {
cell.introLbl.textColor = UIColor(named: "蓝色字体颜色") cell.introLbl.text = "(必填)"
cell.introLbl.isHidden = false cell.introLbl.textColor = UIColor(named: "蓝色字体颜色")
if isCheck != nil { cell.introLbl.isHidden = false
cell.contentStr = itemName + "; \(count!)箱; \(weight!)kg" if isCheck != nil {
} cell.contentStr = itemName + "; \(count!)箱; \(weight!)kg"
} }
if indexPath.row == 1 { }
var sendStr = "上门提货" if indexPath.row == 1 {
if send != 0 { var sendStr = "上门提货"
sendStr = "自送到库" if send != 0 {
} sendStr = "自送到库"
var receiveStr = "送货上门"
if receive != 0 {
receiveStr = "到库自取"
}
cell.contentStr = sendStr + "; " + receiveStr
} }
if indexPath.row == 2 { var receiveStr = "送货上门"
cell.introLbl.isHidden = false if receive != 0 {
if price != nil { receiveStr = "到库自取"
cell.contentStr = "报价金额:\(price!)"
}
} }
if indexPath.row == 3 { cell.contentStr = sendStr + "; " + receiveStr
let cell = tableView.dequeueReusableCell(withIdentifier: "WenDu") as! WenDuCell }
cell.titleLbl.text = titleArr[indexPath.row] if indexPath.row == 2 {
return cell cell.introLbl.isHidden = false
if price != nil {
cell.contentStr = "报价金额:\(price!)"
} }
}
if indexPath.row == 3 {
return cell let cell = tableView.dequeueReusableCell(withIdentifier: "WenDu") as! WenDuCell
default: cell.titleLbl.text = titleArr[indexPath.row]
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFBtnCell") as! TitleAndTFBtnCell
cell.nameLbl.text = title2Arr[indexPath.row]
return cell return cell
} }
// }
return cell
default:
let cell = tableView.dequeueReusableCell(withIdentifier: "TitleAndTFBtnCell") as! TitleAndTFBtnCell
cell.nameLbl.text = title2Arr[indexPath.row]
return cell
}
} }
} }
...@@ -13,12 +13,13 @@ protocol DZGLViewControllerDelegate { ...@@ -13,12 +13,13 @@ protocol DZGLViewControllerDelegate {
func DZGLViewControllerSelect(data:GetAddrsInfoDataModel) func DZGLViewControllerSelect(data:GetAddrsInfoDataModel)
} }
class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,SwipeTableViewCellDelegate,UISearchBarDelegate,SearchBarViewDelegate,XinZengDiZhiViewControllerDelegate,GeliAlertViewDelegate{
func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String) { func XinZengDiZhiViewControllerFinishAction(name: String, phone: String, adr: String, data: AddAddressDataModel?) {
listView.mj_header?.beginRefreshing() listView.mj_header?.beginRefreshing()
} }
func sureGeliAlertViewAction(sender: UIButton) { func sureGeliAlertViewAction(sender: UIButton) {
let model = adrArrs[sender.tag] let model = adrArrs[sender.tag]
AddressDel(["user_token":UserToken as Any,"address_id":model.address_id as Any], success: { (data) in AddressDel(["user_token":UserToken as Any,"address_id":model.address_id as Any], success: { (data) in
self.listView.mj_header?.beginRefreshing() self.listView.mj_header?.beginRefreshing()
...@@ -27,8 +28,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -27,8 +28,8 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
} }
let UserToken = UserDefaults.standard.value(forKey: "user_token") let UserToken = UserDefaults.standard.value(forKey: "user_token")
//MARK:--搜索模块 //MARK:--搜索模块
//MAKR:--调起搜索后添加个蒙版本 //MAKR:--调起搜索后添加个蒙版本
...@@ -85,7 +86,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -85,7 +86,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
var isSelectMotion = false var isSelectMotion = false
var selectIdx:IndexPath? var selectIdx:IndexPath?
var adrInfo:GetAddrsInfoModel? var adrInfo:GetAddrsInfoModel?
var isSelectlogAddress = false
//列表 //列表
var adrArrs:Array<AddressListDataModel> = [] var adrArrs:Array<AddressListDataModel> = []
...@@ -109,11 +110,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -109,11 +110,10 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
super.viewDidLoad() super.viewDidLoad()
navbar.title = "地址管理" navbar.title = "地址管理"
self.view.addSubview(navbar) self.view.addSubview(navbar)
if isSelectlogAddress {
if cus_id != nil {
HUD.flash(.progress) HUD.flash(.progress)
searchBgH.constant = 0 searchBgH.constant = 0
getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any], success: { (data) in getAddr(["user_token":UserToken as Any], success: { (data) in
self.adrInfo = (data as! GetAddrsInfoModel) self.adrInfo = (data as! GetAddrsInfoModel)
self.listView.reloadData() self.listView.reloadData()
HUD.hide() HUD.hide()
...@@ -121,28 +121,41 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -121,28 +121,41 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
}else{ }else{
//searchbar if cus_id != nil {
let searchBr = SearchBarView.init() HUD.flash(.progress)
self.searchBg.addSubview(searchBr) searchBgH.constant = 0
searchBr.snp.makeConstraints { (make) in getAddrsInfo(["user_token":UserToken as Any,"cus_id":cus_id as Any], success: { (data) in
make.left.right.equalTo(0) self.adrInfo = (data as! GetAddrsInfoModel)
make.centerY.equalToSuperview() self.listView.reloadData()
make.height.equalTo(35) HUD.hide()
}) { (error) in
}
}else{
//searchbar
let searchBr = SearchBarView.init()
self.searchBg.addSubview(searchBr)
searchBr.snp.makeConstraints { (make) in
make.left.right.equalTo(0)
make.centerY.equalToSuperview()
make.height.equalTo(35)
}
searchV = searchBr
searchBr.placeholderStr = "请输入收货人地址"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
navbar.rightTitle = "新增"
searchBgH.constant = 45
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
self.listView!.mj_header = headerMJ
self.listView.mj_header?.beginRefreshing()
} }
searchV = searchBr
searchBr.placeholderStr = "请输入收货人地址"
searchBr.cornerRadius = 35/2.0
searchBr.delegate = self
searchBr.delegateL = self
navbar.rightTitle = "新增"
searchBgH.constant = 45
//下拉刷新相关设置
headerMJ.setRefreshingTarget(self, refreshingAction: #selector(loadData))
self.listView!.mj_header = headerMJ
self.listView.mj_header?.beginRefreshing()
} }
listView.separatorStyle = .none listView.separatorStyle = .none
// SetTopFrameView(view: listView, btmView: btmLbl) // SetTopFrameView(view: listView, btmView: btmLbl)
SetTopFrame(view: searchBg, height: 45) SetTopFrame(view: searchBg, height: 45)
...@@ -170,7 +183,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -170,7 +183,7 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
@objc func loadData(){ @objc func loadData(){
adrArrs.removeAll() adrArrs.removeAll()
AddressList(["user_token":UserToken as Any,"key_word":keyWord], success: { (data) in AddressList(["user_token":UserToken as Any,"key_word":keyWord], success: { (data) in
let model = data as! AddressListModel let model = data as! AddressListModel
...@@ -193,6 +206,11 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -193,6 +206,11 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
self.navigationController?.pushViewController(vc, animated: true) self.navigationController?.pushViewController(vc, animated: true)
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if isSelectlogAddress{
if adrInfo != nil {
return (adrInfo?.data!.count)!
}
}
if cus_id != nil { if cus_id != nil {
if adrInfo != nil { if adrInfo != nil {
return (adrInfo?.data!.count)! return (adrInfo?.data!.count)!
...@@ -200,15 +218,15 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -200,15 +218,15 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
} }
return adrArrs.count return adrArrs.count
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell let cell = tableView.dequeueReusableCell(withIdentifier: "DiZhiGuanLiCell") as! DiZhiGuanLiCell
cell.delegate = self cell.delegate = self
if cus_id != nil {//选择 if isSelectlogAddress {
let model = adrInfo?.data![indexPath.row] let model = adrInfo?.data![indexPath.row]
cell.nameLbl.text = model?.consignee cell.nameLbl.text = model?.consignee
cell.phoneLbl.text = model?.mobile cell.phoneLbl.text = model?.mobile
cell.adrLbl.text = model?.addr_cn cell.adrLbl.text = model?.addr_name
if isSelectMotion == false { if isSelectMotion == false {
cell.btnH.constant = 0 cell.btnH.constant = 0
...@@ -218,40 +236,57 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData ...@@ -218,40 +236,57 @@ class DZGLViewController: BaseViewController,UITableViewDelegate,UITableViewData
cell.btn.isSelected = true cell.btn.isSelected = true
} }
} }
}else{//列表 }else{
if adrArrs.count > 0 { if cus_id != nil {//选择
let model = adrArrs[indexPath.row] let model = adrInfo?.data![indexPath.row]
cell.nameLbl.text = model.consignee cell.nameLbl.text = model?.consignee
cell.phoneLbl.text = model.mobile cell.phoneLbl.text = model?.mobile
cell.adrLbl.text = model.province_cn! + model.address! cell.adrLbl.text = model?.addr_cn
if model.city_cn != nil {
cell.adrLbl.text = model.province_cn! + model.city_cn! + model.address! if isSelectMotion == false {
if model.district_cn != nil { cell.btnH.constant = 0
cell.adrLbl.text = model.province_cn! + model.city_cn! + model.district_cn! + model.address! cell.xValue.constant = 0
}else{
if indexPath == selectIdx {
cell.btn.isSelected = true
} }
} }
cell.btnH.constant = 0 }else{//列表
cell.xValue.constant = 0 if adrArrs.count > 0 {
cell.blueLbl.isHidden = true let model = adrArrs[indexPath.row]
cell.yellowLbl.isHidden = true cell.nameLbl.text = model.consignee
cell.phoneLbl.text = model.mobile
if model.is_default == 1 { cell.adrLbl.text = model.province_cn! + model.address!
cell.yellowLbl.isHidden = false if model.city_cn != nil {
cell.adrLbl.text = model.province_cn! + model.city_cn! + model.address!
if model.district_cn != nil {
cell.adrLbl.text = model.province_cn! + model.city_cn! + model.district_cn! + model.address!
}
}
cell.btnH.constant = 0
cell.xValue.constant = 0
cell.blueLbl.isHidden = true cell.blueLbl.isHidden = true
cell.yellowLblLeft.constant = -18
}
if model.is_send_default == 1 {
cell.blueLbl.isHidden = false
cell.yellowLbl.isHidden = true cell.yellowLbl.isHidden = true
if model.is_default == 1 {
cell.yellowLbl.isHidden = false
cell.blueLbl.isHidden = true
cell.yellowLblLeft.constant = -18
}
if model.is_send_default == 1 {
cell.blueLbl.isHidden = false
cell.yellowLbl.isHidden = true
}
if (model.is_send_default == 1) && (model.is_default == 1) {
cell.yellowLbl.isHidden = false
cell.blueLbl.isHidden = false
cell.yellowLblLeft.constant = 10
}
} }
if (model.is_send_default == 1) && (model.is_default == 1) {
cell.yellowLbl.isHidden = false
cell.blueLbl.isHidden = false
cell.yellowLblLeft.constant = 10
}
} }
} }
return cell return cell
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
import UIKit import UIKit
import SwiftyJSON import SwiftyJSON
protocol XinZengDiZhiViewControllerDelegate { protocol XinZengDiZhiViewControllerDelegate {
func XinZengDiZhiViewControllerFinishAction(name:String,phone:String,adr:String) func XinZengDiZhiViewControllerFinishAction(name:String,phone:String,adr:String, data: AddAddressDataModel?)
} }
class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate, UIPickerViewDelegate, UIPickerViewDataSource,SJMapViewControllerDelegate,UITextFieldDelegate,TitleAndSwitchCellDelegate,GeliAlertViewDelegate{ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITableViewDataSource,TitleAndTFAndBtnCellDelegate, UIPickerViewDelegate, UIPickerViewDataSource,SJMapViewControllerDelegate,UITextFieldDelegate,TitleAndSwitchCellDelegate,GeliAlertViewDelegate{
var address_id:Int? var address_id:Int?
...@@ -18,7 +18,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -18,7 +18,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
if sender.tag == 999 { if sender.tag == 999 {
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) self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
}) { (error) in }) { (error) in
...@@ -64,7 +64,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -64,7 +64,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
"is_send_default":send_default as Any, "is_send_default":send_default as Any,
] ]
EditAddress(dict, success: { (data) in EditAddress(dict, success: { (data) in
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr) self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: nil)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
HUD.hide() HUD.hide()
}) { (error) in }) { (error) in
...@@ -87,7 +87,8 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable ...@@ -87,7 +87,8 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
"is_send_default":send_default as Any, "is_send_default":send_default as Any,
] ]
AddAddress(dict, success: { (data) in AddAddress(dict, success: { (data) in
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr) let dataModel = data as! AddAddressModel
self.delegate?.XinZengDiZhiViewControllerFinishAction(name: self.nameStr, phone: self.phone, adr: self.adrStr, data: dataModel.data)
self.navigationController?.popViewController(animated: true) self.navigationController?.popViewController(animated: true)
HUD.hide() HUD.hide()
}) { (error) in }) { (error) in
......
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