|
@@ -16,15 +16,18 @@
|
|
|
#import "netWorkManager.h"
|
|
|
#import "SuperModel.h"
|
|
|
#import "allVersionView.h"
|
|
|
+#import "baseTableViewCell.h"
|
|
|
|
|
|
-@interface AboutViewController ()
|
|
|
+@interface AboutViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
@property (nonatomic, strong) UIButton *checUpdatekBtn;
|
|
|
// gradient
|
|
|
@property (nonatomic, strong)CAGradientLayer *gl_checkVersonBut;
|
|
|
@property (nonatomic, strong) UIButton *ruleBtn;
|
|
|
@property (nonatomic, strong) UIButton *privateBtn;
|
|
|
@property (nonatomic, strong) HWVersionModel *versionModel;
|
|
|
-
|
|
|
+@property (nonatomic, strong) UITableView* tableView;
|
|
|
+@property (nonatomic, strong) NSArray* msgTitleArr;
|
|
|
+@property(nonatomic,strong)couldphoneSysInfoModel *couldphoneSysInfoMod;
|
|
|
@end
|
|
|
|
|
|
@implementation AboutViewController
|
|
@@ -32,10 +35,16 @@
|
|
|
- (void)viewDidLoad {
|
|
|
[super viewDidLoad];
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCouldPhoneBaseInfoFun:) name:getCouldPhoneSysInfoNotification object:nil];
|
|
|
+
|
|
|
[self drawAnyView];
|
|
|
|
|
|
//数据埋点
|
|
|
[[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Version_information"];
|
|
|
+
|
|
|
+ if(_getSysInfo){
|
|
|
+ _getSysInfo();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated {
|
|
@@ -59,7 +68,7 @@
|
|
|
make.width.mas_equalTo(72.f);
|
|
|
make.height.mas_equalTo(72.f);
|
|
|
make.centerX.equalTo(self.view.mas_centerX);
|
|
|
- make.top.equalTo(self.navBarBGView.mas_bottom).offset(123.f);
|
|
|
+ make.top.equalTo(self.navBarBGView.mas_bottom).offset(60.f);
|
|
|
}];
|
|
|
[topImage.layer setCornerRadius:15.f];
|
|
|
topImage.clipsToBounds = YES;
|
|
@@ -86,20 +95,20 @@
|
|
|
}];
|
|
|
|
|
|
/*版本号*/
|
|
|
- UILabel *versionLabel = [[UILabel alloc] init];
|
|
|
- [versionLabel setBackgroundColor:[UIColor clearColor]];
|
|
|
- [versionLabel setTextColor:HW333333Color];
|
|
|
- [versionLabel setFont:[UIFont systemFontOfSize:13.f]];
|
|
|
- [versionLabel setTextAlignment:(NSTextAlignmentCenter)];
|
|
|
- NSString *vers = [iPhone appVersion];
|
|
|
- [versionLabel setText:[NSString stringWithFormat:@"V%@",vers]];
|
|
|
- [self.view addSubview:versionLabel];
|
|
|
- [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(appName.mas_bottom).offset(10.f);
|
|
|
- make.right.mas_equalTo(-27.f);
|
|
|
- make.left.mas_equalTo(27.f);
|
|
|
- make.height.mas_equalTo(20.f);
|
|
|
- }];
|
|
|
+// UILabel *versionLabel = [[UILabel alloc] init];
|
|
|
+// [versionLabel setBackgroundColor:[UIColor clearColor]];
|
|
|
+// [versionLabel setTextColor:HW333333Color];
|
|
|
+// [versionLabel setFont:[UIFont systemFontOfSize:13.f]];
|
|
|
+// [versionLabel setTextAlignment:(NSTextAlignmentCenter)];
|
|
|
+// NSString *vers = [iPhone appVersion];
|
|
|
+// [versionLabel setText:[NSString stringWithFormat:@"V%@",vers]];
|
|
|
+// [self.view addSubview:versionLabel];
|
|
|
+// [versionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(appName.mas_bottom).offset(10.f);
|
|
|
+// make.right.mas_equalTo(-27.f);
|
|
|
+// make.left.mas_equalTo(27.f);
|
|
|
+// make.height.mas_equalTo(20.f);
|
|
|
+// }];
|
|
|
|
|
|
/*开始体验*/
|
|
|
_checUpdatekBtn = [[UIButton alloc] init];
|
|
@@ -125,53 +134,174 @@
|
|
|
[_checUpdatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.centerX.equalTo(self.view.mas_centerX);
|
|
|
make.width.mas_equalTo(160.f);
|
|
|
- make.top.equalTo(versionLabel.mas_bottom).offset(25.f);
|
|
|
+ //make.top.equalTo(versionLabel.mas_bottom).offset(25.f);
|
|
|
+ make.top.equalTo(appName.mas_bottom).offset(25.f);
|
|
|
make.height.mas_equalTo(48.f);
|
|
|
}];
|
|
|
|
|
|
- UIButton *privateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- self.privateBtn = privateBtn;
|
|
|
- privateBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
|
|
|
- [privateBtn setTitle:NSLocalizedString(@"app_update_private",nil) forState:UIControlStateNormal];
|
|
|
- [privateBtn setTitleColor:HW13B2EBColor forState:UIControlStateNormal];
|
|
|
- [privateBtn setBackgroundColor:[UIColor clearColor]];
|
|
|
- [privateBtn addTarget:self action:@selector(privateBtnClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- privateBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
|
|
|
- [self.view addSubview:privateBtn];
|
|
|
- [privateBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.bottom.mas_equalTo(-80-AdaptTabHeight);
|
|
|
- //make.width.mas_equalTo(55);
|
|
|
- make.width.mas_equalTo(130);
|
|
|
- make.height.mas_equalTo(38);
|
|
|
- make.left.equalTo(self.view.mas_centerX).offset(6);
|
|
|
- }];
|
|
|
|
|
|
- UIButton *ruleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
- self.ruleBtn = ruleBtn;
|
|
|
- ruleBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
|
|
|
- [ruleBtn setTitle:NSLocalizedString(@"app_update_use_deal",nil) forState:UIControlStateNormal];
|
|
|
- [ruleBtn setTitleColor:HW13B2EBColor forState:UIControlStateNormal];
|
|
|
- [ruleBtn setBackgroundColor:[UIColor clearColor]];
|
|
|
- [ruleBtn addTarget:self action:@selector(ruleBtnClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- ruleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
|
|
|
- [self.view addSubview:ruleBtn];
|
|
|
- [ruleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.bottom.mas_equalTo(-80-AdaptTabHeight);
|
|
|
- //make.width.mas_equalTo(55);
|
|
|
- make.width.mas_equalTo(130);
|
|
|
- make.height.mas_equalTo(38);
|
|
|
- make.right.equalTo(self.view.mas_centerX).offset(-6);
|
|
|
- }];
|
|
|
+ //1.4.3 新加一个tableview 显示镜像相关信息
|
|
|
+ //用户协议 隐私协议 app当前版本 系统当前版本 系统待更新版本
|
|
|
+ _msgTitleArr = @[NSLocalizedString(@"app_update_use_deal",nil)
|
|
|
+ ,NSLocalizedString(@"app_update_private",nil)
|
|
|
+ ,NSLocalizedString(@"app_version_current",nil)
|
|
|
+ ,NSLocalizedString(@"system_version_current",nil)
|
|
|
+ ,NSLocalizedString(@"asystem_version_wait_update",nil)];
|
|
|
|
|
|
- UIView *lineView = [[UIView alloc] init];
|
|
|
- [lineView setBackgroundColor:HW999999Color];
|
|
|
- [self.view addSubview:lineView];
|
|
|
- [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.centerX.equalTo(self.view.mas_centerX);
|
|
|
- make.width.mas_equalTo(1);
|
|
|
- make.height.mas_equalTo(14);
|
|
|
- make.centerY.equalTo(ruleBtn.mas_centerY);
|
|
|
+
|
|
|
+ [self.view addSubview:self.tableView];
|
|
|
+
|
|
|
+ [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15.f);
|
|
|
+ make.right.mas_equalTo(-15.f);
|
|
|
+ make.top.equalTo(_checUpdatekBtn.mas_bottom).offset(25.f);
|
|
|
+ make.height.mas_equalTo(240.f);
|
|
|
}];
|
|
|
+
|
|
|
+// UIButton *privateBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+// self.privateBtn = privateBtn;
|
|
|
+// privateBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
|
|
|
+// [privateBtn setTitle:NSLocalizedString(@"app_update_private",nil) forState:UIControlStateNormal];
|
|
|
+// [privateBtn setTitleColor:HW13B2EBColor forState:UIControlStateNormal];
|
|
|
+// [privateBtn setBackgroundColor:[UIColor clearColor]];
|
|
|
+// [privateBtn addTarget:self action:@selector(privateBtnClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+// privateBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
|
|
|
+// [self.view addSubview:privateBtn];
|
|
|
+// [privateBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.bottom.mas_equalTo(-80-AdaptTabHeight);
|
|
|
+// //make.width.mas_equalTo(55);
|
|
|
+// make.width.mas_equalTo(130);
|
|
|
+// make.height.mas_equalTo(38);
|
|
|
+// make.left.equalTo(self.view.mas_centerX).offset(6);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// UIButton *ruleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+// self.ruleBtn = ruleBtn;
|
|
|
+// ruleBtn.titleLabel.font = [UIFont systemFontOfSize:13.f];
|
|
|
+// [ruleBtn setTitle:NSLocalizedString(@"app_update_use_deal",nil) forState:UIControlStateNormal];
|
|
|
+// [ruleBtn setTitleColor:HW13B2EBColor forState:UIControlStateNormal];
|
|
|
+// [ruleBtn setBackgroundColor:[UIColor clearColor]];
|
|
|
+// [ruleBtn addTarget:self action:@selector(ruleBtnClick) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+// ruleBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
|
|
|
+// [self.view addSubview:ruleBtn];
|
|
|
+// [ruleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.bottom.mas_equalTo(-80-AdaptTabHeight);
|
|
|
+// //make.width.mas_equalTo(55);
|
|
|
+// make.width.mas_equalTo(130);
|
|
|
+// make.height.mas_equalTo(38);
|
|
|
+// make.right.equalTo(self.view.mas_centerX).offset(-6);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// UIView *lineView = [[UIView alloc] init];
|
|
|
+// [lineView setBackgroundColor:HW999999Color];
|
|
|
+// [self.view addSubview:lineView];
|
|
|
+// [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.centerX.equalTo(self.view.mas_centerX);
|
|
|
+// make.width.mas_equalTo(1);
|
|
|
+// make.height.mas_equalTo(14);
|
|
|
+// make.centerY.equalTo(ruleBtn.mas_centerY);
|
|
|
+// }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 懒加载
|
|
|
+- (UITableView *)tableView{
|
|
|
+ if (!_tableView) {
|
|
|
+ _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
|
|
|
+ _tableView.delegate = self;
|
|
|
+ _tableView.dataSource = self;
|
|
|
+ _tableView.showsVerticalScrollIndicator = NO;
|
|
|
+ _tableView.showsHorizontalScrollIndicator = NO;
|
|
|
+// _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
|
|
|
+ [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
|
|
|
+ [_tableView setSeparatorColor:[UIColor clearColor]];
|
|
|
+ [_tableView setBackgroundColor:[UIColor whiteColor]];
|
|
|
+ _tableView.layer.cornerRadius = 8;
|
|
|
+ _tableView.scrollEnabled = NO;
|
|
|
+ [_tableView setTableFooterView:[UIView new]];
|
|
|
+ [_tableView setBounces:YES];
|
|
|
+
|
|
|
+ if (@available(iOS 15.0, *)) {
|
|
|
+ _tableView.sectionHeaderTopPadding = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return _tableView;
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 列表委托
|
|
|
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
+ return _msgTitleArr.count;
|
|
|
+}
|
|
|
+
|
|
|
+- (baseTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+
|
|
|
+ __block NSInteger row = indexPath.row;
|
|
|
+ static NSString *identifier = @"baseTableViewCell";
|
|
|
+
|
|
|
+ baseTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
+ if (!cell){
|
|
|
+ cell = [[baseTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
+ [cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
|
+
|
|
|
+ cell.showLeftImageType = NO;
|
|
|
+ }
|
|
|
+ //左边标题
|
|
|
+ cell.showRightImageType = NO;
|
|
|
+ if (row < _msgTitleArr.count) {
|
|
|
+ NSString *title = _msgTitleArr[row];
|
|
|
+ cell.titleLabel.text = title;
|
|
|
+
|
|
|
+ if(row == 0 || row ==1){
|
|
|
+ cell.showRightImageType = YES;
|
|
|
+ cell.contentLabel.hidden = YES;
|
|
|
+ }
|
|
|
+ else if(row == 2){
|
|
|
+ NSString *vers = [iPhone appVersion];
|
|
|
+ [cell.contentLabel setText:[NSString stringWithFormat:@"V%@",vers]];
|
|
|
+ }
|
|
|
+ else if(_couldphoneSysInfoMod){
|
|
|
+ cell.contentLabel.hidden = NO;
|
|
|
+ if (row == 3) {
|
|
|
+ cell.contentLabel.text = _couldphoneSysInfoMod.data.hostImgVer;
|
|
|
+ }
|
|
|
+ else if(row == 4) {
|
|
|
+ cell.contentLabel.text = _couldphoneSysInfoMod.data.MyNewVersion;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return cell;
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
+ return 40;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
|
+ return [UIView new];
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
|
+ return 20;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
|
|
|
+{
|
|
|
+ NSInteger row = indexPath.row;
|
|
|
+
|
|
|
+ if(row == 0){
|
|
|
+ [self ruleBtnClick];
|
|
|
+ }
|
|
|
+ else if(row ==1){
|
|
|
+ [self privateBtnClick];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (UIImage *)getAppIcon{
|
|
@@ -335,4 +465,20 @@
|
|
|
_getSysInfo();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+- (void)getCouldPhoneBaseInfoFun:(NSNotification*)not
|
|
|
+{
|
|
|
+ _couldphoneSysInfoMod = [not object];
|
|
|
+ //HLog(@"%@",baseInfoModel);
|
|
|
+
|
|
|
+ if(!_couldphoneSysInfoMod || ![_couldphoneSysInfoMod isKindOfClass:[couldphoneSysInfoModel class]]){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ mainBlock(^{
|
|
|
+ [weakSelf.tableView reloadData];
|
|
|
+ });
|
|
|
+
|
|
|
+}
|
|
|
@end
|