Commit c4cbe6dde77e230e7b906c217b2d2ab62e222cf0
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
33 changed files
with
195 additions
and
482 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -695,7 +695,7 @@ |
| 695 | 695 | 1938BD152B3D6C6000390A34 /* Controller */ = { |
| 696 | 696 | isa = PBXGroup; |
| 697 | 697 | children = ( |
| 698 | - 1938BD272B48009600390A34 /* AuthController */, | |
| 698 | + 1938BD272B48009600390A34 /* HomeController */, | |
| 699 | 699 | 1938BD1D2B46791400390A34 /* PlayletHomePage */, |
| 700 | 700 | ); |
| 701 | 701 | path = Controller; |
| ... | ... | @@ -753,13 +753,13 @@ |
| 753 | 753 | path = PlayletHomePage; |
| 754 | 754 | sourceTree = "<group>"; |
| 755 | 755 | }; |
| 756 | - 1938BD272B48009600390A34 /* AuthController */ = { | |
| 756 | + 1938BD272B48009600390A34 /* HomeController */ = { | |
| 757 | 757 | isa = PBXGroup; |
| 758 | 758 | children = ( |
| 759 | 759 | 1938BD282B4800E500390A34 /* push相关 */, |
| 760 | 760 | 1938BD162B3D6C7F00390A34 /* CNLiveAuthViewController.swift */, |
| 761 | 761 | ); |
| 762 | - path = AuthController; | |
| 762 | + path = HomeController; | |
| 763 | 763 | sourceTree = "<group>"; |
| 764 | 764 | }; |
| 765 | 765 | 1938BD282B4800E500390A34 /* push相关 */ = { |
| ... | ... | @@ -2078,7 +2078,7 @@ |
| 2078 | 2078 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2079 | 2079 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 2080 | 2080 | CODE_SIGN_STYLE = Automatic; |
| 2081 | - CURRENT_PROJECT_VERSION = 1.0.6.24.02.04.18; | |
| 2081 | + CURRENT_PROJECT_VERSION = 1.0.7.24.03.01.16; | |
| 2082 | 2082 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2083 | 2083 | ENABLE_BITCODE = NO; |
| 2084 | 2084 | ENABLE_MODULE_VERIFIER = NO; |
| ... | ... | @@ -2150,7 +2150,7 @@ |
| 2150 | 2150 | "$(inherited)", |
| 2151 | 2151 | "@executable_path/Frameworks", |
| 2152 | 2152 | ); |
| 2153 | - MARKETING_VERSION = 1.0.6; | |
| 2153 | + MARKETING_VERSION = 1.0.7; | |
| 2154 | 2154 | OTHER_LDFLAGS = ( |
| 2155 | 2155 | "$(inherited)", |
| 2156 | 2156 | "-all_load", |
| ... | ... | @@ -2332,7 +2332,7 @@ |
| 2332 | 2332 | CODE_SIGN_ENTITLEMENTS = metaCode/metaCode.entitlements; |
| 2333 | 2333 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 2334 | 2334 | CODE_SIGN_STYLE = Automatic; |
| 2335 | - CURRENT_PROJECT_VERSION = 1.0.6.24.02.04.18; | |
| 2335 | + CURRENT_PROJECT_VERSION = 1.0.7.24.03.01.16; | |
| 2336 | 2336 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 2337 | 2337 | ENABLE_BITCODE = NO; |
| 2338 | 2338 | ENABLE_MODULE_VERIFIER = NO; |
| ... | ... | @@ -2404,7 +2404,7 @@ |
| 2404 | 2404 | "$(inherited)", |
| 2405 | 2405 | "@executable_path/Frameworks", |
| 2406 | 2406 | ); |
| 2407 | - MARKETING_VERSION = 1.0.6; | |
| 2407 | + MARKETING_VERSION = 1.0.7; | |
| 2408 | 2408 | OTHER_LDFLAGS = ( |
| 2409 | 2409 | "$(inherited)", |
| 2410 | 2410 | "-all_load", | ... | ... |
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
| ... | ... | @@ -90,7 +90,7 @@ class UploadManager: NSObject { |
| 90 | 90 | /// - resultBlock: 结果 |
| 91 | 91 | static private func uploadData(madiaData: NSData, key: String, progress: ProgressBlcok?, success: SuccessBlock?) { |
| 92 | 92 | let param = NSMutableDictionary() |
| 93 | - param.setValue(APPId, forKey: "appId") | |
| 93 | + param.setValue(CNLiveMCEnvironmentManager.shared.appId, forKey: "appId") | |
| 94 | 94 | param.setValue("POST", forKey: "verb") |
| 95 | 95 | param.setValue("2", forKey: "storageType") |
| 96 | 96 | param.setValue(kBucketName_QN, forKey: "bucket") |
| ... | ... | @@ -101,7 +101,7 @@ class UploadManager: NSObject { |
| 101 | 101 | CNLiveNetworking.setupShowResult(true) |
| 102 | 102 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 103 | 103 | CNLiveNetworking.setupShowDataResult(false) |
| 104 | - CNLiveNetworking.setupSignRequestKey(APPKey)//APPKey_wjj APPKey | |
| 104 | + CNLiveNetworking.setupSignRequestKey(CNLiveMCEnvironmentManager.shared.appKey)//APPKey_wjj APPKey | |
| 105 | 105 | |
| 106 | 106 | CNLiveNetworking.requestNetwork(with: .POST, urlString: "\(CNLiveMCEnvironmentManager.shared.img_token_url)/vod_epg/getUploadAuthForApp", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 107 | 107 | hiddenLoading() | ... | ... |
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
| ... | ... | @@ -17,7 +17,7 @@ let Height: CGFloat = UIScreen.main.bounds.size.height |
| 17 | 17 | let LeftGap: CGFloat = UIScreen.main.bounds.size.width <= 375 ? 23 : 40 |
| 18 | 18 | |
| 19 | 19 | ///主窗口宽度 |
| 20 | -let MainViewW: CGFloat = Width-LeftGap*2//Width-50 | |
| 20 | +let MainViewW: CGFloat = Width-LeftGap*2 | |
| 21 | 21 | ///下滑页底部工具条高度 |
| 22 | 22 | let DownSlideBottomViewHeight: CGFloat = 74 |
| 23 | 23 | |
| ... | ... | @@ -26,14 +26,6 @@ let CNKeyIsFirstAppearUpSlideHomeGuide: String = "isFirstAppearUpSlideHomeGuideK |
| 26 | 26 | ///存储是否第一次显示首页下滑引导 |
| 27 | 27 | let CNKeyIsFirstAppearDownSlideHomeGuide: String = "isFirstAppearDownSlideHomeGuideKey" |
| 28 | 28 | |
| 29 | -/////用户身份认证状态 | |
| 30 | -//enum UserIdentityStatus { | |
| 31 | -// ///未认证 | |
| 32 | -// case notCertified | |
| 33 | -// ///已经认证 | |
| 34 | -// case haveBeenCertified | |
| 35 | -//} | |
| 36 | - | |
| 37 | 29 | ///数据状态 |
| 38 | 30 | enum NetAPIStatus { |
| 39 | 31 | ///接口成功 |
| ... | ... | @@ -65,8 +57,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 65 | 57 | ///tabBar 的Y坐标位置 |
| 66 | 58 | private var tabBarY:CGFloat = 0.0 |
| 67 | 59 | |
| 68 | - ///用户身份认证状态 | |
| 69 | -// private var identityStatus: UserIdentityStatus = .notCertified | |
| 70 | 60 | ///接口状态 |
| 71 | 61 | private var NetApiStatus: NetAPIStatus = .apiError |
| 72 | 62 | ///接口状态 |
| ... | ... | @@ -127,51 +117,51 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 127 | 117 | return errorFreshButton |
| 128 | 118 | }() |
| 129 | 119 | |
| 130 | - ///上滑引导View | |
| 131 | - lazy var upSlideGuideView:CNHomePageGuideView = { | |
| 132 | - let upSlideGuideView = CNHomePageGuideView.init(frame: UIScreen.main.bounds) | |
| 133 | - upSlideGuideView.setBottomText(text: "向上滑动") | |
| 134 | - upSlideGuideView.skipAction = { | |
| 135 | - [weak self] in | |
| 136 | - self?.upSlideGuideView.removeFromSuperview() | |
| 137 | - self?.upSlideGifView.removeFromSuperview() | |
| 138 | - UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 139 | - UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 140 | - self?.pageFlowView.scrollView.isScrollEnabled = true | |
| 141 | - } | |
| 142 | - return upSlideGuideView | |
| 143 | - }() | |
| 144 | - ///上滑引导动图 | |
| 145 | - lazy var upSlideGifView:UIImageView = { | |
| 146 | - let gif: UIImageView = UIImageView(frame: CGRect(x: 200, y: 30, width: 40, height: 80)) | |
| 147 | - gif.loadGif(name: "slide_up") | |
| 148 | - gif.center = self.view.center | |
| 149 | - gif.contentMode = .scaleAspectFill | |
| 150 | - | |
| 151 | - return gif | |
| 152 | - }() | |
| 153 | - | |
| 154 | - ///下滑引导View | |
| 155 | - lazy var downSlideGuideView:CNHomePageGuideView = { | |
| 156 | - let downSlideGuideView = CNHomePageGuideView.init(frame: UIScreen.main.bounds) | |
| 157 | - downSlideGuideView.setBottomText(text: "向下滑动") | |
| 158 | - downSlideGuideView.skipAction = { | |
| 159 | - [weak self ] in | |
| 160 | - self?.downSlideGuideView.removeFromSuperview() | |
| 161 | - self?.downSlideGifView.removeFromSuperview() | |
| 162 | - UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 163 | - self?.pageFlowView.scrollView.isScrollEnabled = true | |
| 164 | - } | |
| 165 | - return downSlideGuideView | |
| 166 | - }() | |
| 167 | - ///下滑引导动图 | |
| 168 | - lazy var downSlideGifView:UIImageView = { | |
| 169 | - let gif: UIImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 80)) | |
| 170 | - gif.center = self.view.center | |
| 171 | - gif.loadGif(name: "slide_down") | |
| 172 | - gif.contentMode = .scaleAspectFill | |
| 173 | - return gif | |
| 174 | - }() | |
| 120 | +// ///上滑引导View | |
| 121 | +// lazy var upSlideGuideView:CNHomePageGuideView = { | |
| 122 | +// let upSlideGuideView = CNHomePageGuideView.init(frame: UIScreen.main.bounds) | |
| 123 | +// upSlideGuideView.setBottomText(text: "向上滑动") | |
| 124 | +// upSlideGuideView.skipAction = { | |
| 125 | +// [weak self] in | |
| 126 | +// self?.upSlideGuideView.removeFromSuperview() | |
| 127 | +// self?.upSlideGifView.removeFromSuperview() | |
| 128 | +// UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 129 | +// UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 130 | +// self?.pageFlowView.scrollView.isScrollEnabled = true | |
| 131 | +// } | |
| 132 | +// return upSlideGuideView | |
| 133 | +// }() | |
| 134 | +// ///上滑引导动图 | |
| 135 | +// lazy var upSlideGifView:UIImageView = { | |
| 136 | +// let gif: UIImageView = UIImageView(frame: CGRect(x: 200, y: 30, width: 40, height: 80)) | |
| 137 | +// gif.loadGif(name: "slide_up") | |
| 138 | +// gif.center = self.view.center | |
| 139 | +// gif.contentMode = .scaleAspectFill | |
| 140 | +// | |
| 141 | +// return gif | |
| 142 | +// }() | |
| 143 | +// | |
| 144 | +// ///下滑引导View | |
| 145 | +// lazy var downSlideGuideView:CNHomePageGuideView = { | |
| 146 | +// let downSlideGuideView = CNHomePageGuideView.init(frame: UIScreen.main.bounds) | |
| 147 | +// downSlideGuideView.setBottomText(text: "向下滑动") | |
| 148 | +// downSlideGuideView.skipAction = { | |
| 149 | +// [weak self ] in | |
| 150 | +// self?.downSlideGuideView.removeFromSuperview() | |
| 151 | +// self?.downSlideGifView.removeFromSuperview() | |
| 152 | +// UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 153 | +// self?.pageFlowView.scrollView.isScrollEnabled = true | |
| 154 | +// } | |
| 155 | +// return downSlideGuideView | |
| 156 | +// }() | |
| 157 | +// ///下滑引导动图 | |
| 158 | +// lazy var downSlideGifView:UIImageView = { | |
| 159 | +// let gif: UIImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 80)) | |
| 160 | +// gif.center = self.view.center | |
| 161 | +// gif.loadGif(name: "slide_down") | |
| 162 | +// gif.contentMode = .scaleAspectFill | |
| 163 | +// return gif | |
| 164 | +// }() | |
| 175 | 165 | |
| 176 | 166 | ///左右滑动分页view |
| 177 | 167 | lazy var pageFlowView: NewPagedFlowView = { |
| ... | ... | @@ -266,14 +256,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 266 | 256 | |
| 267 | 257 | self.makeConstraints() |
| 268 | 258 | |
| 269 | -// switch self.identityStatus{ | |
| 270 | -// | |
| 271 | -// case .notCertified: | |
| 272 | -// self.view.addSubview(self.addCertificationView) | |
| 273 | -// case .haveBeenCertified: | |
| 274 | -// self.addPageView() | |
| 275 | -// } | |
| 276 | - | |
| 277 | 259 | } |
| 278 | 260 | |
| 279 | 261 | // MARK: -事件 |
| ... | ... | @@ -355,32 +337,31 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 355 | 337 | self.view.addSubview(self.pageFlowView) |
| 356 | 338 | self.pageFlowView.reloadData() |
| 357 | 339 | |
| 358 | - //首选判断是否显示了上滑引导 | |
| 359 | - let isFirstAppearUpSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 360 | 340 | |
| 361 | - if let tempGuide = isFirstAppearUpSlideHomeGuide{ | |
| 362 | - //已经显示过上滑引导 | |
| 363 | - | |
| 364 | - //判断是否显示过下滑引导 | |
| 365 | - let isFirstAppearDownSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 366 | - if let tempDownGuide = isFirstAppearDownSlideHomeGuide{ | |
| 367 | - | |
| 368 | - }else{ | |
| 369 | - //没有显示下滑引导 | |
| 370 | - self.pageFlowView.scrollView.isScrollEnabled = false | |
| 371 | - UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 372 | - UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 373 | -// self.tabBarController?.tabBar.isHidden = true | |
| 374 | - } | |
| 375 | - | |
| 376 | - }else{ | |
| 377 | - //没显示过上滑引导 | |
| 378 | - self.pageFlowView.scrollView.isScrollEnabled = false | |
| 379 | - | |
| 380 | - UIApplication.shared.keyWindow!.addSubview(self.upSlideGuideView) | |
| 381 | - UIApplication.shared.keyWindow!.addSubview(self.upSlideGifView) | |
| 382 | -// self.tabBarController?.tabBar.isHidden = true | |
| 383 | - } | |
| 341 | +// //首选判断是否显示了上滑引导 | |
| 342 | +// let isFirstAppearUpSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 343 | +// | |
| 344 | +// if let tempGuide = isFirstAppearUpSlideHomeGuide{ | |
| 345 | +// //已经显示过上滑引导 | |
| 346 | +// | |
| 347 | +// //判断是否显示过下滑引导 | |
| 348 | +// let isFirstAppearDownSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 349 | +// if let tempDownGuide = isFirstAppearDownSlideHomeGuide{ | |
| 350 | +// | |
| 351 | +// }else{ | |
| 352 | +// //没有显示下滑引导 | |
| 353 | +// self.pageFlowView.scrollView.isScrollEnabled = false | |
| 354 | +// UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 355 | +// UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 356 | +// } | |
| 357 | +// | |
| 358 | +// }else{ | |
| 359 | +// //没显示过上滑引导 | |
| 360 | +// self.pageFlowView.scrollView.isScrollEnabled = false | |
| 361 | +// | |
| 362 | +// UIApplication.shared.keyWindow!.addSubview(self.upSlideGuideView) | |
| 363 | +// UIApplication.shared.keyWindow!.addSubview(self.upSlideGifView) | |
| 364 | +// } | |
| 384 | 365 | } |
| 385 | 366 | |
| 386 | 367 | // MARK: -左滑手势代理 |
| ... | ... | @@ -501,23 +482,23 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 501 | 482 | func customIndexViewWillBeiginScroll(scrollView: UIScrollView) { |
| 502 | 483 | self.view.height = KSreenHeight |
| 503 | 484 | |
| 504 | - /**开始拖拽移除引导View**/ | |
| 505 | - | |
| 506 | - //移除上滑引导 | |
| 507 | - if(self.upSlideGuideView.superview != nil){ | |
| 508 | - self.upSlideGuideView.removeFromSuperview() | |
| 509 | - self.upSlideGifView.removeFromSuperview() | |
| 510 | - UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 511 | - } | |
| 512 | - | |
| 513 | - //移除下滑引导 | |
| 514 | - if (self.downSlideGuideView.superview != nil) { | |
| 515 | - | |
| 516 | - self.downSlideGuideView.removeFromSuperview() | |
| 517 | - self.downSlideGifView.removeFromSuperview() | |
| 518 | - UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 519 | - self.pageFlowView.scrollView.isScrollEnabled = true | |
| 520 | - } | |
| 485 | +// /**开始拖拽移除引导View**/ | |
| 486 | +// | |
| 487 | +// //移除上滑引导 | |
| 488 | +// if(self.upSlideGuideView.superview != nil){ | |
| 489 | +// self.upSlideGuideView.removeFromSuperview() | |
| 490 | +// self.upSlideGifView.removeFromSuperview() | |
| 491 | +// UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearUpSlideHomeGuide) | |
| 492 | +// } | |
| 493 | +// | |
| 494 | +// //移除下滑引导 | |
| 495 | +// if (self.downSlideGuideView.superview != nil) { | |
| 496 | +// | |
| 497 | +// self.downSlideGuideView.removeFromSuperview() | |
| 498 | +// self.downSlideGifView.removeFromSuperview() | |
| 499 | +// UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 500 | +// self.pageFlowView.scrollView.isScrollEnabled = true | |
| 501 | +// } | |
| 521 | 502 | |
| 522 | 503 | } |
| 523 | 504 | func customIndexViewDidScroll(scrollView: UIScrollView) { |
| ... | ... | @@ -566,16 +547,16 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 566 | 547 | if scrollView.contentOffset.y == KSreenHeight { |
| 567 | 548 | self.view.height = self.tabBarY |
| 568 | 549 | |
| 569 | - //判断是否显示过下滑引导 | |
| 570 | - let isFirstAppearDownSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 571 | - if let tempDownGuide = isFirstAppearDownSlideHomeGuide{ | |
| 572 | - print("不该进来") | |
| 573 | - }else{ | |
| 574 | - //没有显示下滑引导 | |
| 575 | - UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 576 | - UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 577 | - self.pageFlowView.scrollView.isScrollEnabled = false | |
| 578 | - } | |
| 550 | +// //判断是否显示过下滑引导 | |
| 551 | +// let isFirstAppearDownSlideHomeGuide:Any? = UserDefaults.standard.object(forKey: CNKeyIsFirstAppearDownSlideHomeGuide) | |
| 552 | +// if let tempDownGuide = isFirstAppearDownSlideHomeGuide{ | |
| 553 | +// print("不该进来") | |
| 554 | +// }else{ | |
| 555 | +// //没有显示下滑引导 | |
| 556 | +// UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 557 | +// UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 558 | +// self.pageFlowView.scrollView.isScrollEnabled = false | |
| 559 | +// } | |
| 579 | 560 | } |
| 580 | 561 | } |
| 581 | 562 | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| ... | ... | @@ -75,7 +75,6 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa |
| 75 | 75 | tableView.delegate = self |
| 76 | 76 | tableView.separatorStyle = .none |
| 77 | 77 | tableView.bounces = false |
| 78 | -// tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideCellIdentifier) | |
| 79 | 78 | tableView.register(CNLiveDownSlideRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideRecommendCellIdentifier) |
| 80 | 79 | tableView.register(CNLiveDownSlideTodayRecommendCell.self, forCellReuseIdentifier: kCNLiveDownSlideTodayRecommendCellIdentifier) |
| 81 | 80 | tableView.register(CNDownSlideSingleCourseCell.self, forCellReuseIdentifier: kCNLiveDownSlideAllCourseCellIdentifier) | ... | ... |
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebView.swift
| ... | ... | @@ -11,6 +11,10 @@ import WebViewJavascriptBridge |
| 11 | 11 | import CNLiveShareToolKit |
| 12 | 12 | import CommonCrypto |
| 13 | 13 | import CNLiveBusinessTools |
| 14 | +import SKPhotoBrowser | |
| 15 | + | |
| 16 | +//更新Web控制器导航回调 | |
| 17 | +typealias cnWebControllerUpdateNavBlock = (_ isFinish:Bool , _ titleName:String ,_ isDecidePolicy:Bool , _ urlStr:String)->Void | |
| 14 | 18 | |
| 15 | 19 | class CNWebView:UIView,WKNavigationDelegate{ |
| 16 | 20 | |
| ... | ... | @@ -21,11 +25,15 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 21 | 25 | return cnWebView |
| 22 | 26 | }() |
| 23 | 27 | |
| 24 | - | |
| 25 | 28 | var webUrl:URL?//初始URL |
| 26 | 29 | var currentUrl:String = ""//当前网页的url |
| 27 | 30 | var bridge:WKWebViewJavascriptBridge? |
| 28 | 31 | |
| 32 | + //CNWebController | |
| 33 | + var isCNWebController:Bool = false//是否网页控制器 | |
| 34 | + var webControllerUpdateNavBlock:cnWebControllerUpdateNavBlock? | |
| 35 | + | |
| 36 | + | |
| 29 | 37 | init(frame: CGRect, configuration: WKWebViewConfiguration ,url:URL?) { |
| 30 | 38 | super.init(frame: frame) |
| 31 | 39 | self.configuration = configuration |
| ... | ... | @@ -56,8 +64,9 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 56 | 64 | self.bridge = WKWebViewJavascriptBridge(for: self.cnWebView) |
| 57 | 65 | self.bridge?.setWebViewDelegate(self) |
| 58 | 66 | } |
| 59 | - //h5拉起原生分享 js call oc | |
| 67 | + //h5拉起原生 | |
| 60 | 68 | func configBridgeRegister() -> Void { |
| 69 | + //h5拉起原生分享 js call oc | |
| 61 | 70 | self.bridge?.registerHandler("wjjylzgVideoShare", handler: { data, responseCallback in |
| 62 | 71 | // print("js call oc\(data)") |
| 63 | 72 | let dic = data as! Dictionary<String, String> |
| ... | ... | @@ -70,6 +79,33 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 70 | 79 | } |
| 71 | 80 | |
| 72 | 81 | }) |
| 82 | + // 网页内容图片预览 | |
| 83 | + self.bridge?.registerHandler("wjjPreviewImage", handler: { data, responseCallback in | |
| 84 | + // print("js call oc\(data)") | |
| 85 | + var images = [SKPhoto]() | |
| 86 | + let dic = data as! Dictionary<String, Any> | |
| 87 | + let index = (dic["index"] as! NSString).integerValue | |
| 88 | + let imageArray = dic["imgArr"] as! NSArray | |
| 89 | + var imgArray = NSMutableArray() | |
| 90 | + for dict in imageArray { | |
| 91 | + var imgUrl = "" | |
| 92 | + if let dictemp = dict as? String{ | |
| 93 | + imgArray.add(dictemp) | |
| 94 | + imgUrl = dictemp | |
| 95 | + }else if let dictemp = dict as? Dictionary<String, Any>{ | |
| 96 | + imgArray.add(dictemp["src"] ?? "") | |
| 97 | + imgUrl = dictemp["src"] as! String | |
| 98 | + } | |
| 99 | + let photo = SKPhoto.photoWithImageURL(imgUrl) | |
| 100 | + photo.shouldCachePhotoURLImage = false | |
| 101 | + photo.photoURL = imgUrl | |
| 102 | + images.append(photo) | |
| 103 | + } | |
| 104 | + let browser = SKPhotoBrowser(photos: images) | |
| 105 | + browser.initializePageIndex(index) | |
| 106 | + currentViewController()?.present(browser, animated: true) | |
| 107 | + | |
| 108 | + }) | |
| 73 | 109 | } |
| 74 | 110 | |
| 75 | 111 | required init?(coder: NSCoder) { |
| ... | ... | @@ -143,7 +179,7 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 143 | 179 | // 页面加载完成之后调用 |
| 144 | 180 | func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { |
| 145 | 181 | print("didFinish") |
| 146 | -// titleName = webView.title! | |
| 182 | + self.webControllerUpdateNavBlock?(true, webView.title!, false , "") | |
| 147 | 183 | } |
| 148 | 184 | // 页面加载失败时调用 |
| 149 | 185 | func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { |
| ... | ... | @@ -160,8 +196,6 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 160 | 196 | |
| 161 | 197 | //允许跳转 |
| 162 | 198 | decisionHandler(.allow) |
| 163 | - //不允许跳转 | |
| 164 | - // decisionHandler(.cancel) | |
| 165 | 199 | } |
| 166 | 200 | // 在发送请求之前,决定是否跳转 -> 默认允许 |
| 167 | 201 | func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { |
| ... | ... | @@ -170,14 +204,8 @@ class CNWebView:UIView,WKNavigationDelegate{ |
| 170 | 204 | var urlStr = (navigationAction.request.url?.absoluteString)! |
| 171 | 205 | |
| 172 | 206 | if navigationAction.request.url?.host == WjjH5 { |
| 207 | + self.webControllerUpdateNavBlock?(false, "", true , urlStr) | |
| 173 | 208 | |
| 174 | -// if urlStr.contains("&isWjjReport=true") || urlStr.contains("?isWjjReport=true"){ | |
| 175 | -// self.rightNavBtns = [self.moreNavBtn] | |
| 176 | -// self.moreNavBtn.isHidden = false | |
| 177 | -// }else{ | |
| 178 | -// self.moreNavBtn.isHidden = true | |
| 179 | -// } | |
| 180 | - | |
| 181 | 209 | urlStr = self.checkURLWithStr(urlStr: urlStr) |
| 182 | 210 | self.currentUrl = urlStr |
| 183 | 211 | } | ... | ... |
metaCode/Classes/Main/HomePage/Controller/WebController/CNWebViewController.swift
| ... | ... | @@ -11,6 +11,7 @@ import WebViewJavascriptBridge |
| 11 | 11 | import CNLiveShareToolKit |
| 12 | 12 | import CommonCrypto |
| 13 | 13 | import CNLiveBusinessTools |
| 14 | +import SKPhotoBrowser | |
| 14 | 15 | |
| 15 | 16 | |
| 16 | 17 | let WjjH5 = "wjjh5.cnlive.com" |
| ... | ... | @@ -21,7 +22,7 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ |
| 21 | 22 | var bridge:WKWebViewJavascriptBridge? |
| 22 | 23 | var currentUrl:String = ""//当前网页的url |
| 23 | 24 | |
| 24 | - lazy var webView: WKWebView = { | |
| 25 | + lazy var webView: CNWebView = { | |
| 25 | 26 | let configuration = WKWebViewConfiguration() |
| 26 | 27 | configuration.allowsInlineMediaPlayback = true |
| 27 | 28 | let preferences = WKPreferences() |
| ... | ... | @@ -30,11 +31,10 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ |
| 30 | 31 | configuration.preferences.minimumFontSize = 0.0 |
| 31 | 32 | configuration.preferences = preferences |
| 32 | 33 | configuration.userContentController = WKUserContentController() |
| 33 | - | |
| 34 | - let webView = WKWebView(frame: CGRectMake(0, 0, Width, Height), configuration: configuration) | |
| 35 | - webView.scrollView.showsVerticalScrollIndicator = false | |
| 36 | - webView.scrollView.showsHorizontalScrollIndicator = false | |
| 37 | -// webView.navigationDelegate = self | |
| 34 | + let webView = CNWebView(frame: CGRectMake(0, 0, Width, Height), configuration: configuration, url: _url) | |
| 35 | + webView.cnWebView.scrollView.showsVerticalScrollIndicator = false | |
| 36 | + webView.cnWebView.scrollView.showsHorizontalScrollIndicator = false | |
| 37 | + webView.isCNWebController = true | |
| 38 | 38 | return webView |
| 39 | 39 | }() |
| 40 | 40 | |
| ... | ... | @@ -62,58 +62,29 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ |
| 62 | 62 | super.viewDidLoad() |
| 63 | 63 | navigationBarHidden = false |
| 64 | 64 | self.view.addSubview(self.webView) |
| 65 | + self.webView.webControllerUpdateNavBlock = { isFinish , title,isDecidePolicy ,urlStr in | |
| 66 | + if isFinish{ | |
| 67 | + self.titleName = title | |
| 68 | + }else if isDecidePolicy{ | |
| 69 | + if urlStr.contains("&isWjjReport=true") || urlStr.contains("?isWjjReport=true"){ | |
| 70 | + self.rightNavBtns = [self.moreNavBtn] | |
| 71 | + self.moreNavBtn.isHidden = false | |
| 72 | + }else{ | |
| 73 | + self.moreNavBtn.isHidden = true | |
| 74 | + } | |
| 75 | + } | |
| 76 | + } | |
| 65 | 77 | webView.snp.makeConstraints { make in |
| 66 | 78 | make.top.equalTo(get_system_nav_height()) |
| 67 | 79 | make.left.right.bottom.equalToSuperview() |
| 68 | 80 | } |
| 69 | - webView.evaluateJavaScript("navigator.userAgent") { [self] result, error in | |
| 70 | - let userAgent = result as! String | |
| 71 | - if error == nil && userAgent.count > 0 { | |
| 72 | - if !userAgent.contains(CNLiveMCEnvironmentManager.shared.base_web_UA) { | |
| 73 | - let newUserAgent = userAgent + CNLiveMCEnvironmentManager.shared.base_web_UA | |
| 74 | - webView.customUserAgent = newUserAgent | |
| 75 | - | |
| 76 | - if (_url != nil){ | |
| 77 | - let urlStr = self.checkURLWithStr(urlStr: _url!.absoluteString) | |
| 78 | - self.currentUrl = urlStr | |
| 79 | - | |
| 80 | - webView.load(URLRequest.init(url:URL(string: urlStr)!)) | |
| 81 | - } | |
| 82 | - self.configBridge() | |
| 83 | - self.configBridgeRegister() | |
| 84 | - } | |
| 85 | - } | |
| 86 | - } | |
| 87 | - } | |
| 88 | - | |
| 89 | - func configBridge(){ | |
| 90 | - WKWebViewJavascriptBridge.enableLogging() | |
| 91 | - self.bridge = WKWebViewJavascriptBridge(for: self.webView) | |
| 92 | - self.bridge?.setWebViewDelegate(self) | |
| 93 | - } | |
| 94 | - //h5拉起原生分享 js call oc | |
| 95 | - func configBridgeRegister() -> Void { | |
| 96 | - self.bridge?.registerHandler("wjjylzgVideoShare", handler: { data, responseCallback in | |
| 97 | -// print("js call oc\(data)") | |
| 98 | - let dic = data as! Dictionary<String, String> | |
| 99 | - CNLiveShareManager.showShareViewWithParam(forShareTitle: dic["title"], shareUrl: dic["shareUrl"], shareDesc: dic["subTitle"], shareImage: dic["cover"], screenFull: false, hiddenWjj: true, hiddenQQ: false, hiddenWB: true, hiddenLifeCircle: true, hiddenWechatCircle: false, hiddenWechat: false, hiddenSafari: true, formVC: self, topImage: [], topTitles: [], platformType: .all) { title in | |
| 100 | - | |
| 101 | - } completerBlock: { resultType, platformType, typeString in | |
| 102 | - if resultType == .succ{ | |
| 103 | - | |
| 104 | - } | |
| 105 | - } | |
| 106 | - | |
| 107 | - }) | |
| 108 | 81 | } |
| 109 | 82 | |
| 110 | 83 | //点击...分享获取h5参数oc call js |
| 111 | 84 | func configBridgeCallHander() -> Void { |
| 112 | - self.bridge?.callHandler("wjjClientGetShareParaFromJS", data: ["":""], responseCallback: { data in | |
| 85 | + self.webView.bridge?.callHandler("wjjClientGetShareParaFromJS", data: ["":""], responseCallback: { data in | |
| 113 | 86 | // print("js call oc\(data)") |
| 114 | 87 | let dic = data as! Dictionary<String, String> |
| 115 | -// let shareType = dic["shareType"] | |
| 116 | -// let contentIdStr = dic["activityId"] | |
| 117 | 88 | let title = dic["title"] |
| 118 | 89 | let desc = dic["desc"] |
| 119 | 90 | let shareImg = dic["shareImg"] |
| ... | ... | @@ -139,143 +110,15 @@ class CNWebViewController:CNLiveBaseViewController ,WKNavigationDelegate{ |
| 139 | 110 | }) |
| 140 | 111 | } |
| 141 | 112 | |
| 142 | - func checkURLWithStr(urlStr:String) -> String{ | |
| 143 | - if URL(string: urlStr)?.host != WjjH5 { | |
| 144 | - return urlStr//不是wjjh5不作处理 | |
| 145 | - } | |
| 146 | - var str = urlStr | |
| 147 | - let date = Date() | |
| 148 | - let formatter = DateFormatter() | |
| 149 | - formatter.dateFormat = "yyyyMMdd" | |
| 150 | - let dateStr = formatter.string(from: date) | |
| 151 | - let sidStr = String(format: "%@%@", UserInfoManager.shared.userInfo.uid,dateStr) | |
| 152 | - let signStr = sidStr.crypt(operation: CCOperation(kCCEncrypt), key: CNLiveMCEnvironmentManager.shared.appKey) | |
| 153 | - //看是 appKey还是appKeywjj | |
| 154 | - let sidSignStr = (signStr ?? "").isEmpty ? "" : signStr | |
| 155 | - let sourceArray = str.components(separatedBy: "?") | |
| 156 | - let buildVersion = Bundle.main.infoDictionary!["CFBundleVersion"] as! String | |
| 157 | - let appVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String | |
| 158 | - let uuid = CNLiveBusinessTools.getUidForStat(Date()) | |
| 159 | - if sourceArray.count == 1{ | |
| 160 | - //是wjjh5且无参数 | |
| 161 | - str = String(format: "%@?shareSid=%@&sid=%@&plat=i&ver=%@&version=%@&wjjFrom=apple&wjjUUID=%@&appId=%@&voteId=%@&wjjToken=%@", str,UserInfoManager.shared.userInfo.uid,UserInfoManager.shared.userInfo.uid,buildVersion,appVersion,uuid,CNLiveMCEnvironmentManager.shared.appId,sidSignStr!,UserInfoManager.shared.userInfo.token) | |
| 162 | - return str | |
| 163 | - } | |
| 164 | - //是wjjh5且有参数 | |
| 165 | - let paraArr = NSMutableArray(array: ["shareSid=","sid=","plat=","ver=","version=","wjjFrom=","wjjUUID=","appId=","voteId=","wjjToken="]) | |
| 166 | - let valueArr = NSMutableArray(array:[UserInfoManager.shared.userInfo.uid,UserInfoManager.shared.userInfo.uid,"i",buildVersion,appVersion,"apple",uuid,CNLiveMCEnvironmentManager.shared.appId,sidSignStr!,UserInfoManager.shared.userInfo.token]) | |
| 167 | - var i = 0 | |
| 168 | - for paraStr in paraArr{ | |
| 169 | - let tempStr = paraStr as! String | |
| 170 | - let paramStr = "&".appending(tempStr) | |
| 171 | - let paramStr2 = "?".appending(tempStr) | |
| 172 | - | |
| 173 | - if str.contains(paramStr){ | |
| 174 | - //包含则替换 &sid= | |
| 175 | - let lastStr = str.components(separatedBy: tempStr).last | |
| 176 | - let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)! | |
| 177 | - let oldStr = tempStr.appending(lastSeparatedStr) | |
| 178 | - let tempValueStr = tempStr.appending(valueArr[i] as! String) | |
| 179 | - str = str.replacingOccurrences(of: oldStr, with: tempValueStr) | |
| 180 | - }else if str.contains(paramStr2){ | |
| 181 | - //包含则替换 &sid= | |
| 182 | - let lastStr = str.components(separatedBy: tempStr).last | |
| 183 | - let lastSeparatedStr = (lastStr?.components(separatedBy: "&").first)! | |
| 184 | - let oldStr = tempStr.appending(lastSeparatedStr) | |
| 185 | - let tempValueStr = tempStr.appending(valueArr[i] as! String) | |
| 186 | - str = str.replacingOccurrences(of: oldStr, with: tempValueStr) | |
| 187 | - }else{ | |
| 188 | - //不包含则拼接 | |
| 189 | - str = String(format: "%@&%@%@", str,tempStr,valueArr[i] as! String) | |
| 190 | - } | |
| 191 | - i = i + 1 | |
| 192 | - } | |
| 193 | - return str | |
| 194 | - } | |
| 195 | - | |
| 196 | - // MARK: - BtnAction | |
| 197 | - // 内部链接右上角···分享 | |
| 113 | + // MARK: - 内部链接右上角···分享 | |
| 198 | 114 | @objc func moreNavBtnAction(){ |
| 199 | 115 | self.configBridgeCallHander() |
| 200 | 116 | } |
| 201 | 117 | override func ClickBackBtn() { |
| 202 | - if self.webView.canGoBack{ | |
| 203 | - self.webView.goBack() | |
| 118 | + if self.webView.cnWebView.canGoBack{ | |
| 119 | + self.webView.cnWebView.goBack() | |
| 204 | 120 | }else{ |
| 205 | 121 | super.ClickBackBtn() |
| 206 | 122 | } |
| 207 | 123 | } |
| 208 | - | |
| 209 | - // MARK: - WKWebViewDelegate | |
| 210 | - // 页面开始加载时调用 | |
| 211 | - func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { | |
| 212 | -// print("didStartProvisionalNavigation") | |
| 213 | - } | |
| 214 | - // 当内容开始返回时调用 | |
| 215 | - func webView(_ webView: WKWebView, didCommit navigation: WKNavigation!) { | |
| 216 | -// print("didCommit") | |
| 217 | - } | |
| 218 | - | |
| 219 | - // 页面加载完成之后调用 | |
| 220 | - func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
| 221 | -// print("didFinish") | |
| 222 | - titleName = webView.title! | |
| 223 | - } | |
| 224 | - // 页面加载失败时调用 | |
| 225 | - func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) { | |
| 226 | -// print("didFailProvisionalNavigation") | |
| 227 | - } | |
| 228 | - // 接收到服务器跳转请求之后调用 | |
| 229 | - func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) { | |
| 230 | -// print("didReceiveServerRedirectForProvisionalNavigation") | |
| 231 | - } | |
| 232 | - // 在收到响应后,决定是否跳转 -> 默认允许 | |
| 233 | - func webView(_ webView: WKWebView, decidePolicyFor navigationResponse: WKNavigationResponse, decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void) { | |
| 234 | - | |
| 235 | -// print("decidePolicyFornavigationResponse") | |
| 236 | - | |
| 237 | - //允许跳转 | |
| 238 | - decisionHandler(.allow) | |
| 239 | - //不允许跳转 | |
| 240 | - // decisionHandler(.cancel) | |
| 241 | - } | |
| 242 | - // 在发送请求之前,决定是否跳转 -> 默认允许 | |
| 243 | - func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { | |
| 244 | -// print("decidePolicyFornavigationAction") | |
| 245 | - | |
| 246 | - var urlStr = (navigationAction.request.url?.absoluteString)! | |
| 247 | - | |
| 248 | - if navigationAction.request.url?.host == WjjH5 { | |
| 249 | - | |
| 250 | - if urlStr.contains("&isWjjReport=true") || urlStr.contains("?isWjjReport=true"){ | |
| 251 | - self.rightNavBtns = [self.moreNavBtn] | |
| 252 | - self.moreNavBtn.isHidden = false | |
| 253 | - }else{ | |
| 254 | - self.moreNavBtn.isHidden = true | |
| 255 | - } | |
| 256 | - | |
| 257 | - urlStr = self.checkURLWithStr(urlStr: urlStr) | |
| 258 | - self.currentUrl = urlStr | |
| 259 | - } | |
| 260 | - | |
| 261 | - if navigationAction.navigationType == .other{ | |
| 262 | - //跳转Appstore | |
| 263 | - let url = URL(string: "https://apps.apple.com/cn/app/%E7%BD%91%E5%AE%B6%E5%AE%B6%E5%95%86%E5%AE%B6%E7%89%88/id1337575497") | |
| 264 | - if url == navigationAction.request.url { | |
| 265 | - if UIApplication.shared.canOpenURL(url!) { UIApplication.shared.open(url!, options: [:], completionHandler: nil) | |
| 266 | - } | |
| 267 | - } | |
| 268 | - }else if navigationAction.navigationType == .linkActivated{ | |
| 269 | - | |
| 270 | - //以后可判断h5地址 ,可跳转原生页面或网页 | |
| 271 | - //暂时只跳h5 | |
| 272 | - let webVC = CNWebViewController() | |
| 273 | - webVC.url = URL(string: urlStr) | |
| 274 | - navigationViewController().pushViewController(webVC, animated: pushAnimated) | |
| 275 | - decisionHandler(.cancel) | |
| 276 | - return | |
| 277 | - | |
| 278 | - } | |
| 279 | - decisionHandler(.allow) | |
| 280 | - } | |
| 281 | 124 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| ... | ... | @@ -131,20 +131,6 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 131 | 131 | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | -// private(set) var userInfo: UserInfoModel { | |
| 135 | -// | |
| 136 | -// set { | |
| 137 | -// _userInfo = newValue | |
| 138 | -// } | |
| 139 | -// | |
| 140 | -// get { | |
| 141 | -// if _userInfo != nil && (_userInfo?.uid.count)! > 0 { | |
| 142 | -// return _userInfo! | |
| 143 | -// } | |
| 144 | -// return UserInfoManager.readUserInfo() | |
| 145 | -// } | |
| 146 | -// } | |
| 147 | - | |
| 148 | 134 | // MARK: - 懒加载 |
| 149 | 135 | |
| 150 | 136 | ///颜色数据 |
| ... | ... | @@ -269,12 +255,6 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 269 | 255 | self.baseScrollView.setContentOffset(CGPointMake(0, self.frame.size.height), animated: true) |
| 270 | 256 | } |
| 271 | 257 | |
| 272 | -// func addCustomGestureRecognizer(){ | |
| 273 | -// let singleTap: UITapGestureRecognizer = UITapGestureRecognizer.init(target: self, action: #selector(singleCellTapAction)) | |
| 274 | -// | |
| 275 | -// self.addGestureRecognizer(singleTap) | |
| 276 | -// } | |
| 277 | - | |
| 278 | 258 | // MARK: - 设置前置视图容器 |
| 279 | 259 | func isHiddenMainFrontContentView(isHidden:Bool){ |
| 280 | 260 | self.mainView.isHiddenMainFrontContentView(isHidden: isHidden) | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideSingleCourseCell.swift
| ... | ... | @@ -107,7 +107,16 @@ class CNDownSlideSingleCourseCell: UITableViewCell { |
| 107 | 107 | bgBackView.layer.cornerRadius = 12 |
| 108 | 108 | bgBackView.backgroundColor = .white |
| 109 | 109 | |
| 110 | - let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | |
| 110 | + var titleTop:CGFloat = DownSlideRecommendLeftGap | |
| 111 | + if model.blockSubTitle?.count ?? 0 > 0{ | |
| 112 | + let subtitleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: DownSlideRecommendLeftGap, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 17)) | |
| 113 | + subtitleLbl.text = model.blockSubTitle | |
| 114 | + subtitleLbl.font = Font_12 | |
| 115 | + subtitleLbl.textColor = HexColor("#999999") | |
| 116 | + bgBackView.addSubview(subtitleLbl) | |
| 117 | + titleTop = DownSlideRecommendLeftGap+17+1 | |
| 118 | + } | |
| 119 | + let titleLbl = UILabel(frame: CGRect(x: DownSlideRecommendLeftGap, y: titleTop, width: DownSlideSingleCourseW-DownSlideRecommendLeftGap*2, height: 30)) | |
| 111 | 120 | titleLbl.text = model.blockName ?? "全部课程" |
| 112 | 121 | titleLbl.font = BoldFont_21 |
| 113 | 122 | titleLbl.textColor = HexColor("#333333") | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNHomePageGuideView.swift
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNIDCardView.swift
| ... | ... | @@ -17,7 +17,7 @@ class CNIDCardView: UIView{ |
| 17 | 17 | } |
| 18 | 18 | set{ |
| 19 | 19 | _idModel = newValue |
| 20 | - self.iDCardBGView.kf.setImage(with: URL(string: _idModel!.cardImg), placeholder: UIImage(named: "homePage_idCardBG")) | |
| 20 | + self.iDCardBGView.kf.setImage(with: URL(string: _idModel!.cardImg)) | |
| 21 | 21 | if _idModel?.id == 9{ |
| 22 | 22 | //电商 , 拼接数据 |
| 23 | 23 | let nameArr = ["公司名称","认证时间","编号"] | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
| ... | ... | @@ -512,14 +512,14 @@ class CNFrontMainView : UIView{ |
| 512 | 512 | //有企业认证显示提示lbl |
| 513 | 513 | if idModel!.enterpriseAuth{ |
| 514 | 514 | self.enterpriseTipsLabel.isHidden = false |
| 515 | - self.enterpriseTipsLabel.textColor = HexColor(newValue!.backgroundColor) | |
| 515 | + self.enterpriseTipsLabel.textColor = HexColor(newValue!.tipsColour) | |
| 516 | 516 | }else{ |
| 517 | 517 | self.enterpriseTipsLabel.isHidden = true |
| 518 | 518 | } |
| 519 | 519 | //有机构认证显示提示lbl |
| 520 | 520 | if idModel!.agencyAuth{ |
| 521 | 521 | self.agencyTipsLabel.isHidden = false |
| 522 | - self.agencyTipsLabel.textColor = HexColor(newValue!.backgroundColor) | |
| 522 | + self.agencyTipsLabel.textColor = HexColor(newValue!.tipsColour) | |
| 523 | 523 | }else{ |
| 524 | 524 | self.agencyTipsLabel.isHidden = false |
| 525 | 525 | } |
| ... | ... | @@ -833,7 +833,7 @@ class CNBackMainView : UIView{ |
| 833 | 833 | lazy var imageView:UIImageView = { |
| 834 | 834 | |
| 835 | 835 | let tempImageView:UIImageView = UIImageView(frame: CGRect(x: 10, y: 10, width: self.width-20, height: self.height - 20)) |
| 836 | - tempImageView.image = UIImage(named: "homePage_backViewImage") | |
| 836 | + tempImageView.image = UIImage(named: "") | |
| 837 | 837 | |
| 838 | 838 | return tempImageView |
| 839 | 839 | }() |
| ... | ... | @@ -943,13 +943,6 @@ class CNMainView : UIView{ |
| 943 | 943 | |
| 944 | 944 | |
| 945 | 945 | self.backView.isHidden = true; |
| 946 | - | |
| 947 | -// self.layer.cornerRadius = 20; | |
| 948 | -// self.layer.shadowOpacity = 1; | |
| 949 | -// self.layer.shadowColor = UIColor("#eeeeee")?.cgColor | |
| 950 | -// self.layer.shadowOffset = CGSize(width: 10, height: 10) | |
| 951 | -// self.layer.shadowRadius = 10; | |
| 952 | - | |
| 953 | 946 | } |
| 954 | 947 | |
| 955 | 948 | // MARK: -设置前置视图容器 | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/CNLiveAuthViewController.swift renamed to metaCode/Classes/Main/HomePages/Controller/HomeController/CNLiveAuthViewController.swift
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageAnimationTransition.swift renamed to metaCode/Classes/Main/HomePages/Controller/HomeController/push相关/CNHomePageAnimationTransition.swift
| ... | ... | @@ -69,12 +69,14 @@ extension CNHomePageAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 69 | 69 | if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 70 | 70 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 71 | 71 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 72 | + | |
| 73 | + fromVC.view.isHidden = true | |
| 72 | 74 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 73 | 75 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 74 | 76 | fromVC.view.frame = frame |
| 75 | 77 | fromVC.view.layer.cornerRadius = GlobalConstants.toDayCardCornerRadius |
| 76 | 78 | fromVC.closeBtn.alpha = 0 |
| 77 | - fromVC.tableView.alpha = 0 | |
| 79 | + | |
| 78 | 80 | }) { (completed) in |
| 79 | 81 | transitionContext.completeTransition(completed) |
| 80 | 82 | } | ... | ... |
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomePageBaseNavigationController.swift renamed to metaCode/Classes/Main/HomePages/Controller/HomeController/push相关/CNHomePageBaseNavigationController.swift
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDetailViewController.swift renamed to metaCode/Classes/Main/HomePages/Controller/HomeController/push相关/CNHomepageDetailViewController.swift
metaCode/Classes/Main/HomePages/Controller/AuthController/push相关/CNHomepageDuanJuDetailViewController.swift renamed to metaCode/Classes/Main/HomePages/Controller/HomeController/push相关/CNHomepageDuanJuDetailViewController.swift
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| ... | ... | @@ -147,6 +147,7 @@ final class StandListModel: BaseModel {//, TableCodable { |
| 147 | 147 | var backgroundColor: String = kCNDownSlideBackgroundColorHex//企业认证按钮背景色- |
| 148 | 148 | var atPersonageColour: String = kCNDownSlideBackgroundColorHex//个人认证按钮背景色- |
| 149 | 149 | var backgroundColour: String = ""//- |
| 150 | + var tipsColour: String = ""//-企业,机构 提醒文本颜色 | |
| 150 | 151 | var description: String = ""//首页身份说明描述- |
| 151 | 152 | var descBackgroundImg: String = ""//首页文字背景图 |
| 152 | 153 | var cardImg: String = ""//卡片背景图- | ... | ... |
metaCode/Classes/Main/Model/CNLiveDownSlideModel.swift
metaCode/Classes/Main/Util/CNUpSlideAnimationTransition.swift
| ... | ... | @@ -150,6 +150,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 150 | 150 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ |
| 151 | 151 | guard let selectedCell = toVC.selectedCell else { return } |
| 152 | 152 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 153 | + fromVC.view.isHidden = true | |
| 153 | 154 | |
| 154 | 155 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 155 | 156 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| ... | ... | @@ -158,13 +159,14 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 158 | 159 | fromVC.scrollView.imageView.frame.size.width = GlobalConstants.todayCardSize.width |
| 159 | 160 | fromVC.scrollView.imageView.frame.size.height = GlobalConstants.todayCardSize.height |
| 160 | 161 | fromVC.closeBtn.alpha = 0 |
| 161 | - fromVC.tableView.alpha = 0 | |
| 162 | + | |
| 162 | 163 | }) { (completed) in |
| 163 | 164 | transitionContext.completeTransition(completed) |
| 164 | 165 | } |
| 165 | 166 | }else if fromNaviVC.topViewController is CNHomepageDuanJuDetailViewController{ |
| 166 | 167 | guard let selectedCell = toVC.selectedDuanjuCell else { return } |
| 167 | 168 | let fromVC = fromNaviVC.topViewController as! CNHomepageDuanJuDetailViewController |
| 169 | + fromVC.view.isHidden = true | |
| 168 | 170 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 169 | 171 | let frame = selectedCell.convert(selectedCell.totalView.frame, to: toVC.view) |
| 170 | 172 | fromVC.view.frame = frame |
| ... | ... | @@ -184,7 +186,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 184 | 186 | guard let toVC = transitionContext.viewController(forKey: .to) as? CNUpSlideViewController else { return } |
| 185 | 187 | guard let selectedCell = toVC.selectedCell else { return } |
| 186 | 188 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 187 | - | |
| 189 | + fromVC.view.isHidden = true | |
| 188 | 190 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 189 | 191 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 190 | 192 | fromVC.view.frame = frame |
| ... | ... | @@ -205,6 +207,7 @@ extension CNUpSlideAnimationTransition: UIViewControllerAnimatedTransitioning { |
| 205 | 207 | guard let selectedCell = toVC.selectedCell else { return } |
| 206 | 208 | if fromNaviVC.topViewController is CNUpSlideDetailViewController{ |
| 207 | 209 | let fromVC = fromNaviVC.topViewController as! CNUpSlideDetailViewController |
| 210 | + fromVC.view.isHidden = true | |
| 208 | 211 | UIView.animate(withDuration: transitonDuration - 0.8, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: { |
| 209 | 212 | let frame = selectedCell.convert(selectedCell.bgBackView.frame, to: toVC.view) |
| 210 | 213 | fromVC.view.frame = frame | ... | ... |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_backViewImage.imageset/4671683516653_.pic.jpg deleted
100644 → 0
82.2 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_backViewImage.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "filename" : "4671683516653_.pic.jpg", | |
| 5 | - "idiom" : "universal", | |
| 6 | - "scale" : "1x" | |
| 7 | - }, | |
| 8 | - { | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "idiom" : "universal", | |
| 14 | - "scale" : "3x" | |
| 15 | - } | |
| 16 | - ], | |
| 17 | - "info" : { | |
| 18 | - "author" : "xcode", | |
| 19 | - "version" : 1 | |
| 20 | - } | |
| 21 | -} |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_idCardBG.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "idiom" : "universal", | |
| 5 | - "scale" : "1x" | |
| 6 | - }, | |
| 7 | - { | |
| 8 | - "filename" : "homePage_idCardBG@2x.png", | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "filename" : "homePage_idCardBG@3x.png", | |
| 14 | - "idiom" : "universal", | |
| 15 | - "scale" : "3x" | |
| 16 | - } | |
| 17 | - ], | |
| 18 | - "info" : { | |
| 19 | - "author" : "xcode", | |
| 20 | - "version" : 1 | |
| 21 | - } | |
| 22 | -} |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_idCardBG.imageset/homePage_idCardBG@2x.png deleted
100644 → 0
19.2 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_idCardBG.imageset/homePage_idCardBG@3x.png deleted
100644 → 0
36.6 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_mainView_front.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "idiom" : "universal", | |
| 5 | - "scale" : "1x" | |
| 6 | - }, | |
| 7 | - { | |
| 8 | - "filename" : "证件@2x.png", | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "filename" : "证件@3x.png", | |
| 14 | - "idiom" : "universal", | |
| 15 | - "scale" : "3x" | |
| 16 | - } | |
| 17 | - ], | |
| 18 | - "info" : { | |
| 19 | - "author" : "xcode", | |
| 20 | - "version" : 1 | |
| 21 | - } | |
| 22 | -} |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_mainView_front.imageset/证件@2x.png deleted
100644 → 0
35.9 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_mainView_front.imageset/证件@3x.png deleted
100644 → 0
67.6 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_payMoneyImage.imageset/4651683514228_.pic.jpg deleted
100644 → 0
52.1 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_payMoneyImage.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "idiom" : "universal", | |
| 5 | - "scale" : "1x" | |
| 6 | - }, | |
| 7 | - { | |
| 8 | - "filename" : "4651683514228_.pic.jpg", | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "idiom" : "universal", | |
| 14 | - "scale" : "3x" | |
| 15 | - } | |
| 16 | - ], | |
| 17 | - "info" : { | |
| 18 | - "author" : "xcode", | |
| 19 | - "version" : 1 | |
| 20 | - } | |
| 21 | -} |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_topImage.imageset/4771683609542_.pic.jpg deleted
100644 → 0
230 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_topImage.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "idiom" : "universal", | |
| 5 | - "scale" : "1x" | |
| 6 | - }, | |
| 7 | - { | |
| 8 | - "filename" : "4771683609542_.pic.jpg", | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "idiom" : "universal", | |
| 14 | - "scale" : "3x" | |
| 15 | - } | |
| 16 | - ], | |
| 17 | - "info" : { | |
| 18 | - "author" : "xcode", | |
| 19 | - "version" : 1 | |
| 20 | - } | |
| 21 | -} |
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_zhongguorenming_bank.imageset/4431683250159_.pic.jpg deleted
100644 → 0
79.4 KB
metaCode/Supporting Files/Assets.xcassets/RenzhenPage/homePage_zhongguorenming_bank.imageset/Contents.json deleted
100644 → 0
| 1 | -{ | |
| 2 | - "images" : [ | |
| 3 | - { | |
| 4 | - "idiom" : "universal", | |
| 5 | - "scale" : "1x" | |
| 6 | - }, | |
| 7 | - { | |
| 8 | - "filename" : "4431683250159_.pic.jpg", | |
| 9 | - "idiom" : "universal", | |
| 10 | - "scale" : "2x" | |
| 11 | - }, | |
| 12 | - { | |
| 13 | - "idiom" : "universal", | |
| 14 | - "scale" : "3x" | |
| 15 | - } | |
| 16 | - ], | |
| 17 | - "info" : { | |
| 18 | - "author" : "xcode", | |
| 19 | - "version" : 1 | |
| 20 | - } | |
| 21 | -} |