Commit 4af2c0c73bb0d9fc06a57193964ac430ddc4e125

Authored by 张旭
1 parent dec1499e

push动画统一

metaCode/Classes/Config/CNLiveConfigstant.swift
... ... @@ -34,6 +34,9 @@ let kBucketName_QN:String = "mam-wjjtest-802"
34 34 ///控制器背景色
35 35 let KVCBackgroupColor = UIColor("#F9F9F9")
36 36  
  37 +///控制器push动画Bool
  38 +let pushAnimated = true
  39 +
37 40 /**
38 41 获取系统状态栏高度
39 42 */
... ... @@ -66,21 +69,21 @@ public func get_system_nav_top_height() -> CGFloat {
66 69 获取系统tabbar高度
67 70 */
68 71 public func get_system_tabbar_height() -> CGFloat {
69   - return isiPhoneXSeries ? 83.0 : 49.0;
  72 + return isiPhoneXSeries ? 83.0 : 49.0
70 73 }
71 74  
72 75 /**
73 76 获取系统tabbarUI高度
74 77 */
75 78 public func get_system_tabbar_ui_height() -> CGFloat {
76   - return 49.0;
  79 + return 49.0
77 80 }
78 81  
79 82 /**
80 83 获取系统tabbarUI增加的高度 (因iPhoneX系列底部有安全区域增加的高度)
81 84 */
82 85 public func get_system_tabbar_ui_offsetHeight() -> CGFloat {
83   - return get_system_tabbar_height() - get_system_tabbar_ui_height();
  86 + return get_system_tabbar_height() - get_system_tabbar_ui_height()
84 87 }
85 88  
86 89  
... ...
metaCode/Classes/Extensions/NSObject+CNLiveExtensions.swift
... ... @@ -31,10 +31,11 @@ func currentViewController() -> (UIViewController?) {
31 31 }
32 32 }
33 33 let vc = window?.rootViewController
34   - print("currentVC:\(currentVC(vc)!)")
35   - print("currentVC.children:\((currentVC(vc)!).children)")
36   - print("currentVC.navi:\((currentVC(vc)!).navigationController)")
37   - return currentVC(vc)
  34 + let retVC = currentVC(vc)
  35 + print("currentVC:\(retVC!)")
  36 + print("111111currentVC.children:\(retVC!).children)")
  37 + print("111111currentVC.navi:\(retVC!.navigationController)")
  38 + return retVC
38 39 }
39 40  
40 41 private func currentVC(_ vc :UIViewController?) -> UIViewController? {
... ... @@ -54,10 +55,57 @@ private func currentVC(_ vc :UIViewController?) -> UIViewController? {
54 55 return currentVC(naiVC.visibleViewController)
55 56 }
56 57 else {
57   - return vc
  58 + print("111111vcChildren:\(vc?.children)")
  59 + print("111111vcChildrenlast.Navi:\(vc?.children.last?.navigationController)")
  60 + print("111111vcChildrenlast.Navi.controls:\(vc?.children.last?.navigationController?.viewControllers)")
  61 + return vc
58 62 }
59 63 }
60 64  
  65 + // 获取当前活动的navigationcontroller
  66 + func navigationViewController() -> UINavigationController{
  67 + var window = UIApplication.shared.keyWindow
  68 + if window?.windowLevel != UIWindow.Level.normal{
  69 + let windows = UIApplication.shared.windows
  70 + for windowTemp in windows{
  71 + if windowTemp.windowLevel == UIWindow.Level.normal{
  72 + window = windowTemp
  73 + break
  74 + }
  75 + }
  76 + }
  77 + if let isNav = window!.rootViewController?.isKind(of: UINavigationController.self){
  78 + let nav = window?.rootViewController as! UINavigationController
  79 + return nav
  80 + }else if let isTabbar = window!.rootViewController?.isKind(of: UITabBarController.self){
  81 + let tabbar = window?.rootViewController as! UITabBarController
  82 + let selectVc = tabbar.selectedViewController
  83 + if let isNavi = selectVc?.isKind(of: UINavigationController.self){
  84 + let nav = selectVc as! UINavigationController
  85 + return nav
  86 + }
  87 + }
  88 + return nil
  89 + }
  90 +- (UINavigationController *)navigationViewController
  91 +{
  92 +
  93 + if ([self.window.rootViewController isKindOfClass:[UINavigationController class]])
  94 + {
  95 + return (UINavigationController *)self.window.rootViewController;
  96 + }
  97 + else if ([self.window.rootViewController isKindOfClass:[UITabBarController class]])
  98 + {
  99 + UIViewController *selectVc = [((UITabBarController *)self.window.rootViewController) selectedViewController];
  100 + if ([selectVc isKindOfClass:[UINavigationController class]])
  101 + {
  102 + return (UINavigationController *)selectVc;
  103 + }
  104 + }
  105 + return nil;
  106 +}
  107 +
  108 +
61 109 /// 弹框提示
62 110 /// - Parameter message: 内容提示
63 111 func showMessage(message: String) {
... ...
metaCode/Classes/Main/HomePage/Controller/CNLiveDownShopDetailController.swift
... ... @@ -238,7 +238,7 @@ class CNLiveDownShopDetailController:CNLiveBaseViewController, UICollectionViewD
238 238 //MARK: - 网络请求获取店铺详情
239 239 func getShopDetailApi()
240 240 {
241   - showLoading(message: "")
  241 +// showLoading(message: "")
242 242 CNLiveShopDetailViewModel.requestShopDetailInfo(storeId: "") { result, status in
243 243 hiddenLoading()
244 244 if status == .success{
... ...
metaCode/Classes/Main/HomePage/Controller/CNLiveShopConsoleController.swift
... ... @@ -87,27 +87,27 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
87 87 let itemModel = listMdl.list[indexPath.item]
88 88 if itemModel.type == CNLiveShopConsoleType.XZSP.rawValue{
89 89 //商城新增商品
90   - currentViewController()?.navigationController?.pushViewController(CNLiveShopNewProductController.init(), animated: false)
  90 + currentViewController()?.navigationController?.pushViewController(CNLiveShopNewProductController.init(), animated: pushAnimated)
91 91  
92 92 }else if itemModel.type == CNLiveShopConsoleType.SPGL.rawValue{
93 93 //商城商品管理
94   - currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: false)
  94 + currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: pushAnimated)
95 95 }else if itemModel.type == CNLiveShopConsoleType.XZYHQ.rawValue{
96 96 //新增优惠券
97 97 let vc = CNLiveShopCouponCreateViewController(couponListModel: nil, type: .create)
98   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  98 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
99 99 }else if itemModel.type == CNLiveShopConsoleType.GLYHQ.rawValue{
100 100 //优惠券管理
101 101 let vc = CNLiveShopCouponsManagerViewController()
102   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  102 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
103 103 }else if itemModel.type == CNLiveShopConsoleType.CreateShopClassify.rawValue{
104 104 //创建店铺分类
105 105 let vc = CNLiveCreateShopClassifyViewController()
106 106 vc.classifyType = .oneLevelClassify
107   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  107 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
108 108 }else if itemModel.type == CNLiveShopConsoleType.ShopClassifyManager.rawValue{
109 109 //店铺分类管理
110   - currentViewController()?.navigationController?.pushViewController(CNLiveShopClassilyManageViewController.init(), animated: false)
  110 + currentViewController()?.navigationController?.pushViewController(CNLiveShopClassilyManageViewController.init(), animated: pushAnimated)
111 111 }else if itemModel.type == CNLiveShopConsoleType.FBDT.rawValue{
112 112 //发布动态
113 113  
... ... @@ -116,7 +116,7 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
116 116  
117 117 }else if itemModel.type == CNLiveShopConsoleType.DDGL.rawValue{
118 118 //订单管理
119   - currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: false)
  119 + currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: pushAnimated)
120 120 }
121 121 // else if itemModel.type == CNLiveShopConsoleType.SH.rawValue{
122 122 // //退款/售后
... ... @@ -129,14 +129,14 @@ class CNLiveShopConsoleController: CNLiveBaseViewController, UICollectionViewDel
129 129 //直播管理
130 130 let webVC = CNWebViewController()
131 131 webVC.url = URL(string: "http://wjjh5.cnlive.com/apkdownloadShop.php")
132   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  132 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
133 133 }
134 134 }
135 135  
136 136 //MARK: - 网络请求获取详情页
137 137 func getPageApi()
138 138 {
139   - showLoading(message: "")
  139 +// showLoading(message: "")
140 140 CNLiveShopConsoleViewModel.requestUserInfo() { result, status in
141 141 hiddenLoading()
142 142  
... ...
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
... ... @@ -572,7 +572,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
572 572 if(navigationAction.navigationType == .linkActivated){
573 573 let webVC = CNWebViewController()
574 574 webVC.url = URL(string: url)
575   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  575 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
576 576 decisionHandler(.cancel, preferences)
577 577 return
578 578 }else if(navigationAction.navigationType == .other){
... ... @@ -592,7 +592,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel
592 592 //MARK: - 网络请求获取身份列表
593 593 func getUserIdentityApi()
594 594 {
595   - showLoading(message: "")
  595 +// showLoading(message: "")
596 596 CNLiveMineViewModel.requestAuthStandList(page: 1)
597 597 { result, respStatue in
598 598  
... ...
metaCode/Classes/Main/HomePage/Controller/CNUpSlideViewController.swift
... ... @@ -205,7 +205,7 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa
205 205 //MARK: - 网络请求获取详情页
206 206 func getPageApi()
207 207 {
208   - showLoading(message: "")
  208 +// showLoading(message: "")
209 209 CNLiveDownSlideViewModel.requestGetPage(pageId: _downPath! as NSString) { result, status in
210 210 hiddenLoading()
211 211  
... ...
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveGoodsCategoryController.swift
... ... @@ -486,7 +486,7 @@ class CNLiveGoodsCategoryController: CNLiveBaseViewController, UITableViewDataSo
486 486 if self.navigationController == nil{
487 487 print("self nil")
488 488 }
489   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  489 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
490 490 }
491 491  
492 492 // MARK: - 数据请求
... ...
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopClassilyManageViewController.swift
... ... @@ -149,7 +149,7 @@ class CNLiveShopClassilyManageViewController:CNLiveBaseViewController, UITableVi
149 149 vc.successCompleteBlock = {[weak self] in
150 150 self!.loadData()
151 151 }
152   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  152 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
153 153 }
154 154 ///显示/隐藏子分类
155 155 func showChildCalssifyAction(section:Int,classifyModel:CNLiveShopClassifyModel){
... ... @@ -168,7 +168,7 @@ class CNLiveShopClassilyManageViewController:CNLiveBaseViewController, UITableVi
168 168 vc.successCompleteBlock = {[weak self] in
169 169 self!.loadData()
170 170 }
171   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  171 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
172 172 }
173 173 func editBtnActionWithMModel(classifyModel:CNLiveShopClassifyModel,type:CNLiveCreateType){
174 174 let data = modelToDictionary(classifyModel)
... ...
metaCode/Classes/Main/HomePage/Controller/GoodsManager/CNLiveShopProductManagerController.swift
... ... @@ -293,7 +293,7 @@ class CNLiveShopProductManagerController:CNLiveBaseViewController, UITableViewDa
293 293 // MARK: - BtnAction
294 294 @objc func addBtnAction(){
295 295  
296   - currentViewController()?.navigationController?.pushViewController(CNLiveShopNewProductController(), animated: false)
  296 + currentViewController()?.navigationController?.pushViewController(CNLiveShopNewProductController(), animated: pushAnimated)
297 297 }
298 298  
299 299 // MARK: - 商品编辑通知
... ...
metaCode/Classes/Main/HomePage/Controller/ShopCoupon/CNLiveShopCouponsManagerViewController.swift
... ... @@ -177,7 +177,7 @@ class CNLiveShopCouponsManagerViewController:CNLiveBaseViewController,UITableVie
177 177 }
178 178 }else{
179 179 let vc = CNLiveShopCouponCreateViewController(couponListModel: nil, type: .create)
180   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  180 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
181 181 }
182 182 }
183 183 // MARK: - UITableViewDelegate
... ...
metaCode/Classes/Main/HomePage/View/CNIDCardView.swift
... ... @@ -58,7 +58,7 @@ class CNIDCardView: UIView{
58 58 }
59 59  
60 60 func loadIDDetailData(){
61   - showLoading(message: "")
  61 +// showLoading(message: "")
62 62 CNLiveMineViewModel.requestsStandInfo(identityId: "\(_idModel!.id)", type: .havedate) { result, respStatue in
63 63 hiddenLoading()
64 64 if respStatue == .success {
... ...
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailBtnsCell.swift
... ... @@ -74,13 +74,13 @@ class CNLiveShopDetailBtnsCell: UICollectionViewCell {
74 74 ///push VC
75 75 if tag == 100 {
76 76 //商品管理
77   - currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: false)
  77 + currentViewController()?.navigationController?.pushViewController(CNLiveShopProductManagerController.init(), animated: pushAnimated)
78 78 }else if tag == 101 {
79 79 //订单管理
80   - currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: false)
  80 + currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: pushAnimated)
81 81 }else if tag == 102 {
82 82 //交易记录
83   - currentViewController()?.navigationController?.pushViewController(CNLiveShopTransViewController.init(), animated: false)
  83 + currentViewController()?.navigationController?.pushViewController(CNLiveShopTransViewController.init(), animated: pushAnimated)
84 84 }
85 85 // if tag == 100 {
86 86 // //发布动态
... ... @@ -88,7 +88,7 @@ class CNLiveShopDetailBtnsCell: UICollectionViewCell {
88 88 // //商品管理
89 89 // let webVC = CNWebViewController()
90 90 // webVC.url = URL(string:"https://www.baidu.com")
91   -// currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  91 +// currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
92 92 //
93 93 // }else if tag == 102 {
94 94 // //订单管理
... ...
metaCode/Classes/Main/HomePage/View/CNLiveShopDetailOrderAssetCell.swift
... ... @@ -125,12 +125,19 @@ class CNLiveShopDetailOrderAssetCell:UICollectionViewCell{
125 125 @objc func navsubBtnAction(_ sender: UIButton){
126 126 if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
127 127 //push订单VC
128   - currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: false)
  128 + currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: pushAnimated)
129 129 }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
130 130 //push余额VC
131 131 }
132 132 }
133 133 @objc func clickBtnAction(_ sender: UIButton){
  134 + if self.displayType == .CNLiveShopDetailDisplayTypeOrder{
  135 + //push订单VC
  136 + currentViewController()?.navigationController?.pushViewController(CNLiveShopOrderViewController.init(), animated: pushAnimated)
  137 + }else if self.displayType == .CNLiveShopDetailDisplayTypeAsset{
  138 + //push余额VC
  139 + }
  140 +
134 141 let tag = sender.tag
135 142 if tag == 100 {
136 143  
... ...
metaCode/Classes/Main/HomePage/View/CNLliveShopDetailBannerCell.swift
... ... @@ -99,6 +99,6 @@ class CNLliveShopDetailBannerCell:UICollectionViewCell,FSPagerViewDataSource,FSP
99 99 let bannerMdl = self.shopDetailModel?.banner[index]
100 100 let webVC = CNWebViewController()
101 101 webVC.url = URL(string: bannerMdl?.url ?? "")
102   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  102 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
103 103 }
104 104 }
... ...
metaCode/Classes/Main/HomePage/View/CNMainView.swift
... ... @@ -197,18 +197,18 @@ class CNFrontMainView : UIView{
197 197  
198 198 @objc func addStandBtnAction() {
199 199 //跳转到添加身份页面
200   -// currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _idModel!), animated: false)
  200 +// currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: _idModel!), animated: pushAnimated)
201 201 // DispatchQueue.main.asyncAfter(deadline: .now()+0.25){
202 202 if _idModel!.id == 9 {
203 203 showLoading(message: "")
204 204 CNLiveMineViewModel.requestApplyShopInfo { [weak self] result, respStatue in
205 205  
206 206 if respStatue == .success {
207   - currentViewController()?.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: false)
  207 + currentViewController()?.navigationController?.pushViewController(CNLiveMineShopViewController.init(showType: .one, listModel: (self?.idModel)!, tempArray: []), animated: pushAnimated)
208 208 }
209 209 }
210 210 }else{
211   - currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: false)
  211 + currentViewController()?.navigationController?.pushViewController(CNLiveMineInputViewController.init(listModel: self._idModel!), animated: pushAnimated)
212 212 }
213 213  
214 214 // }
... ...
metaCode/Classes/Main/Util/CNLiveCommonManager.swift
... ... @@ -23,7 +23,7 @@ class CNLiveCommonManager: NSObject{
23 23 let vc = CNLivePlayerViewController()
24 24 vc.setPlayUrl(playUrl: playURL, isLive: false)
25 25 vc.coverImageUrl = coverImageUrl
26   - currentViewController()?.navigationController?.pushViewController(vc, animated: false)
  26 + currentViewController()?.navigationController?.pushViewController(vc, animated: pushAnimated)
27 27 }
28 28  
29 29 /**
... ...
metaCode/Classes/Main/Util/CNLiveDownSlideTool.swift
... ... @@ -19,12 +19,12 @@ class CNLiveDownSlideTool:NSObject{
19 19 let regURL = urlComponents.url
20 20 let webVC = CNWebViewController()
21 21 webVC.url = regURL
22   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  22 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
23 23  
24 24 }else if (contentMdl.model == kCNDownSlideContentsModelModel3) || (contentMdl.model == kCNDownSlideContentsModelModel4){
25 25 let webVC = CNWebViewController()
26 26 webVC.url = URL(string: (contentMdl.thirdUrl)!)
27   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  27 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
28 28 }else if (contentMdl.model == kCNDownSlideContentsModelModelAlbum) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_ugc) || (contentMdl.model == kCNDownSlideContentsModelModelAlbum_video){
29 29  
30 30 let urlString = "http://wjjh5.cnlive.com/cnYmAlbumVideoList.html"
... ... @@ -35,7 +35,7 @@ class CNLiveDownSlideTool:NSObject{
35 35 let regURL = urlComponents?.url
36 36 let webVC = CNWebViewController()
37 37 webVC.url = regURL
38   - currentViewController()?.navigationController?.pushViewController(webVC, animated: false)
  38 + currentViewController()?.navigationController?.pushViewController(webVC, animated: pushAnimated)
39 39 }else{
40 40 return
41 41 }
... ...
metaCode/Classes/Main/Util/CNLivePlayer/CNLivePlayerView.swift
... ... @@ -101,7 +101,7 @@ class CNLivePlayerView:UIView,PLPlayerDelegate{
101 101 self?.currentOrientation = .portrait
102 102 }else{
103 103 self?.popCallBack!()
104   - currentViewController()?.navigationController?.popViewController(animated: false)
  104 + currentViewController()?.navigationController?.popViewController(animated: pushAnimated)
105 105 }
106 106 }
107 107 controlView.clickFrameBtnAction = {[weak self] in
... ...
metaCode/Info.plist
... ... @@ -2,8 +2,6 @@
2 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3 3 <plist version="1.0">
4 4 <dict>
5   - <key>CFBundleDevelopmentRegion</key>
6   - <string>zh_CN</string>
7 5 <key>CFBundleAllowMixedLocalizations</key>
8 6 <true/>
9 7 <key>CFBundleLocalizations</key>
... ...