//
//  KKDealIdPhotoVC.m
//  Open
//
//  Created by qxy on 2021/10/13.
//  Copyright © 2021 QXY . All rights reserved.
//

#import "KKDealIdPhotoVC.h"
#import "KKPictureEditVC.h"
#import "KKCarPictureEditVC.h"
#import "IdPhotoBottom.h"
#import "WebVC.h"
#import "SbPayMini.h"
@interface SbPayMini ()<UINavigationControllerDelegate,UIImagePickerControllerDelegate,IdPhotoBottomDelegate,UIGestureRecognizerDelegate>
@property (nonatomic, assign) NSInteger index;
@property (nonatomic, assign) UIView *navBar;
@property (nonatomic, assign) UIView *centerGroup;
@property (nonatomic, strong)NSArray* bottomArray;
@end

@implementation SbPayMini
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.view.backgroundColor = [UIColor colorWithHex:0xF5F5F5];
    self.title = @"社保缴纳";
    [self navConfig];
    [self bottomView];
}
-(void)bottomView{
    NSString *url = [NSString stringWithFormat:@"%@dynamic/menu/get",[NetworkConfig ipYinShuConfig]];
    NSDictionary *params = @{
        @"configName":@"IdPhotoBottom",
        @"appName":@"kksh",
        @"version":[Tools getVersionCode],
        @"systemType":@"iOS"
    };
    [NetworkRequest Post15:url Params:params Success:^(id _Nonnull objc) {
        NSLog(@"objc:%@",objc);
        if ([objc isKindOfClass:[NSDictionary class]]) {
            NSString *state = [NSString stringWithFormat:@"%@",objc[@"state"]];
            if ([state isEqualToString:@"200"]) {
                if ([objc[@"result"] isKindOfClass:[NSArray class]]) {
                    self.bottomArray = [KKRedPackageClickEventModel mj_objectArrayWithKeyValuesArray:objc[@"result"]];
                    KKRedPackageClickEventModel *model=self.bottomArray[0];
                    //[bottomImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",KKFindPackageIP,model.menuIcon]]];
                }
            }
        }
    } Failure:^(NSError *error) {
        NSLog(@"error:%@",error);
    }];
    
}


- (void)navConfig{
    UIView*navView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, cl_kNavigationBarHeight)];
    navView.backgroundColor = [UIColor whiteColor];
    //返回按钮
    UIButton* backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [backBtn setTitle:@"返回" forState:UIControlStateNormal];
    [backBtn setImage:[UIImage imageNamed:@"blackBack"] forState:UIControlStateNormal];
    [backBtn setTitleColor:[UIColor colorWithHex:0x4d4d4d] forState:UIControlStateNormal];
    backBtn.frame = CGRectMake(10, cl_kStatusBarHeight, 60, 44);
    backBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    [backBtn layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleLeft imageTitleSpace:4];
    [backBtn addTarget:self action:@selector(backClick:) forControlEvents:UIControlEventTouchUpInside];
    
    
    UILabel* lb_title = [UILabel new];
    lb_title.text = @"AI照相馆";
    lb_title.font = [UIFont boldSystemFontOfSize:18];
    lb_title.textAlignment = NSTextAlignmentCenter;
    lb_title.textColor = [UIColor colorWithHex:0x4d4d4d];
    [navView addSubview:backBtn];
    [navView addSubview:lb_title];
    [lb_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(cl_kStatusBarHeight);
        make.centerX.equalTo(navView);
        make.height.offset(44);
    }];
    self.navBar=navView;
    [self.view addSubview:navView];
}








#pragma mark - ViewDelegate 按钮跳转
- (void)IdPhotoBottomWithItem:(NSInteger)item:(KKRedPackageClickEventModel*)model{
    NSLog(@"111111");
    if(model==nil){
        switch (item) {
            case 0:
                //Morecredit
                [[clickEvent instance] clickEventRooterVC:self Content:@"Morecredit" menuName:@"Morecredit"];
                break;
            case 1:
                [[clickEvent instance] clickEventRooterVC:self Content:@"homeThree2" menuName:@"homeThree2"];
                break;
            case 2:
                //homeThree4
                [[clickEvent instance] clickEventRooterVC:self Content:@"homeThree4" menuName:@"homeThree4"];
                break;
            case 3:
                //拼多多 pinduoduoH5
                [[clickEvent instance] clickEventRooterVC:self Content:@"pinduoduoH5" menuName:@"pinduoduoH5"];
                break;
        }
    }else{
        [[clickEvent instance]clickEventNative:self model:model];
    }
}
/*
#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
