Commit 54efec02b33c6b38f46ecd5fd428fab14a28a344

Authored by zhangxiaowen
1 parent 9d7a765b

no message

Showing 35 changed files with 119 additions and 203 deletions
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_all_front.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_all_front@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_all_front@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_all_front.imageset/mine_all_front@2x.png deleted 100644 → 0

266 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_all_front.imageset/mine_all_front@3x.png deleted 100644 → 0

615 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_code@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_code@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code.imageset/mine_code@2x.png deleted 100644 → 0

1.06 KB

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code.imageset/mine_code@3x.png deleted 100644 → 0

2.03 KB

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code_more.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_code_more@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_code_more@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code_more.imageset/mine_code_more@2x.png deleted 100644 → 0

448 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_code_more.imageset/mine_code_more@3x.png deleted 100644 → 0

771 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_qrcode.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_info_qrcode@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_info_qrcode@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_qrcode.imageset/mine_info_qrcode@2x.png deleted 100644 → 0

1.64 KB

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_qrcode.imageset/mine_info_qrcode@3x.png deleted 100644 → 0

1.73 KB

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_set.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_info_set@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_info_set@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_set.imageset/mine_info_set@2x.png deleted 100644 → 0

238 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_info_set.imageset/mine_info_set@3x.png deleted 100644 → 0

434 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_location.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_location@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_location@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_location.imageset/mine_location@2x.png deleted 100644 → 0

767 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_location.imageset/mine_location@3x.png deleted 100644 → 0

1.47 KB

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_update_select.imageset/Contents.json deleted 100644 → 0
1   -{
2   - "images" : [
3   - {
4   - "idiom" : "universal",
5   - "scale" : "1x"
6   - },
7   - {
8   - "idiom" : "universal",
9   - "filename" : "mine_update_select@2x.png",
10   - "scale" : "2x"
11   - },
12   - {
13   - "idiom" : "universal",
14   - "filename" : "mine_update_select@3x.png",
15   - "scale" : "3x"
16   - }
17   - ],
18   - "info" : {
19   - "version" : 1,
20   - "author" : "xcode"
21   - }
22   -}
23 0 \ No newline at end of file
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_update_select.imageset/mine_update_select@2x.png deleted 100644 → 0

330 Bytes

CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/mine_update_select.imageset/mine_update_select@3x.png deleted 100644 → 0

700 Bytes

CNLiveBalanceModule/Classes/Model/CNLiveBalanceRequest.h
... ... @@ -22,7 +22,7 @@ typedef void(^GetCodeBlock)(BOOL isSuccess, NSMutableAttributedString *string);
22 22 + (void)getBalance:(NSString *)type ID:(NSString *)ID block:(GetBalanceBlock)block;
23 23  
24 24 // 个人中心交易记录
25   -+ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block;
  25 ++ (void)getTradingRecordListWithType:(NSString *)type ID:(NSString *)ID startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block;
26 26  
27 27 // 群组交易记录
28 28 + (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize block:(GetTradingRecordBlock)block;
... ... @@ -37,9 +37,9 @@ typedef void(^GetCodeBlock)(BOOL isSuccess, NSMutableAttributedString *string);
37 37 // 处理时间
38 38 + (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date;
39 39  
40   -+ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name;
  40 ++ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name isAdd:(BOOL)isAdd;
41 41 + (NSMutableArray *)handleIncomeWithModel:(CNLiveTradingRecordDetailModel *)model;
42   -+ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name;
  42 ++ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name isAdd:(BOOL)isAdd;
43 43  
44 44  
45 45 @end
... ...
CNLiveBalanceModule/Classes/Model/CNLiveBalanceRequest.m
... ... @@ -40,29 +40,60 @@
40 40 }];
41 41 }
42 42  
43   -// 个人中心交易记录
44   -+ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block{
45   - NSDictionary *params = @{@"appId":AppId,
46   - @"targetId":ID?ID:@"",
47   - @"type":type?type:@"0",//0全部(默认) 1收入 2支出
48   - @"startTime":startTime?startTime:@"",
49   - @"endTime":endTime?endTime:@"",
50   - @"pageSize":[NSString stringWithFormat:@"%d",INT_MAX],
51   - @"pageNo":[NSString stringWithFormat:@"%d", 1]
52   - };
53   - [CNLiveNetworking setAllowRequestDefaultArgument:YES];
54   - [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNGetTradingRecordUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
55   - if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) {
56   - NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
57   - NSDictionary *data = responseObject[@"data"];
58   - block?block([errorCode isEqualToString:@"0"], data, error):@"";
  43 +// 交易记录
  44 ++ (void)getTradingRecordListWithType:(NSString *)type ID:(NSString *)ID startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block{
  45 + if([type isEqualToString:@"Special"]){
  46 + // 查看与此商户的交易记录
  47 + NSTimeInterval interval = [startTime doubleValue] / 1000.0;
  48 + NSDate *date = [NSDate dateWithTimeIntervalSince1970:interval];
  49 + NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
  50 + [dateFormatter setLocale:[NSLocale currentLocale]];
  51 + [dateFormatter setDateFormat:@"yyyy-MM-dd"];
  52 + NSString *value = [dateFormatter stringFromDate:date];
  53 + NSDictionary *params = @{@"appId":AppId,
  54 + @"fromId":CNUserShareModel.uid?CNUserShareModel.uid:@"",
  55 + @"toId":ID?ID:@"",
  56 + @"time":value?value:@""
  57 + };
  58 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  59 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNViewTransferRecordUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  60 + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) {
  61 + NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
  62 + NSDictionary *data = responseObject[@"data"];
  63 + block?block([errorCode isEqualToString:@"0"], data, error):@"";
59 64  
60   - }else{
61   - block?block(NO, nil, error):@"";
  65 + }else{
  66 + block?block(NO, nil, error):@"";
62 67  
63   - }
  68 + }
64 69  
65   - }];
  70 + }];
  71 +
  72 + }else{
  73 + // 个人中心交易记录
  74 + NSDictionary *params = @{@"appId":AppId,
  75 + @"targetId":ID?ID:@"",
  76 + @"type":type?type:@"0",//0全部(默认) 1收入 2支出
  77 + @"startTime":startTime?startTime:@"",
  78 + @"endTime":endTime?endTime:@"",
  79 + @"pageSize":[NSString stringWithFormat:@"%d",INT_MAX],
  80 + @"pageNo":[NSString stringWithFormat:@"%d", 1]
  81 + };
  82 + [CNLiveNetworking setAllowRequestDefaultArgument:YES];
  83 + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNGetTradingRecordUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) {
  84 + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) {
  85 + NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]];
  86 + NSDictionary *data = responseObject[@"data"];
  87 + block?block([errorCode isEqualToString:@"0"], data, error):@"";
  88 +
  89 + }else{
  90 + block?block(NO, nil, error):@"";
  91 +
  92 + }
  93 +
  94 + }];
  95 + }
  96 +
66 97  
67 98 }
68 99  
... ... @@ -116,7 +147,6 @@
116 147  
117 148 }
118 149  
119   -
120 150 + (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date{
121 151 double interval = 0;
122 152 NSDate *firstDateOut = nil;
... ... @@ -175,14 +205,14 @@
175 205 }
176 206  
177 207 #pragma mark - 数据处理
178   -+ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name{
  208 ++ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name isAdd:(BOOL)isAdd{
179 209 if ([model.sourceType containsString:@"refill"] || [model.sourceType isEqualToString:@"group_vote"] || [model.sourceType containsString:@"refund"]) {
180 210 // 收入
181 211 return [CNLiveBalanceRequest handleIncomeWithModel:model];
182 212  
183 213 } else if ([model.sourceType containsString:@"order"] || [model.sourceType containsString:@"payment"]) { //@"jsfy_order" 金色飞鹰
184 214 // 支出
185   - return [CNLiveBalanceRequest handleExpendWithModel:model name:name];
  215 + return [CNLiveBalanceRequest handleExpendWithModel:model name:name isAdd:isAdd];
186 216 }
187 217 return nil;
188 218 }
... ... @@ -221,7 +251,7 @@
221 251 return data;
222 252 }
223 253  
224   -+ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name {
  254 ++ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name isAdd:(BOOL)isAdd {
225 255 NSMutableArray *data = [[NSMutableArray alloc] init];
226 256 NSMutableArray *array = [@[
227 257 @{
... ... @@ -259,15 +289,18 @@
259 289 @"content":model.sourceId?model.sourceId:@"未知",
260 290 @"height":@"40",
261 291 @"lineHeight":@"0"
262   - },
263   - @{
264   - @"title":@"查看与此商户的交易记录",
265   - @"content":@"",
266   - @"height":@"50",
267   - @"lineHeight":@"10"
268 292 }
269 293 ] mutableCopy];
270 294  
  295 + if(isAdd){
  296 + NSDictionary *dic = @{
  297 + @"title":@"查看与此商户的交易记录",
  298 + @"content":@"",
  299 + @"height":@"50",
  300 + @"lineHeight":@"10"
  301 + };
  302 + [array addObject:dic];
  303 + }
271 304 if (model.remark&&![model.remark isEqualToString:@""]) {
272 305 NSDictionary *dic = @{
273 306 @"title":@"备注",
... ... @@ -275,7 +308,7 @@
275 308 @"height":@"40",
276 309 @"lineHeight":@"0"
277 310 };
278   - [array addObject:dic];
  311 + [array insertObject:dic atIndex:array.count-1];
279 312 }
280 313  
281 314 for (NSDictionary *dic in array) {
... ...
CNLiveBalanceModule/Classes/Model/CNLiveTradingRecordModel.h
... ... @@ -43,7 +43,7 @@ NS_ASSUME_NONNULL_BEGIN
43 43 @property (nonatomic, copy) NSString *income;
44 44 @property (nonatomic, copy) NSString *lastPage;
45 45 @property (nonatomic, strong) NSArray *list;
46   -
  46 +@property (nonatomic, strong) NSArray *transferRecordList;
47 47  
48 48 @end
49 49  
... ...
CNLiveBalanceModule/Classes/Model/CNLiveTradingRecordModel.m
... ... @@ -10,7 +10,7 @@
10 10  
11 11 @implementation CNLiveTradingRecordModel
12 12 + (NSDictionary *)mj_objectClassInArray{
13   - return @{@"list" : @"CNLiveTradingRecordListModel"};
  13 + return @{@"list" : @"CNLiveTradingRecordListModel", @"transferRecordList":@"CNLiveTradingRecordListModel"};
14 14 }
15 15  
16 16 @end
... ...
CNLiveBalanceModule/Classes/Personal/CNLiveMonthBillController.m
... ... @@ -54,7 +54,7 @@ static const CGFloat height = 60;
54 54 }
55 55 #pragma mark - 加载数据
56 56 - (void)loadData {
57   - [CNLiveBalanceRequest getTradingRecordListWithID:CNUserShareModel.uid type:self.type startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) {
  57 + [CNLiveBalanceRequest getTradingRecordListWithType:self.type ID:CNUserShareModel.uid startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) {
58 58 [self.tableView.mj_header endRefreshing];
59 59 [self.tableView.mj_footer endRefreshing];
60 60 self.monthBillView.interactionEnabled = YES;
... ...
CNLiveBalanceModule/Classes/Personal/CNLivePayCenterController.m
... ... @@ -11,6 +11,7 @@
11 11 #import "QMUIKit.h"
12 12  
13 13 #import "CNLiveCategory.h"
  14 +#import "CNUserInfoManager.h"
14 15  
15 16 #import "CNLiveBalanceNavigationBar.h"
16 17 #import "CNLiveBalanceModel.h"
... ... @@ -96,9 +97,10 @@
96 97 }
97 98  
98 99 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
99   -
100 100 if(indexPath.row == 0){
101 101 CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init];
  102 + vc.type = TradingRecordTypeDefault;
  103 + vc.ID = CNUserShareModel.uid;
102 104 [self.navigationController pushViewController:vc animated:YES];
103 105 }else if(indexPath.row == 1){//支付管理
104 106 CNLivePayManagerController *vc = [[CNLivePayManagerController alloc]init];
... ...
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordController.h
... ... @@ -11,8 +11,19 @@
11 11 */
12 12  
13 13 #import "CNCommonViewController.h"
  14 +typedef enum {
  15 + TradingRecordTypeDefault = 0, // 普通交易记录
  16 + TradingRecordTypeSpecial // 查看与此商户的交易记录
  17 +} TradingRecordType;
14 18  
15 19 @interface CNLiveTradingRecordController : CNCommonViewController
  20 +//type: 0 -> 个人中心交易记录 1 -> 查看与此商户的交易记录
  21 +@property (nonatomic, assign) TradingRecordType type;
  22 +
  23 +//ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId
  24 +@property (nonatomic, copy) NSString *ID;
  25 +
  26 +
16 27  
17 28  
18 29 @end
... ...
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordController.m
... ... @@ -47,7 +47,7 @@ static const CGFloat height = 80;
47 47  
48 48 #pragma mark - 加载数据
49 49 - (void)loadData {
50   - [CNLiveBalanceRequest getTradingRecordListWithID:CNUserShareModel.uid type:@"0" startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) {
  50 + [CNLiveBalanceRequest getTradingRecordListWithType:self.type == TradingRecordTypeDefault?@"0":@"Special" ID:self.ID startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) {
51 51 [self.tableView.mj_header endRefreshing];
52 52 [self.tableView.mj_footer endRefreshing];
53 53  
... ... @@ -65,7 +65,7 @@ static const CGFloat height = 80;
65 65 if(self.pageNo == 1&&self.data.count > 0){
66 66 [self.data removeAllObjects];
67 67 }
68   - [self.data addObjectsFromArray:model.list];
  68 + [self.data addObjectsFromArray:self.type == TradingRecordTypeDefault?model.list:model.transferRecordList];
69 69  
70 70 self.tradingRecordView.model = model;
71 71 [self.tableView reloadData];
... ... @@ -126,10 +126,19 @@ static const CGFloat height = 80;
126 126 }
127 127  
128 128 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
129   - CNLiveTradingRecordListModel *model = self.data[indexPath.row];
130   - CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init];
131   - vc.model = model;
132   - [self.navigationController pushViewController:vc animated:YES];
  129 + if(self.type == TradingRecordTypeSpecial){
  130 + CNLiveTradingRecordListModel *model = self.data[indexPath.row];
  131 + CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init];
  132 + vc.model = model;
  133 + vc.type = TradingRecordDetailTypeSpecial;
  134 + [self.navigationController pushViewController:vc animated:YES];
  135 + }else{
  136 + CNLiveTradingRecordListModel *model = self.data[indexPath.row];
  137 + CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init];
  138 + vc.model = model;
  139 + [self.navigationController pushViewController:vc animated:YES];
  140 + }
  141 +
133 142 }
134 143  
135 144 #pragma mark - CNLiveTradingRecordViewDelegate
... ... @@ -174,6 +183,7 @@ static const CGFloat height = 80;
174 183 _tradingRecordView = [[CNLiveTradingRecordView alloc]initWithFrame:CGRectMake(0, NavigationContentTop, SCREEN_WIDTH, height)];
175 184 _tradingRecordView.backgroundColor = [UIColor colorWithRed:242/255.0 green:242/255.0 blue:242/255.0 alpha:1.0];
176 185 _tradingRecordView.delegate = self;
  186 + _tradingRecordView.isShow = self.type == TradingRecordTypeDefault;
177 187 }
178 188 return _tradingRecordView;
179 189 }
... ...
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordDetailController.h
... ... @@ -12,8 +12,13 @@
12 12  
13 13 #import "CNCommonViewController.h"
14 14 @class CNLiveTradingRecordListModel;
  15 +typedef enum {
  16 + TradingRecordDetailTypeDefault = 0, // 普通交易记录
  17 + TradingRecordDetailTypeSpecial // 查看与此商户的交易记录
  18 +} TradingRecordDetailType;
15 19  
16 20 @interface CNLiveTradingRecordDetailController : CNCommonViewController
17 21 @property (nonatomic, strong) CNLiveTradingRecordListModel *model;
  22 +@property (nonatomic, assign) TradingRecordDetailType type;
18 23  
19 24 @end
... ...
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordDetailController.m
... ... @@ -26,6 +26,7 @@
26 26 #import "CNLiveTradingRecordDetailModel.h"
27 27 #import "CNLiveTradingRecordDetailCell.h"
28 28 #import "CNLiveTradingRecordDetailHeaderView.h"
  29 +#import "CNLiveTradingRecordController.h"
29 30  
30 31 @interface CNLiveTradingRecordDetailController ()<UITableViewDelegate, UITableViewDataSource,CNLiveBalanceNavigationBarDelegate>
31 32 @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar;
... ... @@ -49,7 +50,7 @@ static const CGFloat height = 80;
49 50 }
50 51 if (isSuccess) {
51 52 CNLiveTradingRecordDetailModel *model = [CNLiveTradingRecordDetailModel mj_objectWithKeyValues:data];
52   - self.data = [CNLiveBalanceRequest handleDataWithModel:model name:self.model.iconBean.nickName];
  53 + self.data = [CNLiveBalanceRequest handleDataWithModel:model name:self.model.iconBean.nickName isAdd:self.type == TradingRecordDetailTypeDefault];
53 54 [self.tableView reloadData];
54 55 }
55 56 }];
... ... @@ -104,7 +105,10 @@ static const CGFloat height = 80;
104 105 }
105 106  
106 107 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
107   -
  108 + CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init];
  109 + vc.type = TradingRecordTypeSpecial;
  110 + vc.ID = self.model.toId;
  111 + [self.navigationController pushViewController:vc animated:YES];
108 112 }
109 113  
110 114 #pragma mark - 懒加载
... ...
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordDetailCell.m
... ... @@ -101,7 +101,6 @@ static const NSInteger margin = 15;
101 101 }
102 102  
103 103 #pragma mark - 懒加载
104   -
105 104 - (UILabel *)title {
106 105 if (!_title) {
107 106 _title = [[UILabel alloc] init];
... ... @@ -130,7 +129,6 @@ static const NSInteger margin = 15;
130 129 return _line;
131 130 }
132 131  
133   -
134 132 - (UIImageView *)front {
135 133 if (!_front) {
136 134 _front = [[UIImageView alloc] init];
... ... @@ -140,5 +138,6 @@ static const NSInteger margin = 15;
140 138 }
141 139 return _front;
142 140 }
  141 +
143 142 @end
144 143  
... ...
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordDetailHeaderView.m
... ... @@ -95,7 +95,7 @@ static const NSInteger height = 50;
95 95 width = SCREEN_WIDTH-40;
96 96 }
97 97 [_shopName mas_makeConstraints:^(MASConstraintMaker *make) {
98   - make.left.equalTo(self.mas_left).with.offset((SCREEN_WIDTH-width)/2.0+margin);
  98 + make.left.equalTo(self.mas_left).with.offset((SCREEN_WIDTH-width)/2.0+2*margin);
99 99 make.right.mas_lessThanOrEqualTo(self.mas_right).with.offset(-margin);
100 100 make.top.equalTo(self.mas_top).with.offset(margin);
101 101 make.width.offset(width);
... ...
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordView.h
... ... @@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
22 22 @interface CNLiveTradingRecordView : UIView
23 23 @property (nonatomic, weak) id<CNLiveTradingRecordViewDelegate> delegate;
24 24 @property (nonatomic, strong) CNLiveTradingRecordModel *model;
  25 +@property (nonatomic, assign) BOOL isShow;
25 26  
26 27 @end
27 28  
... ...
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordView.m
... ... @@ -70,6 +70,11 @@ static const NSInteger height = 30;
70 70 _paymentsAmount.text = [NSString stringWithFormat:@"支出 ¥%@ 收入 ¥%@",model.defray,model.income];
71 71 }
72 72  
  73 +- (void)setIsShow:(BOOL)isShow{
  74 + _isShow = isShow;
  75 + _paymentsBill.hidden = !isShow;
  76 +}
  77 +
73 78 #pragma mark - PGDatePickerDelegate
74 79 - (void)datePicker:(PGDatePicker *)datePicker didSelectDate:(NSDateComponents *)dateComponents{
75 80 dateComponents.day = 1;
... ...