| | |
| | | #import "HistoryRecordPage.h" |
| | | #import "GloriaLabel.h" |
| | | #import "NetworkSingleton.h" |
| | | #import "AdNoticeView.h" |
| | | #import "NoticeModel.h" |
| | | |
| | | @interface HistoryRecordPage () |
| | | { |
| | |
| | | NSDate *initialDate; |
| | | GloriaLabel* _BeginTimesLabel; |
| | | GloriaLabel* _EndTimesLabel; |
| | | NSString * _beginTimeStr; |
| | | NSString * _EndTimeStr; |
| | | } |
| | | |
| | | @property (nonatomic, strong) AdNoticeView * adNoticeView; // 广告控件 |
| | | |
| | | @end |
| | | |
| | | @implementation HistoryRecordPage |
| | |
| | | _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit]; |
| | | [self.view addSubview:_BeginTimesLabel]; |
| | | |
| | | _beginTimeStr = _BeginTimesLabel.text; |
| | | _EndTimeStr = _beginTimeStr; |
| | | |
| | | GloriaLabel* _TimesLabel = [[GloriaLabel alloc] initWithFrame:CGRectMake(0, 20,SCREEN_WIDTH, 20)]; |
| | | _TimesLabel.font = [UIFont boldSystemFontOfSize:14]; |
| | | _TimesLabel.textAlignment = UITextAlignmentCenter; |
| | |
| | | [_arraw_rightBtn setTitleColor:kUIColorFromRGB(0xfebead) forState:UIControlStateNormal]; |
| | | [_arraw_rightBtn addTarget:self action:@selector(rightLogin) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.view addSubview:_arraw_rightBtn]; |
| | | |
| | | |
| | | |
| | | modelArray = [[NSMutableArray alloc] init]; |
| | | |
| | | [self drawHistoryRecordLine]; |
| | |
| | | _UnitTipsLabel.font = [UIFont boldSystemFontOfSize:14]; |
| | | _UnitTipsLabel.textAlignment = UITextAlignmentCenter; |
| | | _UnitTipsLabel.textColor = RgbColor(0, 146, 252); |
| | | _UnitTipsLabel.text = @"时间段(按周)"; |
| | | _UnitTipsLabel.text = @"时间段(按日)"; |
| | | [self.view addSubview:_UnitTipsLabel]; |
| | | |
| | | [self GetUserDataList]; |
| | | |
| | | [self GetNoticeInfo]; |
| | | // Do any additional setup after loading the view. |
| | | } |
| | | |
| | |
| | | CurrentDate = [DateUtil dateFromStringYMD:[DateUtil stringFromOffDateYMD:CurrentDate dayCount:-(currentUnit+1)]]; |
| | | _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit]; |
| | | _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate]; |
| | | |
| | | _beginTimeStr = [NSString stringWithFormat:@"%@",_BeginTimesLabel.text]; |
| | | if(currentUnit == 1) |
| | | { |
| | | _EndTimeStr = _BeginTimesLabel.text ; |
| | | } |
| | | else |
| | | { |
| | | _EndTimeStr = _EndTimesLabel.text; |
| | | } |
| | | |
| | | [self GetUserDataList]; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | -(void)GetUserDataList |
| | | -(void)GetNoticeInfo |
| | | { |
| | | //[UserDefault stringForKey:@"user_id"] |
| | | NSString *path = [[NSString alloc] initWithFormat:GET_DATALIST]; |
| | | NSString *path = [[NSString alloc] initWithFormat:GET_NOTICE]; |
| | | |
| | | NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; |
| | | [params setValue:[UserDefault stringForKey:@"user_id"] forKey:@"user_id"]; |
| | | [params setValue:_BeginTimesLabel.text forKey:@"start_time"]; |
| | | [params setValue:_EndTimesLabel.text forKey:@"end_time"]; |
| | | |
| | | MPWeakSelf(self); |
| | | [NetworkSingleton networkingGetMethod:params urlName:path success:^(id responseBody) |
| | |
| | | //[UserDefault setObject:self.is_open_upload forKey:@"is_open_upload"]; |
| | | [UserDefault synchronize]; |
| | | |
| | | |
| | | NoticeModel * model = [NoticeModel mj_objectWithKeyValues:resModel.content]; |
| | | |
| | | if (self.adNoticeView == nil) |
| | | { |
| | | self.adNoticeView = [[AdNoticeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) dataModel:model]; |
| | | //self.adNoticeView.delegate = self; |
| | | [self.view addSubview:self.adNoticeView]; |
| | | } |
| | | else |
| | | { |
| | | [self.adNoticeView setUIView:model]; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //[Global alertMessageEx:resModel.desc title:@"提示信息" okTtitle:nil cancelTitle:@"OK" delegate:self]; |
| | | } |
| | | } |
| | | failure:^(NSString *error) |
| | | { |
| | | |
| | | [Global alertMessageEx:error title:@"获取失败" okTtitle:nil cancelTitle:@"OK" delegate:self]; |
| | | }]; |
| | | } |
| | | |
| | | |
| | | -(void)GetUserDataList |
| | | { |
| | | //[UserDefault stringForKey:@"user_id"] |
| | | NSString *path = [[NSString alloc] initWithFormat:GET_DATALIST]; |
| | | |
| | | NSMutableDictionary * params = [[NSMutableDictionary alloc] init]; |
| | | [params setValue:[UserDefault stringForKey:@"user_id"] forKey:@"user_id"]; |
| | | [params setValue:_beginTimeStr forKey:@"start_time"]; |
| | | [params setValue:_EndTimeStr forKey:@"end_time"]; |
| | | |
| | | MPWeakSelf(self); |
| | | [NetworkSingleton networkingGetMethod:params urlName:path success:^(id responseBody) |
| | | { |
| | | MPStrongSelf(self); |
| | | BaseResModel * resModel = [Global toBaseModel:responseBody]; |
| | | |
| | | if(resModel.code == 0) |
| | | { |
| | | //[UserDefault setObject:self.is_open_upload forKey:@"is_open_upload"]; |
| | | [UserDefault synchronize]; |
| | | |
| | | //[self.tableView reloadData]; |
| | | [Global alertMessageEx:resModel.desc title:@"提示信息" okTtitle:nil cancelTitle:@"OK" delegate:self]; |
| | | } |
| | |
| | | _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit]; |
| | | _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate]; |
| | | [self GetUserDataList]; |
| | | _UnitTipsLabel.text = @"时间段(按月)"; |
| | | } |
| | | |
| | | -(void)unitWeekLogin |
| | |
| | | _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit]; |
| | | _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate]; |
| | | [self GetUserDataList]; |
| | | _UnitTipsLabel.text = @"时间段(按周)"; |
| | | } |
| | | |
| | | -(void)unitDayLogin |
| | |
| | | CurrentDate = [DateUtil dateFromStringYMD:[DateUtil stringFromOffDateYMD:[NSDate date] dayCount:-1]]; |
| | | _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit]; |
| | | _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate]; |
| | | _beginTimeStr = [NSString stringWithFormat:@"%@",_BeginTimesLabel.text]; |
| | | _EndTimeStr = _BeginTimesLabel.text ; |
| | | _UnitTipsLabel.text = @"时间段(按日)"; |
| | | [self GetUserDataList]; |
| | | } |
| | | |
| | |
| | | { |
| | | //LiveDataModel * model = [modelArray objectAtIndex:i]; |
| | | |
| | | [valueTeampArr addObject:[NSString stringWithFormat:@"%d",i*(rand()%10)]]; |
| | | [valueTeampArr addObject:[NSString stringWithFormat:@"%d",0]]; |
| | | [historyRecordLineChart.xLineDataArr addObject:[NSString stringWithFormat:@"%d",i]]; |
| | | } |
| | | |