Commit 93c11137a30d67d3d91b1463a9f2802093a2a98f

Authored by zhangxiaowen
1 parent 0bd0e249

no message

CNLiveBalanceModule/Classes/PayCenter/CNLivePayCenterController.m
... ... @@ -98,9 +98,9 @@
98 98  
99 99 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
100 100 if(indexPath.row == 0){
101   - CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init];
102   - vc.type = TradingRecordTypeDefault;
103   - vc.ID = CNUserShareModel.uid;
  101 + CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]initWithType:TradingRecordTypeDefault ID:CNUserShareModel.uid date:nil startTime:nil endTime:nil];
  102 +// vc.type = TradingRecordTypeDefault;
  103 +// vc.ID = CNUserShareModel.uid;
104 104 [self.navigationController pushViewController:vc animated:YES];
105 105 }else if(indexPath.row == 1){//支付管理
106 106 CNLivePayManagerController *vc = [[CNLivePayManagerController alloc]init];
... ...
CNLiveBalanceModule/Classes/TradingRecord/CNLiveTradingRecordController.h
... ... @@ -17,14 +17,18 @@ typedef enum {
17 17 } TradingRecordType;
18 18  
19 19 @interface CNLiveTradingRecordController : CNCommonViewController
20   -//type: 0 -> 个人中心交易记录 1 -> 查看与此商户的交易记录
21   -@property (nonatomic, assign) TradingRecordType type;
22 20  
23   -//ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId
24   -@property (nonatomic, copy) NSString *ID;
  21 +/**
  22 + * @abstract 初始化配置
  23 + * @param type type: 0 -> 个人中心交易记录 1 -> 查看与此商户的交易记录
  24 + * @param ID ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId
  25 + * @param date 2019年12月
  26 + * @param startTime 开始时间
  27 + * @param endTime 结束时间
  28 +*/
  29 +- (instancetype)initWithType:(TradingRecordType)type ID:(NSString *)ID date:(NSString *)date startTime:(NSString *)startTime endTime:(NSString *)endTime;
25 30  
26   -@property (nonatomic, copy) NSString *date;
27   -@property (nonatomic, copy) NSString *startTime;
28   -@property (nonatomic, copy) NSString *endTime;
  31 +- (instancetype)init NS_UNAVAILABLE;
  32 ++ (instancetype)new NS_UNAVAILABLE;
29 33  
30 34 @end
... ...
CNLiveBalanceModule/Classes/TradingRecord/CNLiveTradingRecordController.m
... ... @@ -36,10 +36,32 @@
36 36 @property (nonatomic, strong) NSMutableArray *data;
37 37 @property (nonatomic, assign) NSInteger pageNo;
38 38  
  39 +//type: 0 -> 个人中心交易记录 1 -> 查看与此商户的交易记录
  40 +@property (nonatomic, assign) TradingRecordType type;
  41 +
  42 +//ID: 0 -> 用户id 1 -> 查看与此商户的交易记录 toId
  43 +@property (nonatomic, copy) NSString *ID;
  44 +
  45 +@property (nonatomic, copy) NSString *date;
  46 +@property (nonatomic, copy) NSString *startTime;
  47 +@property (nonatomic, copy) NSString *endTime;
  48 +
39 49 @end
40 50  
41 51 @implementation CNLiveTradingRecordController
42 52 static const CGFloat height = 80;
  53 +#pragma mark - 初始化
  54 +- (instancetype)initWithType:(TradingRecordType)type ID:(NSString *)ID date:(NSString *)date startTime:(NSString *)startTime endTime:(NSString *)endTime{
  55 + if(self = [super init]){
  56 + self.type = type;
  57 + self.ID = ID;
  58 +
  59 + self.date = date;
  60 + self.startTime = startTime;
  61 + self.endTime = endTime;
  62 + }
  63 + return self;
  64 +}
43 65  
44 66 #pragma mark - 加载数据
45 67 - (void)loadData {
... ...
CNLiveBalanceModule/Classes/TradingRecord/CNLiveTradingRecordDetailController.m
... ... @@ -107,14 +107,7 @@ static const CGFloat height = 80;
107 107 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
108 108 CNLiveTradingRecordDetailModel *model = self.data[indexPath.row];
109 109 if([model.style isEqualToString:@"1"]){
110   - CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]init];
111   - vc.type = TradingRecordTypeSpecial;
112   - vc.ID = self.model.toId;
113   -
114   - vc.date = self.date;
115   - vc.startTime = self.startTime;
116   - vc.endTime = self.endTime;
117   -
  110 + CNLiveTradingRecordController *vc = [[CNLiveTradingRecordController alloc]initWithType:TradingRecordTypeSpecial ID:self.model.toId date:self.date startTime:self.startTime endTime:self.endTime];
118 111 [self.navigationController pushViewController:vc animated:YES];
119 112  
120 113 }
... ...