Commit 48466cd55cefd13176f583cf4e764b1580616ffc
1 parent
54efec02
no message
Showing
6 changed files
with
30 additions
and
9 deletions
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordController.h
| @@ -23,7 +23,8 @@ typedef enum { | @@ -23,7 +23,8 @@ typedef enum { | ||
| 23 | //ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId | 23 | //ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId |
| 24 | @property (nonatomic, copy) NSString *ID; | 24 | @property (nonatomic, copy) NSString *ID; |
| 25 | 25 | ||
| 26 | - | ||
| 27 | - | 26 | +@property (nonatomic, copy) NSString *date; |
| 27 | +@property (nonatomic, copy) NSString *startTime; | ||
| 28 | +@property (nonatomic, copy) NSString *endTime; | ||
| 28 | 29 | ||
| 29 | @end | 30 | @end |
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordController.m
| @@ -36,10 +36,6 @@ | @@ -36,10 +36,6 @@ | ||
| 36 | @property (nonatomic, strong) NSMutableArray *data; | 36 | @property (nonatomic, strong) NSMutableArray *data; |
| 37 | @property (nonatomic, assign) NSInteger pageNo; | 37 | @property (nonatomic, assign) NSInteger pageNo; |
| 38 | 38 | ||
| 39 | -@property (nonatomic, copy) NSString *date; | ||
| 40 | -@property (nonatomic, copy) NSString *startTime; | ||
| 41 | -@property (nonatomic, copy) NSString *endTime; | ||
| 42 | - | ||
| 43 | @end | 39 | @end |
| 44 | 40 | ||
| 45 | @implementation CNLiveTradingRecordController | 41 | @implementation CNLiveTradingRecordController |
| @@ -92,9 +88,9 @@ static const CGFloat height = 80; | @@ -92,9 +88,9 @@ static const CGFloat height = 80; | ||
| 92 | [self createSubViews]; | 88 | [self createSubViews]; |
| 93 | 89 | ||
| 94 | NSArray *times = [CNLiveBalanceRequest getMonthFirstAndLastDayWithDate:[NSDate date]]; | 90 | NSArray *times = [CNLiveBalanceRequest getMonthFirstAndLastDayWithDate:[NSDate date]]; |
| 95 | - | ||
| 96 | - self.startTime = times.firstObject; | ||
| 97 | - self.endTime = times.lastObject; | 91 | + |
| 92 | + self.startTime = self.startTime?self.startTime:times.firstObject; | ||
| 93 | + self.endTime = self.endTime?self.endTime:times.lastObject; | ||
| 98 | self.pageNo = 1; | 94 | self.pageNo = 1; |
| 99 | 95 | ||
| 100 | [self.tableView.mj_header beginRefreshing]; | 96 | [self.tableView.mj_header beginRefreshing]; |
| @@ -131,11 +127,17 @@ static const CGFloat height = 80; | @@ -131,11 +127,17 @@ static const CGFloat height = 80; | ||
| 131 | CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init]; | 127 | CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init]; |
| 132 | vc.model = model; | 128 | vc.model = model; |
| 133 | vc.type = TradingRecordDetailTypeSpecial; | 129 | vc.type = TradingRecordDetailTypeSpecial; |
| 130 | + vc.date = self.date; | ||
| 131 | + vc.startTime = self.startTime; | ||
| 132 | + vc.endTime = self.endTime; | ||
| 134 | [self.navigationController pushViewController:vc animated:YES]; | 133 | [self.navigationController pushViewController:vc animated:YES]; |
| 135 | }else{ | 134 | }else{ |
| 136 | CNLiveTradingRecordListModel *model = self.data[indexPath.row]; | 135 | CNLiveTradingRecordListModel *model = self.data[indexPath.row]; |
| 137 | CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init]; | 136 | CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init]; |
| 138 | vc.model = model; | 137 | vc.model = model; |
| 138 | + vc.date = self.date; | ||
| 139 | + vc.startTime = self.startTime; | ||
| 140 | + vc.endTime = self.endTime; | ||
| 139 | [self.navigationController pushViewController:vc animated:YES]; | 141 | [self.navigationController pushViewController:vc animated:YES]; |
| 140 | } | 142 | } |
| 141 | 143 | ||
| @@ -184,6 +186,7 @@ static const CGFloat height = 80; | @@ -184,6 +186,7 @@ static const CGFloat height = 80; | ||
| 184 | _tradingRecordView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; | 186 | _tradingRecordView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0]; |
| 185 | _tradingRecordView.delegate = self; | 187 | _tradingRecordView.delegate = self; |
| 186 | _tradingRecordView.isShow = self.type == TradingRecordTypeDefault; | 188 | _tradingRecordView.isShow = self.type == TradingRecordTypeDefault; |
| 189 | + _tradingRecordView.date = self.date; | ||
| 187 | } | 190 | } |
| 188 | return _tradingRecordView; | 191 | return _tradingRecordView; |
| 189 | } | 192 | } |
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordDetailController.h
| @@ -21,4 +21,8 @@ typedef enum { | @@ -21,4 +21,8 @@ typedef enum { | ||
| 21 | @property (nonatomic, strong) CNLiveTradingRecordListModel *model; | 21 | @property (nonatomic, strong) CNLiveTradingRecordListModel *model; |
| 22 | @property (nonatomic, assign) TradingRecordDetailType type; | 22 | @property (nonatomic, assign) TradingRecordDetailType type; |
| 23 | 23 | ||
| 24 | +@property (nonatomic, copy) NSString *date; | ||
| 25 | +@property (nonatomic, copy) NSString *startTime; | ||
| 26 | +@property (nonatomic, copy) NSString *endTime; | ||
| 27 | + | ||
| 24 | @end | 28 | @end |
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordDetailController.m
| @@ -108,6 +108,11 @@ static const CGFloat height = 80; | @@ -108,6 +108,11 @@ static const CGFloat height = 80; | ||
| 108 | CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init]; | 108 | CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init]; |
| 109 | vc.type = TradingRecordTypeSpecial; | 109 | vc.type = TradingRecordTypeSpecial; |
| 110 | vc.ID = self.model.toId; | 110 | vc.ID = self.model.toId; |
| 111 | + | ||
| 112 | + vc.date = self.date; | ||
| 113 | + vc.startTime = self.startTime; | ||
| 114 | + vc.endTime = self.endTime; | ||
| 115 | + | ||
| 111 | [self.navigationController pushViewController:vc animated:YES]; | 116 | [self.navigationController pushViewController:vc animated:YES]; |
| 112 | } | 117 | } |
| 113 | 118 |
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordView.h
| @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN | @@ -23,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 23 | @property (nonatomic, weak) id<CNLiveTradingRecordViewDelegate> delegate; | 23 | @property (nonatomic, weak) id<CNLiveTradingRecordViewDelegate> delegate; |
| 24 | @property (nonatomic, strong) CNLiveTradingRecordModel *model; | 24 | @property (nonatomic, strong) CNLiveTradingRecordModel *model; |
| 25 | @property (nonatomic, assign) BOOL isShow; | 25 | @property (nonatomic, assign) BOOL isShow; |
| 26 | +@property (nonatomic, copy) NSString *date; | ||
| 26 | 27 | ||
| 27 | @end | 28 | @end |
| 28 | 29 |
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordView.m
| @@ -75,6 +75,13 @@ static const NSInteger height = 30; | @@ -75,6 +75,13 @@ static const NSInteger height = 30; | ||
| 75 | _paymentsBill.hidden = !isShow; | 75 | _paymentsBill.hidden = !isShow; |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | +- (void)setDate:(NSString *)date{ | ||
| 79 | + if (date&&![date isEqualToString:@""]) { | ||
| 80 | + _date = date; | ||
| 81 | + [_switchTime setTitle:date forState:UIControlStateNormal]; | ||
| 82 | + } | ||
| 83 | +} | ||
| 84 | + | ||
| 78 | #pragma mark - PGDatePickerDelegate | 85 | #pragma mark - PGDatePickerDelegate |
| 79 | - (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents{ | 86 | - (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents{ |
| 80 | dateComponents.day = 1; | 87 | dateComponents.day = 1; |