//
//  GMSkinGuidancePopView.m
//  Gengmei
//
//  Created by 刘鹿杰 on 2019/8/16.
//  Copyright © 2019 更美互动信息科技有限公司. All rights reserved.
//

#import "GMSkinGuidancePopView.h"

@implementation GMSkinGuidancePopView

-(void)setup{
    [super setup];
    self.animationType = GMPopupAnimationTypeFade;
    // 设置 container
    self.container.backgroundColor = [UIColor colorWithHex:000000 alpha:0.5];// [UIColor clearColor];
    [self.container mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self);
    }];
    // imageView
    GMImageView *imageView = [[GMImageView alloc] initWithImage:[UIImage imageNamed:@"face_skin_lead"]];
    [self.container addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.container.mas_right).offset(-4);
        make.top.mas_equalTo(OCNavigationBar.barHeight + 25);
    }];
    // imageView1
    UIImage *image1 = [UIImage imageNamed:@"face_skin_lead1"];
    GMImageView *imageView1 = [[GMImageView alloc] initWithImage:image1];
    [self.container addSubview:imageView1];
    CGFloat left = MAINSCREEN_WIDTH * 0.25 - image1.size.width / 2 - 12;
    [imageView1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(left);
        make.bottom.mas_equalTo(- (54 + UIView.safeAreaInsetsBottom));
    }];
    // 添加点击效果
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hideView)];
    [self addGestureRecognizer:tap];
}


- (void)hideView {
    [self hide];
    if (self.guidanceDelegate && [self.guidanceDelegate respondsToSelector:@selector(guidanceBtnClosePopView)]) {
        [self.guidanceDelegate guidanceBtnClosePopView];
    }
}

@end
