瀏覽代碼

地址删除给弹框
商品详情已售罄不能加入购物车/不能立即够买
所有的商品图中加入已售罄图
订单页面商品可以跳商品详情
店铺页面需要微调

南鑫林 6 年之前
父節點
當前提交
b8edfa9402
共有 18 個文件被更改,包括 190 次插入63 次删除
  1. 1 1
      RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj
  2. 6 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/EditExpressAddress/ViewController/EditExpressAddressViewController.swift
  3. 5 1
      RainbowPlanet/RainbowPlanet/Modules/MineModule/EditSelfMentionContacts/ViewController/EditSelfMentionContactsViewController.swift
  4. 18 1
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift
  5. 7 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderViewController.swift
  6. 19 0
      RainbowPlanet/RainbowPlanet/Modules/OrderModule/OrderDetail/ViewController/OrderDetailViewController.swift
  7. 22 23
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift
  8. 25 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailView.swift
  9. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductDetailHotSell/ProductDetailHotSellCollectionViewCell.swift
  10. 15 7
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift
  11. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallRightSideleftPicture/ProductRightSideleftPictureCollectionViewCell.swift
  12. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallSlidingLeftRight/ProductSlidingLeftRightCollectionViewCell.swift
  13. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductSlidingTopBottom/ProductSlidingTopBottomCollectionViewCell.swift
  14. 5 0
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHBigTableViewCell.swift
  15. 5 1
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift
  16. 2 2
      RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopView.swift
  17. 40 26
      RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift
  18. 二進制
      彩虹星球1期遗留问题.xmind

+ 1 - 1
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -2024,10 +2024,10 @@
 			isa = PBXGroup;
 			children = (
 				A77F2CAE2232010F001BD3F6 /* RegisterLoginModule */,
+				A77F2CA92232010F001BD3F6 /* MineModule */,
 				A7FF155A228C689C00A85748 /* OrderModule */,
 				A77F2CA32232010F001BD3F6 /* ShoppingMallModule */,
 				A77F2CAF2232010F001BD3F6 /* ShoppingCartModule */,
-				A77F2CA92232010F001BD3F6 /* MineModule */,
 				A729B5A52266DBC9004AE098 /* CommonModules */,
 			);
 			path = Modules;

+ 6 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/EditExpressAddress/ViewController/EditExpressAddressViewController.swift

@@ -40,7 +40,12 @@ class EditExpressAddressViewController: BaseViewController {
         editExpressAddressView.expressAddresModel = expressAddresModel
         editExpressAddressView.deleteClosure = {
             [weak self] in
-            self?.userAddressDelete()
+            
+            AlertSheetView.alert(title: "是否删除该地址", cancelTitle: "取消", sureTitle: "确定", cancelBlock: { (popupView, int, string) in
+                
+            }, confirmBlock: { (FWPopupView, int, String) in
+                 self?.userAddressDelete()
+            })
         }
         editExpressAddressView.expressAddressClosure = {
             [weak self] (expressAddresModel) in

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/MineModule/EditSelfMentionContacts/ViewController/EditSelfMentionContactsViewController.swift

@@ -56,7 +56,11 @@ class EditSelfMentionContactsViewController: BaseViewController {
         editSelfMentionContactsView.deleteClosure = { //删除
             [weak self] in
             if let selfMentionContactsModel = self?.selfMentionContactsModel {
-                self?.userDelExpreesContactsApi()
+                AlertSheetView.alert(title: "是否删除该地址", cancelTitle: "取消", sureTitle: "确定", cancelBlock: { (popupView, int, string) in
+                    
+                }, confirmBlock: { (FWPopupView, int, String) in
+                    self?.userDelExpreesContactsApi()
+                })
             }
         }
         return editSelfMentionContactsView

+ 18 - 1
RainbowPlanet/RainbowPlanet/Modules/OrderModule/Order/ViewController/OrderListViewController.swift

@@ -29,6 +29,9 @@ class OrderListViewController: UIViewController {
     typealias DidSelectBlock = (_ orderModel:OrderModel) -> Void
     var didSelectBlock : DidSelectBlock?
     
+    typealias ProductDidSelectBlock = (OrderModel,OrderModelDetailModel) -> Void
+    var productDidSelectBlock : ProductDidSelectBlock?
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupViews()
@@ -318,11 +321,25 @@ extension OrderListViewController : UITableViewDelegate, UITableViewDataSource {
     func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
         
         let orderModel = orderModelArray[indexPath.section]
-        if indexPath.row == 0 {
+        let details = orderModel.detail
+        switch indexPath.row {
+        case 0:
             if let didSelectBlock = didSelectBlock {
                 didSelectBlock(orderModel)
             }
+        case 1:
+            break
+        case details!.count + 2:
+            break
+        case details!.count + 3:
+            break
+        default:
+            if let productDidSelectBlock = productDidSelectBlock {
+                productDidSelectBlock(orderModel,(orderModel.detail?[indexPath.row-2])!)
+            }
+            break
         }
+        
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {

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

@@ -174,6 +174,13 @@ extension OrderViewController :JXSegmentedListContainerViewDataSource {
             }
             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
     }
     

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

@@ -235,6 +235,25 @@ extension OrderDetailViewController : UITableViewDelegate, UITableViewDataSource
         }
     }
     
+    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
+            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 {

+ 22 - 23
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductDetail/View/ProductDetailHeader/ProductDetailTableViewHeaderView.swift

@@ -11,29 +11,6 @@ import FSPagerView
 
 class ProductDetailTableViewHeaderView: BaseView {
     
-    
-    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 productDetailModel?.isConfirmSale == 0 {
-                    self.soldOutImageView.isHidden = true
-                }else {
-                    self.soldOutImageView.isHidden = false
-                }
-                pagerView.reloadData()
-            }
-        }
-    }
-    
-    
     override func setupViews() {
         backgroundColor = UIColor.white
         addSubview(pagerView)
@@ -82,9 +59,31 @@ class ProductDetailTableViewHeaderView: BaseView {
     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 productDetailModel?.totalStock == 0 {
+                    self.soldOutImageView.isHidden = false
+                }else {
+                    self.soldOutImageView.isHidden = true
+                }
+                pagerView.reloadData()
+            }
+        }
+    }
+    
 }
 
 extension ProductDetailTableViewHeaderView: FSPagerViewDataSource,FSPagerViewDelegate {

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

@@ -55,6 +55,12 @@ class ProductDetailView: BaseView {
                     tableView.tableHeaderView = productDetailTableViewHeaderView
                     productDetailTableViewHeaderView.productDetailModel = productDetailModel
                 }
+                //是否可以点击购买
+                if productDetailModel?.totalStock == 0 {
+                    self.nuablebuyLabel.isHidden = true
+                }else {
+                    self.nuablebuyLabel.isHidden = true
+                }
             }else {
                 bottomBgView.isHidden = true
             }
@@ -80,6 +86,7 @@ class ProductDetailView: BaseView {
         cartButton.addSubview(cartImageView)
         bottomBgView.addSubview(addCartButton)
         bottomBgView.addSubview(buyButton)
+        bottomBgView.addSubview(nuablebuyLabel)
         addSubview(tableView)
         addSubview(topButton)
         if #available(iOS 11.0, *) {
@@ -113,6 +120,11 @@ class ProductDetailView: BaseView {
             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)
@@ -192,6 +204,17 @@ class ProductDetailView: BaseView {
         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)
@@ -296,6 +319,8 @@ extension ProductDetailView : UITableViewDelegate, UITableViewDataSource {
             }
             return 0
             
+        case 4:
+            return productSearchListModel?.data?.isEmpty ?? true ? 0 :  1
         case 5:
             return productDetailModel?.parameter?.isEmpty ?? true ? 0 :  productDetailModel?.parameter?.count ?? 0
         default:

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

@@ -156,6 +156,11 @@ class ProductDetailHotSellCollectionViewCell: UICollectionViewCell {
             let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
+            if productSearchModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
         }
     }
     

+ 15 - 7
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/CollectionViewCell/ProductMallBarChart/ProductMallBarChartCollectionViewCell.swift

@@ -250,17 +250,25 @@ class ProductMallBarChartCollectionViewCell: UICollectionViewCell {
             sellPriceLabel.text = "¥\(productModel?.price ?? 0)"
             let attributeString = NSMutableAttributedString(string:"¥\(productModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
-            if productModel?.amount == 0 || productModel?.amount == nil  {
+           
+            if productModel?.totalStock == 0 {
                 reduceButton.isHidden = true
                 numberLabel.isHidden = true
                 plusButton.isHidden = true
-                shopingCarButton.isHidden = false
-            }else {
-                reduceButton.isHidden = false
-                numberLabel.isHidden = false
-                plusButton.isHidden = false
                 shopingCarButton.isHidden = true
-                numberLabel.text =  "\(productModel?.amount ?? 1)"
+            }else {
+                if productModel?.amount == 0 || productModel?.amount == nil  {
+                    reduceButton.isHidden = true
+                    numberLabel.isHidden = true
+                    plusButton.isHidden = true
+                    shopingCarButton.isHidden = false
+                }else {
+                    reduceButton.isHidden = false
+                    numberLabel.isHidden = false
+                    plusButton.isHidden = false
+                    shopingCarButton.isHidden = true
+                    numberLabel.text =  "\(productModel?.amount ?? 1)"
+                }
             }
 
         }

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

@@ -158,6 +158,11 @@ class ProductRightSideleftPictureCollectionViewCell: UICollectionViewCell {
             let attributeString = NSMutableAttributedString(string:"¥\(productModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
+            if productModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
         }
     }
     

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

@@ -162,6 +162,11 @@ class ProductSlidingLeftRightCollectionViewCell: UICollectionViewCell {
             let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
+            if productModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
         }
     }
     

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

@@ -22,6 +22,11 @@ class ProductSlidingTopBottomCollectionViewCell: UICollectionViewCell {
             let attrString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
             attrString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attrString
+            if productSearchModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
         }
     }
     

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

@@ -156,6 +156,11 @@ class ProductHBigTableViewCell: UITableViewCell {
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.textColor = kbbbbbbColor
             markPriceLabel.attributedText = attributeString
+            if productSearchModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
 
         }
     }

+ 5 - 1
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/ProductView/TableViewCell/ProductHSmallTableViewCell.swift

@@ -161,7 +161,11 @@ class ProductHSmallTableViewCell: UITableViewCell {
             let attributeString = NSMutableAttributedString(string:"¥\(productSearchModel?.originPrice ?? 0)")
             attributeString.changeStrikethrough(atAllStyle: NSUnderlineStyle.single, color: kbbbbbbColor)
             markPriceLabel.attributedText = attributeString
-            
+            if productSearchModel?.totalStock == 0 {
+                self.plusButton.isHidden = true
+            }else {
+                self.plusButton.isHidden = false
+            }
         }
     }
 

+ 2 - 2
RainbowPlanet/RainbowPlanet/Modules/ShoppingMallModule/Shop/View/ShopView.swift

@@ -21,7 +21,7 @@ class ShopView: BaseView {
     
     var paginationModel: PaginationModel? {
         didSet {
-            tableView.reloadSections([0], with: UITableView.RowAnimation.none)
+            tableView.reloadData()
         }
     }
     
@@ -32,7 +32,7 @@ class ShopView: BaseView {
             }else {
                 tableView.isHiddenFooter(false)
             }
-            tableView.reloadRows(at: [IndexPath(row: 0, section: 1)], with: UITableView.RowAnimation.none)
+            tableView.reloadData()
         }
     }
     

+ 40 - 26
RainbowPlanet/RainbowPlanet/Service/SwiftMoyaService/SwiftMoyaServiceManger/SwiftMoyaNetWorkManager/SwiftMoyaNetWorkManager.swift

@@ -421,7 +421,9 @@ extension SwiftMoyaNetWorkManager {
     private func getResponseStatusCode(response:Response, isCustomAlert:Bool , completion: @escaping successCallback) -> Void {
         let json = try? JSON(response.mapJSON())
         if response.statusCode == 200 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
+            
             let json = JSON(parseJSON: json!.description)
             let rootModel = RootModel(JSONString: json.description)
             let data = JSON(json["data"]).description
@@ -443,7 +445,8 @@ extension SwiftMoyaNetWorkManager {
                 }
             }
         }else if response.statusCode == 401 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
             let infoModel = InfoModel(JSONString: json?.description ?? "")
             kAppDelegate.setLoginController()
             SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
@@ -452,8 +455,8 @@ extension SwiftMoyaNetWorkManager {
                 falseCallback()
             }
         } else {
-            NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
-            SwiftProgressHUD.shared().showText(response.description)
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
             
             if let falseCallback = self.falseCallback  {
                 falseCallback()
@@ -470,7 +473,8 @@ extension SwiftMoyaNetWorkManager {
     private func getResponseValueStatusCode(response:Response, isCustomAlert:Bool , completion: @escaping successCallback) -> Void {
         let json = try? JSON(response.mapJSON())
         if response.statusCode == 200 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
             let json = JSON(parseJSON: json!.description)
             let rootModel = RootModel(JSONString: json.description)
             let data = JSON(json["data"]).description
@@ -492,7 +496,8 @@ extension SwiftMoyaNetWorkManager {
                 }
             }
         }else if response.statusCode == 401 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
             let infoModel = InfoModel(JSONString: json?.description ?? "")
             kAppDelegate.setLoginController()
             SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
@@ -501,7 +506,8 @@ extension SwiftMoyaNetWorkManager {
                 falseCallback()
             }
         } else {
-            NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
             SwiftProgressHUD.shared().showText(response.description)
             
             if let falseCallback = self.falseCallback  {
@@ -519,7 +525,8 @@ extension SwiftMoyaNetWorkManager {
     private func getResponseArrayStatusCode(response:Response, isCustomAlert:Bool , completion: @escaping successCallArrayback) -> Void {
         let json = try? JSON(response.mapJSON())
         if response.statusCode == 200 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
             let json = JSON(parseJSON: json!.description)
             let rootModel = RootModel(JSONString: json.description)
             let data = JSON(json["data"]).description
@@ -542,7 +549,8 @@ extension SwiftMoyaNetWorkManager {
                 }
             }
         }else if response.statusCode == 401 {
-            NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json!.description)")
             let infoModel = InfoModel(JSONString: json?.description ?? "")
             kAppDelegate.setLoginController()
             SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
@@ -551,7 +559,8 @@ extension SwiftMoyaNetWorkManager {
                 falseCallback()
             }
         } else {
-            NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
+            let url = String(describing: response.request!.url!)
+            NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
             SwiftProgressHUD.shared().showText(response.description)
             
             if let falseCallback = self.falseCallback  {
@@ -570,36 +579,37 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
             do {
                 let json = try JSON(response.mapJSON())
                 if response.statusCode == 200 {
-                    NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json.description)");
+                    NXLLog("\nurl=\(String(describing: response.request!.url!))\nstatusCode=\(response.statusCode)\njson=\n\(json.description)");
 
                     let json = JSON(parseJSON: json.description)
                     let rootModel = RootModel(JSONString: json.description)
                     let data = JSON(json["data"]).description
                     rootModel?.data = data
                     if rootModel!.code  == 0 {
+
                         let mapper = T(JSONString:  rootModel!.data ?? "")
                         return Single<T?>.just(mapper)
                     }else if rootModel!.code  == 1 {
-                        SwiftProgressHUD.shared().showText(rootModel!.msg ?? "信息有误!!!", textAlignment: .left)
                         return Single<T?>.just(nil)
                     }else {
-                        NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
-                        SwiftProgressHUD.shared().showText(response.description)
                         return Single<T?>.just(nil)
                     }
                 }else if response.statusCode == 401 {
-                    NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json.description)");
+                    let url = String(describing: response.request!.url!)
+                    NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json.description)")
                     let infoModel = InfoModel(JSONString: json.description)
                     SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
                     kAppDelegate.setLoginController()
                     return Single<T?>.just(nil)
-                }else {                NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
-                    SwiftProgressHUD.shared().showText(response.description)
+                }else {
+                    let url = String(describing: response.request!.url!)
+                    NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
                     return Single<T?>.just(nil)
                 }
 
             } catch {
-                NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
+                let url = String(describing: response.request!.url!)
+                NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)")
                 SwiftProgressHUD.shared().showText(response.description)
                 return Single<T?>.just(nil)
             }
@@ -612,36 +622,40 @@ extension PrimitiveSequence where TraitType == SingleTrait, ElementType == Respo
             do {
                 let json = try JSON(response.mapJSON())
                 if response.statusCode == 200 {
-                    NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json.description)");
                     
+                    let url = String(describing: response.request!.url!)
+                    NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json.description)")
+
                     let json = JSON(parseJSON: json.description)
                     let rootModel = RootModel(JSONString: json.description)
                     let data = JSON(json["data"]).description
                     rootModel?.data = data
                     if rootModel!.code  == 0 {
+
                         let mapper = Mapper<T>().mapArray(JSONString: rootModel!.data!)
                         return Single<[T]?>.just(mapper)
                     }else if rootModel!.code  == 1 {
                         SwiftProgressHUD.shared().showText(rootModel!.msg ?? "信息有误!!!", textAlignment: .left)
                         return Single<[T]?>.just(nil)
-                    }else {
-                        NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
-                        SwiftProgressHUD.shared().showText(response.description)
+                    }else {                        SwiftProgressHUD.shared().showText(response.description)
                         return Single<[T]?>.just(nil)
                     }
                 }else if response.statusCode == 401 {
-                    NXLLog("\nstatusCode=\(response.statusCode)\njson=\n\(json.description)");
+                    let url = String(describing: response.request!.url!)
+                    NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\njson=\n\(json.description)")
                     let infoModel = InfoModel(JSONString: json.description)
                     SwiftProgressHUD.shared().showText(infoModel!.message ?? "登录过期,请重新登录")
                     kAppDelegate.setLoginController()
                     return Single<[T]?>.just(nil)
-                }else {                NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
-                    SwiftProgressHUD.shared().showText(response.description)
+                }else {
+                    let url = String(describing: response.request!.url!)
+                    NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
                     return Single<[T]?>.just(nil)
                 }
                 
             } catch {
-                NXLLog("\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)");
+                let url = String(describing: response.request!.url!)
+                NXLLog("\nurl=\(url)\nstatusCode=\(response.statusCode)\nerror=\n\(response.description)")
                 SwiftProgressHUD.shared().showText(response.description)
                 return Single<[T]?>.just(nil)
             }

二進制
彩虹星球1期遗留问题.xmind