Commit 15ec20e9 by xuning

新任务

parent ded58319
...@@ -20,6 +20,10 @@ ...@@ -20,6 +20,10 @@
7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAEF2B6FC07800F357E7 /* XVCategoryTitleCellModel.m */; }; 7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAEF2B6FC07800F357E7 /* XVCategoryTitleCellModel.m */; };
7981EAF32B6FC08F00F357E7 /* XVCategoryTitleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAF22B6FC08F00F357E7 /* XVCategoryTitleCell.m */; }; 7981EAF32B6FC08F00F357E7 /* XVCategoryTitleCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAF22B6FC08F00F357E7 /* XVCategoryTitleCell.m */; };
7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */; }; 7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */; };
7981EAF92B71205A00F357E7 /* XVJobStatusToolView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAF82B71205A00F357E7 /* XVJobStatusToolView.m */; };
7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAFB2B71272D00F357E7 /* XVNewJobViewCell.m */; };
7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EAFE2B712CC700F357E7 /* HBLockSliderView.m */; };
7981EB042B7273B500F357E7 /* XVPersonalViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7981EB032B7273B500F357E7 /* XVPersonalViewController.m */; };
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.m */; }; 799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 799DF0C52B6BD8AF00680907 /* AppDelegate.m */; };
799DF0D12B6BD8B100680907 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D02B6BD8B100680907 /* Assets.xcassets */; }; 799DF0D12B6BD8B100680907 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D02B6BD8B100680907 /* Assets.xcassets */; };
799DF0D42B6BD8B100680907 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D22B6BD8B100680907 /* LaunchScreen.storyboard */; }; 799DF0D42B6BD8B100680907 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 799DF0D22B6BD8B100680907 /* LaunchScreen.storyboard */; };
...@@ -68,6 +72,14 @@ ...@@ -68,6 +72,14 @@
7981EAF22B6FC08F00F357E7 /* XVCategoryTitleCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVCategoryTitleCell.m; sourceTree = "<group>"; }; 7981EAF22B6FC08F00F357E7 /* XVCategoryTitleCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVCategoryTitleCell.m; sourceTree = "<group>"; };
7981EAF42B6FD62200F357E7 /* XVOrderSortView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSortView.h; sourceTree = "<group>"; }; 7981EAF42B6FD62200F357E7 /* XVOrderSortView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSortView.h; sourceTree = "<group>"; };
7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderSortView.m; sourceTree = "<group>"; }; 7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderSortView.m; sourceTree = "<group>"; };
7981EAF72B71205A00F357E7 /* XVJobStatusToolView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVJobStatusToolView.h; sourceTree = "<group>"; };
7981EAF82B71205A00F357E7 /* XVJobStatusToolView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVJobStatusToolView.m; sourceTree = "<group>"; };
7981EAFA2B71272D00F357E7 /* XVNewJobViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVNewJobViewCell.h; sourceTree = "<group>"; };
7981EAFB2B71272D00F357E7 /* XVNewJobViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVNewJobViewCell.m; sourceTree = "<group>"; };
7981EAFD2B712CC700F357E7 /* HBLockSliderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HBLockSliderView.h; sourceTree = "<group>"; };
7981EAFE2B712CC700F357E7 /* HBLockSliderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HBLockSliderView.m; sourceTree = "<group>"; };
7981EB022B7273B500F357E7 /* XVPersonalViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVPersonalViewController.h; sourceTree = "<group>"; };
7981EB032B7273B500F357E7 /* XVPersonalViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVPersonalViewController.m; sourceTree = "<group>"; };
799DF0C12B6BD8AF00680907 /* fastservice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fastservice.app; sourceTree = BUILT_PRODUCTS_DIR; }; 799DF0C12B6BD8AF00680907 /* fastservice.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = fastservice.app; sourceTree = BUILT_PRODUCTS_DIR; };
799DF0C42B6BD8AF00680907 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; 799DF0C42B6BD8AF00680907 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
799DF0C52B6BD8AF00680907 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; }; 799DF0C52B6BD8AF00680907 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
...@@ -154,10 +166,16 @@ ...@@ -154,10 +166,16 @@
7981EAD02B6F655500F357E7 /* View */ = { 7981EAD02B6F655500F357E7 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7981EAFD2B712CC700F357E7 /* HBLockSliderView.h */,
7981EAFE2B712CC700F357E7 /* HBLockSliderView.m */,
7981EAD12B6F656900F357E7 /* XVCustomBarView.h */, 7981EAD12B6F656900F357E7 /* XVCustomBarView.h */,
7981EAD22B6F656900F357E7 /* XVCustomBarView.m */, 7981EAD22B6F656900F357E7 /* XVCustomBarView.m */,
7981EAF42B6FD62200F357E7 /* XVOrderSortView.h */, 7981EAF42B6FD62200F357E7 /* XVOrderSortView.h */,
7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */, 7981EAF52B6FD62200F357E7 /* XVOrderSortView.m */,
7981EAF72B71205A00F357E7 /* XVJobStatusToolView.h */,
7981EAF82B71205A00F357E7 /* XVJobStatusToolView.m */,
7981EAFA2B71272D00F357E7 /* XVNewJobViewCell.h */,
7981EAFB2B71272D00F357E7 /* XVNewJobViewCell.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -175,6 +193,23 @@ ...@@ -175,6 +193,23 @@
path = CustomCategoryView; path = CustomCategoryView;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
7981EB002B72739300F357E7 /* Personal */ = {
isa = PBXGroup;
children = (
7981EB012B72739D00F357E7 /* Controller */,
);
path = Personal;
sourceTree = "<group>";
};
7981EB012B72739D00F357E7 /* Controller */ = {
isa = PBXGroup;
children = (
7981EB022B7273B500F357E7 /* XVPersonalViewController.h */,
7981EB032B7273B500F357E7 /* XVPersonalViewController.m */,
);
path = Controller;
sourceTree = "<group>";
};
799DF0B82B6BD8AE00680907 = { 799DF0B82B6BD8AE00680907 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -196,6 +231,7 @@ ...@@ -196,6 +231,7 @@
799DF0C32B6BD8AF00680907 /* fastservice */ = { 799DF0C32B6BD8AF00680907 /* fastservice */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7981EB002B72739300F357E7 /* Personal */,
7981EACB2B6F635F00F357E7 /* Main */, 7981EACB2B6F635F00F357E7 /* Main */,
799DF1162B6D2B1300680907 /* Login */, 799DF1162B6D2B1300680907 /* Login */,
799DF0F12B6BDA1400680907 /* Base */, 799DF0F12B6BDA1400680907 /* Base */,
...@@ -491,11 +527,15 @@ ...@@ -491,11 +527,15 @@
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */, 799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */, 7981EAF02B6FC07800F357E7 /* XVCategoryTitleCellModel.m in Sources */,
799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */, 799DF0F82B6BDA1400680907 /* NSString+Unicode.m in Sources */,
7981EAFF2B712CC700F357E7 /* HBLockSliderView.m in Sources */,
7981EAF92B71205A00F357E7 /* XVJobStatusToolView.m in Sources */,
799DF0D72B6BD8B100680907 /* main.m in Sources */, 799DF0D72B6BD8B100680907 /* main.m in Sources */,
7981EB042B7273B500F357E7 /* XVPersonalViewController.m in Sources */,
7981EAF32B6FC08F00F357E7 /* XVCategoryTitleCell.m in Sources */, 7981EAF32B6FC08F00F357E7 /* XVCategoryTitleCell.m in Sources */,
7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */, 7981EAF62B6FD62200F357E7 /* XVOrderSortView.m in Sources */,
7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */, 7981EAC42B6E800900F357E7 /* XVInputFieldView.m in Sources */,
7981EAD92B6FB53E00F357E7 /* XVNewJobViewController.m in Sources */, 7981EAD92B6FB53E00F357E7 /* XVNewJobViewController.m in Sources */,
7981EAFC2B71272D00F357E7 /* XVNewJobViewCell.m in Sources */,
799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */, 799DF11A2B6D2B3200680907 /* XVLoginViewController.m in Sources */,
7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */, 7981EAED2B6FC05B00F357E7 /* XVCategoryTitleView.m in Sources */,
799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */, 799DF0FB2B6BDA1400680907 /* WRNavigationBar.m in Sources */,
......
{
"images" : [
{
"filename" : "huadong.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "huadong@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "huadong@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "if-settings@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "new_order@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "闹钟@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -58,6 +58,8 @@ ...@@ -58,6 +58,8 @@
_tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR; _tableView.backgroundColor = DEFAULT_BACKGROUND_COLOR;
_tableView.rowHeight = UITableViewAutomaticDimension; _tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100; _tableView.estimatedRowHeight = 100;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
} }
return _tableView; return _tableView;
} }
......
...@@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -71,7 +71,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface UIButton (XVAdd) @interface UIButton (XVAdd)
@property (nonatomic, assign) NSTimeInterval cs_acceptEventInterval; // 可以用这个给重复点击加间隔
/** /**
自定义响应边界 UIEdgeInsetsMake(-3, -4, -5, -6). 表示扩大 自定义响应边界 UIEdgeInsetsMake(-3, -4, -5, -6). 表示扩大
例如: self.btn.hitEdgeInsets = UIEdgeInsetsMake(-3, -4, -5, -6); 例如: self.btn.hitEdgeInsets = UIEdgeInsetsMake(-3, -4, -5, -6);
......
...@@ -12,7 +12,7 @@ static const char * kHitEdgeInsets = "hitEdgeInsets"; ...@@ -12,7 +12,7 @@ static const char * kHitEdgeInsets = "hitEdgeInsets";
static const char * kHitScale = "hitScale"; static const char * kHitScale = "hitScale";
static const char * kHitWidthScale = "hitWidthScale"; static const char * kHitWidthScale = "hitWidthScale";
static const char * kHitHeightScale = "hitHeightScale"; static const char * kHitHeightScale = "hitHeightScale";
static const char *UIControl_acceptEventInterval = "UIControl_acceptEventInterval";
@implementation UIView (XVAdd) @implementation UIView (XVAdd)
#pragma mark - 设置部分圆角 #pragma mark - 设置部分圆角
/** /**
...@@ -106,6 +106,69 @@ static const char * kHitHeightScale = "hitHeightScale"; ...@@ -106,6 +106,69 @@ static const char * kHitHeightScale = "hitHeightScale";
@implementation UIButton (XVAdd) @implementation UIButton (XVAdd)
// 在load时执行hook
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class class = [self class];
//分别获取
SEL beforeSelector = @selector(sendAction:to:forEvent:);
SEL afterSelector = @selector(cs_sendAction:to:forEvent:);
Method beforeMethod = class_getInstanceMethod(class, beforeSelector);
Method afterMethod = class_getInstanceMethod(class, afterSelector);
//先尝试给原来的方法添加实现,如果原来的方法不存在就可以添加成功。返回为YES,否则
//返回为NO。
//UIButton 真的没有sendAction方法的实现,这是继承了UIControl的而已,UIControl才真正的实现了。
BOOL didAddMethod =
class_addMethod(class,
beforeSelector,
method_getImplementation(afterMethod),
method_getTypeEncoding(afterMethod));
NSLog(@"%d",didAddMethod);
if (didAddMethod) {
// 如果之前不存在,但是添加成功了,此时添加成功的是cs_sendAction方法的实现
// 这里只需要方法替换
class_replaceMethod(class,
afterSelector,
method_getImplementation(beforeMethod),
method_getTypeEncoding(beforeMethod));
} else {
//本来如果存在就进行交换
method_exchangeImplementations(afterMethod, beforeMethod);
}
});
}
- (void)cs_sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event {
if ([NSDate date].timeIntervalSince1970 - self.cs_acceptEventTime < self.cs_acceptEventInterval) {
return;
}
if (self.cs_acceptEventInterval > 0) {
self.cs_acceptEventTime = [NSDate date].timeIntervalSince1970;
}
[self cs_sendAction:action to:target forEvent:event];
}
- (NSTimeInterval)cs_acceptEventInterval {
return [objc_getAssociatedObject(self, UIControl_acceptEventInterval) doubleValue];
}
- (void)setCs_acceptEventInterval:(NSTimeInterval)cs_acceptEventInterval {
objc_setAssociatedObject(self, UIControl_acceptEventInterval, @(cs_acceptEventInterval), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
static const char *UIControl_acceptEventTime = "UIControl_acceptEventTime";
- (NSTimeInterval)cs_acceptEventTime {
return [objc_getAssociatedObject(self, UIControl_acceptEventTime) doubleValue];
}
- (void)setCs_acceptEventTime:(NSTimeInterval)cs_acceptEventTime {
objc_setAssociatedObject(self, UIControl_acceptEventTime, @(cs_acceptEventTime), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (void)setHighlighted:(BOOL)highlighted { - (void)setHighlighted:(BOOL)highlighted {
} }
......
...@@ -7,9 +7,16 @@ ...@@ -7,9 +7,16 @@
// //
#import "XVNewJobViewController.h" #import "XVNewJobViewController.h"
#import "XVJobStatusToolView.h"
#import "XVNewJobViewCell.h"
@interface XVNewJobViewController ()<UITextFieldDelegate> @interface XVNewJobViewController ()<UITextFieldDelegate>
@property (nonatomic, strong) UITextField *searchField; @property (nonatomic, strong) UITextField *searchField;
@property (nonatomic, strong) XVJobStatusToolView *toolView;
@end @end
@implementation XVNewJobViewController @implementation XVNewJobViewController
...@@ -23,8 +30,62 @@ ...@@ -23,8 +30,62 @@
} }
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[[NSUserDefaults standardUserDefaults] setValue:@(YES) forKey:@"_UIConstraintBasedLayoutLogUnsatisfiable"];
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 100;
self.tableView.estimatedSectionFooterHeight = 0;
self.tableView.estimatedSectionHeaderHeight = 0;
[self.tableView registerClass:[XVNewJobViewCell class] forCellReuseIdentifier:@"XVNewJobViewCell"];
[self setupUI];
}
- (void)setupUI {
[self.view addSubview:self.searchField];
[self.searchField mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view).mas_offset(6);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH-24);
make.height.mas_equalTo(35);
}];
[self.view addSubview:self.toolView];
[self.toolView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.view);
make.centerX.mas_equalTo(self.view);
make.width.mas_equalTo(SCREEN_WIDTH);
make.height.mas_equalTo(61 + KiPhoneXSafeAreaDValue);
}];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view).mas_offset(51);
make.left.right.mas_equalTo(self.view);
make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).mas_offset(-61);
}];
}
#pragma mark - TableViewDelegate & Datasource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return 10;
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
XVNewJobViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"XVNewJobViewCell"];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}
- (void)textFieldDidChange:(UITextField *)textField {
self.view.backgroundColor = kRandomColor;
} }
- (UITextField *)searchField { - (UITextField *)searchField {
...@@ -42,13 +103,18 @@ ...@@ -42,13 +103,18 @@
_searchField.returnKeyType = UIReturnKeySearch; _searchField.returnKeyType = UIReturnKeySearch;
_searchField.clearButtonMode = UITextFieldViewModeAlways; _searchField.clearButtonMode = UITextFieldViewModeAlways;
[_searchField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged]; [_searchField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
kViewBorderRadius(self.searchField, 35/2, 0, [UIColor clearColor]); kViewBorderRadius(self.searchField, 35/2, 0, [UIColor clearColor]);
} }
return _searchField; return _searchField;
} }
- (XVJobStatusToolView *)toolView {
if(_toolView == nil) {
_toolView = [[XVJobStatusToolView alloc]init];
_toolView.backgroundColor = [UIColor colorWithHexString:@"#EEEEEE"];
}
return _toolView;
}
@end @end
//
// HBLockSliderView.h
// MySliderDemo
//
// Created by 屌炸天 on 16/9/18.
// Copyright © 2016年 yhb. All rights reserved.
//
#import <UIKit/UIKit.h>
@class HBLockSliderView;
@protocol HBLockSliderDelegate <NSObject>
@optional
- (void)sliderValueChanging:(HBLockSliderView *)slider;
- (void)sliderEndValueChanged:(HBLockSliderView *)slider;
@end
@interface HBLockSliderView : UIView
@property (nonatomic, assign) CGFloat value;
@property (nonatomic, copy) NSString *text;
@property (nonatomic, strong)UIFont *font;
@property (nonatomic,strong) UIImage *thumbImage;
@property (nonatomic,strong) UIImage *finishImage;
@property (nonatomic, assign) BOOL thumbHidden;
/**
* 拖动后是否返回
*/
@property (nonatomic,assign) BOOL thumbBack;
@property (nonatomic, weak) id<HBLockSliderDelegate> delegate;
/**
* 设置滑动条进度
* value取值0~1
*/
- (void)setSliderValue:(CGFloat)value;
/**
* 动画设置滑动条进度
*/
- (void)setSliderValue:(CGFloat)value animation:(BOOL)animation completion:(void(^)(BOOL finish))completion;
/**
* 设置滑动条颜色
*
* @param backgroud 背景色
* @param foreground 前景色
* @param thumb 滑动控件颜色
* @param border 边框色
*/
- (void)setColorForBackgroud:(UIColor *)backgroud foreground:(UIColor *)foreground thumb:(UIColor *)thumb border:(UIColor *)border textColor:(UIColor *)textColor;
/**
* 设置滑动控件的起始图片和完成图片(可选)
*
* @param beginImage 启始图片
* @param endImage 完成图片
*/
- (void)setThumbBeginImage:(UIImage *)beginImage finishImage:(UIImage *)finishImage;
/**
* 移除圆角和边框
*/
- (void)removeRoundCorners:(BOOL)corners border:(BOOL)border;
- (void)setRoundCorners:(CGFloat)corners;
@end
//
// HBLockSliderView.m
// MySliderDemo
//
// Created by 屌炸天 on 16/9/18.
// Copyright © 2016年 yhb. All rights reserved.
//
#define kSliderW self.bounds.size.width
#define kSliderH self.bounds.size.height
#define kCornerRadius 22 //默认圆角为5
#define kBorderWidth 0 //默认边框为2
#define kAnimationSpeed 0.5 //默认动画移速
#define kForegroundColor [UIColor colorWithRed:78.0/255 green:185.0/255 blue:123.0/255 alpha:1] //默认滑过颜色
#define kBackgroundColor [UIColor colorWithRed:78.0/255 green:185.0/255 blue:123.0/255 alpha:0.2] //默认未滑过颜色
#define kThumbColor [UIColor colorWithRed:255 green:255 blue:255 alpha:1] //默认Thumb颜色
#define kBorderColor [UIColor blackColor] //默认边框颜色
#define kThumbW 30 //默认的thumb的宽度
#import "HBLockSliderView.h"
@interface HBLockSliderView () {
UILabel *_label;
UIImageView *_thumbImageView;
UIView *_foregroundView;
UIView *_touchView;
UIView *_progressView;
}
@end
@implementation HBLockSliderView
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder{
if (self = [super initWithCoder:aDecoder]) {
[self setupUI];
}
return self;
}
- (void)setupUI{
_label = [[UILabel alloc] initWithFrame:self.bounds];
_label.textAlignment = NSTextAlignmentCenter;
_label.font = [UIFont systemFontOfSize:16];
_foregroundView = [[UIView alloc] init];
[self addSubview:_foregroundView];
_progressView = [[UIView alloc]initWithFrame:CGRectZero];
_progressView.layer.cornerRadius = kCornerRadius;
_progressView.layer.masksToBounds = YES;
_progressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
[self addSubview:_progressView];
_thumbImageView = [[UIImageView alloc] initWithFrame:CGRectZero];
_thumbImageView.layer.cornerRadius = kCornerRadius;
_thumbImageView.layer.masksToBounds = YES;
_thumbImageView.userInteractionEnabled = YES;
[self addSubview:_thumbImageView];
self.layer.cornerRadius = kCornerRadius;
self.layer.masksToBounds = YES;
self.layer.borderWidth = kBorderWidth;
[self setSliderValue:0.0];
//默认配置
self.thumbBack = YES;
self.backgroundColor = kBackgroundColor;
_foregroundView.backgroundColor = kForegroundColor;
_thumbImageView.backgroundColor = kThumbColor;
[self.layer setBorderColor:kBorderColor.CGColor];
_touchView = _thumbImageView;
}
#pragma mark - Public
- (void)setText:(NSString *)text{
_text = text;
_label.text = text;
if (!_label.superview) {
[self insertSubview:_label atIndex:1];
}
}
- (void)setFont:(UIFont *)font{
_font = font;
_label.font = font;
}
- (void)setSliderValue:(CGFloat)value{
[self setSliderValue:value animation:NO completion:nil];
}
- (void)setSliderValue:(CGFloat)value animation:(BOOL)animation completion:(void (^)(BOOL))completion{
if (value > 1) {
value = 1;
}
if (value < 1) {
value = 0;
}
CGPoint point = CGPointMake(value * kSliderW, 0);
typeof(self) weakSelf = self;
if (animation) {
[UIView animateWithDuration:kAnimationSpeed animations:^{
[weakSelf fillForeGroundViewWithPoint:point];
} completion:^(BOOL finished) {
if (completion) {
completion(finished);
}
}];
} else {
[self fillForeGroundViewWithPoint:point];
}
}
- (void)setColorForBackgroud:(UIColor *)backgroud foreground:(UIColor *)foreground thumb:(UIColor *)thumb border:(UIColor *)border textColor:(UIColor *)textColor{
self.backgroundColor = backgroud;
_foregroundView.backgroundColor = foreground;
_thumbImageView.backgroundColor = thumb;
[self.layer setBorderColor:border.CGColor];
_label.textColor = textColor;
}
- (void)setThumbImage:(UIImage *)thumbImage{
_thumbImage = thumbImage;
_thumbImageView.image = thumbImage ;
// _thumbImageView.image = [self imageAddCornerWithImage:thumbImage Radius:kCornerRadius andSize:thumbImage.size];
// [_thumbImageView sizeToFit];
[self setSliderValue:0.0];
}
- (void)setThumbBeginImage:(UIImage *)beginImage finishImage:(UIImage *)finishImage{
self.thumbImage = beginImage;
self.finishImage = finishImage;
}
- (void)removeRoundCorners:(BOOL)corners border:(BOOL)border{
if (corners) {
self.layer.cornerRadius = 0.0;
self.layer.masksToBounds = NO;
_thumbImageView.layer.cornerRadius = 0.0;
_thumbImageView.layer.masksToBounds = NO;
}
if (border) {
[self.layer setBorderWidth:0.0];
}
}
- (void)setRoundCorners:(CGFloat)corners {
self.layer.cornerRadius = corners;
self.layer.masksToBounds = YES;
_thumbImageView.layer.cornerRadius = corners;
_thumbImageView.layer.masksToBounds = YES;
_progressView.layer.cornerRadius = corners;
_progressView.layer.masksToBounds = YES;
}
- (void)setThumbHidden:(BOOL)thumbHidden{
_thumbHidden = thumbHidden;
_touchView = thumbHidden ? self : _thumbImageView;
_thumbImageView.hidden = thumbHidden;
}
#pragma mark - Private
- (void)fillForeGroundViewWithPoint:(CGPoint)point{
// CGFloat thunmbW = self.thumbImage ? self.thumbImage.size.width : kThumbW;
CGPoint p = point;
//修正
p.x += kSliderH/2;
if (p.x > kSliderW) {
p.x = kSliderW;
}
if (p.x < 0) {
p.x = 0;
}
if (self.finishImage) {
_thumbImageView.image = point.x < (kSliderW - kSliderH/2) ? self.thumbImage : self.finishImage;
}
self.value = p.x / kSliderW;
_foregroundView.frame = CGRectMake(0, 0, point.x, kSliderH);
_progressView.frame = CGRectMake(0, 0, point.x, kSliderH);
if (_foregroundView.frame.size.width <= 0) {
_thumbImageView.frame = CGRectMake(0, kBorderWidth, kSliderH, _foregroundView.frame.size.height- kBorderWidth);
}else if (_foregroundView.frame.size.width >= kSliderW) {
_thumbImageView.frame = CGRectMake(_foregroundView.frame.size.width - kSliderH, kBorderWidth, kSliderH, _foregroundView.frame.size.height - 2 * kBorderWidth );
}else{
_thumbImageView.frame = CGRectMake(_foregroundView.frame.size.width-kSliderH/2, kBorderWidth, kSliderH, _foregroundView.frame.size.height-kBorderWidth*2);
}
}
#pragma mark - optimize(TODO)
- (UIImage *)imageAddCornerWithImage:(UIImage *)image Radius:(CGFloat)radius andSize:(CGSize)size{
CGRect rect = CGRectMake(0, 0, size.width, size.height);
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
CGContextRef ctx = UIGraphicsGetCurrentContext();
UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:rect byRoundingCorners:UIRectCornerAllCorners cornerRadii:CGSizeMake(radius, radius)];
CGContextAddPath(ctx,path.CGPath);
CGContextClip(ctx);
// CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor);
[image drawInRect:rect];
CGContextDrawPath(ctx, kCGPathFillStroke);
UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
- (UIImage *)drawRoundedCornerImageWithSize:(CGSize)size radius:(CGFloat)radius borderWidth:(CGFloat)borderWidth backgroundColor:(UIColor *)backgroundColor borderColor:(UIColor *)borderColor{
UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(ctx, borderWidth);
CGContextSetStrokeColorWithColor(ctx, borderColor.CGColor);
CGContextSetFillColorWithColor(ctx, backgroundColor.CGColor);
CGFloat halfBorderWidth = borderWidth * 0.5;
CGContextMoveToPoint(ctx, size.width - halfBorderWidth, radius + halfBorderWidth); // 开始坐标右边开始
CGContextAddArcToPoint(ctx, size.width - halfBorderWidth, size.height - halfBorderWidth, size.width - radius - halfBorderWidth, size.height - halfBorderWidth, radius); // 右下角角度
CGContextAddArcToPoint(ctx, halfBorderWidth, size.height - halfBorderWidth, halfBorderWidth, size.height - radius - halfBorderWidth, radius); // 左下角角度
CGContextAddArcToPoint(ctx, halfBorderWidth, halfBorderWidth, size.width - halfBorderWidth, halfBorderWidth, radius); // 左上角
CGContextAddArcToPoint(ctx, size.width - halfBorderWidth, halfBorderWidth, size.width - halfBorderWidth, radius + halfBorderWidth, radius); // 右上角
CGContextDrawPath(ctx, kCGPathFillStroke);
UIImage * newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
#pragma mark - Touch
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if ( _touchView == _thumbImageView) {
return;
}
CGPoint point = [touch locationInView:self];
// DebugLog(@"%f",point.x);
[self fillForeGroundViewWithPoint:point];
}
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if (touch.view != _touchView) {
// return;
}
CGPoint point = [touch locationInView:self];
// DebugLog(@"=======%f",point.x);
[self fillForeGroundViewWithPoint:point];
if ([self.delegate respondsToSelector:@selector(sliderValueChanging:)] ) {
[self.delegate sliderValueChanging:self];
}
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
if (touch.view != _touchView) {
// return;
}
CGPoint __block point = [touch locationInView:self];
if ([self.delegate respondsToSelector:@selector(sliderEndValueChanged:)]) {
[self.delegate sliderEndValueChanged:self];
}
typeof(self) weakSelf = self;
if (_thumbBack) {
//回到原点
[UIView animateWithDuration:0.5 animations:^{
point.x = 0;
[weakSelf fillForeGroundViewWithPoint:point];
}];
}
// [[NSNotificationCenter defaultCenter] postNotificationName:kAppGetOrderSuccess object:@NO];
}
@end
//
// XVJobStatusToolView.h
// fastservice
//
// Created by xuning on 2/5/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVJobStatusToolView : UIView
@end
NS_ASSUME_NONNULL_END
//
// XVJobStatusToolView.m
// fastservice
//
// Created by xuning on 2/5/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVJobStatusToolView.h"
@interface XVJobStatusToolView()
@property (nonatomic, strong) UIButton *settingButton;
@property (nonatomic, strong) UIButton *statusButton;
@end
@implementation XVJobStatusToolView
- (instancetype)initWithFrame:(CGRect)frame {
if(self = [super initWithFrame:frame]) {
[self setupUI];
}
return self;
}
- (void)setupUI {
[self addSubview:self.settingButton];
self.settingButton.frame = CGRectMake(22, 11, 48, 39);
[self.settingButton setTitleEdgeInsets:
UIEdgeInsetsMake(self.settingButton.frame.size.height/2,
(self.settingButton.frame.size.width-self.settingButton.titleLabel.intrinsicContentSize.width)/2-self.settingButton.imageView.frame.size.width,
0,
(self.settingButton.frame.size.width-self.settingButton.titleLabel.intrinsicContentSize.width)/2)];
[self.settingButton setImageEdgeInsets:
UIEdgeInsetsMake(
0,
(self.settingButton.frame.size.width-self.settingButton.imageView.frame.size.width)/2,
self.settingButton.titleLabel.intrinsicContentSize.height,
(self.settingButton.frame.size.width-self.settingButton.imageView.frame.size.width)/2)];
[self addSubview:self.statusButton];
[self.statusButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).mas_offset(90);
make.right.mas_equalTo(self).mas_offset(-11);
make.top.mas_equalTo(self).mas_offset(11);
make.height.mas_equalTo(39);
}];
kViewBorderRadius(self.statusButton, 4, 0, COLOR_THEMEGRENN);
}
- (UIButton *)settingButton {
if(_settingButton == nil) {
_settingButton = [[UIButton alloc]initWithTitle:@"接单设置" fontSize:12 titleColor:F_415058_COLOR normalImageName:@"if-settings" selectedImgName:@"if-settings" backgroundColor:nil];
}
return _settingButton;
}
- (UIButton *)statusButton {
if(_statusButton == nil) {
_statusButton = [[UIButton alloc]initWithTitle:@"上线" fontSize:14 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
}
return _statusButton;
}
@end
//
// XVNewJobViewCell.h
// fastservice
//
// Created by xuning on 2/5/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVNewJobViewCell : UITableViewCell
@end
NS_ASSUME_NONNULL_END
//
// XVNewJobViewCell.m
// fastservice
//
// Created by xuning on 2/5/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVNewJobViewCell.h"
#import "HBLockSliderView.h"
@interface XVNewJobViewCell()<HBLockSliderDelegate>
@property (nonatomic, strong) UIView *bgView;
// 直送
@property (nonatomic, strong) UILabel *orderTypeLabel;
// 18:00 立即取货
@property (nonatomic, strong) UILabel *timeLabel;
// ¥5.5
@property (nonatomic, strong) UILabel *priceLabel;
// 新订单标识
@property (nonatomic, strong) UIImageView *newOrderImageView;
// 小费
@property (nonatomic, strong) UIButton *tipButton;
// tagView
@property (nonatomic, strong) UIView *tagView;
// 取货距离
@property (nonatomic, strong) UILabel *pickupDistanceLabel;
// 取货地址
@property (nonatomic, strong) UILabel *pickupAddressLabel;
// 取货详细地址
@property (nonatomic, strong) UILabel *pickupDetailAddressLabel;
@property (nonatomic, strong) UIView *lineView;
// 送货距离
@property (nonatomic, strong) UILabel *deliveryDistanceLabel;
// 送货地址
@property (nonatomic, strong) UILabel *deliveryAddressLabel;
// 收货人
@property (nonatomic, strong) UILabel *deliveryNameLabel;
// 备注
@property (nonatomic, strong) YYLabel *remarkLabel;
// 抢单
@property (nonatomic, strong) UIButton *orderButton;
// 滑动
@property (nonatomic, strong) HBLockSliderView *sliderView;
// 预约标记
@property (nonatomic, strong) UIView *preOrderView;
@end
@implementation XVNewJobViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
self.backgroundColor = DEFAULT_BACKGROUND_COLOR;
[self setupUI];
}
return self;
}
- (void)setupUI {
[self.contentView addSubview:self.bgView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(UIEdgeInsetsMake(0, 6, 6, 6));
}];
kViewBorderRadius(self.bgView, 10, 0, [UIColor whiteColor]);
[self.bgView addSubview:self.orderTypeLabel];
[self.orderTypeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.bgView).mas_offset(9);
make.left.mas_equalTo(self.bgView).mas_offset(17);
make.size.mas_equalTo(CGSizeMake(62, 25));
}];
kViewBorderRadius(self.orderTypeLabel, 5, 0, [UIColor clearColor]);
[self.bgView addSubview:self.newOrderImageView];
[self.newOrderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.mas_equalTo(self.bgView);
make.size.mas_equalTo(CGSizeMake(29, 27));
}];
[self.bgView addSubview:self.priceLabel];
[self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(self.bgView).mas_offset(-17);
make.top.mas_equalTo(self.bgView).mas_offset(14);
}];
[self.bgView addSubview:self.timeLabel];
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.orderTypeLabel.mas_right).mas_offset(19);
make.centerY.mas_equalTo(self.orderTypeLabel);
}];
[self.bgView addSubview:self.tagView];
[self.tagView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.bgView).mas_offset(50);
make.left.mas_equalTo(self.bgView).mas_offset(17);
make.right.mas_equalTo(self.bgView).mas_offset(-17);
make.height.mas_equalTo(20);
}];
[self.bgView addSubview:self.pickupDistanceLabel];
[self.pickupDistanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.bgView).mas_offset(0);
make.top.mas_equalTo(self.tagView.mas_bottom).mas_offset(14);
make.width.mas_equalTo(50);
}];
[self.bgView addSubview:self.pickupAddressLabel];
[self.pickupAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.tagView.mas_bottom).mas_offset(14);
make.left.mas_equalTo(self.pickupDistanceLabel.mas_right).mas_offset(0);
make.right.mas_equalTo(self.bgView).mas_offset(-17);
}];
[self.bgView addSubview:self.pickupDetailAddressLabel];
[self.pickupDetailAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.pickupAddressLabel.mas_bottom).mas_offset(0);
make.left.right.mas_equalTo(self.pickupAddressLabel);
}];
[self.bgView addSubview:self.deliveryDistanceLabel];
[self.deliveryDistanceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.bgView).mas_offset(0);
make.width.mas_equalTo(50);
make.top.mas_equalTo(self.pickupAddressLabel.mas_bottom).mas_offset(31);
}];
[self.bgView addSubview:self.lineView];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(2);
make.centerX.mas_equalTo(self.pickupDistanceLabel);
make.top.mas_equalTo(self.pickupDistanceLabel.mas_bottom).mas_offset(12);
make.bottom.mas_equalTo(self.deliveryDistanceLabel.mas_top).mas_offset(-12);
}];
[self.bgView addSubview:self.deliveryAddressLabel];
[self.deliveryAddressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.deliveryDistanceLabel);
make.left.right.mas_equalTo(self.pickupAddressLabel);
}];
[self.bgView addSubview:self.deliveryNameLabel];
[self.deliveryNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.deliveryAddressLabel.mas_bottom).mas_offset(0);
make.left.right.mas_equalTo(self.pickupAddressLabel);
}];
[self.bgView addSubview:self.remarkLabel];
[self.remarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.mas_equalTo(self.deliveryAddressLabel);
make.top.mas_equalTo(self.deliveryNameLabel.mas_bottom).mas_offset(20);
}];
[self.bgView addSubview:self.orderButton];
[self.orderButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.bgView).mas_offset(15);
make.right.mas_equalTo(self.bgView).mas_offset(-15);
make.top.mas_equalTo(self.remarkLabel.mas_bottom).mas_offset(15);
make.bottom.mas_equalTo(self.bgView.mas_bottom).mas_offset(-8);
make.height.mas_equalTo(44);
}];
kViewBorderRadius(self.orderButton, 5, 0, [UIColor clearColor]);
}
- (void)orderButtonClick {
}
- (UIView *)bgView {
if(_bgView == nil) {
_bgView = [[UIView alloc]init];
_bgView.backgroundColor = [UIColor whiteColor];
}
return _bgView;
}
- (UILabel *)orderTypeLabel {
if(_orderTypeLabel == nil) {
_orderTypeLabel = [[UILabel alloc]initWithText:@"直送" textColor:[UIColor whiteColor] textAlignment:(NSTextAlignmentCenter) fontSize:10];
_orderTypeLabel.backgroundColor = COLOR_THEMEGRENN;
}
return _orderTypeLabel;
}
- (UILabel *)timeLabel {
if(_timeLabel == nil) {
_timeLabel = [[UILabel alloc]initWithText:@"18:00 立即取货" textColor:[UIColor colorWithHexString:@"#585858"] textAlignment:(NSTextAlignmentCenter) fontSize:18];
}
return _timeLabel;
}
- (UILabel *)priceLabel {
if(_priceLabel == nil) {
_priceLabel = [[UILabel alloc]initWithText:@"¥5.5" textColor:[UIColor colorWithHexString:@"##FF461F"] textAlignment:(NSTextAlignmentCenter) fontSize:18];
}
return _priceLabel;
}
- (UIImageView *)newOrderImageView {
if(_newOrderImageView == nil) {
_newOrderImageView = [[UIImageView alloc]initWithImageName:@"new_order"];
UILabel *text = [[UILabel alloc]initWithText:@"新" textColor:[UIColor whiteColor] textAlignment:(NSTextAlignmentCenter) fontSize:12];
[_newOrderImageView addSubview:text];
[text mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.mas_equalTo(_newOrderImageView).mas_offset(1);
make.top.mas_equalTo(_newOrderImageView);
make.height.mas_equalTo(17);
}];
}
return _newOrderImageView;
}
- (UIView *)tagView {
if (_tagView == nil) {
_tagView = [[UIView alloc]init];
}
return _tagView;
}
- (UILabel *)pickupDistanceLabel {
if (_pickupDistanceLabel == nil) {
_pickupDistanceLabel = [[UILabel alloc]initWithText:@"1.9" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
_pickupDistanceLabel.numberOfLines = 0;
}
return _pickupDistanceLabel;
}
- (UIView *)lineView {
if (_lineView == nil) {
_lineView = [[UIView alloc]init];
_lineView.backgroundColor = F_BBBBBB_COLOR;
}
return _lineView;
}
- (UILabel *)deliveryDistanceLabel {
if (_deliveryDistanceLabel == nil) {
_deliveryDistanceLabel = [[UILabel alloc]initWithText:@"3.9" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
_deliveryDistanceLabel.numberOfLines = 0;
}
return _deliveryDistanceLabel;
}
- (UILabel *)pickupAddressLabel {
if (_pickupAddressLabel == nil) {
_pickupAddressLabel = [[UILabel alloc]initWithText:@"小鱼的测试店铺(花园桥店) " textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:20];
_pickupAddressLabel.numberOfLines = 0;
_pickupAddressLabel.font = [UIFont boldSystemFontOfSize:20];
}
return _pickupAddressLabel;
}
- (UILabel *)pickupDetailAddressLabel {
if (_pickupDetailAddressLabel == nil) {
_pickupDetailAddressLabel = [[UILabel alloc]initWithText:@"北京动物园大猩猩馆000000000" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:12];
_pickupDetailAddressLabel.numberOfLines = 0;
}
return _pickupDetailAddressLabel;
}
- (UILabel *)deliveryAddressLabel {
if (_deliveryAddressLabel == nil) {
_deliveryAddressLabel = [[UILabel alloc]initWithText:@"白石桥南地铁站" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:18];
_deliveryAddressLabel.numberOfLines = 0;
_deliveryAddressLabel.font = [UIFont boldSystemFontOfSize:20];
}
return _deliveryAddressLabel;
}
- (UILabel *)deliveryNameLabel {
if (_deliveryNameLabel == nil) {
_deliveryNameLabel = [[UILabel alloc]initWithText:@"收货人:嫦娥仙子" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:14];
_deliveryNameLabel.numberOfLines = 0;
}
return _deliveryNameLabel;
}
- (YYLabel *)remarkLabel {
if (_remarkLabel == nil) {
_remarkLabel = [[YYLabel alloc]init];
_remarkLabel.backgroundColor = [UIColor whiteColor];
_remarkLabel.textColor = kHexRGB(0x808080);
_remarkLabel.preferredMaxLayoutWidth = SCREEN_WIDTH - 84;
_remarkLabel.textTapAction = ^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
//点击展开
};
}
return _remarkLabel;
}
- (UIButton *)orderButton {
if (_orderButton == nil) {
_orderButton = [[UIButton alloc]initWithTitle:@"抢单" fontSize:16 titleColor:[UIColor whiteColor] bgColor:COLOR_THEMEGRENN];
[_orderButton addTarget:self action:@selector(orderButtonClick) forControlEvents:UIControlEventTouchUpInside];
_orderButton.cs_acceptEventInterval = 1;
}
return _orderButton;
}
- (UIView *)preOrderView {
if (_preOrderView == nil) {
_preOrderView = [[UIView alloc]init];
_preOrderView.backgroundColor = [UIColor colorWithHexString:@"#1393EC"];
UIImageView *imageView = [[UIImageView alloc]initWithImage:IMG(@"闹钟")];
[_preOrderView addSubview:imageView];
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(_preOrderView);
make.size.mas_equalTo(CGSizeMake(15, 15));
make.left.mas_equalTo(_preOrderView).mas_offset(8);
}];
UILabel *label = [[UILabel alloc]initWithText:@"预" textColor:[UIColor whiteColor] textAlignment:(NSTextAlignmentCenter) fontSize:12];
[_preOrderView addSubview:label];
[label mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(imageView.mas_right);
make.right.mas_equalTo(_preOrderView);
make.centerY.mas_equalTo(_preOrderView);
}];
}
return _preOrderView;
}
- (HBLockSliderView *)sliderView {
if (_sliderView == nil) {
_sliderView = [[HBLockSliderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth - 40, 44)];
_sliderView.text = @"滑动抢单";
[_sliderView setColorForBackgroud:COLOR_THEMEGRENN
foreground:COLOR_THEMEGRENN
thumb:COLOR_THEMEGRENN
border:[UIColor clearColor]
textColor:[UIColor whiteColor]];
_sliderView.thumbBack = YES;
[_sliderView setThumbBeginImage:[UIImage imageNamed:@"huadong"] finishImage:[UIImage imageNamed:@"huadong"]];
[_sliderView setRoundCorners:5];
_sliderView.delegate = self;
}
return _sliderView;
}
@end
//
// XVPersonalViewController.h
// fastservice
//
// Created by xuning on 2/6/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XVPersonalViewController : XVBaseViewController
@end
NS_ASSUME_NONNULL_END
//
// XVPersonalViewController.m
// fastservice
//
// Created by xuning on 2/6/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVPersonalViewController.h"
@interface XVPersonalViewController ()
@end
@implementation XVPersonalViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
/*
#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
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
#define F_666666_COLOR [UIColor colorWithHexString:@"#666666"] #define F_666666_COLOR [UIColor colorWithHexString:@"#666666"]
#define F_606060_COLOR [UIColor colorWithHexString:@"#606060"] #define F_606060_COLOR [UIColor colorWithHexString:@"#606060"]
#define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"] #define F_BBBBBB_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define F_101010_COLOR [UIColor colorWithHexString:@"#101010"]
#define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"] #define E9_3_COLOR [UIColor colorWithHexString:@"#e9e9e9"]
#define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"] #define F2_3_COLOR [UIColor colorWithHexString:@"#f2f2f2"]
...@@ -66,10 +67,10 @@ ...@@ -66,10 +67,10 @@
#define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"] #define F7_3_COLOR [UIColor colorWithHexString:@"#F7F7F7"]
#define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"] #define BB_3_COLOR [UIColor colorWithHexString:@"#BBBBBB"]
#define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"] #define EF_3_COLOR [UIColor colorWithHexString:@"#efefef"]
#define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"] #define B2_3_COLOR [UIColor colorWithHexString:@"#b2b2b2"]
#define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf8f8f8) #define DEFAULT_BACKGROUND_COLOR kHexRGB(0xf7f7f7)
#define kViewBorderRadius(View, Radius, Width, Color)\ #define kViewBorderRadius(View, Radius, Width, Color)\
[View.layer setCornerRadius:(Radius)];\ [View.layer setCornerRadius:(Radius)];\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment