瀏覽代碼

Merge branch 'develop' into feature/nanxinlin

南鑫林 6 年之前
父節點
當前提交
b98650872f
共有 19 個文件被更改,包括 473 次插入80 次删除
  1. 1 1
      RainbowPlanet/Podfile.lock
  2. 12 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  3. 4 4
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift
  4. 23 6
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundAccountCell.swift
  5. 6 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundNoteInfoCell.swift
  6. 6 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhoneCell.swift
  7. 29 15
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift
  8. 45 11
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundProductCell.swift
  9. 150 7
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift
  10. 7 3
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift
  11. 33 2
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/ViewController/OrderCommentController.swift
  12. 4 2
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift
  13. 28 0
      RainbowPlanet/RainbowPlanet/Service/Model/ConfigModel/ImageUrlModel.swift
  14. 30 0
      RainbowPlanet/RainbowPlanet/Service/Model/OrderModel/OrderApplyRefundModel.swift
  15. 3 0
      RainbowPlanet/RainbowPlanet/Service/Model/OrderModel/OrderListModel.swift
  16. 38 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/OrderCommentParameterModel.swift
  17. 28 13
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift
  18. 23 13
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaServiceConfigApi.swift
  19. 3 3
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceOrder/SwiftMoyaNetWorkServiceOrder.swift

+ 1 - 1
RainbowPlanet/Podfile.lock

@@ -169,4 +169,4 @@ SPEC CHECKSUMS:
 
 PODFILE CHECKSUM: 8367a381fb27c958a744db1b81ae93efe4c465ee
 
-COCOAPODS: 1.6.2
+COCOAPODS: 1.6.1

+ 12 - 0
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -326,7 +326,9 @@
 		BD20F1D32283D0ED00677D8E /* ShoppingCartPaySuccessCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1D22283D0ED00677D8E /* ShoppingCartPaySuccessCell.swift */; };
 		BD20F1D52283D15500677D8E /* ShoppingCartPayFailureCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1D42283D15500677D8E /* ShoppingCartPayFailureCell.swift */; };
 		BD20F1D82283D2AA00677D8E /* ShoppingCartModule.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = BD20F1D72283D2AA00677D8E /* ShoppingCartModule.xcassets */; };
+		BD29A92E228F99780018CFC3 /* OrderCommentParameterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD29A92D228F99780018CFC3 /* OrderCommentParameterModel.swift */; };
 		BD3474F522857B85000908C5 /* CommonPayHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD3474F422857B85000908C5 /* CommonPayHeader.swift */; };
+		BD6EDF48229007EA009A20FE /* OrderApplyRefundModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD6EDF47229007EA009A20FE /* OrderApplyRefundModel.swift */; };
 		BD7AB83622841A8B0030646A /* ShoppingCartPayOrderItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB83522841A8B0030646A /* ShoppingCartPayOrderItemCell.swift */; };
 		BD7AB838228420310030646A /* ShoppingCartPayOrderHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB837228420310030646A /* ShoppingCartPayOrderHeader.swift */; };
 		BD7AB83A2284288D0030646A /* ShoppingCartPayOrderFooter.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8392284288D0030646A /* ShoppingCartPayOrderFooter.swift */; };
@@ -340,6 +342,7 @@
 		BDAA40FB228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */; };
 		BDAA40FD228E9CD600CF841D /* OrderApplyRefundPhoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40FC228E9CD600CF841D /* OrderApplyRefundPhoneCell.swift */; };
 		BDAA40FF228EA37900CF841D /* OrderApplyRefundPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40FE228EA37900CF841D /* OrderApplyRefundPhotoCell.swift */; };
+		BDD22F0B228FAA5B00D43BFB /* ImageUrlModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */; };
 		BDD4FB1222840597006FE833 /* ShoppingCartPayOrderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD4FB1122840597006FE833 /* ShoppingCartPayOrderController.swift */; };
 		BDD4FB1422840954006FE833 /* ShoppingCartOrderPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD4FB1322840954006FE833 /* ShoppingCartOrderPayView.swift */; };
 		BDD4FB1722840DD3006FE833 /* OrderPayAcountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDD4FB1622840DD3006FE833 /* OrderPayAcountView.swift */; };
@@ -718,7 +721,9 @@
 		BD20F1D22283D0ED00677D8E /* ShoppingCartPaySuccessCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPaySuccessCell.swift; sourceTree = "<group>"; };
 		BD20F1D42283D15500677D8E /* ShoppingCartPayFailureCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayFailureCell.swift; sourceTree = "<group>"; };
 		BD20F1D72283D2AA00677D8E /* ShoppingCartModule.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ShoppingCartModule.xcassets; sourceTree = "<group>"; };
+		BD29A92D228F99780018CFC3 /* OrderCommentParameterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCommentParameterModel.swift; sourceTree = "<group>"; };
 		BD3474F422857B85000908C5 /* CommonPayHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayHeader.swift; sourceTree = "<group>"; };
+		BD6EDF47229007EA009A20FE /* OrderApplyRefundModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundModel.swift; sourceTree = "<group>"; };
 		BD7AB83522841A8B0030646A /* ShoppingCartPayOrderItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayOrderItemCell.swift; sourceTree = "<group>"; };
 		BD7AB837228420310030646A /* ShoppingCartPayOrderHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayOrderHeader.swift; sourceTree = "<group>"; };
 		BD7AB8392284288D0030646A /* ShoppingCartPayOrderFooter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayOrderFooter.swift; sourceTree = "<group>"; };
@@ -733,6 +738,7 @@
 		BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundNoteInfoCell.swift; sourceTree = "<group>"; };
 		BDAA40FC228E9CD600CF841D /* OrderApplyRefundPhoneCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundPhoneCell.swift; sourceTree = "<group>"; };
 		BDAA40FE228EA37900CF841D /* OrderApplyRefundPhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundPhotoCell.swift; sourceTree = "<group>"; };
+		BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageUrlModel.swift; sourceTree = "<group>"; };
 		BDD4FB1122840597006FE833 /* ShoppingCartPayOrderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartPayOrderController.swift; sourceTree = "<group>"; };
 		BDD4FB1322840954006FE833 /* ShoppingCartOrderPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartOrderPayView.swift; sourceTree = "<group>"; };
 		BDD4FB1622840DD3006FE833 /* OrderPayAcountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPayAcountView.swift; sourceTree = "<group>"; };
@@ -2208,6 +2214,7 @@
 			children = (
 				A79057052276EA3D0037F823 /* OpenCityListModel.swift */,
 				A757C92F2274839900226355 /* SelfMentionAddressListModel.swift */,
+				BDD22F0A228FAA5B00D43BFB /* ImageUrlModel.swift */,
 			);
 			path = ConfigModel;
 			sourceTree = "<group>";
@@ -2243,6 +2250,7 @@
 				A70B842F228FF6D400882BC5 /* ProductCartCountModel.swift */,
 				A71738AC228AB7B2000AEA6A /* ProductCommentListModel.swift */,
 				BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */,
+				BD29A92D228F99780018CFC3 /* OrderCommentParameterModel.swift */,
 			);
 			path = ProductModel;
 			sourceTree = "<group>";
@@ -2810,6 +2818,7 @@
 				BD1DC6CA228D157000B89C57 /* OrderCreateBackModel.swift */,
 				BD1DC6CC228D160D00B89C57 /* OrderPurchaseModel.swift */,
 				A7FF159B228D9E3C00A85748 /* OrderRefundDetailModel.swift */,
+				BD6EDF47229007EA009A20FE /* OrderApplyRefundModel.swift */,
 			);
 			path = OrderModel;
 			sourceTree = "<group>";
@@ -3426,6 +3435,7 @@
 				BD3474F522857B85000908C5 /* CommonPayHeader.swift in Sources */,
 				A71AF0B6226EF99A001730FE /* SearchResultViewController.swift in Sources */,
 				A757C9302274839900226355 /* SelfMentionAddressListModel.swift in Sources */,
+				BDD22F0B228FAA5B00D43BFB /* ImageUrlModel.swift in Sources */,
 				A72A72D522321E2700B21995 /* ColorMacro.swift in Sources */,
 				A72A7333223256E100B21995 /* PayManager.swift in Sources */,
 				A70B2C6722887B2B00B2449F /* ProductDetailEvaluationListTableViewCell.swift in Sources */,
@@ -3599,6 +3609,7 @@
 				BD7AB838228420310030646A /* ShoppingCartPayOrderHeader.swift in Sources */,
 				A7824B002271F0DD00ABA381 /* EditSelfMentionContactsViewController.swift in Sources */,
 				A7CC751F227190C5003C4F38 /* AccountSecurityViewController.swift in Sources */,
+				BD29A92E228F99780018CFC3 /* OrderCommentParameterModel.swift in Sources */,
 				A7284440224DFACD00F82F30 /* InfoModel.swift in Sources */,
 				A72A72B522321DE000B21995 /* Extension+UITextView.swift in Sources */,
 				BDF47D822282B3D100941AB9 /* ShoppingCartHotSaleTableViewCell.swift in Sources */,
@@ -3613,6 +3624,7 @@
 				A77F2C9C2231FDCF001BD3F6 /* BaseView.swift in Sources */,
 				A7A98E2F228017E2005306E9 /* SwiftMoyaNetWorkServiceCMS.swift in Sources */,
 				A7284A522252EE9A000BAEC4 /* RootModel.swift in Sources */,
+				BD6EDF48229007EA009A20FE /* OrderApplyRefundModel.swift in Sources */,
 				A72A7388223396CB00B21995 /* ApiMacro.swift in Sources */,
 				A72A72B922321DE000B21995 /* Extension+Array.swift in Sources */,
 				A70B2C492288416F00B2449F /* ProductDetailHotSellCollectionViewCell.swift in Sources */,

+ 4 - 4
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift

@@ -168,9 +168,7 @@ extension OrderViewController :JXSegmentedListContainerViewDataSource {
             
         }
         if button.titleLabel?.text == "取消订单" {
-            let vc = OrderApplyRefundController()
-            vc.orderModel = orderModel
-            self.navigationController?.pushViewController(vc, animated: true)
+            
         }
         if button.titleLabel?.text == "确认收货" {
             
@@ -192,7 +190,9 @@ extension OrderViewController :JXSegmentedListContainerViewDataSource {
             self.navigationController?.pushViewController(vc, animated: true)
         }
         if button.titleLabel?.text == "申请退款" {
-            
+            let vc = OrderApplyRefundController()
+            vc.orderDetailModel = orderModel
+            self.navigationController?.pushViewController(vc, animated: true)
         }
     }
 }

+ 23 - 6
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundAccountCell.swift

@@ -13,6 +13,24 @@ class OrderApplyRefundAccountCell: UITableViewCell {
     
     let disposeBag = DisposeBag()
     
+    typealias AllSelectBlock = (_ isAllSelected: Int) -> Void
+    var allSelectBlock : AllSelectBlock?
+    
+    var isAllSelected: Int? {
+        didSet {
+            // 选中状态
+            let selStatus = isAllSelected == 1 ? true : false
+            allSelectBtn.isSelected = selStatus
+        }
+    }
+    
+    // 退款金额
+    var refundPrice: Int? {
+        didSet {
+            priceLabel.text = "退款金额¥\(self.refundPrice ?? 0)"
+        }
+    }
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundAccountCell {
         let ID = "OrderApplyRefundAccountCell"
         tableView.register(OrderApplyRefundAccountCell.self, forCellReuseIdentifier: ID)
@@ -71,11 +89,10 @@ class OrderApplyRefundAccountCell: UITableViewCell {
         allSelectBtn.titleLabel?.font = kRegularFont14
         allSelectBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
             allSelectBtn.isSelected = !allSelectBtn.isSelected
-//            if let allSelectBlock = self?.allSelectBlock {
-//                let isAllSel: Int = allSelectBtn.isSelected == true ? 1 : 0
-//                allSelectBlock(isAllSel)
-//            }
-            print("点击了全选")
+            if let allSelectBlock = self?.allSelectBlock {
+                let isAllSel: Int = allSelectBtn.isSelected == true ? 1 : 0
+                allSelectBlock(isAllSel)
+            }            
         }).disposed(by: disposeBag)
         return allSelectBtn
     }()
@@ -84,7 +101,7 @@ class OrderApplyRefundAccountCell: UITableViewCell {
         let priceLabel = UILabel()
         priceLabel.textColor = k333333Color
         priceLabel.font = kRegularFont14
-        priceLabel.text = "退款金额¥260"
+        priceLabel.text = "退款金额¥0"
 //        let str = "退款金额 ¥xx"
 //        let attributedString = NSMutableAttributedString.init(string: str)
 //        let range = str.range(of: "¥xx")

+ 6 - 0
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundNoteInfoCell.swift

@@ -10,6 +10,12 @@ import UIKit
 
 class OrderApplyRefundNoteInfoCell: UITableViewCell {
     
+    var orderModel: OrderModel? {
+        didSet {
+            noteLabel.text = orderModel?.remark
+        }
+    }
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundNoteInfoCell {
         let ID = "OrderApplyRefundNoteInfoCell"
         tableView.register(OrderApplyRefundNoteInfoCell.self, forCellReuseIdentifier: ID)

+ 6 - 0
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhoneCell.swift

@@ -10,6 +10,12 @@ import UIKit
 
 class OrderApplyRefundPhoneCell: UITableViewCell {
     
+    var orderModel: OrderModel? {
+        didSet {
+            phoneLabel.text = orderModel?.mobile
+        }
+    }
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundPhoneCell {
         let ID = "OrderApplyRefundPhoneCell"
         tableView.register(OrderApplyRefundPhoneCell.self, forCellReuseIdentifier: ID)

+ 29 - 15
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift

@@ -12,15 +12,16 @@ class OrderApplyRefundPhotoCell: UITableViewCell {
     
     private let maxImageCount: Int = 3
     
-    var productMdl : ProductModel? {
-        didSet {
-            
-        }
-    }
+    typealias ChoosePicBlock = () -> Void
+    var choosePicBlock : ChoosePicBlock?
     
-    var imgCount: Int? {
+    typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
+    var delPicTransBlock : DelPicTransBlock?
+    
+    var imgCount: Int = 0
+    var goodsImageArr: Array<UIImage>? {
         didSet {
-            collectionView.reloadData()
+            imgCount = self.goodsImageArr?.count ?? 0
         }
     }
     
@@ -67,6 +68,7 @@ class OrderApplyRefundPhotoCell: UITableViewCell {
             make.top.equalTo(titleLabel.snp_bottom)
             make.left.right.equalToSuperview()
             make.height.equalTo(200)
+            make.bottom.equalToSuperview().offset(-69)
         }
         rmdBackView.snp.makeConstraints { (make) in
             make.top.equalTo(collectionView.snp_bottom)
@@ -130,6 +132,7 @@ class OrderApplyRefundPhotoCell: UITableViewCell {
             make.top.equalTo(titleLabel.snp_bottom)
             make.left.right.equalToSuperview()
             make.height.equalTo(contentSize.height)
+            make.bottom.equalToSuperview().offset(-69)
         }
         self.collectionView.collectionViewLayout.invalidateLayout()
     }
@@ -141,22 +144,31 @@ extension OrderApplyRefundPhotoCell: UICollectionViewDelegateFlowLayout,UICollec
     }
     
     func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        if imgCount! < maxImageCount {
-            return imgCount!+1
+        if imgCount < maxImageCount {
+            return imgCount+1
         } else {
             return maxImageCount
         }
     }
     
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        if imgCount! < maxImageCount && indexPath.row == imgCount {
+        if imgCount < maxImageCount && indexPath.row == imgCount {
             // 添加图片
             let cell = OrderCommentDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
             return cell
         } else {
             // 展示图片
-            let cell = OrderCommentAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            return cell
+            let pCell = OrderCommentAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            if indexPath.row < imgCount {
+                pCell.showImage = self.goodsImageArr![indexPath.row]
+            }
+            pCell.delPicBlock = {
+                [weak self] (idxRow) in
+                if let delPicTransBlock = self?.delPicTransBlock {
+                    delPicTransBlock(idxRow)
+                }
+            }
+            return pCell
         }
     }
     
@@ -169,9 +181,11 @@ extension OrderApplyRefundPhotoCell: UICollectionViewDelegateFlowLayout,UICollec
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if imgCount! < maxImageCount && indexPath.row == imgCount {
-            // 添加图片
-            print("点击添加图片")
+        if imgCount < maxImageCount && indexPath.row == imgCount {
+            // 添加图片            
+            if let choosePicBlock = self.choosePicBlock {
+                choosePicBlock()
+            }
         }
     }
     

+ 45 - 11
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundProductCell.swift

@@ -7,9 +7,17 @@
 //  申请退款--商品详情Cell
 
 import UIKit
+import RxSwift
+import RxCocoa
 
 class OrderApplyRefundProductCell: UITableViewCell {
     
+    let disposeBag = DisposeBag()
+    
+    // 选中商品
+    typealias ProductSelBlock = (_ isProductSelected: Int) -> Void
+    var productSelBlock : ProductSelBlock?
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundProductCell {
         let ID = "OrderApplyRefundProductCell"
         tableView.register(OrderApplyRefundProductCell.self, forCellReuseIdentifier: ID)
@@ -37,25 +45,37 @@ class OrderApplyRefundProductCell: UITableViewCell {
     private func setupViews() {
         self.selectionStyle = .none
         addSubview(productImageView)
+        addSubview(selectBtn)
+        addSubview(priceLabel)
         addSubview(titleLabel)
         addSubview(timeLabel)
         addSubview(skuLabel)
-        addSubview(priceLabel)
         addSubview(numberLabel)
         addSubview(lineLabel)
     }
     
     private func setupLayouts() {
         productImageView.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.centerY.equalToSuperview()
+            make.left.equalToSuperview().offset(34)
+            make.top.equalToSuperview().offset(14)
+            make.bottom.equalToSuperview().offset(-14)
             make.size.equalTo(80)
         }
-        
-        titleLabel.snp.makeConstraints { (make) in
+        selectBtn.snp.makeConstraints { (make) in
+            make.left.equalToSuperview().offset(14)
+            make.size.equalTo(18)
+            make.centerY.equalTo(productImageView)
+        }
+        priceLabel.snp.remakeConstraints { (make) in
+            make.top.equalToSuperview().offset(21)
+            make.right.equalTo(-14)
+            make.width.lessThanOrEqualTo(60)
+            make.height.equalTo(20)
+        }
+        titleLabel.snp.remakeConstraints { (make) in
             make.left.equalTo(productImageView.snp.right).offset(12)
             make.top.equalTo(20)
-            make.right.equalTo(priceLabel.snp.left).offset(-12)
+            make.right.equalTo(priceLabel.snp.left).offset(-11)
             make.height.equalTo(20)
         }
         timeLabel.snp.makeConstraints { (make) in
@@ -68,15 +88,10 @@ class OrderApplyRefundProductCell: UITableViewCell {
             make.left.equalTo(titleLabel)
             make.height.equalTo(17)
         }
-        priceLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(titleLabel)
-            make.right.equalTo(-14)
-        }
         numberLabel.snp.makeConstraints { (make) in
             make.centerY.equalTo(timeLabel)
             make.right.equalTo(-14)
         }
-        
         lineLabel.snp.makeConstraints { (make) in
             make.bottom.equalToSuperview()
             make.height.equalTo(1)
@@ -85,6 +100,20 @@ class OrderApplyRefundProductCell: UITableViewCell {
         }
     }
     
+    private lazy var selectBtn: UIButton = {
+        let selectBtn = UIButton(type: UIButton.ButtonType.custom)
+        selectBtn.setImage(kImage(name: "common_uncheck_icon"), for: UIControl.State.normal)
+        selectBtn.setImage(kImage(name: "common_check_icon"), for: UIControl.State.selected)
+        selectBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
+            selectBtn.isSelected = !selectBtn.isSelected
+            if let productSelBlock = self?.productSelBlock {
+                let isSel: Int = selectBtn.isSelected == true ? 1 : 0
+                productSelBlock(isSel)
+            }
+        }).disposed(by: disposeBag)
+        return selectBtn
+    }()
+    
     private lazy var productImageView: UIImageView = {
         let productImageView = UIImageView()
         productImageView.image = kImage(name: "pic_preload")
@@ -116,6 +145,7 @@ class OrderApplyRefundProductCell: UITableViewCell {
         let priceLabel = UILabel()
         priceLabel.textColor = k333333Color
         priceLabel.font = kRegularFont14
+        priceLabel.textAlignment = .right
         return priceLabel
     }()
     
@@ -134,6 +164,10 @@ class OrderApplyRefundProductCell: UITableViewCell {
     
     var orderModelDetailModel: OrderModelDetailModel? {
         didSet {
+            // 选中状态
+            let selStatus = orderModelDetailModel?.isSelect == 1 ? true : false
+            selectBtn.isSelected = selStatus
+            
             productImageView.kf.setImage(with: kURLImage(name: orderModelDetailModel?.productImg ?? "pic_preload"), placeholder: kImage(name: "pic_preload"))
             titleLabel.text = orderModelDetailModel?.productName
             timeLabel.text = "预计配送时间:\(orderModelDetailModel?.receiveTime ?? "")"

+ 150 - 7
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift

@@ -8,15 +8,29 @@
 
 import UIKit
 import RxSwift
+import SwiftyJSON
 
 class OrderApplyRefundController: BaseViewController {
     
-    var orderModel: OrderModel?
+    var orderDetailModel: OrderModel? {
+        didSet {
+            self.productArr = self.orderDetailModel?.detail
+            self.tableView.reloadData()
+        }
+    }
+    
+    // 商品数组
+    var productArr: Array<OrderModelDetailModel>?
+    // 当前是否全选
+    var isAllSelected: Int?
     
     // 退款原因数组
     var refundReasonArr: Array<String>?
     // 选中の退款原因
-    var selRefundReason: String?
+    var selRefundReason: String? = ""
+    
+    // 上传图片数组
+    var goodsImageArr = Array<UIImage>()
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -35,7 +49,7 @@ class OrderApplyRefundController: BaseViewController {
         commitButton.backgroundColor = kFFA42FColor
         self.view.addSubview(commitButton)
         commitButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            print("点击了--提交申请退款")
+            self?.applyOrderRefund()
             
         }).disposed(by: disposeBag)
         commitButton.snp.makeConstraints { (make) in
@@ -80,12 +94,13 @@ class OrderApplyRefundController: BaseViewController {
 extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSource {
     
     func numberOfSections(in tableView: UITableView) -> Int {
-        return 1+4
+        return 5
     }
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         if section == 0 {
-            return 2+3
+            let count = productArr?.count ?? 0
+            return count + 3
         } else {
             return 1
         }
@@ -97,15 +112,30 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
             switch indexPath.row {
             case 0:
                 let titleCell = OrderShopAndStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                titleCell.orderModel = orderDetailModel
                 return titleCell
             case 1:
                 let dtCell = OrderDeliveryModeAndTimeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+                dtCell.orderModel = orderDetailModel
                 return dtCell
-            case 4:
+            case 2+(productArr!.count):
                 let actCell = OrderApplyRefundAccountCell.cellWith(tableView: tableView, indexPath: indexPath)
+                actCell.isAllSelected = isAllSelected
+                actCell.refundPrice = self.calculateRefundAmount()
+                actCell.allSelectBlock = {
+                    [weak self] (isAllSel) in
+                    self?.isAllSelected = isAllSel
+                    self?.allSelectedAction(isAllSel)
+                }
                 return actCell
             default:
                 let productCell = OrderApplyRefundProductCell.cellWith(tableView: tableView, indexPath: indexPath)
+                productCell.orderModelDetailModel = productArr![indexPath.row-2]
+                productCell.productSelBlock = {
+                    [weak self] (isSel) in
+                    self?.productArr![indexPath.row-2].isSelect = isSel
+                    self?.judgeAllSelectedStatus()
+                }
                 return productCell
             }
         case 1:
@@ -123,16 +153,49 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
             return reasonCell
         case 2:
             let phoneCell = OrderApplyRefundPhoneCell.cellWith(tableView: tableView, indexPath: indexPath)
+            phoneCell.orderModel = orderDetailModel
             return phoneCell
         case 3:
             let noteCell = OrderApplyRefundNoteInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
+            noteCell.orderModel = orderDetailModel
             return noteCell
         case 4:
             let photoCell = OrderApplyRefundPhotoCell.cellWith(tableView: tableView, indexPath: indexPath)
-            photoCell.imgCount = 0
+            photoCell.goodsImageArr = self.goodsImageArr
             photoCell.frame = tableView.bounds
             photoCell.layoutIfNeeded()
             photoCell.reloadData()
+            photoCell.choosePicBlock = {
+                [weak self] in
+                // 添加图片
+                UIAlertController.showConfirmActionSheet(camera: { (action) in
+                    PhotoAndCameraManager.shared().authorizeCamera()
+                    PhotoAndCameraManager.shared().photoAndCameraManagerImageBlock = { [weak self] (image) in
+                        if self?.goodsImageArr.count ?? 0 < 3 {
+                            self?.goodsImageArr.append(image)
+                            self?.tableView.reloadData()
+                        } else {
+                            print("------超过最大数量")
+                        }
+                        
+                    }
+                }) { (action) in
+                    PhotoAndCameraManager.shared().authorizePhoto()
+                    PhotoAndCameraManager.shared().photoAndCameraManagerImageBlock = { [weak self] (image) in
+                        if self?.goodsImageArr.count ?? 0 < 3 {
+                            self?.goodsImageArr.append(image)
+                            self?.tableView.reloadData()
+                        } else {
+                            print("------超过最大数量")
+                        }
+                    }
+                }
+            }
+            photoCell.delPicTransBlock = {
+                [weak self] (idxRow) in
+                self?.goodsImageArr.remove(at: idxRow!)
+                self?.tableView.reloadData()
+            }
             return photoCell
         default:
             return UITableViewCell()
@@ -163,6 +226,39 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
 
 // MARK: - 逻辑处理
 extension OrderApplyRefundController {
+    // 全选点击事件
+    func allSelectedAction(_ isSelected: Int) {
+        for productMdl in productArr ?? [] {
+            productMdl.isSelect = isSelected
+        }
+        tableView.reloadSections([0], with: UITableView.RowAnimation.none)
+    }
+    
+    // 校验商品是否全选
+    func judgeAllSelectedStatus() -> Void {
+        var isAllSel: Int = 1
+        for productMdl in productArr ?? [] {
+            if productMdl.isSelect == 0 {
+                isAllSel = 0
+                break
+            }
+        }
+        
+        self.isAllSelected = isAllSel
+        tableView.reloadSections([0], with: UITableView.RowAnimation.none)
+    }
+    
+    // 计算退款金额
+    func calculateRefundAmount() -> Int {
+        var totalPrice: Int = 0
+        for productMdl in productArr ?? [] {
+            if productMdl.isSelect == 1 {
+                totalPrice += productMdl.amount! * productMdl.productPrice!
+            }
+        }
+        return totalPrice
+    }
+    
     /// 获取退款原因
     func refundReasonApi() {
         SwiftMoyaNetWorkServiceProduct.shared().productRefundReasonApi { [weak self] (refundModel) -> (Void) in
@@ -170,4 +266,51 @@ extension OrderApplyRefundController {
             self?.refundReasonArr = refundModel.refundReason
         }
     }
+    
+    // 申请退款
+    func applyOrderRefund() {
+        
+        if productArr?.isEmpty ?? true {
+            SwiftProgressHUD.shared().showText("请选择退款商品")
+            return
+        }
+        
+        if selRefundReason?.count == 0 {
+            SwiftProgressHUD.shared().showText("请输入退款原因")
+            return
+        }
+        
+        if productArr?.count == 0 {
+            SwiftProgressHUD.shared().showText("请拍照上传问题")
+            return
+        }
+        
+        // 子订单id参数
+        var subIdArr: Array<Int> = []
+        for productMdl in productArr ?? [] {
+            if productMdl.isSelect == 1 {
+                subIdArr.append(productMdl.id!)
+            }
+        }
+        let detailJsonStr = JSON(subIdArr).description
+        
+        // 多图上传
+        SwiftMoyaNetWorkServiceConfig.shared().configUploadMultiImgApi(imageArray: goodsImageArr) { [weak self] (imgUrlArr) -> (Void) in
+            let imgJsonStr = JSON(imgUrlArr).description
+            
+            self?.orderPurchaseRefundApi(purchaseId: (self?.orderDetailModel!.purchaseNo)!, mobile: (self?.orderDetailModel!.mobile!)!, refundReason: (self?.selRefundReason!)!, refund_remark: self?.orderDetailModel!.remark ?? "", detail: detailJsonStr, imgs: imgJsonStr)
+        }
+    }
+    
+    func orderPurchaseRefundApi(purchaseId:String = "",mobile:String = "",refundReason:String = "",refund_remark:String = "",detail:String = "",imgs:String = "") {
+        SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseRefundApi(purchaseId: purchaseId, mobile: mobile, refundReason: refundReason, refund_remark: refund_remark, detail: detail, imgs: imgs) { (orderApplyRefundModel) -> (Void) in
+            let applyRefundMdl = orderApplyRefundModel as! OrderApplyRefundModel
+            
+            let vc = OrderRefunddetailsViewController()
+            vc.refundNo = applyRefundMdl.refundNo
+            self.navigationController?.pushViewController(vc, animated: true)
+            
+        }
+    }
+    
 }

+ 7 - 3
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift

@@ -94,8 +94,8 @@ class OrderCommentTableViewCell: UITableViewCell {
         starView.snp.makeConstraints { (make) in
             make.left.equalTo(titleLabel.snp_right).offset(12)
             make.centerY.equalTo(iconImageView)
-//            make.width.equalTo(122)
-//            make.height.equalTo(20)
+            make.width.equalTo(122)
+            make.height.equalTo(20)
         }
         
         cmtTextView.snp.makeConstraints { (make) in
@@ -136,7 +136,11 @@ class OrderCommentTableViewCell: UITableViewCell {
     
     private lazy var starView: SwiftyStarRatingView = {
         let starView = SwiftyStarRatingView()
-        return starView
+        starView.emptyStarImage = kImage(name: "star_rating_empty")
+        starView.halfStarImage = kImage(name: "star_rating_half")
+        starView.filledStarImage = kImage(name: "star_rating_filled")
+        starView.allowsHalfStars = false
+        return starView        
     }()
     
     private lazy var cmtTextView: IQTextView = {

+ 33 - 2
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/ViewController/OrderCommentController.swift

@@ -11,7 +11,10 @@ import RxSwift
 
 class OrderCommentController: BaseViewController {
     
+    // 上传图片数组
     var goodsImageArr = Array<UIImage>()
+    // 提交评论参数Model
+    var paraMdl = OrderCommentParameterModel()
     
     override func viewDidLoad() {
         super.viewDidLoad()
@@ -31,6 +34,8 @@ class OrderCommentController: BaseViewController {
         self.view.addSubview(commitButton)
         commitButton.rx.tap.subscribe(onNext: { [weak self] (data) in
             print("点击了--提交评价")
+            self?.uploadMultiImgUrl(imageArr: self!.goodsImageArr)
+//            self?.uploadSingleImgUrl(imageArr: self!.goodsImageArr)
             
         }).disposed(by: disposeBag)
         commitButton.snp.makeConstraints { (make) in
@@ -144,10 +149,16 @@ extension OrderCommentController : UITableViewDelegate, UITableViewDataSource {
 //MARK: - 逻辑处理
 extension OrderCommentController {
     
-    /// 上传图片
+    /// 单图上传
     ///
     /// - Parameter goodsImageArr: 图片数组
-    func uploadFaceUrl(image:UIImage) -> Void {
+    func uploadSingleImgUrl(imageArr:[UIImage]) -> Void {
+        
+        SwiftMoyaNetWorkServiceConfig.shared().configUploadSingleImgApi(imageArray: imageArr) { [weak self] (data) -> (Void) in
+            print(data)
+        }
+        
+        
 //        SwiftMoyaNetWorkService.shared.commonUploadpicSingleApi(imageArray:goodsImageArr) { [weak self] (data) -> (Void) in
 //
 //            SwiftMoyaNetWorkService.shared.minePersonalUploadFaceUrlApi(faceUrl: data as! String , completion: { [weak self] (data) -> (Void) in
@@ -156,4 +167,24 @@ extension OrderCommentController {
 //            })
 //        }
     }
+    
+    /// 多图上传
+    ///
+    /// - Parameter goodsImageArr: 图片数组
+    func uploadMultiImgUrl(imageArr:[UIImage]) -> Void {
+        
+        SwiftMoyaNetWorkServiceConfig.shared().configUploadMultiImgApi(imageArray: imageArr) { [weak self] (data) -> (Void) in
+            print(data)
+        }
+        
+        
+        //        SwiftMoyaNetWorkService.shared.commonUploadpicSingleApi(imageArray:goodsImageArr) { [weak self] (data) -> (Void) in
+        //
+        //            SwiftMoyaNetWorkService.shared.minePersonalUploadFaceUrlApi(faceUrl: data as! String , completion: { [weak self] (data) -> (Void) in
+        //                self?.personalPortraitView.isReloadData = true
+        //                NotificationCenter.default.post(name: kMineUserQueryModelTokenModelChangeNotificationName, object: nil,userInfo: nil)
+        //            })
+        //        }
+    }
+    
 }

+ 4 - 2
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift

@@ -119,7 +119,9 @@ class OrderDetailViewController: BaseViewController {
             self.navigationController?.pushViewController(vc, animated: true)
         }
         if button.titleLabel?.text == "申请退款" {
-            
+            let vc = OrderApplyRefundController()
+            vc.orderDetailModel = self.orderDetailModel
+            self.navigationController?.pushViewController(vc, animated: true)
         }
     }
     
@@ -237,7 +239,7 @@ extension OrderDetailViewController : UITableViewDelegate, UITableViewDataSource
             case 0:
                 return 43
             case detail?.count ?? 0 + 1:
-                return 112
+                return UITableView.automaticDimension
             default:
                 return 40
             }

+ 28 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ConfigModel/ImageUrlModel.swift

@@ -0,0 +1,28 @@
+//
+//  ImageUrlModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/5/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import Foundation
+import ObjectMapper
+
+
+class ImageUrlModel : NSObject, Mappable{
+    
+    var url : String?
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return ImageUrlModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        url <- map["url"]
+    }
+    
+}

+ 30 - 0
RainbowPlanet/RainbowPlanet/Service/Model/OrderModel/OrderApplyRefundModel.swift

@@ -0,0 +1,30 @@
+//
+//  OrderApplyRefundModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/5/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  申请退款のModel
+
+import Foundation
+import ObjectMapper
+
+
+class OrderApplyRefundModel : NSObject, Mappable{
+    
+    var refundNo : String?
+    
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return OrderApplyRefundModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        refundNo <- map["refund_no"]
+        
+    }
+    
+}

+ 3 - 0
RainbowPlanet/RainbowPlanet/Service/Model/OrderModel/OrderListModel.swift

@@ -108,6 +108,9 @@ class OrderModelDetailModel : NSObject, Mappable{
     var skuName : String?
     var status : Int?
     
+    // 申请退款本地计算用
+    var isSelect: Int = 0
+    
     
     class func newInstance(map: Map) -> Mappable?{
         return OrderModelDetailModel()

+ 38 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/OrderCommentParameterModel.swift

@@ -0,0 +1,38 @@
+//
+//  OrderCommentParameterModel.swift
+//  RainbowPlanet
+//
+//  Created by Christopher on 2019/5/18.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//  新增商品评价参数Model
+
+import UIKit
+
+class OrderCommentParameterModel : NSObject{
+    
+    var purchase_id : Int?
+    var username : String?
+    var avatar : String?
+    var purchase_no : String?
+    var shop_id : Int?
+    var shop_name : String?
+    
+    var cmtProductArr : Array<CommentProductModel>?
+}
+
+
+class CommentProductModel : NSObject{
+    
+    var purchase_detail_id : Int?
+    var imgs : Array<String>?
+    var content : String?
+    var star : Int?
+    var sku_id : Int?
+    var sku_name : String?
+    var product_id : Int?
+    var product_name : String?
+    var sale_name : String?
+    var category_name1 : Int?
+    var category_name2 : Int?
+    var category_name3 : Int?        
+}

+ 28 - 13
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift

@@ -72,31 +72,46 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
     /// - Parameters:
     ///   - imageArray: 图片数据
     ///   - completion: null
-    func configUploadImgApi(imageArray:Array<UIImage>, completion: @escaping apiCallBack) {
+    func configUploadSingleImgApi(imageArray:Array<UIImage>, completion: @escaping apiCallBack) {
         
         var  multipartData = Array<Any>()
         let  parameters = Dictionary<String,Any>()
-        for (index,image) in imageArray.enumerated() {
+        for (_,image) in imageArray.enumerated() {
             let data = image.jpegData(compressionQuality: 0.5)
             let today = Date()
-//            let formData = MultipartFormData(provider: .data(data!), name: "file\(index)",fileName: "\(today).png", mimeType: "image/png")
             let formData = MultipartFormData(provider: .data(data!), name: "image",fileName: "\(today).png", mimeType: "image/png")
 
             multipartData.append(formData)
         }
         SwiftProgressHUD.shared().showWait()
-        SwiftMoyaNetWorkManager.shared().request(target: MultiTarget(SwiftMoyaServiceConfigApi.configUploadImg(parameters: parameters, dataArray: multipartData))) { (data) in
+        SwiftMoyaNetWorkManager.shared().request(target: MultiTarget(SwiftMoyaServiceConfigApi.configUploadSingleImg(parameters: parameters, dataArray: multipartData))) { (data) in
+            SwiftProgressHUD.shared().hide()
             let rootModel = data as! RootModel
-//            if rootModel.code == "1" {
-//                SwiftProgressHUD.shared().showSuccess(rootModel.msg!, "success")
-//                let commonUploadpicSingleModel = CommonUploadpicSingleModel(JSONString: rootModel.data!)
-//                completion(commonUploadpicSingleModel!.url! as Any)
-//            }else if rootModel.code == "0" {
-//                SwiftProgressHUD.shared().showError(rootModel.msg!, "error")
-//            }else {
-                SwiftProgressHUD.shared().hide()
             print(rootModel)
-//            }
+        }
+    }
+    
+    // MARK: 多图上传
+    /// 多图上传
+    ///
+    /// - Parameters:
+    ///   - imageArray: 图片数据
+    ///   - completion: null
+    func configUploadMultiImgApi(imageArray:Array<UIImage>, completion: @escaping apiCallBack) {
+        
+        var  multipartData = Array<Any>()
+        let  parameters = Dictionary<String,Any>()
+        for (_,image) in imageArray.enumerated() {
+            let data = image.jpegData(compressionQuality: 0.5)
+            let today = Date()
+            let formData = MultipartFormData(provider: .data(data!), name: "image[]",fileName: "\(today).png", mimeType: "image/png")
+            
+            multipartData.append(formData)
+        }
+        SwiftProgressHUD.shared().showWait()
+        SwiftMoyaNetWorkManager.shared().requestArray(target: MultiTarget(SwiftMoyaServiceConfigApi.configUploadMultiImg(parameters: parameters, dataArray: multipartData))) { (imgUrlArr) in
+            SwiftProgressHUD.shared().hide()
+            completion(imgUrlArr)
         }
     }
             

+ 23 - 13
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaServiceConfigApi.swift

@@ -17,22 +17,26 @@ public let kConfigPickupNodeIndexApi = "/config/pickupNode/index"
 /// 已开通城市列表
 public let kConfigCityManagementIndexApi = "/config/cityManagement/index"
 
-// MARK: - 图片上传
-/// 图片上传
-public let kConfigUploadImgApi = "/config/upload"
+// MARK: - 单图上传
+/// 单图上传
+public let kConfigUploadSingleImgApi = "/config/upload"
+
+// MARK: - 多图上传
+/// 多图上传
+public let kConfigUploadMultiImgApi = "/config/multi_upload"
 
 
 /// 基础配置
 ///
 /// - configPickupNodeIndex: 自提点列表
 /// - configCityManagementIndex: 已开通城市列表
-/// - configUploadImg: 图片上传
+/// - configUploadSingleImg: 单图上传
+/// - configUploadMultiImg: 单图上传
 public enum SwiftMoyaServiceConfigApi {
     case configPickupNodeIndex(parameters:Dictionary<String, Any>)
     case configCityManagementIndex(parameters:Dictionary<String, Any>)
-    case configUploadImg(parameters:Dictionary<String, Any>,dataArray:Array<Any>)
-    
-    
+    case configUploadSingleImg(parameters:Dictionary<String, Any>,dataArray:Array<Any>)
+    case configUploadMultiImg(parameters:Dictionary<String, Any>,dataArray:Array<Any>)
 }
 
 extension SwiftMoyaServiceConfigApi: TargetType {
@@ -41,7 +45,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
         switch self {
         case .configPickupNodeIndex,
              .configCityManagementIndex,
-             .configUploadImg
+             .configUploadSingleImg,
+             .configUploadMultiImg
             :
             return URL(string: kApiDataPrefix())!
         }
@@ -53,8 +58,10 @@ extension SwiftMoyaServiceConfigApi: TargetType {
             return kConfigPickupNodeIndexApi
         case .configCityManagementIndex:
             return kConfigCityManagementIndexApi
-        case .configUploadImg:
-            return kConfigUploadImgApi
+        case .configUploadSingleImg:
+            return kConfigUploadSingleImgApi
+        case .configUploadMultiImg:
+            return kConfigUploadMultiImgApi
         }
     }
     
@@ -64,7 +71,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
              .configCityManagementIndex
             :
             return .get
-        case .configUploadImg
+        case .configUploadSingleImg,
+             .configUploadMultiImg
             :
             return .post
         }
@@ -80,7 +88,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
             parameters.updateValue(sign, forKey: "sign")
             return .requestParameters(parameters: parameters, encoding: URLEncoding.default)
             
-        case .configUploadImg(_,let dataArray)
+        case .configUploadSingleImg(_,let dataArray),
+             .configUploadMultiImg(_,let dataArray)
             :
             return .uploadMultipart(dataArray as! [MultipartFormData])
 
@@ -104,7 +113,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
         switch self {
         case .configPickupNodeIndex,
              .configCityManagementIndex,
-             .configUploadImg
+             .configUploadSingleImg,
+             .configUploadMultiImg
             :
             return (headerParameters(headerType: .tokenHeader) as! [String : String])
         }

+ 3 - 3
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceOrder/SwiftMoyaNetWorkServiceOrder.swift

@@ -139,7 +139,7 @@ class SwiftMoyaNetWorkServiceOrder: NSObject {
     ///   - detail: 子订单id(json字符串
     ///   - imgs: 图库(json字符串)
     ///   - completion: 回调
-    func orderPurchaseRefundApi(purchaseId:Int = 0,mobile:String = "",refundReason:String = "",refund_remark:String = "",detail:String = "",imgs:String = "",completion: @escaping apiCallBack) {
+    func orderPurchaseRefundApi(purchaseId:String = "",mobile:String = "",refundReason:String = "",refund_remark:String = "",detail:String = "",imgs:String = "",completion: @escaping apiCallBack) {
         var parameters = Dictionary<String,Any>()
         parameters.updateValue(purchaseId, forKey: "purchase_id")
         parameters.updateValue(mobile, forKey: "mobile")
@@ -148,9 +148,9 @@ class SwiftMoyaNetWorkServiceOrder: NSObject {
         parameters.updateValue(detail, forKey: "detail")
         parameters.updateValue(imgs, forKey: "imgs")
         SwiftProgressHUD.shared().showWait()
-        SwiftMoyaNetWorkManager.shared().request(OrderRefundDetailModel.self,target: MultiTarget(SwiftMoyaServiceOrderApi.orderPurchaseRefund(parameters: parameters))) { (orderRefundDetailModel) in
+        SwiftMoyaNetWorkManager.shared().request(OrderApplyRefundModel.self,target: MultiTarget(SwiftMoyaServiceOrderApi.orderPurchaseRefund(parameters: parameters))) { (orderApplyRefundModel) in
             SwiftProgressHUD.shared().hide()
-            completion(orderRefundDetailModel)
+            completion(orderApplyRefundModel)
         }
     }