Commit 6d88c5699f8411a7ddbd8a25231e5a38c31ea3e7
1 parent
1af7f5eb
下滑页大图点击 , 大图详情页变形问题 , 删除WebViewJavascriptBridge 的UIWebview
Showing
10 changed files
with
114 additions
and
127 deletions
Podfile
| @@ -67,11 +67,28 @@ target 'metaCode' do | @@ -67,11 +67,28 @@ target 'metaCode' do | ||
| 67 | # pod 'QMUIKit' | 67 | # pod 'QMUIKit' |
| 68 | pod 'YYWebImage', :git => 'https://gitee.com/mirrors/YYWebImage.git' | 68 | pod 'YYWebImage', :git => 'https://gitee.com/mirrors/YYWebImage.git' |
| 69 | 69 | ||
| 70 | + pod 'WebViewJavascriptBridge' | ||
| 71 | + | ||
| 70 | #依赖三方私有库,如果里面有.a的时候加上这个 | 72 | #依赖三方私有库,如果里面有.a的时候加上这个 |
| 71 | pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | 73 | pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} |
| 72 | end | 74 | end |
| 73 | 75 | ||
| 76 | + #依赖三方私有库,如果里面有.a的时候加上这个 | ||
| 77 | + pre_install do |installer| Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {} | ||
| 78 | + ############################################ #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | ||
| 74 | 79 | ||
| 80 | + dir_web = File.join(installer.sandbox.pod_dir('WebViewJavascriptBridge'), 'WebViewJavascriptBridge') | ||
| 81 | + Dir.foreach(dir_web) {|x| | ||
| 82 | + real_path = File.join(dir_web, x) | ||
| 83 | + if (!File.directory?(real_path) && File.exists?(real_path)) | ||
| 84 | + if(x == 'WebViewJavascriptBridge.h' || x == 'WebViewJavascriptBridge.m') | ||
| 85 | + File.delete(real_path) | ||
| 86 | + end | ||
| 87 | + end | ||
| 88 | + } | ||
| 89 | + #删除WebViewJavascriptBridge中的WebViewJavascriptBridge.h和WebViewJavascriptBridge.m文件 | ||
| 90 | + ################################################# | ||
| 91 | + end | ||
| 75 | 92 | ||
| 76 | 93 | ||
| 77 | 94 |
metaCode/Classes/Main/HomePage/Controller/AuthMainController/CNMetaCodeHomePageController.swift
| @@ -56,6 +56,9 @@ enum VNumPage { | @@ -56,6 +56,9 @@ enum VNumPage { | ||
| 56 | 56 | ||
| 57 | class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDelegate, NewPagedFlowViewDataSource, CNCustomIndexViewDelegate,UIGestureRecognizerDelegate,WKNavigationDelegate{ | 57 | class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDelegate, NewPagedFlowViewDataSource, CNCustomIndexViewDelegate,UIGestureRecognizerDelegate,WKNavigationDelegate{ |
| 58 | 58 | ||
| 59 | + //获取身份信息接口总次数,为0时刷新左右轮播 | ||
| 60 | + var reloadNum:Int = 0 | ||
| 61 | + var reloadShopNum:Int = 1 | ||
| 59 | 62 | ||
| 60 | ///NewPagedFlowView 开始滑动时的偏移量 | 63 | ///NewPagedFlowView 开始滑动时的偏移量 |
| 61 | private var beginOffset = 0.0 | 64 | private var beginOffset = 0.0 |
| @@ -396,9 +399,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -396,9 +399,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 396 | bannerView?.idModel = identityModel | 399 | bannerView?.idModel = identityModel |
| 397 | if (identityModel.auth == true){ | 400 | if (identityModel.auth == true){ |
| 398 | bannerView?.baseScrollView.isScrollEnabled = true | 401 | bannerView?.baseScrollView.isScrollEnabled = true |
| 399 | - if identityModel.id == 9{ | ||
| 400 | - self.getApplyShopInfo() | ||
| 401 | - } | ||
| 402 | }else{ | 402 | }else{ |
| 403 | //未认证 | 403 | //未认证 |
| 404 | if (identityModel.downType == 3 || identityModel.downType == 4 || identityModel.upType == 3 || identityModel.upType == 4) | 404 | if (identityModel.downType == 3 || identityModel.downType == 4 || identityModel.upType == 3 || identityModel.upType == 4) |
| @@ -409,7 +409,8 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -409,7 +409,8 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | //未认证&要显示的是电商 | 411 | //未认证&要显示的是电商 |
| 412 | - if identityModel.id == 9{ | 412 | + if identityModel.id == 9 && reloadShopNum == 1{ |
| 413 | + reloadShopNum = reloadShopNum - 1 | ||
| 413 | self.getApplyShopInfo() | 414 | self.getApplyShopInfo() |
| 414 | } | 415 | } |
| 415 | } | 416 | } |
| @@ -626,7 +627,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -626,7 +627,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 626 | { | 627 | { |
| 627 | // showLoading(message: "") | 628 | // showLoading(message: "") |
| 628 | CNLiveMineViewModel.requestAuthStandList(page: 1) | 629 | CNLiveMineViewModel.requestAuthStandList(page: 1) |
| 629 | - { result, respStatue in | 630 | + { [self] result, respStatue in |
| 630 | 631 | ||
| 631 | hiddenLoading() | 632 | hiddenLoading() |
| 632 | if respStatue == .success{ | 633 | if respStatue == .success{ |
| @@ -636,10 +637,9 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -636,10 +637,9 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 636 | 637 | ||
| 637 | self.dataArray = NSMutableArray.init() | 638 | self.dataArray = NSMutableArray.init() |
| 638 | self.dataArray.addObjects(from: listArray as! [Any]) | 639 | self.dataArray.addObjects(from: listArray as! [Any]) |
| 639 | - self.addPageView() | ||
| 640 | - | ||
| 641 | - self.backgroupView.updateData(idArray: listArray as! Array<StandListModel>) | ||
| 642 | 640 | ||
| 641 | + //全部已认证 | ||
| 642 | + var isAllAuthed = true | ||
| 643 | //请求身份详情,判断是企业认证还是个人认证 | 643 | //请求身份详情,判断是企业认证还是个人认证 |
| 644 | listArray.forEach { standListModel in | 644 | listArray.forEach { standListModel in |
| 645 | let listModel = standListModel as! StandListModel | 645 | let listModel = standListModel as! StandListModel |
| @@ -648,9 +648,16 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -648,9 +648,16 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 648 | listModel.isPersonOrEnterprise = 3 | 648 | listModel.isPersonOrEnterprise = 3 |
| 649 | }else{ | 649 | }else{ |
| 650 | //未认证 | 650 | //未认证 |
| 651 | + isAllAuthed = false | ||
| 651 | self.getStandInfo(identityId: "\(listModel.id)") | 652 | self.getStandInfo(identityId: "\(listModel.id)") |
| 653 | + reloadNum = reloadNum + 1 | ||
| 652 | } | 654 | } |
| 653 | } | 655 | } |
| 656 | + if isAllAuthed{ | ||
| 657 | + self.addPageView() | ||
| 658 | + | ||
| 659 | + self.backgroupView.updateData(idArray: listArray as! Array<StandListModel>) | ||
| 660 | + } | ||
| 654 | 661 | ||
| 655 | }else{ | 662 | }else{ |
| 656 | self.NetApiStatus = .apiError | 663 | self.NetApiStatus = .apiError |
| @@ -667,7 +674,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -667,7 +674,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 667 | 674 | ||
| 668 | // MARK: - 获取身份信息是个人认证还是企业认证,机构认证 | 675 | // MARK: - 获取身份信息是个人认证还是企业认证,机构认证 |
| 669 | func getStandInfo(identityId:String){ | 676 | func getStandInfo(identityId:String){ |
| 670 | - CNLiveMineViewModel.requestsStandInfo(identityId: identityId, type: .effect, authType: .person) { result, respStatue in | 677 | + CNLiveMineViewModel.requestsStandInfo(identityId: identityId, type: .effect, authType: .person) { [self] result, respStatue in |
| 671 | hiddenLoading() | 678 | hiddenLoading() |
| 672 | if respStatue == .success{ | 679 | if respStatue == .success{ |
| 673 | let standInfoBaseModel = result as! MineStandInfoBaseModel | 680 | let standInfoBaseModel = result as! MineStandInfoBaseModel |
| @@ -675,104 +682,59 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -675,104 +682,59 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 675 | let listModel = standListModel as! StandListModel | 682 | let listModel = standListModel as! StandListModel |
| 676 | if listModel.id == standInfoBaseModel.identityId{ | 683 | if listModel.id == standInfoBaseModel.identityId{ |
| 677 | listModel.standInfoBaseModel = standInfoBaseModel | 684 | listModel.standInfoBaseModel = standInfoBaseModel |
| 678 | - } | ||
| 679 | - } | ||
| 680 | - | ||
| 681 | - if standInfoBaseModel.authInfos.count > 0{ | ||
| 682 | - //个人认证有值 | ||
| 683 | - if standInfoBaseModel.enterpriseAuthInfos.count > 0{ | ||
| 684 | - //个人有值,企业认证有值 | ||
| 685 | - if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 686 | - //个人有值,企业有值,机构认证有值 | ||
| 687 | - self.dataArray.forEach { standListModel in | ||
| 688 | - let listModel = standListModel as! StandListModel | ||
| 689 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 690 | - //目标model,企业+个人+机构 | 685 | + if standInfoBaseModel.authInfos.count > 0{ |
| 686 | + //个人认证有值 | ||
| 687 | + if standInfoBaseModel.enterpriseAuthInfos.count > 0{ | ||
| 688 | + //个人有值,企业认证有值 | ||
| 689 | + if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 690 | + //个人有值,企业有值,机构认证有值 | ||
| 691 | listModel.isPersonOrEnterprise = 4 | 691 | listModel.isPersonOrEnterprise = 4 |
| 692 | - } | ||
| 693 | - } | ||
| 694 | - | ||
| 695 | - }else{ | ||
| 696 | - //个人有值,企业有值,机构认证没值 | ||
| 697 | - self.dataArray.forEach { standListModel in | ||
| 698 | - let listModel = standListModel as! StandListModel | ||
| 699 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 700 | - //目标model,企业+个人 | 692 | + }else{ |
| 693 | + //个人有值,企业有值,机构认证没值 | ||
| 701 | listModel.isPersonOrEnterprise = 0 | 694 | listModel.isPersonOrEnterprise = 0 |
| 702 | } | 695 | } |
| 703 | - } | ||
| 704 | - } | ||
| 705 | - | ||
| 706 | - }else{ | ||
| 707 | - //个人有值,企业认证没值 | ||
| 708 | - if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 709 | - //个人有值,企业没值,机构有值 | ||
| 710 | - self.dataArray.forEach { standListModel in | ||
| 711 | - let listModel = standListModel as! StandListModel | ||
| 712 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 713 | - //目标model | 696 | + |
| 697 | + }else{ | ||
| 698 | + //个人有值,企业认证没值 | ||
| 699 | + if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 700 | + //个人有值,企业没值,机构有值 | ||
| 714 | listModel.isPersonOrEnterprise = 0 | 701 | listModel.isPersonOrEnterprise = 0 |
| 715 | - } | ||
| 716 | - } | ||
| 717 | - }else{ | ||
| 718 | - //个人有值,企业没值,机构没值 | ||
| 719 | - self.dataArray.forEach { standListModel in | ||
| 720 | - let listModel = standListModel as! StandListModel | ||
| 721 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 722 | - //目标model ,个人 | 702 | + }else{ |
| 703 | + //个人有值,企业没值,机构没值 | ||
| 723 | listModel.isPersonOrEnterprise = 1 | 704 | listModel.isPersonOrEnterprise = 1 |
| 724 | } | 705 | } |
| 725 | } | 706 | } |
| 726 | - } | ||
| 727 | - } | ||
| 728 | - | ||
| 729 | - }else if standInfoBaseModel.enterpriseAuthInfos.count > 0{ | ||
| 730 | - //企业认证有值,个人没值 | ||
| 731 | - if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 732 | - ///企业有值,个人没值,机构有值 | ||
| 733 | - self.dataArray.forEach { standListModel in | ||
| 734 | - let listModel = standListModel as! StandListModel | ||
| 735 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 736 | - //目标model | 707 | + |
| 708 | + }else if standInfoBaseModel.enterpriseAuthInfos.count > 0{ | ||
| 709 | + //企业认证有值,个人没值 | ||
| 710 | + if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 711 | + ///企业有值,个人没值,机构有值 | ||
| 737 | listModel.isPersonOrEnterprise = 0 | 712 | listModel.isPersonOrEnterprise = 0 |
| 738 | - } | ||
| 739 | - } | ||
| 740 | - }else{ | ||
| 741 | - ///企业有值,个人没值,机构没值 | ||
| 742 | - self.dataArray.forEach { standListModel in | ||
| 743 | - let listModel = standListModel as! StandListModel | ||
| 744 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 745 | - //目标model ,企业 | 713 | + }else{ |
| 714 | + ///企业有值,个人没值,机构没值 | ||
| 746 | listModel.isPersonOrEnterprise = 2 | 715 | listModel.isPersonOrEnterprise = 2 |
| 747 | } | 716 | } |
| 748 | - } | ||
| 749 | - } | ||
| 750 | - | ||
| 751 | - | ||
| 752 | - }else{ | ||
| 753 | - //企业个人都没值 | ||
| 754 | - if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 755 | - //企业没值,个人没值,机构有值 | ||
| 756 | - self.dataArray.forEach { standListModel in | ||
| 757 | - let listModel = standListModel as! StandListModel | ||
| 758 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 759 | - //目标model 机构 | 717 | + |
| 718 | + | ||
| 719 | + }else{ | ||
| 720 | + //企业个人都没值 | ||
| 721 | + if standInfoBaseModel.agencyAuthInfos.count > 0{ | ||
| 722 | + //企业没值,个人没值,机构有值 | ||
| 760 | listModel.isPersonOrEnterprise = 5 | 723 | listModel.isPersonOrEnterprise = 5 |
| 761 | - } | ||
| 762 | - } | ||
| 763 | - }else{ | ||
| 764 | - //企业没值,个人没值,机构没值 | ||
| 765 | - self.dataArray.forEach { standListModel in | ||
| 766 | - let listModel = standListModel as! StandListModel | ||
| 767 | - if listModel.id == standInfoBaseModel.identityId{ | ||
| 768 | - //目标model ,已认证/无企业和个人 | 724 | + }else{ |
| 725 | + //企业没值,个人没值,机构没值 | ||
| 769 | listModel.isPersonOrEnterprise = 3 | 726 | listModel.isPersonOrEnterprise = 3 |
| 770 | } | 727 | } |
| 771 | } | 728 | } |
| 772 | } | 729 | } |
| 773 | - | ||
| 774 | } | 730 | } |
| 775 | - self.pageFlowView.reloadData() | 731 | + //已请求全部身份详情,开始刷新 |
| 732 | + reloadNum = reloadNum - 1 | ||
| 733 | + if reloadNum == 0{ | ||
| 734 | + self.addPageView() | ||
| 735 | + let arr = Array(self.dataArray) | ||
| 736 | + self.backgroupView.updateData(idArray: arr as! Array<StandListModel>) | ||
| 737 | + } | ||
| 776 | }else{ | 738 | }else{ |
| 777 | //网络请求失败 | 739 | //网络请求失败 |
| 778 | } | 740 | } |
| @@ -789,8 +751,10 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | @@ -789,8 +751,10 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel | ||
| 789 | for (index, item) in self!.dataArray.enumerated() { | 751 | for (index, item) in self!.dataArray.enumerated() { |
| 790 | let model = item as! StandListModel | 752 | let model = item as! StandListModel |
| 791 | model.shopInfoModel = shopModel | 753 | model.shopInfoModel = shopModel |
| 792 | - let bannerView = self?.pageFlowView.cells[index] as? CNCustomIndexView | ||
| 793 | - bannerView?.idModel = model | 754 | + if model.id == 9{ |
| 755 | + let bannerView = self?.pageFlowView.cells[index] as? CNCustomIndexView | ||
| 756 | + bannerView?.idModel = model | ||
| 757 | + } | ||
| 794 | } | 758 | } |
| 795 | } | 759 | } |
| 796 | } | 760 | } |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideDetailViewController.swift
| @@ -269,7 +269,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | @@ -269,7 +269,7 @@ class CNUpSlideDetailViewController: CNLiveBaseViewController,UITableViewDataSou | ||
| 269 | return 75 | 269 | return 75 |
| 270 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ | 270 | }else if self.slideModel?.type == SlideModelTypeOneCourse75{ |
| 271 | //大图课程 | 271 | //大图课程 |
| 272 | - return KSreenWidth | 272 | + return KSreenWidth*(KSreenWidth/DownSlideSingleCourseW) |
| 273 | } | 273 | } |
| 274 | } | 274 | } |
| 275 | }else{ | 275 | }else{ |
metaCode/Classes/Main/HomePage/Controller/DownSlideController/CNUpSlideViewController.swift
| @@ -131,7 +131,6 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | @@ -131,7 +131,6 @@ class CNUpSlideViewController: CNLiveBaseViewController,UITableViewDelegate,UITa | ||
| 131 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell | 131 | guard let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveDownSlideSingleCourseCellIdentifier) as? CNDownSlideSingleCourseCell |
| 132 | else { | 132 | else { |
| 133 | let cell = CNDownSlideSingleCourseCell() | 133 | let cell = CNDownSlideSingleCourseCell() |
| 134 | - cell.slideModel = slideModel | ||
| 135 | return cell | 134 | return cell |
| 136 | } | 135 | } |
| 137 | cell.slideModel = slideModel | 136 | cell.slideModel = slideModel |
metaCode/Classes/Main/HomePage/View/VerticalViews/DownSlide/CNDownSlideView.swift
| @@ -149,14 +149,14 @@ class CNDownSlideView:UIView{ | @@ -149,14 +149,14 @@ class CNDownSlideView:UIView{ | ||
| 149 | override init(frame: CGRect) { | 149 | override init(frame: CGRect) { |
| 150 | super.init(frame: frame) | 150 | super.init(frame: frame) |
| 151 | 151 | ||
| 152 | -// let tap = UITapGestureRecognizer.init(target: self, action: #selector(slideViewTap)) | ||
| 153 | -// tap.cancelsTouchesInView = false | ||
| 154 | -// self.addGestureRecognizer(tap) | 152 | + let tap = UITapGestureRecognizer.init(target: self, action: #selector(slideViewTap)) |
| 153 | + tap.cancelsTouchesInView = false | ||
| 154 | + self.addGestureRecognizer(tap) | ||
| 155 | self.initUI() | 155 | self.initUI() |
| 156 | } | 156 | } |
| 157 | -// @objc func slideViewTap() { | ||
| 158 | -// print("slideViewTap") | ||
| 159 | -// } | 157 | + @objc func slideViewTap() { |
| 158 | + print("slideViewTap") | ||
| 159 | + } | ||
| 160 | required init?(coder: NSCoder) { | 160 | required init?(coder: NSCoder) { |
| 161 | fatalError("init(coder:) has not been implemented") | 161 | fatalError("init(coder:) has not been implemented") |
| 162 | } | 162 | } |
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNHomePageBackgroupView.swift
| @@ -77,9 +77,9 @@ class CNHomePageBackgroupView: UIView{ | @@ -77,9 +77,9 @@ class CNHomePageBackgroupView: UIView{ | ||
| 77 | ///当前在屏幕显示的view | 77 | ///当前在屏幕显示的view |
| 78 | var currentApearView: CNHomePageBackgroupSubView? | 78 | var currentApearView: CNHomePageBackgroupSubView? |
| 79 | ///数据源 | 79 | ///数据源 |
| 80 | - lazy var dataArray:Array<CNHomePageBackgroupSubView> = { | ||
| 81 | - let dataArray = Array<CNHomePageBackgroupSubView>() | ||
| 82 | - return dataArray | 80 | + lazy var groupSubViewDataArray:Array<CNHomePageBackgroupSubView> = { |
| 81 | + let groupSubViewDataArray = Array<CNHomePageBackgroupSubView>() | ||
| 82 | + return groupSubViewDataArray | ||
| 83 | }() | 83 | }() |
| 84 | 84 | ||
| 85 | // MARK: - 初始化 | 85 | // MARK: - 初始化 |
| @@ -103,7 +103,7 @@ class CNHomePageBackgroupView: UIView{ | @@ -103,7 +103,7 @@ class CNHomePageBackgroupView: UIView{ | ||
| 103 | let obj:UIView = array[i] | 103 | let obj:UIView = array[i] |
| 104 | obj.removeFromSuperview() | 104 | obj.removeFromSuperview() |
| 105 | } | 105 | } |
| 106 | - self.dataArray = Array<CNHomePageBackgroupSubView>() | 106 | + self.groupSubViewDataArray = Array<CNHomePageBackgroupSubView>() |
| 107 | 107 | ||
| 108 | for i in (0..<idArray.count){ | 108 | for i in (0..<idArray.count){ |
| 109 | 109 | ||
| @@ -117,11 +117,11 @@ class CNHomePageBackgroupView: UIView{ | @@ -117,11 +117,11 @@ class CNHomePageBackgroupView: UIView{ | ||
| 117 | subView.imageView.kf.setImage(with: URL(string: idModel.backgroundImg),placeholder: UIImage(named: "homePage_backgroup_blue")) | 117 | subView.imageView.kf.setImage(with: URL(string: idModel.backgroundImg),placeholder: UIImage(named: "homePage_backgroup_blue")) |
| 118 | 118 | ||
| 119 | //更新双向链表 | 119 | //更新双向链表 |
| 120 | - let lastSubView: CNHomePageBackgroupSubView? = self.dataArray.last | 120 | + let lastSubView: CNHomePageBackgroupSubView? = self.groupSubViewDataArray.last |
| 121 | lastSubView?.nextSubView = subView | 121 | lastSubView?.nextSubView = subView |
| 122 | subView.preSubView = lastSubView | 122 | subView.preSubView = lastSubView |
| 123 | 123 | ||
| 124 | - self.dataArray.append(subView) | 124 | + self.groupSubViewDataArray.append(subView) |
| 125 | 125 | ||
| 126 | if i==0 { | 126 | if i==0 { |
| 127 | self.currentApearView = subView | 127 | self.currentApearView = subView |
| @@ -130,7 +130,7 @@ class CNHomePageBackgroupView: UIView{ | @@ -130,7 +130,7 @@ class CNHomePageBackgroupView: UIView{ | ||
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | //倒序添加子view | 132 | //倒序添加子view |
| 133 | - for i in self.dataArray.enumerated().reversed() { | 133 | + for i in self.groupSubViewDataArray.enumerated().reversed() { |
| 134 | 134 | ||
| 135 | let subview: CNHomePageBackgroupSubView = i.element | 135 | let subview: CNHomePageBackgroupSubView = i.element |
| 136 | self.addSubview(subview) | 136 | self.addSubview(subview) |
| @@ -148,14 +148,14 @@ class CNHomePageBackgroupView: UIView{ | @@ -148,14 +148,14 @@ class CNHomePageBackgroupView: UIView{ | ||
| 148 | if(currentApearViewIndex == 0){ | 148 | if(currentApearViewIndex == 0){ |
| 149 | return nil | 149 | return nil |
| 150 | } | 150 | } |
| 151 | - return dataArray[currentApearViewIndex - 1] | 151 | + return groupSubViewDataArray[currentApearViewIndex - 1] |
| 152 | } | 152 | } |
| 153 | ///获取当前视图右边的子视图 | 153 | ///获取当前视图右边的子视图 |
| 154 | func getRightView()->CNHomePageBackgroupSubView?{ | 154 | func getRightView()->CNHomePageBackgroupSubView?{ |
| 155 | - if(currentApearViewIndex >= self.dataArray.count - 1){ | 155 | + if(currentApearViewIndex >= self.groupSubViewDataArray.count - 1){ |
| 156 | return nil | 156 | return nil |
| 157 | } | 157 | } |
| 158 | - return dataArray[currentApearViewIndex + 1] | 158 | + return groupSubViewDataArray[currentApearViewIndex + 1] |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /// 替换当前显示的子view | 161 | /// 替换当前显示的子view |
metaCode/Classes/Main/HomePage/View/VerticalViews/MainView/CNMainView.swift
| @@ -22,8 +22,8 @@ class CNFrontMainView : UIView{ | @@ -22,8 +22,8 @@ class CNFrontMainView : UIView{ | ||
| 22 | override init(frame: CGRect) { | 22 | override init(frame: CGRect) { |
| 23 | super.init(frame: frame) | 23 | super.init(frame: frame) |
| 24 | self.initUI() | 24 | self.initUI() |
| 25 | -// let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapAction)) | ||
| 26 | -// self.addGestureRecognizer(tap) | 25 | + let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(tapAction)) |
| 26 | + self.addGestureRecognizer(tap) | ||
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | required init?(coder: NSCoder) { | 29 | required init?(coder: NSCoder) { |
| @@ -519,18 +519,18 @@ class CNFrontMainView : UIView{ | @@ -519,18 +519,18 @@ class CNFrontMainView : UIView{ | ||
| 519 | 519 | ||
| 520 | if (payLayer != nil){ | 520 | if (payLayer != nil){ |
| 521 | //已添加layer | 521 | //已添加layer |
| 522 | - }else{ | ||
| 523 | - //未添加layer | ||
| 524 | - let gradient = CAGradientLayer() | ||
| 525 | - gradient.frame = self.bounds | ||
| 526 | - gradient.colors = [HexColor(startHex)!.cgColor, HexColor(endHex)!.cgColor] | ||
| 527 | - gradient.locations = [0, 1] | ||
| 528 | - gradient.startPoint = CGPoint(x: 0, y: 0.43) | ||
| 529 | - gradient.endPoint = CGPoint(x: 0.43, y: 0.43) | ||
| 530 | - gradient.name = unStandBtnBgViewLayer | ||
| 531 | - self.unStandBtnBgView.layer.insertSublayer(gradient, at: 0) | ||
| 532 | - self.unStandBtnBgView.backgroundColor = .clear | 522 | + payLayer?.removeFromSuperlayer() |
| 533 | } | 523 | } |
| 524 | + //添加新layer | ||
| 525 | + let gradient = CAGradientLayer() | ||
| 526 | + gradient.frame = self.bounds | ||
| 527 | + gradient.colors = [HexColor(startHex)!.cgColor, HexColor(endHex)!.cgColor] | ||
| 528 | + gradient.locations = [0, 1] | ||
| 529 | + gradient.startPoint = CGPoint(x: 0, y: 0.43) | ||
| 530 | + gradient.endPoint = CGPoint(x: 0.43, y: 0.43) | ||
| 531 | + gradient.name = unStandBtnBgViewLayer | ||
| 532 | + self.unStandBtnBgView.layer.insertSublayer(gradient, at: 0) | ||
| 533 | + self.unStandBtnBgView.backgroundColor = .clear | ||
| 534 | } | 534 | } |
| 535 | func subLayer(name:String,viewLayer:CALayer) -> CALayer?{ | 535 | func subLayer(name:String,viewLayer:CALayer) -> CALayer?{ |
| 536 | if let subLayer = viewLayer.sublayers?.first(where: { $0.name == name }) { | 536 | if let subLayer = viewLayer.sublayers?.first(where: { $0.name == name }) { |
| @@ -556,7 +556,8 @@ class CNFrontMainView : UIView{ | @@ -556,7 +556,8 @@ class CNFrontMainView : UIView{ | ||
| 556 | 556 | ||
| 557 | // MARK: -按钮点击事件 | 557 | // MARK: -按钮点击事件 |
| 558 | @objc func tapAction(){ | 558 | @objc func tapAction(){ |
| 559 | - tapTransformAciton!() | 559 | + //翻转到反面 |
| 560 | +// tapTransformAciton!() | ||
| 560 | } | 561 | } |
| 561 | 562 | ||
| 562 | @objc func addStandBtnAction() { | 563 | @objc func addStandBtnAction() { |
metaCode/Classes/Main/HomePage/View/VerticalViews/UpSlide/CNUpSlideView.swift
| @@ -46,6 +46,9 @@ class CNUpSlideView:UIView{ | @@ -46,6 +46,9 @@ class CNUpSlideView:UIView{ | ||
| 46 | } | 46 | } |
| 47 | set{ | 47 | set{ |
| 48 | _downPath = newValue! | 48 | _downPath = newValue! |
| 49 | + self.subviews.forEach { view in | ||
| 50 | + view.removeFromSuperview() | ||
| 51 | + } | ||
| 49 | if(type == UpDownTypeH5){ | 52 | if(type == UpDownTypeH5){ |
| 50 | self.addSubview(self.webView) | 53 | self.addSubview(self.webView) |
| 51 | if (_downPath != ""){ | 54 | if (_downPath != ""){ |
metaCode/Classes/Main/HomePages/View/HomepageDetail/CNLiveAlbumImageCell.swift
| @@ -11,7 +11,9 @@ class CNLiveAlbumImageCell:UITableViewCell{ | @@ -11,7 +11,9 @@ class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 11 | 11 | ||
| 12 | //MARK: - 懒加载 | 12 | //MARK: - 懒加载 |
| 13 | lazy var iconImgView :UIImageView = { | 13 | lazy var iconImgView :UIImageView = { |
| 14 | - let iconImgView = UIImageView(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: KSreenWidth)) | 14 | + let iconImgView = UIImageView(frame: CGRect(x: (KSreenWidth - KSreenWidth*(KSreenWidth/DownSlideSingleCourseW))/2, y: 0, width: KSreenWidth*(KSreenWidth/DownSlideSingleCourseW), height: KSreenWidth*(KSreenWidth/DownSlideSingleCourseW))) |
| 15 | + iconImgView.contentMode = .scaleAspectFill | ||
| 16 | + iconImgView.clipsToBounds = true | ||
| 15 | return iconImgView | 17 | return iconImgView |
| 16 | }() | 18 | }() |
| 17 | 19 | ||
| @@ -28,6 +30,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | @@ -28,6 +30,7 @@ class CNLiveAlbumImageCell:UITableViewCell{ | ||
| 28 | private func setupUI() { | 30 | private func setupUI() { |
| 29 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) | 31 | contentView.backgroundColor = HexColor(kCNDownSlideBackgroundColorHex) |
| 30 | self.contentView.addSubview(self.iconImgView) | 32 | self.contentView.addSubview(self.iconImgView) |
| 33 | + | ||
| 31 | } | 34 | } |
| 32 | 35 | ||
| 33 | 36 |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| @@ -284,7 +284,7 @@ class CNLiveMineViewModel: NSObject { | @@ -284,7 +284,7 @@ class CNLiveMineViewModel: NSObject { | ||
| 284 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) | 284 | CNLiveNetworking.setupCustomParam(custom_param as? [String : String]) |
| 285 | CNLiveNetworking.setAllowRequestDefaultArgument(true) | 285 | CNLiveNetworking.setAllowRequestDefaultArgument(true) |
| 286 | CNLiveNetworking.setupShowDataResult(false) | 286 | CNLiveNetworking.setupShowDataResult(false) |
| 287 | - CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/identityApi/allList", param: param as! [String : String], cacheType: .cacheNetwork) { task, result, error in | 287 | + CNLiveNetworking.requestNetwork(with: .GET, urlString: APPBaseMCUrl+"/identityApi/allList", param: param as! [String : String], cacheType: .networkOnly) { task, result, error in |
| 288 | hiddenLoading() | 288 | hiddenLoading() |
| 289 | if (error == nil) { | 289 | if (error == nil) { |
| 290 | let resp = result as! NSDictionary | 290 | let resp = result as! NSDictionary |