Commit 4441eae2 authored by 曹云霄's avatar 曹云霄

工单详情界面的子工单列表只显示isEditable 为true的数据

parent e7f11098
This diff is collapsed.
......@@ -99,7 +99,11 @@ class BaseTableViewPullController: BaseViewController {
tableView.reloadData()
if tableView.isEmptyDataSetVisible {
tableView.reloadEmptyDataSet()
} }
tableView.mj_footer.isHidden = true
}else {
tableView.mj_footer.isHidden = false
}
}
// MARK: - 结束刷新切显示无更多的数据
func endRefreshNomoreData() {
......
......@@ -148,7 +148,7 @@ public func repairOrderChineseState(_ state: String) ->String {
case SUBMIT_REPAIR_ORDER_STATE.CREATED.rawValue:
return "未发出"
case SUBMIT_REPAIR_ORDER_STATE.SUBMIT.rawValue:
return "已发出"
return "未派单"
case SUBMIT_REPAIR_ORDER_STATE.PROCESSING.rawValue:
return "处理中"
case SUBMIT_REPAIR_ORDER_STATE.FINISHED.rawValue:
......@@ -177,7 +177,7 @@ public func repairOrderEnglishState(_ state: String) ->String {
switch state {
case "未发出":
return SUBMIT_REPAIR_ORDER_STATE.CREATED.rawValue
case "已发出":
case "未派单":
return SUBMIT_REPAIR_ORDER_STATE.SUBMIT.rawValue
case "处理中":
return SUBMIT_REPAIR_ORDER_STATE.PROCESSING.rawValue
......
......@@ -14,12 +14,12 @@ import Foundation
//public let BaseAttachmentUrl: String = "http://192.168.1.176:9030"
//测试环境
public let BaseUrl: String = "http://222.180.250.18:7080/ifs-server/rest"
public let BaseAttachmentUrl: String = "http://222.180.250.18:7080"
//public let BaseUrl: String = "http://222.180.250.18:7080/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://222.180.250.18:7080"
//外网开发环境
//public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://dev.gomoretech.com"
public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest"
public let BaseAttachmentUrl: String = "http://dev.gomoretech.com"
/// 登录
public let loginUrl: String = "/user/login/%@"
......
......@@ -136,7 +136,9 @@ open class BillDetailData : NSObject{
let executesArray = json["executes"].arrayValue
for executesJson in executesArray{
let value = BillDetailExecute(fromJson: executesJson)
executes.append(value)
if value.isEditable {
executes.append(value)
}
}
feedback = json["feedback"].stringValue
feedbackNote = json["feedbackNote"].stringValue
......
......@@ -109,23 +109,23 @@ extension RepairOrderDetailViewModel {
// MARK: - 查询工单转交部门
func queryRepairOrderDepartmentAction(_ model: QueryModel) ->Observable<DepartmentData> {
if AppManager.shareInstance.userStoreModel != nil {
// if AppManager.shareInstance.userStoreModel != nil {
return queryRepairOrderDepartmentAction2()
}else {
return Observable.create({ (observer) -> Disposable in
Network.request(target: .GetRepairOrderDepartment(model), success: { (json) in
let resultModel = DepartmentResultModel(fromJson: json)
if resultModel.success {
observer.onNext(resultModel.data)
}else {
ShowMessage(resultModel.message)
}
}, failure: { (error) in
ShowMessage(error.localizedDescription)
})
return Disposables.create()
})
}
// }else {
// return Observable.create({ (observer) -> Disposable in
// Network.request(target: .GetRepairOrderDepartment(model), success: { (json) in
// let resultModel = DepartmentResultModel(fromJson: json)
// if resultModel.success {
// observer.onNext(resultModel.data)
// }else {
// ShowMessage(resultModel.message)
// }
// }, failure: { (error) in
// ShowMessage(error.localizedDescription)
// })
// return Disposables.create()
// })
// }
}
// MARK: - 查询工单转交部门2(当前登录人所属项目不为空时调用)
......
......@@ -115,7 +115,7 @@ extension RepairOrderViewModel {
})
break
case REPAIR_ORDER_FILTER_BUTTON_TAG.STATE.rawValue:
YXPickerManager.share().showGeneralPickerView(kNavColor, dataArray: ["全部状态","未发出","已发出","处理中","已完成","已删除","已作废"], defaultString: sender.currentTitle, commit: { (text, index) in
YXPickerManager.share().showGeneralPickerView(kNavColor, dataArray: ["全部状态","未发出","未派单","处理中","已完成","已删除","已作废"], defaultString: sender.currentTitle, commit: { (text, index) in
sender.isSelected = false
sender.addBorder(1.0, kGaryColor)
sender.setTitle(text, for: .normal)
......
......@@ -54,7 +54,7 @@ class HomeTableViewController: BaseTableViewPullController {
default:
break
}
self?.tableView.reloadData()
self?.reloadData()
}.disposed(by: disposeBag)
}
......
......@@ -5,7 +5,7 @@
#import "UIImage+Category.h"
#import "UINavigationController+FDFullscreenPopGesture.h"
#import "YXKitHeader.h"
@import YXPickerView;
#import "YXPickerManager.h"
@import YXAlertController;
@import YXKit;
#import "IQTextView.h"
......
......@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>CFBundleVersion</key>
<string>1.0.4</string>
<string>1.0.5</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
//
// YXAddressPickerView.h
// YXAddressPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YXToolbar.h"
@interface YXAddressPickerView : UIPickerView
@property (nonatomic, strong) YXToolbar *toolbar;
/**
显示省市区选择框
@param tintColor 主题颜色
@param address 默认地址
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showAddressPickerView:(UIColor *)tintColor defaultAddress:(NSString *)address commitBlock:(void(^)(NSString *address,NSString *zipcode))commitBlock cancelBlock:(void(^)())cancelBlock;
@end
This diff is collapsed.
This diff is collapsed.
//
// YXCityModel.h
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface YXCityModel : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *zipcode;
@property (nonatomic, strong) NSArray *city;
@end
//
// YXCityModel.m
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import "YXCityModel.h"
@implementation YXCityModel
@end
//
// YXDatePickerView.h
// demo
//
// Created by 曹云霄 on 2017/7/17.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YXToolbar.h"
@interface YXDatePickerView : UIDatePicker
@property (nonatomic, strong) YXToolbar *toolbar;
/**
显示时间选择框
@param tintColor 主题颜色
@param model NSDate类型
@param minimumDate 最小时间
@param maximumDate 最大时间
@param dateString 默认时间字符串
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showDatePickerView:(UIColor *)tintColor datePickerModel:(UIDatePickerMode)model minimumDate:(NSDate *)minimumDate maximumDate:(NSDate *)maximumDate defaultDate:(NSString *)dateString commitBlock:(void(^)(NSString *date))commitBlock cancelBlock:(void(^)())cancelBlock;
@end
//
// YXDatePickerView.m
// demo
//
// Created by 曹云霄 on 2017/7/17.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import "YXDatePickerView.h"
@interface YXDatePickerView()
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIView *containerView;
@end
@implementation YXDatePickerView
- (instancetype)initWithFrame:(CGRect)frame
{
[self initToolBar];
[self initContainerView];
CGRect initialFrame;
if (CGRectIsEmpty(frame)) {
initialFrame = CGRectMake(0, self.toolbar.frame.size.height, WIDTH, 216);
} else {
initialFrame = frame;
}
self = [super initWithFrame:initialFrame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self initBgView];
}
return self;
}
- (void)initBgView
{
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, HEIGHT - self.frame.size.height - 44, WIDTH, self.frame.size.height + self.toolbar.frame.size.height)];
}
- (void)initToolBar
{
self.toolbar = [[YXToolbar alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 44)];
self.toolbar.translucent = NO;
}
- (void)initContainerView
{
self.containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
self.containerView.userInteractionEnabled = YES;
[self.containerView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hiddenWithAnimation)]];
}
- (void)showWithAnimation {
[self addViews];
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
CGFloat height = self.bgView.frame.size.height;
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT + height / 2);
[UIView animateWithDuration:0.25 animations:^{
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT - height / 2);
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
}];
}
- (void)hiddenWithAnimation {
CGFloat height = self.bgView.frame.size.height;
[UIView animateWithDuration:0.25 animations:^{
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT + height / 2);
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
} completion:^(BOOL finished) {
[self hiddenViews];
}];
}
- (void)addViews {
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[window addSubview:self.containerView];
[window addSubview:self.bgView];
[self.bgView addSubview:self.toolbar];
[self.bgView addSubview:self];
}
- (void)hiddenViews {
[self removeFromSuperview];
[self.toolbar removeFromSuperview];
[self.bgView removeFromSuperview];
[self.containerView removeFromSuperview];
}
- (void)showDatePickerView:(UIColor *)tintColor datePickerModel:(UIDatePickerMode)model minimumDate:(NSDate *)minimumDate maximumDate:(NSDate *)maximumDate defaultDate:(NSString *)dateString commitBlock:(void (^)(NSString *))commitBlock cancelBlock:(void (^)())cancelBlock
{
if (dateString) {
self.date = [self returnDate:dateString];
}else {
self.date = [NSDate date];
}
self.datePickerMode = model;
self.minimumDate = minimumDate;
self.maximumDate = maximumDate;
self.toolbar.tintColor = tintColor;
[self showWithAnimation];
__weak typeof(self) weakSelf = self;
self.toolbar.cancelBlock = ^ {
if (cancelBlock) {
[weakSelf hiddenWithAnimation];
cancelBlock();
}
};
self.toolbar.commitBlock = ^{
if (commitBlock) {
[weakSelf hiddenWithAnimation];
commitBlock([weakSelf returnDateString:weakSelf.date]);
}
};
}
/**
格式化NSDate
@param date NSDate
@return 时间字符串
*/
- (NSString *)returnDateString:(NSDate *)date
{
NSDateFormatter *format = [[NSDateFormatter alloc] init];
format.dateFormat = @"yyyy-MM-dd HH:mm:ss";
NSString *string = [format stringFromDate:date];
return string;
}
/**
格式化NSString
@param dateString 时间字符串
@return NSDate
*/
- (NSDate *)returnDate:(NSString *)dateString
{
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:dateString];
return date;
}
@end
//
// YXGeneralPickerView.h
// demo
//
// Created by 曹云霄 on 2017/9/22.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "YXToolbar.h"
@interface YXGeneralPickerView : UIPickerView
@property (nonatomic, strong) YXToolbar *toolbar;
/**
显示选择框
@param tintColor 主题颜色
@param defaultString 默认选中
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showGeneralPickerView:(UIColor *)tintColor dataArray:(NSArray<NSString *> *)dataArray defaultString:(NSString *)defaultString commitBlock:(void (^)(NSString *selectedItem,NSInteger index))commitBlock cancelBlock:(void (^)())cancelBlock;
@end
//
// YXGeneralPickerView.m
// demo
//
// Created by 曹云霄 on 2017/9/22.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import "YXGeneralPickerView.h"
/**
取消回调
*/
typedef void (^CancelBlock)();
@interface YXGeneralPickerView()<UIPickerViewDelegate,UIPickerViewDataSource>
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIView *containerView;
@property (nonatomic, strong) NSArray *datasArray;
/**
选中下标
*/
@property (nonatomic, assign) NSInteger selectedIndex;
@property (nonatomic, copy) CancelBlock block;
@end
@implementation YXGeneralPickerView
- (instancetype)initWithFrame:(CGRect)frame
{
[self initToolBar];
[self initContainerView];
CGRect initialFrame;
if (CGRectIsEmpty(frame)) {
initialFrame = CGRectMake(0, self.toolbar.frame.size.height, WIDTH, 216);
} else {
initialFrame = frame;
}
self = [super initWithFrame:initialFrame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
self.delegate = self;
self.dataSource = self;
self.autoresizingMask = UIViewAutoresizingFlexibleWidth;
[self initBgView];
}
return self;
}
- (void)initBgView
{
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, HEIGHT - self.frame.size.height - 44, WIDTH, self.frame.size.height + self.toolbar.frame.size.height)];
}
- (void)initToolBar
{
self.toolbar = [[YXToolbar alloc] initWithFrame:CGRectMake(0, 0, WIDTH, 44)];
self.toolbar.translucent = NO;
}
- (void)initContainerView
{
self.containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
self.containerView.userInteractionEnabled = YES;
[self.containerView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hiddenWithAnimation)]];
}
- (void)showWithAnimation {
[self addViews];
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
CGFloat height = self.bgView.frame.size.height;
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT + height / 2);
[UIView animateWithDuration:0.25 animations:^{
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT - height / 2);
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.4];
}];
}
- (void)hiddenWithAnimation {
self.block();
CGFloat height = self.bgView.frame.size.height;
[UIView animateWithDuration:0.25 animations:^{
self.bgView.center = CGPointMake(WIDTH / 2, HEIGHT + height / 2);
self.containerView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.0];
} completion:^(BOOL finished) {
[self hiddenViews];
}];
}
- (void)addViews {
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[window addSubview:self.containerView];
[window addSubview:self.bgView];
[self.bgView addSubview:self.toolbar];
[self.bgView addSubview:self];
}
- (void)hiddenViews {
[self removeFromSuperview];
[self.toolbar removeFromSuperview];
[self.bgView removeFromSuperview];
[self.containerView removeFromSuperview];
}
- (void)showGeneralPickerView:(UIColor *)tintColor dataArray:(NSArray<NSString *> *)dataArray defaultString:(NSString *)defaultString commitBlock:(void (^)(NSString *selectedItem,NSInteger index))commitBlock cancelBlock:(void (^)())cancelBlock
{
self.block = cancelBlock;
self.datasArray = dataArray;
[self showDefaultItem:defaultString];
[self reloadAllComponents];
self.toolbar.tintColor = tintColor;
[self showWithAnimation];
__weak typeof(self) weakSelf = self;
self.toolbar.cancelBlock = ^ {
if (cancelBlock) {
[weakSelf hiddenWithAnimation];
}
};
self.toolbar.commitBlock = ^{
if (commitBlock) {
[weakSelf hiddenWithAnimation];
commitBlock(weakSelf.datasArray[weakSelf.selectedIndex],weakSelf.selectedIndex);
}
};
}
- (void)showDefaultItem:(NSString *)defaultString
{
NSInteger index = [self.datasArray indexOfObject:defaultString];
[self reloadComponent:0];
if (defaultString) {
if (index > self.datasArray.count - 1) {
index = 0;
}
self.selectedIndex = index;
[self selectRow:index inComponent:0 animated:NO];
}else {
self.selectedIndex = 0;
}
}
#pragma mark -<UIPickerViewDelegate,UIPickerViewDataSource>
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 1;
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
return self.datasArray[row];
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
{
return self.datasArray.count;
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
self.selectedIndex = row;
}
@end
//
// YXPickerManager.h
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "YXAddressPickerView.h"
#import "YXDatePickerView.h"
#import "YXGeneralPickerView.h"
@interface YXPickerManager : NSObject
+ (YXPickerManager *)shareManager;
@property (nonatomic, strong) YXAddressPickerView *addressPickerView;
@property (nonatomic, strong) YXDatePickerView *datePickerView;
@property (nonatomic, strong) YXGeneralPickerView *generalPickerView;
/**
显示省市区选择框
@param tintColor 主题颜色
@param address 默认地址
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showAddressPickerView:(UIColor *)tintColor defaultAddress:(NSString *)address commitBlock:(void(^)(NSString *address,NSString *zipcode))commitBlock cancelBlock:(void(^)())cancelBlock;
/**
显示选择框
@param tintColor 主题颜色
@param dataArray 默认选中
@param defaultString 默认选中
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showGeneralPickerView:(UIColor *)tintColor dataArray:(NSArray<NSString *> *)dataArray defaultString:(NSString *)defaultString commitBlock:(void (^)(NSString *selectedItem,NSInteger index))commitBlock cancelBlock:(void (^)())cancelBlock;
/**
显示时间选择框
@param tintColor 主题颜色
@param model NSDate类型
@param minimumDate 最小时间
@param maximumDate 最大时间
@param dateString 默认时间字符串
@param commitBlock 确认回调
@param cancelBlock 取消回调
*/
- (void)showDatePickerView:(UIColor *)tintColor datePickerModel:(UIDatePickerMode)model minimumDate:(NSDate *)minimumDate maximumDate:(NSDate *)maximumDate defaultDate:(NSString *)dateString commitBlock:(void(^)(NSString *date))commitBlock cancelBlock:(void(^)())cancelBlock;
@end
//
// YXPickerManager.m
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import "YXPickerManager.h"
@implementation YXPickerManager
+ (YXPickerManager *)shareManager
{
static YXPickerManager *manager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
manager = [[YXPickerManager alloc] init];
});
return manager;
}
- (YXAddressPickerView *)addressPickerView
{
if (!_addressPickerView) {
_addressPickerView = [[YXAddressPickerView alloc] init];
}
return _addressPickerView;
}
- (YXDatePickerView *)datePickerView
{
if (!_datePickerView) {
_datePickerView = [[YXDatePickerView alloc] init];
}
return _datePickerView;
}
- (YXGeneralPickerView *)generalPickerView
{
if (!_generalPickerView) {
_generalPickerView = [[YXGeneralPickerView alloc] init];
}
return _generalPickerView;
}
- (void)showAddressPickerView:(UIColor *)tintColor defaultAddress:(NSString *)address commitBlock:(void (^)(NSString *, NSString *))commitBlock cancelBlock:(void (^)())cancelBlock
{
[self.addressPickerView showAddressPickerView:tintColor defaultAddress:address commitBlock:^(NSString *address, NSString *zipcode) {
commitBlock(address,zipcode);
} cancelBlock:^{
if (cancelBlock) {
cancelBlock();
}
}];
}
- (void)showGeneralPickerView:(UIColor *)tintColor dataArray:(NSArray<NSString *> *)dataArray defaultString:(NSString *)defaultString commitBlock:(void (^)(NSString *selectedItem,NSInteger index))commitBlock cancelBlock:(void (^)())cancelBlock
{
[self.generalPickerView showGeneralPickerView:tintColor dataArray:dataArray defaultString:defaultString commitBlock:^(NSString *selectedItem,NSInteger index) {
commitBlock(selectedItem,index);
} cancelBlock:^{
if (cancelBlock) {
cancelBlock();
}
}];
}
- (void)showDatePickerView:(UIColor *)tintColor datePickerModel:(UIDatePickerMode)model minimumDate:(NSDate *)minimumDate maximumDate:(NSDate *)maximumDate defaultDate:(NSString *)dateString commitBlock:(void (^)(NSString *))commitBlock cancelBlock:(void (^)())cancelBlock
{
[self.datePickerView showDatePickerView:tintColor datePickerModel:model minimumDate:minimumDate maximumDate:maximumDate defaultDate:dateString commitBlock:^(NSString *date) {
commitBlock(date);
} cancelBlock:^{
if (cancelBlock) {
cancelBlock();
}
}];
}
@end
//
// YXToolbar.h
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import <UIKit/UIKit.h>
#define WIDTH [[UIScreen mainScreen] bounds].size.width
#define HEIGHT [[UIScreen mainScreen] bounds].size.height
#define COLOR [UIColor colorWithRed:0.804 green:0.804 blue:0.804 alpha:1]
@interface YXToolbar : UIToolbar
@property (nonatomic, strong) UIBarButtonItem *cancelButtonItem;
@property (nonatomic, strong) UIBarButtonItem *commitButtonItem;
@property (nonatomic, strong) UIBarButtonItem *titleButtonItem;
/**
toolBar主题色
*/
@property (nonatomic, strong) UIColor *toolBarTintColor;
/**
标题
*/
@property (nonatomic, copy) NSString *title;
/**
标题字体颜色
*/
@property (nonatomic, strong) UIColor *titleColor;
/**
取消
*/
@property (nonatomic, copy) NSString *cancelTitle;
/**
取消字体颜色
*/
@property (nonatomic, strong) UIColor *cancelTitleColor;
/**
提交
*/
@property (nonatomic, copy) NSString *commitTitle;
/**
提交字体颜色
*/
@property (nonatomic, strong) UIColor *commitTitleColor;
/**
取消回调
*/
@property (nonatomic,copy) void(^cancelBlock)();
/**
提交回调
*/
@property (nonatomic,copy) void(^commitBlock)();
@end
//
// YXToolbar.m
// YXPickerView
//
// Created by 曹云霄 on 2017/7/14.
// Copyright © 2017年 曹云霄. All rights reserved.
//
#import "YXToolbar.h"
@implementation YXToolbar
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UIBarButtonItem *leftFixBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
leftFixBar.width = 15;
UIBarButtonItem *rightFixBar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:self action:nil];
rightFixBar.width = 15;
UIBarButtonItem *spaceItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
self.titleButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"请选择" style:UIBarButtonItemStyleDone target:self action:nil];
self.titleButtonItem.enabled = NO;
[self.titleButtonItem setTitleTextAttributes:@{NSFontAttributeName: [UIFont systemFontOfSize:15],
NSForegroundColorAttributeName : [UIColor lightGrayColor]} forState:UIControlStateNormal];
self.cancelButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"取消" style:UIBarButtonItemStyleDone target:self action:@selector(cancelButtonClickAction)];
self.commitButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"确认" style:UIBarButtonItemStyleDone target:self action:@selector(commitButtonClickAction)];
self.items = @[leftFixBar,self.cancelButtonItem,spaceItem,self.titleButtonItem,spaceItem,self.commitButtonItem,rightFixBar];
self.tintColor = [UIColor redColor];
UIView *bottomLineView = [[UIView alloc] initWithFrame:CGRectMake(0, 43.5, WIDTH, 0.5)];
bottomLineView.backgroundColor = COLOR;
[self addSubview:bottomLineView];
[self bringSubviewToFront:bottomLineView];
}
return self;
}
- (void)setTitle:(NSString *)title
{
if (self.titleButtonItem) {
self.titleButtonItem.title = title;
}
}
- (void)setTitleColor:(UIColor *)titleColor
{
if (self.titleButtonItem) {
self.titleButtonItem.tintColor = titleColor;
}
}
- (void)setToolBarTintColor:(UIColor *)toolBarTintColor
{
self.tintColor = toolBarTintColor;
}
- (void)setCancelTitle:(NSString *)cancelTitle
{
if (self.cancelButtonItem) {
self.cancelButtonItem.title = cancelTitle;
}
}
- (void)setCancelTitleColor:(UIColor *)cancelTitleColor
{
if (self.cancelButtonItem) {
self.cancelButtonItem.tintColor = cancelTitleColor;
}
}
- (void)setCommitTitle:(NSString *)commitTitle
{
if (self.commitButtonItem) {
self.commitButtonItem.title = commitTitle;
}
}
- (void)setCommitTitleColor:(UIColor *)commitTitleColor
{
if (self.commitButtonItem) {
self.commitButtonItem.tintColor = commitTitleColor;
}
}
- (void)cancelButtonClickAction
{
if (self.cancelBlock) {
self.cancelBlock();
}
}
- (void)commitButtonClickAction
{
if (self.commitBlock) {
self.commitBlock();
}
}
@end
......@@ -18,7 +18,6 @@ target ‘IFS’ do
pod 'FDFullscreenPopGesture', '~> 1.1'
pod 'ImagePicker'
pod 'SKPhotoBrowser', '~> 5.0.0'
pod 'YXPickerView'
pod 'YXAlertController'
pod 'PPBadgeViewSwift'
pod 'SVProgressHUD', '~> 2.2.2'
......
......@@ -26,7 +26,6 @@ PODS:
- UMengAnalytics (4.2.4)
- YXAlertController (1.0.8)
- YXKit (0.0.8)
- YXPickerView (2.0.0)
DEPENDENCIES:
- DeviceKit
......@@ -49,7 +48,6 @@ DEPENDENCIES:
- UMengAnalytics
- YXAlertController
- YXKit
- YXPickerView
SPEC CHECKSUMS:
Alamofire: f41a599bd63041760b26d393ec1069d9d7b917f4
......@@ -74,8 +72,7 @@ SPEC CHECKSUMS:
UMengAnalytics: ef8d45f94c0e5771dc364cf6a5731d9d3b101da2
YXAlertController: 37a54642cb8e8b43b79004fe9148bb8ff2fab814
YXKit: 73d6ffbcf7530f1159e030460207286e9153b080
YXPickerView: 527ca74d8fbe73b4e9bd0bbff6e143133dced907
PODFILE CHECKSUM: 0eaafb4a7b07d07aea77b58f3cd8a90edc556faf
PODFILE CHECKSUM: dee9f1dd9eac675051bb335b7b1d13637a8eabc1
COCOAPODS: 1.3.1
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