Commit 595ab15711b0e3238f5deab70dd58ee6ff2b6cff
1 parent
0541e120
登录时存储实名认证身份 , 适配短剧没数据时页面 , 数字简历页面存储
Showing
13 changed files
with
891 additions
and
31 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -173,6 +173,7 @@ |
| 173 | 173 | 19DFE6462C41099900E428AE /* CNLiveVitaeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DFE6452C41099900E428AE /* CNLiveVitaeModel.swift */; }; |
| 174 | 174 | 19DFE6492C44BEAE00E428AE /* CNLiveDigitalResumeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DFE6482C44BEAE00E428AE /* CNLiveDigitalResumeCell.swift */; }; |
| 175 | 175 | 19DFE64B2C4516B000E428AE /* CNLiveDigitalResumeSecCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DFE64A2C4516B000E428AE /* CNLiveDigitalResumeSecCell.swift */; }; |
| 176 | + 19DFE64D2C4792C500E428AE /* CNLiveDigitalResumeInfoController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DFE64C2C4792C500E428AE /* CNLiveDigitalResumeInfoController.swift */; }; | |
| 176 | 177 | 19E302672BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E302662BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift */; }; |
| 177 | 178 | 19E9D1602B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */; }; |
| 178 | 179 | 19E9D1622B3BBB2E00D0FB30 /* CNLiveFileManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */; }; |
| ... | ... | @@ -487,6 +488,7 @@ |
| 487 | 488 | 19DFE6452C41099900E428AE /* CNLiveVitaeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveVitaeModel.swift; sourceTree = "<group>"; }; |
| 488 | 489 | 19DFE6482C44BEAE00E428AE /* CNLiveDigitalResumeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumeCell.swift; sourceTree = "<group>"; }; |
| 489 | 490 | 19DFE64A2C4516B000E428AE /* CNLiveDigitalResumeSecCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumeSecCell.swift; sourceTree = "<group>"; }; |
| 491 | + 19DFE64C2C4792C500E428AE /* CNLiveDigitalResumeInfoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveDigitalResumeInfoController.swift; sourceTree = "<group>"; }; | |
| 490 | 492 | 19E302662BC8FEBC00F6B8BD /* CNLliveShopDetailCloseCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLliveShopDetailCloseCell.swift; sourceTree = "<group>"; }; |
| 491 | 493 | 19E9D15F2B3A98C200D0FB30 /* CNLiveShopAssociatedGoodsTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveShopAssociatedGoodsTableViewCell.swift; sourceTree = "<group>"; }; |
| 492 | 494 | 19E9D1612B3BBB2E00D0FB30 /* CNLiveFileManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CNLiveFileManager.swift; sourceTree = "<group>"; }; |
| ... | ... | @@ -1130,6 +1132,7 @@ |
| 1130 | 1132 | 1941348F2C22C25A004FC047 /* CNLiveDigitalMineRealNameController.swift */, |
| 1131 | 1133 | 194134972C292199004FC047 /* CNLiveIdentityRepositoryController.swift */, |
| 1132 | 1134 | 19DFE63F2C3FC5F400E428AE /* CNLiveDigitalResumeController.swift */, |
| 1135 | + 19DFE64C2C4792C500E428AE /* CNLiveDigitalResumeInfoController.swift */, | |
| 1133 | 1136 | ); |
| 1134 | 1137 | path = DigitalAuth; |
| 1135 | 1138 | sourceTree = "<group>"; |
| ... | ... | @@ -2090,6 +2093,7 @@ |
| 2090 | 2093 | 191733212B143F3A007BCC04 /* CNLiveGradientView.swift in Sources */, |
| 2091 | 2094 | 19AD65AE2BA177C20045A444 /* CNLiveShopGoodsDetailsTableHeaderView.swift in Sources */, |
| 2092 | 2095 | 19BB1FE62AEB93B80094D962 /* CNLiveShopUserInfoModel.swift in Sources */, |
| 2096 | + 19DFE64D2C4792C500E428AE /* CNLiveDigitalResumeInfoController.swift in Sources */, | |
| 2093 | 2097 | 7CD675472A274167008354C1 /* NewPagedFlowView.m in Sources */, |
| 2094 | 2098 | 191732ED2B073C52007BCC04 /* CNLiveShopClassifyListModel.swift in Sources */, |
| 2095 | 2099 | 191733482B2855E8007BCC04 /* CNLiveShopCouponViewModel.swift in Sources */, | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveDigitalResumeController.swift
| ... | ... | @@ -7,7 +7,19 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | |
| 10 | +///数字简历页面类型 | |
| 11 | +enum CNLiveResumeType { | |
| 12 | + ///默认状态 | |
| 13 | + case normal | |
| 14 | + ///我的简历 | |
| 15 | + case mineResume | |
| 16 | + ///预览简历 | |
| 17 | + case previewResume | |
| 18 | +} | |
| 19 | + | |
| 10 | 20 | class CNLiveDigitalResumeController:CNLiveBaseViewController,UITableViewDataSource, UITableViewDelegate{ |
| 21 | + | |
| 22 | + var resumeType:CNLiveResumeType = .normal | |
| 11 | 23 | //简历model |
| 12 | 24 | var vitaeModel:CNLiveVitaeModel? |
| 13 | 25 | lazy var moreNavBtn: UIButton = { | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveDigitalResumeInfoController.swift
0 → 100644
| 1 | +// | |
| 2 | +// CNLiveDigitalResumeInfoController.swift | |
| 3 | +// metaCode | |
| 4 | +// | |
| 5 | +// Created by zx on 2024/7/17. | |
| 6 | +// 数字简历信息页面 | |
| 7 | + | |
| 8 | +import Foundation | |
| 9 | +import SnapKit | |
| 10 | +import CoreLocation | |
| 11 | + | |
| 12 | + | |
| 13 | +class CNLiveDigitalResumeInfoController:CNLiveBaseViewController, UITextFieldDelegate,CLLocationManagerDelegate{ | |
| 14 | + let locationManager = CLLocationManager() | |
| 15 | + | |
| 16 | + lazy var topWhiteView :UIView = { | |
| 17 | + let bottomNavView = UIView() | |
| 18 | + bottomNavView.backgroundColor = .white | |
| 19 | + bottomNavView.layer.cornerRadius = 9 | |
| 20 | + bottomNavView.clipsToBounds = true | |
| 21 | + return bottomNavView | |
| 22 | + }() | |
| 23 | + lazy var yinsiTitleLabel: UILabel = { | |
| 24 | + let titleLabel = UILabel.init() | |
| 25 | + titleLabel.textColor = HexColor("#B4B4B4") | |
| 26 | + titleLabel.text = "隐私设置(关闭后,对方将看不到该信息)" | |
| 27 | + titleLabel.textAlignment = .left | |
| 28 | + titleLabel.font = BoldFont_15 | |
| 29 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 30 | + return titleLabel | |
| 31 | + }() | |
| 32 | + | |
| 33 | + lazy var bottomWhiteView :UIView = { | |
| 34 | + let bottomNavView = UIView() | |
| 35 | + bottomNavView.backgroundColor = .white | |
| 36 | + bottomNavView.layer.cornerRadius = 9 | |
| 37 | + bottomNavView.clipsToBounds = true | |
| 38 | + return bottomNavView | |
| 39 | + }() | |
| 40 | + lazy var weizhiTitleLabel: UILabel = { | |
| 41 | + let titleLabel = UILabel.init() | |
| 42 | + titleLabel.textColor = HexColor("#333333") | |
| 43 | + titleLabel.text = "当前位置" | |
| 44 | + titleLabel.textAlignment = .left | |
| 45 | + titleLabel.font = BoldFont_15 | |
| 46 | + return titleLabel | |
| 47 | + }() | |
| 48 | + lazy var weizhiRightTitleLabel: UILabel = { | |
| 49 | + let titleLabel = UILabel.init() | |
| 50 | + titleLabel.textColor = HexColor("#333333") | |
| 51 | + titleLabel.text = "暂无定位信息" | |
| 52 | + titleLabel.textAlignment = .right | |
| 53 | + titleLabel.font = Font_15 | |
| 54 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 55 | + return titleLabel | |
| 56 | + }() | |
| 57 | + lazy var weiZhiRightImgView :UIImageView = { | |
| 58 | + let iconImgView = UIImageView() | |
| 59 | + iconImgView.image = UIImage(named: "mine_header_message_gray_more") | |
| 60 | + iconImgView.contentMode = .scaleAspectFit | |
| 61 | + return iconImgView | |
| 62 | + }() | |
| 63 | + lazy var weiZhiTapView :UIView = { | |
| 64 | + let bottomNavView = UIView() | |
| 65 | + bottomNavView.backgroundColor = .clear | |
| 66 | + bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(weiZhiTapAction))) | |
| 67 | + return bottomNavView | |
| 68 | + }() | |
| 69 | + lazy var topLine1View :UIView = { | |
| 70 | + let bottomNavView = UIView() | |
| 71 | + bottomNavView.backgroundColor = HexColor("#EAEAEA") | |
| 72 | + return bottomNavView | |
| 73 | + }() | |
| 74 | + lazy var lianxiTitleLabel: UILabel = { | |
| 75 | + let titleLabel = UILabel.init() | |
| 76 | + titleLabel.textColor = HexColor("#333333") | |
| 77 | + titleLabel.text = "联系电话" | |
| 78 | + titleLabel.textAlignment = .left | |
| 79 | + titleLabel.font = BoldFont_15 | |
| 80 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 81 | + return titleLabel | |
| 82 | + }() | |
| 83 | + lazy var phoneTextFiled :UITextField = { | |
| 84 | + let textFiled = UITextField() | |
| 85 | + textFiled.textAlignment = .right | |
| 86 | + textFiled.font = Font_15 | |
| 87 | + textFiled.attributedPlaceholder = NSAttributedString(string: "请输入", attributes: [.foregroundColor: HexColor("#B4B4B4")!]) | |
| 88 | + textFiled.textColor = HexColor("#333333") | |
| 89 | + textFiled.delegate = self | |
| 90 | + textFiled.returnKeyType = .done | |
| 91 | + textFiled.clearButtonMode = .whileEditing | |
| 92 | + return textFiled | |
| 93 | + }() | |
| 94 | + lazy var topLine2View :UIView = { | |
| 95 | + let bottomNavView = UIView() | |
| 96 | + bottomNavView.backgroundColor = HexColor("#EAEAEA") | |
| 97 | + return bottomNavView | |
| 98 | + }() | |
| 99 | + lazy var canjiaTitleLabel: UILabel = { | |
| 100 | + let titleLabel = UILabel.init() | |
| 101 | + titleLabel.textColor = HexColor("#333333") | |
| 102 | + titleLabel.text = "参加工作时间" | |
| 103 | + titleLabel.textAlignment = .left | |
| 104 | + titleLabel.font = BoldFont_15 | |
| 105 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 106 | + return titleLabel | |
| 107 | + }() | |
| 108 | + lazy var canjiaRightTitleLabel: UILabel = { | |
| 109 | + let titleLabel = UILabel.init() | |
| 110 | + titleLabel.textColor = HexColor("#B4B4B4") | |
| 111 | + titleLabel.text = "请选择" | |
| 112 | + titleLabel.textAlignment = .right | |
| 113 | + titleLabel.font = Font_15 | |
| 114 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 115 | + return titleLabel | |
| 116 | + }() | |
| 117 | + lazy var canjiaRightImgView :UIImageView = { | |
| 118 | + let iconImgView = UIImageView() | |
| 119 | + iconImgView.image = UIImage(named: "mine_header_message_gray_more") | |
| 120 | + iconImgView.contentMode = .scaleAspectFit | |
| 121 | + return iconImgView | |
| 122 | + }() | |
| 123 | + lazy var canjiaTapView :UIView = { | |
| 124 | + let bottomNavView = UIView() | |
| 125 | + bottomNavView.backgroundColor = .clear | |
| 126 | + bottomNavView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(canJiaTapAction))) | |
| 127 | + return bottomNavView | |
| 128 | + }() | |
| 129 | + | |
| 130 | + lazy var nianlingTitleLabel: UILabel = { | |
| 131 | + let titleLabel = UILabel.init() | |
| 132 | + titleLabel.textColor = HexColor("#333333") | |
| 133 | + titleLabel.text = "展示我的年龄" | |
| 134 | + titleLabel.textAlignment = .left | |
| 135 | + titleLabel.font = BoldFont_15 | |
| 136 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 137 | + return titleLabel | |
| 138 | + }() | |
| 139 | + lazy var nianLingSwitch: UISwitch = { | |
| 140 | + let switchView = UISwitch.init() | |
| 141 | + switchView.isOn = false | |
| 142 | + switchView.onTintColor = .blue | |
| 143 | + switchView.addTarget(self, action: #selector(nianLingSwitchAction), for: .valueChanged) | |
| 144 | + return switchView | |
| 145 | + }() | |
| 146 | + lazy var phoneSwitch: UISwitch = { | |
| 147 | + let switchView = UISwitch.init() | |
| 148 | + switchView.isOn = false | |
| 149 | + switchView.onTintColor = .blue | |
| 150 | + switchView.addTarget(self, action: #selector(phoneSwitchAction), for: .valueChanged) | |
| 151 | + return switchView | |
| 152 | + }() | |
| 153 | + lazy var weiZhiSwitch: UISwitch = { | |
| 154 | + let switchView = UISwitch.init() | |
| 155 | + switchView.isOn = false | |
| 156 | + switchView.onTintColor = .blue | |
| 157 | + switchView.addTarget(self, action: #selector(weiZhiSwitchAction), for: .valueChanged) | |
| 158 | + return switchView | |
| 159 | + }() | |
| 160 | + lazy var huoJiangSwitch: UISwitch = { | |
| 161 | + let switchView = UISwitch.init() | |
| 162 | + switchView.isOn = false | |
| 163 | + switchView.onTintColor = .blue | |
| 164 | + switchView.addTarget(self, action: #selector(huoJiangSwitchAction), for: .valueChanged) | |
| 165 | + return switchView | |
| 166 | + }() | |
| 167 | + | |
| 168 | + lazy var bottomLine1View :UIView = { | |
| 169 | + let bottomNavView = UIView() | |
| 170 | + bottomNavView.backgroundColor = HexColor("#EAEAEA") | |
| 171 | + return bottomNavView | |
| 172 | + }() | |
| 173 | + lazy var phoneTitleLabel: UILabel = { | |
| 174 | + let titleLabel = UILabel.init() | |
| 175 | + titleLabel.textColor = HexColor("#333333") | |
| 176 | + titleLabel.text = "展示我的手机号" | |
| 177 | + titleLabel.textAlignment = .left | |
| 178 | + titleLabel.font = BoldFont_15 | |
| 179 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 180 | + return titleLabel | |
| 181 | + }() | |
| 182 | + lazy var bottomLine2View :UIView = { | |
| 183 | + let bottomNavView = UIView() | |
| 184 | + bottomNavView.backgroundColor = HexColor("#EAEAEA") | |
| 185 | + return bottomNavView | |
| 186 | + }() | |
| 187 | + lazy var zhanShiWeiZhiTitleLabel: UILabel = { | |
| 188 | + let titleLabel = UILabel.init() | |
| 189 | + titleLabel.textColor = HexColor("#333333") | |
| 190 | + titleLabel.text = "展示我的位置" | |
| 191 | + titleLabel.textAlignment = .left | |
| 192 | + titleLabel.font = BoldFont_15 | |
| 193 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 194 | + return titleLabel | |
| 195 | + }() | |
| 196 | + lazy var bottomLine3View :UIView = { | |
| 197 | + let bottomNavView = UIView() | |
| 198 | + bottomNavView.backgroundColor = HexColor("#EAEAEA") | |
| 199 | + return bottomNavView | |
| 200 | + }() | |
| 201 | + lazy var huoJiangTitleLabel: UILabel = { | |
| 202 | + let titleLabel = UILabel.init() | |
| 203 | + titleLabel.textColor = HexColor("#333333") | |
| 204 | + titleLabel.text = "展示我的获奖信息" | |
| 205 | + titleLabel.textAlignment = .left | |
| 206 | + titleLabel.font = BoldFont_15 | |
| 207 | + titleLabel.adjustsFontSizeToFitWidth=true | |
| 208 | + return titleLabel | |
| 209 | + }() | |
| 210 | + | |
| 211 | + | |
| 212 | + override func viewDidLoad() { | |
| 213 | + super.viewDidLoad() | |
| 214 | + titleName = "数字简历信息" | |
| 215 | + navigationBarHidden = false | |
| 216 | + self.view.backgroundColor = HexColor("#F6F7FB") | |
| 217 | + self.initUI() | |
| 218 | + self.loadLocalData() | |
| 219 | + } | |
| 220 | + | |
| 221 | + | |
| 222 | + func initUI(){ | |
| 223 | + self.view.addSubview(self.topWhiteView) | |
| 224 | + self.topWhiteView.snp.makeConstraints { make in | |
| 225 | + make.top.equalTo(KNavigationHeight+15) | |
| 226 | + make.left.equalTo(15) | |
| 227 | + make.right.equalToSuperview().offset(-15) | |
| 228 | + make.height.equalTo(184) | |
| 229 | + } | |
| 230 | + self.topWhiteView.addSubview(self.weizhiTitleLabel) | |
| 231 | + self.weizhiTitleLabel.snp.makeConstraints { make in | |
| 232 | + make.top.equalTo(20) | |
| 233 | + make.left.equalTo(15) | |
| 234 | + make.width.equalTo(62) | |
| 235 | + make.height.equalTo(21) | |
| 236 | + } | |
| 237 | + self.topWhiteView.addSubview(self.weizhiRightTitleLabel) | |
| 238 | + self.weizhiRightTitleLabel.snp.makeConstraints { make in | |
| 239 | + make.top.equalTo(20) | |
| 240 | + make.right.equalToSuperview().offset(-28) | |
| 241 | + make.left.equalTo(self.weizhiTitleLabel.snp.right).offset(5) | |
| 242 | + } | |
| 243 | + self.topWhiteView.addSubview(self.weiZhiRightImgView) | |
| 244 | + self.weiZhiRightImgView.snp.makeConstraints { make in | |
| 245 | + make.width.height.equalTo(13) | |
| 246 | + make.centerY.equalTo(self.weizhiRightTitleLabel.snp.centerY) | |
| 247 | + make.left.equalTo(self.weizhiRightTitleLabel.snp.right) | |
| 248 | + } | |
| 249 | + self.topWhiteView.addSubview(self.topLine1View) | |
| 250 | + self.topLine1View.snp.makeConstraints { make in | |
| 251 | + make.top.equalTo(self.weizhiTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | |
| 252 | + make.left.equalTo(15) | |
| 253 | + make.height.equalTo(0.5) | |
| 254 | + make.right.equalToSuperview().offset(-15) | |
| 255 | + } | |
| 256 | + self.topWhiteView.addSubview(self.weiZhiTapView) | |
| 257 | + self.weiZhiTapView.snp.makeConstraints { make in | |
| 258 | + make.left.right.top.equalToSuperview() | |
| 259 | + make.bottom.equalTo(self.topLine1View.snp.top) | |
| 260 | + } | |
| 261 | + self.topWhiteView.addSubview(self.lianxiTitleLabel) | |
| 262 | + self.lianxiTitleLabel.snp.makeConstraints { make in | |
| 263 | + make.top.equalTo(self.topLine1View.snp.bottom).offset(adapt_length(length: 20)) | |
| 264 | + make.left.equalTo(15) | |
| 265 | + } | |
| 266 | + self.topWhiteView.addSubview(self.phoneTextFiled) | |
| 267 | + self.phoneTextFiled.snp.makeConstraints { make in | |
| 268 | + make.centerY.equalTo(self.lianxiTitleLabel.snp.centerY) | |
| 269 | + make.left.equalTo(self.lianxiTitleLabel.snp.right).offset(10) | |
| 270 | + make.right.equalToSuperview().offset(-15) | |
| 271 | + make.height.equalTo(21) | |
| 272 | + } | |
| 273 | + self.topWhiteView.addSubview(self.topLine2View) | |
| 274 | + self.topLine2View.snp.makeConstraints { make in | |
| 275 | + make.top.equalTo(self.lianxiTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | |
| 276 | + make.left.equalTo(15) | |
| 277 | + make.height.equalTo(0.5) | |
| 278 | + make.right.equalToSuperview().offset(-15) | |
| 279 | + } | |
| 280 | + self.topWhiteView.addSubview(self.canjiaTitleLabel) | |
| 281 | + self.canjiaTitleLabel.snp.makeConstraints { make in | |
| 282 | + make.top.equalTo(self.topLine2View.snp.bottom).offset(adapt_length(length: 20)) | |
| 283 | + make.left.equalTo(15) | |
| 284 | + } | |
| 285 | + self.topWhiteView.addSubview(self.canjiaRightTitleLabel) | |
| 286 | + self.canjiaRightTitleLabel.snp.makeConstraints { make in | |
| 287 | + make.centerY.equalTo(self.canjiaTitleLabel.snp.centerY) | |
| 288 | + make.right.equalToSuperview().offset(-28) | |
| 289 | + make.left.equalTo(self.canjiaTitleLabel.snp.right).offset(5) | |
| 290 | + make.height.equalTo(21) | |
| 291 | + } | |
| 292 | + self.topWhiteView.addSubview(self.canjiaRightImgView) | |
| 293 | + self.canjiaRightImgView.snp.makeConstraints { make in | |
| 294 | + make.width.height.equalTo(13) | |
| 295 | + make.centerY.equalTo(self.canjiaRightTitleLabel.snp.centerY) | |
| 296 | + make.left.equalTo(self.canjiaRightTitleLabel.snp.right) | |
| 297 | + } | |
| 298 | + self.topWhiteView.addSubview(self.canjiaTapView) | |
| 299 | + self.canjiaTapView.snp.makeConstraints { make in | |
| 300 | + make.left.right.bottom.equalToSuperview() | |
| 301 | + make.top.equalTo(self.topLine2View.snp.bottom) | |
| 302 | + } | |
| 303 | + | |
| 304 | + self.view.addSubview(self.yinsiTitleLabel) | |
| 305 | + self.yinsiTitleLabel.snp.makeConstraints { make in | |
| 306 | + make.top.equalTo(self.topWhiteView.snp.bottom).offset(adapt_length(length: 20)) | |
| 307 | + make.left.equalTo(self.topWhiteView.snp.left) | |
| 308 | + } | |
| 309 | + self.view.addSubview(self.bottomWhiteView) | |
| 310 | + self.bottomWhiteView.snp.makeConstraints { make in | |
| 311 | + make.top.equalTo(self.yinsiTitleLabel.snp.bottom).offset(adapt_length(length: 10)) | |
| 312 | + make.left.equalTo(15) | |
| 313 | + make.right.equalToSuperview().offset(-15) | |
| 314 | + make.height.equalTo(246) | |
| 315 | + } | |
| 316 | + self.bottomWhiteView.addSubview(self.nianlingTitleLabel) | |
| 317 | + self.nianlingTitleLabel.snp.makeConstraints { make in | |
| 318 | + make.top.equalTo(20) | |
| 319 | + make.left.equalTo(15) | |
| 320 | + } | |
| 321 | + self.bottomWhiteView.addSubview(self.nianLingSwitch) | |
| 322 | + self.nianLingSwitch.snp.makeConstraints { make in | |
| 323 | + make.top.equalTo(20) | |
| 324 | + make.right.equalToSuperview().offset(-15) | |
| 325 | + } | |
| 326 | + self.bottomWhiteView.addSubview(self.bottomLine1View) | |
| 327 | + self.bottomLine1View.snp.makeConstraints { make in | |
| 328 | + make.top.equalTo(self.nianlingTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | |
| 329 | + make.left.equalTo(15) | |
| 330 | + make.height.equalTo(0.5) | |
| 331 | + make.right.equalToSuperview().offset(-15) | |
| 332 | + } | |
| 333 | + self.bottomWhiteView.addSubview(self.phoneTitleLabel) | |
| 334 | + self.phoneTitleLabel.snp.makeConstraints { make in | |
| 335 | + make.top.equalTo(self.bottomLine1View.snp.bottom).offset(adapt_length(length: 20)) | |
| 336 | + make.left.equalTo(15) | |
| 337 | + } | |
| 338 | + self.bottomWhiteView.addSubview(self.phoneSwitch) | |
| 339 | + self.phoneSwitch.snp.makeConstraints { make in | |
| 340 | + make.top.equalTo(self.phoneTitleLabel.snp.top) | |
| 341 | + make.right.equalToSuperview().offset(-15) | |
| 342 | + } | |
| 343 | + self.bottomWhiteView.addSubview(self.bottomLine2View) | |
| 344 | + self.bottomLine2View.snp.makeConstraints { make in | |
| 345 | + make.top.equalTo(self.phoneTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | |
| 346 | + make.left.equalTo(15) | |
| 347 | + make.height.equalTo(0.5) | |
| 348 | + make.right.equalToSuperview().offset(-15) | |
| 349 | + } | |
| 350 | + self.bottomWhiteView.addSubview(self.zhanShiWeiZhiTitleLabel) | |
| 351 | + self.zhanShiWeiZhiTitleLabel.snp.makeConstraints { make in | |
| 352 | + make.top.equalTo(self.bottomLine2View.snp.bottom).offset(adapt_length(length: 20)) | |
| 353 | + make.left.equalTo(15) | |
| 354 | + } | |
| 355 | + self.bottomWhiteView.addSubview(self.weiZhiSwitch) | |
| 356 | + self.weiZhiSwitch.snp.makeConstraints { make in | |
| 357 | + make.top.equalTo(self.zhanShiWeiZhiTitleLabel.snp.top) | |
| 358 | + make.right.equalToSuperview().offset(-15) | |
| 359 | + } | |
| 360 | + self.bottomWhiteView.addSubview(self.bottomLine3View) | |
| 361 | + self.bottomLine3View.snp.makeConstraints { make in | |
| 362 | + make.top.equalTo(self.zhanShiWeiZhiTitleLabel.snp.bottom).offset(adapt_length(length: 20)) | |
| 363 | + make.left.equalTo(15) | |
| 364 | + make.height.equalTo(0.5) | |
| 365 | + make.right.equalToSuperview().offset(-15) | |
| 366 | + } | |
| 367 | + self.bottomWhiteView.addSubview(self.huoJiangTitleLabel) | |
| 368 | + self.huoJiangTitleLabel.snp.makeConstraints { make in | |
| 369 | + make.top.equalTo(self.bottomLine3View.snp.bottom).offset(adapt_length(length: 20)) | |
| 370 | + make.left.equalTo(15) | |
| 371 | + } | |
| 372 | + self.bottomWhiteView.addSubview(self.huoJiangSwitch) | |
| 373 | + self.huoJiangSwitch.snp.makeConstraints { make in | |
| 374 | + make.top.equalTo(self.huoJiangTitleLabel.snp.top) | |
| 375 | + make.right.equalToSuperview().offset(-15) | |
| 376 | + } | |
| 377 | + } | |
| 378 | + | |
| 379 | + func loadLocalData(){ | |
| 380 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 381 | + if let seleDay = userDic["selectDay"]{ | |
| 382 | + print(seleDay) | |
| 383 | + //设置过工作日期 | |
| 384 | + self.canjiaRightTitleLabel.text = seleDay as? String | |
| 385 | + }else{ | |
| 386 | + //没设置过工作日期 | |
| 387 | + self.canjiaRightTitleLabel.text = "请选择" | |
| 388 | + } | |
| 389 | + if let phone = userDic["phone"]{ | |
| 390 | + //设置过手机号 | |
| 391 | + self.phoneTextFiled.text = phone as? String | |
| 392 | + }else{ | |
| 393 | + //没设置过手机号 | |
| 394 | + self.phoneTextFiled.text = "" | |
| 395 | + } | |
| 396 | + | |
| 397 | + if let showAge = userDic["showAge"]{ | |
| 398 | + //设置展示年龄 | |
| 399 | + self.nianLingSwitch.isOn = showAge as! Bool | |
| 400 | + }else{ | |
| 401 | + //没设置展示年龄 | |
| 402 | + self.nianLingSwitch.isOn = false | |
| 403 | + } | |
| 404 | + | |
| 405 | + if let showPhone = userDic["showPhone"]{ | |
| 406 | + //设置展示手机号 | |
| 407 | + self.phoneSwitch.isOn = showPhone as! Bool | |
| 408 | + }else{ | |
| 409 | + //没设置展示手机号 | |
| 410 | + self.phoneSwitch.isOn = false | |
| 411 | + } | |
| 412 | + | |
| 413 | + if let showWeiZhi = userDic["showWeiZhi"]{ | |
| 414 | + //设置展示位置 | |
| 415 | + self.weiZhiSwitch.isOn = showWeiZhi as! Bool | |
| 416 | + }else{ | |
| 417 | + //没设置展示位置 | |
| 418 | + self.weiZhiSwitch.isOn = false | |
| 419 | + } | |
| 420 | + | |
| 421 | + if let showHuoJiang = userDic["showHuoJiang"]{ | |
| 422 | + //设置展示获奖 | |
| 423 | + self.huoJiangSwitch.isOn = showHuoJiang as! Bool | |
| 424 | + }else{ | |
| 425 | + //没设置展示获奖 | |
| 426 | + self.huoJiangSwitch.isOn = false | |
| 427 | + } | |
| 428 | + | |
| 429 | + if let cityStreet = userDic["cityStreet"]{ | |
| 430 | + //设置街区 | |
| 431 | + self.weizhiRightTitleLabel.text = cityStreet as? String | |
| 432 | + }else{ | |
| 433 | + //没设置街区 | |
| 434 | + self.weizhiRightTitleLabel.text = "暂无定位信息" | |
| 435 | + } | |
| 436 | + } | |
| 437 | + } | |
| 438 | + | |
| 439 | + deinit { | |
| 440 | + | |
| 441 | + } | |
| 442 | + // MARK: - UITextFieldDelegate | |
| 443 | + func textFieldDidEndEditing(_ textField: UITextField) { | |
| 444 | + self.view.endEditing(true) | |
| 445 | + if textField.text?.count ?? 0 > 0{ | |
| 446 | + self.savePhone() | |
| 447 | + } | |
| 448 | + } | |
| 449 | + | |
| 450 | + func savePhone(){ | |
| 451 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 452 | + userDic.updateValue(self.phoneTextFiled.text ?? "", forKey: "phone") | |
| 453 | + UserDefaults.standard.setValue(userDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 454 | + UserDefaults.standard.synchronize() | |
| 455 | + }else{ | |
| 456 | + let tempDic = NSMutableDictionary() | |
| 457 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 458 | + UserDefaults.standard.synchronize() | |
| 459 | + } | |
| 460 | + } | |
| 461 | + | |
| 462 | + // MARK: - ButtonAction | |
| 463 | + @objc func weiZhiTapAction(){ | |
| 464 | + self.getPlacemarkAddress() | |
| 465 | + } | |
| 466 | + func saveWeiZhi(cityStreet:String){ | |
| 467 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 468 | + userDic.updateValue(cityStreet, forKey: "cityStreet") | |
| 469 | + UserDefaults.standard.setValue(userDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 470 | + UserDefaults.standard.synchronize() | |
| 471 | + }else{ | |
| 472 | + let tempDic = NSMutableDictionary() | |
| 473 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 474 | + UserDefaults.standard.synchronize() | |
| 475 | + } | |
| 476 | + } | |
| 477 | + // 代理方法:当定位权限被确定时调用 | |
| 478 | + func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus) { | |
| 479 | + if status == .authorizedWhenInUse || status == .authorizedAlways { | |
| 480 | + // 权限已授权,可以开始获取位置信息 | |
| 481 | + locationManager.startUpdatingLocation() | |
| 482 | + } | |
| 483 | + } | |
| 484 | + | |
| 485 | + // 代理方法:当位置更新时调用 | |
| 486 | + func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { | |
| 487 | + guard let location = locations.last else { return } | |
| 488 | + | |
| 489 | + // 停止更新位置以节省资源 | |
| 490 | + locationManager.stopUpdatingLocation() | |
| 491 | + | |
| 492 | + // 反向地理编码位置以获取地址信息 | |
| 493 | + let geocoder = CLGeocoder() | |
| 494 | + geocoder.reverseGeocodeLocation(location, completionHandler: { (placemarks, error) in | |
| 495 | + if let error = error { | |
| 496 | + print("Geocoding failed with error: \(error.localizedDescription)") | |
| 497 | + return | |
| 498 | + } | |
| 499 | + | |
| 500 | + if let placemark = placemarks?.first { | |
| 501 | + print("市区:\(placemark.locality ?? "")") | |
| 502 | + print("街道:\(placemark.thoroughfare ?? "")") | |
| 503 | + // 你可以根据需要进一步处理placemark对象 | |
| 504 | + let cityStreet = (placemark.locality ?? "") + (placemark.thoroughfare ?? "") | |
| 505 | + self.saveWeiZhi(cityStreet:cityStreet) | |
| 506 | + self.weizhiRightTitleLabel.text = cityStreet | |
| 507 | + } | |
| 508 | + }) | |
| 509 | + } | |
| 510 | + | |
| 511 | + // 代理方法:处理定位错误(可选) | |
| 512 | + func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { | |
| 513 | + print("Location manager failed with error: \(error.localizedDescription)") | |
| 514 | + } | |
| 515 | + func getPlacemarkAddress() { | |
| 516 | + // 检查定位服务是否可用 | |
| 517 | + if CLLocationManager.locationServicesEnabled() { | |
| 518 | + // 设置定位管理器的代理 | |
| 519 | + locationManager.delegate = self | |
| 520 | + // 请求前台使用时的定位权限 | |
| 521 | + locationManager.requestWhenInUseAuthorization() | |
| 522 | + // 配置定位管理器 | |
| 523 | + locationManager.desiredAccuracy = kCLLocationAccuracyBest | |
| 524 | + locationManager.startUpdatingLocation() | |
| 525 | + } else { | |
| 526 | + // 定位服务不可用 | |
| 527 | + print("Location services are not enabled") | |
| 528 | + } | |
| 529 | + | |
| 530 | + } | |
| 531 | + | |
| 532 | + @objc func canJiaTapAction(){ | |
| 533 | + MineInfoAlertView.showSelectView(showType: .selectDay) { [weak self] text in | |
| 534 | + print("刷新之后的数据是=>\(text)")//"2024-06-18" | |
| 535 | + if (text as! String).count > 0{ | |
| 536 | + let textStr = text as! String | |
| 537 | + self?.canjiaRightTitleLabel.text = textStr | |
| 538 | + self?.canjiaRightTitleLabel.textColor = HexColor("#333333") | |
| 539 | + | |
| 540 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 541 | + userDic.updateValue(textStr, forKey: "selectDay") | |
| 542 | + UserDefaults.standard.setValue(userDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 543 | + UserDefaults.standard.synchronize() | |
| 544 | + }else{ | |
| 545 | + let tempDic = NSMutableDictionary() | |
| 546 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 547 | + UserDefaults.standard.synchronize() | |
| 548 | + } | |
| 549 | + | |
| 550 | + | |
| 551 | + }else{ | |
| 552 | + self?.canjiaRightTitleLabel.text = "请选择" | |
| 553 | + self?.canjiaRightTitleLabel.textColor = HexColor("#B4B4B4") | |
| 554 | + } | |
| 555 | + } | |
| 556 | + } | |
| 557 | + | |
| 558 | + // MARK: - SwitchAction | |
| 559 | + @objc func nianLingSwitchAction(sender: UISwitch) { | |
| 560 | + self.saveShowSwitch(key: "showAge", isOn: sender.isOn) | |
| 561 | + } | |
| 562 | + @objc func phoneSwitchAction(sender: UISwitch) { | |
| 563 | + self.saveShowSwitch(key: "showPhone", isOn: sender.isOn) | |
| 564 | + } | |
| 565 | + @objc func weiZhiSwitchAction(sender: UISwitch) { | |
| 566 | + self.saveShowSwitch(key: "showWeiZhi", isOn: sender.isOn) | |
| 567 | + } | |
| 568 | + @objc func huoJiangSwitchAction(sender: UISwitch) { | |
| 569 | + self.saveShowSwitch(key: "showHuoJiang", isOn: sender.isOn) | |
| 570 | + } | |
| 571 | + | |
| 572 | + func saveShowSwitch(key:String,isOn:Bool){ | |
| 573 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 574 | + userDic.updateValue(isOn, forKey: key) | |
| 575 | + UserDefaults.standard.setValue(userDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 576 | + UserDefaults.standard.synchronize() | |
| 577 | + }else{ | |
| 578 | + let tempDic = NSMutableDictionary() | |
| 579 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 580 | + UserDefaults.standard.synchronize() | |
| 581 | + } | |
| 582 | + } | |
| 583 | +} | ... | ... |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/CNLiveRealNameAuthController.swift
| ... | ... | @@ -12,6 +12,7 @@ import QMUIKit |
| 12 | 12 | class CNLiveRealNameAuthController:CNLiveBaseViewController,UITableViewDataSource,UITableViewDelegate{ |
| 13 | 13 | |
| 14 | 14 | var channelId:String = "0" |
| 15 | + var isResume:Bool = false//是否跳转到数字简历页面 | |
| 15 | 16 | var vsid:String = "" |
| 16 | 17 | var sid:String = "" |
| 17 | 18 | |
| ... | ... | @@ -213,12 +214,24 @@ class CNLiveRealNameAuthController:CNLiveBaseViewController,UITableViewDataSourc |
| 213 | 214 | showMessage(message: "请输入证件号码") |
| 214 | 215 | return |
| 215 | 216 | } |
| 216 | - //进入人脸识别页面 | |
| 217 | - let vc = CNLiveFaceAuthController() | |
| 218 | - vc.realName = self.nameTextStr | |
| 219 | - vc.realNumber = self.numberTextStr | |
| 220 | - vc.channelId = self.channelId | |
| 221 | - self.navigationController?.pushViewController(vc, animated: true) | |
| 217 | + if self.isResume == true{ | |
| 218 | + //进入数字简历页面 | |
| 219 | + let is_agree = UserDefaults.standard.bool(forKey: "is_agree_shuzijianlixieyi") | |
| 220 | + if is_agree{ | |
| 221 | + //跳转数字简历页面 | |
| 222 | + let vc = CNLiveDigitalResumeController() | |
| 223 | + self.navigationController?.pushViewController(vc, animated: true) | |
| 224 | + }else{ | |
| 225 | + self.showXieyiAlert() | |
| 226 | + } | |
| 227 | + }else{ | |
| 228 | + //进入人脸识别页面 | |
| 229 | + let vc = CNLiveFaceAuthController() | |
| 230 | + vc.realName = self.nameTextStr | |
| 231 | + vc.realNumber = self.numberTextStr | |
| 232 | + vc.channelId = self.channelId | |
| 233 | + self.navigationController?.pushViewController(vc, animated: true) | |
| 234 | + } | |
| 222 | 235 | } |
| 223 | 236 | |
| 224 | 237 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| ... | ... | @@ -255,4 +268,102 @@ class CNLiveRealNameAuthController:CNLiveBaseViewController,UITableViewDataSourc |
| 255 | 268 | return 122 |
| 256 | 269 | } |
| 257 | 270 | |
| 271 | + | |
| 272 | + | |
| 273 | + // MARK: - 数字简历协议 | |
| 274 | + let delegate = UIApplication.shared.delegate as! AppDelegate | |
| 275 | + /// 未认证-inputType17时弹窗背景图 | |
| 276 | + lazy var alertBgImgView:UIImageView = { | |
| 277 | + let alertBgImgView:UIImageView = UIImageView() | |
| 278 | + alertBgImgView.tag = 20001 | |
| 279 | + alertBgImgView.isUserInteractionEnabled = true | |
| 280 | + alertBgImgView.contentMode = .scaleAspectFit | |
| 281 | + alertBgImgView.backgroundColor = .white | |
| 282 | + return alertBgImgView | |
| 283 | + }() | |
| 284 | + lazy var agreeBtn: UIButton = { | |
| 285 | + let nextBtn = UIButton(type: .custom) | |
| 286 | + nextBtn.width = 285 | |
| 287 | + nextBtn.height = 44 | |
| 288 | + nextBtn.setTitle("同意协议 领取一下", for: .normal) | |
| 289 | + nextBtn.setTitleColor(.white, for: .normal) | |
| 290 | + nextBtn.layer.cornerRadius = 22 | |
| 291 | + nextBtn.clipsToBounds = true | |
| 292 | + nextBtn.addTarget(self, action: #selector(agreeBtnAction), for: .touchUpInside) | |
| 293 | + nextBtn.backgroundColor = HexColor("#8E8BFB") | |
| 294 | + // fillCode | |
| 295 | + let bgLayer1 = CAGradientLayer() | |
| 296 | + bgLayer1.colors = [UIColor(red: 0.1, green: 0.38, blue: 1, alpha: 1).cgColor, UIColor(red: 0.56, green: 0.55, blue: 0.98, alpha: 1).cgColor] | |
| 297 | + bgLayer1.locations = [0, 1] | |
| 298 | + bgLayer1.frame = nextBtn.bounds | |
| 299 | + bgLayer1.startPoint = CGPoint(x: 0.5, y: 1) | |
| 300 | + bgLayer1.endPoint = CGPoint(x: 0, y: 0) | |
| 301 | + nextBtn.layer.addSublayer(bgLayer1) | |
| 302 | + return nextBtn | |
| 303 | + }() | |
| 304 | + lazy var xieyiLabel: UILabel = { | |
| 305 | + let label = UILabel() | |
| 306 | + let attrString = NSMutableAttributedString(string: "查看《元码数字简历服务协议》") | |
| 307 | + label.frame = CGRect(x: 0, y: 0, width: KSreenWidth, height: 20) | |
| 308 | + let attr1: [NSAttributedString.Key : Any] = [.font: Font_14,.foregroundColor: HexColor("#20252A")!] | |
| 309 | + attrString.addAttributes(attr1, range: NSRange(location: 0, length: 2)) | |
| 310 | + let attr: [NSAttributedString.Key : Any] = [.font: Font_14,.foregroundColor: HexColor("#1961FE")!] | |
| 311 | + attrString.addAttributes(attr, range: NSRange(location: 2, length: attrString.length-2)) | |
| 312 | + label.attributedText = attrString | |
| 313 | + label.textAlignment = .center | |
| 314 | + label.isUserInteractionEnabled = true | |
| 315 | + label.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(xieyiAction))) | |
| 316 | + return label | |
| 317 | + }() | |
| 318 | + //弹出数字简历协议alert | |
| 319 | + func showXieyiAlert(){ | |
| 320 | + delegate.window?.addSubview(self.alertBgImgView) | |
| 321 | + alertBgImgView.snp.makeConstraints { make in | |
| 322 | + make.centerX.equalToSuperview() | |
| 323 | + make.centerY.equalToSuperview() | |
| 324 | + make.width.equalToSuperview() | |
| 325 | + make.height.equalToSuperview() | |
| 326 | + } | |
| 327 | + self.alertBgImgView.image = UIImage(named: "mine_jianli_xieyiBg") | |
| 328 | + alertBgImgView.addSubview(self.agreeBtn) | |
| 329 | + self.agreeBtn.snp.makeConstraints { make in | |
| 330 | + make.bottom.equalToSuperview().offset(-50) | |
| 331 | + make.width.equalTo(285) | |
| 332 | + make.centerX.equalToSuperview() | |
| 333 | + make.height.equalTo(44) | |
| 334 | + } | |
| 335 | + alertBgImgView.addSubview(self.xieyiLabel) | |
| 336 | + self.xieyiLabel.snp.makeConstraints { make in | |
| 337 | + make.bottom.equalTo(self.agreeBtn.snp.top).offset(-10) | |
| 338 | + make.left.right.equalToSuperview() | |
| 339 | + make.height.equalTo(20) | |
| 340 | + } | |
| 341 | + } | |
| 342 | + @objc func xieyiAction(){ | |
| 343 | + //查看数字简历协议 | |
| 344 | + let webVC = CNWebViewController() | |
| 345 | + webVC.url = URL(string: "https://wjj.ys1.cnliveimg.com/term/ymRlsbyhxxcjxy.html") | |
| 346 | + self.navigationController?.pushViewController(webVC, animated: true) | |
| 347 | + | |
| 348 | + delegate.window?.subviews.forEach({ view in | |
| 349 | + if view.tag >= 20000{ | |
| 350 | + view.isHidden = true | |
| 351 | + } | |
| 352 | + }) | |
| 353 | + } | |
| 354 | + @objc func agreeBtnAction(){ | |
| 355 | + //同意协议按钮 | |
| 356 | + delegate.window?.subviews.forEach({ view in | |
| 357 | + if view.tag >= 20000{ | |
| 358 | + view.removeFromSuperview() | |
| 359 | + } | |
| 360 | + }) | |
| 361 | + //本地存储已同意 | |
| 362 | + UserDefaults.standard.set(true,forKey: "is_agree_shuzijianlixieyi") | |
| 363 | + | |
| 364 | + //跳转数字简历页面 | |
| 365 | + let vc = CNLiveDigitalResumeController() | |
| 366 | + self.navigationController?.pushViewController(vc, animated: true) | |
| 367 | + } | |
| 368 | + | |
| 258 | 369 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/DigitalAuthViews/DigitalResume/CNLiveDigitalResumeCell.swift
| ... | ... | @@ -514,7 +514,8 @@ class CNLiveDigitalResumeCell: UITableViewCell { |
| 514 | 514 | |
| 515 | 515 | } |
| 516 | 516 | @objc func shezhiBtnAction(){ |
| 517 | - | |
| 517 | + let vc = CNLiveDigitalResumeInfoController() | |
| 518 | + currentViewController()?.navigationController?.pushViewController(vc, animated: true) | |
| 518 | 519 | } |
| 519 | 520 | @objc func chakanBtnAction(){ |
| 520 | 521 | ... | ... |
metaCode/Classes/Main/HomePage/View/VerticalViews/CNCustomIndexView.swift
| ... | ... | @@ -338,7 +338,14 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | func updateRealPerson(){ |
| 341 | - self.topRealPersonBtn.text = "当前对象: "+(UserInfoManager.shared.userInfo.currentUser?.name ?? "") | |
| 341 | + if UserInfoManager.shared.userInfo.currentUser?.name.count ?? 0 > 0{ | |
| 342 | + self.topRealPersonBtn.text = "当前对象: "+(UserInfoManager.shared.userInfo.currentUser?.name ?? "") | |
| 343 | + self.topRealPersonBtn.isHidden = false | |
| 344 | + self.sanjiaoImgView.isHidden = false | |
| 345 | + }else{ | |
| 346 | + self.topRealPersonBtn.isHidden = true | |
| 347 | + self.sanjiaoImgView.isHidden = true | |
| 348 | + } | |
| 342 | 349 | } |
| 343 | 350 | |
| 344 | 351 | // MARK: - 设置前置视图容器 | ... | ... |
metaCode/Classes/Main/HomePage/ViewModel/Vitae/CNLiveVitaeViewModel.swift
| ... | ... | @@ -31,9 +31,13 @@ class CNLiveVitaeViewModel:NSObject{ |
| 31 | 31 | hiddenLoading() |
| 32 | 32 | if (error == nil) { |
| 33 | 33 | let resp = result as! NSDictionary |
| 34 | - let dataDic = resp["data"] as! NSDictionary | |
| 35 | - let shopDetailModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveVitaeModel.self) | |
| 36 | - resultBlock(shopDetailModel,.success) | |
| 34 | + if resp["errorCode"] as! Int == 0{ | |
| 35 | + let dataDic = resp["data"] as! NSDictionary | |
| 36 | + let shopDetailModel = newDictionaryToModel(dataDic as! [String : Any], CNLiveVitaeModel.self) | |
| 37 | + resultBlock(shopDetailModel,.success) | |
| 38 | + }else{ | |
| 39 | + resultBlock(NSNull(),.failed) | |
| 40 | + } | |
| 37 | 41 | }else{ |
| 38 | 42 | resultBlock(NSNull(),.failed) |
| 39 | 43 | } | ... | ... |
metaCode/Classes/Main/HomePages/Controller/HomeController/CNLiveAuthViewController.swift
| ... | ... | @@ -525,10 +525,12 @@ class CNLiveAuthViewController:CNLiveBaseViewController,UITableViewDelegate,UITa |
| 525 | 525 | } |
| 526 | 526 | self.group.notify(queue: .main) { |
| 527 | 527 | // 所有网络请求都已完成,在这里执行你的任务 |
| 528 | - if self.isHaveReBang{ | |
| 529 | - self.dataArray.insert(self.duanjuDataArray, at: 1) | |
| 530 | - }else{ | |
| 531 | - self.dataArray.insert(self.duanjuDataArray, at: 0) | |
| 528 | + if self.duanjuDataArray.count > 0{ | |
| 529 | + if self.isHaveReBang{ | |
| 530 | + self.dataArray.insert(self.duanjuDataArray, at: 1) | |
| 531 | + }else{ | |
| 532 | + self.dataArray.insert(self.duanjuDataArray, at: 0) | |
| 533 | + } | |
| 532 | 534 | } |
| 533 | 535 | self.tableView.mj_header?.endRefreshing() |
| 534 | 536 | self.tableView.reloadData() | ... | ... |
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
| ... | ... | @@ -300,8 +300,32 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { |
| 300 | 300 | func appleLogin(model:CNThreeLoginModel){ |
| 301 | 301 | CNLiveLoginViewModel.appleLogin(model: model) { result, status in |
| 302 | 302 | if status == .success{ |
| 303 | - let window = UIApplication.shared.delegate?.window | |
| 304 | - window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 303 | + //获取用户信息 /api/identityApi/getUserMsg | |
| 304 | + CNLiveMineViewModel.requestGetUserMsg(sid: UserInfoManager.shared.userInfo.uid) { result, respStatue in | |
| 305 | + if respStatue == .success{ | |
| 306 | + if let res = result as? MineGetUserMsgUsersModel{ | |
| 307 | + let userInfo = UserInfoManager.shared.userInfo | |
| 308 | + userInfo.userMsgUsers = res | |
| 309 | + userInfo.currentUser = res.verifyUsers.first | |
| 310 | + UserInfoManager.cacheUserInfo(userInfo: userInfo) | |
| 311 | + | |
| 312 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 313 | + | |
| 314 | + }else{ | |
| 315 | + let tempDic = NSMutableDictionary() | |
| 316 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 317 | + UserDefaults.standard.synchronize() | |
| 318 | + } | |
| 319 | + | |
| 320 | + let window = UIApplication.shared.delegate?.window | |
| 321 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 322 | + | |
| 323 | + } | |
| 324 | + }else{ | |
| 325 | + let window = UIApplication.shared.delegate?.window | |
| 326 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 327 | + } | |
| 328 | + } | |
| 305 | 329 | }else{ |
| 306 | 330 | |
| 307 | 331 | } |
| ... | ... | @@ -398,14 +422,64 @@ class CNLiveLoginViewController : CNLiveBaseViewController, UITextViewDelegate { |
| 398 | 422 | hiddenLoading() |
| 399 | 423 | if status == .success{ |
| 400 | 424 | //登录成功 |
| 401 | - let window = UIApplication.shared.delegate?.window | |
| 402 | - window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 425 | + //获取用户信息 /api/identityApi/getUserMsg | |
| 426 | + CNLiveMineViewModel.requestGetUserMsg(sid: UserInfoManager.shared.userInfo.uid) { result, respStatue in | |
| 427 | + if respStatue == .success{ | |
| 428 | + if let res = result as? MineGetUserMsgUsersModel{ | |
| 429 | + let userInfo = UserInfoManager.shared.userInfo | |
| 430 | + userInfo.userMsgUsers = res | |
| 431 | + userInfo.currentUser = res.verifyUsers.first | |
| 432 | + UserInfoManager.cacheUserInfo(userInfo: userInfo) | |
| 433 | + | |
| 434 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 435 | + | |
| 436 | + }else{ | |
| 437 | + let tempDic = NSMutableDictionary() | |
| 438 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 439 | + UserDefaults.standard.synchronize() | |
| 440 | + } | |
| 441 | + | |
| 442 | + let window = UIApplication.shared.delegate?.window | |
| 443 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 444 | + | |
| 445 | + } | |
| 446 | + }else{ | |
| 447 | + let window = UIApplication.shared.delegate?.window | |
| 448 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 449 | + | |
| 450 | + } | |
| 451 | + } | |
| 403 | 452 | }else{ |
| 404 | 453 | if let res = result as? String{ |
| 405 | 454 | if res == "42013"{ |
| 406 | 455 | if (type == CNLiveSendAuthRespApple) { |
| 407 | - let window = UIApplication.shared.delegate?.window | |
| 408 | - window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 456 | + //获取用户信息 /api/identityApi/getUserMsg | |
| 457 | + CNLiveMineViewModel.requestGetUserMsg(sid: UserInfoManager.shared.userInfo.uid) { result, respStatue in | |
| 458 | + if respStatue == .success{ | |
| 459 | + if let res = result as? MineGetUserMsgUsersModel{ | |
| 460 | + let userInfo = UserInfoManager.shared.userInfo | |
| 461 | + userInfo.userMsgUsers = res | |
| 462 | + userInfo.currentUser = res.verifyUsers.first | |
| 463 | + UserInfoManager.cacheUserInfo(userInfo: userInfo) | |
| 464 | + | |
| 465 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 466 | + | |
| 467 | + }else{ | |
| 468 | + let tempDic = NSMutableDictionary() | |
| 469 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 470 | + UserDefaults.standard.synchronize() | |
| 471 | + } | |
| 472 | + | |
| 473 | + let window = UIApplication.shared.delegate?.window | |
| 474 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 475 | + | |
| 476 | + } | |
| 477 | + }else{ | |
| 478 | + let window = UIApplication.shared.delegate?.window | |
| 479 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 480 | + | |
| 481 | + } | |
| 482 | + } | |
| 409 | 483 | return |
| 410 | 484 | } |
| 411 | 485 | |
| ... | ... | @@ -463,8 +537,33 @@ extension CNLiveLoginViewController { |
| 463 | 537 | |
| 464 | 538 | CNLiveLoginViewModel.requestLoginAction(userName: phoneText.text ?? "", countryCode: countryCode, verCode: veriText.text ?? "") {[self] in |
| 465 | 539 | loginButton.stopAnimating() |
| 466 | - let window = UIApplication.shared.delegate?.window | |
| 467 | - window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 540 | + //获取用户信息 /api/identityApi/getUserMsg | |
| 541 | + CNLiveMineViewModel.requestGetUserMsg(sid: UserInfoManager.shared.userInfo.uid) { result, respStatue in | |
| 542 | + if respStatue == .success{ | |
| 543 | + if let res = result as? MineGetUserMsgUsersModel{ | |
| 544 | + let userInfo = UserInfoManager.shared.userInfo | |
| 545 | + userInfo.userMsgUsers = res | |
| 546 | + userInfo.currentUser = res.verifyUsers.first | |
| 547 | + UserInfoManager.cacheUserInfo(userInfo: userInfo) | |
| 548 | + | |
| 549 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 550 | + | |
| 551 | + }else{ | |
| 552 | + let tempDic = NSMutableDictionary() | |
| 553 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 554 | + UserDefaults.standard.synchronize() | |
| 555 | + } | |
| 556 | + | |
| 557 | + let window = UIApplication.shared.delegate?.window | |
| 558 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 559 | + | |
| 560 | + } | |
| 561 | + }else{ | |
| 562 | + let window = UIApplication.shared.delegate?.window | |
| 563 | + window??.rootViewController = CNLiveBaseTabBarViewController.init() | |
| 564 | + | |
| 565 | + } | |
| 566 | + } | |
| 468 | 567 | } endrefreshBlock: {[self] in |
| 469 | 568 | loginButton.stopAnimating() |
| 470 | 569 | } | ... | ... |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineViewController.swift
| ... | ... | @@ -277,14 +277,26 @@ extension CNLiveMineViewController { |
| 277 | 277 | } |
| 278 | 278 | if indexPath.section == 2 { |
| 279 | 279 | //我的数字简历 |
| 280 | - let is_agree = UserDefaults.standard.bool(forKey: "is_agree_shuzijianlixieyi") | |
| 281 | - if is_agree{ | |
| 282 | - //跳转数字简历页面 | |
| 283 | - let vc = CNLiveDigitalResumeController() | |
| 284 | - self.navigationController?.pushViewController(vc, animated: true) | |
| 280 | + | |
| 281 | + if UserInfoManager.shared.userInfo.userMsgUsers?.verifyUsers.count ?? 0 > 0{ | |
| 282 | + //实名认证过 | |
| 283 | + let is_agree = UserDefaults.standard.bool(forKey: "is_agree_shuzijianlixieyi") | |
| 284 | + if is_agree{ | |
| 285 | + //跳转数字简历页面 | |
| 286 | + let vc = CNLiveDigitalResumeController() | |
| 287 | + self.navigationController?.pushViewController(vc, animated: true) | |
| 288 | + }else{ | |
| 289 | + self.showXieyiAlert() | |
| 290 | + } | |
| 291 | + | |
| 285 | 292 | }else{ |
| 286 | - self.showXieyiAlert() | |
| 293 | + //未实名认证->实名认证 | |
| 294 | + let vc = CNLiveRealNameAuthController() | |
| 295 | + vc.isResume = true | |
| 296 | + self.navigationController?.pushViewController(vc, animated: true) | |
| 287 | 297 | } |
| 298 | + | |
| 299 | + | |
| 288 | 300 | } |
| 289 | 301 | if indexPath.section == 3 { |
| 290 | 302 | //官方认证 | ... | ... |
metaCode/Classes/Main/MinePage/View/CNLiveMineInfoAlertView.swift
| ... | ... | @@ -110,7 +110,7 @@ class MineInfoAlertView: UIView { |
| 110 | 110 | } else { |
| 111 | 111 | // Fallback on earlier versions |
| 112 | 112 | } |
| 113 | - if UserInfoManager.shared.userInfo.birthday.count > 0 { | |
| 113 | + if UserInfoManager.shared.userInfo.birthday.count > 0 && self.type == .birthday{ | |
| 114 | 114 | let dateFomatter = DateFormatter() |
| 115 | 115 | dateFomatter.dateFormat = "yyyy-MM-dd" |
| 116 | 116 | dateFomatter.locale = Locale.init(identifier: "zh_CN") |
| ... | ... | @@ -157,6 +157,7 @@ class MineInfoAlertView: UIView { |
| 157 | 157 | |
| 158 | 158 | var gender: String? = UserInfoManager.shared.userInfo.gender |
| 159 | 159 | var birthday: String? = UserInfoManager.shared.userInfo.birthday |
| 160 | + var selectDay: String? | |
| 160 | 161 | var result: CloseGenderResultBlock? |
| 161 | 162 | var type: CNLiveMineRequestType? |
| 162 | 163 | override init(frame: CGRect) { |
| ... | ... | @@ -271,6 +272,10 @@ class MineInfoAlertView: UIView { |
| 271 | 272 | pickerView.contentView.isHidden = true |
| 272 | 273 | pickerView.datePicker.isHidden = false |
| 273 | 274 | pickerView.birthday = UserInfoManager.shared.userInfo.birthday |
| 275 | + case .selectDay: | |
| 276 | + pickerView.nameLable.text = "选择时间" | |
| 277 | + pickerView.contentView.isHidden = true | |
| 278 | + pickerView.datePicker.isHidden = false | |
| 274 | 279 | case .nickName: |
| 275 | 280 | break |
| 276 | 281 | case .email: |
| ... | ... | @@ -309,7 +314,12 @@ class MineInfoAlertView: UIView { |
| 309 | 314 | @objc func dateChangeAction(sender: UIDatePicker) { |
| 310 | 315 | let formatter = DateFormatter() |
| 311 | 316 | formatter.dateFormat = "yyyy-MM-dd" |
| 312 | - birthday = formatter.string(from: datePicker.date) | |
| 317 | + if self.type == .birthday{ | |
| 318 | + birthday = formatter.string(from: datePicker.date) | |
| 319 | + } | |
| 320 | + if self.type == .selectDay{ | |
| 321 | + selectDay = formatter.string(from: datePicker.date) | |
| 322 | + } | |
| 313 | 323 | } |
| 314 | 324 | |
| 315 | 325 | @objc func setupDoneButtonAction() { |
| ... | ... | @@ -322,6 +332,12 @@ class MineInfoAlertView: UIView { |
| 322 | 332 | if type == .gender { |
| 323 | 333 | value = gender ?? "" |
| 324 | 334 | } |
| 335 | + if type == .selectDay { | |
| 336 | + value = selectDay ?? "" | |
| 337 | + result!(value) | |
| 338 | + return | |
| 339 | + } | |
| 340 | + | |
| 325 | 341 | CNLiveMineViewModel.requestUpdateUserInfoAction(type: type!, value: value) { [self] type, statue in |
| 326 | 342 | if statue { |
| 327 | 343 | let userInfo = UserInfoManager.shared.userInfo | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
metaCode/Classes/Other/AppDelegate.swift
| ... | ... | @@ -60,6 +60,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate { |
| 60 | 60 | userInfo.userMsgUsers = res |
| 61 | 61 | userInfo.currentUser = res.verifyUsers.first |
| 62 | 62 | UserInfoManager.cacheUserInfo(userInfo: userInfo) |
| 63 | + | |
| 64 | + if var userDic = UserDefaults.standard.dictionary(forKey: UserInfoManager.shared.userInfo.uid){ | |
| 65 | + | |
| 66 | + }else{ | |
| 67 | + let tempDic = NSMutableDictionary() | |
| 68 | + UserDefaults.standard.setValue(tempDic, forKey: UserInfoManager.shared.userInfo.uid) | |
| 69 | + UserDefaults.standard.synchronize() | |
| 70 | + } | |
| 63 | 71 | } |
| 64 | 72 | } |
| 65 | 73 | } | ... | ... |