Commit 0ff55856fe62c9def94064df3bcef86190b22b8e
1 parent
ec3f1ac5
提交修改
Showing
4 changed files
with
32 additions
and
12 deletions
metaCode/Classes/Main/MinePage/Controller/CNLiveMineAddInfoViewController.swift
| @@ -189,7 +189,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel | @@ -189,7 +189,7 @@ class CNLiveMineAddInfoViewController : CNLiveBaseViewController, UITableViewDel | ||
| 189 | self!.pageNum = 1 | 189 | self!.pageNum = 1 |
| 190 | self!.loadData() | 190 | self!.loadData() |
| 191 | }) | 191 | }) |
| 192 | - tableView.mj_footer = MJRefreshBackNormalFooter.init(refreshingBlock: {[weak self] in | 192 | + tableView.mj_footer = MJRefreshAutoNormalFooter.init(refreshingBlock: {[weak self] in |
| 193 | self!.pageNum += 1 | 193 | self!.pageNum += 1 |
| 194 | self!.loadData() | 194 | self!.loadData() |
| 195 | }) | 195 | }) |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineEarnListViewController.swift
| @@ -88,11 +88,13 @@ class CNLiveMineEarnListViewController: CNLiveBaseViewController, JXPagingViewLi | @@ -88,11 +88,13 @@ class CNLiveMineEarnListViewController: CNLiveBaseViewController, JXPagingViewLi | ||
| 88 | } | 88 | } |
| 89 | } | 89 | } |
| 90 | if _show_type == .record { | 90 | if _show_type == .record { |
| 91 | - CNLiveMineViewModel.requestWithIntegralRecord(page: page) { result, respStatue in | 91 | + CNLiveMineViewModel.requestWithIntegralRecord(page: page) { [self] result, respStatue in |
| 92 | if respStatue == .success { | 92 | if respStatue == .success { |
| 93 | let listModel = result as! MineIntegralRecordModel | 93 | let listModel = result as! MineIntegralRecordModel |
| 94 | self.network_type = .success | 94 | self.network_type = .success |
| 95 | - self.dataArray.removeAllObjects() | 95 | + if pageNum == 1 { |
| 96 | + self.dataArray.removeAllObjects() | ||
| 97 | + } | ||
| 96 | self.dataArray.addObjects(from: listModel.integralList) | 98 | self.dataArray.addObjects(from: listModel.integralList) |
| 97 | self.tableView.reloadData() | 99 | self.tableView.reloadData() |
| 98 | self.tableView.mj_header?.endRefreshing() | 100 | self.tableView.mj_header?.endRefreshing() |
| @@ -134,7 +136,7 @@ class CNLiveMineEarnListViewController: CNLiveBaseViewController, JXPagingViewLi | @@ -134,7 +136,7 @@ class CNLiveMineEarnListViewController: CNLiveBaseViewController, JXPagingViewLi | ||
| 134 | } | 136 | } |
| 135 | 137 | ||
| 136 | private func addRefreshView() { | 138 | private func addRefreshView() { |
| 137 | - let footerView = MJRefreshBackNormalFooter.init(refreshingBlock: {[weak self] in | 139 | + let footerView = MJRefreshAutoNormalFooter.init(refreshingBlock: {[weak self] in |
| 138 | self!.pageNum += 1 | 140 | self!.pageNum += 1 |
| 139 | self!.loadDataWithTradRecord(page: self!.pageNum) {result,respStatue in } | 141 | self!.loadDataWithTradRecord(page: self!.pageNum) {result,respStatue in } |
| 140 | }) | 142 | }) |
metaCode/Classes/Main/MinePage/Controller/CNLiveMineInfoViewController.swift
| @@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
| 8 | import Foundation | 8 | import Foundation |
| 9 | import HXPHPicker | 9 | import HXPHPicker |
| 10 | import Kingfisher | 10 | import Kingfisher |
| 11 | - | 11 | +import APButton |
| 12 | typealias ClickInfoResultBlock = (_ image: UIImage) -> Void | 12 | typealias ClickInfoResultBlock = (_ image: UIImage) -> Void |
| 13 | class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControllerDelegate { | 13 | class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControllerDelegate { |
| 14 | 14 | ||
| @@ -34,14 +34,15 @@ class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControl | @@ -34,14 +34,15 @@ class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControl | ||
| 34 | return changeBtn | 34 | return changeBtn |
| 35 | }() | 35 | }() |
| 36 | 36 | ||
| 37 | - lazy var sendBtn: UIButton = { | ||
| 38 | - let sendBtn = UIButton.init(type: .custom) | 37 | + lazy var sendBtn: APButton = { |
| 38 | + let sendBtn = APButton() | ||
| 39 | sendBtn.setTitle("确认", for: .normal) | 39 | sendBtn.setTitle("确认", for: .normal) |
| 40 | sendBtn.setTitleColor(.white, for: .normal) | 40 | sendBtn.setTitleColor(.white, for: .normal) |
| 41 | sendBtn.titleLabel?.font = BoldFont_19_Fit | 41 | sendBtn.titleLabel?.font = BoldFont_19_Fit |
| 42 | sendBtn.layer.cornerRadius = 20 | 42 | sendBtn.layer.cornerRadius = 20 |
| 43 | sendBtn.layer.masksToBounds = true | 43 | sendBtn.layer.masksToBounds = true |
| 44 | sendBtn.isHidden = true | 44 | sendBtn.isHidden = true |
| 45 | + sendBtn.activityIndicator.color = .white | ||
| 45 | sendBtn.addTarget(self, action: #selector(changeSendAction), for: .touchUpInside) | 46 | sendBtn.addTarget(self, action: #selector(changeSendAction), for: .touchUpInside) |
| 46 | return sendBtn | 47 | return sendBtn |
| 47 | }() | 48 | }() |
| @@ -124,8 +125,10 @@ class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControl | @@ -124,8 +125,10 @@ class CNLiveMineInfoViewController: CNLiveBaseViewController, PhotoPickerControl | ||
| 124 | } | 125 | } |
| 125 | 126 | ||
| 126 | @objc func changeSendAction() { | 127 | @objc func changeSendAction() { |
| 128 | + sendBtn.startAnimating() | ||
| 127 | CNLiveMineViewModel.requestUploadIconAction(_select_image) { [weak self] type, statue in | 129 | CNLiveMineViewModel.requestUploadIconAction(_select_image) { [weak self] type, statue in |
| 128 | if statue { | 130 | if statue { |
| 131 | + self?.sendBtn.stopAnimating() | ||
| 129 | //再这里进行图片上传 | 132 | //再这里进行图片上传 |
| 130 | self!.reslut(self!._select_image) | 133 | self!.reslut(self!._select_image) |
| 131 | self!.navigationController?.popViewController(animated: true) | 134 | self!.navigationController?.popViewController(animated: true) |
metaCode/Classes/Main/MinePage/Controller/CNLiveTypeFeedBackViewController.swift
| @@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
| 6 | // | 6 | // |
| 7 | 7 | ||
| 8 | import Foundation | 8 | import Foundation |
| 9 | - | 9 | +import APButton |
| 10 | 10 | ||
| 11 | enum ListShowType { | 11 | enum ListShowType { |
| 12 | case feedback | 12 | case feedback |
| @@ -29,7 +29,9 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | @@ -29,7 +29,9 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | ||
| 29 | tableView.tableHeaderView = UIView.init(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: 1)) | 29 | tableView.tableHeaderView = UIView.init(frame: CGRect(x: 0, y: 0, width: KSreenWidth, height: 1)) |
| 30 | tableView.separatorStyle = .none | 30 | tableView.separatorStyle = .none |
| 31 | tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) | 31 | tableView.contentInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) |
| 32 | - tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier) | 32 | + if _show_type != .info { |
| 33 | + tableView.register(MineBodyTwoListViewCell.self, forCellReuseIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier) | ||
| 34 | + } | ||
| 33 | return tableView | 35 | return tableView |
| 34 | }() | 36 | }() |
| 35 | 37 | ||
| @@ -61,17 +63,22 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | @@ -61,17 +63,22 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | ||
| 61 | 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":""]) |
| 62 | dataArray.add(["icon":"","name":"性别","more":UserInfoManager.shared.userInfo.gender,"avatar":""]) | 64 | dataArray.add(["icon":"","name":"性别","more":UserInfoManager.shared.userInfo.gender,"avatar":""]) |
| 63 | 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") | ||
| 64 | } | 70 | } |
| 65 | return dataArray | 71 | return dataArray |
| 66 | }() | 72 | }() |
| 67 | 73 | ||
| 68 | - lazy var logoutButton: UIButton = { | ||
| 69 | - let logoutButton = UIButton.init(type: .custom) | 74 | + lazy var logoutButton: APButton = { |
| 75 | + let logoutButton = APButton() | ||
| 70 | logoutButton.setTitle("退出登录", for: .normal) | 76 | logoutButton.setTitle("退出登录", for: .normal) |
| 71 | logoutButton.backgroundColor = .white | 77 | logoutButton.backgroundColor = .white |
| 72 | logoutButton.setTitleColor(HexColor("#609BFF"), for: .normal) | 78 | logoutButton.setTitleColor(HexColor("#609BFF"), for: .normal) |
| 73 | logoutButton.layer.cornerRadius = 10 | 79 | logoutButton.layer.cornerRadius = 10 |
| 74 | logoutButton.layer.masksToBounds = true | 80 | logoutButton.layer.masksToBounds = true |
| 81 | + logoutButton.activityIndicator.color = .white | ||
| 75 | logoutButton.addTarget(self, action: #selector(logoutAction), for: .touchUpInside) | 82 | logoutButton.addTarget(self, action: #selector(logoutAction), for: .touchUpInside) |
| 76 | return logoutButton | 83 | return logoutButton |
| 77 | }() | 84 | }() |
| @@ -186,8 +193,10 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | @@ -186,8 +193,10 @@ class CNLiveTypeFeedBackViewController : CNLiveBaseViewController, UITableViewDe | ||
| 186 | } | 193 | } |
| 187 | 194 | ||
| 188 | @objc func logoutAction() -> Void { | 195 | @objc func logoutAction() -> Void { |
| 189 | - AlertTool.systemActionSheet(title: nil, message: nil, actionTitles: ["退出登录"]) { index in | 196 | + logoutButton.startAnimating() |
| 197 | + AlertTool.systemActionSheet(title: nil, message: nil, actionTitles: ["退出登录"]) { [self] index in | ||
| 190 | if index == 1 { | 198 | if index == 1 { |
| 199 | + logoutButton.stopAnimating() | ||
| 191 | UserDefaults.standard.set(false,forKey: "is_login") | 200 | UserDefaults.standard.set(false,forKey: "is_login") |
| 192 | UserInfoManager.clearUserInfo() | 201 | UserInfoManager.clearUserInfo() |
| 193 | let window = UIApplication.shared.delegate?.window | 202 | let window = UIApplication.shared.delegate?.window |
| @@ -214,6 +223,12 @@ extension CNLiveTypeFeedBackViewController { | @@ -214,6 +223,12 @@ extension CNLiveTypeFeedBackViewController { | ||
| 214 | 223 | ||
| 215 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { | 224 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| 216 | 225 | ||
| 226 | + if _show_type == .info { | ||
| 227 | + let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier+"\(indexPath.row)") as! MineBodyTwoListViewCell | ||
| 228 | + let dict = dataArray[indexPath.section] as! NSDictionary | ||
| 229 | + cell.setupWithDataSource(show_type: _show_type,dict: dict as! Dictionary<String, Any>) | ||
| 230 | + return cell | ||
| 231 | + } | ||
| 217 | let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier) as! MineBodyTwoListViewCell | 232 | let cell = tableView.dequeueReusableCell(withIdentifier: kCNLiveMineOneFeedBackViewCellIdentifier) as! MineBodyTwoListViewCell |
| 218 | let dict = dataArray[indexPath.section] as! NSDictionary | 233 | let dict = dataArray[indexPath.section] as! NSDictionary |
| 219 | cell.setupWithDataSource(show_type: _show_type,dict: dict as! Dictionary<String, Any>) | 234 | cell.setupWithDataSource(show_type: _show_type,dict: dict as! Dictionary<String, Any>) |