Commit ffd5b0f2b7978b233ea289d9d706301b4040b9c2
1 parent
3bb14b8d
no message
Showing
19 changed files
with
267 additions
and
16 deletions
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_ali_pay.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "trading_record_ali_pay@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "trading_record_ali_pay@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_ali_pay.imageset/trading_record_ali_pay@2x.png
0 → 100644
2.86 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_ali_pay.imageset/trading_record_ali_pay@3x.png
0 → 100644
4.21 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_union_pay.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "trading_record_union_pay@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "trading_record_union_pay@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_union_pay.imageset/trading_record_union_pay@2x.png
0 → 100644
3.62 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_union_pay.imageset/trading_record_union_pay@3x.png
0 → 100644
6.86 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wechat_pay.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "trading_record_wechat_pay@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "trading_record_wechat_pay@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wechat_pay.imageset/trading_record_wechat_pay@2x.png
0 → 100644
1.71 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wechat_pay.imageset/trading_record_wechat_pay@3x.png
0 → 100644
2.17 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wjj_pay.imageset/Contents.json
0 → 100644
| 1 | +{ | ||
| 2 | + "images" : [ | ||
| 3 | + { | ||
| 4 | + "idiom" : "universal", | ||
| 5 | + "scale" : "1x" | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + "idiom" : "universal", | ||
| 9 | + "filename" : "trading_record_wjj_pay@2x.png", | ||
| 10 | + "scale" : "2x" | ||
| 11 | + }, | ||
| 12 | + { | ||
| 13 | + "idiom" : "universal", | ||
| 14 | + "filename" : "trading_record_wjj_pay@3x.png", | ||
| 15 | + "scale" : "3x" | ||
| 16 | + } | ||
| 17 | + ], | ||
| 18 | + "info" : { | ||
| 19 | + "version" : 1, | ||
| 20 | + "author" : "xcode" | ||
| 21 | + } | ||
| 22 | +} | ||
| 0 | \ No newline at end of file | 23 | \ No newline at end of file |
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wjj_pay.imageset/trading_record_wjj_pay@2x.png
0 → 100644
3.49 KB
CNLiveBalanceModule/Assets/CNLiveBalanceModule.xcassets/trading_record_wjj_pay.imageset/trading_record_wjj_pay@3x.png
0 → 100644
6.38 KB
CNLiveBalanceModule/Classes/Group/CNLiveBalanceDetailBaseController.m
| @@ -32,7 +32,7 @@ | @@ -32,7 +32,7 @@ | ||
| 32 | static const CGFloat height = 44; | 32 | static const CGFloat height = 44; |
| 33 | #pragma mark - 加载数据 | 33 | #pragma mark - 加载数据 |
| 34 | - (void)loadData { | 34 | - (void)loadData { |
| 35 | - [CNLiveBalanceRequest getTradingRecordWithID:self.ID type:[NSString stringWithFormat:@"%ld",self.type] pageNo:self.pageNo pageSize:self.pageSize block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { | 35 | + [CNLiveBalanceRequest getTradingRecordListWithID:self.ID type:[NSString stringWithFormat:@"%ld",self.type] pageNo:self.pageNo pageSize:self.pageSize block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { |
| 36 | 36 | ||
| 37 | [self.tableView.mj_header endRefreshing]; | 37 | [self.tableView.mj_header endRefreshing]; |
| 38 | [self.tableView.mj_footer endRefreshing]; | 38 | [self.tableView.mj_footer endRefreshing]; |
| @@ -123,6 +123,10 @@ static const CGFloat height = 44; | @@ -123,6 +123,10 @@ static const CGFloat height = 44; | ||
| 123 | return cell; | 123 | return cell; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | +- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | ||
| 127 | + | ||
| 128 | +} | ||
| 129 | + | ||
| 126 | #pragma mark - JXCategoryListContentViewDelegate | 130 | #pragma mark - JXCategoryListContentViewDelegate |
| 127 | - (UIView *)listView { | 131 | - (UIView *)listView { |
| 128 | return self.view; | 132 | return self.view; |
CNLiveBalanceModule/Classes/Model/CNLiveBalanceRequest.h
| @@ -9,27 +9,39 @@ | @@ -9,27 +9,39 @@ | ||
| 9 | #import <Foundation/Foundation.h> | 9 | #import <Foundation/Foundation.h> |
| 10 | 10 | ||
| 11 | NS_ASSUME_NONNULL_BEGIN | 11 | NS_ASSUME_NONNULL_BEGIN |
| 12 | +@class CNLiveTradingRecordListModel; | ||
| 13 | +@class CNLiveTradingRecordDetailModel; | ||
| 14 | + | ||
| 12 | typedef void(^GetBalanceBlock)(BOOL isSuccess, NSString *number); | 15 | typedef void(^GetBalanceBlock)(BOOL isSuccess, NSString *number); |
| 13 | typedef void(^GetTradingRecordBlock)(BOOL isSuccess, NSDictionary * __nullable data, NSError *error); | 16 | typedef void(^GetTradingRecordBlock)(BOOL isSuccess, NSDictionary * __nullable data, NSError *error); |
| 14 | typedef void(^GetCodeBlock)(BOOL isSuccess, NSMutableAttributedString *string); | 17 | typedef void(^GetCodeBlock)(BOOL isSuccess, NSMutableAttributedString *string); |
| 15 | 18 | ||
| 16 | @interface CNLiveBalanceRequest : NSObject | 19 | @interface CNLiveBalanceRequest : NSObject |
| 17 | - | 20 | +#pragma mark - 数据请求 |
| 18 | // 获取余额 | 21 | // 获取余额 |
| 19 | + (void)getBalance:(NSString *)type ID:(NSString *)ID block:(GetBalanceBlock)block; | 22 | + (void)getBalance:(NSString *)type ID:(NSString *)ID block:(GetBalanceBlock)block; |
| 20 | 23 | ||
| 21 | // 个人中心交易记录 | 24 | // 个人中心交易记录 |
| 22 | -+ (void)getTradingRecordWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block; | 25 | ++ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block; |
| 23 | 26 | ||
| 24 | // 群组交易记录 | 27 | // 群组交易记录 |
| 25 | -+ (void)getTradingRecordWithID:(NSString *)ID type:(NSString *)type pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize block:(GetTradingRecordBlock)block; | ||
| 26 | - | ||
| 27 | -+ (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date; | 28 | ++ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize block:(GetTradingRecordBlock)block; |
| 28 | 29 | ||
| 30 | +// 交易记录详情 | ||
| 31 | ++ (void)getTradingRecordDetailWithModel:(CNLiveTradingRecordListModel *)model block:(GetTradingRecordBlock)block; | ||
| 29 | 32 | ||
| 30 | // 修改密码->获取验证码 | 33 | // 修改密码->获取验证码 |
| 31 | + (void)getCodeWithTaskId:(NSString *)taskId signatureId:(NSString *)signatureId block:(GetCodeBlock)block; | 34 | + (void)getCodeWithTaskId:(NSString *)taskId signatureId:(NSString *)signatureId block:(GetCodeBlock)block; |
| 32 | 35 | ||
| 36 | +#pragma mark - 数据处理 | ||
| 37 | +// 处理时间 | ||
| 38 | ++ (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date; | ||
| 39 | + | ||
| 40 | ++ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name; | ||
| 41 | ++ (NSMutableArray *)handleIncomeWithModel:(CNLiveTradingRecordDetailModel *)model; | ||
| 42 | ++ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name; | ||
| 43 | + | ||
| 44 | + | ||
| 33 | @end | 45 | @end |
| 34 | 46 | ||
| 35 | NS_ASSUME_NONNULL_END | 47 | NS_ASSUME_NONNULL_END |
CNLiveBalanceModule/Classes/Model/CNLiveBalanceRequest.m
| @@ -7,12 +7,17 @@ | @@ -7,12 +7,17 @@ | ||
| 7 | // | 7 | // |
| 8 | 8 | ||
| 9 | #import "CNLiveBalanceRequest.h" | 9 | #import "CNLiveBalanceRequest.h" |
| 10 | +#import "MJExtension.h" | ||
| 11 | + | ||
| 10 | #import "CNLiveNetworking.h" | 12 | #import "CNLiveNetworking.h" |
| 11 | #import "CNLiveEnvironment.h" | 13 | #import "CNLiveEnvironment.h" |
| 12 | #import "CNUserInfoManager.h" | 14 | #import "CNUserInfoManager.h" |
| 15 | +#import "CNLiveTradingRecordModel.h" | ||
| 16 | +#import "CNLiveTradingRecordDetailModel.h" | ||
| 13 | 17 | ||
| 14 | @implementation CNLiveBalanceRequest | 18 | @implementation CNLiveBalanceRequest |
| 15 | -#pragma mark - 获取余额 | 19 | +#pragma mark - 数据请求 |
| 20 | +// 获取余额 | ||
| 16 | + (void)getBalance:(NSString *)type ID:(NSString *)ID block:(GetBalanceBlock)block{ | 21 | + (void)getBalance:(NSString *)type ID:(NSString *)ID block:(GetBalanceBlock)block{ |
| 17 | NSDictionary *params = @{ | 22 | NSDictionary *params = @{ |
| 18 | @"appId":AppId, | 23 | @"appId":AppId, |
| @@ -36,7 +41,7 @@ | @@ -36,7 +41,7 @@ | ||
| 36 | } | 41 | } |
| 37 | 42 | ||
| 38 | // 个人中心交易记录 | 43 | // 个人中心交易记录 |
| 39 | -+ (void)getTradingRecordWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block{ | 44 | ++ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type startTime:(NSString * __nullable)startTime endTime:(NSString * __nullable)endTime block:(GetTradingRecordBlock)block{ |
| 40 | NSDictionary *params = @{@"appId":AppId, | 45 | NSDictionary *params = @{@"appId":AppId, |
| 41 | @"targetId":ID?ID:@"", | 46 | @"targetId":ID?ID:@"", |
| 42 | @"type":type?type:@"0",//0全部(默认) 1收入 2支出 | 47 | @"type":type?type:@"0",//0全部(默认) 1收入 2支出 |
| @@ -62,7 +67,7 @@ | @@ -62,7 +67,7 @@ | ||
| 62 | } | 67 | } |
| 63 | 68 | ||
| 64 | // 群组交易记录 | 69 | // 群组交易记录 |
| 65 | -+ (void)getTradingRecordWithID:(NSString *)ID type:(NSString *)type pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize block:(GetTradingRecordBlock)block{ | 70 | ++ (void)getTradingRecordListWithID:(NSString *)ID type:(NSString *)type pageNo:(NSInteger)pageNo pageSize:(NSInteger)pageSize block:(GetTradingRecordBlock)block{ |
| 66 | NSDictionary *params = @{@"appId":AppId, | 71 | NSDictionary *params = @{@"appId":AppId, |
| 67 | @"targetId":ID?ID:@"", | 72 | @"targetId":ID?ID:@"", |
| 68 | @"startTime":@"", | 73 | @"startTime":@"", |
| @@ -87,6 +92,31 @@ | @@ -87,6 +92,31 @@ | ||
| 87 | 92 | ||
| 88 | } | 93 | } |
| 89 | 94 | ||
| 95 | +// 交易记录详情 | ||
| 96 | ++ (void)getTradingRecordDetailWithModel:(CNLiveTradingRecordListModel *)model block:(GetTradingRecordBlock)block{ | ||
| 97 | + NSDictionary *params = @{@"appId":AppId, | ||
| 98 | + @"userId":CNUserShareModel.uid?CNUserShareModel.uid:@"", | ||
| 99 | + @"recordId":model.recordId?model.recordId:@"", | ||
| 100 | + @"sourceId":model.sourceId?model.sourceId:@"", | ||
| 101 | + @"sourceType":model.sourceType?model.sourceType:@"" | ||
| 102 | + }; | ||
| 103 | + [CNLiveNetworking setAllowRequestDefaultArgument:YES]; | ||
| 104 | + [CNLiveNetworking requestNetworkWithMethod:CNLiveRequestMethodPOST URLString:CNGetRecordSourceMsgUrl Param:params CacheType:CNLiveNetworkCacheTypeNetworkOnly CompletionBlock:^(NSURLSessionTask *requestTask, id responseObject, NSError *error) { | ||
| 105 | + if (responseObject && [responseObject isKindOfClass:[NSDictionary class]] && responseObject[@"data"] && [responseObject[@"data"] isKindOfClass:[NSDictionary class]]) { | ||
| 106 | + NSString *errorCode = [NSString stringWithFormat:@"%@", responseObject[@"errorCode"]]; | ||
| 107 | + NSDictionary *data = responseObject[@"data"]; | ||
| 108 | + block?block([errorCode isEqualToString:@"0"], data, error):@""; | ||
| 109 | + | ||
| 110 | + }else{ | ||
| 111 | + block?block(NO, nil, error):@""; | ||
| 112 | + | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + }]; | ||
| 116 | + | ||
| 117 | +} | ||
| 118 | + | ||
| 119 | + | ||
| 90 | + (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date{ | 120 | + (NSArray *)getMonthFirstAndLastDayWithDate:(NSDate *)date{ |
| 91 | double interval = 0; | 121 | double interval = 0; |
| 92 | NSDate *firstDateOut = nil; | 122 | NSDate *firstDateOut = nil; |
| @@ -144,4 +174,115 @@ | @@ -144,4 +174,115 @@ | ||
| 144 | 174 | ||
| 145 | } | 175 | } |
| 146 | 176 | ||
| 177 | +#pragma mark - 数据处理 | ||
| 178 | ++ (NSMutableArray *)handleDataWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name{ | ||
| 179 | + if ([model.sourceType containsString:@"refill"] || [model.sourceType isEqualToString:@"group_vote"] || [model.sourceType containsString:@"refund"]) { | ||
| 180 | + // 收入 | ||
| 181 | + return [CNLiveBalanceRequest handleIncomeWithModel:model]; | ||
| 182 | + | ||
| 183 | + } else if ([model.sourceType containsString:@"order"] || [model.sourceType containsString:@"payment"]) { //@"jsfy_order" 金色飞鹰 | ||
| 184 | + // 支出 | ||
| 185 | + return [CNLiveBalanceRequest handleExpendWithModel:model name:name]; | ||
| 186 | + } | ||
| 187 | + return nil; | ||
| 188 | +} | ||
| 189 | ++ (NSMutableArray *)handleIncomeWithModel:(CNLiveTradingRecordDetailModel *)model { | ||
| 190 | + NSMutableArray *data = [[NSMutableArray alloc] init]; | ||
| 191 | + NSArray *array = @[ | ||
| 192 | + @{ | ||
| 193 | + @"title":@"当前状态", | ||
| 194 | + @"content":@"已存入余额", | ||
| 195 | + @"height":@"40", | ||
| 196 | + @"lineHeight":@"0" | ||
| 197 | + }, | ||
| 198 | + @{ | ||
| 199 | + @"title":@"转账说明", | ||
| 200 | + @"content":model.desc?model.desc:@"未知", | ||
| 201 | + @"height":@"40", | ||
| 202 | + @"lineHeight":@"0" | ||
| 203 | + }, | ||
| 204 | + @{ | ||
| 205 | + @"title":@"转账时间", | ||
| 206 | + @"content":model.endTime?model.endTime:@"未知", | ||
| 207 | + @"height":@"40", | ||
| 208 | + @"lineHeight":@"0" | ||
| 209 | + }, | ||
| 210 | + @{ | ||
| 211 | + @"title":@"转账编号", | ||
| 212 | + @"content":model.sourceId?model.sourceId:@"未知", | ||
| 213 | + @"height":@"40", | ||
| 214 | + @"lineHeight":@"0" | ||
| 215 | + } | ||
| 216 | + ]; | ||
| 217 | + for (NSDictionary *dic in array) { | ||
| 218 | + CNLiveTradingRecordDetailModel *model = [CNLiveTradingRecordDetailModel mj_objectWithKeyValues:dic]; | ||
| 219 | + [data addObject:model]; | ||
| 220 | + } | ||
| 221 | + return data; | ||
| 222 | +} | ||
| 223 | + | ||
| 224 | ++ (NSMutableArray *)handleExpendWithModel:(CNLiveTradingRecordDetailModel *)model name:(NSString *)name { | ||
| 225 | + NSMutableArray *data = [[NSMutableArray alloc] init]; | ||
| 226 | + NSMutableArray *array = [@[ | ||
| 227 | + @{ | ||
| 228 | + @"title":@"当前状态", | ||
| 229 | + @"content":model.state, | ||
| 230 | + @"height":@"40", | ||
| 231 | + @"lineHeight":@"0" | ||
| 232 | + }, | ||
| 233 | + @{ | ||
| 234 | + @"title":@"商品", | ||
| 235 | + @"content":model.desc?model.desc:@"未知", | ||
| 236 | + @"height":@"40", | ||
| 237 | + @"lineHeight":@"0" | ||
| 238 | + }, | ||
| 239 | + @{ | ||
| 240 | + @"title":@"商户全称", | ||
| 241 | + @"content":name?name:@"未知", | ||
| 242 | + @"height":@"40", | ||
| 243 | + @"lineHeight":@"0" | ||
| 244 | + }, | ||
| 245 | + @{ | ||
| 246 | + @"title":@"支付时间", | ||
| 247 | + @"content":model.endTime?model.endTime:@"未知", | ||
| 248 | + @"height":@"40", | ||
| 249 | + @"lineHeight":@"0" | ||
| 250 | + }, | ||
| 251 | + @{ | ||
| 252 | + @"title":@"支付方式", | ||
| 253 | + @"content":model.payMethod, | ||
| 254 | + @"height":@"40", | ||
| 255 | + @"lineHeight":@"0" | ||
| 256 | + }, | ||
| 257 | + @{ | ||
| 258 | + @"title":@"交易单号", | ||
| 259 | + @"content":model.sourceId?model.sourceId:@"未知", | ||
| 260 | + @"height":@"40", | ||
| 261 | + @"lineHeight":@"0" | ||
| 262 | + }, | ||
| 263 | + @{ | ||
| 264 | + @"title":@"查看与此商户的交易记录", | ||
| 265 | + @"content":@"", | ||
| 266 | + @"height":@"50", | ||
| 267 | + @"lineHeight":@"10" | ||
| 268 | + } | ||
| 269 | + ] mutableCopy]; | ||
| 270 | + | ||
| 271 | + if (model.remark&&![model.remark isEqualToString:@""]) { | ||
| 272 | + NSDictionary *dic = @{ | ||
| 273 | + @"title":@"备注", | ||
| 274 | + @"content":model.remark?model.remark:@"", | ||
| 275 | + @"height":@"40", | ||
| 276 | + @"lineHeight":@"0" | ||
| 277 | + }; | ||
| 278 | + [array addObject:dic]; | ||
| 279 | + } | ||
| 280 | + | ||
| 281 | + for (NSDictionary *dic in array) { | ||
| 282 | + CNLiveTradingRecordDetailModel *model = [CNLiveTradingRecordDetailModel mj_objectWithKeyValues:dic]; | ||
| 283 | + [data addObject:model]; | ||
| 284 | + } | ||
| 285 | + return data; | ||
| 286 | +} | ||
| 287 | + | ||
| 147 | @end | 288 | @end |
CNLiveBalanceModule/Classes/Personal/CNLiveMonthBillController.m
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | #import "CNLiveMonthBillView.h" | 26 | #import "CNLiveMonthBillView.h" |
| 27 | #import "CNLiveTradingRecordModel.h" | 27 | #import "CNLiveTradingRecordModel.h" |
| 28 | #import "CNLiveTradingRecordCell.h" | 28 | #import "CNLiveTradingRecordCell.h" |
| 29 | +#import "CNLiveTradingRecordDetailController.h" | ||
| 29 | 30 | ||
| 30 | @interface CNLiveMonthBillController ()<UITableViewDelegate, UITableViewDataSource,CNLiveBalanceNavigationBarDelegate,CNLiveMonthBillViewDelegate> | 31 | @interface CNLiveMonthBillController ()<UITableViewDelegate, UITableViewDataSource,CNLiveBalanceNavigationBarDelegate,CNLiveMonthBillViewDelegate> |
| 31 | @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; | 32 | @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; |
| @@ -53,7 +54,7 @@ static const CGFloat height = 60; | @@ -53,7 +54,7 @@ static const CGFloat height = 60; | ||
| 53 | } | 54 | } |
| 54 | #pragma mark - 加载数据 | 55 | #pragma mark - 加载数据 |
| 55 | - (void)loadData { | 56 | - (void)loadData { |
| 56 | - [CNLiveBalanceRequest getTradingRecordWithID:CNUserShareModel.uid type:self.type startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { | 57 | + [CNLiveBalanceRequest getTradingRecordListWithID:CNUserShareModel.uid type:self.type startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { |
| 57 | [self.tableView.mj_header endRefreshing]; | 58 | [self.tableView.mj_header endRefreshing]; |
| 58 | [self.tableView.mj_footer endRefreshing]; | 59 | [self.tableView.mj_footer endRefreshing]; |
| 59 | self.monthBillView.interactionEnabled = YES; | 60 | self.monthBillView.interactionEnabled = YES; |
| @@ -127,7 +128,10 @@ static const CGFloat height = 60; | @@ -127,7 +128,10 @@ static const CGFloat height = 60; | ||
| 127 | } | 128 | } |
| 128 | 129 | ||
| 129 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | 130 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ |
| 130 | - | 131 | + CNLiveTradingRecordListModel *model = self.data[indexPath.row]; |
| 132 | + CNLiveTradingRecordDetailController *vc = [[CNLiveTradingRecordDetailController alloc]init]; | ||
| 133 | + vc.model = model; | ||
| 134 | + [self.navigationController pushViewController:vc animated:YES]; | ||
| 131 | 135 | ||
| 132 | } | 136 | } |
| 133 | 137 |
CNLiveBalanceModule/Classes/Personal/CNLiveTradingRecordController.m
| @@ -26,6 +26,7 @@ | @@ -26,6 +26,7 @@ | ||
| 26 | #import "CNLiveMonthBillController.h" //月账单 | 26 | #import "CNLiveMonthBillController.h" //月账单 |
| 27 | #import "CNLiveTradingRecordModel.h" | 27 | #import "CNLiveTradingRecordModel.h" |
| 28 | #import "CNLiveTradingRecordCell.h" | 28 | #import "CNLiveTradingRecordCell.h" |
| 29 | +#import "CNLiveTradingRecordDetailController.h" | ||
| 29 | 30 | ||
| 30 | @interface CNLiveTradingRecordController ()<UITableViewDelegate, UITableViewDataSource,CNLiveBalanceNavigationBarDelegate,CNLiveTradingRecordViewDelegate> | 31 | @interface CNLiveTradingRecordController ()<UITableViewDelegate, UITableViewDataSource,CNLiveBalanceNavigationBarDelegate,CNLiveTradingRecordViewDelegate> |
| 31 | @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; | 32 | @property (nonatomic, strong) CNLiveBalanceNavigationBar *navigationBar; |
| @@ -46,7 +47,7 @@ static const CGFloat height = 80; | @@ -46,7 +47,7 @@ static const CGFloat height = 80; | ||
| 46 | 47 | ||
| 47 | #pragma mark - 加载数据 | 48 | #pragma mark - 加载数据 |
| 48 | - (void)loadData { | 49 | - (void)loadData { |
| 49 | - [CNLiveBalanceRequest getTradingRecordWithID:CNUserShareModel.uid type:@"0" startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { | 50 | + [CNLiveBalanceRequest getTradingRecordListWithID:CNUserShareModel.uid type:@"0" startTime:self.startTime endTime:self.endTime block:^(BOOL isSuccess, NSDictionary * _Nonnull data, NSError *error) { |
| 50 | [self.tableView.mj_header endRefreshing]; | 51 | [self.tableView.mj_header endRefreshing]; |
| 51 | [self.tableView.mj_footer endRefreshing]; | 52 | [self.tableView.mj_footer endRefreshing]; |
| 52 | 53 | ||
| @@ -125,7 +126,10 @@ static const CGFloat height = 80; | @@ -125,7 +126,10 @@ static const CGFloat height = 80; | ||
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ | 128 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ |
| 128 | - | 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 | } | 133 | } |
| 130 | 134 | ||
| 131 | #pragma mark - CNLiveTradingRecordViewDelegate | 135 | #pragma mark - CNLiveTradingRecordViewDelegate |
CNLiveBalanceModule/Classes/View/CNLiveTradingRecordCell.m
| @@ -142,7 +142,6 @@ static const NSInteger height = 25; | @@ -142,7 +142,6 @@ static const NSInteger height = 25; | ||
| 142 | _title.numberOfLines = 1; | 142 | _title.numberOfLines = 1; |
| 143 | _title.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; | 143 | _title.textColor = [UIColor colorWithRed:51/255.0 green:51/255.0 blue:51/255.0 alpha:1.0]; |
| 144 | _title.font = UIFontCNMake(16.0); | 144 | _title.font = UIFontCNMake(16.0); |
| 145 | - _title.text = @"白赖堡;"; | ||
| 146 | } | 145 | } |
| 147 | return _title; | 146 | return _title; |
| 148 | } | 147 | } |
| @@ -153,7 +152,6 @@ static const NSInteger height = 25; | @@ -153,7 +152,6 @@ static const NSInteger height = 25; | ||
| 153 | _time.numberOfLines = 1; | 152 | _time.numberOfLines = 1; |
| 154 | _time.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0]; | 153 | _time.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1.0]; |
| 155 | _time.font = UIFontCNMake(12.0); | 154 | _time.font = UIFontCNMake(12.0); |
| 156 | - _time.text = @"1241"; | ||
| 157 | } | 155 | } |
| 158 | return _time; | 156 | return _time; |
| 159 | } | 157 | } |
Example/CNLiveBalanceModule/CNLIVEAppDelegate.m
| @@ -62,7 +62,7 @@ | @@ -62,7 +62,7 @@ | ||
| 62 | }]; | 62 | }]; |
| 63 | [[NSUserDefaults standardUserDefaults] setObject:@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj" forKey:@"CNLiveAuthToken"]; | 63 | [[NSUserDefaults standardUserDefaults] setObject:@"RkFYeLkl/u5S7tW8UcOkT3rfLTP/Ua8NIkdEsKlcolvl/yxTMNbAYXmmJyhKGpkj" forKey:@"CNLiveAuthToken"]; |
| 64 | 64 | ||
| 65 | - CNLiveBalanceController *vc = [[CNLiveBalanceController alloc] initWithType:@"2" ID:CNUserShareModel.uid]; | 65 | + CNLiveBalanceController *vc = [[CNLiveBalanceController alloc] initWithType:@"1" ID:CNUserShareModel.uid]; |
| 66 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; | 66 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; |
| 67 | self.window.rootViewController = nav;//设置根视图控制器 | 67 | self.window.rootViewController = nav;//设置根视图控制器 |
| 68 | [self.window makeKeyAndVisible]; | 68 | [self.window makeKeyAndVisible]; |