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"]
} }
} }
...@@ -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