PurchaseNoticeCell.m 4.22 KB
Newer Older
朱朝吉's avatar
朱朝吉 committed
1 2 3 4 5 6 7 8 9
//
//  PurchaseNoticeCell.m
//  XFFruit
//
//  Created by mac on 15/8/18.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "PurchaseNoticeCell.h"
zhu's avatar
zhu committed
10
#define TitleSize 17
朱朝吉's avatar
朱朝吉 committed
11
#define LeftMargin 15
zhu's avatar
zhu committed
12 13 14
#define TableHeight 46
#define TableWidth 60

朱朝吉's avatar
朱朝吉 committed
15 16 17 18 19 20
@implementation PurchaseNoticeCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
zhu's avatar
zhu committed
21 22
        
        self.isSelected=NO;
朱朝吉's avatar
朱朝吉 committed
23 24 25 26 27 28 29
        [self bulidLayout];
    }
    return self;
}

- (void)bulidLayout
{
zhu's avatar
zhu committed
30 31 32 33 34 35 36
    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.HeardLabel.backgroundColor = HexColor(@"e5e5e5");
    self.HeardLabel.font = FontSize(TitleSize);
朱朝吉's avatar
朱朝吉 committed
37
    
zhu's avatar
zhu committed
38
    self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, TableWidth, TableHeight))];
朱朝吉's avatar
朱朝吉 committed
39 40 41 42
    self.SpLabel.textAlignment= NSTextAlignmentLeft;
    self.SpLabel.textColor = HexColor(@"666666");
    self.SpLabel.font = FontSize(TitleSize);
    
zhu's avatar
zhu committed
43 44 45
    self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+80, 0,  TableWidth,TableHeight ))];
    self.DjLabel.textAlignment= NSTextAlignmentLeft;
    self.DjLabel.textColor = HexColor(@"666666");
朱朝吉's avatar
朱朝吉 committed
46 47
    self.DjLabel.font = FontSize(TitleSize);
    
zhu's avatar
zhu committed
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
    self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+150, 0, TableWidth, TableHeight)];
    self.BzggLabel.textAlignment= NSTextAlignmentLeft;
    self.BzggLabel.textColor = HexColor(@"666666");
    self.BzggLabel.font = FontSize(TitleSize);
    
    self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(LeftMargin+240, 0, TableWidth, TableHeight)];
    self.BzslLabel.textAlignment= NSTextAlignmentLeft;
    self.BzslLabel.textColor = HexColor(@"666666");
    self.BzslLabel.font = FontSize(TitleSize);
    
    self.SpLabel.text=@"1 西瓜";
    self.DjLabel.text=@"0.8";
    self.BzggLabel.text=@"1*12";
    self.BzslLabel.text=@"100框";
    self.subSview=[[UIView alloc]initWithFrame:CGRectMake(0, 50, ScreenSize.width, TableHeight*3)];
    
   
    
    NSArray*array=[NSArray arrayWithObjects:@"包装规格",@"基础数量" ,@"包装单价",@"备注",nil];
    NSArray*array1=[NSArray arrayWithObjects:@"包装数量",@"基础单价" ,@"总金额",nil];
    
    for (int i=0; i<array.count; i++) {
        UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth-10, i*(10+10), 100, 10)];
        lable.text=[array objectAtIndex:i];
        lable.font=FontSize(TitleSize-2);
        [lable setTextColor:HexColor(@"444444")];
        [self.subSview addSubview:lable];
    }
    for (int i=0; i<array1.count; i++) {
        UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(TableWidth+150, i*(10+10), 100, 10)];
        lable.text=[array objectAtIndex:i];
        lable.font=FontSize(TitleSize-2);
        [lable setTextColor:HexColor(@"444444")];
        [self.subSview addSubview:lable];
    }
    self.subSview.hidden=YES;
    
    self.button=[UIButton buttonWithType:UIButtonTypeCustom];
    [self.button setFrame:CGRectMake(310, 0, 50, 50)];
    [self.button setImage:[UIImage imageNamed:@"AttachHide"] forState:UIControlStateNormal];
//    [self.button setTitle:@"编辑" forState:UIControlStateNormal];
//    [self.button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    [self.contentView addSubview:self.button];
     [self.contentView addSubview:self.subSview];
朱朝吉's avatar
朱朝吉 committed
92 93 94 95
    [self.contentView addSubview:self.SpLabel];
    [self.contentView addSubview:self.DjLabel];
    [self.contentView addSubview:self.BzslLabel];
    [self.contentView addSubview:self.BzggLabel];
zhu's avatar
zhu committed
96 97
    [self.contentView  addSubview:self.HeardLabel];
//    [self.contentView  addSubview:self.FootLabel];
朱朝吉's avatar
朱朝吉 committed
98 99
}
- (void)setTitleStr:(NSString *)str
zhu's avatar
zhu committed
100

朱朝吉's avatar
朱朝吉 committed
101
{
zhu's avatar
zhu committed
102 103 104 105
  
   
   
    }
朱朝吉's avatar
朱朝吉 committed
106 107 108 109 110 111 112 113 114 115 116
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end