Commit 5b6e476fdf94f53b0b14e03fd0cff7b0fd41e41a
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
10 changed files
with
184 additions
and
27 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -42,6 +42,8 @@ |
| 42 | 42 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 798A44FE2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift */; }; |
| 43 | 43 | 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */ = {isa = PBXBuildFile; }; |
| 44 | 44 | 79A68C4C2A26EA6000DC3B43 /* (null) in Sources */ = {isa = PBXBuildFile; }; |
| 45 | + 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C27032F2A36CBE30061EC50 /* CNCertificationView.swift */; }; | |
| 46 | + 7C2703332A36CC660061EC50 /* CNLiveGlobalBlock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C2703322A36CC660061EC50 /* CNLiveGlobalBlock.swift */; }; | |
| 45 | 47 | 79F4B1162A32B96B00993C03 /* CNLiveMineInfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79F4B1152A32B96B00993C03 /* CNLiveMineInfoViewController.swift */; }; |
| 46 | 48 | 79F4B1182A32C5FA00993C03 /* CNLiveBaseMoel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79F4B1172A32C5FA00993C03 /* CNLiveBaseMoel.swift */; }; |
| 47 | 49 | 79F4B11A2A32F21400993C03 /* CNLiveMineNickViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79F4B1192A32F21400993C03 /* CNLiveMineNickViewController.swift */; }; |
| ... | ... | @@ -128,6 +130,8 @@ |
| 128 | 130 | 798A44FC2A309EBA00815935 /* CNLiveTypeFeedBackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveTypeFeedBackViewController.swift; sourceTree = "<group>"; }; |
| 129 | 131 | 798A44FE2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveInputFeedBackViewController.swift; sourceTree = "<group>"; }; |
| 130 | 132 | 79A68C512A26F59C00DC3B43 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = metaCode/Info.plist; sourceTree = "<group>"; }; |
| 133 | + 7C27032F2A36CBE30061EC50 /* CNCertificationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNCertificationView.swift; sourceTree = "<group>"; }; | |
| 134 | + 7C2703322A36CC660061EC50 /* CNLiveGlobalBlock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveGlobalBlock.swift; sourceTree = "<group>"; }; | |
| 131 | 135 | 79F4B1152A32B96B00993C03 /* CNLiveMineInfoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineInfoViewController.swift; sourceTree = "<group>"; }; |
| 132 | 136 | 79F4B1172A32C5FA00993C03 /* CNLiveBaseMoel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveBaseMoel.swift; sourceTree = "<group>"; }; |
| 133 | 137 | 79F4B1192A32F21400993C03 /* CNLiveMineNickViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveMineNickViewController.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -293,6 +297,7 @@ |
| 293 | 297 | 7963988A2A260B3300D045EB /* Classes */ = { |
| 294 | 298 | isa = PBXGroup; |
| 295 | 299 | children = ( |
| 300 | + 7C2703312A36CC430061EC50 /* GlobalBlock */, | |
| 296 | 301 | 798A44F32A3077ED00815935 /* CustomView */, |
| 297 | 302 | 790D01832A2D89E100C5978D /* Extensions */, |
| 298 | 303 | 7CD675502A29C036008354C1 /* Constant */, |
| ... | ... | @@ -407,6 +412,14 @@ |
| 407 | 412 | path = ViewModel; |
| 408 | 413 | sourceTree = "<group>"; |
| 409 | 414 | }; |
| 415 | + 7C2703312A36CC430061EC50 /* GlobalBlock */ = { | |
| 416 | + isa = PBXGroup; | |
| 417 | + children = ( | |
| 418 | + 7C2703322A36CC660061EC50 /* CNLiveGlobalBlock.swift */, | |
| 419 | + ); | |
| 420 | + path = GlobalBlock; | |
| 421 | + sourceTree = "<group>"; | |
| 422 | + }; | |
| 410 | 423 | 798A44F32A3077ED00815935 /* CustomView */ = { |
| 411 | 424 | isa = PBXGroup; |
| 412 | 425 | children = ( |
| ... | ... | @@ -437,6 +450,7 @@ |
| 437 | 450 | 7CD675412A2740F8008354C1 /* CNCustomIndexView.swift */, |
| 438 | 451 | 7C4931302A2F142F000E44B4 /* CNHomePageBackgroupView.swift */, |
| 439 | 452 | 7C4931372A307BDB000E44B4 /* CNHomePageGuideView.swift */, |
| 453 | + 7C27032F2A36CBE30061EC50 /* CNCertificationView.swift */, | |
| 440 | 454 | ); |
| 441 | 455 | name = View; |
| 442 | 456 | path = HomePage/View; |
| ... | ... | @@ -788,7 +802,9 @@ |
| 788 | 802 | 79F4B11A2A32F21400993C03 /* CNLiveMineNickViewController.swift in Sources */, |
| 789 | 803 | 798A44FF2A30A0A800815935 /* CNLiveInputFeedBackViewController.swift in Sources */, |
| 790 | 804 | 79282A442A2F1C1E00B5F8CF /* CNLiveLoginAuthView.swift in Sources */, |
| 805 | + 7C2703302A36CBE30061EC50 /* CNCertificationView.swift in Sources */, | |
| 791 | 806 | 790D01A32A2DDBA300C5978D /* CNLiveConfigManager.swift in Sources */, |
| 807 | + 7C2703332A36CC660061EC50 /* CNLiveGlobalBlock.swift in Sources */, | |
| 792 | 808 | 798A44EA2A30135D00815935 /* CNLiveMineBodyListView.swift in Sources */, |
| 793 | 809 | 798A44F92A30835400815935 /* CNLiveHelpFeedBackViewController.swift in Sources */, |
| 794 | 810 | 79A68C4A2A26E6CE00DC3B43 /* (null) in Sources */, | ... | ... |
metaCode/Classes/GlobalBlock/CNLiveGlobalBlock.swift
0 → 100644
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
| ... | ... | @@ -18,8 +18,33 @@ let CNKeyIsFirstAppearUpSlideHomeGuide: String = "isFirstAppearUpSlideHomeGuideK |
| 18 | 18 | ///存储是否第一次显示首页下滑引导 |
| 19 | 19 | let CNKeyIsFirstAppearDownSlideHomeGuide: String = "isFirstAppearDownSlideHomeGuideKey" |
| 20 | 20 | |
| 21 | +///用户身份认证状态 | |
| 22 | +enum UserIdentityStatus { | |
| 23 | + ///未认证 | |
| 24 | + case notCertified | |
| 25 | + ///已经认证 | |
| 26 | + case haveBeenCertified | |
| 27 | +} | |
| 28 | + | |
| 21 | 29 | class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDelegate, NewPagedFlowViewDataSource, CNCustomIndexViewDelegate{ |
| 22 | 30 | |
| 31 | + ///添加认证View | |
| 32 | + lazy var addCertificationView: CNCertificationView = { | |
| 33 | + let addCertificationView = CNCertificationView(frame: self.view.bounds) | |
| 34 | + | |
| 35 | + addCertificationView.addCertificationAction = { | |
| 36 | + [weak self] in | |
| 37 | + print("添加认证") | |
| 38 | + //模拟认证成功刷新主页面 | |
| 39 | + let time = DispatchTime.now() + 2.0 | |
| 40 | + DispatchQueue.main.asyncAfter(deadline: time, execute: DispatchWorkItem(block: { | |
| 41 | + self?.addCertificationView.isHidden = true | |
| 42 | + self?.addCertificationView.removeFromSuperview() | |
| 43 | + self?.addPageView() | |
| 44 | + })) | |
| 45 | + } | |
| 46 | + return addCertificationView | |
| 47 | + }() | |
| 23 | 48 | ///上滑引导View |
| 24 | 49 | lazy var upSlideGuideView:CNHomePageGuideView = { |
| 25 | 50 | let upSlideGuideView = CNHomePageGuideView.init(frame: UIScreen.main.bounds) |
| ... | ... | @@ -69,9 +94,12 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 69 | 94 | |
| 70 | 95 | ///NewPagedFlowView 开始滑动时的偏移量 |
| 71 | 96 | private var beginOffset = 0.0 |
| 72 | - | |
| 97 | + ///tabBar 的Y坐标位置 | |
| 73 | 98 | private var tabBarY:CGFloat = 0.0 |
| 74 | 99 | |
| 100 | + ///用户身份认证状态 | |
| 101 | + private var identityStatus: UserIdentityStatus = .haveBeenCertified | |
| 102 | + | |
| 75 | 103 | // MARK: - 懒加载 |
| 76 | 104 | ///数据源 |
| 77 | 105 | lazy var dataArray: NSMutableArray = { |
| ... | ... | @@ -130,32 +158,25 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 130 | 158 | |
| 131 | 159 | self.topNavView.isHidden = true |
| 132 | 160 | |
| 133 | - | |
| 134 | -// | |
| 135 | -// | |
| 136 | -// let maskView = UIView.init(frame: UIScreen.main.bounds) | |
| 137 | -// maskView.backgroundColor = .black.withAlphaComponent(0.7) | |
| 138 | -// maskView.isUserInteractionEnabled = false | |
| 139 | -// | |
| 140 | -// let path:UIBezierPath = UIBezierPath.init(rect: UIScreen.main.bounds) | |
| 141 | -// | |
| 142 | -// let W = KSreenWidth-50 | |
| 143 | -// let H = W*1.5 | |
| 144 | -// let rect = CGRectMake(25, (KSreenHeight-H)/2,W, H) | |
| 145 | -// | |
| 146 | -// let appendPath: UIBezierPath = UIBezierPath.init(roundedRect: rect, cornerRadius: 20) | |
| 147 | -// path.append(appendPath.reversing()) | |
| 148 | -// let shapeLayer: CAShapeLayer = CAShapeLayer() | |
| 149 | -// shapeLayer.path = path.cgPath; | |
| 150 | -// maskView.layer.mask = shapeLayer; | |
| 151 | -// | |
| 152 | -// self.view.addSubview(maskView) | |
| 153 | - | |
| 154 | 161 | } |
| 155 | 162 | // MARK: - 添加UI |
| 156 | 163 | func setupUI(){ |
| 157 | 164 | self.view.backgroundColor = KVCBackgroupColor |
| 158 | 165 | self.view.addSubview(self.backgroupView) |
| 166 | + | |
| 167 | + switch self.identityStatus{ | |
| 168 | + | |
| 169 | + case .notCertified: | |
| 170 | + self.view.addSubview(self.addCertificationView) | |
| 171 | + case .haveBeenCertified: | |
| 172 | + self.addPageView() | |
| 173 | + } | |
| 174 | + | |
| 175 | + | |
| 176 | + } | |
| 177 | + | |
| 178 | + ///添加主View | |
| 179 | + func addPageView(){ | |
| 159 | 180 | self.view.addSubview(self.pageFlowView) |
| 160 | 181 | self.pageFlowView.reloadData() |
| 161 | 182 | |
| ... | ... | @@ -182,7 +203,6 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 182 | 203 | self.view.addSubview(self.upSlideGuideView) |
| 183 | 204 | self.view.addSubview(self.upSlideGifView) |
| 184 | 205 | } |
| 185 | - | |
| 186 | 206 | } |
| 187 | 207 | |
| 188 | 208 | // MARK: - NewPagedFlowView代理 | ... | ... |
metaCode/Classes/Main/HomePage/View/CNCertificationView.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNCertificationView.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by daojian on 2023/6/12. | |
| 6 | +// | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | + | |
| 10 | +///身份认证View | |
| 11 | +class CNCertificationView : UIView{ | |
| 12 | + ///添加身份点击事件回调 | |
| 13 | + var addCertificationAction: closeBlock? | |
| 14 | + | |
| 15 | + lazy var contentView: UIView = { | |
| 16 | + let W = self.width-50 | |
| 17 | + let H = W*1.5 | |
| 18 | + let contentView = UIView.init(frame: CGRect(x: 25, y: KSreenHeight*0.16, width: W, height: H )) | |
| 19 | + contentView.backgroundColor = UIColor.white | |
| 20 | + contentView.clipsToBounds = true | |
| 21 | + contentView.layer.cornerRadius = 20 | |
| 22 | + | |
| 23 | + return contentView | |
| 24 | + | |
| 25 | + }() | |
| 26 | + | |
| 27 | + ///添加身份认证按钮 | |
| 28 | + lazy var addCerBtn: UIButton = { | |
| 29 | + let addCerBtn = UIButton(type: .custom) | |
| 30 | + addCerBtn.frame = CGRect(x: 0, y: 0, width: 145, height: 141) | |
| 31 | + addCerBtn.centerX = self.contentView.width/2 | |
| 32 | + addCerBtn.centerY = self.contentView.height/2 | |
| 33 | + addCerBtn.setImage(UIImage(named: "homePage_addCertification_icon"), for: .normal) | |
| 34 | + addCerBtn.addTarget(self, action: #selector(addCerBtnAction), for: .touchUpInside) | |
| 35 | + return addCerBtn | |
| 36 | + }() | |
| 37 | + | |
| 38 | + ///添加身份按钮底部标题 | |
| 39 | + lazy var addCerBtnBottomTitle: UILabel = { | |
| 40 | + let addCerBtnBottomTitle = UILabel(frame: CGRect(x: 0, y: self.addCerBtn.bottom - 10, width: 100, height: 22)) | |
| 41 | + addCerBtnBottomTitle.centerX = self.addCerBtn.centerX | |
| 42 | + addCerBtnBottomTitle.textColor = UIColor("#0066FE") | |
| 43 | + addCerBtnBottomTitle.textAlignment = .center | |
| 44 | + addCerBtnBottomTitle.font = UIFont.systemFont(ofSize: 15, weight: .regular) | |
| 45 | + addCerBtnBottomTitle.text = "身份认证" | |
| 46 | + return addCerBtnBottomTitle | |
| 47 | + | |
| 48 | + }() | |
| 49 | + | |
| 50 | + override init(frame: CGRect) { | |
| 51 | + super.init(frame: frame) | |
| 52 | + self.initUI() | |
| 53 | + | |
| 54 | + } | |
| 55 | + | |
| 56 | + required init?(coder: NSCoder) { | |
| 57 | + fatalError("init(coder:) has not been implemented") | |
| 58 | + } | |
| 59 | + | |
| 60 | + func initUI() | |
| 61 | + { | |
| 62 | + self.addSubview(self.contentView) | |
| 63 | + self.contentView.addSubview(self.addCerBtn) | |
| 64 | + self.contentView.addSubview(self.addCerBtnBottomTitle) | |
| 65 | + } | |
| 66 | + | |
| 67 | + @objc func addCerBtnAction(){ | |
| 68 | + | |
| 69 | + if(self.addCertificationAction != nil){ | |
| 70 | + self.addCertificationAction!() | |
| 71 | + } | |
| 72 | + | |
| 73 | + } | |
| 74 | +} | ... | ... |
metaCode/Classes/Main/HomePage/View/CNCustomIndexView.swift
| ... | ... | @@ -142,6 +142,13 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 142 | 142 | collectionView.backAction = {[weak self] in |
| 143 | 143 | self?.baseScrollView.setContentOffset(CGPoint(x: 0, y: (self!.baseScrollView.height)), animated: true) |
| 144 | 144 | self?.superScrollView?.isScrollEnabled = true |
| 145 | + | |
| 146 | + let time = DispatchTime.now() + 0.5 | |
| 147 | + DispatchQueue.main.asyncAfter(deadline:time, execute: DispatchWorkItem(block: { | |
| 148 | + //下滑提醒View回到初始位置 | |
| 149 | + self?.topCollectMoneyRemindView.top = -((self?.topCollectMoneyRemindView.height)! + 50) | |
| 150 | + })) | |
| 151 | + | |
| 145 | 152 | } |
| 146 | 153 | return collectionView |
| 147 | 154 | }() | ... | ... |
metaCode/Classes/Main/HomePage/View/CNMainView.swift
| ... | ... | @@ -10,8 +10,8 @@ import YYCategories |
| 10 | 10 | |
| 11 | 11 | ///旋转动画时间 |
| 12 | 12 | let KTransformAnimationTime:CGFloat = 0.75; |
| 13 | -///点击事件回调 | |
| 14 | -typealias closureBlock = ()->Void; | |
| 13 | + | |
| 14 | + | |
| 15 | 15 | |
| 16 | 16 | ///正面View |
| 17 | 17 | class CNFrontMainView : UIView{ |
| ... | ... | @@ -105,7 +105,7 @@ class CNBackMainView : UIView{ |
| 105 | 105 | bottomBackBtn.setTitleColor(UIColor("#333333"), for: .normal) |
| 106 | 106 | bottomBackBtn.setImage(UIImage(named: "homePage_backBtn_icon"), for: .normal) |
| 107 | 107 | bottomBackBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 8) |
| 108 | - bottomBackBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15, weight: .regular) | |
| 108 | + bottomBackBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15) | |
| 109 | 109 | |
| 110 | 110 | bottomBackBtn.addTarget(self, action: #selector(tapAction), for: .touchUpInside) |
| 111 | 111 | return bottomBackBtn |
| ... | ... | @@ -148,6 +148,7 @@ class CNMainView : UIView{ |
| 148 | 148 | fatalError("init(coder:) has not been implemented") |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + ///正面View | |
| 151 | 152 | lazy var frontView:CNFrontMainView = { |
| 152 | 153 | |
| 153 | 154 | let frontView = CNFrontMainView.init(frame: self.bounds) |
| ... | ... | @@ -157,6 +158,7 @@ class CNMainView : UIView{ |
| 157 | 158 | return frontView |
| 158 | 159 | }() |
| 159 | 160 | |
| 161 | + ///背面View | |
| 160 | 162 | lazy var backView:CNBackMainView = { |
| 161 | 163 | let backView = CNBackMainView.init(frame: self.bounds) |
| 162 | 164 | backView.tapTransformAciton = { [weak self] in |
| ... | ... | @@ -165,11 +167,15 @@ class CNMainView : UIView{ |
| 165 | 167 | return backView |
| 166 | 168 | }() |
| 167 | 169 | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 168 | 173 | func initUI() |
| 169 | 174 | { |
| 170 | 175 | self.addSubview(self.frontView) |
| 171 | 176 | self.addSubview(self.backView) |
| 172 | 177 | |
| 178 | + | |
| 173 | 179 | self.backView.isHidden = true; |
| 174 | 180 | |
| 175 | 181 | // self.layer.cornerRadius = 20; | ... | ... |
metaCode/Classes/Other/AppDelegate.swift
| ... | ... | @@ -21,7 +21,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { |
| 21 | 21 | |
| 22 | 22 | window = UIWindow.init(frame: UIScreen.main.bounds) |
| 23 | 23 | window?.backgroundColor = KVCBackgroupColor |
| 24 | - window?.rootViewController = UserInfoManager.shared.is_login ? CNLiveBaseTabBarViewController.init() : CNLiveLoginViewController.init() | |
| 24 | +// window?.rootViewController = UserInfoManager.shared.is_login ? CNLiveBaseTabBarViewController.init() : CNLiveLoginViewController.init() | |
| 25 | + window?.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 25 | 26 | window?.makeKeyAndVisible() |
| 26 | 27 | |
| 27 | 28 | ... | ... |
metaCode/Supporting Files/Assets.xcassets/Home/homePage_addCertification_icon.imageset/Contents.json
0 → 100644
| 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/Home/homePage_addCertification_icon.imageset/添加@2x.png
0 → 100644
54.8 KB
metaCode/Supporting Files/Assets.xcassets/Home/homePage_addCertification_icon.imageset/添加@3x.png
0 → 100644
114 KB