Commit 398862a1febf50781aa5f48ef59db95ce4352bd3
Merge branch 'master' of http://bj.gitlab.cnlive.com/ios-team/CNLiveMateCode
Showing
9 changed files
with
55 additions
and
26 deletions
metaCode.xcodeproj/project.pbxproj
| ... | ... | @@ -1131,7 +1131,7 @@ |
| 1131 | 1131 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 1132 | 1132 | CLANG_ENABLE_MODULES = YES; |
| 1133 | 1133 | CODE_SIGN_STYLE = Automatic; |
| 1134 | - CURRENT_PROJECT_VERSION = 1.0.0.23.09.20.10; | |
| 1134 | + CURRENT_PROJECT_VERSION = 1.0.0.23.09.25.16; | |
| 1135 | 1135 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 1136 | 1136 | GENERATE_INFOPLIST_FILE = YES; |
| 1137 | 1137 | INFOPLIST_FILE = metaCode/Info.plist; |
| ... | ... | @@ -1175,7 +1175,7 @@ |
| 1175 | 1175 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; |
| 1176 | 1176 | CLANG_ENABLE_MODULES = YES; |
| 1177 | 1177 | CODE_SIGN_STYLE = Automatic; |
| 1178 | - CURRENT_PROJECT_VERSION = 1.0.0.23.09.20.10; | |
| 1178 | + CURRENT_PROJECT_VERSION = 1.0.0.23.09.25.16; | |
| 1179 | 1179 | DEVELOPMENT_TEAM = 94X49GG3ZW; |
| 1180 | 1180 | GENERATE_INFOPLIST_FILE = YES; |
| 1181 | 1181 | INFOPLIST_FILE = metaCode/Info.plist; | ... | ... |
metaCode/Classes/Main/HomePage/Controller/CNMetaCodeHomePageController.swift
| ... | ... | @@ -13,6 +13,12 @@ import CNLiveRequestBastKit |
| 13 | 13 | let Width: CGFloat = UIScreen.main.bounds.size.width |
| 14 | 14 | let Height: CGFloat = UIScreen.main.bounds.size.height |
| 15 | 15 | |
| 16 | +///主窗口左右间距 | |
| 17 | +let LeftGap: CGFloat = UIScreen.main.bounds.size.width <= 375 ? 23 : 40 | |
| 18 | + | |
| 19 | +///主窗口宽度 | |
| 20 | +let MainViewW: CGFloat = Width-LeftGap*2//Width-50 | |
| 21 | + | |
| 16 | 22 | ///存储是否第一次显示首页上滑引导 |
| 17 | 23 | let CNKeyIsFirstAppearUpSlideHomeGuide: String = "isFirstAppearUpSlideHomeGuideKey" |
| 18 | 24 | ///存储是否第一次显示首页下滑引导 |
| ... | ... | @@ -71,7 +77,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 71 | 77 | |
| 72 | 78 | ///无网.接口失败View |
| 73 | 79 | lazy var notNetworkView: UIView = { |
| 74 | - let W = Width-50 | |
| 80 | + let W = MainViewW | |
| 75 | 81 | let H = W*1.5 |
| 76 | 82 | let notNetworkView = UIView.init(frame: CGRect(x: 25, y: KSreenHeight*0.16, width: W, height: H )) |
| 77 | 83 | notNetworkView.backgroundColor = UIColor.white |
| ... | ... | @@ -207,7 +213,8 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 207 | 213 | |
| 208 | 214 | //提交身份审核后刷新 |
| 209 | 215 | NotificationCenter.default.addObserver(self, selector: #selector(StandAuthNotificationSuccessAction), name: Notification.Name.StandAuth.StandAuthNotificationSuccess, object: nil) |
| 210 | - | |
| 216 | + //我的身份排序后刷新 | |
| 217 | + NotificationCenter.default.addObserver(self, selector: #selector(StandAuthNotificationSuccessAction), name: Notification.Name.StandAuth.StandAuthSortNotificationResult, object: nil) | |
| 211 | 218 | |
| 212 | 219 | // self.tabBarController?.tabBar.top = self.tabBarY + KSreenHeight |
| 213 | 220 | |
| ... | ... | @@ -335,15 +342,18 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 335 | 342 | }else{ |
| 336 | 343 | //没有显示下滑引导 |
| 337 | 344 | self.pageFlowView.scrollView.isScrollEnabled = false |
| 338 | - self.view.addSubview(self.downSlideGuideView) | |
| 339 | - self.view.addSubview(self.downSlideGifView) | |
| 345 | + UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 346 | + UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 347 | +// self.tabBarController?.tabBar.isHidden = true | |
| 340 | 348 | } |
| 341 | 349 | |
| 342 | 350 | }else{ |
| 343 | 351 | //没显示过上滑引导 |
| 344 | 352 | self.pageFlowView.scrollView.isScrollEnabled = false |
| 345 | - self.view.addSubview(self.upSlideGuideView) | |
| 346 | - self.view.addSubview(self.upSlideGifView) | |
| 353 | + | |
| 354 | + UIApplication.shared.keyWindow!.addSubview(self.upSlideGuideView) | |
| 355 | + UIApplication.shared.keyWindow!.addSubview(self.upSlideGifView) | |
| 356 | +// self.tabBarController?.tabBar.isHidden = true | |
| 347 | 357 | } |
| 348 | 358 | } |
| 349 | 359 | |
| ... | ... | @@ -368,7 +378,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 368 | 378 | var bannerView:CNCustomIndexView? = flowView.dequeueReusableCell() as? CNCustomIndexView |
| 369 | 379 | |
| 370 | 380 | if (bannerView == nil) { |
| 371 | - bannerView = CNCustomIndexView.init(frame: CGRectMake(0, 0, Width-50, Height)) | |
| 381 | + bannerView = CNCustomIndexView.init(frame: CGRectMake(0, 0, MainViewW, Height)) | |
| 372 | 382 | bannerView?.tag = index + 100 |
| 373 | 383 | bannerView?.layer.cornerRadius = 4 |
| 374 | 384 | bannerView?.layer.masksToBounds = false |
| ... | ... | @@ -384,7 +394,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 384 | 394 | } |
| 385 | 395 | |
| 386 | 396 | func sizeForPage(in flowView: NewPagedFlowView!) -> CGSize { |
| 387 | - return CGSize(width: Width-50, height: Height) | |
| 397 | + return CGSize(width: MainViewW, height: Height) | |
| 388 | 398 | } |
| 389 | 399 | |
| 390 | 400 | ///NewPagedFlowView 开始滑动 |
| ... | ... | @@ -436,7 +446,7 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 436 | 446 | |
| 437 | 447 | scrollView.isScrollEnabled = true |
| 438 | 448 | |
| 439 | - let toIndex:Int = Int(scrollView.contentOffset.x/(Width-50)) | |
| 449 | + let toIndex:Int = Int(scrollView.contentOffset.x/(MainViewW)) | |
| 440 | 450 | |
| 441 | 451 | if toIndex == self.backgroupView.currentApearViewIndex{ |
| 442 | 452 | return |
| ... | ... | @@ -463,12 +473,12 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 463 | 473 | |
| 464 | 474 | //移除下滑引导 |
| 465 | 475 | if (self.downSlideGuideView.superview != nil) { |
| 476 | + | |
| 466 | 477 | self.downSlideGuideView.removeFromSuperview() |
| 467 | 478 | self.downSlideGifView.removeFromSuperview() |
| 468 | 479 | UserDefaults.standard.set("flase", forKey: CNKeyIsFirstAppearDownSlideHomeGuide) |
| 469 | 480 | self.pageFlowView.scrollView.isScrollEnabled = true |
| 470 | 481 | } |
| 471 | - | |
| 472 | 482 | |
| 473 | 483 | } |
| 474 | 484 | func customIndexViewDidScroll(scrollView: UIScrollView) { |
| ... | ... | @@ -502,8 +512,8 @@ class CNMetaCodeHomePageController:CNLiveBaseViewController, NewPagedFlowViewDel |
| 502 | 512 | print("不该进来") |
| 503 | 513 | }else{ |
| 504 | 514 | //没有显示下滑引导 |
| 505 | - self.view.addSubview(self.downSlideGuideView) | |
| 506 | - self.view.addSubview(self.downSlideGifView) | |
| 515 | + UIApplication.shared.keyWindow!.addSubview(self.downSlideGuideView) | |
| 516 | + UIApplication.shared.keyWindow!.addSubview(self.downSlideGifView) | |
| 507 | 517 | self.pageFlowView.scrollView.isScrollEnabled = false |
| 508 | 518 | } |
| 509 | 519 | } | ... | ... |
metaCode/Classes/Main/HomePage/View/CNCustomIndexView.swift
| ... | ... | @@ -118,8 +118,8 @@ class CNCustomIndexView:PGIndexBannerSubiew, UIScrollViewDelegate, WJColorChange |
| 118 | 118 | set{ |
| 119 | 119 | self.mainView.idModel = newValue! |
| 120 | 120 | _idModel = newValue |
| 121 | - self.upSlideView.url = _idModel?.upPath | |
| 122 | - self.downSlideView.url = _idModel?.downPath | |
| 121 | + self.upSlideView.url = _idModel?.downPath | |
| 122 | + self.downSlideView.url = _idModel?.upPath | |
| 123 | 123 | self.topNavView.setTitleString(title:(_idModel?.name)!) |
| 124 | 124 | } |
| 125 | 125 | ... | ... |
metaCode/Classes/Main/HomePage/View/CNHomePageGuideView.swift
| ... | ... | @@ -58,9 +58,9 @@ class CNHomePageGuideView: UIView{ |
| 58 | 58 | let path:UIBezierPath = UIBezierPath.init(rect: UIScreen.main.bounds) |
| 59 | 59 | |
| 60 | 60 | //rect 首页被镂空的区域 |
| 61 | - let W = KSreenWidth-50 | |
| 61 | + let W = MainViewW | |
| 62 | 62 | let H = W*1.5 |
| 63 | - let rect = CGRectMake(25, KSreenHeight*0.16,W, H) | |
| 63 | + let rect = CGRectMake(LeftGap, KSreenHeight*0.16,W, H) | |
| 64 | 64 | |
| 65 | 65 | let appendPath: UIBezierPath = UIBezierPath.init(roundedRect: rect, cornerRadius: 20) |
| 66 | 66 | path.append(appendPath.reversing()) | ... | ... |
metaCode/Classes/Main/HomePage/View/CNMainView.swift
metaCode/Classes/Main/LoginPage/Controller/CNLiveLoginViewController.swift
metaCode/Classes/Main/MinePage/Controller/CNLiveTypeFeedBackViewController.swift
| ... | ... | @@ -7,12 +7,13 @@ |
| 7 | 7 | |
| 8 | 8 | import Foundation |
| 9 | 9 | import APButton |
| 10 | +import Photos | |
| 10 | 11 | |
| 11 | 12 | enum ListShowType { |
| 12 | 13 | case feedback |
| 13 | 14 | case setting |
| 14 | 15 | case privacy |
| 15 | - case manager | |
| 16 | + case manager//系统权限管理 | |
| 16 | 17 | case about |
| 17 | 18 | case info |
| 18 | 19 | } |
| ... | ... | @@ -50,9 +51,9 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe |
| 50 | 51 | dataArray.add(["icon":"","name":"个人信息保护政策"]) |
| 51 | 52 | } |
| 52 | 53 | if _show_type == .manager { |
| 53 | - dataArray.add(["icon":"mine_list_sub_set_poistion","name":"位置","desc":"用于判断您的所在位置"]) | |
| 54 | +// dataArray.add(["icon":"mine_list_sub_set_poistion","name":"位置","desc":"用于判断您的所在位置"]) | |
| 54 | 55 | dataArray.add(["icon":"mine_list_sub_set_photo","name":"相册","desc":"用于上传反馈问题截图等业务流程"]) |
| 55 | - dataArray.add(["icon":"mine_list_sub_set_note","name":"通知","desc":"用于及时接收消息用于账户安全等风险控制"]) | |
| 56 | +// dataArray.add(["icon":"mine_list_sub_set_note","name":"通知","desc":"用于及时接收消息用于账户安全等风险控制"]) | |
| 56 | 57 | } |
| 57 | 58 | if _show_type == .about { |
| 58 | 59 | dataArray.add(["icon":"","name":"版本更新","more":"当前已经是最新版本"]) |
| ... | ... | @@ -284,6 +285,24 @@ extension CNLiveTypeFeedBackViewController { |
| 284 | 285 | self.navigationController?.pushViewController(CNLiveInfoShowViewController.init(show_type: .privacy,is_login: false), animated: true) |
| 285 | 286 | } |
| 286 | 287 | } |
| 288 | + if _show_type == .manager { | |
| 289 | + | |
| 290 | + // 已弹窗则直接跳转到系统设置; | |
| 291 | + //未弹窗 先弹窗再跳转系统设置 | |
| 292 | + PHPhotoLibrary.requestAuthorization( | |
| 293 | + { (status) in | |
| 294 | + | |
| 295 | + DispatchQueue.main.async | |
| 296 | + { | |
| 297 | + if let settingUrl = URL(string:UIApplication.openSettingsURLString) | |
| 298 | + { | |
| 299 | + if UIApplication.shared.canOpenURL(settingUrl){ | |
| 300 | + UIApplication.shared.open(settingUrl, options: [:], completionHandler: nil) | |
| 301 | + } | |
| 302 | + } | |
| 303 | + } | |
| 304 | + }) | |
| 305 | + } | |
| 287 | 306 | if _show_type == .about { |
| 288 | 307 | if indexPath.section == 0 { |
| 289 | 308 | print("跳转app商店") | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineBaseModel.swift
| ... | ... | @@ -148,8 +148,8 @@ final class StandListModel: BaseModel, TableCodable { |
| 148 | 148 | var descBackgroundImg: String = ""//首页文字背景图 |
| 149 | 149 | var cardImg: String = ""//卡片背景图 |
| 150 | 150 | var cardBackgroundImg: String = ""//首页卡片背景图 |
| 151 | - var upPath: String = ""//上滑h5 | |
| 152 | - var downPath: String = ""//下滑h5 | |
| 151 | + var upPath: String = ""//顶部h5 | |
| 152 | + var downPath: String = ""//底部h5 | |
| 153 | 153 | var auth: Bool = false//身份是否验证 |
| 154 | 154 | |
| 155 | 155 | var createTimeString: String = "" | ... | ... |
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
| ... | ... | @@ -322,7 +322,7 @@ class CNLiveMineViewModel: NSObject { |
| 322 | 322 | if (error == nil) { |
| 323 | 323 | let resp = result as! NSDictionary |
| 324 | 324 | let errorCode = "\(resp["errorCode"] ?? "0")" |
| 325 | - if (errorCode == "0" && resp["data"] is NSNull) { | |
| 325 | + if (errorCode == "0" && !(resp["data"] is NSNull)) { | |
| 326 | 326 | let listModel = dictionaryToModel(resp as! [String : Any], MineAuthListBaseModel.self,"data") as! MineAuthListBaseModel |
| 327 | 327 | if page == 1 && listModel.list.count > 0 { |
| 328 | 328 | CNLiveSaveAuthDB.shared.insertObjects(objects: listModel.list) | ... | ... |