MinRescord.m 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. //
  2. // MinRescord.m
  3. // LNManager
  4. //
  5. // Created by EchoShacolee on 2017/4/14.
  6. // Copyright © 2017年 lee. All rights reserved.
  7. //
  8. #import "MinRescord.h"
  9. #import "MinRecordeCell.h"
  10. @interface MinRescord ()
  11. //{
  12. // UIButton *trainbtn;
  13. // UIButton *photoBtn;
  14. //
  15. // UIView *photoView;
  16. //}
  17. @end
  18. @implementation MinRescord
  19. - (void)viewDidLoad {
  20. [super viewDidLoad];
  21. self.navigationItem.title = @"电子日志详细";
  22. // self.automaticallyAdjustsScrollViewInsets = NO;
  23. // UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(20, kNavOffSet + 10, kSize.width/2.0 - 30, 40)];
  24. // [btn setTitle:@"分钟学时" textColor:COLOR_THEME font:FontTitle fotState:UIControlStateNormal];
  25. // [btn borderColor:COLOR_THEME width:1 cornorRadios:3];
  26. // [btn addTarget:self action:@selector(trainAction) forControlEvents:UIControlEventTouchUpInside];
  27. // [self.view addSubview:btn];
  28. // trainbtn = btn;
  29. //
  30. // btn = [[UIButton alloc] initWithFrame:CGRectMake(kSize.width/2.0 + 10, kNavOffSet + 10, kSize.width/2.0 - 30, 40)];
  31. // [btn setTitle:@"训练照片" textColor:RGB_COLOR(136,136,136) font:FontTitle fotState:UIControlStateNormal];
  32. // [btn borderColor:RGB_COLOR(136,136,136) width:1 cornorRadios:3];
  33. // [btn addTarget:self action:@selector(photoAction) forControlEvents:UIControlEventTouchUpInside];
  34. // [self.view addSubview:btn];
  35. // photoBtn = btn;
  36. //
  37. // UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(10, kNavOffSet + 60, kSize.width - 20, 1)];
  38. // line.backgroundColor = RGB_COLOR(136,136,136);
  39. // [self.view addSubview:line];
  40. //
  41. // self.tableView.y = kNavOffSet + 61;
  42. // self.tableView.height = kSize.height - kNavOffSet - 61;
  43. //
  44. // //添加一个图片轮播器在这里 设置在屏幕右边
  45. // photoView = [[UIView alloc] initWithFrame:self.tableView.frame];
  46. // photoView.x = kSize.width;
  47. // photoView.backgroundColor = [UIColor redColor];
  48. // [self.view addSubview:photoView];
  49. [self getData];
  50. //点击刷新的回调
  51. __weak typeof(self) weakSelf = self;
  52. self.block = ^{
  53. [weakSelf getData];
  54. };
  55. }
  56. //- (void)trainAction {
  57. // [trainbtn setTitleColor:COLOR_THEME forState:UIControlStateNormal];
  58. // trainbtn.layer.borderColor = COLOR_THEME.CGColor;
  59. //
  60. // [photoBtn setTitleColor:RGB_COLOR(136,136,136) forState:UIControlStateNormal];
  61. // photoBtn.layer.borderColor = RGB_COLOR(136, 136, 136).CGColor;
  62. // if (self.tableView.x != 0) {
  63. // [UIView animateWithDuration:.4 animations:^{
  64. // self.tableView.x = 0;
  65. // photoView.x = kSize.width;
  66. // }];
  67. // }
  68. //}
  69. //
  70. //- (void)photoAction {
  71. // [trainbtn setTitleColor:RGB_COLOR(136,136,136) forState:UIControlStateNormal];
  72. // trainbtn.layer.borderColor = RGB_COLOR(136, 136, 136).CGColor;
  73. //
  74. // [photoBtn setTitleColor:COLOR_THEME forState:UIControlStateNormal];
  75. // photoBtn.layer.borderColor = COLOR_THEME.CGColor;
  76. // if (photoView.x != 0) {
  77. // [UIView animateWithDuration:.4 animations:^{
  78. // self.tableView.x = -kSize.width;
  79. // photoView.x = 0;
  80. // }];
  81. // }
  82. //}
  83. #pragma mark tableview代理相关
  84. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  85. return self.dataurce.count;
  86. }
  87. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  88. return 100;
  89. }
  90. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  91. MinRecordeCell * cell = [tableView dequeueReusableCellWithIdentifier:@"minRecordCellId"];
  92. if (!cell) {
  93. cell = [[[NSBundle mainBundle] loadNibNamed:@"MinRecordeCell" owner:nil options:nil] lastObject];
  94. }
  95. [cell upDataWithDic:self.dataurce[indexPath.row]];
  96. return cell;
  97. }
  98. #pragma mark 数据请求
  99. -(void)getData{
  100. NSMutableDictionary *mdic = [[NSMutableDictionary alloc]init];
  101. [mdic setValue:self.stuDic[@"STUNUM"] forKey:@"stunum"];
  102. [mdic setValue:self.stuDic[@"CLASSID"] forKey:@"classId"];
  103. [mdic setValue:@"1" forKey:@"isPage"];
  104. [mdic setValue:@"10" forKey:@"pageSize"];
  105. [mdic setValue:@"1" forKey:@"currentPage"];
  106. [self getDataWithDic:mdic method:@"trainTimesRecordMins"];
  107. }
  108. - (void)didReceiveMemoryWarning {
  109. [super didReceiveMemoryWarning];
  110. // Dispose of any resources that can be recreated.
  111. }
  112. @end