You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
120 lines
4.6 KiB
120 lines
4.6 KiB
// |
|
// AboutViewController.m |
|
// LekangGuard |
|
// |
|
// Created by ecell on 2023/1/7. |
|
// |
|
|
|
#import "AboutViewController.h" |
|
#import "AboutTableViewCell.h" |
|
#import "commWebViewController.h" |
|
#import "FeedbackViewController.h" |
|
|
|
@interface AboutViewController () |
|
|
|
@property (nonatomic ,strong) UIView *headerView; |
|
@property (nonatomic ,strong) CommonTableView *AboutTable; |
|
@property (nonatomic ,strong) NSArray *titleArr; |
|
@property (nonatomic ,strong) NSArray *urlArr; |
|
|
|
@end |
|
|
|
@implementation AboutViewController |
|
|
|
- (void)viewDidLoad { |
|
[super viewDidLoad]; |
|
// Do any additional setup after loading the view. |
|
self.zx_navTitle = GJText(@"关于我们"); |
|
self.titleArr = @[GJText(@"用户协议"), |
|
GJText(@"隐私政策"), |
|
GJText(@"意见反馈")]; |
|
self.urlArr = @[AccoutXieYiURLStr,PrivacyPolicyURLStr]; |
|
|
|
[self.view addSubview:self.AboutTable]; |
|
[self.AboutTable mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.top.equalTo(self.view).offset(iPhoneX_NavHeight); |
|
make.left.right.equalTo(self.view); |
|
make.bottom.equalTo(self.view.mas_bottom); |
|
}]; |
|
|
|
} |
|
|
|
- (CommonTableView *)AboutTable |
|
{ |
|
if (!_AboutTable) |
|
{ |
|
kWeakSelf(self) |
|
_AboutTable = [[CommonTableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain cellHeight:55 cellRow:self.titleArr.count isAdaptive:NO isLine:YES commonCell:AboutTableViewCell.class createCell:^(ZZTableViewCell * _Nonnull cells, NSIndexPath * _Nonnull indexPath) { |
|
AboutTableViewCell *cell = (AboutTableViewCell *)cells; |
|
cell.titleStr = weakself.titleArr[indexPath.row]; |
|
|
|
} selectedCell:^(UITableView * _Nonnull tableView, NSIndexPath * _Nonnull indexPath) { |
|
|
|
if (indexPath.row < 2) |
|
{ |
|
commWebViewController *vc = [commWebViewController new]; |
|
vc.url = self.urlArr[indexPath.row]; |
|
vc.navTitle = self.titleArr[indexPath.row]; |
|
[self.navigationController pushViewController:vc animated:YES]; |
|
} |
|
else |
|
{ |
|
// NSString *string = [NSString stringWithFormat:@"mailto://support@ecellsz.com ?subject=%@%@",GJText(@"守护星"),GJText(@"意见反馈")]; |
|
// string = [string stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; |
|
// NSURL *emailURL = [NSURL URLWithString:string]; |
|
// [[UIApplication sharedApplication] openURL:emailURL options:[NSDictionary new] completionHandler:nil]; |
|
FeedbackViewController *vc = [[FeedbackViewController alloc] init]; |
|
[self.navigationController pushViewController:vc animated:YES]; |
|
} |
|
|
|
} DidscrollView:^(UIScrollView * _Nonnull scrollView) { |
|
|
|
}]; |
|
_AboutTable.backgroundColor = KKClearColor; |
|
_AboutTable.tableHeaderView = self.headerView; |
|
_AboutTable.tableHeaderView.height = Adapted(280); |
|
} |
|
return _AboutTable; |
|
} |
|
|
|
|
|
- (UIView *)headerView |
|
{ |
|
if (!_headerView) |
|
{ |
|
_headerView = [UIView new]; |
|
_headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, Adapted(280)); |
|
|
|
UIImageView *logoImg = [UICommon ui_imageView:CGRectZero fileName:@"About_logo"]; |
|
logoImg.layer.cornerRadius = 8; |
|
logoImg.layer.masksToBounds = YES; |
|
[_headerView addSubview:logoImg]; |
|
[logoImg mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(_headerView); |
|
make.centerY.equalTo(_headerView).inset(20); |
|
make.width.height.mas_equalTo(Adapted(100)); |
|
}]; |
|
|
|
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]; |
|
UILabel *versionLabel = [UICommon ui_label:CGRectZero lines:0 align:NSTextAlignmentCenter font:FontADA_(18) textColor:KKTextBlackColor text:F(@"%@(V%@)", GJText(@"守护星"),version) Radius:0]; |
|
[_headerView addSubview:versionLabel]; |
|
[versionLabel mas_makeConstraints:^(MASConstraintMaker *make) { |
|
make.centerX.equalTo(_headerView); |
|
make.top.equalTo(logoImg.mas_bottom).offset(15); |
|
}]; |
|
|
|
} |
|
return _headerView; |
|
} |
|
|
|
/* |
|
#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
|
|
|