单军华
2018-03-29 89d748b77b478905732e60f0b4c5807c274b6565
pregnancy_guard/BaseProject/Controller/Mine/HistoryRecordPage.m
@@ -9,6 +9,8 @@
#import "HistoryRecordPage.h"
#import "GloriaLabel.h"
#import "NetworkSingleton.h"
#import "AdNoticeView.h"
#import "NoticeModel.h"
@interface HistoryRecordPage ()
{
@@ -23,7 +25,12 @@
    NSDate *initialDate;
    GloriaLabel* _BeginTimesLabel;
    GloriaLabel* _EndTimesLabel;
    NSString * _beginTimeStr;
    NSString * _EndTimeStr;
}
@property (nonatomic, strong) AdNoticeView * adNoticeView; // 广告控件
@end
@implementation HistoryRecordPage
@@ -129,6 +136,9 @@
    _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;
@@ -160,7 +170,6 @@
    [_arraw_rightBtn addTarget:self action:@selector(rightLogin) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_arraw_rightBtn];
    modelArray = [[NSMutableArray alloc] init];
    
     [self drawHistoryRecordLine];
@@ -169,10 +178,16 @@
    _UnitTipsLabel.font = [UIFont boldSystemFontOfSize:14];
    _UnitTipsLabel.textAlignment = UITextAlignmentCenter;
    _UnitTipsLabel.textColor = RgbColor(0, 146, 252);
    _UnitTipsLabel.text = @"时间段(按周)";
    _UnitTipsLabel.text = @"时间段(按日)";
    [self.view  addSubview:_UnitTipsLabel];
    
    [self GetUserDataList];
    NoticeModel * model = [[NoticeModel alloc] init];
    self.adNoticeView = [[AdNoticeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) dataModel:model];
    //self.adNoticeView.delegate = self;
    [self.view addSubview:self.adNoticeView];
    // Do any additional setup after loading the view.
}
@@ -181,6 +196,17 @@
    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];
}
@@ -195,7 +221,6 @@
    }
}
-(void)GetUserDataList
{
    //[UserDefault stringForKey:@"user_id"]
@@ -203,8 +228,8 @@
    
    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"];
    [params setValue:_beginTimeStr forKey:@"start_time"];
    [params setValue:_EndTimeStr forKey:@"end_time"];
    
    MPWeakSelf(self);
    [NetworkSingleton networkingGetMethod:params urlName:path success:^(id responseBody)
@@ -243,6 +268,7 @@
    _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit];
    _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate];
    [self GetUserDataList];
    _UnitTipsLabel.text = @"时间段(按月)";
}
-(void)unitWeekLogin
@@ -255,6 +281,7 @@
    _BeginTimesLabel.text = [DateUtil stringFromOffDateYMD:CurrentDate dayCount:-currentUnit];
    _EndTimesLabel.text = [DateUtil stringFromDateYMD:CurrentDate];
    [self GetUserDataList];
    _UnitTipsLabel.text = @"时间段(按周)";
}
-(void)unitDayLogin
@@ -266,6 +293,9 @@
    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];
}