Files
yinmeng-ios/xplan-ios/Main/Mine/View/XPPrivacyViewController.m

164 lines
5.8 KiB
Mathematica
Raw Permalink Normal View History

2021-12-28 01:03:57 +08:00
//
// XPPrivacyViewController.m
// xplan-ios
//
// Created by zu on 2021/12/28.
//
#import "XPPrivacyViewController.h"
#import <Masonry/Masonry.h>
#import "XPMineSettingTableViewCell.h"
#import "XPMineSettingItemModel.h"
#import "XPWebViewController.h"
#import "XPPermissionsViewController.h"
#import "XPHtmlUrl.h"
#import "NSArray+Safe.h"
2021-12-28 01:03:57 +08:00
@interface XPPrivacyViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView * tableView;
@property (nonatomic, strong) NSArray<XPMineSettingItemModel *> * datasource;
@end
@implementation XPPrivacyViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"个人信息与权限";
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(0);
}];
}
- (void)pushWebViewWIthUrl:(NSString *)url {
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.url = url;
[self.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 45;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.datasource.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
XPMineSettingTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineSettingTableViewCell class])];
if (cell == nil) {
cell = [[XPMineSettingTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineSettingTableViewCell class])];
}
cell.itemModel = [self.datasource safeObjectAtIndex1:indexPath.row];
2021-12-28 01:03:57 +08:00
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
switch (indexPath.row) {
case 0:
{
XPPermissionsViewController * pvc = [[XPPermissionsViewController alloc] init];
[self.navigationController pushViewController:pvc animated:YES];
}
break;
case 1:
[self pushWebViewWIthUrl:URLWithType(kPrivacyURL)];
break;
case 2:
[self pushWebViewWIthUrl:URLWithType(kPrivacySDKURL)];
break;
case 3:
[self pushWebViewWIthUrl:URLWithType(kPrivacyPersonalURL)];
break;
case 4:
[self pushWebViewWIthUrl:URLWithType(kPrivacyDeviceURL)];
break;
case 5:
[self pushWebViewWIthUrl:URLWithType(kUserRechargeAgrURL)];
break;
case 6:
[self pushWebViewWIthUrl:URLWithType(kUserRegiServiceAgrURL)];
break;
case 7:
[self pushWebViewWIthUrl:URLWithType(kLiveServiceAgrURL)];
break;
case 8:
[self pushWebViewWIthUrl:URLWithType(kCommunitySpecURL)];
break;
case 9:
[self pushWebViewWIthUrl:URLWithType(kAccountlogoutAgrURL)];
break;
2021-12-28 01:03:57 +08:00
default:
break;
}
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
[_tableView registerClass:[XPMineSettingTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineSettingTableViewCell class])];
}
return _tableView;
}
- (NSArray<XPMineSettingItemModel *> *)datasource {
if (!_datasource) {
XPMineSettingItemModel * sysPermission = [[XPMineSettingItemModel alloc] init];
sysPermission.title = @"系统权限管理";
sysPermission.subTitle = @"";
XPMineSettingItemModel * privacy = [[XPMineSettingItemModel alloc] init];
privacy.title = @"隐私保护指引";
privacy.subTitle = @"";
XPMineSettingItemModel * sdk = [[XPMineSettingItemModel alloc] init];
sdk.title = @"第三方 SDK 目录";
sdk.subTitle = @"";
XPMineSettingItemModel * personalInfo = [[XPMineSettingItemModel alloc] init];
personalInfo.title = @"个人信息收集清单";
personalInfo.subTitle = @"";
XPMineSettingItemModel * permissionList = [[XPMineSettingItemModel alloc] init];
permissionList.title = @"设备权限清单";
permissionList.subTitle = @"";
XPMineSettingItemModel * userChargeProtocol = [[XPMineSettingItemModel alloc] init];
userChargeProtocol.title = @"用户充值协议";
userChargeProtocol.subTitle = @"";
XPMineSettingItemModel *userRegistProtocol = [[XPMineSettingItemModel alloc] init];
userRegistProtocol.title = @"用户注册服务协议";
userRegistProtocol.subTitle = @"";
XPMineSettingItemModel * liveServiceProtocol = [[XPMineSettingItemModel alloc] init];
liveServiceProtocol.title = @"直播服务协议";
liveServiceProtocol.subTitle = @"";
XPMineSettingItemModel * communitySpec = [[XPMineSettingItemModel alloc] init];
communitySpec.title = @"社区规范";
communitySpec.subTitle = @"";
XPMineSettingItemModel * accountLogout = [[XPMineSettingItemModel alloc] init];
accountLogout.title = @"账号注销协议";
accountLogout.subTitle = @"";
2021-12-28 01:03:57 +08:00
_datasource = @[sysPermission, privacy, sdk, personalInfo, permissionList, userChargeProtocol, userRegistProtocol, liveServiceProtocol, communitySpec,accountLogout];
2021-12-28 01:03:57 +08:00
}
return _datasource;
}
@end