al
liurenjie
2021-07-24 4be386d6c552eed17d7e8b2271c81ac65e02cebf
BuWanVideo2.0/SettingController.m
@@ -38,7 +38,7 @@
-(void)loadData{
    self.navigationItem.title = @"设置";
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]};
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor blackColor]};
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[[UIImage imageNamed:@"详情页面返回"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
@@ -47,10 +47,10 @@
    UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem = iconBarItem;
    
    _dataAry  = [[NSMutableArray alloc] initWithObjects:@[@"清空图片缓存"],@[@"手机存储"],@[@"常见问题",@"关于我们",@"免责声明"], nil];
    _dataAry = [[NSMutableArray alloc] initWithObjects:@[@"清空图片缓存"],@[@"手机存储"],@[@"常见问题",@"关于我们",@"免责声明",@"恢复购买"], nil];
    
    if(!_mytableview){
       _mytableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStyleGrouped];
        _mytableview = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, KScreenW, KScreenH) style:UITableViewStyleGrouped];
        _mytableview.delegate = self;
        _mytableview.dataSource = self;
        [self.view addSubview:_mytableview];
@@ -183,17 +183,17 @@
                NSString *str = [NSString stringWithFormat:@"确认清空%.2fM图片缓存!",[self filePath]];
                UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"温馨提示" message:str preferredStyle:UIAlertControllerStyleAlert];
                
                    UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
                        NSLog(@"点击取消");
                    }];
                UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
                    NSLog(@"点击取消");
                }];
                
                    UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                        [self deleteFile];
                    }];
                UIAlertAction *otherAction = [UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
                    [self deleteFile];
                }];
                
                    [alertController addAction:cancelAction];
                    [alertController addAction:otherAction];
                    [self presentViewController:alertController animated:YES completion:nil];
                [alertController addAction:cancelAction];
                [alertController addAction:otherAction];
                [self presentViewController:alertController animated:YES completion:nil];
            }
                break;
        }
@@ -214,9 +214,16 @@
            }
                break;
            case 2:{//免责声明
               settingWebViewController.webTitle=@"免责声明";
                settingWebViewController.webTitle=@"免责声明";
                settingWebViewController.requestURL=mianzeshengming;
                [self.navigationController pushViewController:settingWebViewController animated:YES];
            }
                break;
            case 3:{
                [UIApplication sharedApplication].keyWindow.userInteractionEnabled = NO;
                [SVProgressHUD show];
                [self performSelector:@selector(popTips) withObject:self afterDelay:2];
            }
                break;
            default:
@@ -229,6 +236,12 @@
    }
}
- (void)popTips {
    [SVProgressHUD dismiss];
    [UIApplication sharedApplication].keyWindow.userInteractionEnabled = YES;
    [self autoDisappearAlertTime:1 msg:@"没有找到可恢复购买项"];
}
#pragma mark 删除沙盒里的文件
-(void)deleteFile{
    NSString * cachPath = [ NSSearchPathForDirectoriesInDomains ( NSCachesDirectory , NSUserDomainMask , YES ) firstObject ];