123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- //
- // MinRescord.m
- // LNManager
- //
- // Created by EchoShacolee on 2017/4/14.
- // Copyright © 2017年 lee. All rights reserved.
- //
- #import "MinRescord.h"
- #import "MinRecordeCell.h"
- @interface MinRescord ()<UITableViewDelegate,UITableViewDataSource>
- {
- HolderView *holderV;
- UITableView *myTableView;
- }
- @property(nonatomic,strong)NSMutableArray *dataurce;
- @end
- @implementation MinRescord
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.navigationItem.title = @"分钟学时记录";
- [self configNavBar];
-
- [self myInit];
- [self getData];
- }
- -(void)myInit{
-
- myTableView = [[UITableView alloc] initWithFrame:kFrame];
- [myTableView setDelegate:self];
- [myTableView setDataSource:self];
- myTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- [self.view addSubview:myTableView];
-
- holderV = [[HolderView alloc] initWithFrame:kFrame];
- holderV.y = kNavOffSet;
- [holderV freshBlock:^{
- [self getData];
- }];
- [self addV:holderV];
- }
- #pragma mark tableview代理相关
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
-
- return self.dataurce.count;
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- return 100;
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- MinRecordeCell * cell = [tableView dequeueReusableCellWithIdentifier:@"minRecordCellId"];
- if (!cell) {
- cell = [[[NSBundle mainBundle] loadNibNamed:@"MinRecordeCell" owner:nil options:nil] lastObject];
- }
- [cell upDataWithDic:self.dataurce[indexPath.row]];
- return cell;
- }
- #pragma mark 数据请求
- -(void)getData{
-
- NSMutableArray *arr=[NSMutableArray array];
- [arr addPro:@"stuId" Value:_stuID];
- [arr addPro:@"classId" Value:_classId];
- [arr addPro:@"dqbh" Value:defUser.userDict[@"cityId"]];
-
- NSString* method = @"getTrainRecordMins";
- [LoadingView showHUD];
- [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary *root) {
- holderV.hidden = NO;
- RemoveHUD();
-
- if (!root) {
- ShowMsg(@"数据请求失败,请重试");
- return;
- }
- if ([root[@"code"] isEqualToString:@"1"]) {
- ShowMsg(root[@"body"]);
- return;
- }
-
- _dataurce = root[@"body"];
- if (_dataurce.count != 0) {
- holderV.hidden = YES;
- }
- [myTableView reloadData];
- }];
-
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- @end
|