PurchaseNoticeCell.m 4.65 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
#define TableHeight 46
#define TableWidth 60
zhu's avatar
zhu committed
14 15
#define LeftWidth 40
#define RightWidth 30
zhu's avatar
zhu committed
16

朱朝吉's avatar
朱朝吉 committed
17 18 19 20 21 22
@implementation PurchaseNoticeCell

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

- (void)bulidLayout
{
zhu's avatar
zhu committed
31
    CGFloat gipWidth = (ScreenSize.width-4*TableWidth-(LeftMargin+20)-RightWidth)/3;
zhu's avatar
zhu committed
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))];
zhu's avatar
zhu committed
37 38 39 40 41 42
    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;
朱朝吉's avatar
朱朝吉 committed
43
    
zhu's avatar
zhu committed
44
    self.SpLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20, 0, TableWidth, TableHeight))];
朱朝吉's avatar
朱朝吉 committed
45 46 47 48
    self.SpLabel.textAlignment= NSTextAlignmentLeft;
    self.SpLabel.textColor = HexColor(@"666666");
    self.SpLabel.font = FontSize(TitleSize);
    
zhu's avatar
zhu committed
49
    self.DjLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin+20+self.SpLabel.size.width+gipWidth , 0,  TableWidth,TableHeight ))];
zhu's avatar
zhu committed
50 51
    self.DjLabel.textAlignment= NSTextAlignmentLeft;
    self.DjLabel.textColor = HexColor(@"666666");
朱朝吉's avatar
朱朝吉 committed
52 53
    self.DjLabel.font = FontSize(TitleSize);
    
zhu's avatar
zhu committed
54
    self.BzggLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.DjLabel.frame.origin.x+self.DjLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
zhu's avatar
zhu committed
55 56 57 58
    self.BzggLabel.textAlignment= NSTextAlignmentLeft;
    self.BzggLabel.textColor = HexColor(@"666666");
    self.BzggLabel.font = FontSize(TitleSize);
    
zhu's avatar
zhu committed
59
    self.BzslLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.BzggLabel.frame.origin.x+self.BzggLabel.size.width+gipWidth, 0, TableWidth, TableHeight)];
zhu's avatar
zhu committed
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
    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++) {
zhu's avatar
zhu committed
76 77 78 79
        UILabel *lable=[[UILabel alloc]init];
//        if (i==0) {
            lable.frame=CGRectMake(LeftWidth, i*(10+10), 100, 10);
//        }
zhu's avatar
zhu committed
80 81 82 83 84 85
        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++) {
zhu's avatar
zhu committed
86
        UILabel *lable=[[UILabel alloc]initWithFrame:CGRectMake(ScreenSize.width/2, i*(10+10), 60, 10)];
zhu's avatar
zhu committed
87 88 89 90 91 92 93 94
        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];
zhu's avatar
zhu committed
95
    [self.button setFrame:CGRectMake(ScreenSize.width-50, 0, 50, 50)];
zhu's avatar
zhu committed
96
    [self.button setImage:[UIImage imageNamed:@"edit"] forState:UIControlStateNormal];
zhu's avatar
zhu committed
97 98
    [self.contentView addSubview:self.button];
     [self.contentView addSubview:self.subSview];
朱朝吉's avatar
朱朝吉 committed
99 100 101 102
    [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
103
    [self.contentView  addSubview:self.HeardLabel];
zhu's avatar
zhu committed
104
    [self.contentView addSubview:self.arrowView];
zhu's avatar
zhu committed
105
//    [self.contentView  addSubview:self.FootLabel];
朱朝吉's avatar
朱朝吉 committed
106 107
}
- (void)setTitleStr:(NSString *)str
zhu's avatar
zhu committed
108

朱朝吉's avatar
朱朝吉 committed
109
{
zhu's avatar
zhu committed
110 111 112 113
  
   
   
    }
朱朝吉's avatar
朱朝吉 committed
114 115 116 117 118 119 120 121 122 123 124
- (void)awakeFromNib {
    // Initialization code
}

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

    // Configure the view for the selected state
}

@end