| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- //
- // CartFrame.m
- // IBOSSmini
- //
- // Created by guan hong hou on 2017/5/18.
- // Copyright © 2017年 elongtian. All rights reserved.
- //
- #import "CartFrame.h"
- #import "NSString+Tools.h"
- @implementation CartFrame
- -(void)setOrderCartModel:(ShopCartItemModel *)cartItem{
- _cartModel=cartItem;
- CGFloat xpadding =10;
- CGFloat ypadding =10;
- NSDictionary *orderDict = @{NSFontAttributeName:orderTextFont};
- _btnCheckF=CGRectMake(xpadding, ypadding+3,25,25);
-
- NSString *productCode= [_cartModel code];
- if(productCode!=nil){
- CGRect productCodeFrame = [productCode textRectWithSize:CGSizeMake(150, MAXFLOAT) attributes:orderDict];
- productCodeFrame.origin.x =CGRectGetMaxX(_btnCheckF)+10;
- productCodeFrame.origin.y = ypadding+7;
- _lblProductCodeF = productCodeFrame;
- }
- _btnDeleteF=CGRectMake(Screen_Width-80, ypadding+3,80, 25);
- _topSeparatorF=CGRectMake(0,CGRectGetMaxY(_btnDeleteF)+13,Screen_Width, 1);
- NSString *titleBrand=@"品牌:";
- CGRect titleBrandFrame = [titleBrand textRectWithSize:CGSizeMake(150, MAXFLOAT) attributes:orderDict];
- titleBrandFrame.origin.x =xpadding+5;
- titleBrandFrame.origin.y = CGRectGetMaxY(_topSeparatorF)+10;
- _lblTitleBrandF = titleBrandFrame;
- NSString *brand=[_cartModel brandName];
- if(brand!=nil){
- CGRect brandFrame = [brand textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:orderDict];
- brandFrame.origin.x =CGRectGetMaxX(_lblTitleBrandF)+8;
- brandFrame.origin.y = CGRectGetMaxY(_topSeparatorF)+10;
- _lblBrandF = brandFrame;
- }
- NSString *titleOnlyCode=@"唯一编码:";
- CGRect titleOnlyCodeFrame = [titleOnlyCode textRectWithSize:CGSizeMake(100, MAXFLOAT) attributes:orderDict];
- titleOnlyCodeFrame.origin.x =Screen_Width/2;
- titleOnlyCodeFrame.origin.y = CGRectGetMaxY(_topSeparatorF)+10;
- _lblTitleOnlyCodeF=titleOnlyCodeFrame;
- NSString *onlyCode=[_cartModel onlyCode];
- if(onlyCode!=nil){
- CGRect onlyCodeFrame = [onlyCode textRectWithSize:CGSizeMake(150, MAXFLOAT) attributes:orderDict];
- onlyCodeFrame.origin.x =CGRectGetMaxX(_lblTitleOnlyCodeF)+8;
- onlyCodeFrame.origin.y = CGRectGetMaxY(_topSeparatorF)+10;
- _lblOnlyCodeF=onlyCodeFrame;
- }
-
- NSString *titleColorNumber=@"色号:";
- CGRect titleColorNumberFrame = [titleColorNumber textRectWithSize:CGSizeMake(100, MAXFLOAT) attributes:orderDict];
- titleColorNumberFrame.origin.x =xpadding+5;
- titleColorNumberFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblTitleColorNumberF= titleColorNumberFrame;
- NSString *colorNumber=[_cartModel colorNumber];
- CGRect colorNumberFrame = [colorNumber textRectWithSize:CGSizeMake(150, MAXFLOAT) attributes:orderDict];
-
- colorNumberFrame.origin.x =CGRectGetMaxX(_lblTitleColorNumberF)+8;
- colorNumberFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblColorNumberF=colorNumberFrame;
-
- NSString *titleSpecification=@"规格:";
- CGRect titleSpecificationFrame = [titleSpecification textRectWithSize:CGSizeMake(100, MAXFLOAT) attributes:orderDict];
- titleSpecificationFrame.origin.x =Screen_Width/3;
- titleSpecificationFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblTitleSpecificationF= titleSpecificationFrame;
-
- NSString *specification=[_cartModel specification];
- CGRect specificationFrame = [specification textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:orderDict];
- specificationFrame.origin.x =CGRectGetMaxX(titleSpecificationFrame)+8;
- specificationFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblSpecificationF= specificationFrame;
-
- NSString *titleGrade=@"等级:";
- CGRect titleGradeFrame = [titleGrade textRectWithSize:CGSizeMake(100, MAXFLOAT) attributes:orderDict];
- titleGradeFrame.origin.x =(Screen_Width/3)*2;
- titleGradeFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblTitleGradeF=titleGradeFrame;
- NSString *grade=[_cartModel gradeName];
- CGRect gradeFrame = [grade textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:orderDict];
- gradeFrame.origin.x =CGRectGetMaxX(titleGradeFrame)+8;
- gradeFrame.origin.y = CGRectGetMaxY(_lblTitleBrandF)+10;
- _lblGradeF=gradeFrame;
-
- NSString *titleWarehouseArea=@"库区:";
- CGRect titleWarehouseAreaFrame = [titleWarehouseArea textRectWithSize:CGSizeMake(100, MAXFLOAT) attributes:orderDict];
- titleWarehouseAreaFrame.origin.x =xpadding+5;
- titleWarehouseAreaFrame.origin.y = CGRectGetMaxY(_lblTitleColorNumberF)+10;
- _lblTitleWareHouseAreaF= titleWarehouseAreaFrame;
- NSString *warehouseArea=[_cartModel warehouseName];
- CGRect warehouseAreaFrame = [warehouseArea textRectWithSize:CGSizeMake(200, MAXFLOAT) attributes:orderDict];
- warehouseAreaFrame.origin.x =CGRectGetMaxX(_lblTitleWareHouseAreaF)+8;
- warehouseAreaFrame.origin.y = CGRectGetMaxY(_lblTitleColorNumberF)+10;
- _lblWareHouseAreaF=warehouseAreaFrame;
- _middleSeparatorF=CGRectMake(0,CGRectGetMaxY(_lblTitleWareHouseAreaF)+10,Screen_Width, 1);
- _btnSubstractQuantityF=CGRectMake(Screen_Width-220,CGRectGetMaxY(_middleSeparatorF)+5,25,25);
- _txtQuantityF=CGRectMake(CGRectGetMaxX(_btnSubstractQuantityF)-1,CGRectGetMaxY(_middleSeparatorF)+5,150,25);
- _btnAddQuantityF=CGRectMake(CGRectGetMaxX(_txtQuantityF)-1,CGRectGetMaxY(_middleSeparatorF)+5,25,25);
- _bottomSeparatorF=CGRectMake(0,CGRectGetMaxY(_btnSubstractQuantityF)+5,Screen_Width, 10);
- _cellHeight=CGRectGetMaxY(_bottomSeparatorF);
- }
- @end
|