Commit 975fd9efdcc7eb99b8b3419bfe079ca893d12eb8
1 parent
445f7233
暂时没复现 push不跳转问题
Showing
10 changed files
with
46 additions
and
9 deletions
metaCode/Classes/Extensions/NSObject+CNLiveExtensions.swift
| @@ -20,8 +20,11 @@ func currentViewController() -> (UIViewController?) { | @@ -20,8 +20,11 @@ func currentViewController() -> (UIViewController?) { | ||
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | } | 22 | } |
| 23 | - let vc = window?.rootViewController | ||
| 24 | - return currentVC(vc) | 23 | + let vc = window?.rootViewController |
| 24 | + print("currentVC:\(currentVC(vc)!)") | ||
| 25 | + print("currentVC.children:\((currentVC(vc)!).children)") | ||
| 26 | + print("currentVC.navi:\((currentVC(vc)!).navigationController)") | ||
| 27 | + return currentVC(vc) | ||
| 25 | } | 28 | } |
| 26 | 29 | ||
| 27 | private func currentVC(_ vc :UIViewController?) -> UIViewController? { | 30 | private func currentVC(_ vc :UIViewController?) -> UIViewController? { |
metaCode/Classes/Main/HomePage/Controller/CNLiveShopConsoleController.swift
| @@ -102,6 +102,9 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel | @@ -102,6 +102,9 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel | ||
| 102 | //创建店铺分类 | 102 | //创建店铺分类 |
| 103 | let vc = CNLiveCreateShopClassifyViewController() | 103 | let vc = CNLiveCreateShopClassifyViewController() |
| 104 | vc.classifyType = .oneLevelClassify | 104 | vc.classifyType = .oneLevelClassify |
| 105 | + if currentViewController()?.navigationController == nil{ | ||
| 106 | + print("nil") | ||
| 107 | + } | ||
| 105 | currentViewController()?.navigationController?.pushViewController(vc, animated: true) | 108 | currentViewController()?.navigationController?.pushViewController(vc, animated: true) |
| 106 | }else if itemModel.type == CNLiveShopConsoleType.ShopClassifyManager.rawValue{ | 109 | }else if itemModel.type == CNLiveShopConsoleType.ShopClassifyManager.rawValue{ |
| 107 | //店铺分类管理 | 110 | //店铺分类管理 |
metaCode/Classes/Main/HomePage/Controller/GoodsDetail/CNLiveShopGoodsDetailsViewController.swift
| @@ -23,10 +23,8 @@ class CNLiveShopGoodsDetailsViewController:CNLiveBaseViewController{ | @@ -23,10 +23,8 @@ class CNLiveShopGoodsDetailsViewController:CNLiveBaseViewController{ | ||
| 23 | /// 编辑商品预览使用 | 23 | /// 编辑商品预览使用 |
| 24 | var detailsModel:CNLiveShopGoodsDetailsModel? | 24 | var detailsModel:CNLiveShopGoodsDetailsModel? |
| 25 | 25 | ||
| 26 | - | ||
| 27 | override func viewDidLoad() { | 26 | override func viewDidLoad() { |
| 28 | super.viewDidLoad() | 27 | super.viewDidLoad() |
| 29 | } | 28 | } |
| 30 | 29 | ||
| 31 | - | ||
| 32 | } | 30 | } |
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveGoodsCategoryController.swift
| @@ -483,7 +483,13 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | @@ -483,7 +483,13 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo | ||
| 483 | vc.successCompleteBlock = { | 483 | vc.successCompleteBlock = { |
| 484 | self.postShopClassify() | 484 | self.postShopClassify() |
| 485 | } | 485 | } |
| 486 | - self.navigationController?.pushViewController(vc, animated: true) | 486 | + if self.navigationController == nil{ |
| 487 | + print("self nil") | ||
| 488 | + } | ||
| 489 | + if currentViewController()?.navigationController == nil{ | ||
| 490 | + print("curr nil") | ||
| 491 | + } | ||
| 492 | + currentViewController()?.navigationController?.pushViewController(vc, animated: true) | ||
| 487 | } | 493 | } |
| 488 | 494 | ||
| 489 | // MARK: - 数据请求 | 495 | // MARK: - 数据请求 |
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopNewProductController.swift
| @@ -84,7 +84,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -84,7 +84,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 84 | vc.secCategoryId = self.shopGoodsDetailsModel.category_id2 | 84 | vc.secCategoryId = self.shopGoodsDetailsModel.category_id2 |
| 85 | } | 85 | } |
| 86 | vc.finishBlock = { | 86 | vc.finishBlock = { |
| 87 | - var singleView = self.getShopClassifyView() | 87 | + let singleView = self.getShopClassifyView() |
| 88 | singleView?.contentTextField.text = "\(self.selectShopClassifyVC!.firCategoryName ?? "") \(self.selectShopClassifyVC!.secCategoryName ?? "")" | 88 | singleView?.contentTextField.text = "\(self.selectShopClassifyVC!.firCategoryName ?? "") \(self.selectShopClassifyVC!.secCategoryName ?? "")" |
| 89 | singleView?.layoutSubviews() | 89 | singleView?.layoutSubviews() |
| 90 | } | 90 | } |
| @@ -195,7 +195,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | @@ -195,7 +195,7 @@ class CNLiveShopNewProductController:CNLiveBaseViewController{ | ||
| 195 | previewBtn.setTitleColor(HexColor("#3A3A3A"), for: .normal) | 195 | previewBtn.setTitleColor(HexColor("#3A3A3A"), for: .normal) |
| 196 | previewBtn.titleLabel?.font = Font_15 | 196 | previewBtn.titleLabel?.font = Font_15 |
| 197 | previewBtn.addTarget(self, action: #selector(previewBtnClick), for: .touchUpInside) | 197 | previewBtn.addTarget(self, action: #selector(previewBtnClick), for: .touchUpInside) |
| 198 | - self.bottomNavView.addSubview(previewBtn) | 198 | +// self.bottomNavView.addSubview(previewBtn) |
| 199 | 199 | ||
| 200 | let saveBtn = UIButton(type: .custom) | 200 | let saveBtn = UIButton(type: .custom) |
| 201 | saveBtn.frame = CGRect(x: previewBtn.right, y: 0, width: self.view.width - previewBtn.right, height: KTabBarHeight) | 201 | saveBtn.frame = CGRect(x: previewBtn.right, y: 0, width: self.view.width - previewBtn.right, height: KTabBarHeight) |
metaCode/Classes/Main/HomePage/View/CNDownSlideView.swift
| @@ -85,9 +85,18 @@ class CNDownSlideView:UIView{ | @@ -85,9 +85,18 @@ class CNDownSlideView:UIView{ | ||
| 85 | }else if(type == UpDownTypeShopDetail){ | 85 | }else if(type == UpDownTypeShopDetail){ |
| 86 | 86 | ||
| 87 | }else if(type == UpDownTypeShopControlConsole){ | 87 | }else if(type == UpDownTypeShopControlConsole){ |
| 88 | - currentViewController()?.addChild(self.shopConsoleVC) | ||
| 89 | - self.shopConsoleVC.didMove(toParent: currentViewController()) | 88 | + var isContainVC = false |
| 89 | + currentViewController()?.children.forEach({ vc in | ||
| 90 | + if vc == self.shopConsoleVC{ | ||
| 91 | + isContainVC = true | ||
| 92 | + } | ||
| 93 | + }) | ||
| 94 | + if isContainVC == false{ | ||
| 95 | + currentViewController()?.addChild(self.shopConsoleVC) | ||
| 96 | + self.shopConsoleVC.didMove(toParent: currentViewController()) | ||
| 97 | + } | ||
| 90 | self.addSubview(self.shopConsoleVC.view) | 98 | self.addSubview(self.shopConsoleVC.view) |
| 99 | + | ||
| 91 | } | 100 | } |
| 92 | } | 101 | } |
| 93 | } | 102 | } |
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailBtnsCell.swift
| @@ -74,9 +74,15 @@ class CNLiveShopDetailBtnsCell: UICollectionViewCell { | @@ -74,9 +74,15 @@ class CNLiveShopDetailBtnsCell: UICollectionViewCell { | ||
| 74 | ///push VC | 74 | ///push VC |
| 75 | if tag == 100 { | 75 | if tag == 100 { |
| 76 | //商品管理 | 76 | //商品管理 |
| 77 | + if currentViewController()?.navigationController == nil{ | ||
| 78 | + print("nil") | ||
| 79 | + } | ||
| 77 | currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: true) | 80 | currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: true) |
| 78 | }else if tag == 101 { | 81 | }else if tag == 101 { |
| 79 | //订单管理 | 82 | //订单管理 |
| 83 | + if currentViewController()?.navigationController == nil{ | ||
| 84 | + print("nil") | ||
| 85 | + } | ||
| 80 | currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: true) | 86 | currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: true) |
| 81 | } | 87 | } |
| 82 | // if tag == 100 { | 88 | // if tag == 100 { |
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailOrderAssetCell.swift
| @@ -125,6 +125,9 @@ class CNLiveShopDetailOrderAssetCell:UICollectionViewCell{ | @@ -125,6 +125,9 @@ class CNLiveShopDetailOrderAssetCell:UICollectionViewCell{ | ||
| 125 | @objc func navsubBtnAction(_ sender: UIButton){ | 125 | @objc func navsubBtnAction(_ sender: UIButton){ |
| 126 | if self.displayType == .CNLiveShopDetailDisplayTypeOrder{ | 126 | if self.displayType == .CNLiveShopDetailDisplayTypeOrder{ |
| 127 | //push订单VC | 127 | //push订单VC |
| 128 | + if currentViewController()?.navigationController == nil{ | ||
| 129 | + print("nil") | ||
| 130 | + } | ||
| 128 | currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: true) | 131 | currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: true) |
| 129 | }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{ | 132 | }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{ |
| 130 | //push余额VC | 133 | //push余额VC |
metaCode/Classes/Main/HomePage/View/CNLliveShopDetailBannerCell.swift
| @@ -99,6 +99,9 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP | @@ -99,6 +99,9 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP | ||
| 99 | let bannerMdl = self.shopDetailModel?.banner[index] | 99 | let bannerMdl = self.shopDetailModel?.banner[index] |
| 100 | let webVC = CNWebViewController() | 100 | let webVC = CNWebViewController() |
| 101 | webVC.url = URL(string: bannerMdl?.url ?? "") | 101 | webVC.url = URL(string: bannerMdl?.url ?? "") |
| 102 | + if currentViewController()?.navigationController == nil{ | ||
| 103 | + print("nil") | ||
| 104 | + } | ||
| 102 | currentViewController()?.navigationController?.pushViewController(webVC, animated: true) | 105 | currentViewController()?.navigationController?.pushViewController(webVC, animated: true) |
| 103 | } | 106 | } |
| 104 | } | 107 | } |
metaCode/Classes/Main/HomePage/View/CNMainView.swift
| @@ -204,10 +204,16 @@ class CNFrontMainView : UIView{ | @@ -204,10 +204,16 @@ class CNFrontMainView : UIView{ | ||
| 204 | CNLiveMineViewModel.requestApplyShopInfo { [weak self] result, respStatue in | 204 | CNLiveMineViewModel.requestApplyShopInfo { [weak self] result, respStatue in |
| 205 | 205 | ||
| 206 | if respStatue == .success { | 206 | if respStatue == .success { |
| 207 | + if currentViewController()?.navigationController == nil{ | ||
| 208 | + print("nil") | ||
| 209 | + } | ||
| 207 | currentViewController()?.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: true) | 210 | currentViewController()?.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: true) |
| 208 | } | 211 | } |
| 209 | } | 212 | } |
| 210 | }else{ | 213 | }else{ |
| 214 | + if currentViewController()?.navigationController == nil{ | ||
| 215 | + print("nil") | ||
| 216 | + } | ||
| 211 | currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: true) | 217 | currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: true) |
| 212 | } | 218 | } |
| 213 | 219 |