南鑫林 лет назад: 5
Родитель
Сommit
d3e4e81c64
100 измененных файлов с 22 добавлено и 15774 удалено
  1. 0 1096
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 1 1
      RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift
  3. 4 3
      RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/View/OrderView/UserPersonalCenterOrderView.swift
  4. 0 159
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderButtonTableViewCell.swift
  5. 0 174
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeAndButtonTableViewCell.swift
  6. 0 96
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeAndTimeTableViewCell.swift
  7. 0 73
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeTableViewCell.swift
  8. 0 87
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderFreightTableViewCell.swift
  9. 0 40
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderListView.swift
  10. 0 149
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderProductTableViewCell.swift
  11. 0 164
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderShopAndStatusTableViewCell.swift
  12. 0 91
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderTotalAmountTableViewCell.swift
  13. 0 429
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift
  14. 0 266
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift
  15. 0 117
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundAccountCell.swift
  16. 0 103
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundNoteInfoCell.swift
  17. 0 79
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhoneCell.swift
  18. 0 197
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift
  19. 0 183
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundProductCell.swift
  20. 0 99
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundReasonCell.swift
  21. 0 356
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift
  22. 0 108
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentAddImgCollectionCell.swift
  23. 0 105
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentDefaultCollectionCell.swift
  24. 0 283
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentTableViewCell.swift
  25. 0 272
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/ViewController/OrderCommentController.swift
  26. 0 219
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailBottomView.swift
  27. 0 110
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailContactAddressTableViewCell.swift
  28. 0 86
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailExpressSelfMentionTableViewCell.swift
  29. 0 122
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailInfoTableViewCell.swift
  30. 0 151
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailProductTableViewCell.swift
  31. 0 112
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailStatusTableViewCell.swift
  32. 0 368
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift
  33. 0 140
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPayFailureCell.swift
  34. 0 175
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPaySuccessCell.swift
  35. 0 144
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPayView.swift
  36. 0 160
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/ViewController/OrderFinishPayController.swift
  37. 0 176
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderLogistics/View/OrderLogisticsInfoCell.swift
  38. 0 138
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderLogistics/ViewController/OrderLogisticsController.swift
  39. 0 107
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPayExpressAddInfoCell.swift
  40. 0 150
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPayExpressInfoShowCell.swift
  41. 0 96
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickAddInfoCell.swift
  42. 0 120
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickAddressCell.swift
  43. 0 104
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickInfoCell.swift
  44. 0 83
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/OrderPayAcountView.swift
  45. 0 94
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartOrderPayFreightCell.swift
  46. 0 431
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartOrderPayView.swift
  47. 0 145
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderFooter.swift
  48. 0 109
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderHeader.swift
  49. 0 163
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderItemCell.swift
  50. 0 175
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/ViewController/ShoppingCartPayOrderController.swift
  51. 0 102
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/View/OrderRefunddetailsStatusTableViewCell.swift
  52. 0 92
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/View/OrderRefunddetailsTipsTableViewCell.swift
  53. 0 193
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/ViewController/OrderRefunddetailsViewController.swift
  54. 8 7
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchProduct/ViewController/SearchProductListViewController.swift
  55. 9 9
      RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift
  56. 0 108
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift
  57. 0 94
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift
  58. 0 167
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift
  59. 0 189
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift
  60. 0 165
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductAllCommentView.swift
  61. 0 63
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductDetailEvaluationImageCollectionViewCell.swift
  62. 0 231
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductDetailEvaluationListTableViewCell.swift
  63. 0 83
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/ViewController/ProductAllCommentViewController.swift
  64. 0 97
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProcuctDetailSelectSku/ProcuctDetailSelectSkuTableViewCell.swift
  65. 0 74
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailDescription/ProductDetailDescriptionTableViewCell.swift
  66. 0 191
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailEvaluation/ProductDetailEvaluationTableViewCell.swift
  67. 0 137
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailHotSell/ProductDetailHotSellTableViewCell.swift
  68. 0 104
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailParameter/ProductDetailParameterTableViewCell.swift
  69. 0 208
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductInfo/ProductDetailProductInfoTableViewCell.swift
  70. 0 74
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductLabel/ProductDetailProductLabelIconCollectionViewCell.swift
  71. 0 217
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductLabel/ProductDetailProductLabelTableViewCell.swift
  72. 0 116
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailShop/ProductDetailShopTableViewCell.swift
  73. 0 63
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailFSPagerViewCell.swift
  74. 0 106
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailSectionHeader.swift
  75. 0 118
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift
  76. 0 101
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailProductSkuLabelCollectionViewCell.swift
  77. 0 60
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuSectionHeaerCollectionReusableView.swift
  78. 0 500
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuView.swift
  79. 0 580
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift
  80. 0 284
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/ViewController/ProductDetailViewController.swift
  81. 0 165
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductDetailHotSell/ProductDetailHotSellCollectionViewCell.swift
  82. 0 196
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift
  83. 0 173
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallRightSideleftPicture/ProductRightSideleftPictureCollectionViewCell.swift
  84. 0 175
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallSlidingLeftRight/ProductSlidingLeftRightCollectionViewCell.swift
  85. 0 162
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductSlidingTopBottom/ProductSlidingTopBottomCollectionViewCell.swift
  86. 0 43
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorBannerView.swift
  87. 0 166
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorCenterHeaderCollectionReusableView.swift
  88. 0 37
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorCenterTitleView.swift
  89. 0 162
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorFullLeftHeaderCollectionReusableView.swift
  90. 0 171
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorLeftHeaderCollectionReusableView.swift
  91. 0 54
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorTitleView.swift
  92. 0 182
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift
  93. 0 170
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift
  94. 0 16
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopSectionHeaderModel.swift
  95. 0 125
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopSectionHeaderView.swift
  96. 0 154
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopView.swift
  97. 0 196
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopViewShopInfoTableViewCell.swift
  98. 0 138
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopViewTableViewCell.swift
  99. 0 148
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/ViewController/ShopViewController.swift
  100. 0 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingCart/View/ShoppingCartAccountView.swift

Разница между файлами не показана из-за своего большого размера
+ 0 - 1096
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj


+ 1 - 1
RainbowPlanet/RainbowPlanet/Base/BaseTabbarViewController/BaseTabbarViewController.swift

@@ -110,7 +110,7 @@ class BaseTabbarViewController: NSObject {
         lottieAnimateContentView5 = BaseLottieAnimateContentView(jsonStr: "MineModuleTabbar")
         
         v1.tabBarItem = ESTabBarItem.init(lottieAnimateContentView1, title: "社区", image: UIImage(named: "tabbar_home")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
-        v2.tabBarItem = ESTabBarItem.init(lottieAnimateContentView2, title: "商城", image: UIImage(named: "tabbar_shopping")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
+        v2.tabBarItem = ESTabBarItem.init(lottieAnimateContentView2, title: "福利", image: UIImage(named: "tabbar_shopping")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
         v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
         v3.tabBarItem.imageInsets =  UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
         

+ 4 - 3
RainbowPlanet/RainbowPlanet/Modules/MineModule/PersonalCenter/UserPersonalCenter/View/OrderView/UserPersonalCenterOrderView.swift

@@ -63,10 +63,11 @@ extension UserPersonalCenterOrderView: UICollectionViewDelegateFlowLayout,UIColl
         
     }
     
+    //TODO: 订单
     func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        let vc = OrderViewController()
-        vc.orderVCType = OrderVCType(rawValue: indexPath.row)
-        findViewController().navigationController?.pushViewController(vc, animated: true)
+//        let vc = OrderViewController()
+//        vc.orderVCType = OrderVCType(rawValue: indexPath.row)
+//        findViewController().navigationController?.pushViewController(vc, animated: true)
     }
     
     func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {

+ 0 - 159
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderButtonTableViewCell.swift

@@ -1,159 +0,0 @@
-//
-//  OrderButtonTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class OrderButtonTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias SetButtonBlock = (_ button:UIButton,_ orderModel:OrderModel) -> Void
-    var setButtonBlock : SetButtonBlock?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderButtonTableViewCell {
-        let ID = "OrderButtonTableViewCell"
-        tableView.register(OrderButtonTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderButtonTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderButtonTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(oneButton)
-        addSubview(twoButton)
-    }
-    
-    private func setupLayouts() {
-
-        oneButton.snp.remakeConstraints { (make) in
-            make.top.equalTo(14)
-            make.height.equalTo(28)
-            make.width.greaterThanOrEqualTo(90)
-            make.right.equalTo(-14)
-            make.bottom.equalTo(-14)
-        }
-        twoButton.snp.remakeConstraints { (make) in
-            make.centerY.equalTo(oneButton)
-            make.height.equalTo(28)
-            make.width.greaterThanOrEqualTo(90)
-            make.right.equalTo(oneButton.snp_left).offset(-12)
-
-        }
-        
-    }
-    
-    lazy var oneButton: UIButton = {
-        let oneButton = UIButton(type: UIButton.ButtonType.custom)
-        oneButton.cornerRadius = 14
-        oneButton.masksToBounds = true
-        oneButton.titleLabel?.font = kRegularFont14
-        oneButton.isHidden = true
-        oneButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let setButtonBlock = self?.setButtonBlock {
-                setButtonBlock((self?.oneButton)!,(self?.orderModel)!)
-            }
-        }).disposed(by: disposeBag)
-        
-        return oneButton
-    }()
-    
-    lazy var twoButton: UIButton = {
-        let twoButton = UIButton(type: UIButton.ButtonType.custom)
-        twoButton.cornerRadius = 14
-        twoButton.masksToBounds = true
-        twoButton.titleLabel?.font = kRegularFont14
-        twoButton.isHidden = true
-        twoButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let setButtonBlock = self?.setButtonBlock {
-                setButtonBlock((self?.twoButton)!,(self?.orderModel)!)
-            }
-        }).disposed(by: disposeBag)
-        return twoButton
-    }()
-
-    var orderModel: OrderModel? {
-        didSet {
-            switch orderModel?.status {
-            case 0: //待付款
-                setButton(isHidden: false, button: oneButton, title: "去付款", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                setButton(isHidden: false, button: twoButton, title: "取消订单", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                 break
-            case 1://待发货
-               
-                if orderModel?.feedbackStatus == 0 {
-                    oneButton.isHidden = true
-                    twoButton.isHidden = true
-                }else {
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    twoButton.isHidden = true
-                }
-                
-                break
-            case 2: //待收货
-                if orderModel?.feedbackStatus == 0 {//没有维权
-                    setButton(isHidden: false, button: oneButton, title: "确认收货", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(isHidden: false, button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(isHidden: false, button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                }
-                break
-
-            case 6: //已完成
-                
-                if orderModel?.feedbackStatus == 0 { //没有维权
-                    if orderModel?.isComment == 0 { // 评价
-                        setButton(isHidden: false, button: oneButton, title: "去评价", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                        setButton(isHidden: false, button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                        
-                    }else {
-                        setButton(isHidden: false, button: oneButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                        twoButton.isHidden = true
-                    }
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(isHidden: false, button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                }
-                break
-            default:
-                break
-            }
-
-        }
-    }
-    
-    func setButton(isHidden:Bool,button:UIButton,title:String,titleColor:UIColor,backgroundColor:UIColor,borderColor:UIColor) {
-        button.isHidden = isHidden
-        button.setTitle(title, for: UIControl.State.normal)
-        button.setTitleColor(titleColor, for: UIControl.State.normal)
-        button.backgroundColor = backgroundColor
-        button.layer.borderColor = borderColor.cgColor
-        button.layer.borderWidth = 1
-    }
-}

+ 0 - 174
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeAndButtonTableViewCell.swift

@@ -1,174 +0,0 @@
-//
-//  OrderDeliveryModeAndButtonTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class OrderDeliveryModeAndButtonTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias SetButtonBlock = (_ button:UIButton,_ orderModel:OrderModel) -> Void
-    var setButtonBlock : SetButtonBlock?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDeliveryModeAndButtonTableViewCell {
-        let ID = "OrderDeliveryModeAndButtonTableViewCell"
-        tableView.register(OrderDeliveryModeAndButtonTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDeliveryModeAndButtonTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDeliveryModeAndButtonTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(addressLabel)
-        addSubview(oneButton)
-        addSubview(twoButton)
-    }
-    
-    private func setupLayouts() {
-        addressLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(14)
-            make.left.equalTo(12)
-            make.right.equalTo(-14)
-        }
-        oneButton.snp.remakeConstraints { (make) in
-            make.top.equalTo(addressLabel.snp.bottom).offset(14)
-            make.height.equalTo(28)
-            make.width.greaterThanOrEqualTo(90)
-            make.right.equalTo(-14)
-            make.bottom.equalTo(-14)
-        }
-        twoButton.snp.remakeConstraints { (make) in
-            make.centerY.equalTo(oneButton)
-            make.height.equalTo(28)
-            make.width.greaterThanOrEqualTo(90)
-            make.right.equalTo(oneButton.snp_left).offset(-12)
-        }
-        
-    }
-    
-    private lazy var addressLabel: UILabel = {
-        let addressLabel = UILabel()
-        addressLabel.textColor = kFE352BColor
-        addressLabel.font = kRegularFont13
-        addressLabel.numberOfLines = 0
-        return addressLabel
-    }()
-    
-     lazy var oneButton: UIButton = {
-        let oneButton = UIButton(type: UIButton.ButtonType.custom)
-        oneButton.cornerRadius = 14
-        oneButton.masksToBounds = true
-        oneButton.titleLabel?.font = kRegularFont14
-        oneButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let setButtonBlock = self?.setButtonBlock {
-                setButtonBlock(oneButton,(self?.orderModel)!)
-            }
-        }).disposed(by: disposeBag)
-
-        return oneButton
-    }()
-    
-    lazy var twoButton: UIButton = {
-        let twoButton = UIButton(type: UIButton.ButtonType.custom)
-        twoButton.cornerRadius = 14
-        twoButton.masksToBounds = true
-        twoButton.titleLabel?.font = kRegularFont14
-        twoButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let setButtonBlock = self?.setButtonBlock {
-                setButtonBlock(twoButton,(self?.orderModel)!)
-            }
-        }).disposed(by: disposeBag)
-        return twoButton
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            addressLabel.text = "自提地址:\(orderModel?.address ?? "")"
-            switch orderModel?.status {
-            case 0: //待付款
-                setButton(isHidden: false, button: oneButton, title: "去付款", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                setButton(isHidden: false, button: twoButton, title: "取消订单", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-            case 1://待发货
-                if orderModel?.feedbackStatus == 0 { //没有维权
-                    oneButton.isHidden = true
-                    twoButton.isHidden = true
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    twoButton.isHidden = true
-                }
-                break
-            case 3: //配送中
-                if orderModel?.feedbackStatus == 0 { //没有维权
-                    oneButton.isHidden = true
-                    twoButton.isHidden = true
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    twoButton.isHidden = true
-                }
-            case 4://待自提
-                
-                if orderModel?.feedbackStatus == 0 { //没有维权
-                    oneButton.isHidden = true
-                    twoButton.isHidden = true
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    twoButton.isHidden = true
-                }
-                
-            case 5: //已自提
-                
-                if orderModel?.feedbackStatus == 0 { //没有维权
-                    if orderModel?.isComment == 0 {
-                        setButton(isHidden: false, button: oneButton, title: "去评价", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                        twoButton.isHidden = true
-                    }else {
-                        oneButton.isHidden = true
-                        twoButton.isHidden = true
-                    }
-                }else {//维权
-                    setButton(isHidden: false, button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    twoButton.isHidden = true
-                }
-
-            default:
-                break
-            }
-        }
-    }
-    
-    func setButton(isHidden:Bool,button:UIButton,title:String,titleColor:UIColor,backgroundColor:UIColor,borderColor:UIColor) {
-        button.isHidden = isHidden
-        button.setTitle(title, for: UIControl.State.normal)
-        button.setTitleColor(titleColor, for: UIControl.State.normal)
-        button.backgroundColor = backgroundColor
-        button.layer.borderColor = borderColor.cgColor
-        button.layer.borderWidth = 1
-    }
-
-}

+ 0 - 96
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeAndTimeTableViewCell.swift

@@ -1,96 +0,0 @@
-//
-//  OrderDeliveryModeAndTimeTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDeliveryModeAndTimeTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDeliveryModeAndTimeTableViewCell {
-        let ID = "OrderDeliveryModeAndTimeTableViewCell"
-        tableView.register(OrderDeliveryModeAndTimeTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDeliveryModeAndTimeTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDeliveryModeAndTimeTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(deliveryModeLabel)
-        addSubview(timeLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        deliveryModeLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.height.equalTo(20)
-            make.left.equalTo(14)
-        }
-        timeLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.height.equalTo(1)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var deliveryModeLabel: UILabel = {
-        let deliveryModeLabel = UILabel()
-        deliveryModeLabel.backgroundColor = kf5f5f5Color
-        deliveryModeLabel.textColor = k333333Color
-        deliveryModeLabel.font = kRegularFont13
-        deliveryModeLabel.cornerRadius = 10
-        deliveryModeLabel.masksToBounds = true
-        return deliveryModeLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.textColor = k333333Color
-        timeLabel.font = kRegularFont13
-        return timeLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            if orderModel?.deliverType == 1 { //自提
-                deliveryModeLabel.text = "  自提  "
-            }else if orderModel?.deliverType == 2 { //快递
-                deliveryModeLabel.text = "  快递  "
-            }
-            timeLabel.text = orderModel?.createdAt
-        }
-    }
-
-}

+ 0 - 73
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderDeliveryModeTableViewCell.swift

@@ -1,73 +0,0 @@
-//
-//  OrderDeliveryModeTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDeliveryModeTableViewCell: UITableViewCell {
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDeliveryModeTableViewCell {
-        let ID = "OrderDeliveryModeTableViewCell"
-        tableView.register(OrderDeliveryModeTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDeliveryModeTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDeliveryModeTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(addressLabel)
-    }
-    
-    private func setupLayouts() {
-        addressLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(14)
-            make.left.equalTo(12)
-            make.bottom.equalTo(-12)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var addressLabel: UILabel = {
-        let addressLabel = UILabel()
-        addressLabel.textColor = kFE352BColor
-        addressLabel.font = kRegularFont13
-        addressLabel.numberOfLines = 0
-        return addressLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            if orderModel?.feedbackStatus == 0 { //未维权
-                switch orderModel?.status {
-                case 1,2,3,4,5,7: //待发货/待收货/配送中/待自提/已自提/已关闭
-                   addressLabel.text = "自提地址:\(orderModel?.address ?? "")"
-                default: //待付款/已自提/已完成
-                    break
-                }
-            }else {//1-退款处理中/2-退款完成/3-拒绝退款
-                
-            }
-        }
-    }
-}

+ 0 - 87
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderFreightTableViewCell.swift

@@ -1,87 +0,0 @@
-//
-//  OrderFreightTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/21.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderFreightTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderFreightTableViewCell {
-        let ID = "OrderFreightTableViewCell"
-        tableView.register(OrderFreightTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderFreightTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderFreightTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(freightLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.top.bottom.equalToSuperview()
-        }
-        freightLabel.snp.makeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.top.bottom.equalToSuperview()
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.left.equalTo(titleLabel)
-            make.right.equalTo(freightLabel)
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "运费"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        return titleLabel
-    }()
-    
-    private lazy var freightLabel: UILabel = {
-        let freightLabel = UILabel()
-        freightLabel.textColor = k333333Color
-        freightLabel.font = kRegularFont14
-        return freightLabel
-    }()
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            freightLabel.text = priceConversion(price: orderModel?.transPrice ?? 0)
-        }
-    }
-
-}

+ 0 - 40
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderListView.swift

@@ -1,40 +0,0 @@
-//
-//  OrderListView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderListView: BaseView {
-
-    override func setupViews() {
-        addSubview(tableView)
-
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: "无订单", detailStr: "忙里偷闲,去下一单")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-        
-    }
-    
-    override func setupLayouts() {
-        tableView.snp.makeConstraints { (make) in
-            make.top.edges.equalToSuperview()
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-
-}
-

+ 0 - 149
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderProductTableViewCell.swift

@@ -1,149 +0,0 @@
-//
-//  OrderProductTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class OrderProductTableViewCell: UITableViewCell {
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderProductTableViewCell {
-        let ID = "OrderProductTableViewCell"
-        tableView.register(OrderProductTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderProductTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderProductTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(productImageView)
-        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.size.equalTo(80)
-        }
-
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(productImageView.snp.right).offset(12)
-            make.top.equalTo(20)
-            make.right.equalTo(priceLabel.snp.left).offset(-12)
-            make.height.equalTo(20)
-        }
-        timeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(8)
-            make.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        skuLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(timeLabel.snp.bottom).offset(8)
-            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)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var productImageView: UIImageView = {
-        let productImageView = UIImageView()
-        productImageView.image = kImage(name: "default_pic")
-        productImageView.contentMode = .scaleAspectFill
-        productImageView.masksToBounds = true
-        return productImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        return titleLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.textColor = k666666Color
-        timeLabel.font = kRegularFont12
-        return timeLabel
-    }()
-    
-    private lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.textColor = k999999Color
-        skuLabel.font = kRegularFont12
-        return skuLabel
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = k333333Color
-        priceLabel.font = kRegularFont14
-        return priceLabel
-    }()
-    
-    private lazy var numberLabel: UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.textColor = k999999Color
-        numberLabel.font = kRegularFont13
-        return numberLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModelDetailModel: OrderModelDetailModel? {
-        didSet {
-            productImageView.kf.setImage(with: kURLImage(name: orderModelDetailModel?.productImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = orderModelDetailModel?.productName
-            timeLabel.text = "预计配送时间:\(orderModelDetailModel?.receiveTime ?? "")"
-            skuLabel.text = "规格:\(orderModelDetailModel?.skuName ?? "")"
-            priceLabel.text = "\(priceConversion(price: orderModelDetailModel?.productPrice ?? 0))"
-            numberLabel.text = "x\(orderModelDetailModel?.amount ?? 0)"
-        }
-    }
-}

+ 0 - 164
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderShopAndStatusTableViewCell.swift

@@ -1,164 +0,0 @@
-//
-//  OrderShopAndStatusTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class OrderShopAndStatusTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias ShopClosure = (_ orderModel: OrderModel) -> Void
-    var shopClosure : ShopClosure?
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderShopAndStatusTableViewCell {
-        let ID = "OrderShopAndStatusTableViewCell"
-        tableView.register(OrderShopAndStatusTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderShopAndStatusTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderShopAndStatusTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(shopButton)
-        addSubview(statusLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        shopButton.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-        }
-        shopButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 5)
-        statusLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.height.equalTo(1)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var shopButton: UIButton = {
-        let shopButton = UIButton(type: UIButton.ButtonType.custom)
-        shopButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        shopButton.titleLabel?.font = kRegularFont14
-        shopButton.setImage(kImage(name: "my_arrows_unfold"), for: UIControl.State.normal)
-        shopButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if self?.orderModel != nil {
-                if let shopClosure = self?.shopClosure {
-                    shopClosure((self?.orderModel)!)
-                }
-            }
-            
-            if self?.orderDetailModel != nil {
-                if let shopClosure = self?.shopClosure {
-                    shopClosure((self?.orderDetailModel)!)
-                }
-            }
-            
-        }).disposed(by: disposeBag)
-        return shopButton
-    }()
-        
-    private lazy var statusLabel: UILabel = {
-        let statusLabel = UILabel()
-        statusLabel.font = kRegularFont14
-        return statusLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            shopButton.setTitle(orderModel?.shopName ?? "", for: UIControl.State.normal)
-            shopButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 5)
-            
-            if orderModel?.feedbackStatus == 0 { //未维权
-                switch orderModel?.status {
-                case 0: //待付款
-                     statusLabel.text = "待付款"
-                     statusLabel.textColor = kFFA42FColor
-                    break
-                case 1: //待发货
-                    statusLabel.text = "待发货"
-                    statusLabel.textColor = kFFA42FColor
-                case 2: //已发货/待收货
-                    statusLabel.text = "待收货"
-                    statusLabel.textColor = k333333Color
-                case 3: //配送中
-                    statusLabel.text = "配送中"
-                    statusLabel.textColor = kFFA42FColor
-                case 4: //待自提
-                    statusLabel.text = "待自提"
-                    statusLabel.textColor = kFFA42FColor
-                case 5: //已自提
-                    statusLabel.text = "已自提"
-                    statusLabel.textColor = k333333Color
-                    
-                case 6: //已完成
-                    statusLabel.text = "已完成"
-                    statusLabel.textColor = k333333Color
-                case 7: //已关闭
-                    statusLabel.text = "已关闭"
-                    statusLabel.textColor = k333333Color
-                    
-                default:
-                    break
-                }
-            }else {
-                switch orderModel?.feedbackStatus {
-                case 1: //1-退款处理中
-                    statusLabel.text = "退款中"
-                    statusLabel.textColor = kFFA42FColor
-                case 2: //2-退款完成
-                    statusLabel.text = "退款完成"
-                    statusLabel.textColor = k333333Color
-                case 3: //3-拒绝退款
-                    statusLabel.text = "退款失败"
-                    statusLabel.textColor = k333333Color
-                default:
-                    break
-                }
-            }
-        }
-    }
-    
-    var orderDetailModel: OrderModel? {
-        didSet {
-            shopButton.setTitle(orderDetailModel?.shopName ?? "", for: UIControl.State.normal)
-            shopButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 5)
-        }
-    }
-}

+ 0 - 91
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderTotalAmountTableViewCell.swift

@@ -1,91 +0,0 @@
-//
-//  OrderTotalAmountTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderTotalAmountTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderTotalAmountTableViewCell {
-        let ID = "OrderTotalAmountTableViewCell"
-        tableView.register(OrderTotalAmountTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderTotalAmountTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderTotalAmountTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(moneyLabel)
-        addSubview(numberLabel)
-        addSubview(lineLabel)
-        
-    }
-    
-    private func setupLayouts() {
-        moneyLabel.snp.remakeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.centerY.equalToSuperview()
-        }
-        numberLabel.snp.remakeConstraints { (make) in
-            make.right.equalTo(moneyLabel.snp.left)
-            make.centerY.equalToSuperview()
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.height.equalTo(1)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var moneyLabel: UILabel = {
-        let moneyLabel = UILabel()
-        moneyLabel.textColor = kFE352BColor
-        moneyLabel.font = kBoldFont13
-        return moneyLabel
-    }()
-    
-    private lazy var numberLabel: UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.textColor = k999999Color
-        numberLabel.font = kRegularFont14
-        return numberLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            moneyLabel.text = "\(priceConversion(price: orderModel?.realPrice ?? 0))"
-            let str = "共\(orderModel?.amount ?? 0)件商品,合计"
-            let attributedString = str.changeTextColor(rangStr: "\(orderModel?.amount ?? 0)", rangColor: k333333Color)
-            numberLabel.attributedText = attributedString
-        }
-    }
-
-}

+ 0 - 429
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift

@@ -1,429 +0,0 @@
-//
-//  OrderListViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import JXSegmentedView
-import RxSwift
-
-public var kOrderVCTypeAlliSRefresh : Bool = false 
-
-class OrderListViewController: UIViewController {
-    
-    deinit {
-        if observe != nil {
-            NotificationCenter.default.removeObserver(observe!)
-        }
-    }
-    weak var observe : NSObjectProtocol?
-
-    let disposeBag = DisposeBag()
-    
-    var orderVCType : OrderVCType?
-    var orderModelArray = Array<OrderModel>()
-    
-    var change : Bool? {
-        didSet {
-            orderPurchaseOrderListApi(page:1)
-        }
-    }
-    
-    typealias SetButtonBlock = (_ button:UIButton,_ orderModel:OrderModel) -> Void
-    var setButtonBlock : SetButtonBlock?
-    
-    typealias ShopButtonBlock = (OrderModel) -> Void
-    var shopButtonBlock : ShopButtonBlock?
-    
-    typealias DidSelectBlock = (_ orderModel:OrderModel) -> Void
-    var didSelectBlock : DidSelectBlock?
-    
-    typealias ProductDidSelectBlock = (OrderModel,OrderModelDetailModel) -> Void
-    var productDidSelectBlock : ProductDidSelectBlock?
-    
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    func setupViews() {
-        view.addSubview(orderListView)
-    }
-    
-    func setupLayouts() {
-        orderListView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    func setupData() {
-        orderListView.tableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.orderPurchaseOrderListApi(page: page)
-        }
-        orderListView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
-            [weak self] (page) in
-            self?.orderPurchaseOrderListApi(page: page)
-        })
-        
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("OrderListVCAll"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
-            self?.orderPurchaseOrderListApi(page: 1)
-        }
-    }
-    
-    
-    /// 订单列表
-    ///
-    /// - Parameter page: <#page description#>
-    func orderPurchaseOrderListApi(page:Int = 1) {
-        
-        SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseOrderListApi(page: page, status: orderVCType.map { $0.rawValue } ?? -1) {
-            [weak self] (orderListModel) -> (Void) in
-            let orderListModel = orderListModel as? OrderListModel
-            if orderListModel?.pagination?.currentPage ?? 1  <= orderListModel?.pagination?.totalPages ?? 1 {
-                if orderListModel?.pagination?.currentPage == 1{
-                    self?.orderModelArray.removeAll()
-                    self?.orderListView.tableView.resetNoMoreData()
-                }
-                self?.orderModelArray = (self?.orderModelArray)! + (orderListModel?.data!)!
-                self?.orderListView.tableView.reloadData()
-                if self?.orderModelArray.isEmpty ?? true {
-                    self?.orderListView.tableView.endFooterNoMoreData()
-                }
-            }else {
-                self?.orderListView.tableView.endFooterNoMoreData()
-            }
-        }
-    }
-    
-    func setButton(button:UIButton,orderModel:OrderModel) {
-        if let setButtonBlock = setButtonBlock {
-            setButtonBlock(button,orderModel)
-        }
-    }
-    
-    private lazy var orderListView: OrderListView = {
-        let orderListView = OrderListView()
-        orderListView.tableView.dataSource = self
-        orderListView.tableView.delegate = self
-        return orderListView
-    }()
-}
-
-extension OrderListViewController : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        
-        return orderModelArray.isEmpty ? 0 : orderModelArray.count
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        let orderModel = orderModelArray[section]
-        
-        
-        if !(orderModel.detail?.isEmpty ?? true) {
-            switch orderModel.deliverType {
-            case 1: //自提
-                if orderModel.feedbackStatus == 0 { //未维权
-                    switch orderModel.status {
-                    case 0: //待付款
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 1: //待发货
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 3: //配送中
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 4: //待自提
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 5: //已自提
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 7: //已关闭
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    default:
-                        return 0
-                    }
-                }else {
-                    return 4 + (orderModel.detail?.count ?? 0)
-                }
-               
-            case 2: //快递
-                if orderModel.feedbackStatus == 0 { //未维权
-                    switch orderModel.status {
-                    case 0: //待付款
-                        return 5 + (orderModel.detail?.count ?? 0)
-                    case 1: //待发货
-                        return 4 + (orderModel.detail?.count ?? 0)
-                    case 2: //已发货/待收货
-                        return 5 + (orderModel.detail?.count ?? 0)
-                    case 6: //已完成
-                        return 5 + (orderModel.detail?.count ?? 0)
-                    case 7: //已关闭
-                         return 4 + (orderModel.detail?.count ?? 0)
-                    default:
-                        return 0
-                    }
-                }else {
-                    return 5 + (orderModel.detail?.count ?? 0)
-                }
-            default:
-                return 0
-            }
-        }else {
-            return 0
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let orderModel = orderModelArray[indexPath.section]
-        let details = orderModel.detail
-        
-        if  orderModel.deliverType == 1 { //自提
-            switch indexPath.row {
-            case 0:
-                let cell = OrderShopAndStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.shopClosure = {
-                    [weak self] orderModel in
-                    if let shopButtonBlock = self?.shopButtonBlock {
-                        shopButtonBlock(orderModel)
-                    }
-                }
-                cell.orderModel = orderModel
-                return cell
-            case 1:
-                let cell = OrderDeliveryModeAndTimeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = orderModel
-                return cell
-            case details!.count + 2:
-                let cell = OrderTotalAmountTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = orderModel
-                return cell
-            case details!.count + 3:
-                    switch orderModel.status {
-                    case 0:
-                        let cell = OrderDeliveryModeAndButtonTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.orderModel = orderModel
-                        cell.setButtonBlock = {
-                            [weak self] (button,orderModel) in
-                            self?.setButton(button: button,orderModel:orderModel)
-                            
-                        }
-                        return cell
-                    case 5:
-                        if orderModel.isComment == 0 {
-                            let cell = OrderDeliveryModeAndButtonTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                            cell.orderModel = orderModel
-                            cell.setButtonBlock = {
-                                [weak self] (button,orderModel) in
-                                self?.setButton(button: button,orderModel:orderModel)
-                                
-                            }
-                            return cell
-                        }else {
-                            let cell = OrderDeliveryModeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                            cell.orderModel = orderModel
-                            return cell
-                        }
-                        
-                    case 1,3,4:
-                        if orderModel.feedbackStatus == 0 {
-                            let cell = OrderDeliveryModeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                            cell.orderModel = orderModel
-                            return cell
-                        }else {
-                            let cell = OrderDeliveryModeAndButtonTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                            cell.orderModel = orderModel
-                            cell.setButtonBlock = {
-                                [weak self] (button,orderModel) in
-                                self?.setButton(button: button,orderModel:orderModel)
-                            }
-                            return cell
-                        }
-                    case 7:
-                        let cell = OrderDeliveryModeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.orderModel = orderModel
-                        return cell
-                    default:
-                        return UITableViewCell()
-                    }
-            default:
-                let cell = OrderProductTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModelDetailModel = details?[indexPath.row - 2]
-                return cell
-            }
-        }else  if  orderModel.deliverType == 2 { //快递
-            switch indexPath.row {
-            case 0:
-                let cell = OrderShopAndStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.shopClosure = {
-                    [weak self] orderModel in
-                    if let shopButtonBlock = self?.shopButtonBlock {
-                        shopButtonBlock(orderModel)
-                    }
-                }
-                cell.orderModel = orderModel
-                return cell
-            case 1:
-                let cell = OrderDeliveryModeAndTimeTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = orderModel
-                return cell
-            case details!.count + 2:
-                let cell = OrderFreightTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = orderModel
-                return cell
-            case details!.count + 3:
-                let cell = OrderTotalAmountTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = orderModel
-                return cell
-            case details!.count + 4:
-                let orderModel = orderModel
-                switch orderModel.status {
-                case 0,2,6:
-                    let cell = OrderButtonTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    cell.orderModel = orderModel
-                    cell.setButtonBlock = {
-                        [weak self] (button,orderModel) in
-                        self?.setButton(button: button,orderModel:orderModel)
-                        
-                    }
-                    return cell
-                case 1:
-                    if orderModel.feedbackStatus != 0 {
-                        let cell = OrderButtonTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.orderModel = orderModel
-                        cell.setButtonBlock = {
-                            [weak self] (button,orderModel) in
-                            self?.setButton(button: button,orderModel:orderModel)
-                        }
-                        return cell
-                    }else {
-                        return UITableViewCell()
-                    }
-                default:
-                    return UITableViewCell()
-                }
-            default:
-                let cell = OrderProductTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModelDetailModel = details?[indexPath.row - 2]
-                return cell
-            }
-        }else {
-            return UITableViewCell()
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        let orderModel = orderModelArray[indexPath.section]
-        let details = orderModel.detail
-        switch indexPath.row {
-        case 0:
-            return 48
-        case 1:
-           return 40
-        case details!.count + 2:
-            return 40
-        case details!.count + 3:
-            if orderModel.deliverType == 1 { //自提
-                return UITableView.automaticDimension
-            }else if orderModel.deliverType == 2 { //快递
-                return 40
-            }else {
-                return 0
-            }
-        case details!.count + 4:
-            return UITableView.automaticDimension
-        default:
-            return 108
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        
-        let orderModel = orderModelArray[indexPath.section]
-        let details = orderModel.detail
-        if orderModel.deliverType == 1 { //自提
-            switch indexPath.row {
-            case details!.count + 3:
-                break
-            default:
-                if let didSelectBlock = didSelectBlock {
-                    didSelectBlock(orderModel)
-                }
-                break
-            }
-        }else if orderModel.deliverType == 2 { //快递
-            switch indexPath.row {
-            case details!.count + 4:
-                break
-            default:
-                if let didSelectBlock = didSelectBlock {
-                    didSelectBlock(orderModel)
-                }
-                break
-            }
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-}
-
-
-extension OrderListViewController : JXSegmentedListContainerViewListDelegate {
-    func listView() -> UIView {
-        
-        return view
-    }
-    
-    func listDidAppear() {
-        if self.orderVCType == .all && kOrderVCTypeAlliSRefresh {
-            orderPurchaseOrderListApiAll()
-        }
-    }
-    
-    /// 订单列表
-    ///
-    /// - Parameter page: <#page description#>
-    func orderPurchaseOrderListApiAll(page:Int = 1) {
-        
-        SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseOrderListApi(page: page, status: -1) {
-            [weak self] (orderListModel) -> (Void) in
-            let orderListModel = orderListModel as? OrderListModel
-            if orderListModel?.pagination?.currentPage ?? 1  <= orderListModel?.pagination?.totalPages ?? 1 {
-                if orderListModel?.pagination?.currentPage == 1{
-                    self?.orderModelArray.removeAll()
-                    self?.orderListView.tableView.resetNoMoreData()
-                }
-                self?.orderModelArray = (self?.orderModelArray)! + (orderListModel?.data!)!
-                self?.orderListView.tableView.reloadData()
-                if self?.orderModelArray.isEmpty ?? true {
-                    self?.orderListView.tableView.endFooterNoMoreData()
-                }
-            }else {
-                self?.orderListView.tableView.endFooterNoMoreData()
-            }
-            kOrderVCTypeAlliSRefresh = false
-        }
-    }
-}

+ 0 - 266
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift

@@ -1,266 +0,0 @@
-//
-//  OrderListViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import JXSegmentedView
-
-/// 我的订单类型
-///
-/// - all: 全部
-/// - pendingPayment: 待付款
-/// - toBeShipped: 待收货
-/// - toBeReceived: 待发货
-/// - toBeEvaluated: 待评价
-/// - refund: 退款
-enum OrderVCType : Int {
-    case all = -1
-    case pendingPayment = 0
-    case toBeShipped = 1
-    case toBeReceived = 2
-    case toBeEvaluated = 3
-    case refund = 4
-    
-}
-
-class OrderViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    deinit {
-        NotificationCenter.default.removeObserver(observe!)
-    }
-    weak var observe : NSObjectProtocol?
-    
-    var orderVCType : OrderVCType?
-    
-    var orderListViewController : OrderListViewController?
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "我的订单"
-        view.addSubview(segmentedView)
-        view.addSubview(listContainerView)
-    }
-    
-    override func setupLayouts() {
-        
-        segmentedView.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.height.equalTo(44)
-            make.top.equalTo(kNavBarTotalHeight)
-
-        }
-        listContainerView.snp.makeConstraints { (make) in
-            make.top.equalTo(segmentedView.snp.bottom)
-            make.left.right.bottom.equalToSuperview()
-        }
-    }
-    
-    override func setupData() {
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("OrderFinishPayVCOrderDetail"), object: nil, queue: OperationQueue.main) {
-            [weak self] (notification) in
-            self?.orderListViewController?.orderPurchaseOrderListApi(page: 1)
-        }
-    }
-    
-    //1.初始化JXSegmentedView
-    lazy var segmentedView: JXSegmentedView = {
-        let segmentedView = JXSegmentedView()
-        segmentedView.delegate = self
-        segmentedView.dataSource = segmentedDataSource
-        segmentedView.indicators = [indicator]
-        segmentedView.contentScrollView = listContainerView.scrollView
-        segmentedView.selectItemAt(index: orderVCType!.rawValue+1)
-        segmentedView.defaultSelectedIndex = orderVCType!.rawValue+1
-        return segmentedView
-    }()
-    
-    //2.初始化dataSource
-    lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
-        let segmentedDataSource = JXSegmentedTitleDataSource()
-        segmentedDataSource.titles = ["全部","待付款","待发货","待收货","待评价","退款"]
-        segmentedDataSource.isTitleColorGradientEnabled = true
-        segmentedDataSource.isItemSpacingAverageEnabled = true
-        segmentedDataSource.titleNormalColor = k333333Color
-        segmentedDataSource.titleSelectedColor = kFFA42FColor
-        segmentedDataSource.titleNormalFont = kRegularFont14!
-        segmentedDataSource.titleSelectedFont = kBoldFont14
-        
-        //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
-        segmentedDataSource.reloadData(selectedIndex: orderVCType!.rawValue+1)
-        
-        return segmentedDataSource
-    }()
-    //3.初始化指示器indicator
-    lazy var indicator: JXSegmentedIndicatorLineView = {
-        let indicator = JXSegmentedIndicatorLineView()
-        indicator.indicatorColor = kFFA42FColor
-        indicator.indicatorHeight = 4
-        indicator.indicatorWidth = 20
-        return indicator
-    }()
-    
-    //4.初始化JXSegmentedListContainerView
-    lazy var listContainerView: JXSegmentedListContainerView = {
-        let listContainerView = JXSegmentedListContainerView(dataSource: self)
-        listContainerView.didAppearPercent = 0.01
-        listContainerView.defaultSelectedIndex = orderVCType!.rawValue + 1
-        return listContainerView
-    }()
-    
-}
-
-extension OrderViewController : JXSegmentedViewDelegate {
-    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
-    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
-
-    }
-    
-    // 点击选中的情况才会调用该方法
-    func segmentedView(_ segmentedView: JXSegmentedView, didClickSelectedItemAt index: Int) {
-        //传递didClickSelectedItemAt事件给listContainerView,必须调用!!!
-        listContainerView.didClickSelectedItem(at: index)
-    }
-    
-    // 滚动选中的情况才会调用该方法
-    func segmentedView(_ segmentedView: JXSegmentedView, didScrollSelectedItemAt index: Int) {
-        
-    }
-    
-    // 正在滚动中的回调
-    func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
-        //传递scrolling事件给listContainerView,必须调用!!!
-        listContainerView.segmentedViewScrolling(from: leftIndex, to: rightIndex, percent: percent, selectedIndex: segmentedView.selectedIndex)
-    }
-    
-    /// 是否允许点击选中目标index的item
-    func segmentedView(_ segmentedView: JXSegmentedView, canClickItemAt index: Int) -> Bool {
-        return true
-    }
-}
-
-extension OrderViewController :JXSegmentedListContainerViewDataSource {
-    
-    func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
-        if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
-            return titleDataSource.dataSource.count
-        }
-        return 0
-    }
-    func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
-        let vc = OrderListViewController()
-        vc.orderVCType =  OrderVCType(rawValue: index-1)
-        vc.setButtonBlock = {
-            [weak self] (button,orderModel) in
-            self?.orderListViewController = vc
-            self?.setButton(button: button, orderModel: orderModel, vc: vc)
-        }
-        vc.shopButtonBlock = {
-            [weak self] (orderModel) in
-            let vc1 = ShopViewController()
-            vc1.shopId = orderModel.shopId
-            self?.navigationController?.pushViewController(vc1, animated: true)
-        }
-        
-        vc.didSelectBlock = {
-            [weak self] (orderModel) in
-            let orderDetailVC = OrderDetailViewController()
-            orderDetailVC.orderModel = orderModel
-            orderDetailVC.cancelOrderClosure = {
-                vc.orderPurchaseOrderListApi(page: 1)
-            }
-            self?.navigationController?.pushViewController(orderDetailVC, animated: true)
-        }
-        vc.productDidSelectBlock = {
-            [weak self]  (orderModel,orderModelDetailModel) in
-            let vc = ProductDetailViewController()
-            vc.productId = orderModelDetailModel.productId
-            vc.shopId = orderModel.shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        return vc
-    }
-    
-    func setButton(button:UIButton,orderModel:OrderModel,vc: OrderListViewController) {
-        if button.titleLabel?.text == "去付款" {
-            // 弹出支付方式View
-            let orderPayModel = OrderCreateBackModel()
-            orderPayModel.money = "\(orderModel.patchMoney ?? 0)"
-            orderPayModel.patchNum = orderModel.patchNum
-            PayManagerPay.shared.payAlertView(orderPayModel: orderPayModel, orderFinishPayVCType: .order, vc: self)
-            PayManagerPay.shared.reloadClosure = {
-                vc.orderPurchaseOrderListApi(page: 1)
-            }
-        }
-        if button.titleLabel?.text == "取消订单" {
-            orderPurchaseCloseApi(orderModel: orderModel, vc: vc)
-        }
-        if button.titleLabel?.text == "确认收货" {
-            orderPurchaseConfirmApi(orderModel: orderModel, vc: vc)
-        }
-        if button.titleLabel?.text == "查看物流" {
-            let vc = OrderLogisticsController()
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "退款详情" {
-            let vc = OrderRefunddetailsViewController()
-            vc.refundNo = orderModel.refundNo
-            vc.orderRefunddetailsVCType = .order
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "去评价" {            
-            let vc1 = OrderCommentController()
-            vc1.orderDetailModel = orderModel
-            vc1.commentSuccessedBlock = {
-                kOrderVCTypeAlliSRefresh = true
-                vc.orderPurchaseOrderListApi(page: 1)
-            }
-            self.navigationController?.pushViewController(vc1, animated: true)
-        }
-        if button.titleLabel?.text == "再次购买" {
-            let vc = ShopViewController()
-            vc.shopId = orderModel.shopId
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "申请退款" {
-            let vc = OrderApplyRefundController()
-            vc.orderDetailModel = orderModel
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-    }
-    
-    /// 取消订单
-    func orderPurchaseCloseApi(orderModel:OrderModel,vc: OrderListViewController) {
-        
-        AlertSheetView.alert(title: "是否取消订单", cancelTitle: "取消", sureTitle: "确定", cancelBlock: nil) { (popupView, index, str) in
-            SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseCloseApi(patchNum: orderModel.patchNum ?? "") { (data) -> (Void) in
-                kOrderVCTypeAlliSRefresh = true
-                vc.orderPurchaseOrderListApi(page: 1)
-            }
-        }
-        
-    }
-    
-    /// 确认收货
-    func orderPurchaseConfirmApi(orderModel:OrderModel,vc: OrderListViewController) {
-        AlertSheetView.alert(title: "是否确认收货", cancelTitle: "取消", sureTitle: "确定", cancelBlock: nil) { (popupView, index, str) in
-            SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseConfirmApi(purchaseId: orderModel.id ?? 0) { (data) -> (Void) in
-                kOrderVCTypeAlliSRefresh = true
-                vc.orderPurchaseOrderListApi(page: 1)
-            }
-        }
-    }
-}

+ 0 - 117
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundAccountCell.swift

@@ -1,117 +0,0 @@
-//
-//  OrderApplyRefundAccountCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  申请退款--全选/退款金额Cell
-
-import UIKit
-import RxSwift
-
-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
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundAccountCell {
-        let ID = "OrderApplyRefundAccountCell"
-        tableView.register(OrderApplyRefundAccountCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderApplyRefundAccountCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundAccountCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(allSelectBtn)
-        addSubview(priceLabel)
-    }
-    
-    private func setupLayouts() {
-        
-        priceLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(14)
-            make.bottom.equalTo(-14)
-            make.right.equalTo(-14)
-            make.height.equalTo(20)
-        }
-        
-        allSelectBtn.snp.makeConstraints { (make) in
-            make.left.equalToSuperview().offset(10)
-            make.centerY.equalTo(priceLabel)
-            make.width.equalTo(54)
-            make.height.equalTo(30)
-        }
-        allSelectBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 4)
-    }
-    
-    private lazy var allSelectBtn: UIButton = {
-        let allSelectBtn = UIButton(type: UIButton.ButtonType.custom)
-        allSelectBtn.setTitle("全选", for: UIControl.State.normal)
-        allSelectBtn.setTitleColor(k333333Color, for: UIControl.State.normal)
-        allSelectBtn.setTitleColor(k666666Color, for: UIControl.State.selected)
-        allSelectBtn.setImage(kImage(name: "common_uncheck_icon"), for: UIControl.State.normal)
-        allSelectBtn.setImage(kImage(name: "common_check_icon"), for: UIControl.State.selected)
-        allSelectBtn.titleLabel?.font = kRegularFont14
-        allSelectBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.allSelectBtn.isSelected = !(self?.allSelectBtn.isSelected)!
-            if let allSelectBlock = self?.allSelectBlock {
-                let isAllSel: Int = self?.allSelectBtn.isSelected == true ? 1 : 0
-                allSelectBlock(isAllSel)
-            }            
-        }).disposed(by: disposeBag)
-        return allSelectBtn
-    }()
-    
-    lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = k333333Color
-        priceLabel.font = kRegularFont14
-        return priceLabel
-    }()
-    
-    // 退款金额
-    var refundPrice: Int? {
-        didSet {
-            
-            let str = "退款金额 \(priceConversion(price: refundPrice ?? 0))"
-            if refundPrice != nil {
-                let attributedString = NSMutableAttributedString.init(string: str)
-                
-                attributedString.changeForegroundColor(kFE352BColor, range: NSRange(location: 4, length: str.count-4))
-                
-                attributedString.changeSystemFont(kBoldFont16, range: NSRange(location: 4, length: str.count-4))
-                priceLabel.attributedText = attributedString
-            }
-        }
-    }
-    
-}
-

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

@@ -1,103 +0,0 @@
-//
-//  OrderApplyRefundNoteInfoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import IQKeyboardManagerSwift
-
-class OrderApplyRefundNoteInfoCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias NoteTextViewClosure = (_ text: String) -> Void
-    var noteTextViewClosure : NoteTextViewClosure?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundNoteInfoCell {
-        let ID = "OrderApplyRefundNoteInfoCell"
-        tableView.register(OrderApplyRefundNoteInfoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderApplyRefundNoteInfoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundNoteInfoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(noteTextView)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.left.equalTo(14)
-            make.width.equalTo(56)
-            make.height.equalTo(20)
-        }
-        noteTextView.snp.remakeConstraints { (make) in
-            make.top.equalTo(6).priority(999)
-            make.height.greaterThanOrEqualTo(46).priority(888)
-            make.bottom.equalTo(-6).priority(777)
-            make.left.equalTo(titleLabel.snp_right).offset(20)
-            make.right.equalToSuperview().offset(-14)
-        }
-    }
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        titleLabel.text = "备注信息"
-        return titleLabel
-    }()
-    
-    lazy var noteTextView: IQTextView = {
-        let noteTextView = IQTextView()
-        noteTextView.backgroundColor = kffffffColor
-        noteTextView.textColor = k999999Color
-        noteTextView.font = kRegularFont14
-        noteTextView.placeholder = "如需部分商品退款请备注退款商品的名称和数量,如订单疑问可通过“我的”联系社长哦"
-        noteTextView.placeholderTextColor = k999999Color
-        noteTextView.isScrollEnabled = false
-        noteTextView.delegate = self
-        return noteTextView
-    }()
-    
-}
-
-extension OrderApplyRefundNoteInfoCell: UITextViewDelegate {
-    
-    func textViewDidChange(_ textView: UITextView) {
-        if textView == noteTextView {
-            var fullStr = textView.text ?? ""
-            if textView.text?.count ?? 0 > 180 {
-                fullStr = String(fullStr.prefix(150)) as String
-                textView.text = fullStr
-            }
-            
-            if let noteTextViewClosure = self.noteTextViewClosure {
-                noteTextViewClosure(self.noteTextView.text ?? "")
-            }
-        }
-    }
-    
-}

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

@@ -1,79 +0,0 @@
-//
-//  OrderApplyRefundPhoneCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-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)
-        let cell : OrderApplyRefundPhoneCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundPhoneCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(phoneLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.left.equalTo(14)
-            make.bottom.equalTo(-14)
-            make.width.equalTo(56)
-            make.height.equalTo(20)
-        }
-        phoneLabel.snp.makeConstraints { (make) in            
-            make.left.equalTo(titleLabel.snp_right).offset(20)
-            make.centerY.equalTo(titleLabel)
-            make.height.equalTo(20)
-        }
-    }
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        titleLabel.text = "手机号码"
-        return titleLabel
-    }()
-    
-    lazy var phoneLabel: UILabel = {
-        let phoneLabel = UILabel()
-        phoneLabel.textColor = k333333Color
-        phoneLabel.font = kRegularFont14
-        phoneLabel.text = "158xxxxxxxx"
-        return phoneLabel
-    }()
-    
-}

+ 0 - 197
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundPhotoCell.swift

@@ -1,197 +0,0 @@
-//
-//  OrderApplyRefundPhotoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderApplyRefundPhotoCell: UITableViewCell {
-    
-    private let maxImageCount: Int = 3
-    
-    typealias ChoosePicBlock = () -> Void
-    var choosePicBlock : ChoosePicBlock?
-    
-    typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
-    var delPicTransBlock : DelPicTransBlock?
-    
-    var imgCount: Int = 0
-    var goodsImageArr: Array<UIImage>? {
-        didSet {
-            imgCount = self.goodsImageArr?.count ?? 0
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundPhotoCell {
-        let ID = "OrderApplyRefundPhotoCell"
-        tableView.register(OrderApplyRefundPhotoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderApplyRefundPhotoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundPhotoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(titleLabel)
-        addSubview(collectionView)
-        addSubview(rmdBackView)
-        rmdBackView.addSubview(remindLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.top.equalTo(14)
-            make.height.equalTo(20)
-        }
-        collectionView.snp.makeConstraints { (make) in
-            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)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(69)
-        }
-        remindLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(20)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(20)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "拍照上传问题"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        titleLabel.textAlignment = .left
-        return titleLabel
-    }()
-    
-    private lazy var rmdBackView: UIView = {
-        let rmdBackView = UIView()
-        rmdBackView.backgroundColor = kf7f8faColor
-        return rmdBackView
-    }()
-    
-    private lazy var remindLabel: UILabel = {
-        let remindLabel = UILabel()
-        remindLabel.text = "退款将根据支付方式原路返回"
-        remindLabel.textColor = k333333Color
-        remindLabel.font = kBoldFont13
-        return remindLabel
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kffffffColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 10
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
-    }()
-    
-    //加载数据
-    func reloadData() {
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalToSuperview().offset(-69)
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-}
-
-extension OrderApplyRefundPhotoCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,UICollectionViewDelegate {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        if imgCount < maxImageCount {
-            return imgCount+1
-        } else {
-            return maxImageCount
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        if imgCount < maxImageCount && indexPath.row == imgCount {
-            // 添加图片
-            let cell = OrderCommentDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            if imgCount == 0 {
-                cell.noteStr = "上传凭证"
-            } else {
-                cell.noteStr = "\(imgCount)/\(maxImageCount)"
-            }
-            return cell
-        } else {
-            // 展示图片
-            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
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:(kScreenWidth-30-5*3)/4, height: (kScreenWidth-30-5*3)/4)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 15, bottom: 20, right: 15)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if imgCount < maxImageCount && indexPath.row == imgCount {
-            // 添加图片            
-            if let choosePicBlock = self.choosePicBlock {
-                choosePicBlock()
-            }
-        }
-    }
-    
-}

+ 0 - 183
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundProductCell.swift

@@ -1,183 +0,0 @@
-//
-//  OrderApplyRefundProductCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  申请退款--商品详情Cell
-
-import UIKit
-import RxSwift
-import RxCocoa
-import Kingfisher
-
-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)
-        let cell : OrderApplyRefundProductCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundProductCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(productImageView)
-        addSubview(selectBtn)
-        addSubview(priceLabel)
-        addSubview(titleLabel)
-        addSubview(timeLabel)
-        addSubview(skuLabel)
-        addSubview(numberLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        productImageView.snp.makeConstraints { (make) in
-            make.left.equalToSuperview().offset(34)
-            make.top.equalToSuperview().offset(14)
-            make.bottom.equalToSuperview().offset(-14)
-            make.size.equalTo(80)
-        }
-        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(-11)
-            make.height.equalTo(20)
-        }
-        timeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(8)
-            make.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        skuLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(timeLabel.snp.bottom).offset(8)
-            make.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        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)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    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
-            self?.selectBtn.isSelected = !(self?.selectBtn.isSelected)!
-            if let productSelBlock = self?.productSelBlock {
-                let isSel: Int = self?.selectBtn.isSelected == true ? 1 : 0
-                productSelBlock(isSel)
-            }
-        }).disposed(by: disposeBag)
-        return selectBtn
-    }()
-    
-    private lazy var productImageView: UIImageView = {
-        let productImageView = UIImageView()
-        productImageView.image = kImage(name: "default_pic")
-        productImageView.contentMode = .scaleAspectFill
-        productImageView.masksToBounds = true
-        return productImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        return titleLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.textColor = k666666Color
-        timeLabel.font = kRegularFont12
-        return timeLabel
-    }()
-    
-    private lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.textColor = k999999Color
-        skuLabel.font = kRegularFont12
-        return skuLabel
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = k333333Color
-        priceLabel.font = kRegularFont14
-        priceLabel.textAlignment = .right
-        return priceLabel
-    }()
-    
-    private lazy var numberLabel: UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.textColor = k999999Color
-        numberLabel.font = kRegularFont13
-        return numberLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModelDetailModel: OrderModelDetailModel? {
-        didSet {
-            // 选中状态
-            let selStatus = orderModelDetailModel?.isSelect == 1 ? true : false
-            selectBtn.isSelected = selStatus
-            
-            productImageView.kf.setImage(with: kURLImage(name: orderModelDetailModel?.productImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = orderModelDetailModel?.productName
-            timeLabel.text = "预计配送时间:\(orderModelDetailModel?.receiveTime ?? "")"
-            skuLabel.text = "规格:\(orderModelDetailModel?.skuName ?? "")"
-            priceLabel.text = "\(priceConversion(price: orderModelDetailModel?.productPrice ?? 0))"
-            numberLabel.text = "x\(orderModelDetailModel?.amount ?? 0)"
-        }
-    }
-}

+ 0 - 99
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/View/OrderApplyRefundReasonCell.swift

@@ -1,99 +0,0 @@
-//
-//  OrderApplyRefundReasonCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-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)
-                chooseBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-            }
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderApplyRefundReasonCell {
-        let ID = "OrderApplyRefundReasonCell"
-        tableView.register(OrderApplyRefundReasonCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderApplyRefundReasonCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderApplyRefundReasonCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(chooseBtn)
-    }
-    
-    private func setupLayouts() {
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.left.equalTo(14)
-            make.bottom.equalTo(-14)
-            make.height.equalTo(20)
-        }
-        
-        chooseBtn.snp.makeConstraints { (make) in
-            make.right.equalToSuperview().offset(-14)
-            make.centerY.equalTo(titleLabel)
-            make.left.greaterThanOrEqualTo(titleLabel.snp_right).offset(35)
-            make.height.equalTo(30)
-        }
-        chooseBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-    }
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        titleLabel.text = "退款原因"
-        return titleLabel
-    }()
-    
-    private lazy var chooseBtn: UIButton = {
-        let chooseBtn = UIButton(type: UIButton.ButtonType.custom)
-        chooseBtn.setTitle("请选择", for: UIControl.State.normal)
-        chooseBtn.setTitleColor(k999999Color, for: UIControl.State.normal)
-        chooseBtn.titleLabel?.font = kRegularFont14
-        chooseBtn.setImage(kImage(name: "my_arrows_unfold"), for: UIControl.State.normal)
-        chooseBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.chooseBtn.isSelected = !(self?.chooseBtn.isSelected)!
-                if let reasonBlock = self?.reasonBlock {
-                    reasonBlock()
-                }            
-        }).disposed(by: disposeBag)
-        return chooseBtn
-    }()
-    
-}

+ 0 - 356
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderApplyRefund/ViewController/OrderApplyRefundController.swift

@@ -1,356 +0,0 @@
-//
-//  OrderApplyRefundController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单--申请退款Vc
-
-import UIKit
-import RxSwift
-import SwiftyJSON
-import Photos
-
-class OrderApplyRefundController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    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 goodsImageArr = Array<UIImage>()
-    
-    // 退款备注信息
-    var refundNote: String = ""
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "申请退款"        
-        self.view.backgroundColor = kf7f8faColor
-        
-        let commitButton = UIButton(type: UIButton.ButtonType.custom)
-        commitButton.setTitle("提交", for: .normal)
-        commitButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        commitButton.titleLabel?.font = kRegularFont16
-        commitButton.backgroundColor = kFFA42FColor
-        self.view.addSubview(commitButton)
-        commitButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.applyOrderRefund()
-            
-        }).disposed(by: disposeBag)
-        commitButton.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.bottom.equalToSuperview().offset(-kSafeTabBarHeight)
-            make.height.equalTo(50)
-        }
-        
-        
-        self.view.addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-        tableView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview().offset(kSafeStatusBarHeight+40)
-            make.bottom.equalTo(commitButton.snp_top)
-            make.left.right.equalToSuperview()
-        }
-        
-    }
-    
-    override func setupData() {
-        self.refundReasonApi()
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-}
-
-// MARK: - tableView dataSource && delegate
-extension OrderApplyRefundController : UITableViewDelegate, UITableViewDataSource {
-    
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 5
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            let count = productArr?.count ?? 0
-            return count + 3
-        } else {
-            return 1
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            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 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:
-            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)
-            phoneCell.orderModel = orderDetailModel
-            return phoneCell
-        case 3:
-            let noteCell = OrderApplyRefundNoteInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
-            noteCell.noteTextViewClosure = {
-                [weak self] (text) in
-                self?.refundNote = text
-                
-                // 重算偏移量
-                let currentOffset = tableView.contentOffset
-                UIView.setAnimationsEnabled(false)
-                tableView.beginUpdates()
-                tableView.endUpdates()
-                UIView.setAnimationsEnabled(true)
-                tableView.setContentOffset(currentOffset, animated: false)
-            }
-            return noteCell
-        case 4:
-            let photoCell = OrderApplyRefundPhotoCell.cellWith(tableView: tableView, indexPath: indexPath)
-            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("------超过最大数量")
-                        }
-                        
-                    }
-                }) {[weak self] (action) in
-                    let curImages: Int = self?.goodsImageArr.count ?? 0
-                    _ = self?.presentHGImagePicker(maxSelected:3-curImages) { (assets) in
-                        for asset in assets {
-                            let imgManager: PHImageManager = PHImageManager()
-                            imgManager.requestImageData(for: asset, options: nil, resultHandler: { (imageData, dataUTI, orientation, info) in
-                                let image = UIImage(data: imageData ?? Data())
-                                self?.goodsImageArr.append(image ?? UIImage())
-                                self?.tableView.reloadData()
-                            })
-                        }                        
-                    }
-                }
-            }
-            photoCell.delPicTransBlock = {
-                [weak self] (idxRow) in
-                self?.goodsImageArr.remove(at: idxRow!)
-                self?.tableView.reloadData()
-            }
-            return photoCell
-        default:
-            return UITableViewCell()
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return  UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-}
-
-// 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 judgeAllUnselected() -> Bool {
-        var isAllUnsel: Bool = true
-        for productMdl in productArr ?? [] {
-            if productMdl.isSelect == 1 {
-                isAllUnsel = false
-                break
-            }
-        }
-        return isAllUnsel
-    }
-    
-    
-    // 计算退款金额
-    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
-            let refundModel = refundModel as! ProductRefundReasonModel
-            self?.refundReasonArr = refundModel.refundReason
-        }
-    }
-    
-    // 申请退款
-    func applyOrderRefund() {
-        
-        let isAllUnselected: Bool = judgeAllUnselected()
-        if isAllUnselected {
-            SwiftProgressHUD.shared().showText("请选择退款商品")
-            return
-        }
-        
-        if selRefundReason?.count == 0 {
-            SwiftProgressHUD.shared().showText("请输入退款原因")
-            return
-        }
-        
-        if refundNote.count > 150 {
-            SwiftProgressHUD.shared().showText("退款原因最多可输入150个字符,请重新编辑", textAlignment: .left)
-            return
-        }
-        
-        // 子订单id参数
-        var subIdArr: Array<Int> = []
-        for productMdl in productArr ?? [] {
-            if productMdl.isSelect == 1 {
-                subIdArr.append(productMdl.id!)
-            }
-        }
-        let detailJsonStr = JSON(subIdArr).description
-        
-        if goodsImageArr.isEmpty {
-            self.orderPurchaseRefundApi(purchaseId: self.orderDetailModel?.id ?? 0, mobile: self.orderDetailModel?.mobile ?? "", refundReason: self.selRefundReason ?? "", refund_remark: self.refundNote, detail: detailJsonStr, imgs: "[]")
-        } else {
-            // 多图上传
-            SwiftMoyaNetWorkServiceConfig.shared().configUploadMultiImgApi(imageArray: goodsImageArr) { [weak self] (imgUrlArr) -> (Void) in
-                let imgJsonStr = JSON(imgUrlArr).description
-                
-                self?.orderPurchaseRefundApi(purchaseId: self?.orderDetailModel?.id ?? 0, mobile: self?.orderDetailModel?.mobile ?? "", refundReason: self?.selRefundReason ?? "", refund_remark: self?.refundNote ?? "", detail: detailJsonStr, imgs: imgJsonStr)
-            }
-        }
-    }
-    
-    func orderPurchaseRefundApi(purchaseId:Int ,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
-            vc.orderRefunddetailsVCType = .orderApplyRefund
-            self.navigationController?.pushViewController(vc, animated: true)
-            
-        }
-    }
-    
-}

+ 0 - 108
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentAddImgCollectionCell.swift

@@ -1,108 +0,0 @@
-//
-//  OrderCommentAddImgCollectionCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  添加照片のCell(有图)
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class OrderCommentAddImgCollectionCell: UICollectionViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    var showImage: UIImage? {
-        didSet {
-            if self.showImage != nil {
-                picImageView.image = self.showImage
-            }
-        }
-    }
-    
-    var productSearchModel: ProductSearchModel? {
-        didSet {
-            picImageView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-        }
-    }
-    
-    typealias DelPicBlock = (_ idxRow:Int?) -> Void
-    var delPicBlock : DelPicBlock?
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> OrderCommentAddImgCollectionCell {
-        let ID = "OrderCommentAddImgCollectionCell"
-        collectionView.register(OrderCommentAddImgCollectionCell.self, forCellWithReuseIdentifier: ID)
-        let cell : OrderCommentAddImgCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! OrderCommentAddImgCollectionCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        setupViews()
-        setupLayouts()
-        
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(imgBackView)
-        imgBackView.addSubview(picImageView)
-        
-        addSubview(delButton)
-    }
-    
-    private func setupLayouts() {
-        imgBackView.snp.makeConstraints { (make) in
-            make.left.bottom.equalToSuperview()
-            make.size.equalTo((kScreenWidth-30-5*3)/4-9)
-        }
-        picImageView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-        delButton.snp.makeConstraints { (make) in
-            make.top.right.equalToSuperview()
-            make.size.equalTo(18)
-        }
-    }
-    
-    private lazy var imgBackView: UIView = {
-        let imgBackView = UIView()
-        return imgBackView
-    }()
-        
-    private lazy var picImageView: UIImageView = {
-        let picImageView = UIImageView()
-        picImageView.cornerRadius = 4
-        picImageView.masksToBounds = true
-        return picImageView
-    }()
-    
-    private lazy var delButton: UIButton = {
-        let delButton = UIButton(type: UIButton.ButtonType.custom)
-        delButton.setImage(kImage(name: "common_sku_cancel"), for: UIControl.State.normal)
-        delButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            let idxPath = self?.indexPath
-            if let delPicBlock = self?.delPicBlock {
-                delPicBlock(idxPath?.row)
-            }
-        }).disposed(by: disposeBag)
-        return delButton
-    }()
-    
-}

+ 0 - 105
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderComment/View/OrderCommentDefaultCollectionCell.swift

@@ -1,105 +0,0 @@
-//
-//  OrderCommentDefaultCollectionCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  添加照片のCell(默认,无图)
-
-import UIKit
-import RxSwift
-
-class OrderCommentDefaultCollectionCell: UICollectionViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    var noteStr: String? {
-        didSet {
-            titleLabel.text = noteStr
-        }
-    }
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> OrderCommentDefaultCollectionCell {
-        let ID = "OrderCommentDefaultCollectionCell.swift"
-        collectionView.register(OrderCommentDefaultCollectionCell.self, forCellWithReuseIdentifier: ID)
-        let cell : OrderCommentDefaultCollectionCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! OrderCommentDefaultCollectionCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        cornerRadius = 4
-        masksToBounds = true
-        setupViews()
-        setupLayouts()        
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(imgBackView)
-        imgBackView.addSubview(picImageView)
-        imgBackView.addSubview(cameraImgView)
-        imgBackView.addSubview(titleLabel)
-    }
-        
-    private func setupLayouts() {
-        imgBackView.snp.makeConstraints { (make) in
-            make.left.bottom.equalToSuperview()
-            make.size.equalTo((kScreenWidth-30-5*3)/4-9)
-        }
-        picImageView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-        cameraImgView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview().offset(16)
-            make.centerX.equalToSuperview()
-            make.width.equalTo(23)
-            make.height.equalTo(20)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(cameraImgView.snp_bottom).offset(12)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(17)
-        }
-    }
-    
-    private lazy var imgBackView: UIView = {
-        let imgBackView = UIView()
-        return imgBackView
-    }()
-    
-    private lazy var picImageView: UIImageView = {
-        let picImageView = UIImageView()
-        picImageView.image = kImage(name: "order_image_empty")
-        return picImageView
-    }()
-    
-    private lazy var cameraImgView: UIImageView = {
-        let cameraImgView = UIImageView()
-        cameraImgView.image = kImage(name: "order_photo")
-        return cameraImgView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k666666Color
-        titleLabel.font = kRegularFont12
-        titleLabel.textAlignment = .center
-        titleLabel.numberOfLines = 1        
-        return titleLabel
-    }()
-     
-}
-

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

@@ -1,283 +0,0 @@
-//
-//  OrderCommentTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import IQKeyboardManagerSwift
-import Kingfisher
-
-class OrderCommentTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    private let maxImageCount: Int = 6
-    
-    typealias CommentTextViewClosure = (_ text: String) -> Void
-    var commentTextViewClosure : CommentTextViewClosure?
-    
-    typealias StartChangedBlock = (_ starValue:Int?) -> Void
-    var startChangedBlock : StartChangedBlock?
-    
-    typealias ChoosePicBlock = () -> Void
-    var choosePicBlock : ChoosePicBlock?
-    
-    typealias DelPicTransBlock = (_ idxRow:Int?) -> Void
-    var delPicTransBlock : DelPicTransBlock?
-    
-    var imgCount: Int = 0
-    var goodsImageArr: Array<UIImage>? {
-        didSet {
-            imgCount = self.goodsImageArr?.count ?? 0
-        }
-    }
-    
-    var orderModelDetailModel: OrderModelDetailModel? {
-        didSet {
-            // 商品图片
-            iconImageView.kf.setImage(with: kURLImage(name: orderModelDetailModel?.productImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            starView.value = CGFloat(self.orderModelDetailModel?.starValue ?? 5)
-        }
-    }
-    
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderCommentTableViewCell {
-        let ID = "OrderCommentTableViewCell"
-        tableView.register(OrderCommentTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderCommentTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderCommentTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(cmtBackView)
-        cmtBackView.addSubview(iconImageView)
-        cmtBackView.addSubview(titleLabel)
-        cmtBackView.addSubview(starView)
-        
-        addSubview(cmtTextView)
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        cmtBackView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(91)
-        }
-        iconImageView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview().offset(16)
-            make.left.equalToSuperview().offset(14)
-            make.size.equalTo(55)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImageView.snp_right).offset(10)
-            make.centerY.equalTo(iconImageView)
-//            make.width.equalTo(56)
-            make.height.equalTo(20)
-        }
-        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)
-        }
-        
-        cmtTextView.snp.makeConstraints { (make) in
-            make.top.equalTo(cmtBackView.snp_bottom)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-            make.height.equalTo(100)
-        }
-        
-        collectionView.snp.makeConstraints { (make) in
-            make.top.equalTo(cmtTextView.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(200)
-            make.bottom.equalToSuperview()
-        }
-        
-    }    
-    
-    private lazy var cmtBackView: UIView = {
-        let cmtBackView = UIView()
-        return cmtBackView
-    }()
-    
-    private lazy var iconImageView: UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.contentMode = .scaleAspectFill
-        iconImageView.masksToBounds = true
-        return iconImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "商品评分"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var starView: SwiftyStarRatingView = {
-        let starView = SwiftyStarRatingView()
-        starView.emptyStarImage = kImage(name: "star_rating_empty")
-        starView.halfStarImage = kImage(name: "star_rating_half")
-        starView.filledStarImage = kImage(name: "star_rating_filled")
-        starView.allowsHalfStars = false
-        starView.addTarget(self, action: #selector(starViewDidClick), for: .valueChanged)
-        return starView        
-    }()
-    
-    private lazy var cmtTextView: IQTextView = {
-        let cmtTextView = IQTextView()
-        cmtTextView.backgroundColor = kfafafaColor
-        cmtTextView.textColor = k333333Color
-        cmtTextView.font = kRegularFont14
-        cmtTextView.placeholder = "输入商品评价..."
-        cmtTextView.placeholderTextColor = k999999Color
-        cmtTextView.delegate = self
-        return cmtTextView
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kffffffColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 10
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
-    }()
-    
-    //加载数据
-    func reloadData() {
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(cmtTextView.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalToSuperview()
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-    
-    // 评分视图点击
-    @objc func starViewDidClick(starView: SwiftyStarRatingView)  {
-        let starValue = Int(starView.value)
-        if let startChangedBlock = self.startChangedBlock {
-            startChangedBlock(starValue)
-        }
-    }
-    
-}
-
-extension OrderCommentTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,UICollectionViewDelegate {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        if imgCount < maxImageCount {
-            return imgCount+1
-        } else {
-            return maxImageCount
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        if imgCount < maxImageCount && indexPath.row == imgCount {
-            // 添加图片
-            let aCell = OrderCommentDefaultCollectionCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-            if imgCount == 0 {
-                aCell.noteStr = "添加照片"
-            } else {
-                aCell.noteStr = "\(imgCount)/\(maxImageCount)"
-            }
-            return aCell
-        } else {
-            // 展示图片
-            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
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:(kScreenWidth-30-5*3)/4, height: (kScreenWidth-30-5*3)/4)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 15, bottom: 0, right: 15)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {        
-        if imgCount < maxImageCount && indexPath.row == imgCount {
-            if let choosePicBlock = self.choosePicBlock {
-                choosePicBlock()
-            }
-        }
-    }
-    
-}
-
-extension OrderCommentTableViewCell: UITextViewDelegate {
-    
-    func textViewDidChange(_ textView: UITextView) {
-        if textView == cmtTextView {
-            var fullStr = textView.text ?? ""
-            if textView.text?.count ?? 0 > 180 {
-                fullStr = String(fullStr.prefix(150)) as String
-                textView.text = fullStr
-            }
-            
-            if let commentTextViewClosure = self.commentTextViewClosure {
-                commentTextViewClosure(self.cmtTextView.text ?? "")
-            }
-        }
-    }
-    
-}

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

@@ -1,272 +0,0 @@
-//
-//  OrderCommentController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/17.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单--评价Vc
-
-import UIKit
-import RxSwift
-import SwiftyJSON
-import Photos
-
-class OrderCommentController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    typealias CommentSuccessedBlock = () -> Void
-    var commentSuccessedBlock : CommentSuccessedBlock?
-    
-    var orderDetailModel: OrderModel? {
-        didSet {
-            self.productArr = self.orderDetailModel?.detail
-            // 默认5星评分
-            for (idx, _) in (self.productArr?.enumerated())! {
-                self.productArr![idx].starValue = 5
-            }
-            self.tableView.reloadData()
-        }
-    }
-    
-    // 商品数组
-    var productArr: Array<OrderModelDetailModel>?
-    
-    // 提交评论参数Model
-    var paraMdl = OrderCommentParameterModel()
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "评价"
-        
-        let commitButton = UIButton(type: UIButton.ButtonType.custom)
-        commitButton.setTitle("提交", for: .normal)
-        commitButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        commitButton.titleLabel?.font = kRegularFont16
-        commitButton.backgroundColor = kFFA42FColor
-        self.view.addSubview(commitButton)
-        commitButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.commitProductComment()
-        }).disposed(by: disposeBag)
-        commitButton.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.bottom.equalToSuperview().offset(-kSafeTabBarHeight)
-            make.height.equalTo(50)
-        }
-        
-        self.view.addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-        tableView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview().offset(kSafeStatusBarHeight+40)
-            make.bottom.equalTo(commitButton.snp_top)
-            make.left.right.equalToSuperview()
-        }
-        
-    }
-    
-    override func setupData() {
-        
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kffffffColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-}
-
-// MARK: - tableView dataSource && delegate
-extension OrderCommentController : UITableViewDelegate, UITableViewDataSource {
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return productArr?.count ?? 0
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let commentCell = OrderCommentTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-        commentCell.orderModelDetailModel = productArr![indexPath.row]
-        commentCell.goodsImageArr = productArr![indexPath.row].imageArr
-        commentCell.frame = tableView.bounds
-        commentCell.layoutIfNeeded()
-        commentCell.reloadData()
-        commentCell.startChangedBlock = {
-            [weak self] (starValue) in
-            self?.productArr![indexPath.row].starValue = starValue!
-        }
-        commentCell.commentTextViewClosure = {
-            [weak self] (text) in
-            self?.productArr![indexPath.row].comment = text
-        }
-        commentCell.choosePicBlock = {
-            [weak self] in
-            // 添加图片            
-            UIAlertController.showConfirmActionSheet(camera: { (action) in
-                PhotoAndCameraManager.shared().authorizeCamera()
-                PhotoAndCameraManager.shared().photoAndCameraManagerImageBlock = { [weak self] (image) in
-                    if self?.productArr![indexPath.row].imageArr.count ?? 0 < 6 {
-                        self?.productArr![indexPath.row].imageArr.append(image)
-                        self?.tableView.reloadData()
-                    } else {
-                        print("------超过最大数量")
-                    }
-                    
-                }
-            }) { (action) in
-                // 开始选择照片,最多允许选择6张
-                let curImages: Int = self?.productArr![indexPath.row].imageArr.count ?? 0
-                _ = self?.presentHGImagePicker(maxSelected:6-curImages) { (assets) in
-                    for asset in assets {
-                        let imgManager: PHImageManager = PHImageManager()
-                        imgManager.requestImageData(for: asset, options: nil, resultHandler: { (imageData, dataUTI, orientation, info) in
-                            let image = UIImage(data: imageData ?? Data())
-                            self?.productArr![indexPath.row].imageArr.append(image ?? UIImage())
-                            self?.tableView.reloadData()
-                        })
-                    }                    
-                }
-            }
-        }
-        commentCell.delPicTransBlock = {
-            [weak self] (picIdx) in
-            self?.productArr![indexPath.row].imageArr.remove(at: picIdx!)
-            self?.tableView.reloadData()
-        }
-        return commentCell
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return  UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        let headerSepView = UIView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 10))
-        headerSepView.backgroundColor = kf7f8faColor
-        return headerSepView
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-}
-
-//MARK: - 逻辑处理
-extension OrderCommentController {
-    // 提交评价
-    func commitProductComment() {
-        // 1-校验长度
-        for (_, productMdl) in (productArr?.enumerated())! {
-            if productMdl.comment.count > 150 {
-                SwiftProgressHUD.shared().showText("订单评价最多可输入150个字符,请重新编辑商品评价", textAlignment: .left)
-                return
-            }
-        }
-        
-        
-        // 2-上传图片流程
-        uploadAllImages(totalTimes: 0)
-        
-            
-            // 多图上传Api
-//            SwiftMoyaNetWorkServiceConfig.shared().configUploadMultiImgApi(imageArray: curImageArr) { (imgUrlArr) -> (Void) in
-//                productMdl.imageArrUrl = imgUrlArr as! Array<String>
-//                NXLLog("\n2----请求返回\(idx)")
-//
-//                // 需待最后一次请求返回后,再调用评价API
-//                times -= 1
-//                if times == 0 {
-//                    self.productAddCommentApi()
-//                }
-//            }
-    }
-    
-    func uploadAllImages(totalTimes: Int) {
-        var curTimes: Int = totalTimes
-        
-        let productMdl = productArr![curTimes]
-        let curImageArr = productArr![curTimes].imageArr
-        
-        if curImageArr.isEmpty {
-            productMdl.imageArrUrl = []
-            if curTimes == productArr!.count - 1 {
-                self.productAddCommentApi()
-            } else {
-                curTimes += 1
-                uploadAllImages(totalTimes: curTimes)
-            }
-        } else {
-            uploadSectionImages(productMdl: productMdl, curImageArr: curImageArr, totalTimes: curTimes, secTimes: 0)
-        }
-    }
-    
-    func uploadSectionImages(productMdl: OrderModelDetailModel, curImageArr: Array<UIImage>, totalTimes: Int, secTimes: Int) {
-        var curTimes: Int = secTimes
-        print("-----StartUpload,secTimes == \(totalTimes),rowTimes == \(curTimes)")
-        SwiftMoyaNetWorkServiceConfig.shared().configUploadSingleImgApi(imageArray: [curImageArr[curTimes]]) {
-            [weak self] (imgUrl) -> (Void) in
-            let urlStr: String = imgUrl as! String
-            productMdl.imageArrUrl.append(urlStr)
-            print("-----FinishUpload,secTimes == \(totalTimes),rowTimes == \(curTimes)")
-            curTimes += 1
-            if curTimes < curImageArr.count {
-                self?.uploadSectionImages(productMdl: productMdl, curImageArr: curImageArr, totalTimes: totalTimes, secTimes: curTimes)
-            } else {
-                if totalTimes == (self?.productArr!.count)! - 1 {
-                    self?.productAddCommentApi()
-                } else {
-                    self?.uploadAllImages(totalTimes: totalTimes+1)
-                }
-            }
-        }
-    }
-    
-    func productAddCommentApi() {
-        print("3----评价流程")
-        
-        let paraMdl = OrderCommentParameterModel()
-        paraMdl.purchase_id = orderDetailModel?.id
-        paraMdl.purchase_no = orderDetailModel?.purchaseNo
-        paraMdl.shop_id = orderDetailModel?.shopId
-        paraMdl.shop_name = orderDetailModel?.shopName
-        
-        let userModel = UserModel.shared().getModel()
-        paraMdl.username = userModel?.username
-        paraMdl.avatar = userModel?.avatarurl
-        
-        paraMdl.cmtProductArr = productArr
-        
-        // 新增评价Api
-        SwiftMoyaNetWorkServiceProduct.shared().productAddCommentApi(paraMdl: paraMdl) { (data) -> (Void) in
-            if let commentSuccessedBlock = self.commentSuccessedBlock {
-                commentSuccessedBlock()
-            }
-            self.navigationController?.popViewController(animated: true)
-        }
-    }
-    
-}

+ 0 - 219
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailBottomView.swift

@@ -1,219 +0,0 @@
-//
-//  OrderDetailBottomView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDetailBottomView: BaseView {
-
-
-    override func setupViews() {
-        addSubview(oneButton)
-        addSubview(twoButton)
-        addSubview(threeButton)
-        addSubview(leftButton)
-    }
-    
-    override func setupLayouts() {
-        oneButton.snp.remakeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.height.equalTo(36)
-            make.width.greaterThanOrEqualTo(90)
-            make.right.equalTo(-14)
-        }
-        twoButton.snp.remakeConstraints { (make) in
-            make.right.equalTo(oneButton.snp.left).offset(-12)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(36)
-            make.width.greaterThanOrEqualTo(90)
-        }
-        threeButton.snp.makeConstraints { (make) in
-            make.right.equalTo(twoButton.snp.left).offset(-12)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(36)
-            make.width.greaterThanOrEqualTo(90)
-        }
-        leftButton.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(20)
-        }
-    }
-    
-    private lazy var addressLabel: UILabel = {
-        let addressLabel = UILabel()
-        addressLabel.textColor = kFE352BColor
-        addressLabel.font = kRegularFont13
-        addressLabel.text = "自提地址:碑林区建设西路新城南门柜机"
-        return addressLabel
-    }()
-    
-    lazy var oneButton: UIButton = {
-        let oneButton = UIButton(type: UIButton.ButtonType.custom)
-        oneButton.cornerRadius = 18
-        oneButton.masksToBounds = true
-        oneButton.titleLabel?.font = kRegularFont15
-        oneButton.isHidden = true
-        return oneButton
-    }()
-    
-    lazy var twoButton: UIButton = {
-        let twoButton = UIButton(type: UIButton.ButtonType.custom)
-        twoButton.cornerRadius = 18
-        twoButton.masksToBounds = true
-        twoButton.titleLabel?.font = kRegularFont15
-        twoButton.isHidden = true
-        return twoButton
-    }()
-    
-    lazy var threeButton: UIButton = {
-        let threeButton = UIButton(type: UIButton.ButtonType.custom)
-        threeButton.cornerRadius = 18
-        threeButton.masksToBounds = true
-        threeButton.titleLabel?.font = kRegularFont15
-        return threeButton
-    }()
-    
-    lazy var leftButton: UIButton = {
-        let leftButton = UIButton(type: UIButton.ButtonType.custom)
-        leftButton.titleLabel?.font = kRegularFont15
-        leftButton.isHidden = true
-        return leftButton
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            switch orderModel?.status {
-                case 0: //待付款
-                    leftButton.setTitle("取消订单", for: UIControl.State.normal)
-                    leftButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-                    setButton(button: oneButton, title: "去付款", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setIsButtonHidden(leftHidden: false, oneHidden: false, twoHidden: true, threeHidden: true)
-
-                case 1://待发货
-                    if orderModel?.feedbackStatus == 0 {
-                        leftButton.setTitle("申请退款", for: UIControl.State.normal)
-                        leftButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-                        setButton(button: oneButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                        setIsButtonHidden(leftHidden: false, oneHidden: false, twoHidden: true, threeHidden: true)
-
-                    }else {
-                        setButton(button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                        setButton(button: twoButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                        setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-                    }
-
-                    break
-                case 2: //待收货
-                    
-                if orderModel?.feedbackStatus == 0 {
-                    leftButton.setTitle("申请退款", for: UIControl.State.normal)
-                    leftButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-                    setButton(button: oneButton, title: "确认收货", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: false, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                }else {
-                    setButton(button: oneButton, title: "确认收货", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: twoButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: threeButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: false)
-                                    
-                }
-
-                case 3: //配送中
-                    
-                if orderModel?.feedbackStatus == 0 {
-                    leftButton.isHidden = false
-                    leftButton.setTitle("申请退款", for: UIControl.State.normal)
-                    leftButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-                    setButton(button: oneButton, title: "再次购买", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setIsButtonHidden(leftHidden: false, oneHidden: false, twoHidden: true, threeHidden: true)
-
-                }else {
-                    setButton(button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: twoButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                }
-                case 4://待自提
-                if orderModel?.feedbackStatus == 0 {
-                    leftButton.setTitle("申请退款", for: UIControl.State.normal)
-                    leftButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-                    setButton(button: oneButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: false, oneHidden: false, twoHidden: true, threeHidden: true)
-
-                    
-                }else {
-                    setButton(button: oneButton, title: "退款详情", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: threeButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                }
-                case 5: //已自提
-                    if orderModel?.feedbackStatus == 0 {
-                        
-                        if orderModel?.isComment == 0 {
-                            setButton(button: oneButton, title: "去评价", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                            setButton(button: twoButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                            setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                        }else {
-                            setButton(button: oneButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                            setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: true, threeHidden: true)
-
-                        }
-                    }else {
-                        if orderModel?.isComment == 0 {
-                            setButton( button: oneButton, title: "去评价", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                            setButton(button: twoButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                            setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: false)
-
-                        }else {
-                            setButton(button: oneButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                            setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                        }
-                        
-                    }
-                case 6: //已完成
-                if orderModel?.isComment == 0 {
-                    setButton(button: oneButton, title: "去评价", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: twoButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setButton(button: threeButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: false)
-
-                }else {
-                    setButton(button: oneButton, title: "再次购买", titleColor: kffffffColor, backgroundColor: kFFA42FColor, borderColor: kFFA42FColor)
-                    setButton(button: twoButton, title: "查看物流", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: kbfbfbfColor)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: false, threeHidden: true)
-
-                }
-                case 7: //已关闭
-                    setButton(button: oneButton, title: "再次购买", titleColor: k333333Color, backgroundColor: UIColor.white, borderColor: k333333Color)
-                    setIsButtonHidden(leftHidden: true, oneHidden: false, twoHidden: true, threeHidden: true)
-                default:
-                    break
-            }
-        }
-    }
-    
-    func setButton(button:UIButton,title:String,titleColor:UIColor,backgroundColor:UIColor,borderColor:UIColor) {
-        button.setTitle(title, for: UIControl.State.normal)
-        button.setTitleColor(titleColor, for: UIControl.State.normal)
-        button.backgroundColor = backgroundColor
-        button.layer.borderColor = borderColor.cgColor
-        button.layer.borderWidth = 1
-    }
-    
-    func setIsButtonHidden(leftHidden:Bool,oneHidden:Bool,twoHidden:Bool,threeHidden:Bool) {
-        leftButton.isHidden = leftHidden
-        oneButton.isHidden = oneHidden
-        twoButton.isHidden = twoHidden
-        threeButton.isHidden = threeHidden
-    }
-
-}

+ 0 - 110
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailContactAddressTableViewCell.swift

@@ -1,110 +0,0 @@
-//
-//  OrderDetailContactAddressTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDetailContactAddressTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDetailContactAddressTableViewCell {
-        let ID = "OrderDetailContactAddressTableViewCell"
-        tableView.register(OrderDetailContactAddressTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDetailContactAddressTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDetailContactAddressTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(addressImageView)
-        addSubview(contactLabel)
-        addSubview(addressTitleLabel)
-        addSubview(addressContentLabel)
-    }
-    
-    private func setupLayouts() {
-        addressImageView.snp.makeConstraints { (make) in
-            make.top.left.equalTo(14)
-            make.size.equalTo(16)
-        }
-        contactLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(addressImageView)
-            make.left.equalTo(addressImageView.snp.right).offset(14)
-            make.right.equalTo(-14)
-            make.height.equalTo(21)
-        }
-        addressTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(contactLabel.snp.bottom).offset(8)
-            make.left.equalTo(contactLabel)
-            make.width.equalTo(65)
-        }
-        addressContentLabel.snp.remakeConstraints { (make) in
-            make.top.equalTo(addressTitleLabel)
-            make.left.equalTo(addressTitleLabel.snp.right)
-            make.bottom.equalTo(-14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var addressImageView: UIImageView = {
-        let addressImageView = UIImageView()
-        addressImageView.image = kImage(name: "order_coord")
-        return addressImageView
-    }()
-    
-    private lazy var contactLabel: UILabel = {
-        let contactLabel = UILabel()
-        contactLabel.textColor = k333333Color
-        contactLabel.font = kBoldFont15
-        return contactLabel
-    }()
-    
-    private lazy var addressTitleLabel: UILabel = {
-        let addressTitleLabel = UILabel()
-        addressTitleLabel.textColor = k666666Color
-        addressTitleLabel.font = kRegularFont13
-        return addressTitleLabel
-    }()
-    
-    private lazy var addressContentLabel: UILabel = {
-        let addressContentLabel = UILabel()
-        addressContentLabel.textColor = k666666Color
-        addressContentLabel.font = kRegularFont13
-        addressContentLabel.numberOfLines = 0
-        return addressContentLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            if orderModel?.deliverType == 1 { //自提
-                addressTitleLabel.text = "自提地址:"
-            }else { //快递
-                addressTitleLabel.text = "快递地址:"
-
-            }
-            contactLabel.text = "\(orderModel?.name ?? "")   \(orderModel?.mobile ?? "")"
-            addressContentLabel.text = orderModel?.address
-        }
-    }
-
-}

+ 0 - 86
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailExpressSelfMentionTableViewCell.swift

@@ -1,86 +0,0 @@
-//
-//  OrderDetailExpressTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDetailExpressSelfMentionTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDetailExpressSelfMentionTableViewCell {
-        let ID = "OrderDetailExpressSelfMentionTableViewCell"
-        tableView.register(OrderDetailExpressSelfMentionTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDetailExpressSelfMentionTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDetailExpressSelfMentionTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(contentLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-        }
-        contentLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(titleLabel)
-            make.left.equalTo(80)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k999999Color
-        titleLabel.font = kRegularFont13
-        titleLabel.text = "配送方式"
-        return titleLabel
-    }()
-    
-    private lazy var contentLabel: UILabel = {
-        let contentLabel = UILabel()
-        contentLabel.textColor = k333333Color
-        contentLabel.font = kRegularFont13
-        
-        return contentLabel
-    }()
-    
-    var orderModel: OrderModel? {
-        didSet {
-            switch indexPath?.row {
-            case 0:
-                if orderModel?.deliverType == 1 { //自提
-                    contentLabel.text = "自提"
-                }else { //快递
-                    contentLabel.text = "快递"
-                }
-            default:
-                titleLabel.text = "自提点店长"
-                contentLabel.text = orderModel?.pickNodeContact
-            }
-        }
-    }
-
-}

+ 0 - 122
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailInfoTableViewCell.swift

@@ -1,122 +0,0 @@
-//
-//  OrderDetailInfoTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class OrderDetailInfoTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDetailInfoTableViewCell {
-        let ID = "OrderDetailInfoTableViewCell"
-        tableView.register(OrderDetailInfoTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDetailInfoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDetailInfoTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(contentLabel)
-        addSubview(copyButton)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-        }
-        contentLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(titleLabel)
-            make.left.equalTo(titleLabel.snp.right).offset(14)
-        }
-        copyButton.snp.makeConstraints { (make) in
-            make.centerY.equalTo(titleLabel)
-            make.height.equalTo(16)
-            make.right.equalTo(-14)
-            make.width.equalTo(40)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k999999Color
-        titleLabel.font = kRegularFont13
-        titleLabel.text = "订单编码"
-        return titleLabel
-    }()
-    
-    private lazy var contentLabel: UILabel = {
-        let contentLabel = UILabel()
-        contentLabel.textColor = k333333Color
-        contentLabel.font = kRegularFont13
-        return contentLabel
-    }()
-    
-    private lazy var copyButton: UIButton = {
-        let copyButton = UIButton(type: UIButton.ButtonType.custom)
-        copyButton.setTitle("复制", for: UIControl.State.normal)
-        copyButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        copyButton.titleLabel?.font = kRegularFont12
-        copyButton.cornerRadius = 8
-        copyButton.masksToBounds = true
-        copyButton.isHidden = true
-        copyButton.layer.borderColor = kbfbfbfColor.cgColor
-        copyButton.layer.borderWidth = 1
-        copyButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            commonCopy(string: self?.contents?[0] ?? "")
-        }).disposed(by: disposeBag)
-        return copyButton
-    }()
-    
-    var titles : [String]? {
-        didSet {
-            titleLabel.text = titles?[(indexPath?.row)!]
-
-        }
-    }
-    
-    var contents : [String]? {
-        didSet {
-            if indexPath?.row == 0 {
-                copyButton.isHidden = false
-            }else {
-                copyButton.isHidden = true
-            }
-            contentLabel.text = contents?[(indexPath?.row)!]
-        }
-    }
-    
-    var refundContents : [String]? {
-        didSet {
-            copyButton.isHidden = true
-            contentLabel.text = refundContents?[(indexPath?.row)!]
-        }
-    }
-    
-}

+ 0 - 151
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailProductTableViewCell.swift

@@ -1,151 +0,0 @@
-//
-//  OrderDetailProductTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/6/3.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class OrderDetailProductTableViewCell: UITableViewCell {
-
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDetailProductTableViewCell {
-        let ID = "OrderDetailProductTableViewCell"
-        tableView.register(OrderDetailProductTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDetailProductTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDetailProductTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(productImageView)
-        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.size.equalTo(92)
-        }
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(productImageView.snp.right).offset(12)
-            make.top.equalTo(20)
-            make.right.equalTo(priceLabel.snp.left).offset(-12)
-            make.height.equalTo(20)
-        }
-        timeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(8)
-            make.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        skuLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(timeLabel.snp.bottom).offset(8)
-            make.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        numberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(skuLabel.snp.bottom).offset(8)
-            make.left.equalTo(skuLabel)
-        }
-        priceLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(numberLabel)
-            make.right.equalTo(-14)
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.height.equalTo(1)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var productImageView: UIImageView = {
-        let productImageView = UIImageView()
-        productImageView.contentMode = .scaleAspectFill
-        productImageView.masksToBounds = true
-        productImageView.image = kImage(name: "default_pic")
-        return productImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        return titleLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.textColor = k666666Color
-        timeLabel.font = kRegularFont12
-        return timeLabel
-    }()
-    
-    private lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.textColor = k999999Color
-        skuLabel.font = kRegularFont12
-        return skuLabel
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = k333333Color
-        priceLabel.font = kRegularFont14
-        return priceLabel
-    }()
-    
-    private lazy var numberLabel: UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.textColor = k999999Color
-        numberLabel.font = kRegularFont12
-        return numberLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var orderModelDetailModel: OrderModelDetailModel? {
-        didSet {
-            productImageView.kf.setImage(with: kURLThumbnailsImage(name: orderModelDetailModel?.productImg ?? "default_pic", size: kSize92x92Image), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = orderModelDetailModel?.productName
-            timeLabel.text = "预计配送时间:\(orderModelDetailModel?.receiveTime ?? "")"
-            skuLabel.text = "规格:\(orderModelDetailModel?.skuName ?? "")"
-            priceLabel.text = "\(priceConversion(price: orderModelDetailModel?.productPrice ?? 0))"
-            numberLabel.text = "x\(orderModelDetailModel?.amount ?? 0)"
-        }
-    }
-
-}

+ 0 - 112
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailStatusTableViewCell.swift

@@ -1,112 +0,0 @@
-//
-//  OrderDetailStatusTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDetailStatusTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderDetailStatusTableViewCell {
-        let ID = "OrderDetailStatusTableViewCell"
-        tableView.register(OrderDetailStatusTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderDetailStatusTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderDetailStatusTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(bgImageView)
-        addSubview(statusLabel)
-        addSubview(statusImageView)
-    }
-    
-    private func setupLayouts() {
-        bgImageView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-        statusLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(20)
-        }
-        statusImageView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-40)
-        }
-    }
-    
-    lazy var bgImageView: UIImageView = {
-        let bgImageView = UIImageView()
-        bgImageView.image = kImage(name: "order_bg")
-        return bgImageView
-    }()
-    
-    private lazy var statusLabel: UILabel = {
-        let statusLabel = UILabel()
-        statusLabel.textColor = kffffffColor
-        statusLabel.font = kBoldFont20
-        return statusLabel
-    }()
-    
-    private lazy var statusImageView: UIImageView = {
-        let statusImageView = UIImageView()
-        return statusImageView
-    }()
-    
-    
-    var orderModel: OrderModel? {
-        didSet {
-                switch orderModel?.status {
-                case 0: //待付款
-                    statusLabel.text = "待付款"
-                    statusImageView.image = kImage(name: "order_payment")
-                    break
-                case 1: //待发货
-                    statusLabel.text = "待发货"
-                    statusImageView.image = kImage(name: "order_good")
-                case 2: //已发货/待收货
-                    statusLabel.text = "待收货"
-                    statusImageView.image = kImage(name: "order_good")
-                case 3: //配送中
-                    statusLabel.text = "配送中"
-                    statusImageView.image = kImage(name: "order_good")
-                case 4: //待自提
-                    statusLabel.text = "待自提"
-                    statusImageView.image = kImage(name: "order_pick")
-                case 5: //已自提
-                    statusLabel.text = "已自提"
-                    statusImageView.image = kImage(name: "order_pick_been")
-                    
-                case 6: //已完成
-                    statusLabel.text = "已完成"
-                    statusImageView.image = kImage(name: "order_done")
-                case 7: //已关闭
-                    statusLabel.text = "已关闭"
-                    statusImageView.image = kImage(name: "order_de")
-                    
-                default:
-                    break
-                }
-        }
-    }
-}

+ 0 - 368
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift

@@ -1,368 +0,0 @@
-//
-//  OrderDetailViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderDetailViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var orderModel : OrderModel?
-    
-    var orderDetailModel : OrderModel?
-    
-    typealias CancelOrderClosure = () -> Void
-    var cancelOrderClosure : CancelOrderClosure?
-    
-    var titles = ["订单编码","下单时间","支付时间","支付方式","订单备注"]
-    
-    var contents = ["","","","",""]
-    
-    var isChange : Bool = false
-    
-    deinit {
-        if let observe = observe {
-            NotificationCenter.default.removeObserver(observe)
-        }
-    }
-    weak var observe : NSObjectProtocol?
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "订单详情"
-        navigationBar.onClickLeftButton = {
-            [weak self] in
-            if self?.isChange ?? false {
-                if let cancelOrderClosure = self?.cancelOrderClosure {
-                    cancelOrderClosure()
-                }
-            }
-            self?.navigationController?.popViewController(animated: true)
-        }
-        view.addSubview(orderDetailBottomView)
-        view.addSubview(tableView)
-    }
-    
-    override func setupLayouts() {
-        orderDetailBottomView.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.height.equalTo(48)
-            make.bottom.equalTo(-kSafeTabBarHeight)
-        }
-        tableView.snp.makeConstraints { (make) in
-            make.top.equalTo(kNavBarTotalHeight)
-            make.left.right.equalToSuperview()
-            make.bottom.equalTo(orderDetailBottomView.snp.top)
-        }
-    }
-    
-    override func setupData() {
-        tableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.orderPurchaseDetailApi()
-        }
-        orderDetailBottomView.oneButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.setButton(button: (self?.orderDetailBottomView.oneButton)!)
-        }).disposed(by: disposeBag)
-        orderDetailBottomView.twoButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.setButton(button: (self?.orderDetailBottomView.twoButton)!)
-        }).disposed(by: disposeBag)
-        orderDetailBottomView.threeButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.setButton(button: (self?.orderDetailBottomView.threeButton)!)
-        }).disposed(by: disposeBag)
-        orderDetailBottomView.leftButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.setButton(button: (self?.orderDetailBottomView.leftButton)!)
-        }).disposed(by: disposeBag)
-        
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("OrderApplyRefund"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
-            self?.orderPurchaseDetailApi()
-
-        }
-    }
-    
-    /// 订单详情接口
-    func orderPurchaseDetailApi() {
-        SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseDetailApi(purchaseNo:orderModel?.purchaseNo ?? "") {
-            [weak self] (orderDetailModel) -> (Void) in
-            self?.orderDetailModel = orderDetailModel as? OrderModel
-            self?.contents[0] = self?.orderDetailModel?.purchaseNo ?? ""
-            self?.contents[1] = self?.orderDetailModel?.createdAt ?? ""
-            self?.contents[2] = self?.orderDetailModel?.paidAt ?? ""
-            if self?.orderDetailModel?.payType == "weixin" {
-                self?.contents[3] = "微信"
-            }else if self?.orderDetailModel?.payType == "alipay" {
-                self?.contents[3] = "支付宝"
-            }
-            self?.contents[4] = self?.orderDetailModel?.remark ?? ""
-            self?.orderDetailBottomView.orderModel =  self?.orderDetailModel
-            self?.tableView.reloadData()
-        }
-    }
-    
-    func setButton(button:UIButton) {
-        if button.titleLabel?.text == "去付款" {
-            // 弹出支付方式View
-            let orderPayModel = OrderCreateBackModel()
-            orderPayModel.money = "\(self.orderDetailModel?.patchMoney ?? 0)"
-            orderPayModel.patchNum = self.orderDetailModel?.patchNum
-            PayManagerPay.shared.payAlertView(orderPayModel: orderPayModel, orderFinishPayVCType: .orderDetail,vc: self)
-        }
-        if button.titleLabel?.text == "取消订单" {
-
-            AlertSheetView.alert(title: "是否取消订单", cancelTitle: "取消", sureTitle: "确定", cancelBlock: nil) { [weak self] (popupView, index, str) in
-                SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseCloseApi(patchNum: self?.orderDetailModel?.patchNum ?? "") {
-                    [weak self] (data) -> (Void) in
-                    self?.isChange = true
-                    kOrderVCTypeAlliSRefresh = true
-                    self?.orderPurchaseDetailApi()
-                }
-            }
-        }
-        if button.titleLabel?.text == "确认收货" {
-            AlertSheetView.alert(title: "是否确认收货", cancelTitle: "取消", sureTitle: "确定", cancelBlock: nil) { [weak self] (popupView, index, str) in
-                SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseConfirmApi(purchaseId: self?.orderDetailModel?.id ?? 0) {
-                    [weak self] (data) -> (Void) in
-                    kOrderVCTypeAlliSRefresh = true
-                    self?.orderPurchaseDetailApi()
-                }
-            }
- 
-        }
-        if button.titleLabel?.text == "查看物流" {
-            let vc = OrderLogisticsController()
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "退款详情" {
-            let vc = OrderRefunddetailsViewController()
-            vc.refundNo = self.orderDetailModel?.refundNo
-            vc.orderRefunddetailsVCType = .orderDetail
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "去评价" {
-            let vc = OrderCommentController()
-            vc.orderDetailModel = self.orderDetailModel
-            vc.commentSuccessedBlock = {
-                [weak self] in
-                kOrderVCTypeAlliSRefresh = true
-                self?.orderPurchaseDetailApi()
-            }
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "再次购买" {
-            let vc = ShopViewController()
-            vc.shopId = self.orderDetailModel?.shopId
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-        if button.titleLabel?.text == "申请退款" {
-            let vc = OrderApplyRefundController()
-            vc.orderDetailModel = self.orderDetailModel
-            self.navigationController?.pushViewController(vc, animated: true)
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-    
-    lazy var orderDetailBottomView: OrderDetailBottomView = {
-        let orderDetailBottomView = OrderDetailBottomView()
-        return orderDetailBottomView
-    }()
-
-}
-
-extension OrderDetailViewController : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 4
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        switch section {
-        case 0:
-            return 2
-        case 1:
-            if self.orderDetailModel?.deliverType == 1 { //自提
-                return 2
-            }else { // 快递
-                return 1
-            }
-        case 2:
-            if self.orderDetailModel?.detail?.isEmpty ?? true {
-                return 0
-            }else {
-                if self.orderDetailModel?.deliverType == 1 { //自提
-                    return 2 + (self.orderDetailModel?.detail?.count ?? 0)
-
-                }else { // 快递
-                    return 3 + (self.orderDetailModel?.detail?.count ?? 0)
-
-                }
-            }
-        case 3:
-            switch self.orderDetailModel?.status {
-            case 0: //  0-待付款
-                return 2
-            default: //1-待发货 2-已发货 3-配送中 4-待自提 5-已自提 6-已完成 7-已关闭
-                return titles.count
-            }
-        default:
-            return 0
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            if indexPath.row == 0 {
-                let cell = OrderDetailStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = self.orderDetailModel
-                return cell
-            }else {
-                let cell = OrderDetailContactAddressTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                 cell.orderModel = self.orderDetailModel
-                return cell
-            }
-        case 1:
-            let cell = OrderDetailExpressSelfMentionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.orderModel = self.orderDetailModel
-            return cell
-        case 2:
-            let detail = self.orderDetailModel?.detail
-            switch indexPath.row {
-            case 0:
-                let cell = OrderShopAndStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.shopClosure = {
-                    [weak self] orderModel in
-                    let vc = ShopViewController()
-                    vc.shopId = orderModel.shopId
-                    self?.navigationController?.pushViewController(vc, animated: true)
-                }
-                cell.orderDetailModel = self.orderDetailModel
-
-                return cell
-            case detail!.count + 1:
-                if self.orderDetailModel?.deliverType == 1 { //自提
-                    let cell = OrderTotalAmountTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    cell.orderModel = self.orderDetailModel
-                    return cell
-                    
-                }else { // 快递
-                    let cell = OrderFreightTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    cell.orderModel = self.orderDetailModel
-                    return cell
-                }
-            case detail!.count + 2:
-                let cell = OrderTotalAmountTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModel = self.orderDetailModel
-                return cell
-            default:
-                let detail = self.orderDetailModel?.detail
-                let cell = OrderDetailProductTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderModelDetailModel = detail?[indexPath.row - 1]
-                return cell
-            }
-        case 3:
-            let cell = OrderDetailInfoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.titles = titles
-            cell.contents = contents
-            return cell
-        default:
-            return UITableViewCell()
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        
-        if indexPath.section == 2 {
-            let detail = self.orderDetailModel?.detail
-            switch indexPath.row {
-            case 0:
-                break
-            case detail!.count + 1:
-                break
-            case detail!.count + 2:
-                break
-            default:
-                let vc = ProductDetailViewController()
-                vc.productId = detail![indexPath.row - 1].productId
-                vc.shopId = self.orderDetailModel!.shopId
-                self.navigationController?.pushViewController(vc, animated: true)
-                break
-            }
-        }
-    }
-
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-         let detail = self.orderDetailModel?.detail
-        switch indexPath.section {
-        case 0:
-            if indexPath.row == 0 {
-                return 75
-            }else {
-                return UITableView.automaticDimension
-            }
-        case 1:
-            return 43
-        case 2:
-           
-            switch indexPath.row {
-            case 0:
-                return 43
-            case (detail?.isEmpty ?? true) ? 1 : detail!.count + 1:
-                return 40
-            case (detail?.isEmpty ?? true) ? 1 : detail!.count + 2:
-                return UITableView.automaticDimension
-            default:
-                return 120
-            }
-        case 3:
-            return 33.5
-        default:
-             return 0
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-}
-

+ 0 - 140
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPayFailureCell.swift

@@ -1,140 +0,0 @@
-//
-//  ShoppingCartPayFailureCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--支付失败Cell
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class OrderFinishPayFailureCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias RepayBlock = () -> Void
-    var repayBlock : RepayBlock?
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderFinishPayFailureCell {
-        let ID = "OrderFinishPayFailureCell"
-        tableView.register(OrderFinishPayFailureCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderFinishPayFailureCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderFinishPayFailureCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(statusImageView)
-        addSubview(titleLabel)
-        addSubview(describeLabel)
-        addSubview(jumpButton)
-    }
-    
-    private func setupLayouts() {
-        statusImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(32)
-            make.centerX.equalToSuperview()
-            make.size.equalTo(50)
-        }
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(statusImageView.snp.bottom).offset(20)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(31)
-        }
-        
-        describeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(12)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(19)
-        }
-        
-        jumpButton.snp.makeConstraints { (make) in
-            make.top.equalTo(describeLabel.snp.bottom).offset(20)
-            make.bottom.equalToSuperview().offset(-30)
-            make.centerX.equalToSuperview()
-            make.left.equalTo(24)
-            make.right.equalTo(-24)
-        }
-        
-    }
-    
-    lazy var statusImageView : UIImageView = {
-        let statusImageView = UIImageView()
-        statusImageView.image = kImage(name: "shopping_cart_trade_failure")
-        return statusImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "支付失败"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont22
-        titleLabel.textAlignment = .center
-        return titleLabel
-    }()
-    
-    private lazy var describeLabel: UILabel = {
-        let describeLabel = UILabel()
-        describeLabel.textColor = k666666Color
-        describeLabel.font = kRegularFont13
-        describeLabel.textAlignment = .center
-        return describeLabel
-    }()
-    
-    private lazy var jumpButton: UIButton = {
-        let jumpButton = UIButton(type: UIButton.ButtonType.custom)
-        jumpButton.backgroundColor = kFFA42FColor
-        jumpButton.setTitle("重新支付", for: UIControl.State.normal)
-        jumpButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        jumpButton.titleLabel?.font = kRegularFont16
-        jumpButton.cornerRadius = 18
-        jumpButton.masksToBounds = true
-        jumpButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let repayBlock = self?.repayBlock {
-                repayBlock()
-            }
-        }).disposed(by: disposeBag)
-        return jumpButton
-    }()
-    
-    var configModel: ConfigModel? {
-        didSet {
-            describeLabel.text = "\(configModel?.orderExpiredTime ?? "15")分钟未支付,系统自动判断失败"
-        }
-    }
-    
-}

+ 0 - 175
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPaySuccessCell.swift

@@ -1,175 +0,0 @@
-//
-//  ShoppingCartPaySuccessCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--支付成功Cell
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-enum PayJumpDes {
-    case homePage
-    case checkOrder
-}
-
-class OrderFinishPaySuccessCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias JumpBlock = (_ jType: PayJumpDes) -> Void
-    var jumpBlock : JumpBlock?
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderFinishPaySuccessCell {
-        let ID = "OrderFinishPaySuccessCell"
-        tableView.register(OrderFinishPaySuccessCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderFinishPaySuccessCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderFinishPaySuccessCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(statusImageView)
-        addSubview(titleLabel)
-        addSubview(describeLabel)
-        addSubview(jumpButton)
-        addSubview(orderButton)
-        addSubview(bottomLabel)
-    }
-    
-    private func setupLayouts() {
-        statusImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(32)
-            make.centerX.equalToSuperview()
-            make.size.equalTo(50)
-        }
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(statusImageView.snp.bottom).offset(20)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(31)
-        }
-        
-        describeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(12)
-            make.centerX.equalToSuperview()
-            make.height.equalTo(19)
-        }
-        
-        jumpButton.snp.makeConstraints { (make) in
-            make.top.equalTo(describeLabel.snp.bottom).offset(20)
-            make.bottom.equalToSuperview().offset(-73)
-            make.centerX.equalToSuperview()
-            make.left.equalTo(24)
-            make.right.equalTo(-24)
-        }
-        
-        orderButton.snp.makeConstraints { (make) in
-            make.top.equalTo(jumpButton.snp.bottom).offset(20)
-            make.right.equalTo(-24)
-            make.width.equalTo(56)
-            make.height.equalTo(24)
-        }
-        
-        bottomLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(orderButton.snp.bottom).offset(3)
-            make.left.right.equalTo(orderButton)
-            make.height.equalTo(1)
-        }
-    }
-    
-    lazy var statusImageView : UIImageView = {
-        let statusImageView = UIImageView()
-        statusImageView.image = kImage(name: "shopping_cart_trade_finish")
-        return statusImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "支付完成"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont22
-        titleLabel.textAlignment = .center
-        return titleLabel
-    }()
-    
-    private lazy var describeLabel: UILabel = {
-        let describeLabel = UILabel()
-        describeLabel.text = "订单整装待发,请注意查收!"
-        describeLabel.textColor = k666666Color
-        describeLabel.font = kRegularFont13
-        describeLabel.textAlignment = .center
-        return describeLabel
-    }()
-    
-    private lazy var jumpButton: UIButton = {
-        let jumpButton = UIButton(type: UIButton.ButtonType.custom)
-        jumpButton.backgroundColor = kFFA42FColor
-        jumpButton.setTitle("继续逛一逛", for: UIControl.State.normal)
-        jumpButton.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        jumpButton.titleLabel?.font = kRegularFont16
-        jumpButton.cornerRadius = 18
-        jumpButton.masksToBounds = true
-        jumpButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let jumpBlock = self?.jumpBlock {
-                jumpBlock(PayJumpDes.homePage)
-            }
-        }).disposed(by: disposeBag)
-        return jumpButton
-    }()
-    
-    private lazy var orderButton: UIButton = {
-        
-        let orderButton = UIButton(type: UIButton.ButtonType.custom)
-        orderButton.backgroundColor = kffffffColor
-        orderButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        orderButton.setTitle("查看订单", for: UIControl.State.normal)
-        orderButton.titleLabel?.font = kRegularFont14
-        orderButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let jumpBlock = self?.jumpBlock {
-                jumpBlock(PayJumpDes.checkOrder)
-            }
-        }).disposed(by: disposeBag)
-        return orderButton
-    }()
-    
-    lazy var bottomLabel: UILabel = {
-        let bottomLabel = UILabel()
-        bottomLabel.backgroundColor = k333333Color
-        return bottomLabel
-    }()
-    
-}

+ 0 - 144
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/View/OrderFinishPayView.swift

@@ -1,144 +0,0 @@
-//
-//  ShoppingCartFinishPayView.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--支付完成View
-
-import UIKit
-
-class OrderFinishPayView: BaseView {
-    
-    typealias RepayTransBlock = () -> Void
-    var repayTransBlock : RepayTransBlock?
-    
-    typealias JumpTransBlock = (_ jType: PayJumpDes) -> Void
-    var jumpTransBlock : JumpTransBlock?
-    
-    typealias JumpToDetailTransClosure = (_ proId: Int,_ shopId : Int) -> Void
-    var jumpToDetailTransClosure : JumpToDetailTransClosure?
-    
-    // 热销ModelArr
-    var hotSaleModelArr : Array<ProductSearchModel>? {
-        didSet {
-            self.tableView.reloadSections([1], with: UITableView.RowAnimation.none)
-        }
-    }
-    
-    var payStatus: Bool? {
-        didSet {
-            self.tableView.reloadSections([0], with: UITableView.RowAnimation.none)
-        }
-    }
-    
-    var configModel: ConfigModel? {
-        didSet {
-            self.tableView.reloadSections([0], with: UITableView.RowAnimation.none)
-        }
-    }
-    override func setupViews() {
-        self.backgroundColor = kf7f8faColor
-        addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-    }
-    
-    override func setupLayouts() {
-        tableView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-}
-
-extension OrderFinishPayView : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 1
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            if (payStatus == true) {
-                // 支付成功
-                let sCell = OrderFinishPaySuccessCell.cellWith(tableView: tableView, indexPath: indexPath)
-                sCell.jumpBlock = {
-                    [weak self] (jType) in
-                    if let jumpTransBlock = self?.jumpTransBlock {
-                        jumpTransBlock(jType)
-                    }
-                }
-                return sCell
-            } else {
-                // 支付失败
-                let fCell = OrderFinishPayFailureCell.cellWith(tableView: tableView, indexPath: indexPath)
-                fCell.configModel = self.configModel
-                fCell.repayBlock = {
-                    [weak self] in
-                    if let repayTransBlock = self?.repayTransBlock {
-                        repayTransBlock()
-                    }
-                }
-                return fCell
-            }            
-        case 1:
-            // 超值热卖
-            let hotSaleCell = ShoppingCartHotSaleTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            hotSaleCell.frame = tableView.bounds
-            hotSaleCell.hotSaleModelArr = hotSaleModelArr
-            hotSaleCell.layoutIfNeeded()
-            hotSaleCell.reloadData()
-            hotSaleCell.jumpToDetailClosure = {
-                [weak self] (proId, shopId) in
-                if let jumpToDetailTransClosure = self?.jumpToDetailTransClosure {
-                    jumpToDetailTransClosure(proId, shopId)
-                }
-            }
-            return hotSaleCell
-            
-        default:
-            return UITableViewCell()
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return  UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-}

+ 0 - 160
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderFinishPay/ViewController/OrderFinishPayController.swift

@@ -1,160 +0,0 @@
-//
-//  ShoppingCartFinishPayController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--支付完成Vc
-
-import UIKit
-import RxSwift
-
-
-/// OrderFinishPayVCType
-///
-/// - cart: 购物车
-/// - productDetail: 订单详情
-/// - order: 订单
-/// - orderDetails: 订单详情
-enum OrderFinishPayVCType {
-    case cart
-    case productDetail
-    case order
-    case orderDetail
-}
-
-class OrderFinishPayController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var payStatus: Bool? = true {
-        didSet {
-            if payStatus ?? true {
-                navigationBar.title = "支付成功"
-            } else {
-                navigationBar.title = "支付失败"
-            }
-        }
-    }
-    
-    var orderFinishPayVCType : OrderFinishPayVCType?
-    
-    typealias ReloadClosure = () -> Void
-    var reloadClosure : ReloadClosure?
-    
-    var productSearchModelArray = Array<ProductSearchModel>()
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-         view.addSubview(finishPayView)
-    }
-    
-    override func setupLayouts() {
-        finishPayView.snp.makeConstraints { (make) in
-            make.bottom.left.right.equalToSuperview()
-            make.top.equalTo(kNavBarTotalHeight)
-        }
-    }
-    
-    override func setupData() {
-        
-        if !(payStatus ?? true) {
-            self.finishPayView.configModel = ConfigModel.shared.object()
-        }
-        
-        finishPayView.tableView.addHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
-            self?.productHotSaleApi(page: page)
-        }
-        
-        navigationBar.onClickLeftButton = {
-            [weak self] in
-            
-            switch self?.orderFinishPayVCType {
-            case .cart?:
-                self?.navigationController?.popToRootViewController(animated: true)
-                break
-            case .productDetail?:
-                self?.navigationController?.popToClass(type: ProductDetailViewController.self)
-                break
-            case .order?:
-                if self?.payStatus ?? true {
-                    if let reloadClosure = self?.reloadClosure {
-                        reloadClosure()
-                    }
-                }
-                self?.navigationController?.popViewController(animated: true)
-                break
-            case .orderDetail?:
-                if self?.payStatus ?? true {
-                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "OrderFinishPayVCOrderDetail"), object: nil)
-                    self?.navigationController?.popToClass(type: OrderViewController.self)
-                }else {
-                    self?.navigationController?.popViewController(animated: true)
-                }
-                break
-            default:
-                break
-            }
-           
-        }
-    }
-    
-    private lazy var finishPayView: OrderFinishPayView = {
-        let finishPayView = OrderFinishPayView()
-        finishPayView.payStatus = payStatus
-        finishPayView.repayTransBlock = {
-            [weak self] in            
-            let vc = OrderViewController()
-            vc.orderVCType = .pendingPayment
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        finishPayView.jumpTransBlock = {
-            [weak self] (jType) in
-            switch jType {
-            case PayJumpDes.homePage:
-                self?.tabBarController?.selectedIndex = 0
-                self?.navigationController?.popToRootViewController(animated: false)
-            case PayJumpDes.checkOrder:
-                let vc = OrderViewController()
-                vc.orderVCType = .toBeShipped
-                self?.navigationController?.pushViewController(vc, animated: true)
-            }
-        }
-        finishPayView.jumpToDetailTransClosure = {
-            [weak self] (proId, shopId) in
-            let vc = ProductDetailViewController()
-            vc.productId = proId
-            vc.shopId = shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        
-        return finishPayView
-    }()
-    
-    /// 商品热销
-    func productHotSaleApi(page:Int = 1) {
-        SwiftMoyaNetWorkServiceProduct.shared().productHotSaleApi(page: page) { [weak self] (productSearchListModel) -> (Void) in
-            let productSearchListModel = productSearchListModel as? ProductSearchListModel
-            if productSearchListModel?.pagination?.currentPage ?? 1  <= productSearchListModel?.pagination?.totalPages ?? 1 {
-                if productSearchListModel?.pagination?.currentPage == 1{
-                    self?.productSearchModelArray.removeAll()
-                }
-                self?.productSearchModelArray = (self?.productSearchModelArray)! + (productSearchListModel?.data!)!
-                
-                self?.finishPayView.hotSaleModelArr = self?.productSearchModelArray
-                
-            } else {
-                self?.finishPayView.hotSaleModelArr = self?.productSearchModelArray
-            }
-        }
-    }
-    
-}

+ 0 - 176
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderLogistics/View/OrderLogisticsInfoCell.swift

@@ -1,176 +0,0 @@
-//
-//  OrderLogisticsInfoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderLogisticsInfoCell: UITableViewCell {
-    
-    var productMdl : ProductModel? {
-        didSet {
-            
-        }
-    }
-    
-    var isFirstCell: Bool = false {
-        didSet {
-            if isFirstCell == true {
-                topLineView.isHidden = true
-                twoLabel.isHidden = false
-                threeLabel.isHidden = false
-            }else {
-                twoLabel.isHidden = true
-                threeLabel.isHidden = true
-            }
-        }
-    }
-    
-    var isLastCell: Bool = false {
-        didSet {
-            if isLastCell == true {
-                botLineView.isHidden = true
-            }
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderLogisticsInfoCell {
-        let ID = "OrderLogisticsInfoCell"
-        tableView.register(OrderLogisticsInfoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderLogisticsInfoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderLogisticsInfoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(informationLabel)
-        addSubview(threeLabel)
-        addSubview(twoLabel)
-        addSubview(oneLabel)
-        addSubview(timeInfoLabel)
-        addSubview(topLineView)
-        addSubview(botLineView)
-    }
-    
-    private func setupLayouts() {
-        informationLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(13)
-            make.right.equalTo(-28)
-            make.left.equalTo(48)
-        }
-        oneLabel.snp.makeConstraints { (make) in
-            make.left.equalToSuperview().offset(18)
-            make.size.equalTo(6)
-            make.centerY.equalTo(informationLabel)
-        }
-        twoLabel.snp.makeConstraints { (make) in
-            make.centerX.equalTo(oneLabel)
-            make.size.equalTo(9)
-            make.centerY.equalTo(informationLabel)
-        }
-        threeLabel.snp.makeConstraints { (make) in
-            make.centerX.equalTo(oneLabel)
-            make.size.equalTo(12)
-            make.centerY.equalTo(informationLabel)
-        }
-        timeInfoLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(informationLabel.snp_left)
-            make.top.equalTo(informationLabel.snp_bottom).offset(8)
-            make.bottom.equalTo(-12)
-            make.height.equalTo(17)
-        }
-        topLineView.snp.makeConstraints { (make) in
-            make.centerX.equalTo(oneLabel)
-            make.top.equalToSuperview()
-            make.bottom.equalTo(oneLabel.snp_top)
-            make.width.equalTo(1)
-        }
-        botLineView.snp.makeConstraints { (make) in
-            make.centerX.equalTo(oneLabel)
-            make.top.equalTo(oneLabel.snp_bottom)
-            make.bottom.equalToSuperview()
-            make.width.equalTo(1)
-        }
-    }
-    
-    
-    private lazy var oneLabel: UILabel = {
-        let oneLabel = UILabel()
-        oneLabel.backgroundColor = ke6e6e6Color
-        oneLabel.layer.cornerRadius = 3
-        oneLabel.masksToBounds = true
-        return oneLabel
-    }()
-    private lazy var twoLabel: UILabel = {
-        let twoLabel = UILabel()
-        twoLabel.backgroundColor = UIColor.white
-        twoLabel.layer.cornerRadius = 4.5
-        twoLabel.isHidden = true
-        twoLabel.masksToBounds = true
-        twoLabel.isHidden = true
-        return twoLabel
-    }()
-    private lazy var threeLabel: UILabel = {
-        let threeLabel = UILabel()
-        threeLabel.backgroundColor = kFFA42FColor.withAlphaComponent(0.4)
-        threeLabel.layer.cornerRadius = 6
-        threeLabel.masksToBounds = true
-        threeLabel.isHidden = true
-        return threeLabel
-    }()
-    
-    private lazy var informationLabel: UILabel = {
-        let informationLabel = UILabel()
-        informationLabel.text = "时间轴展示也是一种比较常见的展现形式。一般用于展示以时间为主线的一连串事件"
-        informationLabel.textColor = k333333Color
-        informationLabel.font = kRegularFont13
-        informationLabel.textAlignment = .left
-        informationLabel.numberOfLines = 0
-        return informationLabel
-    }()
-    
-    private lazy var timeInfoLabel: UILabel = {
-        let timeInfoLabel = UILabel()
-        timeInfoLabel.text = "2019-02-29  17:20:08"
-        timeInfoLabel.textColor = k666666Color
-        timeInfoLabel.font = kRegularFont12
-        timeInfoLabel.textAlignment = .left
-        return timeInfoLabel
-    }()
-    
-    private lazy var topLineView: UIView = {
-        let topLineView = UIView()
-        topLineView.backgroundColor = ke6e6e6Color
-        return topLineView
-    }()
-    
-    private lazy var botLineView: UIView = {
-        let botLineView = UILabel()
-        botLineView.backgroundColor = ke6e6e6Color
-        return botLineView
-    }()
-    
-}
-

+ 0 - 138
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderLogistics/ViewController/OrderLogisticsController.swift

@@ -1,138 +0,0 @@
-//
-//  OrderLogisticsController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单--查看物流Vc
-
-import UIKit
-import RxSwift
-
-class OrderLogisticsController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var orderNumber: String? {
-        didSet {
-            numLbl.text = self.orderNumber
-        }
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupData()
-        
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "查看物流"
-        
-        self.view.backgroundColor = kf7f8faColor
-        
-        let serialNumView = UIView()
-        serialNumView.backgroundColor = kffffffColor
-        self.view.addSubview(serialNumView)
-        serialNumView.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.top.equalToSuperview().offset(kSafeStatusBarHeight+40+10)
-            make.height.equalTo(44)
-        }
-        
-        let titleLbl = UILabel()
-        titleLbl.text = "订单编号"
-        titleLbl.textColor = k999999Color
-        titleLbl.font = kRegularFont13
-        serialNumView.addSubview(titleLbl)
-        titleLbl.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(20)
-        }
-                
-        serialNumView.addSubview(numLbl)
-        numLbl.snp.makeConstraints { (make) in
-            make.centerY.equalTo(titleLbl.snp_centerY)
-            make.left.equalTo(titleLbl.snp_right).offset(20)
-            make.height.equalTo(titleLbl)
-        }
-        
-        self.view.addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-        tableView.snp.makeConstraints { (make) in
-            make.top.equalTo(serialNumView.snp_bottom).offset(10)
-            make.left.right.bottom.equalToSuperview()
-        }
-        
-    }
-    
-    override func setupData() {
-        
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kffffffColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-    private lazy var numLbl: UILabel = {
-        let numLbl = UILabel()
-        numLbl.textColor = k333333Color
-        numLbl.font = kRegularFont13
-        return numLbl
-    }()
-    
-}
-
-// MARK: - tableView dataSource && delegate
-extension OrderLogisticsController : UITableViewDelegate, UITableViewDataSource {
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return 5
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let infoCell = OrderLogisticsInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
-        if indexPath.row == 0 {
-            infoCell.isFirstCell = true
-        }
-        if indexPath.row == 4 {
-            infoCell.isLastCell = true
-        }
-        return infoCell
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return  UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-}

+ 0 - 107
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPayExpressAddInfoCell.swift

@@ -1,107 +0,0 @@
-//
-//  OrderPayExpressAddInfoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--添加快递信息Cell
-
-import UIKit
-
-class OrderPayExpressAddInfoCell: UITableViewCell {
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderPayExpressAddInfoCell {
-        let ID = "OrderPayExpressAddInfoCell"
-        tableView.register(OrderPayExpressAddInfoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderPayExpressAddInfoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderPayExpressAddInfoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(plusImageView)
-        addSubview(titleLabel)
-        addSubview(arrowImageView)
-        addSubview(sepLineImageView)
-    }
-    
-    private func setupLayouts() {
-        plusImageView.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.width.height.equalTo(18)
-            make.top.equalToSuperview().offset(37)
-            make.bottom.equalToSuperview().offset(-38)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(plusImageView.snp_right).offset(8)
-            make.height.equalTo(23)
-            make.centerY.equalTo(plusImageView)
-        }
-        arrowImageView.snp.makeConstraints { (make) in
-            make.centerY.equalTo(plusImageView)
-            make.right.equalTo(-14)
-            make.width.equalTo(8)
-            make.height.equalTo(14)
-        }
-        sepLineImageView.snp.makeConstraints { (make) in
-            make.left.right.bottom.equalToSuperview()
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var plusImageView: UIImageView = {
-        let plusImageView = UIImageView()
-        plusImageView.image = kImage(name: "my_address_add")
-        return plusImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "添加快递收货地址"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont16
-        return titleLabel
-    }()
-    
-    private lazy var arrowImageView: UIImageView = {
-        let arrowImageView = UIImageView()
-        arrowImageView.image = kImage(name: "my_arrows_unfold")
-        return arrowImageView
-    }()
-    
-    private lazy var sepLineImageView: UIImageView = {
-        let sepLineImageView = UIImageView()
-        sepLineImageView.image = kImage(name: "orderPay_separateLine")
-        return sepLineImageView
-    }()
-    
-}

+ 0 - 150
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPayExpressInfoShowCell.swift

@@ -1,150 +0,0 @@
-//
-//  OrderPayExpressInfoShowCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--快递信息Cell
-
-import UIKit
-
-class OrderPayExpressInfoShowCell: UITableViewCell {
-    
-    // 快递地址信息Mdl
-    var addressMdl: ExpressAddresModel? {
-        didSet {
-            nameLabel.text = addressMdl?.contactName
-            phoneLabel.text = addressMdl?.contactMobile
-            titleLabel.text = "\(addressMdl?.provinceName ?? "")\(addressMdl?.cityName ?? "")\(addressMdl?.areaName ?? "")\(addressMdl?.address ?? "")"
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderPayExpressInfoShowCell {
-        let ID = "OrderPayExpressInfoShowCell"
-        tableView.register(OrderPayExpressInfoShowCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderPayExpressInfoShowCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderPayExpressInfoShowCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(nameLabel)
-        addSubview(phoneLabel)
-        addSubview(typeLabel)
-        addSubview(titleLabel)
-        addSubview(arrowImageView)
-        addSubview(sepLineImageView)
-    }
-    
-    private func setupLayouts() {
-        nameLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(14)
-            make.width.lessThanOrEqualTo(67)
-            make.height.equalTo(20)
-            make.top.equalToSuperview().offset(20)
-            make.bottom.equalToSuperview().offset(-50)
-        }
-        phoneLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(nameLabel.snp_right).offset(10)
-            make.height.equalTo(20)
-            make.centerY.equalTo(nameLabel)
-        }
-        typeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(nameLabel.snp_bottom).offset(10)
-            make.left.equalTo(14)
-            make.width.equalTo(40)
-            make.height.equalTo(20)
-        }
-        arrowImageView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-            make.width.equalTo(8)
-            make.height.equalTo(14)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(typeLabel.snp_right).offset(4)
-            make.right.equalTo(arrowImageView.snp_left).offset(-20)
-            make.height.equalTo(20)
-            make.centerY.equalTo(typeLabel)
-        }
-        sepLineImageView.snp.makeConstraints { (make) in
-            make.left.right.bottom.equalToSuperview()
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var nameLabel: UILabel = {
-        let nameLabel = UILabel()
-        nameLabel.textColor = k333333Color
-        nameLabel.font = kBoldFont16
-        return nameLabel
-    }()
-    
-    private lazy var phoneLabel: UILabel = {
-        let phoneLabel = UILabel()
-        phoneLabel.textColor = k333333Color
-        phoneLabel.font = kBoldFont16
-        return phoneLabel
-    }()
-    
-    private lazy var typeLabel: UILabel = {
-        let typeLabel = UILabel()
-        typeLabel.text = "快递"
-        typeLabel.textAlignment = .center
-        typeLabel.backgroundColor = kfee5e4Color
-        typeLabel.textColor = kFE352BColor
-        typeLabel.font = kRegularFont13
-        typeLabel.cornerRadius = 10
-        typeLabel.masksToBounds = true
-        return typeLabel
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k666666Color
-        titleLabel.font = kRegularFont14
-        return titleLabel
-    }()
-    
-    private lazy var arrowImageView: UIImageView = {
-        let arrowImageView = UIImageView()
-        arrowImageView.image = kImage(name: "my_arrows_unfold")
-        return arrowImageView
-    }()
-    
-    private lazy var sepLineImageView: UIImageView = {
-        let sepLineImageView = UIImageView()
-        sepLineImageView.image = kImage(name: "orderPay_separateLine")
-        return sepLineImageView
-    }()
-    
-}

+ 0 - 96
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickAddInfoCell.swift

@@ -1,96 +0,0 @@
-//
-//  OrderPaySelfPickAddInfoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--自提添加收货人信息Cell
-
-import UIKit
-
-class OrderPaySelfPickAddInfoCell: UITableViewCell {
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderPaySelfPickAddInfoCell {
-        let ID = "OrderPaySelfPickAddInfoCell"
-        tableView.register(OrderPaySelfPickAddInfoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderPaySelfPickAddInfoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderPaySelfPickAddInfoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(plusImageView)
-        addSubview(titleLabel)
-        addSubview(arrowImageView)
-    }
-    
-    private func setupLayouts() {
-        plusImageView.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.width.height.equalTo(18)
-            make.top.equalToSuperview().offset(15)
-            make.bottom.equalToSuperview().offset(-15)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(plusImageView.snp_right).offset(8)
-            make.height.equalTo(20)
-            make.centerY.equalTo(plusImageView)
-        }
-        arrowImageView.snp.makeConstraints { (make) in
-            make.centerY.equalTo(plusImageView)
-            make.right.equalTo(-14)
-            make.width.equalTo(8)
-            make.height.equalTo(14)
-        }
-    }
-    
-    private lazy var plusImageView: UIImageView = {
-        let plusImageView = UIImageView()
-        plusImageView.image = kImage(name: "my_address_add")
-        return plusImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "添加收货人信息"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        return titleLabel
-    }()
-    
-    private lazy var arrowImageView: UIImageView = {
-        let arrowImageView = UIImageView()
-        arrowImageView.image = kImage(name: "my_arrows_unfold")
-        return arrowImageView
-    }()
-    
-}

+ 0 - 120
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickAddressCell.swift

@@ -1,120 +0,0 @@
-//
-//  OrderPaySelfPickAddressCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--自提地址信息Cell
-
-import UIKit
-
-class OrderPaySelfPickAddressCell: UITableViewCell {
-    
-    var selfAddressMdl: SelfAddresModel? {
-        didSet {
-            titleLabel.text = "\(selfAddressMdl?.address ?? "")"
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderPaySelfPickAddressCell {
-        let ID = "OrderPaySelfPickAddressCell"
-        tableView.register(OrderPaySelfPickAddressCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderPaySelfPickAddressCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderPaySelfPickAddressCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(typeLabel)
-        addSubview(titleLabel)
-        addSubview(arrowImageView)
-        addSubview(sepLineImageView)
-    }
-    
-    private func setupLayouts() {
-        typeLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.width.equalTo(40)
-            make.height.equalTo(20)
-            make.top.equalToSuperview().offset(14)
-            make.bottom.equalToSuperview().offset(-14)
-        }
-        arrowImageView.snp.makeConstraints { (make) in
-            make.centerY.equalTo(typeLabel)
-            make.right.equalTo(-14)
-            make.width.equalTo(8)
-            make.height.equalTo(14)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(typeLabel.snp_right).offset(8)
-            make.right.equalTo(arrowImageView.snp_left).offset(-20)
-            make.height.equalTo(20)
-            make.centerY.equalTo(typeLabel)
-        }
-        sepLineImageView.snp.makeConstraints { (make) in
-            make.left.right.bottom.equalToSuperview()
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var typeLabel: UILabel = {
-        let typeLabel = UILabel()
-        typeLabel.text = "自提"
-        typeLabel.textAlignment = .center
-        typeLabel.backgroundColor = kfee5e4Color
-        typeLabel.textColor = kFE352BColor
-        typeLabel.font = kRegularFont13
-        typeLabel.cornerRadius = 10
-        typeLabel.masksToBounds = true
-        return typeLabel
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        return titleLabel
-    }()
-    
-    private lazy var arrowImageView: UIImageView = {
-        let arrowImageView = UIImageView()
-        arrowImageView.image = kImage(name: "my_arrows_unfold")
-        return arrowImageView
-    }()
-    
-    private lazy var sepLineImageView: UIImageView = {
-        let sepLineImageView = UIImageView()
-        sepLineImageView.image = kImage(name: "orderPay_separateLine")
-        return sepLineImageView
-    }()
-    
-}

+ 0 - 104
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/AdressCell/OrderPaySelfPickInfoCell.swift

@@ -1,104 +0,0 @@
-//
-//  OrderPaySelfPickInfoCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--自提个人信息Cell
-
-import UIKit
-
-class OrderPaySelfPickInfoCell: UITableViewCell {
-    
-    // 默认联系人Mdl
-    var contactMdl: SelfMentionContactsModel? {
-        didSet {
-            nameLabel.text = contactMdl?.name
-            phoneLabel.text = contactMdl?.mobile
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderPaySelfPickInfoCell {
-        let ID = "OrderPaySelfPickInfoCell"
-        tableView.register(OrderPaySelfPickInfoCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderPaySelfPickInfoCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderPaySelfPickInfoCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(nameLabel)
-        addSubview(phoneLabel)
-        addSubview(arrowImageView)
-    }
-    
-    private func setupLayouts() {
-        nameLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(14)
-            make.width.lessThanOrEqualTo(100)
-            make.top.equalToSuperview().offset(14)
-            make.bottom.equalToSuperview().offset(-14)
-        }
-        phoneLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(nameLabel.snp_right).offset(12)
-            make.height.equalTo(20)
-            make.centerY.equalTo(nameLabel)
-        }
-        arrowImageView.snp.makeConstraints { (make) in
-            make.centerY.equalTo(nameLabel)
-            make.right.equalTo(-14)
-            make.width.equalTo(8)
-            make.height.equalTo(14)
-        }
-    }
-    
-    private lazy var nameLabel: UILabel = {
-        let nameLabel = UILabel()
-        nameLabel.textColor = k333333Color
-        nameLabel.font = kRegularFont14
-        return nameLabel
-    }()
-    
-    private lazy var phoneLabel: UILabel = {
-        let phoneLabel = UILabel()
-        phoneLabel.textColor = k333333Color
-        phoneLabel.font = kRegularFont14
-        return phoneLabel
-    }()
-    
-    private lazy var arrowImageView: UIImageView = {
-        let arrowImageView = UIImageView()
-        arrowImageView.image = kImage(name: "my_arrows_unfold")
-        return arrowImageView
-    }()
-    
-}

+ 0 - 83
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/OrderPayAcountView.swift

@@ -1,83 +0,0 @@
-//
-//  OrderPayAcountView.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--结算View
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class OrderPayAcountView: BaseView {
-    
-    typealias CommitOrderBlock = () -> Void
-    var commitOrderBlock : CommitOrderBlock?
-    
-    var tPrice: Int? {
-        didSet {            
-            priceLabel.text = priceConversion(price: tPrice ?? 0)
-        }
-    }
-    
-    override func setupViews() {
-        self.backgroundColor = kffffffColor
-        addSubview(accountBtn)
-        addSubview(priceLabel)
-        addSubview(prePriceLabel)
-    }
-    
-    override func setupLayouts() {
-        accountBtn.snp.makeConstraints { (make) in
-            make.right.equalToSuperview().offset(-14)
-            make.centerY.equalToSuperview()
-            make.width.equalTo(100)
-            make.height.equalTo(37)
-        }
-        
-        priceLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(accountBtn.snp_left).offset(-12)
-            make.height.equalTo(25)
-        }
-        
-        prePriceLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(priceLabel.snp_left).offset(-1)
-        }
-        
-    }
-    
-    private lazy var accountBtn: UIButton = {
-        let accountBtn = UIButton(type: UIButton.ButtonType.custom)
-        accountBtn.backgroundColor = kFFA42FColor
-        accountBtn.setTitle("提交订单", for: UIControl.State.normal)
-        accountBtn.setTitleColor(kffffffColor, for: UIControl.State.normal)
-        accountBtn.titleLabel?.font = kScaleRegularFont15
-        accountBtn.cornerRadius = 18
-        accountBtn.masksToBounds = true
-        accountBtn.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let commitOrderBlock = self?.commitOrderBlock {
-                commitOrderBlock()
-            }
-        }).disposed(by: disposeBag)
-        return accountBtn
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = kFE352BColor
-        priceLabel.font = kScaleBoldFont18
-        return priceLabel
-    }()
-    
-    private lazy var prePriceLabel: UILabel = {
-        let prePriceLabel = UILabel()
-        prePriceLabel.text = "合计"
-        prePriceLabel.textColor = k333333Color
-        prePriceLabel.font = kScaleRegularFont16
-        return prePriceLabel
-    }()
-    
-}

+ 0 - 94
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartOrderPayFreightCell.swift

@@ -1,94 +0,0 @@
-//
-//  ShoppingCartOrderPayFreightCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/6/3.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--运费Cell
-
-import UIKit
-
-class ShoppingCartOrderPayFreightCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingCartOrderPayFreightCell {
-        let ID = "ShoppingCartOrderPayFreightCell"
-        tableView.register(ShoppingCartOrderPayFreightCell.self, forCellReuseIdentifier: ID)
-        let cell : ShoppingCartOrderPayFreightCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingCartOrderPayFreightCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(freightLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.top.bottom.equalToSuperview()
-        }
-        freightLabel.snp.makeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.top.bottom.equalToSuperview()
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalToSuperview()
-            make.left.equalTo(titleLabel)
-            make.right.equalTo(freightLabel)
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "运费"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont14
-        return titleLabel
-    }()
-    
-    private lazy var freightLabel: UILabel = {
-        let freightLabel = UILabel()
-        freightLabel.textColor = k333333Color
-        freightLabel.font = kRegularFont14
-        freightLabel.text = priceConversion(price: 0)
-        return freightLabel
-    }()
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-}

+ 0 - 431
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartOrderPayView.swift

@@ -1,431 +0,0 @@
-//
-//  ShoppingCartOrderPayView.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--订单支付View
-
-import UIKit
-
-class ShoppingCartOrderPayView: BaseView {
-    
-    typealias CommitOrderTransBlock = (_ paraModel: OrderCreateParameterModel) -> Void
-    var commitOrderTransBlock : CommitOrderTransBlock?
-    
-    typealias JumpNavBlock = (_ jumpType: WillJumpType) -> Void
-    var jumpNavBlock : JumpNavBlock?       
-    
-    // 全部已选总价(元)
-    var totalProductPrice: Int = 0 {
-        didSet {
-            self.accountView.tPrice = totalProductPrice
-        }
-    }
-    
-    // 已选商品ModelArr
-    var proListModelArr : Array<CartProductListModel>? {
-        didSet {
-            if proListModelArr != nil {
-                self.proListModelArr = self.fixOriginalPayArray()
-                tableView.reloadData()
-                accountView.isHidden = false
-
-            }else {
-                accountView.isHidden = true
-            }
-            
-        }
-    }
-    
-    // 配送方式
-    var deliverType: String? {
-        didSet {
-            if self.deliverType == "1" {
-                selfAddressLabel.text = "\(selfAddrMdl?.address ?? "")"
-            } else {
-                selfAddressView.isHidden = true
-                tableView.snp.remakeConstraints { (make) in
-                    make.top.left.right.equalToSuperview()
-                    make.bottom.equalTo(accountView.snp_top)
-                }
-            }
-        }
-    }
-    
-    // 快递地址信息Mdl
-    var expressAddressMdl: ExpressAddresModel? {
-        didSet {
-            if expressAddressMdl != nil && expressAddressMdl?.id != nil {
-                tableView.reloadData()
-            }
-        }
-    }
-    
-    // 自提联系人信息Mdl
-    var selfAddressInfoMdl: SelfMentionContactsModel? {
-        didSet {
-            if selfAddressInfoMdl != nil {
-                tableView.reloadData()
-            }
-        }
-    }
-    
-    // 自提地址信息Mdl
-    var selfAddrMdl: SelfAddresModel? {
-        didSet {
-            if selfAddrMdl != nil {
-                selfAddressLabel.text = "\(selfAddrMdl?.address ?? "")"
-                tableView.reloadData()
-            }
-        }
-    }
-    
-    override func setupViews() {
-        self.backgroundColor = kf7f8faColor
-        addSubview(accountView)
-        addSubview(selfAddressView)
-        selfAddressView.addSubview(selfAddressLabel)
-        addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-        tableView.ly_startLoading()
-    }
-    
-    override func setupLayouts() {
-        accountView.snp.makeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.bottom.equalTo(-kSafeTabBarHeight)
-            make.height.equalTo(48)
-        }
-        
-        selfAddressView.snp.makeConstraints { (make) in
-            make.bottom.equalTo(accountView.snp_top)
-            make.left.right.equalToSuperview()
-        }
-        
-        selfAddressLabel.snp.remakeConstraints { (make) in
-            make.left.equalToSuperview().offset(14)
-            make.right.equalToSuperview().offset(-26)
-            make.top.bottom.equalToSuperview()
-            make.height.equalTo(40)
-        }
-        
-        tableView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.bottom.equalTo(selfAddressView.snp_top)
-        }
-    }
-    
-    lazy var accountView: OrderPayAcountView = {
-        let accountView = OrderPayAcountView()
-        accountView.commitOrderBlock = {
-            [weak self] in
-            // 1-校验长度
-            for (_, productListMdl) in (self?.proListModelArr?.enumerated())! {
-                if productListMdl.buyerNotes?.count ?? 0 > 50 {
-                    SwiftProgressHUD.shared().showText("买家留言最多可输入50个字符,请重新编辑商品留言", textAlignment: .left)
-                    return
-                }
-            }
-            
-            // 2-拼接参数模型
-            let paraMdl = OrderCreateParameterModel()
-            paraMdl.money = self!.totalProductPrice
-            paraMdl.selShopListArr = self?.proListModelArr
-            switch self?.deliverType {
-            case "1":
-                // 自提
-                paraMdl.name = self?.selfAddressInfoMdl?.name
-                paraMdl.mobile = Int(self?.selfAddressInfoMdl?.mobile ?? "")
-                paraMdl.address = "\(self?.selfAddrMdl?.address ?? "")"
-                paraMdl.pickNodeId = self?.selfAddrMdl?.pickupNodeId
-                paraMdl.pickNodeContact = self?.selfAddrMdl?.managerName
-            case "2":
-                // 快递
-                paraMdl.name = self?.expressAddressMdl?.contactName
-                paraMdl.mobile = Int(self?.expressAddressMdl?.contactMobile ?? "")
-                paraMdl.address = self?.expressAddressMdl?.address
-                paraMdl.pickNodeId = 0
-                paraMdl.pickNodeContact = ""
-            default:
-                return
-            }
-            
-            if let commitOrderTransBlock = self?.commitOrderTransBlock {
-                commitOrderTransBlock(paraMdl)
-            }
-            
-        }
-        return accountView
-    }()
-    
-    private lazy var selfAddressView: UIView = {
-        let selfAddressView = UIView()
-        selfAddressView.backgroundColor = kfff8efColor
-        return selfAddressView
-    }()
-    
-    private lazy var selfAddressLabel: UILabel = {
-        let selfAddressLabel = UILabel()
-        selfAddressLabel.textColor = kFFA42FColor
-        selfAddressLabel.font = kRegularFont13
-        selfAddressLabel.textAlignment = .left
-        selfAddressLabel.numberOfLines = 0
-        return selfAddressLabel
-    }()
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 20, right: 0)
-        return tableView
-    }()
-    
-}
-
-// MARK: - tableView dataSource && delegate
-extension ShoppingCartOrderPayView : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        
-        return proListModelArr?.isEmpty ?? true ? 0 : (proListModelArr?.count ?? 0) + 1
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if section == 0 {
-            switch deliverType {
-            case "1":
-                // 自提
-                return 2
-            case "2":
-                // 快递
-                return 1
-            default:
-                return 1
-            }
-        } else {
-            let productItems: Int = proListModelArr![section-1].productList?.isEmpty ?? true ? 0 : proListModelArr![section-1].productList?.count ?? 0
-            switch deliverType {
-            case "1":
-                // 自提
-                return productItems
-            case "2":
-                // 快递(商品Cells + 运费Cell)
-                return productItems + 1
-            default:
-                return productItems
-            }
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        if indexPath.section == 0 {
-            switch deliverType {
-            case "1":
-                // 自提
-                if selfAddressInfoMdl?.id == nil  {
-                    if indexPath.row == 0 {
-                        // 自提添加收货人信息
-                        let cell = OrderPaySelfPickAddInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        return cell
-                    } else {
-                        // 自提地址信息
-                        let cell = OrderPaySelfPickAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.selfAddressMdl = selfAddrMdl
-                        return cell
-                    }
-                } else {
-                    if indexPath.row == 0 {
-                        // 自提个人信息
-                        let cell = OrderPaySelfPickInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.contactMdl = selfAddressInfoMdl
-                        return cell
-                    } else {
-                        // 自提地址信息
-                        let cell = OrderPaySelfPickAddressCell.cellWith(tableView: tableView, indexPath: indexPath)
-                        cell.selfAddressMdl = selfAddrMdl
-                        return cell
-                    }
-                }
-            case "2":
-                // 快递
-                if expressAddressMdl == nil {
-                    // 快递添加地址
-                    let expressCell = OrderPayExpressAddInfoCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    return expressCell
-                } else {
-                    // 快递信息管理
-                    let expressCell = OrderPayExpressInfoShowCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    expressCell.addressMdl = expressAddressMdl
-                    return expressCell
-                }
-            default:
-                return UITableViewCell()
-            }
-            
-        } else {
-            let productItems: Int = proListModelArr![indexPath.section-1].productList?.isEmpty ?? true ? 0 : proListModelArr![indexPath.section-1].productList?.count ?? 0
-            switch deliverType {
-            case "1":
-                // 自提
-                // 购物车列表Item
-                let cell = ShoppingCartPayOrderItemCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.productMdl = proListModelArr![indexPath.section-1].productList![indexPath.row]
-                return cell
-            case "2":
-                // 快递(商品Cells + 运费Cell)
-                if indexPath.row < productItems {
-                    // 购物车列表Item
-                    let cell = ShoppingCartPayOrderItemCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    cell.productMdl = proListModelArr![indexPath.section-1].productList![indexPath.row]
-                    return cell
-                } else {
-                    // 运费Cell
-                    let cell = ShoppingCartOrderPayFreightCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    return cell
-                }
-            default:
-                return UITableViewCell()
-            }
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return  UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        if section == 0 {
-            return 10
-        } else {
-            return 58
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        if section == 0 {
-            return nil
-        } else {
-            let headerView = ShoppingCartPayOrderHeader(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 58))
-            headerView.shopName = proListModelArr![section-1].shopName
-            return headerView
-            
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        if section == 0 {
-            return 0.000001
-        } else {
-            return 88
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        if section == 0 {
-            return nil
-        } else {
-            let footerView = ShoppingCartPayOrderFooter(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 88))
-            
-            let cartProListMdl: CartProductListModel = proListModelArr![section-1]
-            let secNum: Int = cartProListMdl.productList!.count
-            
-            footerView.tPrice = self.calculateSectionPrice(section-1)
-            footerView.tNumber = secNum
-            
-            footerView.buyerNoteBlock = { [weak self]
-                (buyerNotes) in
-                self?.proListModelArr![section-1].buyerNotes = buyerNotes
-            }
-            
-            return footerView
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if indexPath.section != 0 {
-            return
-        }
-        
-        switch deliverType {
-        case "1":
-            // 自提
-            if selfAddressInfoMdl?.id == nil {
-                if indexPath.row == 0 {
-                    if let jumpNavBlock = self.jumpNavBlock {
-                        jumpNavBlock(WillJumpType.selfAddInfo)
-                    }
-                } else {
-                    if let jumpNavBlock = self.jumpNavBlock {
-                        jumpNavBlock(WillJumpType.selfAddressInfo)
-                    }
-                }
-            } else {
-                if indexPath.row == 0 {
-                    if let jumpNavBlock = self.jumpNavBlock {
-                        jumpNavBlock(WillJumpType.selfPersonalInfo)
-                    }
-                } else {
-                    if let jumpNavBlock = self.jumpNavBlock {
-                        jumpNavBlock(WillJumpType.selfAddressInfo)
-                    }
-                }
-            }
-        case "2":
-            // 快递
-            if expressAddressMdl?.id == nil {
-                if let jumpNavBlock = self.jumpNavBlock {
-                    jumpNavBlock(WillJumpType.expressAddInfo)
-                }
-            } else {
-                if let jumpNavBlock = self.jumpNavBlock {
-                    jumpNavBlock(WillJumpType.expressManageInfo)
-                }
-            }
-        default:
-            return
-        }
-    }
-    
-}
-
-// MARK: - 购物车计算
-extension ShoppingCartOrderPayView {
-    
-    // 剔除section下商品全为下架/售罄的商家
-    func fixOriginalPayArray() -> Array<CartProductListModel> {
-        var fixedListMdlArr: Array<CartProductListModel> = []
-        for (secIdx, proListMdl) in (proListModelArr?.enumerated())! {
-            var shopAllDisabled: Bool = true
-            for productMdl in proListMdl.productList ?? [] {
-                if productMdl.upStatus != 0 && productMdl.stock != 0 {
-                    shopAllDisabled = false
-                    break
-                }
-            }
-            if shopAllDisabled == false {
-                fixedListMdlArr.append(proListModelArr![secIdx])
-            }
-        }
-        return fixedListMdlArr
-    }
-    
-    // 计算Section数据,刷新结算View
-    func calculateSectionPrice(_ section: Int) -> Int {
-        var totalPrice: Int = 0
-        
-        let cartProListMdl: CartProductListModel = proListModelArr![section]
-        for productMdl in cartProListMdl.productList! {
-            totalPrice += ((productMdl.skuPrice ?? 0) * (productMdl.amount ?? 0))
-        }
-        return totalPrice
-    }
-    
-}

+ 0 - 145
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderFooter.swift

@@ -1,145 +0,0 @@
-//
-//  ShoppingCartPayOrderFooter.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--商品列表Footer
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class ShoppingCartPayOrderFooter: BaseView {
-    
-    typealias BuyerNoteBlock = (_ note: String) -> Void
-    var buyerNoteBlock : BuyerNoteBlock?
-    
-    var tPrice: Int? {
-        didSet {
-            let priceStr = priceConversion(price: tPrice ?? 0)
-            let originStr = "合计 \(priceStr)"
-            let attrStr = NSMutableAttributedString(string:originStr)
-            attrStr.changeForegroundColor(kFE352BColor, range: NSRange(location: 2, length: originStr.count-2))
-            priceLabel.attributedText = attrStr
-        }
-    }
-    
-    var tNumber: Int? {
-        didSet {
-            let originStr = "共\(tNumber ?? 0)件商品,"
-            let attrStr = NSMutableAttributedString(string:originStr)
-            attrStr.changeForegroundColor(k333333Color, range: NSRange(location: 1, length: originStr.count-5))
-            numberLabel.attributedText = attrStr
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    override func setupViews() {
-        self.backgroundColor = kffffffColor
-        addSubview(msgLabel)
-        addSubview(msgTextField)
-        addSubview(priceLabel)
-        addSubview(numberLabel)
-    }
-    
-    override func setupLayouts() {
-        msgLabel.snp.makeConstraints { (make) in
-            make.left.top.equalToSuperview().offset(14)
-            make.width.equalTo(56)
-            make.height.equalTo(20)
-        }
-        
-        msgTextField.snp.makeConstraints { (make) in
-            make.centerY.equalTo(msgLabel)
-            make.left.equalTo(msgLabel.snp_right).offset(11)
-            make.right.equalTo(-14)
-            make.height.equalTo(28)
-        }
-        
-        priceLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(msgTextField.snp_bottom).offset(20)
-            make.right.equalTo(msgTextField)
-            make.height.equalTo(20)
-        }
-        
-        numberLabel.snp.makeConstraints { (make) in
-            make.right.equalTo(priceLabel.snp_left)
-            make.centerY.equalTo(priceLabel)
-            make.height.equalTo(priceLabel)
-        }
-    }
-    
-    private lazy var msgLabel: UILabel = {
-        let msgLabel = UILabel()
-        msgLabel.text = "买家留言"
-        msgLabel.textColor = k333333Color
-        msgLabel.font = kRegularFont14
-        msgLabel.textAlignment = .left
-        return msgLabel
-    }()
-    
-    private lazy var msgTextField : UITextField = {
-        let msgTextField = UITextField()
-        msgTextField.placeholder = "单行输入"
-        msgTextField.borderStyle = .roundedRect
-        msgTextField.textColor = k666666Color
-        msgTextField.font = kRegularFont12
-        msgTextField.clearButtonMode = .whileEditing
-        msgTextField.sizeToFit()
-        msgTextField.tintColor = kFFA42FColor
-        msgTextField.delegate = self
-        return msgTextField
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = k999999Color
-        priceLabel.font = kRegularFont14
-        priceLabel.textAlignment = .right
-        return priceLabel
-    }()
-    
-    private lazy var numberLabel: UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.textColor = k999999Color
-        numberLabel.font = kRegularFont14
-        numberLabel.textAlignment = .right
-        return numberLabel
-    }()
-    
-}
-
-extension ShoppingCartPayOrderFooter: UITextFieldDelegate {
-    
-    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
-        if textField == msgTextField {
-            textField.addTarget(self, action: #selector(textFieldDidChange(_:)), for: UIControl.Event.editingChanged)
-        }
-        return true
-    }
-    
-    @objc func textFieldDidChange(_ textField: UITextField) {
-        var fullStr = textField.text ?? ""
-        if textField.text?.count ?? 0 > 80 {
-            fullStr = String(fullStr.prefix(50)) as String
-            textField.text = fullStr
-        }
-        
-        if let buyerNoteBlock = self.buyerNoteBlock {
-            buyerNoteBlock(self.msgTextField.text ?? "")
-        }
-    }
-    
-}

+ 0 - 109
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderHeader.swift

@@ -1,109 +0,0 @@
-//
-//  ShoppingCartPayOrderHeader.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--商品列表Header
-
-import UIKit
-import RxSwift
-import RxCocoa
-
-class ShoppingCartPayOrderHeader: BaseView {
-    
-    var shopName : String? {
-        didSet {
-            titleButton.setTitle(shopName, for: UIControl.State.normal)
-            titleButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    override func setupViews() {
-        self.backgroundColor = kf7f8faColor
-        addSubview(separateView)
-        addSubview(headerBackView)
-        addSubview(bottomLineView)
-        
-        headerBackView.addSubview(titleButton)
-    }
-    
-    override func setupLayouts() {
-        separateView.snp.makeConstraints { (make) in
-            make.left.top.right.equalToSuperview()
-            make.height.equalTo(10)
-        }
-        
-        headerBackView.snp.makeConstraints { (make) in
-            make.top.equalTo(separateView.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(48)
-        }
-        
-        titleButton.snp.makeConstraints { (make) in
-            make.left.equalToSuperview().offset(10)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(20)
-        }
-        
-        bottomLineView.snp.makeConstraints { (make) in
-            make.left.right.bottom.equalToSuperview()
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var separateView: UIView = {
-        let separateView = UIView()
-        separateView.backgroundColor = kf7f8faColor
-        return separateView
-    }()
-    
-    lazy var headerBackView: UIView = {
-        let headerBackView = UIView()
-        headerBackView.backgroundColor = kffffffColor
-        let shapeLayer = CAShapeLayer()
-        headerBackView.layer.mask = nil
-        let rect = CGRect(x: 0, y: 0, width: kScreenWidth - 14 * kScaleWidth * 2, height: 48)
-        let bezierPath = UIBezierPath(roundedRect: rect,
-                                      byRoundingCorners: [.topLeft,.topRight],
-                                      cornerRadii: CGSize(width: 4,height: 4))
-        shapeLayer.frame = headerBackView.bounds
-        shapeLayer.path = bezierPath.cgPath
-        headerBackView.layer.mask = shapeLayer
-        return headerBackView
-    }()
-    
-    private lazy var titleButton: UIButton = {
-        let titleButton = UIButton(type: UIButton.ButtonType.custom)
-        titleButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        titleButton.titleLabel?.font = kScaleRegularFont14
-        titleButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            
-            //            if let loginBlock = self?.loginBlock {
-            //                loginBlock((self?.phoneNumber)!,(self?.password)!)
-            //            }
-            print("点击了当前店铺Header")
-            
-        }).disposed(by: disposeBag)
-        return titleButton
-    }()
-    
-    private lazy var bottomLineView: UIView = {
-        let bottomLineView = UIView()
-        bottomLineView.backgroundColor = kf5f5f5Color
-        return bottomLineView
-    }()
-    
-}

+ 0 - 163
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/View/ShoppingCartPayOrderItemCell.swift

@@ -1,163 +0,0 @@
-//
-//  ShoppingCartPayOrderItemCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  订单支付--商品列表Cell
-
-import UIKit
-import Kingfisher
-
-class ShoppingCartPayOrderItemCell: UITableViewCell {
-    
-    var productMdl : ProductModel? {
-        didSet {
-            // 商品图片
-            iconImageView.kf.setImage(with: kURLImage(name: productMdl?.productImg ?? ""), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            // 商品名称
-            titleLabel.text = productMdl?.productName
-            // 预计配送时间
-            deliveryTime.text = "预计配送时间:\(productMdl?.receiveTime ?? "")"
-            // 规格
-            sellScaleLabel.text = "规格:\(productMdl?.skuName ?? "")"
-            // 数量
-            sellNumberLabel.text = "x\(productMdl?.amount ?? 1)"
-            // 价格            
-            sellPriceLabel.text = priceConversion(price: productMdl?.skuPrice ?? 0)
-        }
-    }
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14 * kScaleWidth
-            frame.size.width -= 14 * kScaleWidth * 2
-            super.frame = frame
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShoppingCartPayOrderItemCell {
-        let ID = "ShoppingCartPayOrderItemCell"
-        tableView.register(ShoppingCartPayOrderItemCell.self, forCellReuseIdentifier: ID)
-        let cell : ShoppingCartPayOrderItemCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShoppingCartPayOrderItemCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(iconImageView)
-        addSubview(titleLabel)
-        addSubview(deliveryTime)
-        addSubview(sellScaleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        
-    }
-    
-    private func setupLayouts() {
-        iconImageView.snp.makeConstraints { (make) in
-            make.top.left.equalToSuperview().offset(14)
-            make.width.height.equalTo(92)
-            make.bottom.equalToSuperview().offset(-14)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImageView.snp_right).offset(10)
-            make.top.equalTo(14)
-            make.right.equalTo(-26)
-            make.height.equalTo(20)
-        }
-        deliveryTime.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(8)
-            make.right.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        sellScaleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(deliveryTime.snp.bottom).offset(8)
-            make.left.right.equalTo(deliveryTime)
-            make.height.equalTo(17)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(sellScaleLabel.snp.bottom).offset(4)
-            make.left.equalTo(sellScaleLabel)
-            make.height.equalTo(17)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.height.equalTo(20)
-            make.centerY.equalTo(sellNumberLabel)
-        }
-        
-    }
-    
-    private lazy var iconImageView: UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.contentMode = .scaleAspectFill
-        iconImageView.clipsToBounds = true
-        return iconImageView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kBoldFont14
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var deliveryTime: UILabel = {
-        let deliveryTime = UILabel()
-        deliveryTime.text = "预计配送时间:次日达"
-        deliveryTime.textColor = k666666Color
-        deliveryTime.font = kRegularFont12
-        deliveryTime.textAlignment = .left
-        return deliveryTime
-    }()
-    
-    private lazy var sellScaleLabel: UILabel = {
-        let sellScaleLabel = UILabel()
-        sellScaleLabel.textColor = k999999Color
-        sellScaleLabel.font = kRegularFont12
-        return sellScaleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()
-        sellNumberLabel.textColor = k999999Color
-        sellNumberLabel.font = kRegularFont12
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = k333333Color
-        sellPriceLabel.font = kRegularFont14
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-}

+ 0 - 175
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderPayOrder/ViewController/ShoppingCartPayOrderController.swift

@@ -1,175 +0,0 @@
-//
-//  ShoppingCartPayOrderController.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/9.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//  购物车--订单支付
-
-import UIKit
-import RxSwift
-
-// 跳转类型
-enum WillJumpType {
-    case expressAddInfo         // 添加快递地址
-    case expressManageInfo      // 管理快递地址
-    case selfAddInfo            // 添加自提收货信息
-    case selfPersonalInfo       // 自提个人信息
-    case selfAddressInfo        // 自提地址信息
-}
-
-enum ShoppingCartPayOrderVCType {
-    case cart
-    case productDetail
-}
-
-class ShoppingCartPayOrderController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    // 已选商品ModelArr
-    var selListModelArr : Array<CartProductListModel>?
-
-    // 全部已选总价
-    var totalProductPrice: Int?
-    
-    var shoppingCartPayOrderVCType : ShoppingCartPayOrderVCType?
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "订单支付"
-        view.addSubview(orderPayView)
-    }
-    
-    override func setupLayouts() {
-        orderPayView.snp.makeConstraints { (make) in
-            make.bottom.left.right.equalToSuperview()
-            make.top.equalTo(kNavBarTotalHeight)
-        }
-    }
-    
-    override func setupData() {
-        let deliverType = DeliveryMethodTypeModel.shared().getModel()?.deliveryMethodType
-        orderPayView.deliverType = deliverType
-        
-        switch deliverType {
-        case "1":
-            self.userDefaultContactApi()
-            self.userSelfAndExpressAddressListApi(type:1)
-        case "2":
-            // 获取默认快递信息
-            self.userDefaultExpressApi()
-        default:
-            break
-        }
-        
-        orderPayView.jumpNavBlock = {
-            [weak self] (jumpType) in
-            switch jumpType {
-            case WillJumpType.expressAddInfo:
-                let vc = EditExpressAddressViewController()
-                vc.isFromOrderPay = true
-                vc.isAddNewAddress = true                
-                vc.saveAddressClosure = {
-                    [weak self] () in
-                    self?.setupData()
-                }
-                self?.navigationController?.pushViewController(vc, animated: true)
-            case WillJumpType.expressManageInfo:
-                let vc = ExpressAddressListViewController()
-                vc.isFromOrderPay = true
-                vc.selectAddressClosure = {
-                    [weak self] (expressAddresModel) in
-                    self?.orderPayView.expressAddressMdl = expressAddresModel
-                }
-                self?.navigationController?.pushViewController(vc, animated: true)
-            case WillJumpType.selfAddInfo,
-                 WillJumpType.selfPersonalInfo
-                 :
-                let vc = SelfMentionContactsListViewController()
-                vc.isFromOrderPay = true
-                vc.saveContactClosure = {
-                    [weak self] (contactMdl) in
-                    self?.orderPayView.selfAddressInfoMdl = contactMdl
-                }
-                self?.navigationController?.pushViewController(vc, animated: true)
-            case WillJumpType.selfAddressInfo:
-                let vc = SelfRecommendationViewController()
-                vc.didSelectClosure = {
-                    [weak self] () in
-                    self?.setupData()
-                }
-                self?.navigationController?.pushViewController(vc, animated: true)
-            }
-        }
-        
-        orderPayView.commitOrderTransBlock = {
-            [weak self] (paraMdl) in
-            if self?.selListModelArr != nil {
-                self?.orderCreateApi(paraMdl: paraMdl)
-            }
-        }
-    }
-    
-    private lazy var orderPayView: ShoppingCartOrderPayView = {
-        let orderPayView = ShoppingCartOrderPayView()
-        orderPayView.proListModelArr = self.selListModelArr
-        orderPayView.totalProductPrice = self.totalProductPrice ?? 0
-        return orderPayView
-    }()
-    
-}
-
-// MARK: - 网络请求相关
-extension ShoppingCartPayOrderController {
-    /// 获取默认快递信息
-    func userDefaultExpressApi() {
-        SwiftMoyaNetWorkServiceUser.shared().userDefaultExpressApi { [weak self] (expressAddrModel) -> (Void) in
-            self?.orderPayView.expressAddressMdl = expressAddrModel as? ExpressAddresModel
-        }
-    }
-    
-    // 获取默认用户自提信息
-    func userDefaultContactApi() {
-        SwiftMoyaNetWorkServiceUser.shared().userDefaultContactApi { [weak self] (contactModel) -> (Void) in
-            self?.orderPayView.selfAddressInfoMdl = contactModel as? SelfMentionContactsModel
-        }
-    }
-    
-    // 获取自提地址列表(始终只有1条)
-    func userSelfAndExpressAddressListApi(type:Int) {
-        SwiftMoyaNetWorkServiceUser.shared().userSelfAndExpressAddressListApi(type: type) {
-            
-            [weak self] (addressManagerListModel) -> (Void) in
-            let addressManagerListModel = (addressManagerListModel as! AddressManagerListModel)
-            
-            if !(addressManagerListModel.selfAddress?.isEmpty ?? true) {
-                let selfAddressModel: SelfAddresModel = ((addressManagerListModel.selfAddress?[0]) ?? nil)!
-                self?.orderPayView.selfAddrMdl = selfAddressModel
-            }
-        }
-    }
-    
-    // 创建订单
-    func orderCreateApi(paraMdl: OrderCreateParameterModel) {
-        
-        SwiftMoyaNetWorkServiceOrder.shared().orderCreateApi(paraMdl: paraMdl) {
-            [weak self] (orderBackModel) -> (Void) in
-            // 弹出支付方式View
-            if self?.shoppingCartPayOrderVCType == .cart {
-                PayManagerPay.shared.payAlertView(orderPayModel: orderBackModel as! OrderCreateBackModel, orderFinishPayVCType: .cart, vc: self!)
-            }else  if self?.shoppingCartPayOrderVCType == .productDetail {
-                PayManagerPay.shared.payAlertView(orderPayModel: orderBackModel as! OrderCreateBackModel, orderFinishPayVCType: .productDetail, vc: self!)
-            }
-            
-        }
-    }
-}

+ 0 - 102
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/View/OrderRefunddetailsStatusTableViewCell.swift

@@ -1,102 +0,0 @@
-//
-//  OrderRefunddetailsStatusTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderRefunddetailsStatusTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderRefunddetailsStatusTableViewCell {
-        let ID = "OrderRefunddetailsStatusTableViewCell"
-        tableView.register(OrderRefunddetailsStatusTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderRefunddetailsStatusTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderRefunddetailsStatusTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        backgroundColor = kf7f8faColor
-        addSubview(statusButton)
-        addSubview(moneyLabel)
-    }
-    
-    private func setupLayouts() {
-        statusButton.snp.makeConstraints { (make) in
-            make.top.equalTo(30)
-            make.centerX.equalToSuperview()
-        }
-        statusButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 6)
-        moneyLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(statusButton.snp.bottom).offset(8)
-            make.centerX.equalToSuperview()
-        }
-    }
-    
-    lazy var statusButton : UIButton = {
-        let statusButton = UIButton(type: UIButton.ButtonType.custom)
-        statusButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        statusButton.titleLabel?.font = kBoldFont20
-        return statusButton
-    }()
-    
-    lazy var moneyLabel: UILabel = {
-        let moneyLabel = UILabel()
-        moneyLabel.textColor = k999999Color
-        moneyLabel.font = kRegularFont16
-        return moneyLabel
-    }()
-    
-    
-    var orderRefundDetailModel : OrderRefundDetailModel? {
-        didSet {
-            if orderRefundDetailModel?.refundStatus == 0 {
-                statusButton.setImage(kImage(name: "order_win"), for: UIControl.State.normal)
-                statusButton.setTitle("退款中", for: UIControl.State.normal)
-            }
-            if orderRefundDetailModel?.refundStatus == 1 {
-                statusButton.setImage(kImage(name: "order_win"), for: UIControl.State.normal)
-                statusButton.setTitle("退款中", for: UIControl.State.normal)
-            }
-            if orderRefundDetailModel?.refundStatus == 2 {
-                statusButton.setImage(kImage(name: "order_win"), for: UIControl.State.normal)
-                statusButton.setTitle("退款完成", for: UIControl.State.normal)
-            }
-            if orderRefundDetailModel?.refundStatus == 3 {
-                statusButton.setImage(kImage(name: "order_no"), for: UIControl.State.normal)
-                statusButton.setTitle("退款失败", for: UIControl.State.normal)
-            }
-            let str = "退款金额 \(priceConversion(price: orderRefundDetailModel?.showRefundPrice ?? 0))"
-            if orderRefundDetailModel?.showRefundPrice != nil {
-                let attributedString = NSMutableAttributedString.init(string: str)
-                
-                attributedString.changeForegroundColor(kFE352BColor, range: NSRange(location: 4, length: str.count-4))
-
-                attributedString.changeSystemFont(kBoldFont16, range: NSRange(location: 4, length: str.count-4))
-                moneyLabel.attributedText = attributedString
-            }
-           
-        }
-    }
-
-}

+ 0 - 92
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/View/OrderRefunddetailsTipsTableViewCell.swift

@@ -1,92 +0,0 @@
-//
-//  OrderRefunddetailsTipsTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderRefunddetailsTipsTableViewCell: UITableViewCell {
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> OrderRefunddetailsTipsTableViewCell {
-        let ID = "OrderRefunddetailsTipsTableViewCell"
-        tableView.register(OrderRefunddetailsTipsTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : OrderRefunddetailsTipsTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! OrderRefunddetailsTipsTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(tipsLabel)
-    }
-    
-    private func setupLayouts() {
-        tipsLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(16)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-            make.bottom.equalTo(-16)
-        }
-    }
-
-    lazy var tipsLabel: UILabel = {
-        let tipsLabel = UILabel()
-        tipsLabel.textColor = k999999Color
-        tipsLabel.font = kRegularFont14
-        tipsLabel.numberOfLines = 0
-        let str = "注:您的退款申请已经提交成功!\n彩虹星球会在48小时内处理您的退款信息,请耐心等待,退款将根据支付方式原路退回。"
-        let attributedString = NSMutableAttributedString.init(string: str)
-        attributedString.changeAllLineSpacing(3)
-        tipsLabel.attributedText = attributedString
-        return tipsLabel
-    }()
-    
-    var orderRefundDetailModel : OrderRefundDetailModel? {
-        didSet {
-            if orderRefundDetailModel?.refundStatus == 0 {
-                let str = "  注:您的退款申请进行中!\n彩虹星球会在48小时内处理您的退款信息,请耐心等待,退款将根据支付方式原路退回。"
-                let attributedString = NSMutableAttributedString.init(string: str)
-                attributedString.changeAllLineSpacing(3)
-                tipsLabel.attributedText = attributedString
-            }
-            if orderRefundDetailModel?.refundStatus == 1 {
-              
-                let str = "  注:您的退款申请进行中!\n彩虹星球会在48小时内处理您的退款信息,请耐心等待,退款将根据支付方式原路退回。"
-                let attributedString = NSMutableAttributedString.init(string: str)
-                attributedString.changeAllLineSpacing(3)
-                tipsLabel.attributedText = attributedString
-            }
-            if orderRefundDetailModel?.refundStatus == 2 {
-                let str = "注:您的退款申请已经提交成功!\n彩虹星球会在48小时内处理您的退款信息,请耐心等待,退款将根据支付方式原路退回。"
-                let attributedString = NSMutableAttributedString.init(string: str)
-                attributedString.changeAllLineSpacing(3)
-                tipsLabel.attributedText = attributedString
-            }
-            if orderRefundDetailModel?.refundStatus == 3 {
-                let str = "失败原因: \n彩虹星球会在48小时内处理您的退款信息,请耐心等待, 退款将根据支付方式原路退回。"
-                let attributedString = NSMutableAttributedString.init(string: str)
-                attributedString.changeAllLineSpacing(3)
-                tipsLabel.attributedText = attributedString
-            }
-        }
-    }
-}

+ 0 - 193
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/ViewController/OrderRefunddetailsViewController.swift

@@ -1,193 +0,0 @@
-//
-//  OrderRefunddetailsViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/16.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-enum OrderRefunddetailsVCType {
-    case order
-    case orderDetail
-    case orderApplyRefund
-}
-
-class OrderRefunddetailsViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var titles = ["退款编号","申请时间","订单状态","退款原因","退款金额"]
-    var contents = ["","","","",""]
-    
-    var refundNo : String?
-    var orderRefundDetailModel : OrderRefundDetailModel?
-    var orderRefunddetailsVCType : OrderRefunddetailsVCType?
-    
-    typealias CancelCloSure = () -> Void?
-    var cancelCloSure : CancelCloSure?
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "退款详情"
-        navigationBar.onClickLeftButton = {
-            [weak self] in
-            if self?.orderRefunddetailsVCType == .order {
-                self?.navigationController?.popViewController(animated: true)
-            }else if self?.orderRefunddetailsVCType == .orderDetail {
-                self?.navigationController?.popViewController(animated: true)
-            }else if self?.orderRefunddetailsVCType == .orderApplyRefund {
-                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "OrderApplyRefund"), object: nil)
-                if let cancelCloSure = self?.cancelCloSure {
-                    cancelCloSure()
-                }
-                self?.navigationController?.popToClass(type: OrderDetailViewController.self)
-            }
-        }
-        view.addSubview(tableView)
-    }
-    
-    override func setupLayouts() {
-        tableView.snp.makeConstraints { (make) in
-            make.bottom.right.left.equalToSuperview()
-            make.top.equalTo(kNavBarTotalHeight)
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-    override func setupData() {
-        
-       
-        tableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.orderPurchaseRefundDetail()
-        }
-        
-    }
-    
-    func orderPurchaseRefundDetail() {
-        SwiftMoyaNetWorkServiceOrder.shared().orderPurchaseRefundDetailApi(refundNo: refundNo ?? "") { [weak self] (orderRefundDetailModel) -> (Void) in
-            self?.orderRefundDetailModel = orderRefundDetailModel as? OrderRefundDetailModel
-            
-            self?.contents[0] = self?.orderRefundDetailModel?.refundNo ?? ""
-            self?.contents[1] = self?.orderRefundDetailModel?.createdAt ?? ""
-            if self?.orderRefundDetailModel?.status == 0 {
-                self?.contents[2] = "待付款"
-            }
-            if self?.orderRefundDetailModel?.status == 1 {
-                self?.contents[2] = "待发货"
-            }
-            if self?.orderRefundDetailModel?.status == 2 {
-                self?.contents[2] = "待收货"
-            }
-            if self?.orderRefundDetailModel?.status == 3 {
-                self?.contents[2] = "配送中"
-            }
-            if self?.orderRefundDetailModel?.status == 4 {
-                self?.contents[2] = "待自提"
-            }
-            if self?.orderRefundDetailModel?.status == 5 {
-                self?.contents[2] = "已自提"
-            }
-            if self?.orderRefundDetailModel?.status == 6 {
-                self?.contents[2] = "已完成"
-            }
-            if self?.orderRefundDetailModel?.status == 7 {
-                self?.contents[2] = "已关闭"
-            }
-            self?.contents[3] = self?.orderRefundDetailModel?.refundReason ?? ""
-            self?.contents[4] = "\(priceConversionNone(price: self?.orderRefundDetailModel?.showRefundPrice ?? 0))元"
-            self?.tableView.reloadData()
-        }
-    }
-    
-}
-
-extension OrderRefunddetailsViewController : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        switch section {
-        case 0:
-            if orderRefundDetailModel?.refundStatus == 3 {
-                return 1
-            }
-            return 2
-        default:
-            return titles.count
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            if indexPath.row == 0 {
-                let cell = OrderRefunddetailsStatusTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.orderRefundDetailModel = orderRefundDetailModel
-                return cell
-            }else {
-                let cell = OrderRefunddetailsTipsTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                 cell.orderRefundDetailModel = orderRefundDetailModel
-                return cell
-            }
-        default:
-            let cell = OrderDetailInfoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.titles = titles
-            cell.refundContents = contents
-            return cell
-        }
-    }
-    
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        switch indexPath.section {
-        case 0:
-            if indexPath.row == 0 {
-                return 109
-            }else {
-                return UITableView.automaticDimension
-            }
-        default:
-            return 33
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-}
-

+ 8 - 7
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchProduct/ViewController/SearchProductListViewController.swift

@@ -109,14 +109,15 @@ extension SearchProductListViewController :UITableViewDataSource,UITableViewDele
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
         return productSearchModelArray.isEmpty ? 0 : productSearchModelArray.count
     }
-    
+    //TODO: 商品
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let cell = ProductHBigTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-        cell.productSearchModel = productSearchModelArray[indexPath.row]
-        cell.plusClosure = {
-            [weak self] (productSearchModel,indexPath) in
-            self?.addCart(productSearchModel: productSearchModel!, indexPath: indexPath!)
-        }
+//        let cell = ProductHBigTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+//        cell.productSearchModel = productSearchModelArray[indexPath.row]
+//        cell.plusClosure = {
+//            [weak self] (productSearchModel,indexPath) in
+//            self?.addCart(productSearchModel: productSearchModel!, indexPath: indexPath!)
+//        }
+        let cell = UITableViewCell()
         return cell
     }
     

+ 9 - 9
RainbowPlanet/RainbowPlanet/Modules/SearchModule/SearchResult/ViewController/SearchResultViewController.swift

@@ -71,15 +71,15 @@ class SearchResultViewController: BaseViewController {
             self?.keyWord = keyWord
             self?.segmentedReload()
         }
-        // 商品详情页面
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("SearchProductList"), object: nil, queue: OperationQueue.main) {
-            [weak self] (notification) in
-            let productSearchModel = notification.object as! ProductSearchModel
-            let vc = ProductDetailViewController()
-            vc.productId = productSearchModel.id
-            vc.shopId = productSearchModel.shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
+//        // 商品详情页面
+//        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("SearchProductList"), object: nil, queue: OperationQueue.main) {
+//            [weak self] (notification) in
+//            let productSearchModel = notification.object as! ProductSearchModel
+//            let vc = ProductDetailViewController()
+//            vc.productId = productSearchModel.id
+//            vc.shopId = productSearchModel.shopId
+//            self?.navigationController?.pushViewController(vc, animated: true)
+//        }
         
         // 用户页面
         observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("OtherPersonalCenter"), object: nil, queue: OperationQueue.main) {

+ 0 - 108
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategorySearchView.swift

@@ -1,108 +0,0 @@
-//
-//  CategorySearchView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class CategorySearchView: BaseView {
-
-    /// 购物车
-    typealias ShoppingCarBlock = () -> Void
-    var shoppingCarBlock : ShoppingCarBlock?
-    
-    /// 搜索
-    typealias SearchResultBlock = (_ keyWord:String) -> Void
-    var searchResultBlock : SearchResultBlock?
-    
-    var productCartCountModel : ProductCartCountModel? {
-        didSet {
-            
-            if productCartCountModel?.count == 0 {
-               shoppingCarButton.pp.hiddenBadge()
-            }else {
-                //        shoppingCarButton.pp.setBadge(height: 14)
-                //        shoppingCarButton.pp.badgeView.font = kRegularFont10
-                shoppingCarButton.pp.badgeView.backgroundColor = kFE352BColor
-                shoppingCarButton.pp.moveBadge(x: -2, y: 2)
-                shoppingCarButton.pp.addBadge(number: productCartCountModel?.count ?? 0)
-            }
-        }
-    }
-    
-    override func setupViews() {
-        addSubview(shoppingCarButton)
-        addSubview(searchbgView)
-        searchbgView.addSubview(searchIconImageView)
-        searchbgView.addSubview(searchTextField)
-    }
-    
-    override func setupLayouts() {
-        shoppingCarButton.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalToSuperview().offset(-14)
-            make.width.equalTo(24)
-            make.height.equalTo(21)
-        }
-        searchbgView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-            make.right.equalTo(shoppingCarButton.snp.left).offset(-10)
-            make.height.equalTo(30)
-        }
-        searchIconImageView.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(12)
-            make.size.equalTo(18)
-        }
-        
-        searchTextField.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(searchIconImageView.snp.right).offset(8)
-            make.right.equalToSuperview().offset(8)
-            make.height.equalTo(30)
-            
-        }
-    }
-    
-    lazy var searchbgView: UIButton = {
-        let searchbgView = UIButton(type: UIButton.ButtonType.custom)
-        searchbgView.backgroundColor = kf7f8faColor
-        searchbgView.cornerRadius = 15
-        searchbgView.masksToBounds = true
-        return searchbgView
-    }()
-    
-    private lazy var searchIconImageView: UIImageView = {
-        let searchIconImageView = UIImageView()
-        searchIconImageView.image = kImage(name: "navbar_search")
-        return searchIconImageView
-    }()
-    
-    lazy var searchTextField: UITextField = {
-        let searchTextField = UITextField()
-        searchTextField.placeholder = "请输入商品名称"
-        searchTextField.tintColor = kFFA42FColor
-        searchTextField.textColor = k333333Color
-        searchTextField.returnKeyType = .search
-        searchTextField.font = kScaleRegularFont14
-        searchTextField.borderStyle = .none
-        searchTextField.isEnabled = false
-        return searchTextField
-    }()
-    
-    private lazy var shoppingCarButton: UIButton = {
-        let shoppingCarButton = UIButton(type: UIButton.ButtonType.custom)
-        shoppingCarButton.setImage(kImage(name: "navbar_shopping"), for: UIControl.State.normal)
-        shoppingCarButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let shoppingCarBlock = self?.shoppingCarBlock {
-                shoppingCarBlock()
-            }
-        }).disposed(by: disposeBag)
-        return shoppingCarButton
-    }()
-
-}

+ 0 - 94
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryTableViewCell.swift

@@ -1,94 +0,0 @@
-//
-//  CategoryTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class CategoryTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> CategoryTableViewCell {
-        let ID = "CategoryTableViewCell"
-        tableView.register(CategoryTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : CategoryTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! CategoryTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    override func setSelected(_ selected: Bool, animated: Bool) {
-        super.setSelected(selected, animated: animated)
-        isHighlighted = selected
-        titleLable.isHighlighted = selected
-        h_Label.isHidden = !selected
-        if selected {
-            backgroundColor = UIColor.white
-        }else {
-            backgroundColor = UIColor.clear
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        backgroundColor = kf5f5f5Color
-        addSubview(h_Label)
-        addSubview(titleLable)
-    }
-    
-    private func setupLayouts() {
-        h_Label.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalToSuperview()
-            make.width.equalTo(4)
-            make.height.equalTo(14)
-        }
-        titleLable.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(5)
-            make.right.equalTo(-5)
-        }
-    }
-    
-    lazy var h_Label: UILabel = {
-        let h_Label = UILabel()
-        h_Label.backgroundColor = kff724fColor
-        h_Label.cornerRadius = 2
-        h_Label.masksToBounds = true
-        return h_Label
-    }()
-    
-    lazy var titleLable: UILabel = {
-        let titleLable = UILabel()
-        titleLable.textColor = k333333Color
-        titleLable.highlightedTextColor = kff724fColor
-        titleLable.font = kRegularFont14
-        titleLable.textAlignment = .center
-        return titleLable
-    }()
-    
-    var categoryModel:CategoryModel? {
-        didSet {
-            titleLable.text = categoryModel?.name
-        }
-    }
-
-}

+ 0 - 167
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/View/CategoryView.swift

@@ -1,167 +0,0 @@
-//
-//  CategoryView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class CategoryView: BaseView {
-    
-    var productSearchModelArray : Array<ProductSearchModel>? {
-        didSet {
-            if productSearchModelArray?.isEmpty ?? true {
-                rightTableView.endFooterNoMoreData()
-            }else {
-                rightTableView.isHiddenFooter(false)
-            }
-            rightTableView.reloadData()
-        }
-    }
-    
-    var categoryModelArray : Array<CategoryModel>? {
-        didSet {
-            if categoryModelArray?.isEmpty ?? true {
-                leftTableView.endFooterNoMoreData()
-
-            }else {
-                leftTableView.endFooterNoMoreData()
-                leftTableView.reloadData()
-                leftTableView.selectRow(at: leftIndexPath, animated: true, scrollPosition: UITableView.ScrollPosition.none)
-
-            }
-            
-        }
-    }
-    
-    var leftIndexPath : IndexPath =  IndexPath(row: 0, section: 0)
-    
-    typealias LeftDidSelectRow = (_ indexPath: IndexPath) -> Void
-    var leftDidSelectRow : LeftDidSelectRow?
-    
-    typealias RightDidSelectRow = (_ indexPath: IndexPath) -> Void
-    var rightDidSelectRow : RightDidSelectRow?
-    
-    typealias AddCartClosure = (ProductSearchModel,IndexPath) -> Void
-    var addCartClosure : AddCartClosure?
-    
-    override func setupViews() {
-        addSubview(leftTableView)
-        addSubview(rightTableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        rightTableView.ly_emptyView = emptyView
-        rightTableView.ly_startLoading()
-    }
-    
-    override func setupLayouts() {
-        leftTableView.snp.makeConstraints { (make) in
-            make.top.left.bottom.equalToSuperview()
-            make.width.equalTo(90)
-        }
-        rightTableView.snp.makeConstraints { (make) in
-            make.top.right.bottom.equalToSuperview()
-            make.left.equalTo(leftTableView.snp.right)
-        }
-    }
-    
-    //左侧表格
-    lazy var leftTableView : UITableView = {
-        let leftTableView = UITableView()
-        leftTableView.delegate = self
-        leftTableView.dataSource = self
-        leftTableView.rowHeight = 46
-        leftTableView.showsVerticalScrollIndicator = false
-        leftTableView.separatorColor = UIColor.clear
-        leftTableView.backgroundColor = kf5f5f5Color
-
-        return leftTableView
-    }()
-    
-    //右侧表格
-    lazy var rightTableView : UITableView = {
-        let rightTableView = UITableView()
-        rightTableView.delegate = self
-        rightTableView.dataSource = self
-        rightTableView.rowHeight = 106
-        rightTableView.showsVerticalScrollIndicator = false
-        rightTableView.separatorColor = UIColor.clear
-        rightTableView.backgroundColor = kffffffColor
-
-        return rightTableView
-    }()
-    
-}
-
-extension CategoryView : UITableViewDataSource, UITableViewDelegate {
-    //表格分区数
-    func numberOfSections(in tableView: UITableView) -> Int {
-        if leftTableView == tableView {
-            return categoryModelArray?.isEmpty ?? true ? 0 : 1
-        } else {
-            return productSearchModelArray?.isEmpty ?? true ? 0 : 1
-        }
-    }
-    
-    //分区下单元格数量
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if leftTableView == tableView {
-            return categoryModelArray?.isEmpty ?? true ? 0 : categoryModelArray?.count ?? 0
-        } else {
-            return productSearchModelArray?.isEmpty ?? true ? 0 : productSearchModelArray?.count ?? 0
-        }
-    }
-    
-    //返回自定义单元格
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)
-        -> UITableViewCell {
-            if leftTableView == tableView {
-                let cell = CategoryTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.categoryModel = categoryModelArray![indexPath.row]
-                return cell
-            } else {
-                let cell = ProductHSmallTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.productSearchModel = productSearchModelArray![indexPath.row]
-                cell.plusClosure = {
-                    [weak self] (productSearchModel,indexPath) in
-                    
-                    if let addCartClosure = self?.addCartClosure {
-                        addCartClosure(productSearchModel!,indexPath!)
-                    }
-                }
-                return cell
-            }
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if leftTableView == tableView {
-            self.leftIndexPath = indexPath
-            if let leftDidSelectRow = self.leftDidSelectRow {
-                leftDidSelectRow(indexPath)
-            }
-        } else {
-            if let rightDidSelectRow = self.rightDidSelectRow {
-                rightDidSelectRow(indexPath)
-            }
-        }
-    }
-    
-    //分区头高度(只有右侧表格有分区头)
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        if leftTableView == tableView {
-            return 0
-        }
-        return 0
-    }
-    
-    //返回自定义分区头(只有右侧表格有分区头)
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        if leftTableView == tableView {
-            return nil
-        }
-
-        return nil
-    }
-}

+ 0 - 189
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Category/ViewController/CategoryViewController.swift

@@ -1,189 +0,0 @@
-//
-//  CategoryViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class CategoryViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var categoryModelArray = Array<CategoryModel>()
-    var productSearchModelArray = Array<ProductSearchModel>()
-    
-    var leftIndexPath : IndexPath =  IndexPath(row: 0, section: 0)
-    
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        productGetCartCountApi()
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        view.addSubview(categorySearchView)
-        view.addSubview(categoryView)
-    }
-    
-    override func setupLayouts() {
-        categorySearchView.snp.makeConstraints { (make) in
-            make.top.equalTo(kNavBarTotalHeight)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(44)
-        }
-        categoryView.snp.makeConstraints { (make) in
-            make.top.equalTo(categorySearchView.snp.bottom)
-            make.left.right.bottom.equalToSuperview()
-        }
-    }
-    
-    override func setupData() {
-
-        categorySearchView.searchbgView.rx.tap.subscribe(onNext: {
-            [weak self] in
-            let vc = SearchViewController()
-            vc.searchType = .product
-            self?.navigationController?.pushViewController(vc, animated: true)
-
-        }).disposed(by: disposeBag)
-        categorySearchView.shoppingCarBlock = {
-            [weak self] in
-            
-            let vc = ShoppingCartViewController()
-            vc.shoppingCartVCType = .push
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        
-        categoryView.leftTableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.productCategoryApi(page: page)
-        }
-        categoryView.leftTableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
-            [weak self] (page) in
-            self?.productCategoryApi(page: page)
-        })
-        categoryView.leftDidSelectRow = {
-            [weak self] indexPath in
-            self?.leftIndexPath = indexPath
-            self?.productSearchApi(page: 1)
-        }
-        categoryView.rightTableView.addHeader(withBeginRefresh: false, animation: false) {
-            [weak self] (page) in
-            self?.productSearchApi(page: page)
-        }
-        categoryView.rightTableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
-            [weak self] (page) in
-            self?.productSearchApi(page: page)
-        })
-        
-        
-        categoryView.rightDidSelectRow = {
-             [weak self] indexPath in
-            let vc = ProductDetailViewController()
-            let productSearch = self?.productSearchModelArray[indexPath.row]
-            vc.productId = productSearch?.id
-            vc.shopId = productSearch?.shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-            
-        }
-        categoryView.addCartClosure = {
-            [weak self]  (productSearchModel,indexPath) in
-            self?.addCart(productSearchModel: productSearchModel, indexPath: indexPath)
-        }
-        
-    }
-
-    private lazy var categorySearchView: CategorySearchView = {
-        let categorySearchView = CategorySearchView()
-        return categorySearchView
-    }()
-    
-    private lazy var categoryView: CategoryView = {
-        let categoryView = CategoryView()
-        return categoryView
-    }()
-    
-    
-    /// 分类
-    ///
-    /// - Parameter page: 分页
-    func productCategoryApi(page:Int = 1) {
-        SwiftMoyaNetWorkServiceProduct.shared().productCategoryApi(page:page) {
-            [weak self] (categoryListModel) -> (Void) in
-            let categoryListModel = categoryListModel as? CategoryListModel
-            if categoryListModel?.pagination?.currentPage ?? 1  <= categoryListModel?.pagination?.totalPages ?? 1 {
-                if categoryListModel?.pagination?.currentPage == 1{
-                    self?.categoryModelArray.removeAll()
-                     self?.categoryView.rightTableView.resetNoMoreData()
-
-                    self?.categoryModelArray = (self?.categoryModelArray)! + (categoryListModel?.data!)!
-                     self?.productSearchApi(page: page)
-                }else {
-                    self?.categoryModelArray = (self?.categoryModelArray)! + (categoryListModel?.data!)!
-                   
-                }
-                self?.categoryView.categoryModelArray = self?.categoryModelArray
-            }else {
-                self?.categoryView.rightTableView.endFooterNoMoreData()
-            }
-        }
-    }
-    
-    /// 商品结果
-    func productSearchApi(page:Int = 1) {
-        let categoryModel = categoryModelArray[leftIndexPath.row]
-
-        SwiftMoyaNetWorkServiceProduct.shared().productListApi(page:page ,categoryId:categoryModel.id ?? 0) {
-            [weak self] (productSearchListModel) -> (Void) in
-            let productSearchListModel = productSearchListModel as? ProductSearchListModel
-            
-            if productSearchListModel?.pagination?.currentPage ?? 1  <= productSearchListModel?.pagination?.totalPages ?? 1 {
-                if productSearchListModel?.pagination?.currentPage == 1{
-                    self?.productSearchModelArray.removeAll()
-                    self?.categoryView.rightTableView.resetNoMoreData()
-                }
-                self?.productSearchModelArray = (self?.productSearchModelArray)! + (productSearchListModel?.data!)!
-                self?.categoryView.productSearchModelArray = self?.productSearchModelArray
-                if  self?.productSearchModelArray.count ?? 0 >= productSearchListModel?.pagination?.total ?? 0 {
-                    self?.categoryView.rightTableView.endFooterNoMoreData()
-                }
-            }else {
-                self?.categoryView.rightTableView.endFooterNoMoreData()
-            }
-        }
-    }
-    
-    /// 获取购物车数量
-    func productGetCartCountApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productGetCartCountApi {
-            [weak self] (productCartCountModel) -> (Void) in
-            self?.categorySearchView.productCartCountModel = productCartCountModel as? ProductCartCountModel
-        }
-    }
-    
-    /// 添加购物车
-    ///
-    /// - Returns:
-    func addCart(productSearchModel:ProductSearchModel,indexPath:IndexPath) {
-        
-        productSearchModel.isSelect = 1
-        SwiftMoyaNetWorkServiceProduct.shared().productCartListAddApi(productSearchModel: productSearchModel, completion: {
-            [weak self] (cartAmountModel) -> (Void) in
-            self?.categoryView.rightTableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
-            SwiftProgressHUD.shared().showText("已加入购物车", view: (self?.categoryView.rightTableView)!, textAlignment: .center)
-            self?.productGetCartCountApi()
-        })
-    }
-}

+ 0 - 165
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductAllCommentView.swift

@@ -1,165 +0,0 @@
-//
-//  ProductAllCommentView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/14.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductAllCommentView: BaseView {
-    
-    typealias DidSelectItemAtClosure = (_ images:  Array<String>,_ indexPath: IndexPath) -> Void
-    var didSelectItemAtClosure : DidSelectItemAtClosure?
-    
-    var productAllCommentArray : Array<ProductCommentModel>? {
-        didSet {
-            if productAllCommentArray?.isEmpty ?? true {
-                tableView.endFooterNoMoreData()
-            }else {
-                tableView.isHiddenFooter(false)
-            }
-            tableView.reloadData()
-        }
-    }
-
-    
-    override func setupViews() {
-//        addSubview(bottomBgView)
-//        bottomBgView.addSubview(cartButton)
-//        cartButton.addSubview(cartImageView)
-//        bottomBgView.addSubview(addCartButton)
-//        bottomBgView.addSubview(buyButton)
-        addSubview(tableView)
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-    }
-    
-    override func setupLayouts() {
-//        bottomBgView.snp.makeConstraints { (make) in
-//            make.left.bottom.right.equalToSuperview()
-//            make.height.equalTo(50 + kSafeTabBarHeight)
-//        }
-//        cartButton.snp.makeConstraints { (make) in
-//            make.top.left.equalToSuperview()
-//            make.width.equalTo(71 * kScaleWidth)
-//            make.bottom.equalTo(-kSafeTabBarHeight)
-//        }
-//        cartImageView.snp.makeConstraints { (make) in
-//            make.center.equalToSuperview()
-//        }
-//        addCartButton.snp.makeConstraints { (make) in
-//            make.left.equalTo(cartButton.snp.right)
-//            make.top.bottom.equalTo(cartButton)
-//            make.width.equalTo(152 * kScaleWidth)
-//        }
-//        buyButton.snp.makeConstraints { (make) in
-//            make.left.equalTo(addCartButton.snp.right)
-//            make.top.bottom.equalTo(cartButton)
-//            make.width.equalTo(152 * kScaleWidth)
-//        }
-        tableView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-//            make.bottom.equalTo(bottomBgView.snp.top)
-            make.bottom.equalTo(0)
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 0.000001
-        return tableView
-    }()
-    
-    private lazy var bottomBgView: UIView = {
-        let bottomBgView = UIView()
-        return bottomBgView
-    }()
-    
-    private lazy var cartButton : UIButton = {
-        let cartButton = UIButton()
-        return cartButton
-    }()
-    
-    private lazy var cartImageView: UIImageView = {
-        let cartImageView = UIImageView()
-        cartImageView.image = kImage(name: "tabbar_shopping")
-        cartImageView.pp.addBadge(number: 2)
-        //        shoppingCarButton.pp.setBadge(height: 14)
-        //        shoppingCarButton.pp.badgeView.font = kRegularFont10
-        cartImageView.pp.badgeView.backgroundColor = kFE352BColor
-        cartImageView.pp.moveBadge(x: -2, y: 2)
-        return cartImageView
-    }()
-    
-    private lazy var addCartButton : UIButton = {
-        let addCartButton = UIButton(type: UIButton.ButtonType.custom)
-        addCartButton.setTitle("加入购物车", for: UIControl.State.normal)
-        addCartButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        addCartButton.backgroundColor = k404040Color
-        addCartButton.titleLabel?.font = kRegularFont16
-        return addCartButton
-    }()
-    
-    private lazy var buyButton : UIButton = {
-        let buyButton = UIButton(type: UIButton.ButtonType.custom)
-        buyButton.setTitle("立即购买", for: UIControl.State.normal)
-        buyButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        buyButton.backgroundColor = kFFA42FColor
-        buyButton.titleLabel?.font = kRegularFont16
-        return buyButton
-    }()
-
-}
-
-extension ProductAllCommentView : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return productAllCommentArray?.isEmpty ?? true ? 0 : 1
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        return productAllCommentArray?.isEmpty ?? true ? 0 : productAllCommentArray?.count ?? 0
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {        
-        let cell = ProductDetailEvaluationListTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-        cell.productCommentModel = productAllCommentArray?[indexPath.row]
-        cell.frame = tableView.bounds
-        cell.layoutIfNeeded()
-        cell.reloadData()
-        cell.didSelectItemAtClosure = {
-            [weak self] (images,indexPath) in
-            if let didSelectItemAtClosure = self?.didSelectItemAtClosure {
-                didSelectItemAtClosure(images,indexPath)
-            }
-        }
-        return cell
-    }
-    
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        return UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-            return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-            return nil
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-}

+ 0 - 63
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductDetailEvaluationImageCollectionViewCell.swift

@@ -1,63 +0,0 @@
-//
-//  ProductDetailEvaluationImageCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/6/3.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class ProductDetailEvaluationImageCollectionViewCell: UICollectionViewCell {
-    
-    var imageUrl: String? {
-        didSet {
-            iconImageView.kf.setImage(with: kURLImage(name: imageUrl ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-        }
-    }
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailEvaluationImageCollectionViewCell {
-        let ID = "ProductDetailEvaluationImageCollectionViewCell"
-        collectionView.register(ProductDetailEvaluationImageCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailEvaluationImageCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailEvaluationImageCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置view
-    private func setupViews() {
-        self.cornerRadius = 2
-        self.masksToBounds = true
-        addSubview(iconImageView)
-    }
-    
-    private func setupLayouts() {
-        iconImageView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    private lazy var iconImageView: UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "default_pic")
-        return iconImageView
-    }()
-}

+ 0 - 231
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/View/ProductDetailEvaluationListTableViewCell.swift

@@ -1,231 +0,0 @@
-//
-//  ProductDetailEvaluationListTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/13.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class ProductDetailEvaluationListTableViewCell: UITableViewCell {
-    
-    var commentImages: Array<String> = []
-    
-    typealias DidSelectItemAtClosure = (_ images:  Array<String>,_ indexPath: IndexPath) -> Void
-    var didSelectItemAtClosure : DidSelectItemAtClosure?
-    
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailEvaluationListTableViewCell {
-        let ID = "ProductDetailEvaluationListTableViewCell"
-        tableView.register(ProductDetailEvaluationListTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailEvaluationListTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailEvaluationListTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        
-        addSubview(avatarImagView)
-        addSubview(nameLabel)
-        addSubview(timeLabel)
-        addSubview(infoLabel)
-        addSubview(collectionView)
-        addSubview(skuLabel)
-        addSubview(lineLabel)
-    }
-    
-    private func setupLayouts() {
-        avatarImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(20)
-            make.left.equalTo(14)
-            make.size.equalTo(28)
-        }
-        nameLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(avatarImagView.snp.right).offset(8)
-            make.centerY.equalTo(avatarImagView)
-            make.right.equalTo(timeLabel.snp.left).offset(-10)
-        }
-        timeLabel.snp.makeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.centerY.equalTo(avatarImagView)
-        }
-        infoLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(avatarImagView.snp.bottom).offset(15)
-            make.left.equalTo(avatarImagView)
-            make.right.equalTo(timeLabel)
-        }
-        collectionView.snp.makeConstraints { (make) in
-            make.top.equalTo(infoLabel.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(200)
-        }
-        skuLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(collectionView.snp.bottom).offset(15)
-            make.left.equalTo(avatarImagView)
-            make.right.equalTo(timeLabel)
-        }
-        lineLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(skuLabel.snp.bottom).offset(20)
-            make.left.equalTo(avatarImagView)
-            make.right.bottom.equalToSuperview()
-            make.height.equalTo(1)
-        }
-    }
-    
-    private lazy var avatarImagView: UIImageView = {
-        let avatarImagView = UIImageView()
-        avatarImagView.image = kImage(name: "default_pic")
-        avatarImagView.cornerRadius = 14
-        avatarImagView.masksToBounds = true
-        return avatarImagView
-    }()
-    
-    private lazy var nameLabel: UILabel = {
-        let nameLabel = UILabel()
-        nameLabel.text = "昵称"
-        nameLabel.textColor = k333333Color
-        nameLabel.font = kRegularFont14
-        return nameLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.text = "2019-03-29 23:05"
-        timeLabel.textColor = kbbbbbbColor
-        timeLabel.font = kRegularFont12
-        return timeLabel
-    }()
-    
-    private lazy var infoLabel: UILabel = {
-        let infoLabel = UILabel()
-        infoLabel.textColor = k333333Color
-        infoLabel.font = kRegularFont14
-        infoLabel.numberOfLines = 0
-        let str = "猪肉很新鲜特别棒,配送很迅速第二天一大早就拿到手了,以后会常来的猪肉很新鲜特别棒,配送很迅速第二天一大早就拿到手了,以后会常来的"
-        let attributeString = NSMutableAttributedString(string:str)
-        attributeString.changeAllLineSpacing(2)
-        infoLabel.attributedText = attributeString
-        return infoLabel
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kffffffColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 10
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
-    }()
-    
-    private lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.text = "规格:500g"
-        skuLabel.textColor = kbbbbbbColor
-        skuLabel.font = kRegularFont12
-        return skuLabel
-    }()
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kf5f5f5Color
-        return lineLabel
-    }()
-    
-    var productCommentModel: ProductCommentModel? {
-        didSet {
-            avatarImagView.kf.setImage(with: kURLImage(name: productCommentModel?.avatar ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            nameLabel.text = productCommentModel?.username
-            timeLabel.text = productCommentModel?.createdAt
-            let attributeString = NSMutableAttributedString(string:productCommentModel?.content ?? "")
-            attributeString.changeAllLineSpacing(2)
-            infoLabel.attributedText = attributeString
-            skuLabel.text = "规格:\(productCommentModel?.skuName ?? "")"
-            
-            commentImages = productCommentModel?.imgs ?? []
-            if commentImages.count == 0 {
-                collectionView.snp.remakeConstraints { (make) in
-                    make.top.equalTo(infoLabel.snp_bottom)
-                    make.left.right.equalToSuperview()
-                    make.height.equalTo(0)
-                }
-            } else {
-                collectionView.reloadData()
-            }
-        }
-    }
-    
-    //加载数据
-    func reloadData() {
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(infoLabel.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalTo(skuLabel.snp_top).offset(-15)
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-
-}
-
-extension ProductDetailEvaluationListTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource,UICollectionViewDelegate {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return commentImages.count
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductDetailEvaluationImageCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.imageUrl = commentImages[indexPath.row]
-        return cell
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:(kScreenWidth-30-5*3)/4, height: (kScreenWidth-30-5*3)/4)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 15, bottom: 0, right: 15)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if let didSelectItemAtClosure = self.didSelectItemAtClosure {
-            didSelectItemAtClosure(commentImages,indexPath)
-        }
-    }
-    
-}

+ 0 - 83
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductAllComment/ViewController/ProductAllCommentViewController.swift

@@ -1,83 +0,0 @@
-//
-//  ProductAllCommentViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/14.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductAllCommentViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    
-    /// 商品Id
-    var productId : Int = 0
-    
-    var productAllCommentArray = Array<ProductCommentModel>()
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.title = "全部评价"
-        view.addSubview(productAllCommentView)
-    }
-    
-    override func setupLayouts() {
-        productAllCommentView.snp.makeConstraints { (make) in
-            make.left.right.bottom.equalToSuperview()
-            make.top.equalTo(kNavBarTotalHeight)
-        }
-    }
-    
-    private lazy var productAllCommentView: ProductAllCommentView = {
-        let productAllCommentView = ProductAllCommentView()
-        return productAllCommentView
-    }()
-    
-    override func setupData() {
-        productAllCommentView.tableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.productCommentListApi(page:page)
-        }
-        productAllCommentView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
-            [weak self] (page) in
-            self?.productCommentListApi(page:page)
-        })
-        productAllCommentView.didSelectItemAtClosure = {
-            [weak self] (images,indexPath) in
-            let vc = BrowsePicturesViewController.init(imageStrs: images, index: indexPath.row)
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-    }
-    
-    /// 获取商品评价列表
-    ///
-    /// - Parameter page: 分页
-    func productCommentListApi(page:Int = 1) {
-       
-        SwiftMoyaNetWorkServiceProduct.shared().productCommentListApi(page:page,productId: productId ) {
-            [weak self] (productCommentListModel) -> (Void) in
-            let productCommentListModel = productCommentListModel as? ProductCommentListModel
-            if productCommentListModel?.pagination?.currentPage ?? 1  <= productCommentListModel?.pagination?.totalPages ?? 1 {
-                if productCommentListModel?.pagination?.currentPage == 1{
-                    self?.productAllCommentArray.removeAll()
-                    self?.productAllCommentView.tableView.resetNoMoreData()
-                }
-                self?.productAllCommentArray = (self?.productAllCommentArray)! + (productCommentListModel?.data!)!
-                self?.productAllCommentView.productAllCommentArray = self?.productAllCommentArray
-            }else {
-                self?.productAllCommentView.tableView.endFooterNoMoreData()
-            }
-        }
-    }
-}

+ 0 - 97
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProcuctDetailSelectSku/ProcuctDetailSelectSkuTableViewCell.swift

@@ -1,97 +0,0 @@
-//
-//  ProcuctDetailSelectSkuTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/18.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProcuctDetailSelectSkuTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProcuctDetailSelectSkuTableViewCell {
-        let ID = "ProcuctDetailSelectSkuTableViewCell"
-        tableView.register(ProcuctDetailSelectSkuTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProcuctDetailSelectSkuTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProcuctDetailSelectSkuTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(selectedLabel)
-        addSubview(goImageView)
-        addSubview(skuLabel)
-    }
-    
-    private func setupLayouts() {
-        
-        selectedLabel.snp.remakeConstraints { (make) in
-            make.top.equalTo(13)
-            make.left.equalTo(14)
-            make.width.greaterThanOrEqualTo(10)
-            make.height.equalTo(20)
-        }
-        
-        goImageView.snp.remakeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-            make.width.equalTo(6)
-            make.height.equalTo(11)
-        }
-        
-        skuLabel.snp.remakeConstraints { (make) in
-            make.top.equalTo(13)
-            make.left.equalTo(selectedLabel.snp.right).offset(27)
-            make.right.equalTo(goImageView.snp.left).offset(-10)
-            make.bottom.equalTo(-13)
-        }
-    }
-    
-    lazy var skuLabel: UILabel = {
-        let skuLabel = UILabel()
-        skuLabel.text = "请选择规格"
-        skuLabel.textColor = k333333Color
-        skuLabel.font = kRegularFont13
-        return skuLabel
-    }()
-    
-    private lazy var selectedLabel : UILabel = {
-        let selectedLabel = UILabel()
-        selectedLabel.text = "选择"
-        selectedLabel.textColor = k999999Color
-        selectedLabel.font = kScaleRegularFont13
-        return selectedLabel
-    }()
-    
-    lazy var goImageView: UIImageView = {
-        let goImageView = UIImageView()
-        goImageView.image = kImage(name: "my_arrows_unfold")
-        return goImageView
-    }()
-    
-    var productDetailSkuModel: ProductDetailSkuModel? {
-        didSet {
-            selectedLabel.text = "已选中"
-            skuLabel.text = productDetailSkuModel?.skuName
-        }
-    }
-
-}

+ 0 - 74
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailDescription/ProductDetailDescriptionTableViewCell.swift

@@ -1,74 +0,0 @@
-//
-//  ProductDetailDescriptionTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductDetailDescriptionTableViewCell: UITableViewCell {
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailDescriptionTableViewCell {
-        let ID = "ProductDetailDescriptionTableViewCell"
-        tableView.register(ProductDetailDescriptionTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailDescriptionTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailDescriptionTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(descriptionLabel)
-    }
-    
-    private func setupLayouts() {
-        descriptionLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(10)
-            make.bottom.equalTo(-10)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-        }
-    }
-    
-    private lazy var descriptionLabel: UILabel = {
-        let descriptionLabel = UILabel()
-
-        descriptionLabel.numberOfLines = 0
-        return descriptionLabel
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            var str = productDetailModel?.desc ?? ""
-            if str == "" {
-                str = "暂无数据"
-            }
-            str = "<head><style>img{width:\(kScreenWidth) !important;height:auto}</style></head>\(str)"
-            str = str.setHTMLImgStyle()
-            let htmlData = NSString(string: str).data(using: String.Encoding.unicode.rawValue)
-            let options = [NSAttributedString.DocumentReadingOptionKey.documentType:
-                NSAttributedString.DocumentType.html]
-            let attributedString = try? NSMutableAttributedString(data: htmlData ?? Data(),options: options,documentAttributes: nil)
-            descriptionLabel.attributedText = attributedString
-        }
-    }
-
-}

+ 0 - 191
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailEvaluation/ProductDetailEvaluationTableViewCell.swift

@@ -1,191 +0,0 @@
-//
-//  ProductDetailEvaluationTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class ProductDetailEvaluationTableViewCell: UITableViewCell {
-    
-    var commentImages: Array<String> = []
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailEvaluationTableViewCell {
-        let ID = "ProductDetailEvaluationTableViewCell"
-        tableView.register(ProductDetailEvaluationTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailEvaluationTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailEvaluationTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(avatarImageView)
-        addSubview(nickNameLabel)
-        addSubview(evaluationLabel)
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        avatarImageView.snp.makeConstraints { (make) in
-            make.top.left.equalTo(14)
-            make.size.equalTo(24)
-        }
-        nickNameLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(avatarImageView)
-            make.left.equalTo(avatarImageView.snp.right).offset(6)
-            make.right.equalTo(-14)
-        }
-        evaluationLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(avatarImageView.snp.bottom).offset(5)
-            make.left.equalTo(avatarImageView)
-            make.right.equalTo(-14)
-        }
-        collectionView.snp.makeConstraints { (make) in
-            make.top.equalTo(evaluationLabel.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(200)
-            make.bottom.equalToSuperview()
-        }
-    }
-    
-    lazy var avatarImageView: UIImageView = {
-        let avatarImageView = UIImageView()
-        avatarImageView.image = kImage(name: "default_pic")
-        avatarImageView.cornerRadius = 12
-        avatarImageView.masksToBounds = true
-        return avatarImageView
-    }()
-    
-    private lazy var nickNameLabel: UILabel = {
-        let nickNameLabel = UILabel()
-        nickNameLabel.text = "昵称"
-        nickNameLabel.textColor = k333333Color
-        nickNameLabel.font = kRegularFont13
-        return nickNameLabel
-    }()
-    
-    private lazy var evaluationLabel: UILabel = {
-        let evaluationLabel = UILabel()
-        evaluationLabel.textColor = k999999Color
-        evaluationLabel.font = kRegularFont13
-        evaluationLabel.numberOfLines = 0
-        return evaluationLabel
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kffffffColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 10
-        collectionViewLayout.minimumInteritemSpacing = 0
-        return collectionViewLayout
-    }()
-    
-    var productCommentModel : ProductCommentModel? {
-        didSet {
-            avatarImageView.kf.setImage(with: kURLImage(name: productCommentModel?.avatar ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            nickNameLabel.text = productCommentModel?.username
-            let attributeString = NSMutableAttributedString(string:productCommentModel?.content ?? "")
-            attributeString.changeAllLineSpacing(2)
-            evaluationLabel.attributedText = attributeString
-            
-            commentImages = productCommentModel?.imgs ?? []
-            if commentImages.count == 0 {
-                collectionView.snp.remakeConstraints { (make) in
-                    make.top.equalTo(evaluationLabel.snp_bottom)
-                    make.left.right.equalToSuperview()
-                    make.height.equalTo(0)
-                    make.bottom.equalToSuperview()
-                }
-            } else {
-                collectionView.reloadData()
-            }
-        }
-    }
-    
-    //加载数据
-    func reloadData() {
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.top.equalTo(evaluationLabel.snp_bottom)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-            make.bottom.equalToSuperview().offset(-14)
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-}
-
-extension ProductDetailEvaluationTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return commentImages.count
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductDetailEvaluationImageCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.imageUrl = commentImages[indexPath.row]
-        return cell
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:(kScreenWidth-30-5*3)/4, height: (kScreenWidth-30-5*3)/4)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 15, bottom: 0, right: 15)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        let vc = BrowsePicturesViewController.init(imageStrs: commentImages, index: indexPath.row)
-        responderViewController()?.navigationController?.pushViewController(vc, animated: true)
-    }
-    
-    //查找所在的ViewController
-    func responderViewController() -> UIViewController? {
-        for view in sequence(first: self.superview, next: { $0?.superview }) {
-            if let responder = view?.next {
-                if responder.isKind(of: UIViewController.self){
-                    return responder as? UIViewController
-                }
-            }
-        }
-        return nil
-    }
-    
-}

+ 0 - 137
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailHotSell/ProductDetailHotSellTableViewCell.swift

@@ -1,137 +0,0 @@
-//
-//  ProductDetailHotSellTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductDetailHotSellTableViewCell: UITableViewCell {
-
-    typealias JumpToDetailClosure = (_ proId: Int,_ shopId : Int) -> Void
-    var jumpToDetailClosure : JumpToDetailClosure?
-    
-    var productSearchListModel: ProductSearchListModel? {
-        didSet {
-            collectionView.reloadData()
-        }
-    }
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailHotSellTableViewCell {
-        let ID = "ProductDetailHotSellTableViewCell"
-        tableView.register(ProductDetailHotSellTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailHotSellTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailHotSellTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-
-        backgroundColor = kf7f8faColor
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        collectionView.snp.remakeConstraints {(make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = UIColor.white
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        collectionView.cornerRadius = 4
-        collectionView.masksToBounds = true
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 7
-        collectionViewLayout.minimumInteritemSpacing = 0
-        collectionViewLayout.scrollDirection = .horizontal
-        return collectionViewLayout
-    }()
-    
-    /// 添加购物车
-    ///
-    /// - Returns:
-    func addCart(productSearchModel:ProductSearchModel,indexPath:IndexPath) {
-        productSearchModel.isSelect = 1
-        SwiftMoyaNetWorkServiceProduct.shared().productCartListAddApi(productSearchModel: productSearchModel, completion: {
-            [weak self] (cartAmountModel) -> (Void) in
-            self!.collectionView.reloadItems(at: [indexPath])
-            SwiftProgressHUD.shared().showText("已加入购物车")
-        })
-    }
-    
-}
-
-extension ProductDetailHotSellTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return productSearchListModel?.data?.isEmpty ?? true ? 0 : 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        if productSearchListModel?.data?.isEmpty ?? true {
-            return 0
-        }else {
-            if productSearchListModel?.data?.count ?? 0 > 10 {
-                return productSearchListModel?.data?.prefix(10).count ?? 0
-            }else {
-                return productSearchListModel?.data?.count ?? 0
-            }
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductDetailHotSellCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.productSearchModel = productSearchListModel?.data?[indexPath.row]
-        cell.plusClosure = {
-            [weak self] (productSearchModel,indexPath) in
-            self?.addCart(productSearchModel: productSearchModel!, indexPath: indexPath!)
-        }
-        return cell
-        
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        let productSearchModel = productSearchListModel?.data?[indexPath.row]
-        if let jumpToDetailClosure = self.jumpToDetailClosure {
-            jumpToDetailClosure(productSearchModel?.id ?? 0, productSearchModel?.shopId ?? 0)
-        }
-    }
-
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:120, height: 153)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 14, bottom: 10, right: 14)
-    }
-    
-}

+ 0 - 104
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailParameter/ProductDetailParameterTableViewCell.swift

@@ -1,104 +0,0 @@
-//
-//  ProductDetailParameterTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductDetailParameterTableViewCell: UITableViewCell {
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailParameterTableViewCell {
-        let ID = "ProductDetailParameterTableViewCell"
-        tableView.register(ProductDetailParameterTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailParameterTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailParameterTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(titleLabel)
-        addSubview(contentLabel)
-        addSubview(lookTestReportButton)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(6)
-            make.left.equalTo(14)
-            make.bottom.equalTo(-6)
-        }
-        contentLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(6)
-            make.bottom.equalTo(-6)
-            make.left.equalTo(titleLabel.snp.right).offset(11)
-        }
-        lookTestReportButton.snp.makeConstraints { (make) in
-            make.centerY.equalTo(contentLabel)
-            make.left.equalTo(contentLabel.snp.right).offset(11)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "产品名称"
-        titleLabel.textColor = k999999Color
-        titleLabel.font = kRegularFont13
-        return titleLabel
-    }()
-    
-    private lazy var contentLabel: UILabel = {
-        let contentLabel = UILabel()
-        contentLabel.text = "彩虹星球山东章姬大草莓"
-        contentLabel.textColor = k333333Color
-        contentLabel.font = kRegularFont13
-        contentLabel.numberOfLines = 0
-        return contentLabel
-    }()
-    
-    private lazy var lookTestReportButton: UIButton = {
-        let lookTestReportButton = UIButton()
-        lookTestReportButton.setTitle("查看检测报告>>", for: UIControl.State.normal)
-        lookTestReportButton.setTitleColor(kFFA42FColor, for: UIControl.State.normal)
-        lookTestReportButton.titleLabel?.font = kMediumFont13
-        lookTestReportButton.isHidden = true
-        return lookTestReportButton
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            let productDetailParameterModel = productDetailModel?.parameter?[(indexPath?.row)!]
-            titleLabel.text = productDetailParameterModel?.name
-            contentLabel.text = productDetailParameterModel?.value
-            if productDetailModel?.report?.isEmpty ?? true {
-                lookTestReportButton.isHidden = true
-            }else {
-                if indexPath?.row == productDetailModel?.parameter?.count ?? 1 - 1 {
-                    lookTestReportButton.isHidden = false
-                }else {
-                    lookTestReportButton.isHidden = true
-                }
-            }
-        }
-    }
-
-}

+ 0 - 208
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductInfo/ProductDetailProductInfoTableViewCell.swift

@@ -1,208 +0,0 @@
-//
-//  ProductDetailProductInfoTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/11.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class ProductDetailProductInfoTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductInfoTableViewCell {
-        let ID = "ProductDetailProductInfoTableViewCell"
-        tableView.register(ProductDetailProductInfoTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailProductInfoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailProductInfoTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(topBgView)
-        addSubview(bottomBgView)
-        topBgView.addSubview(sellPriceLabel)
-//        topBgView.addSubview(markPriceLabel)
-        topBgView.addSubview(soldNumberLabel)
-        topBgView.addSubview(stockLabel)
-        bottomBgView.addSubview(titleLabel)
-        bottomBgView.addSubview(timeLabel)
-        bottomBgView.addSubview(detailTitleLabel)
-        bottomBgView.addSubview(shareButton)
-    }
-    
-    private func setupLayouts() {
-        
-        topBgView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(44)
-        }
-        sellPriceLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(9)
-            make.height.equalTo(19)
-        }
-        
-//        markPriceLabel.snp.makeConstraints { (make) in
-//            make.bottom.equalTo(sellPriceLabel)
-//            make.left.equalTo(sellPriceLabel.snp.right).offset(6)
-//            make.height.equalTo(13)
-//        }
-        
-        stockLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-        }
-        
-        soldNumberLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(stockLabel.snp.left).offset(-12)
-        }
-        
-        bottomBgView.snp.makeConstraints { (make) in
-            make.bottom.left.right.equalToSuperview()
-            make.top.equalTo(topBgView.snp.bottom)
-        }
-        
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(20)
-            make.left.equalTo(14)
-            make.right.equalTo(70)
-        }
-        
-        timeLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(10)
-            make.left.equalTo(titleLabel)
-        }
-        
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(timeLabel.snp.bottom).offset(10)
-            make.bottom.equalTo(-20)
-            make.left.equalTo(titleLabel)
-            make.right.equalTo(-14)
-        }
-        shareButton.snp.makeConstraints { (make) in
-            make.top.equalTo(20)
-            make.width.equalTo(66)
-            make.height.equalTo(24)
-            make.right.equalTo(0)
-        }
-        
-    }
-    
-    private lazy var topBgView: UIView = {
-        let topBgView = UIView()
-        topBgView.backgroundColor = kFFA42FColor
-        return topBgView
-    }()
-    
-    private lazy var sellPriceLabel : UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = UIColor.white
-        sellPriceLabel.font = kMediumFont24
-        return sellPriceLabel
-    }()
-    
-//    private lazy var markPriceLabel : UILabel = {
-//        let markPriceLabel = UILabel()
-//        markPriceLabel.textColor = UIColor.white
-//        markPriceLabel.font = kRegularFont13
-//        return markPriceLabel
-//    }()
-    
-    private lazy var soldNumberLabel : UILabel = {
-        let soldNumberLabel = UILabel()
-        soldNumberLabel.textColor = UIColor.white
-        soldNumberLabel.font = kRegularFont12
-        return soldNumberLabel
-    }()
-    
-    private lazy var stockLabel : UILabel = {
-        let markPrice = UILabel()
-        markPrice.textColor = UIColor.white
-        markPrice.font = kRegularFont12
-        return markPrice
-    }()
-    
-    private lazy var bottomBgView: UIView = {
-        let bottomBgView = UIView()
-        bottomBgView.backgroundColor = UIColor.white
-        return bottomBgView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kMediumFont17
-        titleLabel.numberOfLines = 0
-        return titleLabel
-    }()
-    
-    private lazy var timeLabel: UILabel = {
-        let timeLabel = UILabel()
-        timeLabel.backgroundColor = kFFF1EBColor
-        timeLabel.textColor = kFE5706Color
-        timeLabel.font = kRegularFont13
-        timeLabel.cornerRadius = 20/2
-        timeLabel.masksToBounds = true
-        return timeLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kRegularFont13
-        detailTitleLabel.numberOfLines = 0
-        return detailTitleLabel
-    }()
-    
-    private lazy var shareButton: UIButton = {
-        let shareButton = UIButton(type: UIButton.ButtonType.custom)
-        shareButton.backgroundColor = kf5f5f5Color
-        shareButton.setTitle("分享", for: UIControl.State.normal)
-        shareButton.setTitleColor(k999999Color, for: UIControl.State.normal)
-        shareButton.setImage(kImage(name: "goods_ico_share"), for: UIControl.State.normal)
-        shareButton.titleLabel?.font = kRegularFont13
-        let maskPath = UIBezierPath.init(roundedRect: CGRect(x: 0, y: 0, width: kScreenWidth, height: 24), byRoundingCorners: [.topLeft,.bottomLeft], cornerRadii: CGSize(width: 12, height: 12))
-        let maskLayer = CAShapeLayer.init()
-        maskLayer.frame = CGRect(x: 0, y: 0, width: kScreenWidth, height: 24)
-        maskLayer.path = maskPath.cgPath
-        shareButton.layer.mask = maskLayer
-        shareButton.rx.tap.subscribe(onNext: { (data) in
-            ShareView.sheetShareView()
-        }).disposed(by: disposeBag)
-        return shareButton
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            sellPriceLabel.text = "¥" + (productDetailModel?.skuPrice ?? "")
-            titleLabel.text = productDetailModel?.saleName
-            detailTitleLabel.text = productDetailModel?.subtitle
-            soldNumberLabel.text = "已售\(productDetailModel?.totalCount ?? 0)"
-            stockLabel.text = "仅剩\(productDetailModel?.totalStock ?? 0)"
-            timeLabel.text = "  \(productDetailModel?.receiveTime ?? "")  "
-        }
-    }
-
-}

+ 0 - 74
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductLabel/ProductDetailProductLabelIconCollectionViewCell.swift

@@ -1,74 +0,0 @@
-//
-//  ProductDetailProductSkuIconCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-
-class ProductDetailProductLabelIconCollectionViewCell: UICollectionViewCell {
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailProductLabelIconCollectionViewCell {
-        let ID = "ProductDetailProductLabelIconCollectionViewCell"
-        collectionView.register(ProductDetailProductLabelIconCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailProductLabelIconCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailProductLabelIconCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置view
-    private func setupViews() {
-        addSubview(iconImageView)
-        addSubview(titleLabel)
-    }
-    
-    private func setupLayouts() {
-        iconImageView.snp.makeConstraints { (make) in
-            make.top.centerX.equalToSuperview()
-            make.size.equalTo(32 * kScaleWidth)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(iconImageView.snp.bottom).offset(5)
-            make.centerX.equalToSuperview()
-            make.bottom.equalToSuperview()
-        }
-    }
-    lazy var iconImageView : UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "default_pic")
-        return iconImageView
-    }()
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont13
-        return titleLabel
-    }()
-    
-    var label : ProductDetailLabelModel? {
-        didSet {
-            iconImageView.kf.setImage(with: kURLImage(name: label?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = label?.name
-        }
-    }
-}

+ 0 - 217
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailProductLabel/ProductDetailProductLabelTableViewCell.swift

@@ -1,217 +0,0 @@
-//
-//  ProductDetailProductSkuTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import SwiftyJSON
-import RxSwift
-
-class ProductDetailProductLabelTableViewCell: UITableViewCell {
-    
-    
-    let disposeBag = DisposeBag()
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailProductLabelTableViewCell {
-        let ID = "ProductDetailProductSkuTableViewCell"
-        tableView.register(ProductDetailProductLabelTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailProductLabelTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailProductLabelTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(iconCollectionView)
-        addSubview(bgView)
-        bgView.addSubview(iconImageView)
-        bgView.addSubview(titleLabel)
-
-
-    }
-    
-    private func setupLayouts() {
-        iconCollectionView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview()
-            make.height.equalTo(65 * kScaleWidth)
-            make.left.equalTo(0)
-            make.width.equalTo(4*(kScreenWidth/5))
-        }
-        bgView.snp.makeConstraints { (make) in
-            make.top.equalTo(10)
-            make.bottom.equalTo(-10)
-            make.right.equalToSuperview()
-            make.width.equalTo(kScreenWidth/5)
-        }
-        iconImageView.snp.makeConstraints { (make) in
-            make.top.centerX.equalToSuperview()
-            make.size.equalTo(32 * kScaleWidth)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(iconImageView.snp.bottom).offset(5)
-            make.centerX.equalToSuperview()
-            make.bottom.equalToSuperview()
-        }
-    }
-    
-    lazy var bgView : UIButton = {
-        let bgView = UIButton(type: UIButton.ButtonType.custom)
-        bgView.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if !(self?.productDetailModel?.report?.isEmpty ?? true) {
-                let vc = BrowsePicturesViewController.init(imageStrs: (self?.productDetailModel?.report)!, index: 0)
-                self?.responderViewController()?.navigationController?.pushViewController(vc, animated: true)
-            }
-        }).disposed(by: disposeBag)
-        return bgView
-    }()
-    //查找所在的ViewController
-    func responderViewController() -> UIViewController? {
-        for view in sequence(first: self.superview, next: { $0?.superview }) {
-            if let responder = view?.next {
-                if responder.isKind(of: UIViewController.self){
-                    return responder as? UIViewController
-                }
-            }
-        }
-        return nil
-    }
-    
-    private lazy var iconCollectionView: UICollectionView = {
-        let iconCollectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: iconCollectionViewLayout)
-        iconCollectionView.backgroundColor = UIColor.white
-        iconCollectionView.delegate = self;
-        iconCollectionView.dataSource = self;
-        iconCollectionView.showsVerticalScrollIndicator = false
-        iconCollectionView.showsHorizontalScrollIndicator = false
-        iconCollectionView.cornerRadius = 4
-        iconCollectionView.masksToBounds = true
-        return iconCollectionView
-        
-    }()
-    
-    private lazy var iconCollectionViewLayout: UICollectionViewFlowLayout = {
-        let iconCollectionViewLayout = UICollectionViewFlowLayout.init()
-        iconCollectionViewLayout.minimumLineSpacing = 0
-        iconCollectionViewLayout.minimumInteritemSpacing = 0
-        iconCollectionViewLayout.itemSize = CGSize(width: kScreenWidth/5, height: kScaleWidth * 55)
-        iconCollectionViewLayout.scrollDirection = .horizontal
-        return iconCollectionViewLayout
-    }()
-    lazy var iconImageView : UIImageView = {
-        let iconImageView = UIImageView()
-        iconImageView.image = kImage(name: "common_jiancebaogao")
-        iconImageView.isUserInteractionEnabled = false
-        return iconImageView
-    }()
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "检测报告"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont13
-        titleLabel.isUserInteractionEnabled = false
-        return titleLabel
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-
-        }
-    }
-    
-    
-    //加载数据
-    func reloadData() {
-        
-        //collectionView重新加载数据
-        self.iconCollectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize1 = self.iconCollectionView.collectionViewLayout.collectionViewContentSize
-        if productDetailModel?.report?.isEmpty ?? true {
-            bgView.isHidden = true
-            iconImageView.isHidden = true
-            titleLabel.isHidden = true
-            bgView.snp.remakeConstraints { (make) in
-                make.top.equalTo(10)
-                make.bottom.equalTo(-10)
-                make.right.equalToSuperview()
-                make.width.equalTo(0)
-            }
-            iconCollectionView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(contentSize1.height)
-                make.left.equalTo(0)
-                make.width.equalTo(kScreenWidth)
-                make.bottom.equalToSuperview()
-            }
-        }else {
-            bgView.isHidden = false
-            iconImageView.isHidden = false
-            titleLabel.isHidden = false
-            bgView.snp.makeConstraints { (make) in
-                make.top.equalTo(10)
-                make.bottom.equalTo(-10)
-                make.right.equalToSuperview()
-                make.width.equalTo(kScreenWidth/5)
-            }
-            iconCollectionView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(contentSize1.height)
-                make.left.equalTo(0)
-                make.width.equalTo(4*(kScreenWidth/5))
-                make.bottom.equalToSuperview()
-            }
-        }
-       
-        self.iconCollectionView.collectionViewLayout.invalidateLayout()
-    }
-
-}
-
-extension ProductDetailProductLabelTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return  self.productDetailModel?.label?.isEmpty ?? true ? 0 :1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return self.productDetailModel?.label?.count ?? 0
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductDetailProductLabelIconCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.label = self.productDetailModel?.label?[indexPath.row]
-        return cell
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 0, bottom: 10, right: 0)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
-        return 0
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
-        return 0
-    }
-}

+ 0 - 116
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/Cell/ProductDetailShop/ProductDetailShopTableViewCell.swift

@@ -1,116 +0,0 @@
-//
-//  ProductDetailShopTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductDetailShopTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias JumpToShopBlock = (_ shopName: String,_ shopId : Int) -> Void
-    var jumpToShopBlock : JumpToShopBlock?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductDetailShopTableViewCell {
-        let ID = "ProductDetailShopTableViewCell"
-        tableView.register(ProductDetailShopTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductDetailShopTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductDetailShopTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(shopImageView)
-        addSubview(shopNameLabel)
-        addSubview(comeInButton)
-    }
-    
-    private func setupLayouts() {
-        shopImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(12)
-            make.left.equalTo(14)
-            make.size.equalTo(60)
-            make.bottom.lessThanOrEqualTo(-12)
-        }
-        shopNameLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(shopImageView.snp.right).offset(10)
-            make.centerY.equalToSuperview()
-            make.right.equalTo(comeInButton.snp.left).offset(10)
-        }
-        comeInButton.snp.makeConstraints { (make) in
-            make.right.equalTo(-14)
-            make.height.equalTo(24)
-            make.width.equalTo(63)
-            make.centerY.equalToSuperview()
-        }
-        
-    }
-    
-    private lazy var shopImageView: UIImageView = {
-        let shopImageView = UIImageView()
-        shopImageView.image = kImage(name: "default_pic")
-        shopImageView.cornerRadius = 60/2
-        shopImageView.masksToBounds = true
-        shopImageView.layer.borderColor = kf9f9f9Color.cgColor
-        shopImageView.layer.borderWidth = 0.5
-        return shopImageView
-    }()
-    
-    private lazy var shopNameLabel : UILabel = {
-        let shopNameLabel = UILabel()
-        shopNameLabel.text = "彩虹星球专营店"
-        shopNameLabel.textColor = k333333Color
-        shopNameLabel.font = kMediumFont15
-        return shopNameLabel
-    }()
-    
-    private lazy var comeInButton: UIButton = {
-        let comeInButton = UIButton(type: UIButton.ButtonType.custom)
-        comeInButton.setTitle("进入", for: UIControl.State.normal)
-        comeInButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        comeInButton.titleLabel?.font = kRegularFont14
-        comeInButton.cornerRadius = 12
-        comeInButton.masksToBounds = true
-        comeInButton.backgroundColor = kFFA42FColor
-        comeInButton.rx.tap.subscribe(onNext: { //跳转到店铺
-             [weak self] (data) in
-            if let jumpToShopBlock = self?.jumpToShopBlock {
-                jumpToShopBlock(self?.productDetailModel?.shopName ?? "", self?.productDetailModel?.shopId ?? 0)
-            }
-        }).disposed(by: disposeBag)
-        return comeInButton
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            shopImageView.kf.setImage(with: kURLImage(name: productDetailModel?.logoImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            shopNameLabel.text = productDetailModel?.shopName
-            
-        }
-    }
-
-}

+ 0 - 63
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailFSPagerViewCell.swift

@@ -1,63 +0,0 @@
-//
-//  ProductDetailFSPagerViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/11.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import FSPagerView
-import Kingfisher
-class ProductDetailFSPagerViewCell: FSPagerViewCell {
-    class func cellWith(collectionView:FSPagerView,index:Int) -> ProductDetailFSPagerViewCell {
-        let ID = "ProductDetailFSPagerViewCell"
-        collectionView.register(ProductDetailFSPagerViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailFSPagerViewCell =
-            collectionView.dequeueReusableCell(withReuseIdentifier: ID, at: index) as! ProductDetailFSPagerViewCell
-        cell.index = index
-        return cell
-    }
-    //MARK: - indexPath
-    var index: Int?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置view
-    private func setupViews() {
-        addSubview(productImageView)
-    }
-    
-    private func setupLayouts() {
-        productImageView.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-            make.size.equalToSuperview()
-        }
-
-    }
-    
-    private lazy var productImageView: UIImageView = {
-        let productImageView = UIImageView()
-        productImageView.contentMode = .scaleAspectFill
-        return productImageView
-    }()
-    
-    var imageNames: Array<String>?{
-        didSet {
-            productImageView.kf.setImage(with: kURLImage(name: imageNames?[index ?? 0] ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-        }
-    }
-}

+ 0 - 106
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailSectionHeader.swift

@@ -1,106 +0,0 @@
-//
-//  ProductDetailSectionHeader.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-
-class ProductDetailSectionHeader: BaseView {
-    
-    let disposeBags = DisposeBag()
-    
-    typealias LookAllCommentClosure = () -> Void
-    var lookAllCommentClosure : LookAllCommentClosure?
-
-    override func setupViews() {
-        backgroundColor = UIColor.white
-        addSubview(vlineLabel)
-        addSubview(hlineLabel)
-        addSubview(titleLabel)
-        addSubview(goButton)
-    }
-    
-    override func setupLayouts() {
-
-        hlineLabel.snp.makeConstraints { (make) in
-            make.bottom.equalTo(0)
-            make.height.equalTo(1)
-            make.left.equalTo(14)
-            make.right.equalToSuperview()
-        }
-        vlineLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(14)
-            make.centerY.equalToSuperview()
-            make.height.equalTo(15)
-            make.width.equalTo(4)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(vlineLabel.snp.right).offset(10)
-        }
-        goButton.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.right.equalTo(-14)
-        }
-        goButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-    }
-    
-    lazy var vlineLabel: UILabel = {
-        let vlineLabel = UILabel()
-        vlineLabel.backgroundColor = kFFA42FColor
-        vlineLabel.cornerRadius = 2
-        vlineLabel.clipsToBounds = true
-        return vlineLabel
-    }()
-    
-    lazy var hlineLabel: UILabel = {
-        let hlineLabel = UILabel()
-        hlineLabel.backgroundColor = kf5f5f5Color
-        return hlineLabel
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kMediumFont15
-        return titleLabel
-    }()
-    
-    private lazy var goButton: UIButton = {
-        let goButton = UIButton(type: UIButton.ButtonType.custom)
-        goButton.setTitle("查看全部评价", for: UIControl.State.normal)
-        goButton.setTitleColor(k999999Color, for: UIControl.State.normal)
-        goButton.titleLabel?.font = kRegularFont13
-        goButton.setImage(kImage(name: "my_arrows_unfold"), for:
-            UIControl.State.normal)
-        goButton.isHidden = false
-        goButton.rx.tap.subscribe(onNext: {
-             [weak self](data) in
-            if let lookAllCommentClosure = self?.lookAllCommentClosure {
-                lookAllCommentClosure()
-            }
-        }).disposed(by: disposeBags)
-        return goButton
-    }()
-    
-    var section : Int? {
-        didSet {
-            if section == 2 {
-                goButton.isHidden = false
-            }else {
-               goButton.isHidden = true
-            }
-        }
-    }
-    
-    var titles : [String]? {
-        didSet {
-            titleLabel.text = (titles?[section!])!
-        }
-    }
-    
-}

+ 0 - 118
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift

@@ -1,118 +0,0 @@
-//
-//  ProductDetailTableViewHeaderView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/11.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import FSPagerView
-
-class ProductDetailTableViewHeaderView: BaseView {
-    
-    override func setupViews() {
-        backgroundColor = UIColor.white
-        addSubview(pagerView)
-        addSubview(pageControl)
-        pagerView.addSubview(soldOutImageView)
-    }
-    
-    override func setupLayouts() {
-        pagerView.snp.makeConstraints { (make) in
-//            make.top.equalTo(kSafeStatusBarHeight)
-            make.top.left.right.bottom.equalToSuperview()
-        }
-        soldOutImageView.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-            make.size.equalTo(91)
-        }
-    }
-    
-    private lazy var pagerView: FSPagerView = {
-        let pagerView = FSPagerView()
-        pagerView.delegate = self
-        pagerView.dataSource = self
-        pagerView.scrollDirection = .horizontal
-        pagerView.itemSize = CGSize(width:kScreenWidth, height:251+kSafeTabBarHeight)
-        pagerView.decelerationDistance = FSPagerView.automaticDistance
-        
-        return pagerView
-    }()
-    
-    private lazy var pageControl: NXLPageControl = {
-        let pageControl = NXLPageControl()
-        pageControl.pointSize = CGSize.init(width: kScaleValue(value: 5), height: 5)
-        pageControl.currentWidthMultiple = 1//当前点的宽度为其他点的4倍
-        pageControl.localPointSpace = 8
-        pageControl.currentColor = kFFA42FColor
-        pageControl.otherColor = UIColor(white: 0, alpha: 0.2)
-        pageControl.clickPoint { [weak self] (index) in
-            
-        }
-        return pageControl
-    }()
-    
-    private lazy var soldOutImageView: UIImageView = {
-        let soldOutImageView = UIImageView()
-        soldOutImageView.image = kImage(name: "common_goods_pic_soldout")
-        soldOutImageView.isHidden = true
-        return soldOutImageView
-    }()
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            if !(productDetailModel?.imgs?.isEmpty ?? true) {
-                let pageControlWidth = CGFloat((productDetailModel?.imgs!.count)!) * kScaleValue(value: 8) +  CGFloat((productDetailModel?.imgs!.count)! - 1) * kScaleValue(value: 8)
-                pageControl.snp.remakeConstraints { (make) in
-                    make.bottom.equalTo(-12)
-                    make.height.equalTo(8)
-                    make.centerX.equalToSuperview()
-                    make.width.equalTo(pageControlWidth)
-                }
-                pageControl.numberOfPages = (productDetailModel?.imgs!.count)!
-                if  pageControl.numberOfPages > 1 {
-                    pageControl.isHidden = false
-                    pagerView.automaticSlidingInterval = 3.0
-                    pagerView.isInfinite = true
-                }else {
-                    pageControl.isHidden = true
-                    pagerView.automaticSlidingInterval = 0.0
-                    pagerView.isInfinite = false
-                }
-                if productDetailModel?.totalStock == 0 {
-                    self.soldOutImageView.isHidden = false
-                }else {
-                    self.soldOutImageView.isHidden = true
-                }
-                pagerView.reloadData()
-            }
-        }
-    }
-    
-}
-
-extension ProductDetailTableViewHeaderView: FSPagerViewDataSource,FSPagerViewDelegate {
-    func numberOfItems(in pagerView: FSPagerView) -> Int {
-        return productDetailModel?.imgs?.isEmpty ?? true ? 0 : productDetailModel?.imgs?.count ?? 0
-    }
-    func pagerView(_ pagerView: FSPagerView, cellForItemAt index: Int) -> FSPagerViewCell {
-        let cell  = ProductDetailFSPagerViewCell.cellWith(collectionView: pagerView, index: index)
-        cell.imageNames = productDetailModel?.imgs
-        return cell
-    }
-    
-    func pagerView(_ pagerView: FSPagerView, didSelectItemAt index: Int) {
-        pagerView.deselectItem(at: index, animated: true)
-        pagerView.scrollToItem(at: index, animated: true)
-    }
-    
-    func pagerViewWillEndDragging(_ pagerView: FSPagerView, targetIndex: Int) {
-        self.pageControl.currentPage = targetIndex
-    }
-    
-    func pagerViewDidEndScrollAnimation(_ pagerView: FSPagerView) {
-        self.pageControl.currentPage = pagerView.currentIndex
-    }
-    
-}

+ 0 - 101
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailProductSkuLabelCollectionViewCell.swift

@@ -1,101 +0,0 @@
-//
-//  ProductDetailProductSkuLabelCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductDetailProductSkuLabelCollectionViewCell: UICollectionViewCell {
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailProductSkuLabelCollectionViewCell {
-        let ID = "ProductDetailProductSkuLabelCollectionViewCell"
-        collectionView.register(ProductDetailProductSkuLabelCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailProductSkuLabelCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailProductSkuLabelCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置view
-    private func setupViews() {
-        backgroundColor = kf5f5f5Color
-        layer.cornerRadius = 4
-        layer.masksToBounds = true
-        addSubview(titleLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.top.equalTo(6)
-            make.right.bottom.equalTo(-6)
-        }
-    }
-    
-    lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "蔬菜400g"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont13
-        return titleLabel
-    }()
-    
-    
-    var productDetailSpecValueModel: ProductDetailSpecValueModel? {
-        didSet {
-            titleLabel.text = productDetailSpecValueModel?.value
-        }
-    }
-    
-    var filter: ORSKUDataFilter? {
-        didSet {
-            if (filter?.availableIndexPathsSet.contains(indexPath!))! {
-                self.backgroundColor = kf5f5f5Color
-                self.layer.cornerRadius = 4
-                self.layer.masksToBounds = true
-                self.layer.borderColor = kf5f5f5Color.cgColor
-                self.layer.borderWidth = 1
-                titleLabel.textColor = k333333Color
-            }else {
-
-                self.backgroundColor = kf5f5f5Color
-                self.layer.cornerRadius = 4
-                self.layer.masksToBounds = true
-                self.layer.borderColor = kf5f5f5Color.cgColor
-                self.layer.borderWidth = 1
-                titleLabel.textColor = k999999Color
-            }
-            
-            if (filter?.selectedIndexPaths.contains(indexPath!))! {
-                self.backgroundColor =  kffffffColor
-                self.layer.cornerRadius = 4
-                self.layer.masksToBounds = true
-                self.layer.borderColor = kFFA42FColor.cgColor
-                self.layer.borderWidth = 1
-                titleLabel.textColor = kFFA42FColor
-            }
-        }
-    }
-    
-    var text : String? {
-        didSet {
-            titleLabel.text = text
-        }
-    }
-}

+ 0 - 60
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuSectionHeaerCollectionReusableView.swift

@@ -1,60 +0,0 @@
-//
-//  ProductDetailSkuSectionHeaerCollectionReusableView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/13.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ProductDetailSkuSectionHeaerCollectionReusableView: UICollectionReusableView {
-    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ProductDetailSkuSectionHeaerCollectionReusableView {
-        let ID = "ProductDetailSkuSectionHeaerCollectionReusableView"
-        collectionView.register(ProductDetailSkuSectionHeaerCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
-        let headerView : ProductDetailSkuSectionHeaerCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductDetailSkuSectionHeaerCollectionReusableView
-        headerView.indexPath = indexPath
-        return headerView
-    }
-    
-    var indexPath : IndexPath? {
-        didSet {
-            
-        }
-    }
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置View
-    private func setupViews() {
-        addSubview(titleLabel)
-    }
-    
-    private func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.left.equalTo(14)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "颜色"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kRegularFont15
-        return titleLabel
-    }()
-    
-    var productDetailSpecModel: ProductDetailSpecModel? {
-        didSet {
-            titleLabel.text = productDetailSpecModel?.name
-        }
-    }
-}

+ 0 - 500
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailSkuView/ProductDetailSkuView.swift

@@ -1,500 +0,0 @@
-//
-//  ProductDetailSkuView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/13.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import FWPopupView
-import RxSwift
-import RxCocoa
-import Kingfisher
-
-enum ProductDetailSkuViewType {
-    case selectSku
-    case addCart
-    case buyNow
-}
-
-class ProductDetailSkuView: FWPopupView {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias SureClosure = (ProductDetailSkuViewType,ProductDetailSkuModel) -> Void
-    var sureClosure: SureClosure?
-    
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-
-    
-    private func setupViews() {
-       
-        addSubview(topBgView)
-        topBgView.addSubview(productImageView)
-        topBgView.addSubview(priceLabel)
-        topBgView.addSubview(stockLabel)
-        topBgView.addSubview(oneLineLabel)
-        
-        addSubview(closeButton)
-        
-        addSubview(sureButton)
-        
-        addSubview(bottomBgView)
-        bottomBgView.addSubview(twoLineLabel)
-        bottomBgView.addSubview(buyNumberLabel)
-        bottomBgView.addSubview(limitLabel)
-        
-        bottomBgView.addSubview(buyNumberBgView)
-        buyNumberBgView.addSubview(plusButton)
-        buyNumberBgView.addSubview(oneVLine)
-        buyNumberBgView.addSubview(twoVLine)
-        buyNumberBgView.addSubview(numberLabel)
-        buyNumberBgView.addSubview(reduceButton)
-        
-        addSubview(collectionView)
-
-    }
-    
-    private func setupLayouts() {
-        
-        closeButton.snp.makeConstraints { (make) in
-            make.top.right.equalToSuperview()
-            make.size.equalTo(46)
-        }
-        
-        topBgView.snp.makeConstraints { (make) in
-            make.top.equalTo(42)
-            make.left.equalTo(14)
-            make.right.equalTo(-15)
-            make.height.equalTo(115)
-        }
-        productImageView.snp.makeConstraints { (make
-            ) in
-            make.left.top.equalToSuperview()
-            make.size.equalTo(100)
-        }
-        stockLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(productImageView.snp.right).offset(22)
-            make.bottom.equalTo(productImageView)
-        }
-        priceLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(stockLabel)
-            make.bottom.equalTo(stockLabel.snp.top).offset(-7)
-        }
-        oneLineLabel.snp.makeConstraints { (make) in
-            make.bottom.left.right.equalToSuperview()
-            make.height.equalTo(1)
-        }
-        sureButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(-kSafeTabBarHeight)
-            make.left.right.equalToSuperview()
-            make.height.equalTo(50)
-        }
-        bottomBgView.snp.makeConstraints { (make) in
-            make.bottom.equalTo(sureButton.snp.top).offset(-13)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-            make.height.equalTo(50)
-        }
-        twoLineLabel.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(1)
-        }
-        buyNumberLabel.snp.makeConstraints { (make) in
-            make.centerY.left.equalToSuperview()
-        }
-        limitLabel.snp.makeConstraints { (make) in
-            make.centerY.equalTo(buyNumberLabel)
-            make.left.equalTo(buyNumberLabel.snp.right).offset(5)
-        }
-        
-        buyNumberBgView.snp.remakeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.height.equalTo(22)
-            make.width.greaterThanOrEqualTo(10)
-            make.right.equalTo(0)
-        }
-        
-        plusButton.snp.remakeConstraints { (make) in
-            make.top.bottom.right.equalToSuperview()
-            make.width.equalTo(22)
-        }
-        oneVLine.snp.remakeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.width.equalTo(1)
-            make.right.equalTo(plusButton.snp.left)
-        }
-        
-        numberLabel.snp.remakeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.width.greaterThanOrEqualTo(36)
-            make.right.equalTo(oneVLine.snp.left)
-        }
-        
-        twoVLine.snp.remakeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.width.equalTo(1)
-            make.right.equalTo(numberLabel.snp.left)
-        }
-        reduceButton.snp.remakeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.right.equalTo(twoVLine.snp.left)
-            make.width.equalTo(22)
-            make.left.equalTo(buyNumberBgView)
-        }
-
-        collectionView.snp.makeConstraints { (make) in
-            make.top.equalTo(topBgView.snp.bottom)
-            make.bottom.equalTo(bottomBgView.snp.top)
-            make.left.right.equalToSuperview()
-        }
-    }
-
-    private lazy var closeButton : UIButton = {
-        let closeButton = UIButton(type: UIButton.ButtonType.custom)
-        closeButton.setImage(kImage(name: "common_sku_cancel"), for: UIControl.State.normal)
-        closeButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.hide()
-        }).disposed(by: disposeBag)
-        return closeButton
-    }()
-    
-    private lazy var topBgView: UIView = {
-        let topBgView = UIView()
-        return topBgView
-    }()
-    
-    private lazy var productImageView: UIImageView = {
-        let productImageView = UIImageView()
-        productImageView.image = kImage(name: "default_pic")
-        productImageView.contentMode = .scaleAspectFill
-        productImageView.masksToBounds = true
-        return productImageView
-    }()
-    
-    private lazy var priceLabel: UILabel = {
-        let priceLabel = UILabel()
-        priceLabel.textColor = kFE352BColor
-        priceLabel.font = kMediumFont18
-        return priceLabel
-    }()
-    
-    private lazy var stockLabel: UILabel = {
-        let stockLabel = UILabel()
-        stockLabel.textColor = k333333Color
-        stockLabel.font = kMediumFont13
-        return stockLabel
-    }()
-    
-    lazy var oneLineLabel: UILabel = {
-        let oneLineLabel = UILabel()
-        oneLineLabel.backgroundColor = kf5f5f5Color
-        return oneLineLabel
-    }()
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = UIColor.white
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewLeftAlignedLayout = {
-        let collectionViewLayout = UICollectionViewLeftAlignedLayout.init()
-        collectionViewLayout.minimumLineSpacing = 10
-        collectionViewLayout.minimumInteritemSpacing = 10
-        collectionViewLayout.estimatedItemSize = CGSize(width: 72, height: 25)
-        return collectionViewLayout
-    }()
-    
-    private lazy var bottomBgView: UIView = {
-        let bottomBgView = UIView()
-        return bottomBgView
-    }()
-    
-    private lazy var twoLineLabel: UILabel = {
-        let twoLineLabel = UILabel()
-        twoLineLabel.backgroundColor = kf5f5f5Color
-        return twoLineLabel
-    }()
-    
-    private lazy var buyNumberLabel: UILabel = {
-        let buyNumberLabel = UILabel()
-        buyNumberLabel.text = "购买数量"
-        buyNumberLabel.textColor = k333333Color
-        buyNumberLabel.font = kRegularFont15
-        return buyNumberLabel
-    }()
-    
-    private lazy var limitLabel: UILabel = {
-        let limitLabel = UILabel()
-        limitLabel.textColor = k999999Color
-        limitLabel.font = kRegularFont13
-        return limitLabel
-    }()
-    
-    private lazy var buyNumberBgView: UIView = {
-        let buyNumberBgView = UIView()
-        buyNumberBgView.cornerRadius = 2
-        buyNumberBgView.masksToBounds = true
-        buyNumberBgView.layer.borderColor = kf5f5f5Color.cgColor
-        buyNumberBgView.layer.borderWidth = 1
-        return buyNumberBgView
-    }()
-    
-    lazy var plusButton : UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setTitle(" + ", for: UIControl.State.normal)
-        plusButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        plusButton.titleLabel?.font = kMediumFont13
-        plusButton.contentVerticalAlignment = .center
-        plusButton.contentHorizontalAlignment = .center
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self](data) in
-            
-            if self?.productCount ?? 1 < self?.productDetailSkuModel?.stock ?? 0 {
-                if self?.productDetailModel?.limitNumber ?? 0 > 0 {
-                    if  self?.productCount ?? 1 >=  self?.productDetailModel?.limitNumber ?? 1{
-                        SwiftProgressHUD.shared().showText("该数量已是限购数量",view: self!)
-                    }else {
-                        self?.productCount += 1
-                        self?.numberLabel.text = "\(self?.productCount ?? 0)"
-                    }
-                }else {
-                    self?.productCount += 1
-                    self?.numberLabel.text = "\(self?.productCount ?? 0)"
-                }
-                
-            }else {
-                SwiftProgressHUD.shared().showText("该数量已是库存数量",view: self!)
-            }
-
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    lazy var reduceButton : UIButton = {
-        let reduceButton = UIButton(type: UIButton.ButtonType.custom)
-        reduceButton.setTitle(" - ", for: UIControl.State.normal)
-        reduceButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        reduceButton.titleLabel?.font = kMediumFont13
-        reduceButton.contentVerticalAlignment = .center
-        reduceButton.contentHorizontalAlignment = .center
-        reduceButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if self?.productCount ?? 1 <= 1 {
-                SwiftProgressHUD.shared().showText("该数量已是最低数量",view: self!)
-            }else {
-                self?.productCount -= 1
-                self?.numberLabel.text = "\(self?.productCount ?? 0)"
-            }
-        }).disposed(by: disposeBag)
-        return reduceButton
-    }()
-    
-    lazy var numberLabel : UILabel = {
-        let numberLabel = UILabel()
-        numberLabel.text = "\(productCount)"
-        numberLabel.textColor = k333333Color
-        numberLabel.font = kMediumFont13
-        numberLabel.textAlignment = .center
-        return numberLabel
-    }()
-    
-    lazy var oneVLine: UILabel = {
-        let oneVLine = UILabel()
-        oneVLine.backgroundColor = kE6E6E6Color
-        return oneVLine
-    }()
-    
-    lazy var twoVLine: UILabel = {
-        let twoVLine = UILabel()
-        twoVLine.backgroundColor = kE6E6E6Color
-        return twoVLine
-    }()
-    
-    lazy var sureButton: UIButton = {
-        let sureButton = UIButton(type: UIButton.ButtonType.custom)
-        sureButton.setBackgroundImage(UIImage.imageWithColor(color: kFFA42FColor), for: UIControl.State.normal)
-        sureButton.setBackgroundImage(UIImage.imageWithColor(color: kf5f5f5Color), for: UIControl.State.disabled)
-        sureButton.backgroundColor = kFFA42FColor
-        sureButton.setTitle("确  认", for: UIControl.State.normal)
-        sureButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        sureButton.setTitleColor(k666666Color, for: UIControl.State.disabled)
-        sureButton.titleLabel?.font = kRegularFont16
-        sureButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            if let sureClosure = self?.sureClosure {
-               self?.productDetailSkuModel?.productCount = self?.productCount
-                sureClosure((self?.productDetailSkuViewType)!,(self?.productDetailSkuModel)!)
-            }
-        }).disposed(by: disposeBag)
-        return sureButton
-    }()
-    
-    var skuModelMainkey = ""
-    var skuIdArray : Array<String>?
-    var productCount : Int = 1
-    var filter : ORSKUDataFilter?
-    var productDetailSkuModel : ProductDetailSkuModel?
-    var productDetailSkuViewType:ProductDetailSkuViewType?
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            productImageView.kf.setImage(with: kURLImage(name: productDetailModel?.img ?? "default_pic")
-                , placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            if productDetailModel?.limitNumber ?? 0 <= 0 {
-                limitLabel.isHidden = true
-            }else {
-                limitLabel.text = "(" + "每人限购\(productDetailModel?.limitNumber ?? 0)件" + ")"
-            }
-            filter = ORSKUDataFilter.init(dataSource: self)
-            if productDetailSkuModel != nil {
-                selected()
-            }else {
-                defaultMainSelected()
-            }
-            self.collectionView.reloadData()
-            actionComplete()
-            
-        }
-    }
-    
-    func defaultMainSelected() {
-        if !(self.productDetailModel?.sku?.isEmpty ?? true) { //skus是否为空
-            for (index,sku) in (self.productDetailModel?.sku)!.enumerated() {//便利skus
-                if sku.isMain == 1 {//sku是否是主规格
-                    filter?.defaultIndex = Int32(index)
-                }
-            }
-        }
-    }
-    func selected() {
-        if !(self.productDetailModel?.sku?.isEmpty ?? true) { //skus是否为空
-            for (index,sku) in (self.productDetailModel?.sku)!.enumerated() {//便利skus
-                if sku.id == productDetailSkuModel?.id {//sku是否是主规格
-                    filter?.defaultIndex = Int32(index)
-                }
-            }
-        }
-    }
-    
-    func actionComplete() {
-         let  productDetailSkuModel = filter?.currentResult as? ProductDetailSkuModel
-        if productDetailSkuModel != nil {
-            self.productDetailSkuModel = productDetailSkuModel
-            priceLabel.text = priceConversion(price: productDetailSkuModel!.price ?? 0)
-            stockLabel.text = "库存\(productDetailSkuModel!.stock ?? 0)件"
-            if productDetailSkuModel!.stock ?? 0 > 0 {
-                 sureButton.isEnabled = true
-            }else {
-                sureButton.isEnabled = false
-            }
-            if productDetailSkuModel!.stock ?? 0 < self.productCount {
-                self.productCount = productDetailSkuModel!.stock ?? 0
-            }
-        }else {
-            sureButton.isEnabled = false
-        }
-       
-    }
-    
-
-}
-
-extension ProductDetailSkuView: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return productDetailModel?.spec?.isEmpty ?? true ? 0 : productDetailModel?.spec?.count ?? 0
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        let values = productDetailModel?.spec?[section].value
-        return values?.isEmpty ?? true ? 0 : values?.count ?? 0
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductDetailProductSkuLabelCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.productDetailSpecValueModel = (productDetailModel?.spec?[indexPath.section].value?[indexPath.row])!
-        cell.filter = filter
-
-        return cell
-        
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        filter!.didSelectedProperty(with: indexPath)
-        collectionView.reloadData()
-        actionComplete()
-
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 0, left: 14, bottom: 10, right: 14)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
-        if kind == UICollectionView.elementKindSectionHeader {
-
-            let headerView = ProductDetailSkuSectionHeaerCollectionReusableView.headerWith(collectionView: collectionView, kind:  UICollectionView.elementKindSectionHeader, indexPath: indexPath)
-            headerView.productDetailSpecModel = productDetailModel?.spec?[indexPath.section]
-            return headerView
-        }
-        return UICollectionReusableView()
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
-         return CGSize(width:kScreenWidth, height:41)
-    }
-    
-}
-
-extension ProductDetailSkuView: ORSKUDataFilterDataSource {
-    
-    
-    func numberOfSectionsForProperties(in filter: ORSKUDataFilter!) -> Int {
-        return  (self.productDetailModel?.spec?.count)!
-    }
-    
-    func filter(_ filter: ORSKUDataFilter!, propertiesInSection section: Int) -> [Any]! {
-        return self.productDetailModel?.spec?[section].value!
-    }
-    
-    func numberOfConditions(in filter: ORSKUDataFilter!) -> Int {
-        return (self.productDetailModel?.sku!.count)!
-    }
-    func filter(_ filter: ORSKUDataFilter!, conditionForRow row: Int) -> [Any]! {
-        let key = self.productDetailModel?.sku?[row].key
-        let keys = key?.components(separatedBy: "_")
-        var deystrs = Array<ProductDetailSpecValueModel>()
-       
-        for key in keys! {
-            for specs in self.productDetailModel!.spec! {
-                for spec in specs.value! {
-                    if spec.id == Int(key) {
-                        deystrs.append(spec)
-                    }
-                }
-            }
-        }
-        return deystrs
-    }
-    
-    func filter(_ filter: ORSKUDataFilter!, resultOfConditionForRow row: Int) -> Any! {
-        return self.productDetailModel?.sku?[row]
-    }
-}
-

+ 0 - 580
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift

@@ -1,580 +0,0 @@
-
-//  ProductDetailView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/11.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import PPBadgeViewSwift
-import FWPopupView
-
-class ProductDetailView: BaseView {
-
-    
-    /// 添加View
-    override func setupViews() {
-        backgroundColor = kf7f8faColor
-        addSubview(bottomBgView)
-        bottomBgView.addSubview(cartButton)
-        cartButton.addSubview(cartImageView)
-        bottomBgView.addSubview(addCartButton)
-        bottomBgView.addSubview(buyButton)
-        bottomBgView.addSubview(nuablebuyLabel)
-        addSubview(tableView)
-        addSubview(topButton)
-        setProductDetailSkuView()
-        if #available(iOS 11.0, *) {
-            tableView.contentInsetAdjustmentBehavior = .never
-        }
-        let emptyView = DIYEmptyView.empty(with: kImage(name: "default_page_data"), titleStr: nil, detailStr: "当前暂无数据")
-        emptyView!.contentViewY = kScaleValue(value: 182)
-        tableView.ly_emptyView = emptyView
-    }
-    
-    /// 约束
-    override func setupLayouts() {
-        bottomBgView.snp.makeConstraints { (make) in
-            make.left.bottom.right.equalToSuperview()
-            make.height.equalTo(50 + kSafeTabBarHeight)
-        }
-        cartButton.snp.makeConstraints { (make) in
-            make.top.left.equalToSuperview()
-            make.width.equalTo(71 * kScaleWidth)
-            make.bottom.equalTo(-kSafeTabBarHeight)
-        }
-        cartImageView.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-        }
-        addCartButton.snp.makeConstraints { (make) in
-            make.left.equalTo(cartButton.snp.right)
-            make.top.bottom.equalTo(cartButton)
-            make.width.equalTo(152 * kScaleWidth)
-        }
-        buyButton.snp.makeConstraints { (make) in
-            make.left.equalTo(addCartButton.snp.right)
-            make.top.bottom.equalTo(cartButton)
-            make.width.equalTo(152 * kScaleWidth)
-        }
-        nuablebuyLabel.snp.makeConstraints { (make) in
-            make.top.bottom.equalTo(cartButton)
-            make.left.equalTo(cartButton.snp.right)
-            make.right.equalToSuperview()
-        }
-        tableView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.bottom.equalTo(bottomBgView.snp.top)
-        }
-        topButton.snp.makeConstraints { (make) in
-            make.right.equalTo(-10)
-            make.size.equalTo(44)
-            make.bottom.equalTo(-70-kSafeTabBarHeight)
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.grouped)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 100
-        tableView.estimatedSectionFooterHeight = 10
-        tableView.estimatedSectionHeaderHeight = 44
-        return tableView
-    }()
-    
-    lazy var productDetailTableViewHeaderView: ProductDetailTableViewHeaderView = {
-        let productDetailTableViewHeaderView = ProductDetailTableViewHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 251+kSafeStatusBarHeight))
-        return productDetailTableViewHeaderView
-    }()
-    
-    private lazy var bottomBgView: UIView = {
-        let bottomBgView = UIView()
-        bottomBgView.isHidden = true
-        bottomBgView.backgroundColor = UIColor.white
-        return bottomBgView
-    }()
-    
-    private lazy var cartButton : UIButton = {
-        let cartButton = UIButton()
-        cartButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let cartButtonClosure = self?.cartButtonClosure {
-                cartButtonClosure()
-            }
-        }).disposed(by: disposeBag)
-        return cartButton
-    }()
-    
-    private lazy var cartImageView: UIImageView = {
-        let cartImageView = UIImageView()
-        cartImageView.image = kImage(name: "tabbar_shopping")
-        return cartImageView
-    }()
-    
-    private lazy var addCartButton : UIButton = {
-        let addCartButton = UIButton(type: UIButton.ButtonType.custom)
-        addCartButton.setTitle("加入购物车", for: UIControl.State.normal)
-        addCartButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        addCartButton.backgroundColor = k404040Color
-        addCartButton.titleLabel?.font = kRegularFont16
-        addCartButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-
-            self?.productDetailSkuView.productDetailSkuViewType = ProductDetailSkuViewType.addCart
-            if self?.productDetailSkuModel != nil {
-                self?.productDetailSkuView.productDetailSkuModel = self?.productDetailSkuModel
-            }
-            self?.productDetailSkuView.productDetailModel = self?.productDetailModel
-            self?.productDetailSkuView.show()
-
-            
-        }).disposed(by: disposeBag)
-        return addCartButton
-    }()
-    
-    private lazy var buyButton : UIButton = {
-        let buyButton = UIButton(type: UIButton.ButtonType.custom)
-        buyButton.setTitle("立即购买", for: UIControl.State.normal)
-        buyButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        buyButton.backgroundColor = kFFA42FColor
-        buyButton.titleLabel?.font = kRegularFont16
-        buyButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.productDetailSkuView.productDetailSkuViewType = ProductDetailSkuViewType.buyNow
-            if self?.productDetailSkuModel != nil {
-                self?.productDetailSkuView.productDetailSkuModel = self?.productDetailSkuModel
-            }
-            self?.productDetailSkuView.productDetailModel = self?.productDetailModel
-            self?.productDetailSkuView.show()
-        }).disposed(by: disposeBag)
-        return buyButton
-    }()
-    
-    private lazy var nuablebuyLabel: UILabel = {
-        let nuablebuyLabel = UILabel()
-        nuablebuyLabel.isUserInteractionEnabled = true
-        nuablebuyLabel.text = "无法购买"
-        nuablebuyLabel.backgroundColor = ke6e6e6Color
-        nuablebuyLabel.font = kRegularFont16
-        nuablebuyLabel.textColor = k333333Color
-        nuablebuyLabel.textAlignment = .center
-        return nuablebuyLabel
-    }()
-    
-    private lazy var topButton : UIButton = {
-        let topButton = UIButton(type: UIButton.ButtonType.custom)
-        topButton.setImage(kImage(name: "product_detail_top"), for: UIControl.State.normal)
-        topButton.isHidden = true
-        topButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.tableView.scrollToTop()
-        }).disposed(by: disposeBag)
-        return topButton
-    }()
-    
-    lazy var productDetailSkuView: ProductDetailSkuView = {
-        let productDetailSkuView = ProductDetailSkuView.init(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: kScreenHeight - 76 - kNavBarTotalHeight))
-        return productDetailSkuView
-    }()
-    
-    lazy var vProperty1: FWPopupViewProperty = {
-        let vProperty1 = FWPopupViewProperty()
-        vProperty1.popupCustomAlignment = .bottomCenter
-        vProperty1.popupAnimationType = .position
-        vProperty1.maskViewColor = UIColor(white: 0, alpha: 0.5)
-        vProperty1.touchWildToHide = "0"
-        vProperty1.animationDuration = 0.2
-        return vProperty1
-    }()
-    
-    func setProductDetailSkuView() {
-        productDetailSkuView.vProperty = vProperty1
-        productDetailSkuView.sureClosure = {
-            [weak self] (productDetailSkuViewType,productDetailSkuModel) in
-            self?.productDetailSkuModel = productDetailSkuModel
-            switch productDetailSkuViewType {
-            case .selectSku:
-                self?.tableView.reloadData()
-                self?.productDetailSkuView.hide()
-                break
-            case .buyNow:
-                self?.productDetailSkuView.hide(popupDidDisappearBlock: { (FWPopupView) in
-                    self?.tableView.reloadData()
-                    if let buyNowClosure = self?.buyNowClosure {
-                        buyNowClosure((self?.productDetailSkuModel)!)
-                    }
-                })
-                break
-            case .addCart:
-                
-                if let addCartClosure = self?.addCartClosure {
-                    addCartClosure((self?.productDetailSkuModel)!)
-                }
-                break
-            }
-        }
-    }
-    
-    typealias LookAllCommentClosure = () -> Void
-    var lookAllCommentClosure : LookAllCommentClosure?
-    
-    typealias AddCartClosure = (ProductDetailSkuModel) -> Void
-    var addCartClosure : AddCartClosure?
-    
-    typealias BuyNowClosure = (ProductDetailSkuModel) -> Void
-    var buyNowClosure : BuyNowClosure?
-    
-    typealias CartButtonClosure = () -> Void
-    var cartButtonClosure : CartButtonClosure?
-    
-    typealias JumpToShopTransClosure = (_ shopName: String,_ shopId : Int) -> Void
-    var jumpToShopTransClosure : JumpToShopTransClosure?
-    
-    typealias JumpToDetailTransClosure = (_ proId: Int,_ shopId : Int) -> Void
-    var jumpToDetailTransClosure : JumpToDetailTransClosure?
-    
-    var productDetailSkuModel : ProductDetailSkuModel?
-    
-    var titles = ["","","商品评价","","热销排行","商品参数","商品详情"]
-    
-    var index : Int? {
-        didSet {
-            if index == 0 {
-                tableView.scrollToTop()
-            }else {
-                let reloadSection = 2 * index!
-                let rect = tableView.rect(forSection: reloadSection)
-                tableView.setContentOffset(CGPoint(x: 0, y: rect.origin.y - kNavBarTotalHeight), animated: true)
-            }
-            
-        }
-    }
-    
-    var productDetailModel : ProductDetailModel? {
-        didSet {
-            tableView.ly_startLoading()
-            if productDetailModel != nil {
-                bottomBgView.isHidden = false
-                topButton.isHidden = false
-                if productDetailModel?.commentNumber != 0 && productDetailModel?.commentNumber != nil {
-                    titles[2] = "商品评价" + "(" + "\(productDetailModel?.commentNumber ?? 0)" + ")"
-                    
-                }else {
-                    titles[2] = "商品评价" + "(" + "0" + ")"
-                }
-                if productDetailModel?.imgs?.isEmpty ?? true {
-                    tableView.tableHeaderView = nil
-                }else {
-                    tableView.ly_hideEmpty()
-                    tableView.tableHeaderView = productDetailTableViewHeaderView
-                    productDetailTableViewHeaderView.productDetailModel = productDetailModel
-                }
-                //是否可以点击购买
-                if productDetailModel?.totalStock == 0 ||   productDetailModel?.upStatus == 0 {
-                    self.nuablebuyLabel.isHidden = false
-                }else {
-                    self.nuablebuyLabel.isHidden = true
-                }
-            }else {
-                bottomBgView.isHidden = true
-                topButton.isHidden = true
-            }
-            tableView.reloadData()
-        }
-    }
-    
-    var productSearchListModel: ProductSearchListModel? {
-        didSet {
-            tableView.reloadData()
-        }
-    }
-    
-    var productCommentListModel :ProductCommentListModel? {
-        didSet {
-            tableView.reloadData()
-        }
-    }
-    
-    var productCartCount : Int = 0 {
-        didSet {
-            if productCartCount == 0 {
-                cartImageView.pp.hiddenBadge()
-            }else {
-                cartImageView.pp.badgeView.backgroundColor = kFE352BColor
-                cartImageView.pp.moveBadge(x: -2, y: 2)
-                cartImageView.pp.addBadge(number: productCartCount)
-            }
-            self.productDetailSkuView.hide()
-        }
-    }
-    var productCartCountModel : ProductCartCountModel? {
-        didSet {
-            if productCartCountModel != nil {
-                if productCartCountModel?.count == 0 {
-                    cartImageView.pp.hiddenBadge()
-                }else {
-                    cartImageView.pp.badgeView.backgroundColor = kFE352BColor
-                    cartImageView.pp.moveBadge(x: -2, y: 2)
-                    cartImageView.pp.addBadge(number: productCartCountModel?.count ?? 0)
-                }
-            }
-            
-        }
-    }
-    
-}
-
-extension ProductDetailView : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        if productDetailModel != nil {
-            return 7
-        }
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        switch section {
-        case 1:
-            
-            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                return 2
-            }
-            
-            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                return 1
-            }
-            
-            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
-                return 1
-            }
-            return 0
-            
-        case 2:
-            if productCommentListModel != nil {
-                return productCommentListModel?.data?.isEmpty ?? true ? 0 :  1
-            }
-            return 0
-            
-        case 4:
-            return productSearchListModel?.data?.isEmpty ?? true ? 0 :  1
-        case 5:
-            return productDetailModel?.parameter?.isEmpty ?? true ? 0 :  productDetailModel?.parameter?.count ?? 0
-        default:
-            return 1
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            let cell = ProductDetailProductInfoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productDetailModel = productDetailModel
-            return cell
-        case 1:
-            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                if indexPath.row == 0 {
-                    let cell = ProcuctDetailSelectSkuTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    if self.productDetailSkuModel != nil {
-                        cell.productDetailSkuModel = self.productDetailSkuModel
-                    }
-                    return cell
-                }else {
-                    let cell = ProductDetailProductLabelTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                    cell.productDetailModel = productDetailModel
-                    cell.frame = tableView.bounds
-                    cell.layoutIfNeeded()
-                    cell.reloadData()
-                    return cell
-                }
-            }
-            
-            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                let cell = ProductDetailProductLabelTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                cell.productDetailModel = productDetailModel
-                cell.frame = tableView.bounds
-                cell.layoutIfNeeded()
-                cell.reloadData()
-                return cell
-            }
-            
-            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
-                let cell = ProcuctDetailSelectSkuTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-                if self.productDetailSkuModel != nil {
-                    cell.productDetailSkuModel = self.productDetailSkuModel
-                }
-                return cell
-            }
-            return UITableViewCell()
-        case 2:
-            let cell = ProductDetailEvaluationTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productCommentModel = productCommentListModel?.data?[indexPath.row]
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
-            return cell
-        case 3:
-            let cell = ProductDetailShopTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productDetailModel = productDetailModel
-            cell.jumpToShopBlock = {
-                [weak self] (shopName, shopId) in
-                if let jumpToShopTransClosure = self?.jumpToShopTransClosure {
-                    jumpToShopTransClosure(shopName, shopId)
-                }
-            }
-            return cell
-        case 4:
-            let cell = ProductDetailHotSellTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productSearchListModel = productSearchListModel
-            cell.jumpToDetailClosure = {
-                [weak self] (proId, shopId) in
-                if let jumpToDetailTransClosure = self?.jumpToDetailTransClosure {
-                    jumpToDetailTransClosure(proId, shopId)
-                }
-            }
-            return cell
-        case 5:
-            let cell = ProductDetailParameterTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productDetailModel = productDetailModel
-            return cell
-        case 6:
-            let cell = ProductDetailDescriptionTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productDetailModel = productDetailModel
-            cell.layer.shouldRasterize = true
-            cell.layer.rasterizationScale = UIScreen.main.scale
-            return cell
-            
-        default:
-            
-            return UITableViewCell()
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        if indexPath.section == 1 {
-            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                if indexPath.row == 0 {
-                    
-                    self.productDetailSkuView.productDetailSkuViewType = ProductDetailSkuViewType.selectSku
-                    if self.productDetailSkuModel != nil {
-                        self.productDetailSkuView.productDetailSkuModel = self.productDetailSkuModel
-                    }
-                    self.productDetailSkuView.productDetailModel = self.productDetailModel
-                    self.productDetailSkuView.show()
-                    
-                }
-            }
-            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
-                
-                self.productDetailSkuView.productDetailSkuViewType = ProductDetailSkuViewType.selectSku
-                if self.productDetailSkuModel != nil {
-                    self.productDetailSkuView.productDetailSkuModel = self.productDetailSkuModel
-                }
-                self.productDetailSkuView.productDetailModel = self.productDetailModel
-                self.productDetailSkuView.show()
-
-            }
-        }
-    }
-    
-    
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        switch indexPath.section {
-        case 1:
-            if !(productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                if indexPath.row == 0 {
-                    return UITableView.automaticDimension
-                }else {
-                    return 65 * kScaleWidth
-                }
-            }
-            
-            if (productDetailModel?.spec?.isEmpty ?? true) && !(productDetailModel?.label?.isEmpty ?? true) {
-                return 65 * kScaleWidth
-            }
-            
-            if !(productDetailModel?.spec?.isEmpty ?? true) && (productDetailModel?.label?.isEmpty ?? true) {
-                return UITableView.automaticDimension
-            }
-            return 0
-        case 4:
-            return 173
-        default:
-            return UITableView.automaticDimension
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        switch section {
-        case 2,4,5,6:
-            return 44
-        default:
-            return 0
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        switch section {
-        case 2,4,5,6:
-            let view = ProductDetailSectionHeader(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 44))
-            view.section = section
-            view.titles = titles
-            view.lookAllCommentClosure = {
-                [weak self] in
-                if let lookAllCommentClosure = self?.lookAllCommentClosure {
-                    lookAllCommentClosure()
-                }
-            }
-            
-            return view
-        default:
-            return nil
-        }
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 10
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-    func scrollViewDidScroll(_ scrollView: UIScrollView) {
-        var offset = scrollView.contentOffset
-        NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ProductDetailView"), object: offset)
-        
-        if (!(scrollView.isTracking || scrollView.isDecelerating)) {
-            //不是用户滚动的,比如setContentOffset等方法,引起的滚动不需要处理。
-            return;
-        }
-        offset.y =  offset.y + kNavBarTotalHeight
-        
-        if  offset.y > 251 + kSafeStatusBarHeight + kSafeTabBarHeight {
-            
-            let indexPath = tableView.indexPathForRow(at: offset)
-            if indexPath != nil {
-                var rect = tableView.rect(forSection: (indexPath?.section)!)
-                
-                if rect.size.height + kNavBarTotalHeight - tableView.frame.size.height < 0 {
-                    
-                    rect.size.height = tableView.frame.size.height - kNavBarTotalHeight - rect.size.height
-                    
-                    tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: rect.size.height, right: 0)
-                }else {
-                    tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
-                }
-                
-                if indexPath!.section % 2 == 0  {
-                    NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ProductDetailViewSection"), object: indexPath!.section)
-                    
-                }
-            }
-        }
-    }
-    
-}

+ 0 - 284
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/ViewController/ProductDetailViewController.swift

@@ -1,284 +0,0 @@
-//
-//  ProductDetailViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/11.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import JXSegmentedView
-
-class ProductDetailViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    deinit {
-        if observe != nil {
-            NotificationCenter.default.removeObserver(observe!)
-        }
-    }
-    weak var observe : NSObjectProtocol?
-    
-    /// 商品Id
-    var productId : Int?
-    /// 店铺Id
-    var shopId : Int?
-    
-    var productDetailModel : ProductDetailModel?
-    
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        self.productGetCartCountApi()
-    }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        self.navigationBar.wr_setLeftButton(image: kImage(name: "nav_back_black_mask")!)
-        navigationBar.wr_setBackgroundAlpha(alpha: 0)
-        view.addSubview(productDetailView)
-        view.insertSubview(navigationBar, aboveSubview: productDetailView)
-        
-    }
-    
-    override func setupLayouts() {
-        productDetailView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    override func setupData() {
-        productDetailView.tableView.addHeader(withBeginRefresh: true, animation: false) {
-            [weak self] (page) in
-            self?.productDetailApi()
-            self?.productListApi()
-            self?.productCommentListApi()
-        }
-        
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("ProductDetailView"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
-            let offset = notification.object as! CGPoint
-            if offset.y <= 0  {
-                self?.segmentedView.isHidden = true
-                self?.navigationBar.wr_setBackgroundAlpha(alpha: 0)
-                self?.navigationBar.wr_setLeftButton(image: kImage(name: "nav_back_black_mask")!)
-            }else {
-                self?.segmentedView.isHidden = false
-                self?.navigationBar.wr_setBackgroundAlpha(alpha: 1)
-                self?.navigationBar.wr_setLeftButton(image: kImage(name: "navbar_back_black")!)
-            }
-        }
-        
-        observe = NotificationCenter.default.addObserver(forName: NSNotification.Name("ProductDetailViewSection"), object: nil, queue: OperationQueue.main) {[weak self] (notification) in
-            let item = notification.object as! Int
-            if item == 0 {
-                self?.segmentedView.selectItemAt(index: item)
-            }else {
-                self?.segmentedView.selectItemAt(index: item/2)
-            }
-        }
-        
-        productDetailView.lookAllCommentClosure = {
-            [weak self] in
-            let vc = ProductAllCommentViewController()
-            vc.productId = self?.productId ?? 0
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        productDetailView.addCartClosure = {
-            [weak self] (productDetailSkuModel) in
-            self?.productDetailAddCartApi(productDetailSkuModel: productDetailSkuModel)
-        }
-        productDetailView.buyNowClosure = {
-            [weak self] (productDetailSkuModel) in
-            let vc = ShoppingCartPayOrderController()
-            vc.shoppingCartPayOrderVCType = .productDetail
-            
-            var cartProductListModels = Array<CartProductListModel>()
-            let cartProductListModel = CartProductListModel()
-            cartProductListModel.shopId = self?.productDetailModel?.shopId
-            cartProductListModel.shopName = self?.productDetailModel?.shopName
-            
-            var productList = Array<ProductModel>()
-            let productModel = ProductModel()
-            productModel.productImg = self?.productDetailModel?.img
-            productModel.productName = self?.productDetailModel?.name
-            productModel.skuId = productDetailSkuModel.id
-            productModel.skuName = productDetailSkuModel.skuName
-            productModel.amount = productDetailSkuModel.productCount
-            productModel.skuPrice = productDetailSkuModel.price
-            productModel.receiveTime = self?.productDetailModel?.receiveTime
-            productList.append(productModel)
-            
-            cartProductListModel.productList = productList
-            cartProductListModels.append(cartProductListModel)
-            
-            vc.selListModelArr = cartProductListModels
-            vc.totalProductPrice = (productDetailSkuModel.price ?? 0) * (productDetailSkuModel.productCount ?? 0)
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        productDetailView.cartButtonClosure = {
-            [weak self] in
-            let vc = ShoppingCartViewController()
-            vc.shoppingCartVCType = .push
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-    }
-    
-    
-    /// 获取商品详情
-    private func productDetailApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productDetailApi(id: productId ?? 0) {
-            [weak self] (productDetailModel) -> (Void) in
-            self?.productDetailModel = productDetailModel as? ProductDetailModel
-            self?.productDetailView.productDetailModel = productDetailModel as? ProductDetailModel
-            self?.navigationBar.addSubview((self?.segmentedView)!)
-            self?.segmentedView.snp.makeConstraints { (make) in
-                make.top.equalTo(kSafeStatusBarHeight)
-                make.left.equalTo(50)
-                make.right.equalTo(-50)
-                make.bottom.equalToSuperview()
-            }
-        }
-    }
-    
-    /// 获取商家商品列表
-    private func productListApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productListApi(page: 1, shopId: shopId ?? 0,desc: 1, fieldOrder: 1) {
-            [weak self] (productListModel) -> (Void) in
-            let productSearchListModel = productListModel as? ProductSearchListModel
-            self?.productDetailView.productSearchListModel = productSearchListModel
-        }
-    }
-    
-    
-    /// 获取评价列表
-    func productCommentListApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productCommentListApi(productId: productId ?? 0) {
-            [weak self] (productCommentListModel) -> (Void) in
-            let productCommentListModel = productCommentListModel as? ProductCommentListModel
-            self?.productDetailView.productCommentListModel = productCommentListModel
-            
-        }
-    }
-    
-    
-    /// 加入购物车
-    ///
-    /// - Parameter productDetailSkuModel: 选中的sku
-    func productDetailAddCartApi(productDetailSkuModel:ProductDetailSkuModel) {
-        SwiftMoyaNetWorkServiceProduct.shared().productDetailAddCartApi(productDetailModel: self.productDetailModel!, productDetailSkuModel: productDetailSkuModel) {
-            [weak self] (cartAmountModel) -> (Void) in
-            self?.productGetCartCountApi()
-        }
-    }
-    
-    var productCartCountModel :ProductCartCountModel?
-    
-    var isOnlyOne : Bool = false
-    
-    /// 获取购物车数量
-    func productGetCartCountApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productGetCartCountApi {
-            [weak self] (productCartCountModel) -> (Void) in
-            self?.productDetailView.productCartCountModel = productCartCountModel as? ProductCartCountModel
-            if self?.isOnlyOne ?? false {
-                self?.productDetailView.productCartCount = (productCartCountModel as? ProductCartCountModel)?.count ?? 0
-            }else {
-                self?.isOnlyOne = true
-            }
-        }
-    }
-    
-    lazy var productDetailView: ProductDetailView = {
-        let productDetailView = ProductDetailView()
-        productDetailView.jumpToShopTransClosure = {
-            [weak self] (shopName, shopId) in
-            let vc = ShopViewController()
-            vc.navigationBar.title = shopName
-            vc.shopId = shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        productDetailView.jumpToDetailTransClosure = {
-            [weak self] (proId, shopId) in
-            let vc = ProductDetailViewController()
-            vc.productId = proId
-            vc.shopId = shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        return productDetailView
-    }()
-    
-    //1.初始化JXSegmentedView
-    private lazy var segmentedView: JXSegmentedView = {
-        let segmentedView = JXSegmentedView()
-        segmentedView.delegate = self
-        segmentedView.indicators = [indicator]
-        segmentedView.dataSource = segmentedDataSource
-        segmentedView.isHidden = true
-        return segmentedView
-    }()
-    
-    //2.初始化dataSource
-    private lazy var segmentedDataSource: JXSegmentedTitleDataSource = {
-        let segmentedDataSource = JXSegmentedTitleDataSource()
-        segmentedDataSource.titles = ["商品","评价","热销","详情"]
-        segmentedDataSource.isTitleColorGradientEnabled = true
-        segmentedDataSource.isItemSpacingAverageEnabled = true
-        segmentedDataSource.titleNormalColor = k333333Color
-        segmentedDataSource.titleSelectedColor = k333333Color
-        segmentedDataSource.titleNormalFont = kMediumFont18!
-        segmentedDataSource.titleSelectedFont = kMediumFont18
-        
-        //reloadData(selectedIndex:)方法一定要调用,方法内部会刷新数据源数组
-        segmentedDataSource.reloadData(selectedIndex: 0)
-        return segmentedDataSource
-    }()
-    
-    //3.初始化指示器indicator
-    private lazy var indicator: JXSegmentedIndicatorLineView = {
-        let indicator = JXSegmentedIndicatorLineView()
-        indicator.indicatorColor = kFFA42FColor
-        indicator.indicatorHeight = 4
-        indicator.indicatorWidth = 34
-        return indicator
-    }()
-
-}
-
-extension ProductDetailViewController : JXSegmentedViewDelegate {
-    //点击选中或者滚动选中都会调用该方法。适用于只关心选中事件,而不关心具体是点击还是滚动选中的情况。
-    func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
-        
-    }
-    
-    // 点击选中的情况才会调用该方法
-    func segmentedView(_ segmentedView: JXSegmentedView, didClickSelectedItemAt index: Int) {
-        if index == 0 {
-            self.segmentedView.isHidden = true
-            self.navigationBar.wr_setBackgroundAlpha(alpha: 0)
-            self.navigationBar.wr_setLeftButton(image: kImage(name: "nav_back_black_mask")!)
-        }
-
-        productDetailView.index = index
-    }
-    
-    // 滚动选中的情况才会调用该方法
-    func segmentedView(_ segmentedView: JXSegmentedView, didScrollSelectedItemAt index: Int) {
-        
-    }
-    
-    // 正在滚动中的回调
-    func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
-    }
-    
-    /// 是否允许点击选中目标index的item
-    func segmentedView(_ segmentedView: JXSegmentedView, canClickItemAt index: Int) -> Bool {
-        return true
-    }
-}

+ 0 - 165
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductDetailHotSell/ProductDetailHotSellCollectionViewCell.swift

@@ -1,165 +0,0 @@
-//
-//  ProductDetailHotSellCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import Kingfisher
-import RxSwift
-
-class ProductDetailHotSellCollectionViewCell: UICollectionViewCell {
-    let disposeBag = DisposeBag()
-    
-    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-    
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductDetailHotSellCollectionViewCell {
-        let ID = "ProductDetailHotSellCollectionViewCell"
-        collectionView.register(ProductDetailHotSellCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductDetailHotSellCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductDetailHotSellCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellPriceLabel)
-//        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(5)
-            make.centerX.equalToSuperview()
-            make.size.equalTo(80)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(iconImagView.snp.bottom).offset(5)
-            make.left.equalTo(5)
-            make.right.equalTo(-5)
-            make.height.equalTo(21)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(2)
-            make.right.left.equalTo(titleLabel)
-            make.height.equalTo(17)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(-6)
-            make.height.equalTo(14)
-
-        }
-//        markPriceLabel.snp.makeConstraints { (make) in
-//            make.left.equalTo(sellPriceLabel.snp.right).offset(3)
-//            make.bottom.equalTo(sellPriceLabel)
-//            make.height.equalTo(11)
-//        }
-        plusButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(-6)
-            make.right.equalTo(-6)
-            make.size.equalTo(22)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kRegularFont12
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.text = "¥11.8"
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kBoldFont14
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.text = "¥24.4"
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kRegularFont11
-        markPriceLabel.textAlignment = .left
-        let attrString = NSMutableAttributedString(string: "¥24.4")
-        attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-        markPriceLabel.attributedText = attrString
-        markPriceLabel.adjustsFontSizeToFitWidth = true
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productSearchModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productSearchModel : ProductSearchModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productSearchModel?.saleName
-            detailTitleLabel.text = productSearchModel?.subtitle
-            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
-            if productSearchModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-    
-}

+ 0 - 196
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift

@@ -1,196 +0,0 @@
-//
-//  ShoppingMallBarChartCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductMallBarChartCollectionViewCell: UICollectionViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias ShopingCarClosure = (_ productModel: ProductModel?,_ indexPath:IndexPath?) -> Void
-    var shopingCarClosure : ShopingCarClosure?
-    
-    typealias PlusClosure = (_ productModel: ProductModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductMallBarChartCollectionViewCell {
-        let ID = "ProductMallBarChartCollectionViewCell"
-        collectionView.register(ProductMallBarChartCollectionViewCell .self, forCellWithReuseIdentifier: ID)
-        let cell : ProductMallBarChartCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductMallBarChartCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        cornerRadius = 4
-        masksToBounds = true
-        setupViews()
-        setupLayouts()
-        
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(iconImagView)
-        addSubview(newLabel)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(150 * kScaleWidth)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(10)
-            make.top.equalTo(iconImagView.snp.bottom).offset(10)
-            make.right.equalTo(-10)
-            make.height.equalTo(23)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(4)
-            make.right.left.equalTo(titleLabel)
-            make.height.equalTo(13)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(detailTitleLabel.snp.bottom).offset(15)
-            make.left.right.equalTo(detailTitleLabel)
-            make.height.equalTo(13)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(-10)
-            make.height.equalTo(19)
-        }
-        markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(5)
-            make.centerY.equalTo(sellPriceLabel)
-            make.height.equalTo(13)
-        }
-        plusButton.snp.makeConstraints { (make) in
-            make.right.equalTo(-10)
-            make.bottom.equalTo(-10)
-            make.size.equalTo(25)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    lazy var newLabel: UILabel = {
-        let newLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 50, height: 18))
-        newLabel.backgroundColor = kFE352BColor
-        newLabel.text = "新品上架"
-        newLabel.textColor = kffffffColor
-        newLabel.font = kMediumFont11
-        newLabel.textAlignment = .center
-        newLabel.configRectCorner(corner: [.bottomRight], radii: CGSize(width: 4, height: 4))
-        return newLabel
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont12
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()
-        sellNumberLabel.textColor = k333333Color
-        sellNumberLabel.font = kScaleRegularFont11
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kBoldFont15
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kRegularFont13
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.isHidden = true
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productModel : ProductModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productModel?.bigImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productModel?.saleName
-            detailTitleLabel.text = productModel?.subtitle
-            sellNumberLabel.text = "已售\(productModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
-            let attributeString = NSMutableAttributedString(string:priceConversion(price: productModel?.originPrice ?? 0))
-            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            markPriceLabel.attributedText = attributeString
-           
-            if productModel?.stock == 0 {
-                plusButton.isHidden = true
-            }else {
-                plusButton.isHidden = false
-            }
-
-        }
-    }
-
-}

+ 0 - 173
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallRightSideleftPicture/ProductRightSideleftPictureCollectionViewCell.swift

@@ -1,173 +0,0 @@
-//
-//  ProductRightSideleftPictureCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductRightSideleftPictureCollectionViewCell: UICollectionViewCell {
-    let disposeBag = DisposeBag()
-    typealias PlusClosure = (_ productModel: ProductModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductRightSideleftPictureCollectionViewCell {
-        let ID = "ProductRightSideleftPictureCollectionViewCell"
-        collectionView.register(ProductRightSideleftPictureCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductRightSideleftPictureCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductRightSideleftPictureCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(10)
-            make.left.equalTo(10)
-            make.size.equalTo(120)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImagView.snp.right).offset(10)
-            make.top.equalTo(iconImagView)
-            make.right.equalTo(-10)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(10)
-            make.right.left.equalTo(titleLabel)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(detailTitleLabel.snp.bottom).offset(10)
-            make.left.right.equalTo(detailTitleLabel)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(iconImagView)
-        }
-        markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(5)
-            make.bottom.equalTo(iconImagView)
-        }
-        plusButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(iconImagView)
-            make.right.equalTo(-10)
-            make.size.equalTo(25)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.text = "海南冰糖心木瓜 1个装"
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 2
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.text = "酸甜可口营养无限"
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont12
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()
-        sellNumberLabel.text = "已售2400件"
-        sellNumberLabel.textColor = k333333Color
-        sellNumberLabel.font = kScaleRegularFont11
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.text = "¥11.8"
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kScaleBoldFont15
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.text = "¥24.4"
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kScaleRegularFont13
-        let attrString = NSMutableAttributedString(string: "¥24.4")
-        attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-        markPriceLabel.attributedText = attrString
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productModel : ProductModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLThumbnailsImage(name: productModel?.img ?? "default_pic", size: kSize120x120Image), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productModel?.saleName
-            detailTitleLabel.text = productModel?.subtitle
-            sellNumberLabel.text = "已售\(productModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
-            let attributeString = NSMutableAttributedString(string:priceConversion(price: productModel?.originPrice ?? 0))
-            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            markPriceLabel.attributedText = attributeString
-            if productModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-    
-}

+ 0 - 175
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallSlidingLeftRight/ProductSlidingLeftRightCollectionViewCell.swift

@@ -1,175 +0,0 @@
-//
-//  ProductSlidingLeftRightCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductSlidingLeftRightCollectionViewCell: UICollectionViewCell {
-    let disposeBag = DisposeBag()
-    
-    typealias PlusClosure = (_ productModel: ProductModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductSlidingLeftRightCollectionViewCell {
-        let ID = "ProductSlidingLeftRightCollectionViewCell"
-        collectionView.register(ProductSlidingLeftRightCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductSlidingLeftRightCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductSlidingLeftRightCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellPriceLabel)
-//        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(120)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(iconImagView.snp.bottom).offset(4)
-            make.left.equalTo(5)
-            make.right.equalTo(-5)
-            make.height.equalTo(15)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(5)
-            make.right.left.equalTo(titleLabel)
-            make.height.equalTo(12)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(5)
-        }
-//        markPriceLabel.snp.makeConstraints { (make) in
-//            make.left.equalTo(sellPriceLabel.snp.right).offset(3)
-//            make.bottom.equalTo(5)
-//        }
-        plusButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(5)
-            make.right.equalTo(-5)
-            make.size.equalTo(22)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont12
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.text = "¥11.8"
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kScaleBoldFont14
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.text = "¥24.4"
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kScaleRegularFont11
-        markPriceLabel.textAlignment = .left
-        let attrString = NSMutableAttributedString(string: "¥24.4")
-        attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-        markPriceLabel.attributedText = attrString
-        markPriceLabel.adjustsFontSizeToFitWidth = true
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productModel : ProductModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productModel?.saleName
-            detailTitleLabel.text = productModel?.subtitle
-            sellPriceLabel.text = priceConversion(price: productModel?.price ?? 0)
-            if productModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-    
-    var productSearchModel : ProductSearchModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productSearchModel?.saleName
-            detailTitleLabel.text = productSearchModel?.subtitle
-            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
-            if productSearchModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-    
-}

+ 0 - 162
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductSlidingTopBottom/ProductSlidingTopBottomCollectionViewCell.swift

@@ -1,162 +0,0 @@
-//
-//  ProductSlidingTopBottomCollectionViewCell.swift
-//  RainbowPlanet
-//
-//  Created by Christopher on 2019/5/8.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductSlidingTopBottomCollectionViewCell: UICollectionViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
-     var plusClosure : PlusClosure?
-    
-    class func cellWith(collectionView:UICollectionView,indexPath:IndexPath) -> ProductSlidingTopBottomCollectionViewCell {
-        let ID = "ProductSlidingTopBottomCollectionViewCell"
-        collectionView.register(ProductSlidingTopBottomCollectionViewCell.self, forCellWithReuseIdentifier: ID)
-        let cell : ProductSlidingTopBottomCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: ID, for: indexPath) as! ProductSlidingTopBottomCollectionViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    //MARK: - indexPath
-    var indexPath: IndexPath?{
-        didSet {
-            
-        }
-    }
-    //MARK: - 初始化
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        backgroundColor = UIColor.white
-        cornerRadius = 4
-        masksToBounds = true
-        setupViews()
-        setupLayouts()
-        
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MRAK: - 设置View
-    private func setupViews() {
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.left.right.equalToSuperview()
-            make.height.equalTo(150 * kScaleWidth)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(10)
-            make.top.equalTo(iconImagView.snp.bottom).offset(10)
-            make.right.equalTo(-10)
-            make.height.equalTo(23)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(15)
-            make.left.right.equalTo(titleLabel)
-            make.height.equalTo(13)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(-10)
-            make.height.equalTo(19)
-        }
-        markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(5)
-            make.bottom.equalTo(-10)
-            make.height.equalTo(13)
-        }
-        plusButton.snp.makeConstraints { (make) in
-            make.right.equalTo(-10)
-            make.bottom.equalTo(-10)
-            make.size.equalTo(25)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 1
-        return titleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()        
-        sellNumberLabel.textColor = k999999Color
-        sellNumberLabel.font = kScaleRegularFont12
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kScaleBoldFont15
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kScaleRegularFont13
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productSearchModel,self?.indexPath)
-            }
-
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productSearchModel: ProductSearchModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productSearchModel?.saleName
-            sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
-            let attrString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
-            attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            markPriceLabel.attributedText = attrString
-            if productSearchModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-    
-}

+ 0 - 43
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorBannerView.swift

@@ -1,43 +0,0 @@
-//
-//  ProductFloorBannerView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorBannerView: BaseView {
-    
-    override func setupViews() {
-        backgroundColor = kffffffColor
-        addSubview(bannerButton)
-    }
-    
-    override func setupLayouts() {
-        bannerButton.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    private lazy var bannerButton: UIButton = {
-        let bannerButton = UIButton(type: UIButton.ButtonType.custom)
-        bannerButton.setBackgroundImage(kImage(name: "default_pic"), for: UIControl.State.normal)
-        bannerButton.cornerRadius = 4
-        bannerButton.masksToBounds = true
-        bannerButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ShoppingMallFloor"), object: self?.cmsRuleModel)
-
-        }).disposed(by: disposeBag)
-        return bannerButton
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            bannerButton.kf.setBackgroundImage(with: kURLImage(name: cmsRuleModel?.url ?? "default_pic"), for: UIControl.State.normal, placeholder: kImage(name: "default_pic"))
-        }
-    }
-
-}

+ 0 - 166
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorCenterHeaderCollectionReusableView.swift

@@ -1,166 +0,0 @@
-//
-//  ProductFloorCenterHeaderCollectionReusableView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/8.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorCenterHeaderCollectionReusableView: UICollectionReusableView {
-    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ProductFloorCenterHeaderCollectionReusableView {
-        let ID = "ProductFloorCenterHeaderCollectionReusableView"
-        collectionView.register(ProductFloorCenterHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
-        let headerView : ProductFloorCenterHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorCenterHeaderCollectionReusableView
-        headerView.indexPath = indexPath
-        return headerView
-    }
-    
-    var indexPath : IndexPath? {
-        didSet {
-            
-        }
-    }
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置View
-    private func setupViews() {
-        backgroundColor = UIColor.clear
-        addSubview(bgView)
-        bgView.addSubview(floorTitleView)
-        bgView.addSubview(floorBannerView)
-        
-    }
-    
-    private func setupLayouts() {
-        bgView.snp.makeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.left.equalTo(14 * kScaleWidth)
-            make.right.equalTo(-14 * kScaleWidth)
-        }
-        floorTitleView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview()
-            make.right.equalTo(-14 * kScaleWidth)
-            make.left.equalTo(14 * kScaleWidth)
-            make.height.equalTo(63)
-        }
-        floorBannerView.snp.makeConstraints { (make) in
-            make.top.equalTo(63)
-            make.right.equalTo(-14 * kScaleWidth)
-            make.left.equalTo(14 * kScaleWidth)
-            make.height.equalTo(90 * kScaleWidth)
-        }
-    }
-    
-    lazy var floorTitleView: ProductFloorCenterTitleView = {
-        let floorTitleView = ProductFloorCenterTitleView()
-        return floorTitleView
-    }()
-    
-    lazy var floorBannerView: ProductFloorBannerView = {
-        let floorBannerView = ProductFloorBannerView()
-        floorBannerView.cornerRadius = 4
-        floorBannerView.masksToBounds = true
-        return floorBannerView
-    }()
-    
-    private lazy var bgView: UIView = {
-        let bgView = UIView()
-        bgView.backgroundColor = UIColor.clear
-        return bgView
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            floorLayout()
-            floorIsHidden()
-            floorTitleView.cmsRuleModel = cmsRuleModel?.rule
-            floorBannerView.cmsRuleModel = cmsRuleModel?.rule
-        }
-    }
-    
-    private func floorLayout() {
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(63)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalTo(0)
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        }else {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(63)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            
-            floorBannerView.snp.remakeConstraints { (make) in
-                make.top.equalTo(63)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        }
-    }
-    
-    private func floorIsHidden() {
-        
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = false
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = true
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = true
-        }else {
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = false
-        }
-    }
-    
-}

+ 0 - 37
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorCenterTitleView.swift

@@ -1,37 +0,0 @@
-//
-//  FloorTitleCenterBaseView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorCenterTitleView: BaseView {
-    
-    override func setupViews() {
-        addSubview(titleLabel)
-    }
-    
-    override func setupLayouts() {
-        titleLabel.snp.makeConstraints { (make) in
-            make.center.equalToSuperview()
-            make.height.equalTo(25)
-        }
-    }
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kMediumFont18
-        titleLabel.text = "今日推荐"
-        return titleLabel
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            titleLabel.text = cmsRuleModel?.title
-        }
-    }
-}

+ 0 - 162
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorFullLeftHeaderCollectionReusableView.swift

@@ -1,162 +0,0 @@
-//
-//  ProductFloorFullLeftHeaderCollectionReusableView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/9.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorFullLeftHeaderCollectionReusableView: UICollectionReusableView {
-    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ProductFloorFullLeftHeaderCollectionReusableView {
-        let ID = "ProductFloorFullLeftHeaderCollectionReusableView"
-        collectionView.register(ProductFloorFullLeftHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
-        let headerView : ProductFloorFullLeftHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorFullLeftHeaderCollectionReusableView
-        headerView.indexPath = indexPath
-        return headerView
-    }
-    
-    var indexPath : IndexPath? {
-        didSet {
-            
-        }
-    }
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置View
-    private func setupViews() {
-        backgroundColor = UIColor.clear
-        addSubview(bgView)
-        bgView.addSubview(floorTitleView)
-        bgView.addSubview(floorBannerView)
-    }
-    
-    private func setupLayouts() {
-        bgView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-
-        floorTitleView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview()
-            make.height.equalTo(50)
-            make.left.equalToSuperview().offset(14 * kScaleWidth)
-            make.right.equalToSuperview().offset(-14 * kScaleWidth)
-        }
-        floorBannerView.snp.makeConstraints { (make) in
-            make.top.equalTo(50)
-            make.left.equalTo(14 * kScaleWidth)
-            make.right.equalTo(-14 * kScaleWidth)
-            make.height.equalTo(90 * kScaleWidth)
-        }
-    }
-    
-    private lazy var floorTitleView: ProductFloorTitleView = {
-        let floorTitleView = ProductFloorTitleView()
-        return floorTitleView
-    }()
-    
-    private lazy var floorBannerView: ProductFloorBannerView = {
-        let floorBannerView = ProductFloorBannerView()
-        return floorBannerView
-    }()
-    
-    private lazy var bgView: UIView = {
-        let bgView = UIView()
-        bgView.backgroundColor = UIColor.white
-        return bgView
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            floorLayout()
-            floorIsHidden()
-            floorTitleView.cmsRuleModel = cmsRuleModel?.rule
-            floorBannerView.cmsRuleModel = cmsRuleModel?.rule
-        }
-    }
-    
-    private func floorLayout() {
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.left.equalToSuperview().offset(14 * kScaleWidth)
-                make.right.equalToSuperview().offset(-14 * kScaleWidth)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(50)
-                make.left.equalToSuperview().offset(14 * kScaleWidth)
-                make.right.equalToSuperview().offset(-14 * kScaleWidth)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalTo(0)
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        }else {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(50)
-                make.left.equalToSuperview().offset(14 * kScaleWidth)
-                make.right.equalToSuperview().offset(-14 * kScaleWidth)
-            }
-            
-            floorBannerView.snp.remakeConstraints { (make) in
-                make.top.equalTo(50)
-                make.left.equalToSuperview().offset(14 * kScaleWidth)
-                make.right.equalToSuperview().offset(-14 * kScaleWidth)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        }
-    }
-    
-    private func floorIsHidden() {
-        
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = false
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = true
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = true
-        }else {
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = false
-        }
-    }
-
-}

+ 0 - 171
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorLeftHeaderCollectionReusableView.swift

@@ -1,171 +0,0 @@
-//
-//  ProductFloorLeftHeaderCollectionReusableView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/8.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorLeftHeaderCollectionReusableView: UICollectionReusableView {
-    class func headerWith(collectionView:UICollectionView,kind: String,indexPath: IndexPath) -> ProductFloorLeftHeaderCollectionReusableView {
-        let ID = "ProductFloorLeftHeaderCollectionReusableView"
-        collectionView.register(ProductFloorLeftHeaderCollectionReusableView.self, forSupplementaryViewOfKind: kind, withReuseIdentifier: ID)
-        let headerView : ProductFloorLeftHeaderCollectionReusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: ID, for: indexPath) as! ProductFloorLeftHeaderCollectionReusableView
-        headerView.indexPath = indexPath
-        return headerView
-    }
-    
-    var indexPath : IndexPath? {
-        didSet {
-            
-        }
-    }
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    //MARK: - 设置View
-    private func setupViews() {
-        backgroundColor = UIColor.clear
-        addSubview(bgView)
-        bgView.addSubview(floorTitleView)
-        bgView.addSubview(floorBannerView)
-    }
-    
-    private func setupLayouts() {
-        bgView.snp.makeConstraints { (make) in
-            make.top.bottom.equalToSuperview()
-            make.left.equalTo(14 * kScaleWidth)
-            make.right.equalTo(-14 * kScaleWidth)
-        }
-        floorTitleView.snp.makeConstraints { (make) in
-            make.top.equalToSuperview()
-            make.height.equalTo(50)
-            make.right.equalTo(0)
-            make.left.equalTo(0)
-        }
-        floorBannerView.snp.makeConstraints { (make) in
-            make.top.equalTo(50)
-            make.right.equalTo(-5 * kScaleWidth)
-            make.left.equalTo(5 * kScaleWidth)
-            make.height.equalTo(90 * kScaleWidth)
-        }
-    }
-    
-    private lazy var floorTitleView: ProductFloorTitleView = {
-        let floorTitleView = ProductFloorTitleView()
-        return floorTitleView
-    }()
-    
-    private lazy var floorBannerView: ProductFloorBannerView = {
-        let floorBannerView = ProductFloorBannerView()
-        return floorBannerView
-    }()
-    
-    lazy var bgView: UIView = {
-        let bgView = UIView()
-        bgView.backgroundColor = UIColor.white
-        let shapeLayer = CAShapeLayer()
-        bgView.layer.mask = nil
-        let rect = CGRect(x: 0, y: 0, width: kScaleWidth * 347, height: 50 + kScaleWidth * 90)
-        let bezierPath = UIBezierPath(roundedRect: rect,
-                                      byRoundingCorners: [.topLeft,.topRight],
-                                      cornerRadii: CGSize(width: 4,height: 4))
-        shapeLayer.path = bezierPath.cgPath
-        bgView.layer.mask = shapeLayer
-        return bgView
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            floorLayout()
-            floorIsHidden()
-            floorTitleView.cmsRuleModel = cmsRuleModel?.rule
-            floorBannerView.cmsRuleModel = cmsRuleModel?.rule
-
-        }
-    }
-    
-    private func floorLayout() {
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(50)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalTo(0)
-                make.height.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            floorBannerView.snp.makeConstraints { (make) in
-                make.top.equalTo(0)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(0)
-            }
-        }else {
-            floorTitleView.snp.remakeConstraints { (make) in
-                make.top.equalToSuperview()
-                make.height.equalTo(50)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-            }
-            
-            floorBannerView.snp.remakeConstraints { (make) in
-                make.top.equalTo(50)
-                make.right.equalTo(0)
-                make.left.equalTo(0)
-                make.height.equalTo(90 * kScaleWidth)
-            }
-        }
-    }
-    
-    private func floorIsHidden() {
-
-        if cmsRuleModel?.rule?.title == "" && cmsRuleModel?.rule?.url != "" {
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = false
-        } else if  cmsRuleModel?.rule?.title != "" && cmsRuleModel?.rule?.url == ""{
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = true
-        } else if cmsRuleModel?.rule?.url == "" && cmsRuleModel?.rule?.title == ""{
-            floorTitleView.isHidden = true
-            floorBannerView.isHidden = true
-        }else {
-            floorTitleView.isHidden = false
-            floorBannerView.isHidden = false
-        }
-    }
-}

+ 0 - 54
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/ProductCollectionReusableView/ProductFloorTitleView.swift

@@ -1,54 +0,0 @@
-//
-//  ProductFloorTitleView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/7.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-
-class ProductFloorTitleView: BaseView {
-    
-    override func setupViews() {
-        self.backgroundColor = kffffffColor
-        addSubview(lineLabel)
-        addSubview(titleLabel)
-    }
-    
-    override func setupLayouts() {
-        lineLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.width.equalTo(4)
-            make.height.equalTo(15)
-            make.left.equalTo(10)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.centerY.equalToSuperview()
-            make.height.equalTo(25)
-            make.left.equalTo(lineLabel.snp.right).offset(10)
-        }
-        
-    }
-    
-    private lazy var lineLabel: UILabel = {
-        let lineLabel = UILabel()
-        lineLabel.backgroundColor = kff724fColor
-        return lineLabel
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kMediumFont18
-        titleLabel.text = "今日推荐"
-        return titleLabel
-    }()
-    
-    var cmsRuleModel: CMSRuleModel? {
-        didSet {
-            titleLabel.text = cmsRuleModel?.title
-        }
-    }
-    
-}

+ 0 - 182
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift

@@ -1,182 +0,0 @@
-//
-//  ProductHBigTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/4/23.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductHBigTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    override var frame: CGRect {
-        get {
-            return super.frame
-        }
-        set {
-            var frame = newValue
-            frame.origin.x += 14
-            frame.size.width -= 14 * 2
-            super.frame = frame
-        }
-    }
-    
-    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHBigTableViewCell {
-        let ID = "ProductHBigTableViewCell"
-        tableView.register(ProductHBigTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductHBigTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductHBigTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(10)
-            make.left.equalTo(10)
-            make.size.equalTo(120)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImagView.snp.right).offset(10)
-            make.top.equalTo(iconImagView)
-            make.right.equalTo(-10)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(10)
-            make.right.left.equalTo(titleLabel)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(detailTitleLabel.snp.bottom).offset(10)
-            make.left.right.equalTo(detailTitleLabel)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(iconImagView)
-        }
-        markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(5)
-            make.bottom.equalTo(iconImagView)
-        }
-        plusButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(iconImagView)
-            make.right.equalToSuperview().offset(-10)
-            make.size.equalTo(25)
-        }
-
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "default_pic")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont18
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 2
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont13
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()
-        sellNumberLabel.textColor = k333333Color
-        sellNumberLabel.font = kScaleRegularFont12
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kScaleBoldFont20
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.font = kScaleRegularFont13
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.isHidden = true
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productSearchModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productSearchModel: ProductSearchModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productSearchModel?.saleName
-            detailTitleLabel.text = productSearchModel?.subtitle
-            sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            
-            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)
-            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
-            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            markPriceLabel.attributedText = attributeString
-            markPriceLabel.textColor = kbbbbbbColor
-            if productSearchModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-
-}

+ 0 - 170
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift

@@ -1,170 +0,0 @@
-//
-//  ProductHSmallTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/5.
-//  Copyright © 2019 南鑫林. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ProductHSmallTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias PlusClosure = (_ productSearchModel: ProductSearchModel?,_ indexPath:IndexPath?) -> Void
-    var plusClosure : PlusClosure?
-
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ProductHSmallTableViewCell {
-        let ID = "ProductHSmallTableViewCell"
-        tableView.register(ProductHSmallTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ProductHSmallTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ProductHSmallTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(iconImagView)
-        addSubview(titleLabel)
-        addSubview(detailTitleLabel)
-        addSubview(sellNumberLabel)
-        addSubview(sellPriceLabel)
-        addSubview(markPriceLabel)
-        addSubview(plusButton)
-    }
-    
-    private func setupLayouts() {
-        iconImagView.snp.makeConstraints { (make) in
-            make.top.equalTo(6)
-            make.left.equalTo(6)
-            make.size.equalTo(94)
-        }
-        titleLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(iconImagView.snp.right).offset(8)
-            make.top.equalTo(iconImagView)
-            make.right.equalTo(-16)
-        }
-        detailTitleLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(titleLabel.snp.bottom).offset(4)
-            make.right.left.equalTo(titleLabel)
-        }
-        sellNumberLabel.snp.makeConstraints { (make) in
-            make.top.equalTo(detailTitleLabel.snp.bottom).offset(4)
-            make.left.right.equalTo(detailTitleLabel)
-        }
-        sellPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(titleLabel)
-            make.bottom.equalTo(iconImagView)
-        }
-        markPriceLabel.snp.remakeConstraints { (make) in
-            make.left.equalTo(sellPriceLabel.snp.right).offset(2)
-            make.bottom.equalTo(iconImagView)
-        }
-        plusButton.snp.makeConstraints { (make) in
-            make.bottom.equalTo(iconImagView)
-            make.right.equalToSuperview().offset(-10)
-            make.size.equalTo(25)
-        }
-        
-    }
-    
-    private lazy var iconImagView: UIImageView = {
-        let iconImagView = UIImageView()
-        iconImagView.contentMode = .scaleAspectFill
-        iconImagView.masksToBounds = true
-        iconImagView.image = kImage(name: "iconImagView")
-        return iconImagView
-    }()
-    
-    private lazy var titleLabel: UILabel = {
-        let titleLabel = UILabel()
-        titleLabel.textColor = k333333Color
-        titleLabel.font = kScaleMediumFont15
-        titleLabel.textAlignment = .left
-        titleLabel.numberOfLines = 2
-        return titleLabel
-    }()
-    
-    private lazy var detailTitleLabel: UILabel = {
-        let detailTitleLabel = UILabel()
-        detailTitleLabel.textColor = k999999Color
-        detailTitleLabel.font = kScaleRegularFont12
-        detailTitleLabel.textAlignment = .left
-        return detailTitleLabel
-    }()
-    
-    private lazy var sellNumberLabel: UILabel = {
-        let sellNumberLabel = UILabel()
-        sellNumberLabel.textColor = k333333Color
-        sellNumberLabel.font = kScaleRegularFont11
-        return sellNumberLabel
-    }()
-    
-    private lazy var sellPriceLabel: UILabel = {
-        let sellPriceLabel = UILabel()
-        sellPriceLabel.textColor = kFE352BColor
-        sellPriceLabel.font = kScaleBoldFont15
-        sellPriceLabel.textAlignment = .left
-        return sellPriceLabel
-    }()
-    
-    private lazy var markPriceLabel: UILabel = {
-        let markPriceLabel = UILabel()
-        markPriceLabel.textColor = kbbbbbbColor
-        markPriceLabel.font = kScaleRegularFont13
-        return markPriceLabel
-    }()
-    
-    private lazy var plusButton: UIButton = {
-        let plusButton = UIButton(type: UIButton.ButtonType.custom)
-        plusButton.setImage(kImage(name: "shopping_mall_plus"), for: UIControl.State.normal)
-        plusButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            if let plusClosure = self?.plusClosure {
-                plusClosure(self?.productSearchModel, self?.indexPath)
-            }
-        }).disposed(by: disposeBag)
-        return plusButton
-    }()
-    
-    var productSearchModel: ProductSearchModel? {
-        didSet {
-            iconImagView.kf.setImage(with: kURLImage(name: productSearchModel?.img ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-            titleLabel.text = productSearchModel?.saleName
-            detailTitleLabel.text = productSearchModel?.subtitle
-            sellNumberLabel.text = "已售\(productSearchModel?.totalCount ?? 0)件"
-            
-            sellPriceLabel.text = priceConversion(price: productSearchModel?.price ?? 0)            
-            let attributeString = NSMutableAttributedString(string:priceConversion(price: productSearchModel?.originPrice ?? 0))
-            attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            markPriceLabel.attributedText = attributeString
-            if productSearchModel?.stock == 0 {
-                self.plusButton.isHidden = true
-            }else {
-                self.plusButton.isHidden = false
-            }
-        }
-    }
-
-
-}

+ 0 - 16
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopSectionHeaderModel.swift

@@ -1,16 +0,0 @@
-//
-//  ShopSectionHeaderModel.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/24.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ShopSectionHeaderModel: NSObject {
-    var priceState : Int = 0 // 0默认,1down,2up
-    var salesState : Int = 0 // 0默认,1down,2up
-    var state : Int = 0 // 0默认,1down,2up
-    var fieldOrder : Int = 0 // 默认,1.销量,2,价格
-}

+ 0 - 125
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopSectionHeaderView.swift

@@ -1,125 +0,0 @@
-//
-//  ShopSectionHeaderView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ShopSectionHeaderView: BaseView {
-    
-    var priceState = 0 // 0默认,1down,2up
-    var salesState = 0 // 0默认,1down,2up
-    
-    override func setupViews() {
-        backgroundColor = UIColor.white
-        addSubview(priceButton)
-        addSubview(salesVolumeButton)
-    }
-    
-    override func setupLayouts() {
-        priceButton.snp.makeConstraints { (make) in
-            make.top.bottom.left.equalToSuperview()
-            make.width.equalToSuperview().dividedBy(2)
-        }
-        priceButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-        salesVolumeButton.snp.makeConstraints { (make) in
-            make.top.bottom.right.equalToSuperview()
-            make.width.equalToSuperview().dividedBy(2)
-        }
-        salesVolumeButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-
-    }
-    
-    lazy var priceButton: UIButton = {
-        let priceButton = UIButton(type: UIButton.ButtonType.custom)
-        priceButton.setTitle("价格", for: UIControl.State.normal)
-        priceButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        priceButton.titleLabel?.font = kRegularFont14
-        priceButton.setImage(kImage(name: "common_store_arrow_normal"), for: UIControl.State.normal)
-        priceButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.shopSectionHeaderModel?.salesState = 0
-
-            if self?.shopSectionHeaderModel?.priceState == 0 && self?.shopSectionHeaderModel?.salesState == 0 {
-                self?.shopSectionHeaderModel?.priceState = 1
-                self?.shopSectionHeaderModel?.fieldOrder = 2
-
-            }else if self?.shopSectionHeaderModel?.priceState == 1 && self?.shopSectionHeaderModel?.salesState == 0 {
-                self?.shopSectionHeaderModel?.priceState = 2
-                self?.shopSectionHeaderModel?.fieldOrder = 2
-
-            }else if self?.shopSectionHeaderModel?.priceState == 2 && self?.shopSectionHeaderModel?.salesState == 0 {
-                self?.shopSectionHeaderModel?.priceState = 0
-                self?.shopSectionHeaderModel?.fieldOrder = 0
-            }
-            self?.shopSectionHeaderModel?.state = (self?.shopSectionHeaderModel?.priceState)!
-
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ShopVCDesc"), object: self?.shopSectionHeaderModel?.priceState, userInfo: ["desc":self?.shopSectionHeaderModel as Any,"field_order":self?.shopSectionHeaderModel?.fieldOrder as Any])
-
-        }).disposed(by: disposeBag)
-        return priceButton
-    }()
-    
-    lazy var salesVolumeButton: UIButton = {
-        let salesVolumeButton = UIButton(type: UIButton.ButtonType.custom)
-        salesVolumeButton.setTitle("销量", for: UIControl.State.normal)
-        salesVolumeButton.setTitleColor(k333333Color, for: UIControl.State.normal)
-        salesVolumeButton.titleLabel?.font = kRegularFont14
-        salesVolumeButton.setImage(kImage(name: "common_store_arrow_normal"), for: UIControl.State.normal)
-        salesVolumeButton.rx.tap.subscribe(onNext: {
-            [weak self] (data) in
-            self?.shopSectionHeaderModel?.priceState = 0
-
-            if self?.shopSectionHeaderModel?.priceState == 0 && self?.shopSectionHeaderModel?.salesState == 0 {
-                self?.shopSectionHeaderModel?.salesState = 1
-                self?.shopSectionHeaderModel?.fieldOrder = 1
-            } else if self?.shopSectionHeaderModel?.priceState == 0 && self?.shopSectionHeaderModel?.salesState == 1 {
-                self?.shopSectionHeaderModel?.salesState = 2
-                self?.shopSectionHeaderModel?.fieldOrder = 1
-            } else if self?.shopSectionHeaderModel?.priceState == 0 && self?.shopSectionHeaderModel?.salesState == 2 {
-                self?.shopSectionHeaderModel?.salesState = 0
-                self?.shopSectionHeaderModel?.fieldOrder = 0
-            }
-            self?.shopSectionHeaderModel?.state = (self?.shopSectionHeaderModel?.salesState)!
-            
-            NotificationCenter.default.post(name: NSNotification.Name(rawValue: "ShopVCDesc"), object: self?.shopSectionHeaderModel?.salesState, userInfo: ["desc":self?.shopSectionHeaderModel as Any,"field_order":self?.shopSectionHeaderModel?.fieldOrder as Any])
-        }).disposed(by: disposeBag)
-        return salesVolumeButton
-    }()
-    
-    var shopSectionHeaderModel : ShopSectionHeaderModel?  {
-        didSet {
-            if shopSectionHeaderModel?.salesState == 0 {
-                salesVolumeButton.setImage(kImage(name: "common_store_arrow_normal"), for: UIControl.State.normal)
-            }
-            
-            if shopSectionHeaderModel?.salesState == 1 {
-                salesVolumeButton.setImage(kImage(name: "common_store_arrow_down"), for: UIControl.State.normal)
-                
-            }
-            
-            if  shopSectionHeaderModel?.salesState == 2 {
-                salesVolumeButton.setImage(kImage(name: "common_store_arrow_up"), for: UIControl.State.normal)
-                
-            }
-            
-            if shopSectionHeaderModel?.priceState == 0 {
-                priceButton.setImage(kImage(name: "common_store_arrow_normal"), for: UIControl.State.normal)
-                
-            }
-            
-            if shopSectionHeaderModel?.priceState == 1 {
-                priceButton.setImage(kImage(name: "common_store_arrow_down"), for: UIControl.State.normal)
-                
-            }
-            
-            if  shopSectionHeaderModel?.priceState == 2 {
-                priceButton.setImage(kImage(name: "common_store_arrow_up"), for: UIControl.State.normal)
-                
-            }
-        }
-    }
-}

+ 0 - 154
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopView.swift

@@ -1,154 +0,0 @@
-//
-//  ShopView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ShopView: BaseView {
-    
-    typealias DidSelectItemBlock = (_ indexPath: IndexPath) -> Void
-    var didSelectItemBlock : DidSelectItemBlock?
-    
-    typealias PlusCloSure = () -> Void
-    var plusCloSure : PlusCloSure?
-    
-    var shopModel : ShopModel? {
-        didSet {
-           tableView.reloadData()
-        }
-    }
-    
-    var paginationModel: PaginationModel? {
-        didSet {
-            tableView.reloadData()
-        }
-    }
-    
-    var productSearchModelArray : Array<ProductSearchModel>? {
-        didSet {
-            if productSearchModelArray?.isEmpty ?? true {
-                tableView.endFooterNoMoreData()
-            }else {
-                tableView.isHiddenFooter(false)
-            }
-            tableView.reloadData()
-        }
-    }
-    
-    var shopSectionHeaderModel : ShopSectionHeaderModel? {
-        didSet {
-            tableView.reloadData()
-        }
-    }
-    
-    override func setupViews() {
-        addSubview(tableView)
-    }
-    
-    override func setupLayouts() {
-        tableView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    lazy var tableView: UITableView = {
-        let tableView = UITableView(frame: CGRect.zero, style: UITableView.Style.plain)
-        tableView.separatorStyle = .none
-        tableView.backgroundColor = kf7f8faColor
-        tableView.dataSource = self
-        tableView.delegate = self
-        tableView.estimatedRowHeight = 82
-        tableView.estimatedSectionFooterHeight = 0.000001
-        tableView.estimatedSectionHeaderHeight = 0.000001
-        return tableView
-    }()
-    
-    
-}
-
-extension ShopView : UITableViewDelegate, UITableViewDataSource {
-    func numberOfSections(in tableView: UITableView) -> Int {
-        return 2
-    }
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-            return 1
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        switch indexPath.section {
-        case 0:
-            let cell = ShopViewShopInfoTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.shopModel = shopModel
-            cell.paginationModel = paginationModel
-            cell.lookButtonClosure = {
-                [weak self] isSelected in
-                self?.shopModel?.isOpen = isSelected
-                tableView.reloadRows(at: [indexPath], with: UITableView.RowAnimation.none)
-            }
-            return cell
-        case 1:
-            let cell = ShopViewTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
-            cell.productSearchModelArray = productSearchModelArray
-            cell.frame = tableView.bounds
-            cell.layoutIfNeeded()
-            cell.reloadData()
-            cell.didSelectItemBlock = {
-                [weak self] indexPath in
-                if let didSelectItemBlock = self?.didSelectItemBlock {
-                    didSelectItemBlock(indexPath)
-                }
-            }
-            cell.plusCloSure = {
-                if let plusCloSure = self.plusCloSure {
-                    plusCloSure()
-                }
-            }
-            return cell
-        default:
-            return UITableViewCell()
-        }
-    }
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-            return UITableView.automaticDimension
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        switch section {
-        case 0:
-            return 0.000001
-        case 1:
-            return 44
-        default:
-            return 0
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        switch section {
-        case 0:
-            return nil
-        case 1:
-            let view = ShopSectionHeaderView(frame: CGRect(x: 0, y: 0, width: kScreenWidth, height: 44))
-            view.shopSectionHeaderModel = self.shopSectionHeaderModel
-            return view
-        default:
-            return nil
-        }
-        
-    }
-    
-    func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
-        return 0.000001
-    }
-    
-    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
-        return nil
-    }
-    
-}

+ 0 - 196
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopViewShopInfoTableViewCell.swift

@@ -1,196 +0,0 @@
-//
-//  ShopViewShopInfoTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-import RxSwift
-import Kingfisher
-
-class ShopViewShopInfoTableViewCell: UITableViewCell {
-    
-    let disposeBag = DisposeBag()
-    
-    typealias LookButtonClosure = (_ isSelected: Bool) -> Void
-    var lookButtonClosure : LookButtonClosure?
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShopViewShopInfoTableViewCell {
-        let ID = "ShopViewShopInfoTableViewCell"
-        tableView.register(ShopViewShopInfoTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ShopViewShopInfoTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShopViewShopInfoTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    func setupViews() {
-        self.selectionStyle = .none
-        backgroundColor = kFFA42FColor
-        addSubview(shopIconImageView)
-        addSubview(shopNameLabel)
-        addSubview(productNumberLabel)
-        addSubview(descriptionLabel)
-        addSubview(lookButton)
-    }
-    
-    func setupLayouts() {
-        shopIconImageView.snp.makeConstraints { (make) in
-            make.top.equalTo(12)
-            make.left.equalTo(14)
-            make.size.equalTo(60)
-        }
-        shopNameLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(shopIconImageView.snp.right).offset(10)
-            make.right.equalTo(-14)
-            make.height.equalTo(14)
-            make.top.equalTo(shopIconImageView).offset(11)
-        }
-        productNumberLabel.snp.makeConstraints { (make) in
-            make.left.equalTo(shopIconImageView.snp.right).offset(10)
-            make.right.equalTo(-14)
-            make.height.equalTo(14)
-            make.bottom.equalTo(shopIconImageView).offset(-11)
-        }
-        descriptionLabel.snp.remakeConstraints { (make) in
-            make.top.equalTo(shopIconImageView.snp.bottom).offset(10)
-            make.left.equalTo(14)
-            make.right.equalTo(-14)
-            make.bottom.equalTo(-35)
-        }
-        lookButton.snp.makeConstraints { (make) in
-            make.top.equalTo(descriptionLabel.snp.bottom).offset(10)
-            make.right.equalTo(-18)
-            make.bottom.equalTo(-10)
-        }
-    }
-    
-    lazy var shopIconImageView: UIImageView = {
-        let shopIconImageView = UIImageView()
-        shopIconImageView.image = kImage(name: "default_pic")
-        shopIconImageView.cornerRadius = 30
-        shopIconImageView.masksToBounds = true
-        return shopIconImageView
-    }()
-    
-    lazy var shopNameLabel: UILabel = {
-        let shopNameLabel = UILabel()
-        shopNameLabel.text = "彩虹星球专营店"
-        shopNameLabel.textColor = UIColor.white
-        shopNameLabel.font = kMediumFont15
-        return shopNameLabel
-    }()
-    
-    lazy var productNumberLabel: UILabel = {
-        let productNumberLabel = UILabel()
-        productNumberLabel.text = "全部商品:200"
-        productNumberLabel.textColor = UIColor.white
-        productNumberLabel.font = kRegularFont14
-        return productNumberLabel
-    }()
-    
-    lazy var descriptionLabel: UILabel = {
-        let descriptionLabel = UILabel()
-        descriptionLabel.textColor = UIColor.white
-        descriptionLabel.font = kRegularFont14
-        descriptionLabel.numberOfLines = 0
-        descriptionLabel.sizeToFit()
-        return descriptionLabel
-    }()
-    
-    lazy var lookButton: UIButton = {
-        let lookButton = UIButton(type: UIButton.ButtonType.custom)
-        lookButton.setTitleColor(UIColor.white, for: UIControl.State.normal)
-        lookButton.titleLabel?.font = kRegularFont14
-        lookButton.isHidden = true
-        lookButton.rx.tap.subscribe(onNext: { [weak self] (data) in
-            self?.lookButton.isSelected = !(self?.lookButton.isSelected)!
-            if let lookButtonClosure = self?.lookButtonClosure {
-                lookButtonClosure(lookButton.isSelected)
-            }
-        }).disposed(by: disposeBag)
-        return lookButton
-    }()
-    
-    var shopModel : ShopModel? {
-        didSet {
-            
-            let str = shopModel?.shopDesc
-            let attributeString = NSMutableAttributedString(string:str ?? "")
-            attributeString.changeAllLineSpacing(2)
-            descriptionLabel.attributedText = attributeString
-            
-            
-            let dict = [
-                NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14),
-            ]
-            let height: CGFloat = str?.boundingRect(with: CGSize(width: kScreenWidth-60-28-10, height:CGFloat(MAXFLOAT)), options: .usesLineFragmentOrigin, attributes: dict, context: nil).size.height ?? 0
-            let labelHeight = height
-            
-            let count = Int((labelHeight) / descriptionLabel.font.lineHeight)
-
-            
-            if (shopModel?.isOpen ?? false) {
-                descriptionLabel.numberOfLines = 0
-                descriptionLabel.lineBreakMode = .byCharWrapping
-                lookButton.isSelected = true
-                lookButton.setImage(UIImage.init(named: "common_word_packup"), for: UIControl.State.selected)
-                lookButton.setTitle("收起", for: UIControl.State.normal)
-            } else {
-                descriptionLabel.numberOfLines = 2
-                descriptionLabel.lineBreakMode = .byTruncatingTail
-                lookButton.isSelected = false
-                lookButton.setImage(kImage(name: "common_word_unfold"), for: UIControl.State.normal)
-                lookButton.setTitle("查看更多", for: UIControl.State.normal)
-            }
-            lookButton.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
-
-            
-            shopIconImageView.kf.setImage(with: kURLImage(name: shopModel?.logoImg ?? "default_pic"), placeholder: kImage(name: "default_pic"))
-            KingfisherManager.shared.cache.clearMemoryCache()
-             shopNameLabel.text = shopModel?.shopName
-
-            
-            if count > 2 {
-                descriptionLabel.snp.remakeConstraints { (make) in
-                    make.top.equalTo(shopIconImageView.snp.bottom).offset(10)
-                    make.left.equalTo(14)
-                    make.right.equalTo(-14)
-                    make.bottom.equalTo(-35)
-                }
-                lookButton.isHidden = false
-            }else {
-                descriptionLabel.snp.remakeConstraints { (make) in
-                    make.top.equalTo(shopIconImageView.snp.bottom).offset(10)
-                    make.left.equalTo(14)
-                    make.right.equalTo(-14)
-                    make.bottom.equalTo(-10)
-                }
-                lookButton.isHidden = true
-            }
-            
-        }
-    }
-    
-    var paginationModel: PaginationModel? {
-        didSet{
-            productNumberLabel.text = "全部商品:\(paginationModel?.total ?? 0)"
-        }
-    }
-}

+ 0 - 138
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopViewTableViewCell.swift

@@ -1,138 +0,0 @@
-//
-//  ShopViewTableViewCell.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ShopViewTableViewCell: UITableViewCell {
-
-    var productSearchModelArray : Array<ProductSearchModel>? {
-        didSet {
-            collectionView.reloadData()
-        }
-    }
-    
-    typealias DidSelectItemBlock = (_ indexPath: IndexPath) -> Void
-    var didSelectItemBlock : DidSelectItemBlock?
-    
-    typealias PlusCloSure = () -> Void
-    var plusCloSure : PlusCloSure?
-    
-    class func cellWith(tableView:UITableView,indexPath:IndexPath) -> ShopViewTableViewCell {
-        let ID = "ShopViewTableViewCell"
-        tableView.register(ShopViewTableViewCell.self, forCellReuseIdentifier: ID)
-        let cell : ShopViewTableViewCell = tableView.dequeueReusableCell(withIdentifier: ID, for: indexPath) as! ShopViewTableViewCell
-        cell.indexPath = indexPath
-        return cell
-    }
-    
-    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
-        super.init(style: style, reuseIdentifier: reuseIdentifier)
-        setupViews()
-        setupLayouts()
-    }
-    
-    required init?(coder aDecoder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    var indexPath: IndexPath? {
-        didSet {
-            
-        }
-    }
-    //MRAK: - 设置View
-    private func setupViews() {
-        self.selectionStyle = .none
-        addSubview(collectionView)
-    }
-    
-    private func setupLayouts() {
-        collectionView.snp.makeConstraints { (make) in
-            make.edges.equalToSuperview()
-        }
-    }
-    
-    private lazy var collectionView: UICollectionView = {
-        let collectionView = UICollectionView.init(frame: CGRect.zero, collectionViewLayout: collectionViewLayout)
-        collectionView.backgroundColor = kf7f8faColor
-        collectionView.delegate = self;
-        collectionView.dataSource = self;
-        collectionView.showsVerticalScrollIndicator = false
-        collectionView.showsHorizontalScrollIndicator = false
-        return collectionView
-    }()
-    
-    private lazy var collectionViewLayout: UICollectionViewFlowLayout = {
-        let collectionViewLayout = UICollectionViewFlowLayout.init()
-        collectionViewLayout.minimumLineSpacing = 7 * kScaleWidth
-        collectionViewLayout.minimumInteritemSpacing = 7 * kScaleWidth
-        return collectionViewLayout
-    }()
-    
-    //加载数据
-    func reloadData() {
-        //collectionView重新加载数据
-        self.collectionView.reloadData()
-        //更新collectionView的高度约束
-        let contentSize = self.collectionView.collectionViewLayout.collectionViewContentSize
-        collectionView.snp.remakeConstraints { (make) in
-            make.edges.equalToSuperview()
-            make.height.equalTo(contentSize.height)
-        }
-        self.collectionView.collectionViewLayout.invalidateLayout()
-    }
-    
-    /// 添加购物车
-    ///
-    /// - Returns:
-    func addCart(productSearchModel:ProductSearchModel,indexPath:IndexPath) {
-            productSearchModel.isSelect = 1
-        SwiftMoyaNetWorkServiceProduct.shared().productCartListAddApi(productSearchModel: productSearchModel, completion: {
-            [weak self] (cartAmountModel) -> (Void) in
-            if let plusCloSure = self?.plusCloSure {
-                plusCloSure()
-            }
-            SwiftProgressHUD.shared().showText("已加入购物车")
-        })
-    }
-    
-}
-
-extension ShopViewTableViewCell: UICollectionViewDelegateFlowLayout,UICollectionViewDataSource {
-    func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return productSearchModelArray?.isEmpty ?? true ? 0 : 1
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return productSearchModelArray?.isEmpty ?? true ? 0 :  productSearchModelArray?.count ?? 0
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let cell = ProductSlidingTopBottomCollectionViewCell.cellWith(collectionView: collectionView, indexPath: indexPath)
-        cell.productSearchModel = productSearchModelArray![indexPath.row]
-        cell.plusClosure = {
-            [weak self] (productSearchModel,indexPath) in
-            self?.addCart(productSearchModel: productSearchModel!, indexPath: indexPath!)
-        }
-        return cell
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        if let didSelectItemBlock = didSelectItemBlock {
-            didSelectItemBlock(indexPath)
-        }
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
-        return CGSize(width:170 * kScaleWidth, height: 170 * kScaleWidth + 80)
-    }
-    
-    func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
-        return UIEdgeInsets(top: 10, left: 14 * kScaleWidth, bottom: 10, right: 14 * kScaleWidth)
-    }
-}

+ 0 - 148
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/ViewController/ShopViewController.swift

@@ -1,148 +0,0 @@
-//
-//  ShopViewController.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/12.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class ShopViewController: BaseViewController {
-    
-    override func didReceiveMemoryWarning() {
-        super.didReceiveMemoryWarning()
-    }
-    
-    var shopId : Int?
-    var productSearchModelArray = Array<ProductSearchModel>()
-    
-    var fieldOrder : Int = 0
-    var shopSectionHeaderModel = ShopSectionHeaderModel()
-    
-    override func viewWillAppear(_ animated: Bool) {
-        super.viewWillAppear(animated)
-        self.productGetCartCountApi()
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupViews()
-        setupLayouts()
-        setupData()
-    }
-    
-    override func setupViews() {
-        navigationBar.barBackgroundColor = kFFA42FColor
-        navigationBar.titleLabelColor = UIColor.white
-        navigationBar.wr_setLeftButton(image: kImage(name: "navbar_back_white")!)
-        navigationBar.wr_setRightButton(image: kImage(name:
-            "navbar_shopping_white")!)
-        statusBarStyle = .lightContent
-        navigationBar.onClickRightButton = {
-            [weak self] in
-            let vc = ShoppingCartViewController()
-            vc.shoppingCartVCType = .push
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        view.addSubview(shopView)
-    }
-    
-    override func setupLayouts() {
-        shopView.snp.makeConstraints { (make) in
-            make.top.equalTo(kNavBarTotalHeight)
-            make.left.right.bottom.equalToSuperview()
-        }
-    }
-    
-    
-    override func setupData() {
-        
-        shopView.tableView.addHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
-             self?.productGetCartCountApi()
-             self?.shopViewApi()
-             self?.productListApi(page: page)
-        }
-        
-        shopView.tableView.addAutoNormalFooter(withAutomaticallyRefresh: true, loadMoreBlock: {
-            [weak self] (page) in
-            self?.productListApi(page: page)
-        })
-        
-        _ = NotificationCenter.default.rx
-            .notification(NSNotification.Name("ShopVCDesc"))
-            .takeUntil(self.rx.deallocated) //页面销毁自动移除通知监听
-            .subscribe(onNext: {
-                [weak self] notification in
-
-                self?.shopSectionHeaderModel = notification.userInfo!["desc"] as! ShopSectionHeaderModel
-                self?.fieldOrder = notification.userInfo!["field_order"] as! Int
-                self?.productListApi(page: 1)
-            })
-        shopView.didSelectItemBlock = {
-            [weak self] indexPath in
-            let vc = ProductDetailViewController()
-            let productSearch = self?.productSearchModelArray[indexPath.row]
-            vc.productId = productSearch?.id
-            vc.shopId = productSearch?.shopId
-            self?.navigationController?.pushViewController(vc, animated: true)
-        }
-        shopView.plusCloSure = {
-            [weak self] in
-            self?.productGetCartCountApi()
-        }
-    }
-    
-    private lazy var shopView: ShopView = {
-        let shopView = ShopView()
-        return shopView
-    }()
-    
-    /// 获取商家信息
-    private func shopViewApi() {
-        SwiftMoyaNetWorkServiceShop.shared().shopViewApi(shopId: shopId ?? 0) {
-            [weak self] (shopModel) -> (Void) in
-            let shopModel = shopModel as! ShopModel
-            self?.shopView.shopModel = shopModel
-        }
-    }
-    
-    /// 获取商家商品列表
-    private func productListApi(page:Int) {
-        
-
-        SwiftMoyaNetWorkServiceProduct.shared().productListApi(page: page, shopId: shopId ?? 0,desc: self.shopSectionHeaderModel.state, fieldOrder: fieldOrder) {
-            [weak self] (productListModel) -> (Void) in
-            let productSearchListModel = productListModel as? ProductSearchListModel
-            if productSearchListModel?.pagination?.currentPage ?? 1  <= productSearchListModel?.pagination?.totalPages ?? 1 {
-                if productSearchListModel?.pagination?.currentPage == 1{
-                    self?.productSearchModelArray.removeAll()
-                    self?.shopView.paginationModel = productSearchListModel?.pagination
-                    self?.shopView.tableView.resetNoMoreData()
-                }
-                self?.productSearchModelArray = (self?.productSearchModelArray)! + (productSearchListModel?.data!)!
-                self?.shopView.productSearchModelArray = self?.productSearchModelArray
-                self?.shopView.shopSectionHeaderModel = self?.shopSectionHeaderModel
-
-            }else {
-                self?.shopView.tableView.endFooterNoMoreData()
-            }
-        }
-    }
-    
-    /// 获取购物车数量
-    private func productGetCartCountApi() {
-        SwiftMoyaNetWorkServiceProduct.shared().productGetCartCountApi {
-            [weak self] (productCartCountModel) -> (Void) in
-            let productCartCountModel = productCartCountModel as!  ProductCartCountModel
-            if productCartCountModel.count != 0 {
-                self?.navigationBar.rightButton.pp.badgeView.isUserInteractionEnabled = false
-                self?.navigationBar.rightButton.pp.badgeView.offset = CGPoint(x: -13, y: 13)
-                self?.navigationBar.rightButton.pp.addBadge(number: productCartCountModel.count ?? 0)
-            }else {
-                self?.navigationBar.rightButton.pp.badgeView.isHidden = true
-            }
-        }
-    }
-
-}

+ 0 - 0
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ShoppingCart/View/ShoppingCartAccountView.swift


Некоторые файлы не были показаны из-за большого количества измененных файлов