// // KDPSetViewController.m // KuDianProject // // Created by 学丽 on 2019/7/9. // Copyright © 2019 KDP. All rights reserved. // #import "KDPSetViewController.h" #import "KDPPhoneLoginViewController.h" @interface KDPSetViewController () { } @property(nonatomic,strong)UITableView *setView; @end @implementation KDPSetViewController - (void)viewDidLoad { [super viewDidLoad]; [self.navBar addleftReturnButton:self selector:@selector(returnClickBtn)]; self.navBar.navTitleLabel.text=@"设置"; self.view.backgroundColor=[UIColor colorWithHexString:LineColor]; [self.view addSubview:self.setView]; [self.setView mas_makeConstraints:^(MASConstraintMaker *make) { make.top.mas_equalTo(KDNavBarHeight); make.left.right.mas_equalTo(0); make.bottom.mas_equalTo(self.view.mas_bottom).offset(-50); }]; UIButton *exitButton=[[UIButton alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT-50, SCREEN_WIDTH, 50)]; [exitButton setTitleColor:[UIColor colorWithHexString:ThemeColor] forState:UIControlStateNormal]; [exitButton setTitle:@"退出登录" forState:UIControlStateNormal]; exitButton.titleLabel.font=[UIFont systemFontOfSize:14]; [exitButton addTarget:self action:@selector(exitClickButton) forControlEvents:UIControlEventTouchUpInside]; exitButton.backgroundColor=[UIColor whiteColor]; [self.view addSubview:exitButton]; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *listC=[tableView dequeueReusableCellWithIdentifier:@"set"]; if (!listC) { listC=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"set"]; listC.selectionStyle=UITableViewCellSelectionStyleNone; } KDPAccountModel *model =[KDPAccountTool account]; listC.textLabel.text=@"我的手机号"; listC.textLabel.font=[UIFont systemFontOfSize:14]; listC.textLabel.textColor=[UIColor colorWithHexString:fontColor]; listC.detailTextLabel.text=model.phone; listC.detailTextLabel.font=[UIFont systemFontOfSize:14]; listC.detailTextLabel.textColor=[UIColor colorWithHexString:@"#666666"]; return listC; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 50; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } -(UITableView *)setView { if (!_setView) { _setView=[[UITableView alloc]init]; _setView.backgroundColor=[UIColor clearColor]; _setView.separatorStyle=UITableViewCellSeparatorStyleNone; _setView.delegate=self; _setView.dataSource=self; } return _setView; } -(void)returnClickBtn { [self.navigationController popViewControllerAnimated:YES]; } -(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.navigationController.navigationBar.hidden=YES; self.tabBarController.tabBar.hidden=YES; } -(void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; self.tabBarController.tabBar.hidden=NO; } #pragma mark---退出登录 -(void)exitClickButton { [KDPAccountTool deleteAccount]; [[UIApplication sharedApplication].keyWindow.rootViewController presentViewController:[[UINavigationController alloc]initWithRootViewController:[[KDPPhoneLoginViewController alloc]init]] animated:YES completion:nil]; [self.navigationController popToRootViewControllerAnimated:YES]; } @end