240 lines
6.7 KiB
Objective-C
240 lines
6.7 KiB
Objective-C
//
|
|
// XJEditSystemViewController.m
|
|
// XinjiangProject
|
|
//
|
|
// Created by 仁康信息 on 2024/1/10.
|
|
//
|
|
|
|
#import "XJEditSystemViewController.h"
|
|
#import "XJLoginFoundPasswordViewController.h"
|
|
#import "XJMineCenterUserModel.h"
|
|
#import "ADJumpViewController.h"
|
|
|
|
@interface XJEditSystemViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
|
@property (nonatomic, strong) UITableView * homeTableView;
|
|
|
|
@property (nonatomic, strong) NSMutableArray * dataArray;
|
|
|
|
@end
|
|
|
|
@implementation XJEditSystemViewController
|
|
|
|
- (NSMutableArray *)dataArray {
|
|
|
|
if (!_dataArray) {
|
|
_dataArray = [[NSMutableArray alloc] init];
|
|
}
|
|
return _dataArray;
|
|
}
|
|
|
|
- (void)viewDidLoad {
|
|
[super viewDidLoad];
|
|
// Do any additional setup after loading the view.
|
|
self.view.backgroundColor = CViewBgColor;
|
|
self.navigationItem.title = @"设置";
|
|
[self createUI];
|
|
[self createData];
|
|
}
|
|
|
|
- (void)createUI
|
|
{
|
|
self.homeTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight) style:UITableViewStyleGrouped];
|
|
if (@available(iOS 11.0, *)) {
|
|
self.homeTableView.estimatedRowHeight = 0;
|
|
self.homeTableView.estimatedSectionFooterHeight = 0;
|
|
self.homeTableView.estimatedSectionHeaderHeight = 0;
|
|
self.homeTableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
}
|
|
self.homeTableView.delegate = self;
|
|
self.homeTableView.backgroundColor = CViewBgColor;
|
|
self.homeTableView.dataSource = self;
|
|
self.homeTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
|
|
self.homeTableView.showsVerticalScrollIndicator = NO;
|
|
[self.view addSubview:self.homeTableView];
|
|
}
|
|
|
|
- (void)createData {
|
|
|
|
JKCQAPI * agreeAPI = [[JKCQAPI alloc] init:self tag:@"AGREEAPI" NeedToken:@""];
|
|
|
|
[agreeAPI getUserAgreementPrivacy:nil];
|
|
|
|
}
|
|
|
|
|
|
- (void)Failed:(NSString*)message tag:(NSString*)tag
|
|
{
|
|
[self showMBProgressHUDOnlyWithString:message];
|
|
[self hiddenAllMBProgressHUD];
|
|
|
|
}
|
|
|
|
- (void)Sucess:(id)response tag:(NSString*)tag
|
|
{
|
|
if ([tag isEqualToString:@"AGREEAPI"]) {
|
|
|
|
NSArray * array = response;
|
|
|
|
for (NSDictionary * parmDic in array) {
|
|
|
|
XJMineCenterUserModel * model = [XJMineCenterUserModel modelWithDictionary:parmDic];
|
|
|
|
[self.dataArray addObject:model];
|
|
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
#pragma mark - DataSource
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
|
|
{
|
|
if (section == 0) {
|
|
return 3;
|
|
}
|
|
return 1;
|
|
}
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
|
|
{
|
|
return 2;
|
|
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
if (indexPath.section == 0) {
|
|
|
|
NSArray * sectionOne = @[@"账号与安全(修改密码)",@"用户协议",@"隐私政策"];
|
|
|
|
|
|
static NSString * cellID = @"cellID";
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
|
|
|
|
if (!cell) {
|
|
|
|
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
|
|
}
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
cell.textLabel.font = SYSTEMFONT(14);
|
|
cell.textLabel.text = sectionOne[indexPath.row];
|
|
cell.textLabel.textColor = UIColorHex(#666666);
|
|
cell.textLabel.font = SYSTEMFONT(14);
|
|
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
|
|
cell.backgroundColor = KWhiteColor;
|
|
return cell;
|
|
|
|
|
|
}
|
|
if (indexPath.section == 1) {
|
|
|
|
|
|
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"CONNETCELL"];
|
|
|
|
if (!cell) {
|
|
|
|
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"CONNETCELL"];
|
|
}
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
cell.textLabel.font = SYSTEMFONT(14);
|
|
cell.textLabel.text = @"版本号";
|
|
cell.detailTextLabel.text = [[[NSBundle mainBundle]infoDictionary] objectForKey:@"CFBundleShortVersionString"];
|
|
return cell;
|
|
|
|
|
|
}
|
|
|
|
|
|
return UITableViewCell.new;
|
|
|
|
}
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
|
|
return 44;
|
|
|
|
}
|
|
|
|
- (CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
|
|
{
|
|
|
|
return CGFLOAT_MIN;
|
|
}
|
|
|
|
|
|
- (CGFloat )tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
|
|
{
|
|
return kRealValue(5);
|
|
}
|
|
|
|
|
|
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
|
|
|
|
|
return UIView.new;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
if (indexPath.section == 0) {
|
|
|
|
if (indexPath.row == 0) {
|
|
|
|
XJLoginFoundPasswordViewController * loginVC = [[XJLoginFoundPasswordViewController alloc] init];
|
|
[self.navigationController pushViewController:loginVC animated:YES];
|
|
}
|
|
if (indexPath.row == 1) {
|
|
|
|
for (XJMineCenterUserModel * model in self.dataArray) {
|
|
|
|
if ([model.value integerValue] == 1) {
|
|
|
|
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
|
|
webVC.webTitle = @"用户协议";
|
|
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
|
|
[self.navigationController pushViewController:webVC animated:YES];
|
|
}
|
|
|
|
}
|
|
}
|
|
if (indexPath.row == 2) {
|
|
|
|
for (XJMineCenterUserModel * model in self.dataArray) {
|
|
|
|
if ([model.value integerValue] == 2) {
|
|
|
|
ADJumpViewController * webVC= [[ADJumpViewController alloc] init];
|
|
webVC.webTitle = @"隐私政策";
|
|
webVC.webUrl = [NSString stringWithFormat:@"%@%@",IntervenH5,model.text];
|
|
[self.navigationController pushViewController:webVC animated:YES];
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
/*
|
|
#pragma mark - Navigation
|
|
|
|
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
|
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
|
// Get the new view controller using [segue destinationViewController].
|
|
// Pass the selected object to the new view controller.
|
|
}
|
|
*/
|
|
|
|
@end
|