//
//  XVGetOrderAlterButtonView.m
//  fastservice
//
//  Created by xuning on 2/27/24.
//  Copyright © 2024 FastService. All rights reserved.
//

#import "XVGetOrderAlterButtonView.h"
@interface XVGetOrderAlterButtonView()

@property (nonatomic, strong) UIButton *leftRefuseButton;
// 抢单
@property (nonatomic, strong) UIButton *orderButton;

@property (nonatomic, strong) UIButton *rightRefuseButton;

@end

@implementation XVGetOrderAlterButtonView



- (instancetype)initWithFrame:(CGRect)frame {
    if(self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
    
    CGFloat x = (SCREEN_WIDTH - 16) / 4;
    
    [self addSubview:self.orderButton];
    [self.orderButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.mas_equalTo(self);
        make.size.mas_equalTo(CGSizeMake(75, 75));
    }];
    
    [self addSubview:self.leftRefuseButton];
    [self.leftRefuseButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.centerX.mas_equalTo(self).mas_offset(-x);
        make.size.mas_equalTo(CGSizeMake(44, 44));
    }];
    
    [self addSubview:self.rightRefuseButton];
    [self.rightRefuseButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.centerX.mas_equalTo(self).mas_offset(x);
        make.size.mas_equalTo(CGSizeMake(44, 44));
    }];
    
    
    self.orderButton.layer.shadowColor = RGBAColor(0, 0, 0, 0.4).CGColor;
    self.orderButton.layer.shadowOffset = CGSizeMake(0,0);
    self.orderButton.layer.shadowOpacity = 0.8f;
    kViewBorderRadius(self.orderButton, 75/2, 1, F_BBBBBB_COLOR);
    
    self.rightRefuseButton.layer.shadowColor = RGBAColor(0, 0, 0, 0.4).CGColor;
    self.rightRefuseButton.layer.shadowOffset = CGSizeMake(0,0);
    self.rightRefuseButton.layer.shadowOpacity = 0.8f;
    kViewBorderRadius(self.rightRefuseButton, 22, 1, F_BBBBBB_COLOR);
    
    self.leftRefuseButton.layer.shadowColor = RGBAColor(0, 0, 0, 0.4).CGColor;
    self.leftRefuseButton.layer.shadowOffset = CGSizeMake(0,0);
    self.leftRefuseButton.layer.shadowOpacity = 0.8f;
    kViewBorderRadius(self.leftRefuseButton, 22, 1, F_BBBBBB_COLOR);
    
}
- (UIButton *)leftRefuseButton {
    if(_leftRefuseButton == nil) {
        _leftRefuseButton = [[UIButton alloc]initWithTitle:@"拒绝" fontSize:14 titleColor:F_101010_COLOR bgColor:[UIColor whiteColor]];
    }
    return _leftRefuseButton;
}

- (UIButton *)orderButton {
    if(_orderButton == nil) {
        _orderButton = [[UIButton alloc]initWithTitle:@"接受\n10S" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
    }
    return _orderButton;
}

- (UIButton *)rightRefuseButton {
    if(_rightRefuseButton == nil) {
        _rightRefuseButton = [[UIButton alloc]initWithTitle:@"拒绝" fontSize:14 titleColor:F_101010_COLOR bgColor:[UIColor whiteColor]];
    }
    return _rightRefuseButton;
}

@end
