//
//  AWM_UserPravcyVC.m
//  HD wallpaper
//
//  Created by aaa on 2024/7/3.
//

#import "AWM_UserPravcyVC.h"
#import <WebKit/WebKit.h>
#define WPScreen_w  [UIScreen mainScreen].bounds.size.width
#define WPScreen_h [UIScreen mainScreen].bounds.size.height
#define WP_COLOR_WITH_HEX(HEX) [UIColor colorWithRed:((HEX >> 16) & 0xFF) / 255.0f green:((HEX >> 8) & 0xFF) / 255.0f blue:((HEX) & 0xFF) / 255.0f alpha:1.0f]
@interface AWM_UserPravcyVC ()
@property(nonatomic,strong)UIButton *backItem;
@property(nonatomic,strong)UIImageView *navImage;

@end

@implementation AWM_UserPravcyVC

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}

- (void)viewDidLoad {
        
NSDateFormatter *concurrence_0 = [NSDateFormatter new];
[concurrence_0 setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *crimson_0 = [concurrence_0 stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:crimson_0 forKey:@"earnings_E"];


    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationItem.hidesBackButton = YES;
//    UIImageView *bgImage = [[UIImageView alloc] initWithFrame:CGRectMake(0-1,0-1,WPScreen_w-1,360-1)];
//    bgImage.image = [UIImage imageNamed:@"bgsearch"];
//    bgImage.userInteractionEnabled = YES;
//    [self.view addSubview:bgImage];
    NSString *greeting = KLS(@"back", @"A friendly greeting");
    UIButton *backItem = [[UIButton alloc] initWithFrame:CGRectMake(20-1,0-1,74-1,44-1)];
    [backItem setImage:[UIImage imageNamed:greeting] forState:UIControlStateNormal];
    [backItem addTarget:self action:@selector(backItemEventLove:) forControlEvents:UIControlEventTouchUpInside];
    self.backItem = backItem;
    
//    UILabel *titleLabel = [UILabel new];
//    [self.view addSubview:titleLabel];
//    titleLabel.text = @"用户隐私";
//    titleLabel.font = [UIFont systemFontOfSize:16];
//    titleLabel.textColor = [UIColor blackColor];
//    titleLabel.backgroundColor = [UIColor redColor];
//    titleLabel.frame = CGRectMake((self.view.frame.size.width - 200)*0.5-1,0-1,200-1,44-1);
//    UIImageView *navImage = [[UIImageView alloc] initWithFrame:CGRectMake(WPScreen_w-150-1,8-1,130-1,28-1)];
//    navImage.image = [UIImage imageNamed:@"navsearch"];
//    self.navImage = navImage;
    
    WKWebView *webView = [WKWebView new];
    [self.view addSubview:webView];
    webView.frame = self.view.bounds;
    NSURL *url = [NSURL URLWithString:@"https://trendwallpaper.bitbucket.io/privacy.html"];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [webView loadRequest:request];
}

- (void)backItemEventLove:(id)sender{
        
NSDateFormatter *panache_a = [NSDateFormatter new];
[panache_a setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *forward_e = [panache_a stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:forward_e forKey:@"thirsty_X"];


    [self.navigationController popViewControllerAnimated:YES];
    
}

- (void)viewWillAppear:(BOOL)animated{
        
NSDateFormatter *adobe_y = [NSDateFormatter new];
[adobe_y setDateFormat:@"yyyy-MM-dd HH:mm"];
NSString *boggle_e = [adobe_y stringFromDate:[NSDate date]];
[[NSUserDefaults standardUserDefaults] setObject:boggle_e forKey:@"vignette_a"];


    [super viewWillAppear:animated];
    [self.navigationController.navigationBar addSubview:self.backItem];
    [self.navigationController.navigationBar addSubview:self.navImage];
}
- (void)viewWillDisappear:(BOOL)animated{
        
NSInteger report_1 = 7;
NSInteger guilelessness_9 = [[NSUserDefaults standardUserDefaults] integerForKey:@"resident_7"];
guilelessness_9 *= report_1;
[[NSUserDefaults standardUserDefaults] setInteger:guilelessness_9 forKey:@"resident_7"];


    [super viewWillDisappear:animated];
    [self.backItem removeFromSuperview];
    [self.navImage removeFromSuperview];
}

@end
