Commit 7c757c81 by xuning

接单设置

parent 0533b5e2
......@@ -45,6 +45,9 @@
79DC8B782B74B78A00DBD8EA /* XVOrderInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B772B74B78A00DBD8EA /* XVOrderInfoViewController.m */; };
79DC8B7B2B7AF42800DBD8EA /* XVOrderInfoTopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B7A2B7AF42800DBD8EA /* XVOrderInfoTopView.m */; };
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B7D2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m */; };
79DC8B842B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B832B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m */; };
79DC8B872B8CD5F000DBD8EA /* XVOrderSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B862B8CD5F000DBD8EA /* XVOrderSettingView.m */; };
79DC8B8A2B8D818000DBD8EA /* XVVerticalButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 79DC8B892B8D818000DBD8EA /* XVVerticalButton.m */; };
FA5E55D5A48FDC04BA4CCD08 /* Pods_fastservice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08D109EE60B32403F3655A70 /* Pods_fastservice.framework */; };
/* End PBXBuildFile section */
......@@ -128,6 +131,12 @@
79DC8B7A2B7AF42800DBD8EA /* XVOrderInfoTopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderInfoTopView.m; sourceTree = "<group>"; };
79DC8B7C2B88DC3B00DBD8EA /* XVOrderInfoViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderInfoViewCell.h; sourceTree = "<group>"; };
79DC8B7D2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderInfoViewCell.m; sourceTree = "<group>"; };
79DC8B822B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSettiingTitleView.h; sourceTree = "<group>"; };
79DC8B832B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderSettiingTitleView.m; sourceTree = "<group>"; };
79DC8B852B8CD5F000DBD8EA /* XVOrderSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVOrderSettingView.h; sourceTree = "<group>"; };
79DC8B862B8CD5F000DBD8EA /* XVOrderSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVOrderSettingView.m; sourceTree = "<group>"; };
79DC8B882B8D818000DBD8EA /* XVVerticalButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XVVerticalButton.h; sourceTree = "<group>"; };
79DC8B892B8D818000DBD8EA /* XVVerticalButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XVVerticalButton.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -248,6 +257,10 @@
7981EB0A2B73BC1500F357E7 /* XVPersonalViewCell.m */,
79DC8B6D2B74A8E600DBD8EA /* XVPersonalFooterView.h */,
79DC8B6E2B74A8E600DBD8EA /* XVPersonalFooterView.m */,
79DC8B822B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.h */,
79DC8B832B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m */,
79DC8B852B8CD5F000DBD8EA /* XVOrderSettingView.h */,
79DC8B862B8CD5F000DBD8EA /* XVOrderSettingView.m */,
);
path = View;
sourceTree = "<group>";
......@@ -317,6 +330,8 @@
7981EAB92B6E670200F357E7 /* UIView+XVAdd.m */,
7981EABB2B6E675F00F357E7 /* NSString+XVAdd.h */,
7981EABC2B6E675F00F357E7 /* NSString+XVAdd.m */,
79DC8B882B8D818000DBD8EA /* XVVerticalButton.h */,
79DC8B892B8D818000DBD8EA /* XVVerticalButton.m */,
);
path = Categpry;
sourceTree = "<group>";
......@@ -546,9 +561,11 @@
files = (
79DC8B6F2B74A8E600DBD8EA /* XVPersonalFooterView.m in Sources */,
79DC8B752B74B69600DBD8EA /* XVOrderDetailsViewController.m in Sources */,
79DC8B872B8CD5F000DBD8EA /* XVOrderSettingView.m in Sources */,
7981EAB72B6E669000F357E7 /* UIScrollView+XVAdd.m in Sources */,
7981EACF2B6F63CF00F357E7 /* XVMainJobViewController.m in Sources */,
799DF1042B6D220300680907 /* XVBaseViewController.m in Sources */,
79DC8B8A2B8D818000DBD8EA /* XVVerticalButton.m in Sources */,
799DF0C62B6BD8AF00680907 /* AppDelegate.m in Sources */,
7981EAC72B6F41B000F357E7 /* XVRegisterViewController.m in Sources */,
79DC8B7B2B7AF42800DBD8EA /* XVOrderInfoTopView.m in Sources */,
......@@ -557,6 +574,7 @@
7981EAD32B6F656900F357E7 /* XVCustomBarView.m in Sources */,
7981EACA2B6F59E800F357E7 /* XVPasswordViewController.m in Sources */,
79DC8B782B74B78A00DBD8EA /* XVOrderInfoViewController.m in Sources */,
79DC8B842B8CD5DF00DBD8EA /* XVOrderSettiingTitleView.m in Sources */,
7981EABD2B6E675F00F357E7 /* NSString+XVAdd.m in Sources */,
799DF0F72B6BDA1400680907 /* BRPlaceholderTextView.m in Sources */,
79DC8B7E2B88DC3B00DBD8EA /* XVOrderInfoViewCell.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "iconPark-camera-five@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "iconPark-checklist@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
//
// XVVerticalButton.h
// fastservice
//
// Created by xuning on 2/27/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVVerticalButton : UIButton
// Round Image
@property BOOL imageIsRound;
// Image Padding
@property CGFloat padding;
// Spacing between imageview and textlabel
@property CGFloat imageTextSpace;
// Maximum imageview size
@property CGSize imageViewMaxSize;
// Button backgroundHighlighted
@property(nonatomic, strong) UIColor *backgroundHighlightedColor;
// Button backgroundNormal
@property(nonatomic, strong) UIColor *backgroundNormalColor;
@end
NS_ASSUME_NONNULL_END
//
// XVVerticalButton.m
// fastservice
//
// Created by xuning on 2/27/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVVerticalButton.h"
#define IMAGECENTERBUTTON_IMAGE_TEXT_SPACING 10.0
#define IMAGECENTERBUTTON_TITLE_MIN_HEIGHT 14.0
#define IMAGECENTERBUTTON_PADDING_MIN 8.0
@implementation XVVerticalButton
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
[self addAction];
}
return self;
}
- (instancetype)init {
self = [super init];
if (self) {
[self addAction];
}
return self;
}
- (void)addAction {
// [self addTarget:self action:@selector(pressed:) forControlEvents:UIControlEventTouchDown];
// [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpInside];
// [self addTarget:self action:@selector(touchUp:) forControlEvents:UIControlEventTouchUpOutside];
}
- (void)layoutSubviews {
[super layoutSubviews];
self.adjustsImageWhenHighlighted = NO;
if (!self.padding) {
self.padding = IMAGECENTERBUTTON_PADDING_MIN;
}
if (!self.imageTextSpace) {
self.imageTextSpace = IMAGECENTERBUTTON_IMAGE_TEXT_SPACING;
}
CGFloat titleLabelHeight = self.titleLabel.frame.size.height;
if (titleLabelHeight == 0) {
titleLabelHeight = IMAGECENTERBUTTON_TITLE_MIN_HEIGHT;
}
CGFloat imageMaxHeight = self.frame.size.height - titleLabelHeight - self.imageTextSpace - self.padding * 2;
CGFloat imageMaxWidth = self.frame.size.width - self.padding * 2;
if (self.imageViewMaxSize.height) {
imageMaxHeight = self.imageViewMaxSize.height;
}
if (self.imageViewMaxSize.width) {
imageMaxWidth = self.imageViewMaxSize.width;
}
//Set ImageView Threshold
if (self.imageView.frame.size.height > imageMaxHeight) {
CGRect newImageView = self.imageView.frame;
newImageView.size = CGSizeMake(imageMaxHeight / self.imageView.frame.size.height * self.imageView.frame.size.width, imageMaxHeight);
self.imageView.frame = newImageView;
}
if (self.imageView.frame.size.width > imageMaxWidth) {
CGRect newImageView = self.imageView.frame;
newImageView.size = CGSizeMake(imageMaxWidth , imageMaxWidth / self.imageView.frame.size.width * self.imageView.frame.size.height);
self.imageView.frame = newImageView;
}
CGFloat totalHeight = self.imageView.frame.size.height + self.imageTextSpace + titleLabelHeight;
//Center image
CGPoint center = self.imageView.center;
center.x = self.frame.size.width / 2.0;
center.y = self.frame.size.height / 2.0 - totalHeight / 2.0 + self.imageView.frame.size.height / 2.0;
self.imageView.center = center;
if (self.imageIsRound) {
self.imageView.layer.cornerRadius = self.imageView.frame.size.width / 2.0;
}
CGRect titleLabelFrame = self.titleLabel.frame;
titleLabelFrame.size = CGSizeMake(self.frame.size.width, titleLabelHeight);
self.titleLabel.frame = titleLabelFrame;
//Center text
CGPoint titleCenter = self.titleLabel.center;
titleCenter.x = self.frame.size.width / 2.0;
titleCenter.y = self.imageView.center.y + self.imageView.frame.size.height / 2.0 + self.imageTextSpace + titleLabelHeight / 2.0;
self.titleLabel.center = titleCenter;
self.titleLabel.textAlignment = NSTextAlignmentCenter;
}
//- (void)pressed:(UIButton *)btn {
// if (self.backgroundHighlightedColor) {
// [btn setBackgroundColor:self.backgroundHighlightedColor];
// } else {
// [btn setBackgroundColor:[UIColor colorWithRed:0.9 green:0.9 blue:0.9 alpha:1]];
// }
//}
//
//- (void)touchUp:(UIButton *)btn {
// if (self.backgroundNormalColor) {
// [btn setBackgroundColor:self.backgroundNormalColor];
// } else {
// [btn setBackgroundColor:[UIColor whiteColor]];
// }
//}
@end
......@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XVJobStatusToolView : UIView
@end
NS_ASSUME_NONNULL_END
......@@ -7,6 +7,7 @@
//
#import "XVJobStatusToolView.h"
#import "XVOrderSettingViewController.h"
@interface XVJobStatusToolView()
......@@ -54,11 +55,16 @@
kViewBorderRadius(self.statusButton, 4, 0, COLOR_THEMEGRENN);
}
- (void)settingButtonClick {
XVOrderSettingViewController *vc = [[XVOrderSettingViewController alloc]init];
[self.viewController.navigationController pushViewController:vc animated:YES];
}
- (UIButton *)settingButton {
if(_settingButton == nil) {
_settingButton = [[UIButton alloc]initWithTitle:@"接单设置" fontSize:12 titleColor:F_415058_COLOR normalImageName:@"if-settings" selectedImgName:@"if-settings" backgroundColor:nil];
[_settingButton addTarget:self action:@selector(settingButtonClick) forControlEvents:UIControlEventTouchUpInside];
}
return _settingButton;
......
......@@ -7,7 +7,7 @@
//
#import "XVOrderInfoViewCell.h"
#import "XVLabel.h"
@interface XVOrderInfoViewCell()
@property (nonatomic, strong) UILabel *titleLabel;
......
//
// XVOrderSettiingTitleView.h
// fastservice
//
// Created by xuning on 2/26/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVOrderSettiingTitleView : UIView
- (instancetype)initWithTitle:(NSString *)title;
@end
NS_ASSUME_NONNULL_END
//
// XVOrderSettiingTitleView.m
// fastservice
//
// Created by xuning on 2/26/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import "XVOrderSettiingTitleView.h"
@interface XVOrderSettiingTitleView()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *lineView;
@end
@implementation XVOrderSettiingTitleView
- (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.lineView];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self);
make.left.mas_equalTo(self).mas_offset(15);
make.right.mas_equalTo(self).mas_offset(-15);
make.height.mas_equalTo(1);
}];
}
return self;
}
- (UILabel *)titleLabel {
if(_titleLabel == nil) {
_titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:16];
}
return _titleLabel;
}
- (UIView *)lineView {
if(_lineView == nil) {
_lineView = [[UIView alloc]init];
_lineView.backgroundColor = F7_3_COLOR;
}
return _lineView;
}
@end
//
// XVOrderSettingView.h
// fastservice
//
// Created by xuning on 2/26/24.
// Copyright © 2024 FastService. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XVOrderSettingView : UIView
- (instancetype)initWithTitle:(NSString *)title;
@end
NS_ASSUME_NONNULL_END
//
// 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
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