Преглед изворни кода

自提/退款图片 && 支付--自提选中返回

Chris пре 5 година
родитељ
комит
7bef438ea2

+ 5 - 5
RainbowPlanet/RainbowPlanet/Modules/MineModule/SelfMentionContactsList/ViewController/SelfMentionContactsListViewController.swift

@@ -15,8 +15,8 @@ class SelfMentionContactsListViewController: BaseViewController {
     // 是否由支付订单页面进入
     var isFromOrderPay: Bool = false
     
-    typealias SaveAddressClosure = () -> Void
-    var saveAddressClosure : SaveAddressClosure?
+    typealias SaveContactClosure = (_ contactMdl: SelfMentionContactsModel) -> Void
+    var saveContactClosure : SaveContactClosure?
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -68,6 +68,9 @@ class SelfMentionContactsListViewController: BaseViewController {
         selfMentionContactsListView.didSelectRowClosure = {
             [weak self] indexPath in
             let selfMentionContactsModel = self?.selfMentionContactsModels?[indexPath.row]
+            if let saveContactClosure = self?.saveContactClosure {
+                saveContactClosure(selfMentionContactsModel ?? SelfMentionContactsModel())
+            }
             
             // 当前选中的为默认,不进行请求
             if selfMentionContactsModel?.isDefault == 1 {
@@ -117,9 +120,6 @@ class SelfMentionContactsListViewController: BaseViewController {
         SwiftMoyaNetWorkServiceUser.shared().userSetExpreesContactsDefaultApi(id: id, completion: {
             [weak self] (data) -> (Void) in
             if self!.isFromOrderPay {
-                if let saveAddressClosure = self?.saveAddressClosure {
-                    saveAddressClosure()
-                }
                 self?.navigationController?.popViewController(animated: true)
             } else {
                 self?.userExpreesContactsListApi()

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift

@@ -155,7 +155,11 @@ extension OrderApplyRefundPhotoCell: UICollectionViewDelegateFlowLayout,UICollec
         if imgCount < maxImageCount && indexPath.row == imgCount {
             // 添加图片
             let cell = OrderCommentDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            cell.noteStr = "上传凭证"
+            if imgCount == 0 {
+                cell.noteStr = "上传凭证"
+            } else {
+                cell.noteStr = "\(imgCount)/\(maxImageCount)"
+            }
             return cell
         } else {
             // 展示图片

+ 1 - 7
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentDefaultCollectionCell.swift

@@ -13,12 +13,6 @@ class OrderCommentDefaultCollectionCell: UICollectionViewCell {
     
     let disposeBag = DisposeBag()
     
-    var productSearchModel: ProductSearchModel? {
-        didSet {
-            titleLabel.text = productSearchModel?.saleName
-        }
-    }
-    
     var noteStr: String? {
         didSet {
             titleLabel.text = noteStr
@@ -103,7 +97,7 @@ class OrderCommentDefaultCollectionCell: UICollectionViewCell {
         titleLabel.textColor = k666666Color
         titleLabel.font = kRegularFont12
         titleLabel.textAlignment = .center
-        titleLabel.numberOfLines = 1
+        titleLabel.numberOfLines = 1        
         return titleLabel
     }()
      

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift

@@ -226,7 +226,11 @@ extension OrderCommentTableViewCell: UICollectionViewDelegateFlowLayout,UICollec
         if imgCount < maxImageCount && indexPath.row == imgCount {
             // 添加图片
             let aCell = OrderCommentDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            aCell.noteStr = "添加照片"
+            if imgCount == 0 {
+                aCell.noteStr = "添加照片"
+            } else {
+                aCell.noteStr = "\(imgCount)/\(maxImageCount)"
+            }
             return aCell
         } else {
             // 展示图片

+ 3 - 3
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/ViewController/ShoppingCartPayOrderController.swift

@@ -92,9 +92,9 @@ class ShoppingCartPayOrderController: BaseViewController {
                  :
                 let vc = SelfMentionContactsListViewController()
                 vc.isFromOrderPay = true
-                vc.saveAddressClosure = {
-                    [weak self] () in
-                    self?.setupData()
+                vc.saveContactClosure = {
+                    [weak self] (contactMdl) in
+                    self?.orderPayView.selfAddressInfoMdl = contactMdl
                 }
                 self?.navigationController?.pushViewController(vc, animated: true)
             case WillJumpType.selfAddressInfo: