|
@@ -14,7 +14,6 @@ class EditSelfMentionContactsViewController: BaseViewController {
|
|
|
var saveClosure : SaveClosure?
|
|
|
|
|
|
var selfMentionContactsModel: SelfMentionContactsModel?
|
|
|
- var selfMentionContactsModel1 = SelfMentionContactsModel()
|
|
|
|
|
|
// 是否由支付订单页面进入
|
|
|
var isFromOrderPay: Bool = false
|
|
@@ -50,13 +49,11 @@ class EditSelfMentionContactsViewController: BaseViewController {
|
|
|
editSelfMentionContactsView.selfMentionContactsModel = selfMentionContactsModel
|
|
|
editSelfMentionContactsView.selfMentionContactsClosure = { //赋值
|
|
|
[weak self] (moblie,name) in
|
|
|
- if self?.selfMentionContactsModel != nil {
|
|
|
- self?.selfMentionContactsModel?.mobile = moblie
|
|
|
- self?.selfMentionContactsModel?.name = name
|
|
|
- }else {
|
|
|
- self?.selfMentionContactsModel1.mobile = moblie
|
|
|
- self?.selfMentionContactsModel1.name = name
|
|
|
+ if self?.selfMentionContactsModel == nil {
|
|
|
+ self?.selfMentionContactsModel = SelfMentionContactsModel()
|
|
|
}
|
|
|
+ self?.selfMentionContactsModel?.mobile = moblie
|
|
|
+ self?.selfMentionContactsModel?.name = name
|
|
|
|
|
|
}
|
|
|
editSelfMentionContactsView.deleteClosure = { //删除
|
|
@@ -81,23 +78,12 @@ class EditSelfMentionContactsViewController: BaseViewController {
|
|
|
/// 新增、编辑 自提地址收货人信息
|
|
|
func userSaveExpreesContactsApi() {
|
|
|
|
|
|
- if self.selfMentionContactsModel != nil {
|
|
|
- SwiftMoyaNetWorkServiceUser.shared().userSaveExpreesContactsApi(id: self.selfMentionContactsModel?.id ?? 0 ,mobile: self.selfMentionContactsModel?.mobile ?? "", name: self.selfMentionContactsModel?.name ?? "") {
|
|
|
- [weak self] (data) -> (Void) in
|
|
|
- if self!.isFromOrderPay {
|
|
|
- self?.navigationController?.popViewController(animated: true)
|
|
|
- } else {
|
|
|
- self?.popVC()
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- SwiftMoyaNetWorkServiceUser.shared().userSaveExpreesContactsApi(id: self.selfMentionContactsModel1.id ?? 0 ,mobile: self.selfMentionContactsModel1.mobile ?? "", name: self.selfMentionContactsModel1.name ?? "") {
|
|
|
- [weak self] (data) -> (Void) in
|
|
|
- if self!.isFromOrderPay {
|
|
|
- self?.navigationController?.popViewController(animated: true)
|
|
|
- } else {
|
|
|
- self?.popVC()
|
|
|
- }
|
|
|
+ SwiftMoyaNetWorkServiceUser.shared().userSaveExpreesContactsApi(id: self.selfMentionContactsModel?.id ?? 0 ,mobile: self.selfMentionContactsModel?.mobile ?? "", name: self.selfMentionContactsModel?.name ?? "") {
|
|
|
+ [weak self] (data) -> (Void) in
|
|
|
+ if self!.isFromOrderPay {
|
|
|
+ self?.navigationController?.popViewController(animated: true)
|
|
|
+ } else {
|
|
|
+ self?.popVC()
|
|
|
}
|
|
|
}
|
|
|
|