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

#import "XVOrderSettingView.h"

@interface XVOrderSettingView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UISwitch *switchView;

@end

@implementation XVOrderSettingView

- (instancetype)initWithTitle:(NSString *)title {
    if(self = [super init]) {
        self.backgroundColor = [UIColor whiteColor];
        self.titleLabel.text = title;
        [self addSubview:self.titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self).mas_offset(13);
            make.left.mas_equalTo(self).mas_offset(15);
        }];
        
        [self addSubview:self.switchView];
        [self.switchView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.centerY.mas_equalTo(self);
            make.right.mas_equalTo(self).mas_offset(-15);
            
        }];
        
    }
    return self;
}

- (UILabel *)titleLabel {
    if(_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_606060_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:14];
    }
    return _titleLabel;
}

- (UISwitch *)switchView {
    if(_switchView == nil) {
        _switchView = [[UISwitch alloc]init];
        _switchView.onTintColor = COLOR_THEMEGRENN;
        _switchView.tintColor = BB_3_COLOR;
    }
    return _switchView;
}

@end
