// // // AICity // // Created by 刘伟伟 on 2023/7/20. // Copyright © 2023 wei.z. All rights reserved. // #import "DelAccProtocolViewController.h" #import "CommonBarView.h" @interface DelAccProtocolViewController () @property(nonatomic,strong)CommonBarView *customerbar; @property(nonatomic,strong)UITableView *tableView; @property(nonatomic,strong)NSString *cc; @property(nonatomic,assign)int height; @end @implementation DelAccProtocolViewController -(UIStatusBarStyle)preferredStatusBarStyle{ return UIStatusBarStyleLightContent; } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.fd_prefersNavigationBarHidden = true; self.view.backgroundColor = rgba(18, 23, 41, 1); self.cc = @"注销权\n如您不需要使用韩小圈的服务,您可以向平台申请注销您的账号。您可以在快影 APP“我的——设置——账号安全中心——注销账号”来申请账号注销。请注意,账号注销是不可恢复的操作,您需要自行备份账号下相关信息和数据,操作前请确认与韩小圈相关的所有服务均已妥善处理。\n在您注销韩小圈账号后,该账号下的内容、信息、数据、记录等将会被删除或匿名化处理(但法律法规另有规定或监管部门另有要求的除外)。 "; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.lineSpacing = 5;// 字体的行间距 NSDictionary *defaultAttributesC = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:rgba(255, 255, 255, 0.6), NSParagraphStyleAttributeName:paragraphStyle }; NSMutableAttributedString * attributedStrX = [[NSMutableAttributedString alloc] initWithString:self.cc attributes:defaultAttributesC]; NSStringDrawingOptions options = NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading; CGRect rect = [attributedStrX boundingRectWithSize:CGSizeMake(kScreenWidth-24, CGFLOAT_MAX) options:options context:nil]; self.height = rect.size.height + 10; [self.view addSubview:self.customerbar]; [self.view addSubview:self.tableView]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.bottom.equalTo(self.view); make.top.equalTo(self.customerbar.mas_bottom); }]; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ return 1; } -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return self.height; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ UITableViewCell * cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"privatecell"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.backgroundColor = [UIColor clearColor]; UILabel *lab = [UILabel new]; lab.textColor = rgba(255, 255, 255, 0.6); lab.font = [UIFont systemFontOfSize:14]; lab.numberOfLines = 0; NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.lineSpacing = 5;// 字体的行间距 NSDictionary *defaultAttributesC = @{ NSFontAttributeName:[UIFont systemFontOfSize:14], NSForegroundColorAttributeName:rgba(255, 255, 255, 0.6), NSParagraphStyleAttributeName:paragraphStyle }; NSMutableAttributedString * attributedStrX = [[NSMutableAttributedString alloc] initWithString:self.cc attributes:defaultAttributesC]; lab.attributedText = attributedStrX;; [cell.contentView addSubview:lab]; [lab mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(cell.contentView); make.width.mas_equalTo(@(SCREEN_WIDTH-24)); }]; return cell; } -(UITableView *)tableView{ if(!_tableView){ _tableView =[[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped]; _tableView.delegate = self; _tableView.dataSource = self; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; _tableView.showsVerticalScrollIndicator = false; _tableView.showsHorizontalScrollIndicator = false; // _tableView.backgroundColor = rgba(18, 23, 41, 1); _tableView.backgroundColor = [UIColor clearColor]; if (@available(iOS 11, *)) { _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; _tableView.estimatedRowHeight = 0; _tableView.estimatedSectionFooterHeight = 0; _tableView.estimatedSectionHeaderHeight = 0; UIWindow *keyWindow = UIApplication.sharedApplication.keyWindow; UIEdgeInsets safeAreaInsets = keyWindow.safeAreaInsets; CGFloat topSafeArea = safeAreaInsets.top; _tableView.contentInset = UIEdgeInsetsMake(0, 0, BAR_HEIGHT, 0); // _tableView2.contentInset = UIEdgeInsetsMake(-35, 0, 0, 0); } #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 // only Xcode 13+ needs and can compile this if (@available(iOS 15.0, *)) { _tableView.sectionHeaderTopPadding = 0; } #endif } return _tableView; } -(void)backAction{ [self.navigationController popViewControllerAnimated:true]; } -(CommonBarView *)customerbar{ if(!_customerbar){ CGFloat h=0; if(@available(iOS 13.0, *)){ UIStatusBarManager *sc= [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager; CGRect f=sc.statusBarFrame; h=f.size.height; }else{ h=[UIApplication sharedApplication].statusBarFrame.size.height; } if(h>=40){ h=30; } _customerbar =[[CommonBarView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 72-20+h)]; _customerbar.bgView.backgroundColor = [UIColor clearColor]; _customerbar.label.text=@"服务协议"; _customerbar.bgView.alpha = 1; _customerbar.label.textColor = rgba(255, 255, 255, 1); // _customerbar.leftButton.hidden = true; // [_customerbar.leftButton setImage:[UIImage imageNamed:@"his_back"] forState:UIControlStateNormal]; [_customerbar.rightButton setImage:[UIImage imageNamed:@"Frame 9411"] forState:UIControlStateNormal]; [_customerbar.rightButton setTitle:@"编辑" forState:UIControlStateNormal]; // [_customerbar.rightButton setImage:[self imageWithColor:[UIColor clearColor]] forState:UIControlStateSelected]; [_customerbar.rightButton setTitle:@"取消" forState:UIControlStateSelected]; [_customerbar.rightButton setTitleColor:rgba(255, 255, 255, 1) forState:UIControlStateNormal]; _customerbar.rightButton.titleLabel.font =[UIFont systemFontOfSize:14]; _customerbar.rightButton.hidden = true; [_customerbar.leftButton addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside]; // [_customerbar.rightButton addTarget:self action:@selector(changeSelState:) forControlEvents:UIControlEventTouchUpInside]; // [_customerbar.rightButton addTarget:self action:@selector(shareAction) forControlEvents:UIControlEventTouchUpInside]; // [_customerbar.rightButton mas_remakeConstraints:^(MASConstraintMaker *make) { // make.centerY.equalTo(_customerbar.leftButton); // make.right.equalTo(_customerbar).offset(-15); // make.size.mas_equalTo(CGSizeMake(23, 23)); // }]; } return _customerbar; } @end