123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- //
- // JXMoneyMenuViewController.m
- // shiku_im
- //
- // Created by 1 on 2018/9/18.
- // Copyright © 2018年 Reese. All rights reserved.
- //
- #import "JXMoneyMenuViewController.h"
- #import "JXRecordCodeVC.h"
- #import "JXPayPasswordVC.h"
- #import "forgetPwdVC.h"
- #define HEIGHT 56
- @interface JXMoneyMenuViewController ()<forgetPwdVCDelegate,UITableViewDelegate,UITableViewDataSource>
- @property (nonatomic,strong) NSMutableArray *dataArr;
- @property (nonatomic,strong) UITableView *collectionView ;
- @end
- @implementation JXMoneyMenuViewController
- - (instancetype)init {
- self = [super init];
- if (self) {
- // self.title = Localized(@"JX_PayCenter");
- // self.heightHeader = JX_SCREEN_TOP;
- // self.heightFooter = 0;
- // self.isGotoBack = YES;
- // [self createHeadAndFoot];
-
- [self defineNavBar:@"支付中心" andRinghtBtnImg:@""];
-
- /*
- int h=0;
- int w=JX_SCREEN_WIDTH;
- JXImageView* iv;
- iv = [self createButton:Localized(@"JX_Bill") drawTop:NO drawBottom:YES click:@selector(onBill)];
- iv.frame = CGRectMake(0,h, w, HEIGHT);
- h+=iv.frame.size.height;
-
- iv = [self createButton:Localized(@"JX_SetPayPsw") drawTop:NO drawBottom:YES click:@selector(onPayThePassword)];
- iv.frame = CGRectMake(0,h, w, HEIGHT);
- h+=iv.frame.size.height;
-
- iv = [self createButton:@"忘记支付密码" drawTop:NO drawBottom:NO click:@selector(onForgetPassWord)];
- iv.frame = CGRectMake(0,h, w, HEIGHT);
- h+=iv.frame.size.height;
- */
- }
- return self;
- }
- - (void)onBill {
- JXRecordCodeVC * recordVC = [[JXRecordCodeVC alloc]init];
- [g_navigation pushViewController:recordVC animated:YES];
- }
- - (void)viewDidLoad{
- [super viewDidLoad];
- _dataArr=[NSMutableArray array];
- NSArray *title=@[@"账单",@"设置密码",@"忘记密码"];
- [_dataArr addObjectsFromArray:title];
-
- _collectionView = [[UITableView alloc]initWithFrame:CGRectMake(0, JX_SCREEN_TOP, JX_SCREEN_WIDTH, JX_SCREEN_HEIGHT-JX_SCREEN_TOP)];
- _collectionView.delegate = self;
- _collectionView.dataSource = self;
- _collectionView.showsVerticalScrollIndicator = NO;
- _collectionView.showsHorizontalScrollIndicator = NO;
- _collectionView.backgroundColor = [UIColor colorWithRed:250/255. green:250/255. blue:250/255. alpha:1.0];
-
- _collectionView.tableFooterView=[UIView new];
- [self.view addSubview:_collectionView];
- }
- - (void)forgetPwdSuccess {
- g_server.myself.isPayPassword = nil;
- [self onPayThePassword];
- }
-
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
-
- return JX_SCREEN_HEIGHT>=812?60:54;
- }
-
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
-
- return _dataArr.count;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- static NSString *ID = @"UITableViewCell";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
- if (!cell) {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
- cell.selectionStyle=UITableViewCellSelectionStyleNone;
- cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
- }
-
- cell.textLabel.text= _dataArr[indexPath.row];
-
- return cell;
-
- }
- - (void)onPayThePassword {
- }
- - (void)onForgetPassWord {
-
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
-
-
- NSString *titleStr= _dataArr[indexPath.row];
-
- if ([titleStr isEqualToString:@"账单"]) {
- JXRecordCodeVC * recordVC = [[JXRecordCodeVC alloc]init];
- [g_navigation pushViewController:recordVC animated:YES];
- }else if ([titleStr isEqualToString:@"设置密码"]) {
- JXPayPasswordVC * PayVC = [JXPayPasswordVC alloc];
- if ([g_server.myself.isPayPassword boolValue]) {
- PayVC.type = JXPayTypeInputPassword;
- }else {
- PayVC.type = JXPayTypeSetupPassword;
- }
- PayVC.enterType = JXEnterTypeDefault;
- PayVC = [PayVC init];
- [g_navigation pushViewController:PayVC animated:YES];
- }else if ([titleStr isEqualToString:@"忘记密码"]) {
- forgetPwdVC* vc = [[forgetPwdVC alloc] init];
- vc.delegate = self;
- vc.isPayPWD = YES;
- vc.isModify = NO;
- // [g_window addSubview:vc.view];
- [g_navigation pushViewController:vc animated:YES];
- }
- }
- /*
- -(JXImageView*)createButton:(NSString*)title drawTop:(BOOL)drawTop drawBottom:(BOOL)drawBottom click:(SEL)click{
- JXImageView* btn = [[JXImageView alloc] init];
- btn.backgroundColor = [UIColor whiteColor];
- btn.userInteractionEnabled = YES;
- btn.didTouch = click;
- btn.delegate = self;
- [self.view addSubview:btn];
-
- JXLabel* p = [[JXLabel alloc] initWithFrame:CGRectMake(15, 0, self_width-15, HEIGHT)];
- p.text = title;
- p.font = g_factory.font17;
- p.backgroundColor = [UIColor clearColor];
- p.textColor = HEXCOLOR(0x323232);
- [btn addSubview:p];
-
- if(drawTop){
- UIView* line = [[UIView alloc] initWithFrame:CGRectMake(15,0,JX_SCREEN_WIDTH-20,LINE_WH)];
- line.backgroundColor = THE_LINE_COLOR;
- [btn addSubview:line];
- }
-
- if(drawBottom){
- UIView* line = [[UIView alloc] initWithFrame:CGRectMake(15,HEIGHT-LINE_WH,JX_SCREEN_WIDTH-15,LINE_WH)];
- line.backgroundColor = THE_LINE_COLOR;
- [btn addSubview:line];
- }
-
- if(click){
- UIImageView* iv;
- iv = [[UIImageView alloc] initWithFrame:CGRectMake(JX_SCREEN_WIDTH-15-7, (HEIGHT-13)/2, 7, 13)];
- iv.image = [UIImage imageNamed:@"new_icon_>"];
- [btn addSubview:iv];
-
- }
- return btn;
- }
- */
- @end
|