// // PurchaseNoticeCell.m // XFFruit // // Created by mac on 15/8/18. // Copyright (c) 2015年 Xummer. All rights reserved. // #import "PurchaseNoticeCell.h" #define TitleSize 16 #define LeftMargin 15 #define TableHeight 46 #define TableWidth 60 #define LeftWidth 40 #define RightWidth 30 @implementation PurchaseNoticeCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { self.isSelected=NO; [self initdata]; [self bulidLayout]; } return self; } -(void)initdata { self.shopeName=[[UILabel alloc]init];//商品 self.packageSpecification=[[UILabel alloc]init];//包装规格 self.packageQuantity=[[UILabel alloc]init];;//包装数量 self.packageUnit=[[UILabel alloc]init]; ;//包装单位 self.foundationQuantity=[[UILabel alloc]init];;//基础数量 self.foundationUnitPrice=[[UILabel alloc]init];;//基础单价 self.packageUnitPrice=[[UILabel alloc]init];;//包装单价 self.totalMoney=[[UILabel alloc]init];;//总金额 self.remark=[[UILabel alloc]init];;//备注 self.shopDetailAry1=[NSArray arrayWithObjects: self.packageSpecification, self.foundationQuantity ,self.remark,nil]; self.shopDetailAry2=[NSArray arrayWithObjects: self.packageQuantity, self.packageUnit ,nil]; } - (void)bulidLayout { CGFloat gipWidth = (ScreenSize.width-(LeftMargin+20)-RightWidth-2)/3; self.shopeName.textAlignment= NSTextAlignmentLeft; self.shopeName.textColor = GXF_PLACEHOLDER_COLOR; self.shopeName.font = FontSize(TitleSize-2); self.HeardLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, ScreenSize.width - LeftMargin * 2, 1))]; self.HeardLabel.backgroundColor = HexColor(@"e5e5e5"); self.HeardLabel.font = FontSize(TitleSize); self.FootLabel=[[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.size.height-1, ScreenSize.width - LeftMargin * 2, 1))]; self.FootLabel.backgroundColor = HexColor(@"e5e5e5"); self.FootLabel.font = FontSize(TitleSize); self.arrowView=[[UIImageView alloc]initWithFrame:CGRectMake(LeftMargin, (TableHeight - 10)/2 , 10, 10)]; self.arrowView.image = [UIImage imageNamed:@"arrowright"]; self.arrowView.contentMode = UIViewContentModeScaleAspectFit; self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, gipWidth, TableHeight))]; self.SpLabel.textAlignment= NSTextAlignmentLeft; self.SpLabel.textColor = HexColor(@"666666"); self.SpLabel.font = FontSize(TitleSize); // self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20+self.SpLabel.size.width+gipWidth , 0, TableWidth,TableHeight ))]; // self.DjLabel.textAlignment= NSTextAlignmentLeft; // self.DjLabel.textColor = HexColor(@"666666"); // self.DjLabel.font = FontSize(TitleSize); self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+20+gipWidth+1, 0, gipWidth, TableHeight)]; self.BzggLabel.textAlignment= NSTextAlignmentLeft; self.BzggLabel.textColor = HexColor(@"666666"); self.BzggLabel.font = FontSize(TitleSize); self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+20+2*gipWidth+2, 0, gipWidth, TableHeight)]; self.BzslLabel.textAlignment= NSTextAlignmentLeft; self.BzslLabel.textColor = HexColor(@"666666"); self.BzslLabel.font = FontSize(TitleSize); self.subSview=[[UIView alloc]initWithFrame:CGRectMake(0, TableHeight, self.contentView.width, TableHeight*2)]; NSArray*array=[NSArray arrayWithObjects:@"包装规格:",@"基础数量:" ,@"备注:",nil]; NSArray*array1=[NSArray arrayWithObjects:@"包装数量:",@"包装单位:" ,nil]; UILabel *shopeNameLable=[[UILabel alloc]init]; shopeNameLable.frame=CGRectMake(LeftWidth, 0, (self.contentView.width-2*LeftMargin)/4, TableHeight*2/4); shopeNameLable.text=@"商品:"; shopeNameLable.font=FontSize(TitleSize-2); [shopeNameLable setTextColor:GXF_PLACEHOLDER_COLOR]; [self.subSview addSubview:shopeNameLable]; self.shopeName.frame=CGRectMake(shopeNameLable.frame.origin.x+shopeNameLable.frame.size.width, shopeNameLable.frame.origin.y,(self.contentView.width-2*LeftMargin)/4*3, TableHeight*2/4); [self.subSview addSubview:self.shopeName]; for (int i=0; i