JXMoneyMenuViewController.m 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. //
  2. // JXMoneyMenuViewController.m
  3. // shiku_im
  4. //
  5. // Created by 1 on 2018/9/18.
  6. // Copyright © 2018年 Reese. All rights reserved.
  7. //
  8. #import "JXMoneyMenuViewController.h"
  9. #import "JXRecordCodeVC.h"
  10. #import "JXPayPasswordVC.h"
  11. #import "forgetPwdVC.h"
  12. #define HEIGHT 56
  13. @interface JXMoneyMenuViewController ()<forgetPwdVCDelegate,UITableViewDelegate,UITableViewDataSource>
  14. @property (nonatomic,strong) NSMutableArray *dataArr;
  15. @property (nonatomic,strong) UITableView *collectionView ;
  16. @end
  17. @implementation JXMoneyMenuViewController
  18. - (instancetype)init {
  19. self = [super init];
  20. if (self) {
  21. // self.title = Localized(@"JX_PayCenter");
  22. // self.heightHeader = JX_SCREEN_TOP;
  23. // self.heightFooter = 0;
  24. // self.isGotoBack = YES;
  25. // [self createHeadAndFoot];
  26. [self defineNavBar:@"支付中心" andRinghtBtnImg:@""];
  27. /*
  28. int h=0;
  29. int w=JX_SCREEN_WIDTH;
  30. JXImageView* iv;
  31. iv = [self createButton:Localized(@"JX_Bill") drawTop:NO drawBottom:YES click:@selector(onBill)];
  32. iv.frame = CGRectMake(0,h, w, HEIGHT);
  33. h+=iv.frame.size.height;
  34. iv = [self createButton:Localized(@"JX_SetPayPsw") drawTop:NO drawBottom:YES click:@selector(onPayThePassword)];
  35. iv.frame = CGRectMake(0,h, w, HEIGHT);
  36. h+=iv.frame.size.height;
  37. iv = [self createButton:@"忘记支付密码" drawTop:NO drawBottom:NO click:@selector(onForgetPassWord)];
  38. iv.frame = CGRectMake(0,h, w, HEIGHT);
  39. h+=iv.frame.size.height;
  40. */
  41. }
  42. return self;
  43. }
  44. - (void)onBill {
  45. JXRecordCodeVC * recordVC = [[JXRecordCodeVC alloc]init];
  46. [g_navigation pushViewController:recordVC animated:YES];
  47. }
  48. - (void)viewDidLoad{
  49. [super viewDidLoad];
  50. _dataArr=[NSMutableArray array];
  51. NSArray *title=@[@"账单",@"设置密码",@"忘记密码"];
  52. [_dataArr addObjectsFromArray:title];
  53. _collectionView = [[UITableView alloc]initWithFrame:CGRectMake(0, JX_SCREEN_TOP, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP)];
  54. _collectionView.delegate = self;
  55. _collectionView.dataSource = self;
  56. _collectionView.showsVerticalScrollIndicator = NO;
  57. _collectionView.showsHorizontalScrollIndicator = NO;
  58. _collectionView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0];
  59. _collectionView.tableFooterView=[UIView new];
  60. [self.view addSubview:_collectionView];
  61. }
  62. - (void)forgetPwdSuccess {
  63. g_server.myself.isPayPassword = nil;
  64. [self onPayThePassword];
  65. }
  66. -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  67. return JX_SCREEN_HEIGHT>=812?60:54;
  68. }
  69. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  70. return _dataArr.count;
  71. }
  72. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  73. static NSString *ID = @"UITableViewCell";
  74. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
  75. if (!cell) {
  76. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
  77. cell.selectionStyle=UITableViewCellSelectionStyleNone;
  78. cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
  79. }
  80. cell.textLabel.text= _dataArr[indexPath.row];
  81. return cell;
  82. }
  83. - (void)onPayThePassword {
  84. }
  85. - (void)onForgetPassWord {
  86. }
  87. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  88. NSString *titleStr= _dataArr[indexPath.row];
  89. if ([titleStr isEqualToString:@"账单"]) {
  90. JXRecordCodeVC * recordVC = [[JXRecordCodeVC alloc]init];
  91. [g_navigation pushViewController:recordVC animated:YES];
  92. }else if ([titleStr isEqualToString:@"设置密码"]) {
  93. JXPayPasswordVC * PayVC = [JXPayPasswordVC alloc];
  94. if ([g_server.myself.isPayPassword boolValue]) {
  95. PayVC.type = JXPayTypeInputPassword;
  96. }else {
  97. PayVC.type = JXPayTypeSetupPassword;
  98. }
  99. PayVC.enterType = JXEnterTypeDefault;
  100. PayVC = [PayVC init];
  101. [g_navigation pushViewController:PayVC animated:YES];
  102. }else if ([titleStr isEqualToString:@"忘记密码"]) {
  103. forgetPwdVC* vc = [[forgetPwdVC alloc] init];
  104. vc.delegate = self;
  105. vc.isPayPWD = YES;
  106. vc.isModify = NO;
  107. // [g_window addSubview:vc.view];
  108. [g_navigation pushViewController:vc animated:YES];
  109. }
  110. }
  111. /*
  112. -(JXImageView*)createButton:(NSString*)title drawTop:(BOOL)drawTop drawBottom:(BOOL)drawBottom click:(SEL)click{
  113. JXImageView* btn = [[JXImageView alloc] init];
  114. btn.backgroundColor = [UIColor whiteColor];
  115. btn.userInteractionEnabled = YES;
  116. btn.didTouch = click;
  117. btn.delegate = self;
  118. [self.view addSubview:btn];
  119. JXLabel* p = [[JXLabel alloc] initWithFrame:CGRectMake(15, 0, self_width-15, HEIGHT)];
  120. p.text = title;
  121. p.font = g_factory.font17;
  122. p.backgroundColor = [UIColor clearColor];
  123. p.textColor = HEXCOLOR(0x323232);
  124. [btn addSubview:p];
  125. if(drawTop){
  126. UIView* line = [[UIView alloc] initWithFrame:CGRectMake(15,0,JX_SCREEN_WIDTH-20,LINE_WH)];
  127. line.backgroundColor = THE_LINE_COLOR;
  128. [btn addSubview:line];
  129. }
  130. if(drawBottom){
  131. UIView* line = [[UIView alloc] initWithFrame:CGRectMake(15,HEIGHT-LINE_WH,JX_SCREEN_WIDTH-15,LINE_WH)];
  132. line.backgroundColor = THE_LINE_COLOR;
  133. [btn addSubview:line];
  134. }
  135. if(click){
  136. UIImageView* iv;
  137. iv = [[UIImageView alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-15-7, (HEIGHT-13)/2, 7, 13)];
  138. iv.image = [UIImage imageNamed:@"new_icon_>"];
  139. [btn addSubview:iv];
  140. }
  141. return btn;
  142. }
  143. */
  144. @end