@@ -70,66 +70,21 @@ open class NEBaseValidationMessageViewController: NEContactBaseViewController {
7070 tableView. sectionHeaderTopPadding = 0.0
7171 }
7272
73- tableView. mj_header = MJRefreshNormalHeader (
74- refreshingTarget: self ,
75- refreshingAction: #selector( loadData)
76- )
7773 return tableView
7874 } ( )
7975
80- /// 表格添加底部 loading
81- func addBottomLoadMore( ) {
82- let footer = MJRefreshAutoFooter (
83- refreshingTarget: self ,
84- refreshingAction: #selector( loadMoreData)
85- )
86- footer. triggerAutomaticallyRefreshPercent = - 10
87- tableView. mj_footer = footer
88- }
89-
90- /// 表格移除底部 loading
91- func removeBottomLoadMore( ) {
92- tableView. mj_footer? . endRefreshingWithNoMoreData ( )
93- tableView. mj_footer = nil
94- }
95-
9676 /// 加载数据
9777 func loadData( ) {
9878 viewModel. loadApplicationList ( true ) { [ weak self] finished, error in
9979 if let err = error {
10080 NEALog . errorLog ( ModuleName + " " + NEBaseValidationMessageViewController. className ( ) , desc: " loadApplicationList CALLBACK error: \( err. localizedDescription) " )
10181 } else {
102- if finished {
103- self ? . removeBottomLoadMore ( )
104- } else {
105- self ? . addBottomLoadMore ( )
106- }
107-
108- self ? . tableView. mj_header? . endRefreshing ( )
10982 self ? . emptyView. isHidden = ( self ? . viewModel. datas. count ?? 0 ) > 0
11083 self ? . tableView. reloadData ( )
11184 }
11285 }
11386 }
11487
115- /// 加载更多
116- func loadMoreData( ) {
117- viewModel. loadApplicationList ( false ) { [ weak self] finished, error in
118- if let err = error {
119- NEALog . errorLog ( ModuleName + " " + NEBaseValidationMessageViewController. className ( ) , desc: " loadMoreApplicationList CALLBACK error: \( err. localizedDescription) " )
120- } else {
121- if finished {
122- self ? . removeBottomLoadMore ( )
123- } else {
124- self ? . addBottomLoadMore ( )
125- }
126-
127- self ? . tableView. mj_footer? . endRefreshing ( )
128- self ? . tableView. reloadData ( )
129- }
130- }
131- }
132-
13388 func initNav( ) {
13489 let clearItem = UIBarButtonItem (
13590 title: localizable ( " clear " ) ,
@@ -205,13 +160,8 @@ extension NEBaseValidationMessageViewController: SystemNotificationCellDelegate
205160 /// - notifiModel: 申请模型
206161 /// - notiStatus: 处理状态
207162 public func changeValidationStatus( notifiModel: NENotification , notiStatus: NEHandleStatus ) {
208- notifiModel. handleStatus = notiStatus
209- notifiModel. unReadCount = 0
210- for msg in notifiModel. msgList ?? [ ] {
211- msg. handleStatus = notiStatus
212- }
213-
214163 DispatchQueue . main. async {
164+ self . loadData ( )
215165 self . tableView. reloadData ( )
216166 }
217167 }
0 commit comments