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

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

parent 6f53c7b0
......@@ -220,5 +220,7 @@
<string>Order/confirmReceiving</string>
<key>商品上下/架</key>
<string>Goods/onOff</string>
<key>下运单收发地址信息</key>
<string>Logistics/getAddr</string>
</dict>
</plist>
......@@ -60,7 +60,7 @@ consignee 联系人
is_send_default 是否默发收货地址,1是0非
*/
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)
}) { (error) in
......
......@@ -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 {
var mobile:String? //联系方式
var is_default:Int?
var addr_cn:String? //联系人详细地址
var addr_name:String? ////完整地址信息(下单收发货才有)
required init?( map: Map) {
}
......@@ -53,5 +54,7 @@ class GetAddrsInfoDataModel: Mappable {
mobile <- map["mobile"]
is_default <- map["is_default"]
addr_cn <- map["addr_cn"]
addr_name <- map["addr_name"]
}
}
......@@ -9,7 +9,7 @@
import UIKit
import SwiftyJSON
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{
var address_id:Int?
......@@ -18,7 +18,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
if sender.tag == 999 {
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)
}) { (error) in
......@@ -64,7 +64,7 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
"is_send_default":send_default as Any,
]
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)
HUD.hide()
}) { (error) in
......@@ -87,7 +87,8 @@ class XinZengDiZhiViewController: BaseViewController,UITableViewDelegate,UITable
"is_send_default":send_default as Any,
]
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)
HUD.hide()
}) { (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