Selaa lähdekoodia

流程细节fixed

Chris 6 vuotta sitten
vanhempi
commit
3f234472f4

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

@@ -56,6 +56,7 @@ class OrderApplyRefundNoteInfoCell: UITableViewCell {
             make.top.equalTo(14)
             make.left.equalTo(titleLabel.snp_right).offset(20)
             make.bottom.right.equalTo(-14)
+            make.height.greaterThanOrEqualTo(20)
         }
     }
     

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

@@ -21,6 +21,7 @@ class OrderApplyRefundReasonCell: UITableViewCell {
         didSet {
             if self.selRefundReason?.count ?? 0 > 0 {
                 chooseBtn.setTitle(self.selRefundReason, for: UIControl.State.normal)
+                chooseBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.right, imageTitleSpace: 4)
             }
         }
     }

+ 28 - 12
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/View/ShoppingCartView.swift

@@ -17,12 +17,7 @@ class ShoppingCartView: BaseView {
             self.judgeAllSelectedStatus()
             self.refreshAccountView()
             
-            // FIXME: to be deal
-            if cartListModelArr?.isEmpty ?? true {
-                accountView.isHidden = true
-            } else {
-                accountView.isHidden = false
-            }
+            self.updateAccountViewCondition()
         }
     }
     
@@ -58,14 +53,10 @@ class ShoppingCartView: BaseView {
         tableView.ly_emptyView = emptyView
         tableView.ly_startLoading()
         
-        // FIXME: to be deal
-        if cartListModelArr?.isEmpty ?? true {
-            accountView.isHidden = true
-        } else {
-            accountView.isHidden = false
-        }
+        self.updateAccountViewCondition()
     }
     
+    
     override func setupLayouts() {
         accountView.snp.makeConstraints { (make) in
             make.left.right.bottom.equalToSuperview()
@@ -77,6 +68,25 @@ class ShoppingCartView: BaseView {
         }
     }
     
+    // 处理购物车结算是否显示
+    func updateAccountViewCondition() {
+        if cartListModelArr?.isEmpty ?? true {
+            accountView.isHidden = true
+            accountView.snp_updateConstraints { (make) in
+                accountView.snp_updateConstraints { (make) in
+                    make.height.equalTo(0)
+                }
+            }
+        } else {
+            accountView.isHidden = false
+            accountView.snp_updateConstraints { (make) in
+                accountView.snp_updateConstraints { (make) in
+                    make.height.equalTo(48)
+                }
+            }
+        }
+    }
+    
     lazy var accountView: ShoppingCartAccountView = {
         let accountView = ShoppingCartAccountView()
         
@@ -258,6 +268,12 @@ extension ShoppingCartView : UITableViewDelegate, UITableViewDataSource {
             SwiftMoyaNetWorkServiceProduct.shared().productCartDeleteApi(id: productId ?? 0) { [weak self] (data) -> (Void) in
                 self?.cartListModelArr![indexPath.section].productList?.remove(at: indexPath.row)
                 tableView.deleteRows(at: [indexPath], with: .none)
+                
+                // 删除后商店为空,刷新table
+                if self?.cartListModelArr![indexPath.section].productList?.isEmpty ?? true {
+                    self?.cartListModelArr?.remove(at: indexPath.section)
+                    tableView.reloadData()
+                }
             }
         }
     }

+ 1 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCart/ViewController/ShoppingCartViewController.swift

@@ -39,7 +39,7 @@ class ShoppingCartViewController: BaseViewController {
     }
     
     override func setupLayouts() {
-        self.tabBarController?.selectedIndex = 0
+        
     }
     
     override func setupData() {

+ 4 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCartFinishPay/View/ShoppingCartPaySuccessCell.swift

@@ -148,9 +148,12 @@ class ShoppingCartPaySuccessCell: UITableViewCell {
     }()
     
     private lazy var orderButton: UIButton = {
+        let attributeString = NSMutableAttributedString(string:"查看订单")
+        attributeString.changeUnderline(atAllStyle: NSUnderlineStyle(rawValue: NSUnderlineStyle.single.rawValue), color: kbbbbbbColor)
+        
         let orderButton = UIButton(type: UIButton.ButtonType.custom)
         orderButton.backgroundColor = kffffffColor
-        orderButton.setTitle("查看订单", for: UIControl.State.normal)
+        orderButton.setAttributedTitle(attributeString, for: UIControl.State.normal)
         orderButton.setTitleColor(k333333Color, for: UIControl.State.normal)
         orderButton.setImage(UIImage.imageWithColor(color: k333333Color), for: UIControl.State.normal)
         orderButton.titleLabel?.font = kRegularFont14

+ 16 - 4
RainbowPlanet/RainbowPlanet/Modules/ShoppingCartModule/ShoppingCartFinishPay/ViewController/ShoppingCartFinishPayController.swift

@@ -11,7 +11,15 @@ import RxSwift
 
 class ShoppingCartFinishPayController: BaseViewController {
     
-    var payStatus: Bool? = true
+    var payStatus: Bool? = true {
+        didSet {
+            if (payStatus == true) {
+                navigationBar.title = "支付成功"
+            } else {
+                navigationBar.title = "支付失败"
+            }
+        }
+    }
     
     var productSearchModelArray = Array<ProductSearchModel>()
     
@@ -55,8 +63,10 @@ class ShoppingCartFinishPayController: BaseViewController {
         let finishPayView = ShoppingCartFinishPayView()
         finishPayView.payStatus = payStatus
         finishPayView.repayTransBlock = {
-            [weak self] in
-            print("点击了----重新支付")
+            [weak self] in            
+            let vc = OrderViewController()
+            vc.orderVCType = .pendingPayment
+            self?.navigationController?.pushViewController(vc, animated: true)
         }
         finishPayView.jumpTransBlock = {
             [weak self] (jType) in
@@ -65,7 +75,9 @@ class ShoppingCartFinishPayController: BaseViewController {
                 self?.tabBarController?.selectedIndex = 0
                 self?.navigationController?.popToRootViewController(animated: false)
             case PayJumpDes.checkOrder:
-                print("点击了----\(jType) --查看订单")
+                let vc = OrderViewController()
+                vc.orderVCType = .toBeReceived
+                self?.navigationController?.pushViewController(vc, animated: true)
             }
         }
         

+ 5 - 5
RainbowPlanet/RainbowPlanet/Tools/Extension/Extension+UIAlertController.swift

@@ -66,15 +66,15 @@ extension UIAlertController {
     static func showConfirmActionSheet(camera: ((UIAlertAction)->Void)?,album: ((UIAlertAction)->Void)?) {
         let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
         let cancelAction = UIAlertAction(title: "取消", style: .cancel)
-        cancelAction.setValue(UIColor(hexString: "333333"), forKey: "titleTextColor")
+        cancelAction.setValue(UIColor(hexString: "ffa42f"), forKey: "titleTextColor")
         alert.addAction(cancelAction)
 
-        let cameraAction = UIAlertAction(title: "拍", style: .default, handler: camera)
-        cameraAction.setValue(UIColor(hexString: "333333"), forKey: "titleTextColor")
+        let cameraAction = UIAlertAction(title: "拍", style: .default, handler: camera)
+        cameraAction.setValue(UIColor(hexString: "ffa42f"), forKey: "titleTextColor")
         alert.addAction(cameraAction)
 
-        let albumAction = UIAlertAction(title: "从手机相册选择", style: .default, handler: album)
-        albumAction.setValue(UIColor(hexString: "333333"), forKey: "titleTextColor")
+        let albumAction = UIAlertAction(title: "从相册选择", style: .default, handler: album)
+        albumAction.setValue(UIColor(hexString: "ffa42f"), forKey: "titleTextColor")
         alert.addAction(albumAction)
 
         let viewController = getCurrentVC()