This commit is contained in:
启星
2025-11-28 22:43:06 +08:00
parent 8913ea6f48
commit 7eb4f8d3b8
197 changed files with 7315 additions and 666 deletions

View File

@@ -57,14 +57,19 @@
[self.navigationController pushViewController:vc animated:YES];
}
-(void)getPriceData{
MJWeakSelf
__weak typeof(self) weakSelf = self;
[QXMineNetwork roomWaterDetailWithRoomId:self.room_id start_time:self.startTime end_time:self.endTime page:self.page type:self.type successBlock:^(QXRoomDetailModel * _Nonnull model) {
weakSelf.headerView.model = model;
if (weakSelf.page == 1) {
[weakSelf.dict removeAllObjects];
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) {
NSLog(@"⚠️ self has been deallocated, skipping hide operation");
return;
}
strongSelf.headerView.model = model;
if (strongSelf.page == 1) {
[strongSelf.dict removeAllObjects];
}
NSArray *arr = [weakSelf.dict allKeys];
NSArray *arr = [strongSelf.dict allKeys];
for (QXRoomWaterModel*md in model.list) {
BOOL haveKey = NO;
for (NSString *s in arr) {
@@ -75,10 +80,10 @@
}
if (!haveKey) {
// keyjson
[weakSelf.dict setObject:[md yy_modelToJSONString] forKey:md.time];
[strongSelf.dict setObject:[md yy_modelToJSONString] forKey:md.time];
}else{
//
NSString *json = [weakSelf.dict objectForKey:md.time];
NSString *json = [strongSelf.dict objectForKey:md.time];
//
QXRoomWaterModel *m = [QXRoomWaterModel yy_modelWithJSON:json];
//
@@ -88,10 +93,10 @@
//
m.list = newArr;
//
[weakSelf.dict setObject:[m yy_modelToJSONString] forKey:md.time];
[strongSelf.dict setObject:[m yy_modelToJSONString] forKey:md.time];
}
}
NSArray *keys = [weakSelf.dict.allKeys sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
NSArray *keys = [strongSelf.dict.allKeys sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
// NSString *s1 = obj1;
// NSString *s2 = obj2;
NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
@@ -110,18 +115,23 @@
return NSOrderedSame;
}
}];
self.allDateArray = [NSMutableArray arrayWithArray:keys];
[weakSelf.tableView reloadData];
[weakSelf.tableView.mj_header endRefreshing];
strongSelf.allDateArray = [NSMutableArray arrayWithArray:keys];
[strongSelf.tableView reloadData];
[strongSelf.tableView.mj_header endRefreshing];
if (model.list.count == 0) {
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
strongSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
}else{
[weakSelf.tableView.mj_footer endRefreshing];
[strongSelf.tableView.mj_footer endRefreshing];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
[weakSelf.tableView.mj_footer endRefreshing];
[weakSelf.tableView.mj_header endRefreshing];
dispatch_async(dispatch_get_main_queue(), ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
if (strongSelf) {
showToast(msg);
[strongSelf.tableView.mj_header endRefreshing];
[strongSelf.tableView.mj_footer endRefreshing];
}
});
}];
}