Procházet zdrojové kódy

Merge branch 'feature/liuxuqing' into develop

# Conflicts:
#	RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift
#	RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift
Chris před 6 roky
rodič
revize
64945618d2
14 změnil soubory, kde provedl 203 přidání a 25 odebrání
  1. 4 0
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 3 2
      RainbowPlanet/RainbowPlanet/Modules/CommonModules/PickView/PickHeaderView.swift
  3. 1 1
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift
  4. 16 6
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundReasonCell.swift
  5. 30 4
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift
  6. 7 3
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentAddImgCollectionCell.swift
  7. 10 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift
  8. 3 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/ViewController/OrderCommentController.swift
  9. 29 0
      RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductRefundReasonModel.swift
  10. 34 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift
  11. 22 3
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaServiceConfigApi.swift
  12. 14 0
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift
  13. 29 5
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift
  14. 1 1
      RainbowPlanet/RainbowPlanet/Tools/AlertSheetView/AlertSheetView.swift

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

@@ -339,6 +339,7 @@
 		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 */; };
+		BDDF3B28228EBB72003A7D16 /* ProductRefundReasonModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */; };
 		BDE3045D22851E4F001D050F /* ProductCartListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE3045C22851E4F001D050F /* ProductCartListModel.swift */; };
 		BDE3045F228554CA001D050F /* ProductCartAmountModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE3045E228554CA001D050F /* ProductCartAmountModel.swift */; };
 		BDEF7791228571DC00ED0AC0 /* CommonPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDEF7790228571DC00ED0AC0 /* CommonPayView.swift */; };
@@ -726,6 +727,7 @@
 		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>"; };
+		BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductRefundReasonModel.swift; sourceTree = "<group>"; };
 		BDE3045C22851E4F001D050F /* ProductCartListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCartListModel.swift; sourceTree = "<group>"; };
 		BDE3045E228554CA001D050F /* ProductCartAmountModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCartAmountModel.swift; sourceTree = "<group>"; };
 		BDEF7790228571DC00ED0AC0 /* CommonPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonPayView.swift; sourceTree = "<group>"; };
@@ -2210,6 +2212,7 @@
 				BDE3045C22851E4F001D050F /* ProductCartListModel.swift */,
 				BDE3045E228554CA001D050F /* ProductCartAmountModel.swift */,
 				A71738AC228AB7B2000AEA6A /* ProductCommentListModel.swift */,
+				BDDF3B27228EBB72003A7D16 /* ProductRefundReasonModel.swift */,
 			);
 			path = ProductModel;
 			sourceTree = "<group>";
@@ -3308,6 +3311,7 @@
 				A7284A7322546460000BAEC4 /* SwiftMoyaServicePayApi.swift in Sources */,
 				BDE3045D22851E4F001D050F /* ProductCartListModel.swift in Sources */,
 				A7A98DFF227E8501005306E9 /* SwiftMoyaNetWorkServiceProduct.swift in Sources */,
+				BDDF3B28228EBB72003A7D16 /* ProductRefundReasonModel.swift in Sources */,
 				A7CC74DC2270352F003C4F38 /* MineOrderCollectionViewCell.swift in Sources */,
 				BDD4FB1222840597006FE833 /* ShoppingCartPayOrderController.swift in Sources */,
 				A7284404224DBFBD00F82F30 /* UserModel.swift in Sources */,

+ 3 - 2
RainbowPlanet/RainbowPlanet/Modules/CommonModules/PickView/PickHeaderView.swift

@@ -23,12 +23,10 @@ class PickHeaderView: BaseView {
         }
         cancleButton.snp.makeConstraints { (make) in
             make.centerY.equalToSuperview()
-            make.size.equalTo(kScaleWidth * 30)
             make.left.equalTo(kScaleWidth * 7)
         }
         sureButton.snp.makeConstraints { (make) in
             make.centerY.equalToSuperview()
-            make.size.equalTo(kScaleWidth * 30)
             make.right.equalTo(kScaleWidth * -7)
         }
     }
@@ -41,12 +39,15 @@ class PickHeaderView: BaseView {
     lazy var cancleButton: UIButton = {
         let cancleButton = UIButton(type: UIButton.ButtonType.custom)
         cancleButton.setTitle("取消", for: UIControl.State.normal)
+        cancleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
         return cancleButton
     }()
     
     lazy var sureButton: UIButton = {
         let sureButton = UIButton(type: UIButton.ButtonType.custom)
         sureButton.setTitle("完成", for: UIControl.State.normal)
+        sureButton.setTitleColor(k333333Color, for: UIControl.State.normal)
+
 
         return sureButton
     }()

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

@@ -165,7 +165,7 @@ extension OrderApplyRefundPhotoCell: UICollectionViewDelegateFlowLayout,UICollec
     }
     
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 15, bottom: 0, right: 15)
+        return UIEdgeInsets(top: 10, left: 15, bottom: 20, right: 15)
     }
     
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {

+ 16 - 6
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundReasonCell.swift

@@ -13,6 +13,18 @@ class OrderApplyRefundReasonCell: UITableViewCell {
     
     let disposeBag = DisposeBag()
     
+    typealias ReasonBlock = () -> Void
+    var reasonBlock : ReasonBlock?
+    
+    // 选中の退款原因
+    var selRefundReason: String? {
+        didSet {
+            if self.selRefundReason?.count ?? 0 > 0 {
+                chooseBtn.setTitle(self.selRefundReason, for: UIControl.State.normal)
+            }
+        }
+    }
+    
     class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundReasonCell {
         let ID = "OrderApplyRefundReasonCell"
         tableView.register(OrderApplyRefundReasonCell.self, forCellReuseIdentifier: ID)
@@ -54,7 +66,7 @@ class OrderApplyRefundReasonCell: UITableViewCell {
         chooseBtn.snp.makeConstraints { (make) in
             make.right.equalToSuperview().offset(-14)
             make.centerY.equalTo(titleLabel)
-            make.width.equalTo(54)
+            make.left.greaterThanOrEqualTo(titleLabel.snp_right).offset(35)
             make.height.equalTo(30)
         }
         chooseBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
@@ -76,11 +88,9 @@ class OrderApplyRefundReasonCell: UITableViewCell {
         chooseBtn.setImage(kImage(name: "my_arrows_unfold"), for: UIControl.State.normal)
         chooseBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
             chooseBtn.isSelected = !chooseBtn.isSelected
-            //            if let allSelectBlock = self?.allSelectBlock {
-            //                let isAllSel: Int = chooseBtn.isSelected == true ? 1 : 0
-            //                allSelectBlock(isAllSel)
-            //            }
-            print("点击了--选择")
+                if let reasonBlock = self?.reasonBlock {
+                    reasonBlock()
+                }            
         }).disposed(by: disposeBag)
         return chooseBtn
     }()

+ 30 - 4
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift

@@ -13,6 +13,11 @@ class OrderApplyRefundController: BaseViewController {
     
     var orderModel: OrderModel?
     
+    // 退款原因数组
+    var refundReasonArr: Array<String>?
+    // 选中の退款原因
+    var selRefundReason: String?
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupViews()
@@ -54,7 +59,7 @@ class OrderApplyRefundController: BaseViewController {
     }
     
     override func setupData() {
-        
+        self.refundReasonApi()
     }
     
     lazy var tableView: UITableView = {
@@ -105,6 +110,16 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
             }
         case 1:
             let reasonCell = OrderApplyRefundReasonCell.cellWith(tableView: tableView, indexPath: indexPath)
+            reasonCell.selRefundReason = self.selRefundReason
+            reasonCell.reasonBlock = {
+                [weak self] in
+                AlertSheetView.sheetPickViewOneComponentsView(titles: self!.refundReasonArr ?? [], title: "", height: 250, sureClosure: { (row, value) in                    
+                    self?.selRefundReason = value
+                    // 刷新cell
+                    let indexPath = IndexPath(item: indexPath.row, section: indexPath.section)
+                    self?.tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
+                })
+            }
             return reasonCell
         case 2:
             let phoneCell = OrderApplyRefundPhoneCell.cellWith(tableView: tableView, indexPath: indexPath)
@@ -114,10 +129,10 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
             return noteCell
         case 4:
             let photoCell = OrderApplyRefundPhotoCell.cellWith(tableView: tableView, indexPath: indexPath)
-            photoCell.frame = tableView.frame
-            photoCell.setNeedsLayout()
-            photoCell.reloadData()
             photoCell.imgCount = 0
+            photoCell.frame = tableView.bounds
+            photoCell.layoutIfNeeded()
+            photoCell.reloadData()
             return photoCell
         default:
             return UITableViewCell()
@@ -145,3 +160,14 @@ extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSourc
     }
     
 }
+
+// MARK: - 逻辑处理
+extension OrderApplyRefundController {
+    /// 获取退款原因
+    func refundReasonApi() {
+        SwiftMoyaNetWorkServiceProduct.shared().productRefundReasonApi { [weak self] (refundModel) -> (Void) in
+            let refundModel = refundModel as! ProductRefundReasonModel
+            self?.refundReasonArr = refundModel.refundReason
+        }
+    }
+}

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

@@ -4,7 +4,7 @@
 //
 //  Created by Christopher on 2019/5/17.
 //  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  添加照片のCell(有图)(85*85)
+//  添加照片のCell(有图)
 
 import UIKit
 import RxSwift
@@ -19,7 +19,9 @@ class OrderCommentAddImgCollectionCell: UICollectionViewCell {
         }
     }
     
-    typealias DelPicBlock = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
+//    typealias DelPicBlock = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
+//    var delPicBlock : DelPicBlock?
+    typealias DelPicBlock = () -> Void
     var delPicBlock : DelPicBlock?
     
     class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> OrderCommentAddImgCollectionCell {
@@ -90,7 +92,9 @@ class OrderCommentAddImgCollectionCell: UICollectionViewCell {
 //            if let delPicBlock = self?.delPicBlock {
 //                delPicBlock(self?.productSearchModel,self?.indexPath)
 //            }
-            print("点击删除图片")
+            if let delPicBlock = self?.delPicBlock {
+                delPicBlock()
+            }            
             
         }).disposed(by: disposeBag)
         return delButton

+ 10 - 0
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift

@@ -196,6 +196,10 @@ extension OrderCommentTableViewCell: UICollectionViewDelegateFlowLayout,UICollec
         } else {
             // 展示图片
             let cell = OrderCommentAddImgCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
+            cell.delPicBlock = {
+                [weak self] in
+                print("点击删除图片")
+            }
             return cell
         }
     }
@@ -212,6 +216,12 @@ extension OrderCommentTableViewCell: UICollectionViewDelegateFlowLayout,UICollec
         if imgCount! < maxImageCount && indexPath.row == imgCount {
             // 添加图片
             print("点击添加图片")
+            
+//            UIAlertController.showConfirmActionSheet(camera: { (action) in
+//                <#code#>
+//            }) { (action) in
+//                <#code#>
+//            }
         }
     }
     

+ 3 - 0
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/ViewController/OrderCommentController.swift

@@ -78,6 +78,9 @@ extension OrderCommentController : UITableViewDelegate, UITableViewDataSource {
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         let commentCell = OrderCommentTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
         commentCell.imgCount = 3
+        commentCell.frame = tableView.bounds
+        commentCell.layoutIfNeeded()
+        commentCell.reloadData()        
         return commentCell
     }
     

+ 29 - 0
RainbowPlanet/RainbowPlanet/Service/Model/ProductModel/ProductRefundReasonModel.swift

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

+ 34 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaNetWorkServiceConfig.swift

@@ -66,4 +66,38 @@ class SwiftMoyaNetWorkServiceConfig: NSObject {
         }
     }
     
+    // MARK: 单图上传
+    /// 单图上传
+    ///
+    /// - Parameters:
+    ///   - imageArray: 图片数据
+    ///   - completion: null
+    func configUploadImgApi(imageArray:Array<UIImage>, completion: @escaping apiCallBack) {
+        
+        var  multipartData = Array<Any>()
+        let  parameters = Dictionary<String,Any>()
+        for (index,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
+            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)
+//            }
+        }
+    }
+            
 }

+ 22 - 3
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceConfig/SwiftMoyaServiceConfigApi.swift

@@ -17,15 +17,22 @@ public let kConfigPickupNodeIndexApi = "/config/pickupNode/index"
 /// 已开通城市列表
 public let kConfigCityManagementIndexApi = "/config/cityManagement/index"
 
+// MARK: - 图片上传
+/// 图片上传
+public let kConfigUploadImgApi = "/config/upload"
+
 
 /// 基础配置
 ///
 /// - configPickupNodeIndex: 自提点列表
 /// - configCityManagementIndex: 已开通城市列表
+/// - configUploadImg: 图片上传
 public enum SwiftMoyaServiceConfigApi {
     case configPickupNodeIndex(parameters:Dictionary<String, Any>)
     case configCityManagementIndex(parameters:Dictionary<String, Any>)
-
+    case configUploadImg(parameters:Dictionary<String, Any>,dataArray:Array<Any>)
+    
+    
 }
 
 extension SwiftMoyaServiceConfigApi: TargetType {
@@ -33,7 +40,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
     public var baseURL: URL {
         switch self {
         case .configPickupNodeIndex,
-             .configCityManagementIndex
+             .configCityManagementIndex,
+             .configUploadImg
             :
             return URL(string: kApiDataPrefix())!
         }
@@ -45,6 +53,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
             return kConfigPickupNodeIndexApi
         case .configCityManagementIndex:
             return kConfigCityManagementIndexApi
+        case .configUploadImg:
+            return kConfigUploadImgApi
         }
     }
     
@@ -54,6 +64,9 @@ extension SwiftMoyaServiceConfigApi: TargetType {
              .configCityManagementIndex
             :
             return .get
+        case .configUploadImg
+            :
+            return .post
         }
     }
     
@@ -66,6 +79,11 @@ extension SwiftMoyaServiceConfigApi: TargetType {
             let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
             parameters.updateValue(sign, forKey: "sign")
             return .requestParameters(parameters: parameters, encoding: URLEncoding.default)
+            
+        case .configUploadImg(_,let dataArray)
+            :
+            return .uploadMultipart(dataArray as! [MultipartFormData])
+
         }
     }
     
@@ -85,7 +103,8 @@ extension SwiftMoyaServiceConfigApi: TargetType {
         //同task,具体选择看后台 有application/x-www-form-urlencoded 、application/json
         switch self {
         case .configPickupNodeIndex,
-             .configCityManagementIndex
+             .configCityManagementIndex,
+             .configUploadImg
             :
             return (headerParameters(headerType: .tokenHeader) as! [String : String])
         }

+ 14 - 0
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaNetWorkServiceProduct.swift

@@ -357,4 +357,18 @@ class SwiftMoyaNetWorkServiceProduct: NSObject {
         }
     }
     
+    // MARK: - 退款原因
+    /// 退款原因
+    ///
+    /// - Parameters:    
+    ///   - completion: 回调
+    func productRefundReasonApi(completion: @escaping apiCallBack) {
+        var parameters = Dictionary<String,Any>()                        
+        SwiftProgressHUD.shared().showWait()
+        SwiftMoyaNetWorkManager.shared().request(ProductRefundReasonModel.self, target: MultiTarget(SwiftMoyaServiceProductApi.productRefundReason(parameters: parameters))) { (refundReasonModel) in
+            SwiftProgressHUD.shared().hide()
+            completion(refundReasonModel)
+        }
+    }
+    
 }

+ 29 - 5
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceApi/SwiftMoyaServiceProduct/SwiftMoyaServiceProductApi.swift

@@ -57,6 +57,14 @@ public let kProductCartIsSelApi = "/product/isSelect"
 /// 购物车-全选
 public let kProductCartAllSelApi = "/product/isSelectAll"
 
+// MARK: - 退款原因
+/// 退款原因
+public let kProductRefundReasonApi = "/product/config"
+
+// MARK: - 新增商品评价
+/// 新增商品评价
+public let kProductAddCommentApi = "/product/commentCreate"
+
 
 /// 商品
 ///
@@ -72,6 +80,8 @@ public let kProductCartAllSelApi = "/product/isSelectAll"
 /// - productCartAmount: 购物车-数量
 /// - productCartIsSel: 购物车-选中
 /// - productCartAllSel: 购物车-全选
+/// - productRefundReason: 退款原因
+/// - productAddComment: 新增商品评价
 public enum SwiftMoyaServiceProductApi {
     case productSearch(parameters:Dictionary<String, Any>)
     case productCategory(parameters:Dictionary<String, Any>)
@@ -85,6 +95,8 @@ public enum SwiftMoyaServiceProductApi {
     case productCartAmount(parameters:Dictionary<String, Any>)
     case productCartIsSel(parameters:Dictionary<String, Any>)
     case productCartAllSel(parameters:Dictionary<String, Any>)
+    case productRefundReason(parameters:Dictionary<String, Any>)
+    case productAddComment(parameters:Dictionary<String, Any>)
 }
 
 extension SwiftMoyaServiceProductApi: TargetType {
@@ -102,7 +114,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
              .productCartDelete,
              .productCartAmount,
              .productCartIsSel,
-             .productCartAllSel
+             .productCartAllSel,
+             .productRefundReason,
+             .productAddComment
             :
             return URL(string: kApiDataPrefix())!
         }
@@ -134,12 +148,17 @@ extension SwiftMoyaServiceProductApi: TargetType {
             return kProductCartIsSelApi
         case .productCartAllSel:
             return kProductCartAllSelApi
+        case .productRefundReason:
+            return kProductRefundReasonApi
+        case .productAddComment:
+            return kProductAddCommentApi
         }
     }
     
     public var method: Moya.Method {
         switch self {
-        case.productCartAdd
+        case .productCartAdd,
+             .productAddComment
             :
             return .post
         case .productCartAmount,
@@ -153,7 +172,8 @@ extension SwiftMoyaServiceProductApi: TargetType {
              .productCartList,
              .productDetail,
              .productCommentList,
-             .productHotSale
+             .productHotSale,
+             .productRefundReason
             :
             return .get
         case .productCartDelete
@@ -176,7 +196,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
              .productCartDelete(var parameters),
              .productCartAmount(var parameters),
              .productCartIsSel(var parameters),
-             .productCartAllSel(var parameters)
+             .productCartAllSel(var parameters),
+             .productRefundReason(var parameters),
+             .productAddComment(var parameters)
             :
             let sign = SwiftSign.shared().sign(signType:.AccessToken, parameters: parameters)
             parameters.updateValue(sign, forKey: "sign")
@@ -210,7 +232,9 @@ extension SwiftMoyaServiceProductApi: TargetType {
              .productCartDelete,
              .productCartAmount,
              .productCartIsSel,
-             .productCartAllSel
+             .productCartAllSel,
+             .productRefundReason,
+             .productAddComment
             :
             return (headerParameters(headerType: .tokenHeader) as! [String : String])
         }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Tools/AlertSheetView/AlertSheetView.swift

@@ -130,7 +130,7 @@ class AlertSheetView: NSObject {
     
     
     /// 单个选择器
-    func sheetPickViewOneComponentsView(titles:[String],title:String,height:CGFloat,sureClosure:((_ row: Int,_ value:String) -> Void)?) {
+    class func sheetPickViewOneComponentsView(titles:[String],title:String,height:CGFloat,sureClosure:((_ row: Int,_ value:String) -> Void)?) {
         let view = PickViewOneComponentsView(titles: titles,title: title)
         view.frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: height * kScaleWidth + kSafeTabBarHeight)
         let vProperty = FWPopupViewProperty()