// // AboutViewController.m // watch // // Created by xTT on 2017/7/13. // Copyright © 2017年 xTT. All rights reserved. // #import "AboutViewController.h" #import "WebViewController.h" @interface AboutViewController () @end @implementation AboutViewController @synthesize myDataSource = _myDataSource; -(NSMutableArray *)myDataSource{ if(!_myDataSource){ _myDataSource = [NSMutableArray arrayWithArray:@[@[@"用户协议",@"隐私政策",@"意见反馈"]]]; } return _myDataSource; } - (void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; // self.zx_enableAdjustNavContainerAll = YES; self.view.frame = CGRectMake(0, iPhoneX_NavHeight, ScreenWidth, ScreenHeight-iPhoneX_NavHeight); } - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.title = @"关于我们"; // self.extendedLayoutIncludesOpaqueBars = YES; NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; // app版本 NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; //获取供应商资料 // NSDictionary *supplierConfigDic = [UserDefaults objectForKey:kSupplierConfigKey]; // NSString *iconURLStr = supplierConfigDic[@"icon"]; // NSString *appName = supplierConfigDic[@"name"]; // int type = [supplierConfigDic[@"type"] intValue]; // if(type != 0){ // self.label_version.text = [NSString stringWithFormat:@"%@ (V%@)",appName,app_Version]; // [self.IconImageVieww sd_setImageWithURL:[NSURL URLWithString:iconURLStr]]; // }else{ NSString *icon = [[infoDictionary valueForKeyPath:@"CFBundleIcons.CFBundlePrimaryIcon.CFBundleIconFiles"] lastObject]; self.label_version.text = [NSString stringWithFormat:@"%@ (V%@)",APPName,app_Version]; self.IconImageVieww.image = [UIImage imageNamed:icon]; // } //不要滑动 self.myTableView.scrollEnabled = NO; self.view.backgroundColor = tabViewBG; self.IconImageVieww.layer.cornerRadius = 10; self.IconImageVieww.layer.masksToBounds = YES; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ // NSString *title = self.myDataSource[indexPath.section][indexPath.row]; return 49; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *title = self.myDataSource[indexPath.section][indexPath.row]; if ([title isEqualToString:@"意见反馈"]) { // [self performSegueWithIdentifier:@"goFeedbackVC" sender:nil]; //跳转到对应的邮箱 /* support@ecellsz.com 主题:APPName意见反馈 */ NSString *string = [NSString stringWithFormat:@"mailto://support@ecellsz.com?subject=%@意见反馈",APPName]; string = [string stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *emailURL = [NSURL URLWithString:string]; if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) { [[UIApplication sharedApplication] openURL:emailURL options:[NSDictionary new] completionHandler:nil]; }else{ [[UIApplication sharedApplication] openURL:emailURL]; } }else if ([title isEqualToString:@"用户协议"]){ WebViewController *webVC = [WebViewController new]; webVC.title = @"用户服务协议";; webVC.url = AccoutXieYiURLStr; [self.navigationController pushViewController:webVC animated:YES]; }else if ([title isEqualToString:@"隐私政策"]){ WebViewController *vc = [[WebViewController alloc] init]; vc.url = PrivacyPolicyURLStr; vc.title = @"隐私政策"; [self.navigationController pushViewController:vc animated:YES]; } } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } /* #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