|
@@ -43,7 +43,13 @@ class ShoppingCartOrderPayView: BaseView {
|
|
|
didSet {
|
|
|
if self.deliverType == "1" {
|
|
|
let addr: SelfMentionAddressModel = SelfMentionAddressModel.getModel()!
|
|
|
- selfAddressLabel.text = "\(addr.cityName ?? "")\(addr.address ?? "")"
|
|
|
+ selfAddressLabel.text = "\(addr.address ?? "")"
|
|
|
+ } else {
|
|
|
+ selfAddressView.isHidden = true
|
|
|
+ tableView.snp.remakeConstraints { (make) in
|
|
|
+ make.top.left.right.equalToSuperview()
|
|
|
+ make.bottom.equalTo(accountView.snp_top)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -57,8 +63,8 @@ class ShoppingCartOrderPayView: BaseView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 自提地址信息Mdl
|
|
|
- var selfAddressInfoMdl: DefaultContactInfoModel? {
|
|
|
+ // 自提联系人信息Mdl
|
|
|
+ var selfAddressInfoMdl: SelfMentionContactsModel? {
|
|
|
didSet {
|
|
|
if selfAddressInfoMdl != nil {
|
|
|
tableView.reloadData()
|
|
@@ -66,6 +72,15 @@ class ShoppingCartOrderPayView: BaseView {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 自提地址信息Mdl
|
|
|
+ var selfAddrMdl: SelfAddresModel? {
|
|
|
+ didSet {
|
|
|
+ if selfAddrMdl != nil {
|
|
|
+ tableView.reloadData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
override func setupViews() {
|
|
|
self.backgroundColor = kf7f8faColor
|
|
|
addSubview(accountView)
|
|
@@ -98,7 +113,7 @@ class ShoppingCartOrderPayView: BaseView {
|
|
|
}
|
|
|
|
|
|
tableView.snp.makeConstraints { (make) in
|
|
|
- make.edges.equalToSuperview()
|
|
|
+ make.top.left.right.equalToSuperview()
|
|
|
make.bottom.equalTo(selfAddressView.snp_top)
|
|
|
}
|
|
|
}
|
|
@@ -115,10 +130,9 @@ class ShoppingCartOrderPayView: BaseView {
|
|
|
// 自提
|
|
|
paraMdl.name = self?.selfAddressInfoMdl?.name
|
|
|
paraMdl.mobile = Int(self?.selfAddressInfoMdl?.mobile ?? "")
|
|
|
- paraMdl.address = ""
|
|
|
- // FIXME:待填充
|
|
|
- paraMdl.pickNodeId = 0
|
|
|
- paraMdl.pickNodeContact = ""
|
|
|
+ paraMdl.address = "\(self?.selfAddrMdl?.address ?? "")"
|
|
|
+ paraMdl.pickNodeId = self?.selfAddrMdl?.pickupNodeId
|
|
|
+ paraMdl.pickNodeContact = self?.selfAddrMdl?.managerName
|
|
|
case "2":
|
|
|
// 快递
|
|
|
paraMdl.name = self?.expressAddressMdl?.contactName
|
|
@@ -197,7 +211,7 @@ extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource
|
|
|
switch deliverType {
|
|
|
case "1":
|
|
|
// 自提
|
|
|
- if selfAddressInfoMdl == nil {
|
|
|
+ if selfAddressInfoMdl?.id == nil {
|
|
|
if indexPath.row == 0 {
|
|
|
// 自提添加收货人信息
|
|
|
let cell = OrderPaySelfPickAddInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
@@ -205,7 +219,7 @@ extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource
|
|
|
} else {
|
|
|
// 自提地址信息
|
|
|
let cell = OrderPaySelfPickAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
- cell.selfAddressMdl = SelfMentionAddressModel.getModel()
|
|
|
+ cell.selfAddressMdl = selfAddrMdl
|
|
|
return cell
|
|
|
}
|
|
|
} else {
|
|
@@ -217,7 +231,7 @@ extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource
|
|
|
} else {
|
|
|
// 自提地址信息
|
|
|
let cell = OrderPaySelfPickAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
|
- cell.selfAddressMdl = SelfMentionAddressModel.getModel()
|
|
|
+ cell.selfAddressMdl = selfAddrMdl
|
|
|
return cell
|
|
|
}
|
|
|
}
|
|
@@ -305,7 +319,7 @@ extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource
|
|
|
switch deliverType {
|
|
|
case "1":
|
|
|
// 自提
|
|
|
- if selfAddressInfoMdl == nil {
|
|
|
+ if selfAddressInfoMdl?.id == nil {
|
|
|
if indexPath.row == 0 {
|
|
|
if let jumpNavBlock = self.jumpNavBlock {
|
|
|
jumpNavBlock(WillJumpType.selfAddInfo)
|
|
@@ -328,7 +342,7 @@ extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource
|
|
|
}
|
|
|
case "2":
|
|
|
// 快递
|
|
|
- if expressAddressMdl == nil {
|
|
|
+ if expressAddressMdl?.id == nil {
|
|
|
if let jumpNavBlock = self.jumpNavBlock {
|
|
|
jumpNavBlock(WillJumpType.expressAddInfo)
|
|
|
}
|