//
//  LookReportPicCell.m
//  redstar
//
//  Created by admin on 16/1/25.
//  Copyright © 2016年 ZWF. All rights reserved.
//

#import "LookReportPicCell.h"

@implementation LookReportPicCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setup];
    }
    return self;
}

#pragma mark - Private Methods
- (void)setup
{
    self.contentView.backgroundColor = kFootViewBackGroundColor;
    
}
- (UIButton *)photoButton1
{
    if (!_photoButton1) {
        _photoButton1 = [[UIButton alloc] init];
        _photoButton1.contentMode = UIViewContentModeScaleAspectFill;
        _photoButton1.clipsToBounds = YES;
        _photoButton1.translatesAutoresizingMaskIntoConstraints = NO;
        [self.contentView addSubview:_photoButton1];
        
        NSLayoutConstraint *overDateTop = [NSLayoutConstraint
                                           constraintWithItem:_photoButton1
                                           attribute:NSLayoutAttributeTop
                                           relatedBy:NSLayoutRelationEqual
                                           toItem:self.contentView
                                           attribute:NSLayoutAttributeTop
                                           multiplier:1.0
                                           constant:5];
        [self.contentView addConstraint:overDateTop];
        
        NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
                                            constraintWithItem:_photoButton1
                                            attribute:NSLayoutAttributeLeft
                                            relatedBy:NSLayoutRelationEqual
                                            toItem:self.contentView
                                            attribute:NSLayoutAttributeLeft
                                            multiplier:1.0
                                            constant:20];
        [self.contentView addConstraint:overDateLeft];
        
        NSLayoutConstraint *overDateRight = [NSLayoutConstraint
                                             constraintWithItem:_photoButton1
                                             attribute:NSLayoutAttributeRight
                                             relatedBy:NSLayoutRelationEqual
                                             toItem:self.contentView
                                             attribute:NSLayoutAttributeRight
                                             multiplier:1.0
                                             constant:-(kScreenWidth / 2 + 10)];
        [self.contentView addConstraint:overDateRight];
        
        NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
                                              constraintWithItem:_photoButton1
                                              attribute:NSLayoutAttributeHeight
                                              relatedBy:NSLayoutRelationEqual
                                              toItem:nil
                                              attribute:NSLayoutAttributeNotAnAttribute
                                              multiplier:1.0
                                              constant:90];
        [self.contentView addConstraint:overDateHeight];
        
        NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
                                              constraintWithItem:_photoButton1
                                              attribute:NSLayoutAttributeBottom
                                              relatedBy:NSLayoutRelationEqual
                                              toItem:self.contentView
                                              attribute:NSLayoutAttributeBottom
                                              multiplier:1.0
                                              constant:-10];
        [self.contentView addConstraint:overDateBottom];
    }
    return _photoButton1;
}

- (UIButton *)photoButton2
{
    if (!_photoButton2) {
        _photoButton2 = [[UIButton alloc] init];
        _photoButton2.translatesAutoresizingMaskIntoConstraints = NO;
        _photoButton1.contentMode = UIViewContentModeScaleAspectFill;
        _photoButton1.clipsToBounds = YES;
        [self.contentView addSubview:_photoButton2];
        
        NSLayoutConstraint *overDateTop = [NSLayoutConstraint
                                           constraintWithItem:_photoButton2
                                           attribute:NSLayoutAttributeTop
                                           relatedBy:NSLayoutRelationEqual
                                           toItem:self.contentView
                                           attribute:NSLayoutAttributeTop
                                           multiplier:1.0
                                           constant:5];
        [self.contentView addConstraint:overDateTop];
        
        NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
                                            constraintWithItem:_photoButton2
                                            attribute:NSLayoutAttributeLeft
                                            relatedBy:NSLayoutRelationEqual
                                            toItem:self.contentView
                                            attribute:NSLayoutAttributeLeft
                                            multiplier:1.0
                                            constant:kScreenWidth / 2 + 10];
        [self.contentView addConstraint:overDateLeft];
        
        NSLayoutConstraint *overDateRight = [NSLayoutConstraint
                                             constraintWithItem:_photoButton2
                                             attribute:NSLayoutAttributeRight
                                             relatedBy:NSLayoutRelationEqual
                                             toItem:self.contentView
                                             attribute:NSLayoutAttributeRight
                                             multiplier:1.0
                                             constant:-20];
        [self.contentView addConstraint:overDateRight];
        
        NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
                                              constraintWithItem:_photoButton2
                                              attribute:NSLayoutAttributeHeight
                                              relatedBy:NSLayoutRelationEqual
                                              toItem:nil
                                              attribute:NSLayoutAttributeNotAnAttribute
                                              multiplier:1.0
                                              constant:90];
        [self.contentView addConstraint:overDateHeight];
        
    }
    return _photoButton2;
}

@end
