Commit a4a53ec4 authored by 陈俊俊's avatar 陈俊俊

规格描述

parent 5cd4c129
This diff is collapsed.
......@@ -40,8 +40,10 @@
+ (NSString *)checkNull: (id)data;
+ (BOOL)checkStringIsNilOrSpance: (NSString *)str;
+ (NSMutableAttributedString *)setTextViewFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color;
+ (NSMutableAttributedString *)setTextViewBoldFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color;
+ (NSString *)trimmingCharacters:(NSString *)str;
+ (int)compareDate:(NSString*)oneDate withDate:(NSString*)twoDate;
+ (BOOL)checkIsPermission:(NSString *)permission;
+(UILabel *)labelWithTitle:(NSString *)title frame:(CGRect)frame textFont:(UIFont *)titleFont;
+ (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color;
@end
......@@ -224,6 +224,14 @@
return attributeStr;
}
+ (NSMutableAttributedString *)setTextViewBoldFontOfString:(NSString *)string paragraphStyle:(NSInteger)lineHeight fontSize:(float)size color:(UIColor *)color {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];
paragraphStyle.lineSpacing = lineHeight;
NSDictionary *attributes = @{ NSFontAttributeName:[UIFont boldSystemFontOfSize:size],NSForegroundColorAttributeName :color, NSParagraphStyleAttributeName:paragraphStyle};
NSMutableAttributedString *attributeStr = [[NSMutableAttributedString alloc] initWithString:string attributes:attributes];
return attributeStr;
}
+ (NSString *)trimmingCharacters:(NSString *)str{
NSString *newStr = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
return newStr;
......@@ -258,4 +266,36 @@
return NO;
}
+(UILabel *)labelWithTitle:(NSString *)title frame:(CGRect)frame textFont:(UIFont *)titleFont
{
UILabel * titleLabel = [[UILabel alloc] initWithFrame:frame];
titleLabel.backgroundColor = [UIColor clearColor];
titleLabel.font = titleFont;
titleLabel.textColor = [UIColor blackColor];
titleLabel.numberOfLines = 1;
//设置文字过长时的显示格式,截去尾部...
titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
titleLabel.text=title;
return titleLabel;
}
+ (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color
{
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitle:title forState:UIControlStateNormal];
button.frame = frame;
button.titleLabel.font = [UIFont systemFontOfSize:fontSize];
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
button.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
[button setImage:image forState:UIControlStateNormal];
[button setTitleColor:color forState:UIControlStateNormal];
return button;
}
@end
......@@ -217,11 +217,15 @@
#define TRANSPORT_ACTION_FINISH @"500504" //结束权
#define TRANSPORT_ACTION_ABORT @"500505" //作废权
//选中的颜色
#define BASESELECT_COLOR RGBA(255, 127, 0, 1)
//销售
#define SaleDay @"日"
#define SaleWeek @"周"
#define SaleMonth @"月"
//选中的颜色
#define BASESELECT_COLOR RGBA(255, 127, 0, 1)
#endif
......@@ -25,4 +25,12 @@
+ (UIButton *)creatButtonWithFrame:(CGRect)frame target:(id)target sel:(SEL)sel tag:(NSInteger)tag image:(NSString *)name title:(NSString *)title titleColor:(UIColor *)titleCorlor isCorner:(BOOL)isCornor corner:(CGFloat)corner bgColor:(UIColor *)bgcolor;
#pragma mark - border
- (void)addTopBorderWithHeight:(CGFloat)height color:(UIColor *)color;
- (void)addBottomBorderWithHeight:(CGFloat)height color:(UIColor *)color;
- (void)addLeftBorderWithWidth:(CGFloat)width color:(UIColor *)color;
- (void)addRightBorderWithWidth:(CGFloat)width color:(UIColor *)color;
@end
......@@ -92,5 +92,39 @@
return button;
}
#pragma mark - border
- (void)addTopBorderWithHeight:(CGFloat)height color:(UIColor *)color
{
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(0, 0, self.frame.size.width, height);
layer.backgroundColor = color.CGColor;
[self.layer addSublayer:layer];
}
- (void)addBottomBorderWithHeight:(CGFloat)height color:(UIColor *)color
{
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(0, self.frame.size.height - height, self.frame.size.width, height);
layer.backgroundColor = color.CGColor;
[self.layer addSublayer:layer];
}
- (void)addLeftBorderWithWidth:(CGFloat)width color:(UIColor *)color
{
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(0, 0, width, self.frame.size.height);
layer.backgroundColor = color.CGColor;
[self.layer addSublayer:layer];
}
- (void)addRightBorderWithWidth:(CGFloat)width color:(UIColor *)color
{
CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(self.frame.size.width - width, 0, width, self.frame.size.height);
layer.backgroundColor = color.CGColor;
[self.layer addSublayer:layer];
}
@end
......@@ -396,8 +396,7 @@ typedef enum : NSUInteger {
billProduct.basePrice = [NSNumber numberWithFloat:0];
billProduct.total = [NSNumber numberWithFloat:0];
billProduct.remark = @"";
#warning 包装规格说明是不是少了在NoticeProduct
billProduct.qpcStr = @"无";
billProduct.qpcStr = [NSString stringWithFormat:@"1*%@",product.qpc];
[billArr addObject:billProduct];
}
return billArr;
......
......@@ -221,7 +221,7 @@ typedef enum : NSUInteger {
self.shopDetail.merchandise = self.productNameStr;
self.shopDetail.packageSpecification = packageSpecification.text;
self.shopDetail.packageQpcStr = self.packageQpcStr;
self.shopDetail.packageQpcStr = [NSString stringWithFormat:@"1*%@",packageSpecification.text];
self.shopDetail.packageQpcUnit = self.productMeasureUnit;
self.shopDetail.packageUnit = self.packageUintStr;
......@@ -407,7 +407,6 @@ typedef enum : NSUInteger {
self.productNameStr = product.name;
self.productUuidStr = product.uuid;
self.productCodeStr = product.code;
self.packageQpcStr = product.qpcStr;
self.productMeasureUnit = product.measureUnit;
if (self.selectProducts.count > 0) {
[self.selectProducts removeAllObjects];
......
......@@ -33,7 +33,7 @@ typedef enum : NSUInteger {
UITextField *_leftmoneyField;
HPGrowingTextView *_noteTextView;
}
@property (nonatomic,strong)NSString *selectStr;
@end
@implementation NewCostViewController
......@@ -233,6 +233,8 @@ typedef enum : NSUInteger {
_leftmoneyField.text = [self.accountDetail.leftmoney stringValue];
_noteTextView.text = self.accountDetail.note;
self.selectStr = self.accountDetail.accounttitle;
}
- (void)textChange:(UITextField *)textField{
if (_actualmoneyField.text.length > 0 && _paidmoneyField.text.length > 0 ) {
......@@ -247,11 +249,15 @@ typedef enum : NSUInteger {
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row == 0){
ChooseCostViewController *cvc = [ChooseCostViewController new];
if (self.selectStr.length > 0) {
cvc.selectStr = self.selectStr;
}
cvc.choseBaseInfo = ^(NSArray *costs){
if (costs.count > 0) {
Accounttitle *type = costs[0];
_chooseCostLabel.text = type.name;
_chooseCostLabel.textColor = GXF_CONTENT_COLOR;
self.selectStr = type.name;
}
};
[self PushViewController:cvc animated:YES];
......
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