Commit 4e7a19970a9c73e4fbff2fbe73e24706e2849773

Authored by 张旭
2 parents adf6c574 c6cb41cb
metaCode/Classes/Common/Base/CNLiveBaseViewController.swift
@@ -139,7 +139,7 @@ class CNLiveBaseViewController: UIViewController { @@ -139,7 +139,7 @@ class CNLiveBaseViewController: UIViewController {
139 139
140 override func viewWillLayoutSubviews() { 140 override func viewWillLayoutSubviews() {
141 super.viewWillLayoutSubviews() 141 super.viewWillLayoutSubviews()
142 - topNavView.frame = CGRect(x: 0, y: get_system_statusBar_height(), width: view.width, height: topNavViewHeight + get_system_statusBar_height()) 142 + topNavView.frame = CGRect(x: 0, y: 0, width: view.width, height: topNavViewHeight + get_system_statusBar_height())
143 let lrSpace = leftNavSpace > rightNavSpace ? leftNavSpace : rightNavSpace 143 let lrSpace = leftNavSpace > rightNavSpace ? leftNavSpace : rightNavSpace
144 titleLabel.frame = CGRect(x: CGFloat(Int(lrSpace)) , y: topNavViewHeight - get_system_nav_ui_height() - topNavViewSubUIContentOffsetY, width: topNavView.width - (lrSpace * 2), height: get_system_nav_ui_height()) 144 titleLabel.frame = CGRect(x: CGFloat(Int(lrSpace)) , y: topNavViewHeight - get_system_nav_ui_height() - topNavViewSubUIContentOffsetY, width: topNavView.width - (lrSpace * 2), height: get_system_nav_ui_height())
145 leftNavBtns.forEach { currentBtn in 145 leftNavBtns.forEach { currentBtn in
metaCode/Classes/Config/CNLiveConfigstant.swift
@@ -36,7 +36,7 @@ public func is_iPhoneX_series() -> Bool { @@ -36,7 +36,7 @@ public func is_iPhoneX_series() -> Bool {
36 } 36 }
37 let window = UIApplication.shared.delegate?.window!! 37 let window = UIApplication.shared.delegate?.window!!
38 if (window?.safeAreaInsets.bottom ?? 0.0 > 0.0) { 38 if (window?.safeAreaInsets.bottom ?? 0.0 > 0.0) {
39 - iPhoneXSeries = false; 39 + iPhoneXSeries = true;
40 } 40 }
41 return iPhoneXSeries; 41 return iPhoneXSeries;
42 } 42 }
@@ -63,6 +63,13 @@ public func get_system_nav_ui_height() -> CGFloat { @@ -63,6 +63,13 @@ public func get_system_nav_ui_height() -> CGFloat {
63 } 63 }
64 64
65 /** 65 /**
  66 + 获取iPhoneX顶部高度
  67 + */
  68 +public func get_system_nav_top_height() -> CGFloat {
  69 + return is_iPhoneX_series() ? KStatusBarHeight - 64.0 : 0.0
  70 +}
  71 +
  72 +/**
66 获取系统tabbar高度 73 获取系统tabbar高度
67 */ 74 */
68 public func get_system_tabbar_height() -> CGFloat { 75 public func get_system_tabbar_height() -> CGFloat {
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
@@ -114,7 +114,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel @@ -114,7 +114,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel
114 navigationBarHidden = false 114 navigationBarHidden = false
115 view.addSubview(tableView) 115 view.addSubview(tableView)
116 tableView.snp.makeConstraints { make in 116 tableView.snp.makeConstraints { make in
117 - make.top.equalTo(get_system_nav_height()+get_system_statusBar_height()) 117 + make.top.equalTo(KNavigationHeight)
118 make.left.right.bottom.equalToSuperview() 118 make.left.right.bottom.equalToSuperview()
119 } 119 }
120 } 120 }
@@ -221,8 +221,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel @@ -221,8 +221,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel
221 } 221 }
222 222
223 @objc func StandAuthNotificationSuccessAction() { 223 @objc func StandAuthNotificationSuccessAction() {
224 - self.pageNum = 1  
225 - loadData() 224 + self.tableView.mj_header?.beginRefreshing()
226 } 225 }
227 226
228 227
metaCode/Classes/Main/MinePage/Controller/CNLiveTypeFeedBackViewController.swift
@@ -63,10 +63,6 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe @@ -63,10 +63,6 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe
63 dataArray.add(["icon":"","name":"昵称","more":(UserInfoManager.shared.userInfo.nickName.count > 0 ? UserInfoManager.shared.userInfo.nickName : "请输入昵称"),"avatar":""]) 63 dataArray.add(["icon":"","name":"昵称","more":(UserInfoManager.shared.userInfo.nickName.count > 0 ? UserInfoManager.shared.userInfo.nickName : "请输入昵称"),"avatar":""])
64 dataArray.add(["icon":"","name":"性别","more":UserInfoManager.shared.userInfo.gender,"avatar":""]) 64 dataArray.add(["icon":"","name":"性别","more":UserInfoManager.shared.userInfo.gender,"avatar":""])
65 dataArray.add(["icon":"","name":"生日","more":UserInfoManager.shared.userInfo.birthday,"avatar":""]) 65 dataArray.add(["icon":"","name":"生日","more":UserInfoManager.shared.userInfo.birthday,"avatar":""])
66 - self.tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"0")  
67 - self.tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"1")  
68 - self.tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"2")  
69 - self.tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"3")  
70 } 66 }
71 return dataArray 67 return dataArray
72 }() 68 }()
@@ -190,6 +186,12 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe @@ -190,6 +186,12 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe
190 tipSubView.addSubview(tipLabel) 186 tipSubView.addSubview(tipLabel)
191 tableView.tableHeaderView = tipView 187 tableView.tableHeaderView = tipView
192 } 188 }
  189 + if _show_type == .info {
  190 + tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"0")
  191 + tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"1")
  192 + tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"2")
  193 + tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"3")
  194 + }
193 } 195 }
194 196
195 @objc func logoutAction() -> Void { 197 @objc func logoutAction() -> Void {
metaCode/Classes/Main/MinePage/View/CNLiveMineBodyListView.swift
@@ -286,6 +286,8 @@ class MineBodyTwoListViewCell : UITableViewCell { @@ -286,6 +286,8 @@ class MineBodyTwoListViewCell : UITableViewCell {
286 avatarView.isHidden = false 286 avatarView.isHidden = false
287 avatarView.kf.indicatorType = .activity 287 avatarView.kf.indicatorType = .activity
288 avatarView.kf.setImage(with: URL(string: "\(dict["avatar"] ?? "")"), placeholder: UIImage(named: "mine_header_icon_defult_ava")) 288 avatarView.kf.setImage(with: URL(string: "\(dict["avatar"] ?? "")"), placeholder: UIImage(named: "mine_header_icon_defult_ava"))
  289 + }else{
  290 + avatarView.isHidden = true
289 } 291 }
290 nameLabel.text = "\(dict["name"] ?? "")" 292 nameLabel.text = "\(dict["name"] ?? "")"
291 } 293 }
metaCode/Classes/Main/MinePage/ViewModel/CNLiveMineViewModel.swift
@@ -277,7 +277,7 @@ class CNLiveMineViewModel: NSObject { @@ -277,7 +277,7 @@ class CNLiveMineViewModel: NSObject {
277 listModel.pageNum = page 277 listModel.pageNum = page
278 listModel.total = page 278 listModel.total = page
279 listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel] 279 listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
280 - resultBlock(listModel,.failed) 280 + resultBlock(listModel,.success)
281 }else{ 281 }else{
282 showMessage(message: resp["errorMessage"] as! String) 282 showMessage(message: resp["errorMessage"] as! String)
283 resultBlock(NSNull(),.failed) 283 resultBlock(NSNull(),.failed)
@@ -290,7 +290,7 @@ class CNLiveMineViewModel: NSObject { @@ -290,7 +290,7 @@ class CNLiveMineViewModel: NSObject {
290 listModel.pageNum = page 290 listModel.pageNum = page
291 listModel.total = page 291 listModel.total = page
292 listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel] 292 listModel.list = StandSortManager.sortAllListData(stands: tempArray as NSArray) as! [StandListModel]
293 - resultBlock(listModel,.failed) 293 + resultBlock(listModel,.success)
294 }else{ 294 }else{
295 if CNLiveNetworking.isNetworking() { 295 if CNLiveNetworking.isNetworking() {
296 showMessage(message: "获取失败") 296 showMessage(message: "获取失败")
@@ -321,7 +321,7 @@ class CNLiveMineViewModel: NSObject { @@ -321,7 +321,7 @@ class CNLiveMineViewModel: NSObject {
321 if (error == nil) { 321 if (error == nil) {
322 let resp = result as! NSDictionary 322 let resp = result as! NSDictionary
323 let errorCode = "\(resp["errorCode"] ?? "0")" 323 let errorCode = "\(resp["errorCode"] ?? "0")"
324 - if (errorCode == "0") { 324 + if (errorCode == "0" && resp["data"] is NSNull) {
325 let listModel = dictionaryToModel(resp as! [String : Any], MineAuthListBaseModel.self,"data") as! MineAuthListBaseModel 325 let listModel = dictionaryToModel(resp as! [String : Any], MineAuthListBaseModel.self,"data") as! MineAuthListBaseModel
326 if page == 1 && listModel.list.count > 0 { 326 if page == 1 && listModel.list.count > 0 {
327 CNLiveSaveAuthDB.shared.insertObjects(objects: listModel.list) 327 CNLiveSaveAuthDB.shared.insertObjects(objects: listModel.list)
@@ -335,7 +335,7 @@ class CNLiveMineViewModel: NSObject { @@ -335,7 +335,7 @@ class CNLiveMineViewModel: NSObject {
335 listModel.pageNum = page 335 listModel.pageNum = page
336 listModel.total = page 336 listModel.total = page
337 listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel] 337 listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
338 - resultBlock(listModel,.failed) 338 + resultBlock(listModel,.success)
339 }else{ 339 }else{
340 showMessage(message: resp["errorMessage"] as! String) 340 showMessage(message: resp["errorMessage"] as! String)
341 resultBlock(NSNull(),.failed) 341 resultBlock(NSNull(),.failed)
@@ -348,7 +348,7 @@ class CNLiveMineViewModel: NSObject { @@ -348,7 +348,7 @@ class CNLiveMineViewModel: NSObject {
348 listModel.pageNum = page 348 listModel.pageNum = page
349 listModel.total = page 349 listModel.total = page
350 listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel] 350 listModel.list = StandSortManager.sortMyListData(auths: tempArray as NSArray) as! [MineAuthListModel]
351 - resultBlock(listModel,.failed) 351 + resultBlock(listModel,.success)
352 }else{ 352 }else{
353 if CNLiveNetworking.isNetworking() { 353 if CNLiveNetworking.isNetworking() {
354 showMessage(message: "获取失败") 354 showMessage(message: "获取失败")
@@ -443,20 +443,24 @@ class CNLiveMineViewModel: NSObject { @@ -443,20 +443,24 @@ class CNLiveMineViewModel: NSObject {
443 let resp = result as! NSDictionary 443 let resp = result as! NSDictionary
444 let errorCode = "\(resp["errorCode"] ?? "0")" 444 let errorCode = "\(resp["errorCode"] ?? "0")"
445 if (errorCode == "0") { 445 if (errorCode == "0") {
446 - let newsModel = dictionaryToModel(resp as! [String : Any], MineStandInfoBaseModel.self,"data") as! MineStandInfoBaseModel  
447 - if type == .nodate {  
448 - let tempArray = NSMutableArray()  
449 - for authinfo in newsModel.authInfos {  
450 - if authinfo.input {  
451 - tempArray.add(authinfo) 446 + if resp["data"] is NSNull {
  447 + resultBlock(NSNull(),.failed)
  448 + } else {
  449 + let newsModel = dictionaryToModel(resp as! [String : Any], MineStandInfoBaseModel.self,"data") as! MineStandInfoBaseModel
  450 + if type == .nodate {
  451 + let tempArray = NSMutableArray()
  452 + for authinfo in newsModel.authInfos {
  453 + if authinfo.input {
  454 + tempArray.add(authinfo)
  455 + }
452 } 456 }
  457 + resultBlock(tempArray,.success)
  458 + }else if (type == .effect) {
  459 + resultBlock(newsModel,.success)
  460 + }else {
  461 + let tempArray = NSMutableArray.init(array: newsModel.authInfos)
  462 + resultBlock(tempArray,.success)
453 } 463 }
454 - resultBlock(tempArray,.success)  
455 - }else if (type == .effect) {  
456 - resultBlock(newsModel,.success)  
457 - }else {  
458 - let tempArray = NSMutableArray.init(array: newsModel.authInfos)  
459 - resultBlock(tempArray,.success)  
460 } 464 }
461 } else { 465 } else {
462 showMessage(message: resp["errorMessage"] as! String) 466 showMessage(message: resp["errorMessage"] as! String)