Procházet zdrojové kódy

订单页面初始化完成

南鑫林 před 6 roky
rodič
revize
cbbf4092c0

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

@@ -282,7 +282,7 @@
 		A7FF1555228AC27600A85748 /* ProductAllCommentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1554228AC27600A85748 /* ProductAllCommentView.swift */; };
 		A7FF1557228AC3E800A85748 /* ProductAllCommentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1556228AC3E800A85748 /* ProductAllCommentViewController.swift */; };
 		A7FF1560228C693D00A85748 /* OrderViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF155F228C693D00A85748 /* OrderViewController.swift */; };
-		A7FF1564228C696B00A85748 /* OrderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1563228C696B00A85748 /* OrderView.swift */; };
+		A7FF1564228C696B00A85748 /* OrderListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1563228C696B00A85748 /* OrderListView.swift */; };
 		A7FF1566228C6DF200A85748 /* OrderShopAndStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1565228C6DF200A85748 /* OrderShopAndStatusTableViewCell.swift */; };
 		A7FF1568228C6E2300A85748 /* OrderDeliveryModeAndTimeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1567228C6E2300A85748 /* OrderDeliveryModeAndTimeTableViewCell.swift */; };
 		A7FF156A228C6E3600A85748 /* OrderProductTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1569228C6E3600A85748 /* OrderProductTableViewCell.swift */; };
@@ -302,6 +302,7 @@
 		A7FF1590228C914600A85748 /* OrderRefunddetailsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF158F228C914600A85748 /* OrderRefunddetailsView.swift */; };
 		A7FF1592228C918100A85748 /* OrderRefunddetailsStatusTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1591228C918100A85748 /* OrderRefunddetailsStatusTableViewCell.swift */; };
 		A7FF1594228C919A00A85748 /* OrderRefunddetailsTipsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1593228C919A00A85748 /* OrderRefunddetailsTipsTableViewCell.swift */; };
+		A7FF1596228CFA8100A85748 /* OrderListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7FF1595228CFA8100A85748 /* OrderListViewController.swift */; };
 		BD20F1CB2283C12000677D8E /* ShoppingCartListNoneItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1CA2283C12000677D8E /* ShoppingCartListNoneItemCell.swift */; };
 		BD20F1CD2283C51300677D8E /* ShoppingCartFinishPayController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1CC2283C51300677D8E /* ShoppingCartFinishPayController.swift */; };
 		BD20F1CF2283CE2300677D8E /* ShoppingCartFinishPayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD20F1CE2283CE2300677D8E /* ShoppingCartFinishPayView.swift */; };
@@ -641,7 +642,7 @@
 		A7FF1554228AC27600A85748 /* ProductAllCommentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAllCommentView.swift; sourceTree = "<group>"; };
 		A7FF1556228AC3E800A85748 /* ProductAllCommentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductAllCommentViewController.swift; sourceTree = "<group>"; };
 		A7FF155F228C693D00A85748 /* OrderViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderViewController.swift; sourceTree = "<group>"; };
-		A7FF1563228C696B00A85748 /* OrderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderView.swift; sourceTree = "<group>"; };
+		A7FF1563228C696B00A85748 /* OrderListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListView.swift; sourceTree = "<group>"; };
 		A7FF1565228C6DF200A85748 /* OrderShopAndStatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderShopAndStatusTableViewCell.swift; sourceTree = "<group>"; };
 		A7FF1567228C6E2300A85748 /* OrderDeliveryModeAndTimeTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderDeliveryModeAndTimeTableViewCell.swift; sourceTree = "<group>"; };
 		A7FF1569228C6E3600A85748 /* OrderProductTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderProductTableViewCell.swift; sourceTree = "<group>"; };
@@ -661,6 +662,7 @@
 		A7FF158F228C914600A85748 /* OrderRefunddetailsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderRefunddetailsView.swift; sourceTree = "<group>"; };
 		A7FF1591228C918100A85748 /* OrderRefunddetailsStatusTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderRefunddetailsStatusTableViewCell.swift; sourceTree = "<group>"; };
 		A7FF1593228C919A00A85748 /* OrderRefunddetailsTipsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderRefunddetailsTipsTableViewCell.swift; sourceTree = "<group>"; };
+		A7FF1595228CFA8100A85748 /* OrderListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderListViewController.swift; sourceTree = "<group>"; };
 		BD20F1CA2283C12000677D8E /* ShoppingCartListNoneItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartListNoneItemCell.swift; sourceTree = "<group>"; };
 		BD20F1CC2283C51300677D8E /* ShoppingCartFinishPayController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartFinishPayController.swift; sourceTree = "<group>"; };
 		BD20F1CE2283CE2300677D8E /* ShoppingCartFinishPayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShoppingCartFinishPayView.swift; sourceTree = "<group>"; };
@@ -2611,6 +2613,7 @@
 			isa = PBXGroup;
 			children = (
 				A7FF155F228C693D00A85748 /* OrderViewController.swift */,
+				A7FF1595228CFA8100A85748 /* OrderListViewController.swift */,
 			);
 			path = ViewController;
 			sourceTree = "<group>";
@@ -2618,7 +2621,7 @@
 		A7FF155E228C692000A85748 /* View */ = {
 			isa = PBXGroup;
 			children = (
-				A7FF1563228C696B00A85748 /* OrderView.swift */,
+				A7FF1563228C696B00A85748 /* OrderListView.swift */,
 				A7FF1565228C6DF200A85748 /* OrderShopAndStatusTableViewCell.swift */,
 				A7FF1567228C6E2300A85748 /* OrderDeliveryModeAndTimeTableViewCell.swift */,
 				A7FF1569228C6E3600A85748 /* OrderProductTableViewCell.swift */,
@@ -3273,9 +3276,10 @@
 				A738D205225AF90D00EEE860 /* WeChatpayOrderModel.swift in Sources */,
 				A7CC7524227190FB003C4F38 /* AccountSecurityView.swift in Sources */,
 				A72A72BD22321DE000B21995 /* Extension+UIColor.swift in Sources */,
+				A7FF1596228CFA8100A85748 /* OrderListViewController.swift in Sources */,
 				A7A98E05227EB891005306E9 /* CategoryViewController.swift in Sources */,
 				A77F2CC822320627001BD3F6 /* WRCustomNavigationBar.swift in Sources */,
-				A7FF1564228C696B00A85748 /* OrderView.swift in Sources */,
+				A7FF1564228C696B00A85748 /* OrderListView.swift in Sources */,
 				A7CC74EF22706CCA003C4F38 /* MessageView.swift in Sources */,
 				A70B2C072284305400B2449F /* ProductModel.swift in Sources */,
 				A7CC74E0227042A4003C4F38 /* MineServiceTableViewCell.swift in Sources */,

+ 13 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/View/MineOrderTableViewCell.swift

@@ -7,9 +7,16 @@
 //
 
 import UIKit
+import RxSwift
+import RxCocoa
 
 class MineOrderTableViewCell: UITableViewCell {
     
+    let disposeBag = DisposeBag()
+    
+    typealias LookAllOrderButtonBlock = () -> Void
+    var lookAllOrderButtonBlock : LookAllOrderButtonBlock?
+    
     let images = ["my_payment","my_pickup","my_shipment","my_reception","my_refund"]
     
     let titles = ["待付款","待自提","待发货","待收货","退款/售后"]
@@ -112,6 +119,12 @@ class MineOrderTableViewCell: UITableViewCell {
             UIControl.State.normal)
         lookAllOrderButton.setTitleColor(k999999Color, for: UIControl.State.normal)
         lookAllOrderButton.titleLabel?.font = kRegularFont13
+        lookAllOrderButton.rx.tap.subscribe(onNext: {
+            [weak self] (data) in
+            if let lookAllOrderButtonBlock = self?.lookAllOrderButtonBlock {
+                lookAllOrderButtonBlock()
+            }
+        }).disposed(by: disposeBag)
         return lookAllOrderButton
     }()
     

+ 11 - 0
RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/View/MineView.swift

@@ -10,9 +10,13 @@ import UIKit
 
 class MineView: BaseView {
     
+
     typealias ScrollViewDidScrollBlock = (_ offsetY:CGFloat,_ alpha:CGFloat) -> Void
     var scrollViewDidScrollBlock : ScrollViewDidScrollBlock?
     
+    typealias LookAllOrderButtonBlock = () -> Void
+    var lookAllOrderButtonBlock : LookAllOrderButtonBlock?
+    
     typealias AddressClosure = () -> Void
     var addressClosure : AddressClosure?
     
@@ -68,6 +72,13 @@ extension MineView: UITableViewDelegate,UITableViewDataSource {
         switch indexPath.section {
         case 0:
             let cell = MineOrderTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
+            cell.lookAllOrderButtonBlock = {
+                [weak self] in
+                
+                if let lookAllOrderButtonBlock = self?.lookAllOrderButtonBlock {
+                    lookAllOrderButtonBlock()
+                }
+            }
             cell.frame = tableView.bounds
             cell.layoutIfNeeded()
             cell.reloadData()

+ 25 - 12
RainbowPlanet/RainbowPlanet/Modules/MineModule/Mine/ViewController/MineViewController.swift

@@ -15,11 +15,8 @@ class MineViewController: BaseViewController {
         super.viewDidLoad()
         setupViews()
         setupLayouts()
-        let operationQueue = OperationQueue.main
-        NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "AccountSecurity"), object: nil, queue: operationQueue) {
-            [weak self] (notification) in
-            self?.mineView.tableView.reloadData()
-        }
+        setupData()
+        
     }
     
     override func setupViews() {
@@ -43,8 +40,12 @@ class MineViewController: BaseViewController {
         }
     }
     
-    private lazy var navigationBarView: MineNavigationBarView = {
-        let navigationBarView = MineNavigationBarView()
+    override func setupData() {
+        let operationQueue = OperationQueue.main
+        NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: "AccountSecurity"), object: nil, queue: operationQueue) {
+            [weak self] (notification) in
+            self?.mineView.tableView.reloadData()
+        }
         navigationBarView.messageBlock = {
             [weak self] in
             self?.navigationController?.pushViewController(MessageViewController(), animated: true)
@@ -53,11 +54,6 @@ class MineViewController: BaseViewController {
             [weak self] in
             self?.navigationController?.pushViewController(SetViewController(), animated: true)
         }
-        return navigationBarView
-    }()
-    
-    private lazy var mineView: MineView = {
-        let mineView = MineView()
         mineView.scrollViewDidScrollBlock = {
             [weak self] (offsetY,alpha) in
             self?.navigationBar.barBackgroundColor = kFFAC33Color.withAlphaComponent(alpha)
@@ -70,6 +66,23 @@ class MineViewController: BaseViewController {
             vc.addressManagerVCType = .mine
             self?.navigationController?.pushViewController(vc, animated: true)
         }
+        mineView.lookAllOrderButtonBlock = {
+            [weak self] in
+            let vc = OrderViewController()
+            vc.orderVCType = .all
+            self?.navigationController?.pushViewController(vc, animated: true)
+        }
+    }
+    
+    private lazy var navigationBarView: MineNavigationBarView = {
+        let navigationBarView = MineNavigationBarView()
+       
+        return navigationBarView
+    }()
+    
+    private lazy var mineView: MineView = {
+        let mineView = MineView()
+       
         return mineView
     }()
     

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

@@ -0,0 +1,72 @@
+//
+//  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)
+        
+    }
+    
+    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.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 0.000001
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+
+}
+
+extension OrderListView : UITableViewDelegate, UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        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
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
+}

+ 0 - 21
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/View/OrderView.swift

@@ -1,21 +0,0 @@
-//
-//  OrderListView.swift
-//  RainbowPlanet
-//
-//  Created by 南鑫林 on 2019/5/15.
-//  Copyright © 2019 RainbowPlanet. All rights reserved.
-//
-
-import UIKit
-
-class OrderView: BaseView {
-
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
-    }
-    */
-
-}

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

@@ -0,0 +1,46 @@
+//
+//  OrderListViewController.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/5/16.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import JXSegmentedView
+
+class OrderListViewController: UIViewController {
+
+    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() {
+        
+    }
+    
+    private lazy var orderListView: OrderListView = {
+        let orderListView = OrderListView()
+        return orderListView
+    }()
+
+}
+
+extension OrderListViewController : JXSegmentedListContainerViewListDelegate {
+    func listView() -> UIView {
+        return view
+    }
+}

+ 130 - 9
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift

@@ -7,24 +7,145 @@
 //
 
 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 {
+    
+    var orderVCType : OrderVCType?
 
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        // Do any additional setup after loading the view.
+        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)
 
-    /*
-    // MARK: - Navigation
+        }
+        listContainerView.snp.makeConstraints { (make) in
+            make.top.equalTo(segmentedView.snp.bottom)
+            make.left.right.bottom.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    //1.初始化JXSegmentedView
+    lazy var segmentedView: JXSegmentedView = {
+        let segmentedView = JXSegmentedView()
+        segmentedView.delegate = self
+        segmentedView.dataSource = segmentedDataSource
+        segmentedView.indicators = [indicator]
+        segmentedView.contentScrollView = listContainerView.scrollView
+        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: 0)
+        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
+        return listContainerView
+    }()
+    
+}
 
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+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()
+//        let cmsTemplateModel = cmsTemplateModels![index]
+//        vc.shoppingMallListVCType = cmsTemplateModel.applyType ?? 0
+        return vc
+    }
 }

+ 57 - 6
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/View/OrderDetailView.swift

@@ -10,12 +10,63 @@ import UIKit
 
 class OrderDetailView: BaseView {
 
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
+    override func setupViews() {
+        addSubview(tableView)
+        
     }
-    */
+    
+    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.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 0.000001
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+    
+}
 
+extension OrderDetailView : UITableViewDelegate, UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+        
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        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
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
 }

+ 21 - 11
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift

@@ -12,19 +12,29 @@ class OrderDetailViewController: BaseViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        // Do any additional setup after loading the view.
+        setupViews()
+        setupLayouts()
+        setupData()
     }
     
-
-    /*
-    // MARK: - Navigation
-
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+    override func setupViews() {
+        view.addSubview(orderDetailView)
+    }
+    
+    override func setupLayouts() {
+        orderDetailView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kNavBarTotalHeight)
+            make.top.left.right.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
     }
-    */
+    
+    private lazy var orderDetailView: OrderDetailView = {
+        let orderDetailView = OrderDetailView()
+        return orderDetailView
+    }()
 
 }

+ 57 - 6
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/View/OrderRefunddetailsView.swift

@@ -10,12 +10,63 @@ import UIKit
 
 class OrderRefunddetailsView: BaseView {
 
-    /*
-    // Only override draw() if you perform custom drawing.
-    // An empty implementation adversely affects performance during animation.
-    override func draw(_ rect: CGRect) {
-        // Drawing code
+    override func setupViews() {
+        addSubview(tableView)
+        
     }
-    */
+    
+    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.dataSource = self
+        tableView.delegate = self
+        tableView.estimatedRowHeight = 0.000001
+        tableView.estimatedSectionFooterHeight = 0.000001
+        tableView.estimatedSectionHeaderHeight = 0.000001
+        return tableView
+    }()
+    
+}
 
+extension OrderRefunddetailsView : UITableViewDelegate, UITableViewDataSource {
+    func numberOfSections(in tableView: UITableView) -> Int {
+        
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
+        return 0
+    }
+    
+    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
+        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
+    }
+    
+    func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return nil
+    }
 }

+ 21 - 12
RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderRefunddetails/ViewController/OrderRefunddetailsViewController.swift

@@ -12,19 +12,28 @@ class OrderRefunddetailsViewController: BaseViewController {
 
     override func viewDidLoad() {
         super.viewDidLoad()
-
-        // Do any additional setup after loading the view.
+        setupViews()
+        setupLayouts()
+        setupData()
     }
     
-
-    /*
-    // MARK: - Navigation
-
-    // In a storyboard-based application, you will often want to do a little preparation before navigation
-    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
-        // Get the new view controller using segue.destination.
-        // Pass the selected object to the new view controller.
+    override func setupViews() {
+        view.addSubview(orderRefunddetailsView)
     }
-    */
-
+    
+    override func setupLayouts() {
+        orderRefunddetailsView.snp.makeConstraints { (make) in
+            make.top.equalToSuperview().offset(kNavBarTotalHeight)
+            make.top.left.right.equalToSuperview()
+        }
+    }
+    
+    override func setupData() {
+        
+    }
+    
+    private lazy var orderRefunddetailsView: OrderRefunddetailsView = {
+        let orderRefunddetailsView = OrderRefunddetailsView()
+        return orderRefunddetailsView
+    }()
 }