|
@@ -15,16 +15,19 @@
|
15
|
15
|
self=[super initWithFrame:frame];
|
16
|
16
|
if (self) {
|
17
|
17
|
|
18
|
|
- self.imgView=[[SDCycleScrollView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 355+KDStatusHeight)];
|
|
18
|
+ self.imgView=[[SDCycleScrollView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 395+KDStatusHeight)];
|
19
|
19
|
self.imgView.backgroundColor=[UIColor colorWithHexString:LineColor];
|
20
|
20
|
[self addSubview:self.imgView];
|
21
|
21
|
|
22
|
|
-
|
|
22
|
+ UIView*backV=[[UIView alloc]initWithFrame:CGRectMake(0, self.imgView.height-50, SCREEN_WIDTH, 50)];
|
|
23
|
+ backV.backgroundColor=[UIColor colorWithHexString:@"#444444"];
|
|
24
|
+ [self addSubview:backV];
|
|
25
|
+
|
23
|
26
|
|
24
|
27
|
|
25
|
|
- self.shopImgV=[[UIImageView alloc]initWithFrame:CGRectMake(10, self.imgView.bottom+14, 20, 20)];
|
26
|
|
- self.shopImgV.image=[UIImage imageNamed:@"taobao_icon"];
|
27
|
|
- [self addSubview:self.shopImgV];
|
|
28
|
+// self.shopImgV=[[UIImageView alloc]initWithFrame:CGRectMake(10, self.imgView.bottom+14, 20, 20)];
|
|
29
|
+// self.shopImgV.image=[UIImage imageNamed:@"taobao_icon"];
|
|
30
|
+// [self addSubview:self.shopImgV];
|
28
|
31
|
|
29
|
32
|
self.detailTitleL=[[UILabel alloc]initWithFrame:CGRectMake(10, self.imgView.bottom+14, SCREEN_WIDTH-20, 45)];
|
30
|
33
|
self.detailTitleL.numberOfLines=0;
|
|
@@ -34,17 +37,37 @@
|
34
|
37
|
[self addSubview:self.detailTitleL];
|
35
|
38
|
|
36
|
39
|
|
37
|
|
- self.priceL=[[UILabel alloc]initWithFrame:CGRectMake(10, self.detailTitleL.bottom+8, 300, 36)];
|
38
|
|
- self.priceL.textColor=[UIColor blackColor];
|
|
40
|
+ self.priceL=[[UILabel alloc]initWithFrame:CGRectMake(10, 0, 300, 50)];
|
|
41
|
+ self.priceL.textColor=[UIColor whiteColor];
|
39
|
42
|
self.priceL.font=[UIFont boldSystemFontOfSize:25];
|
40
|
43
|
self.priceL.text=@"¥--";
|
41
|
|
- [self addSubview:self.priceL];
|
42
|
44
|
|
43
|
|
- self.originalLabel=[[UILabel alloc]initWithFrame:CGRectMake(10, self.priceL.bottom+5, 100, 14)];
|
44
|
|
- self.originalLabel.textColor=[UIColor colorWithHexString:@"#A9A9A9"];
|
|
45
|
+ [backV addSubview:self.priceL];
|
|
46
|
+ [self.priceL mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
47
|
+ make.height.mas_equalTo(50);
|
|
48
|
+ make.left.mas_equalTo(10);
|
|
49
|
+ make.top.mas_equalTo(0);
|
|
50
|
+ }];
|
|
51
|
+
|
|
52
|
+ self.originalLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.priceL.right+10, 0, 100, 50)];
|
|
53
|
+ self.originalLabel.textColor=[UIColor whiteColor];
|
45
|
54
|
self.originalLabel.font=[UIFont systemFontOfSize:10];
|
46
|
|
- [self addSubview:self.originalLabel];
|
|
55
|
+ [backV addSubview:self.originalLabel];
|
|
56
|
+ [self.originalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
57
|
+ make.left.mas_equalTo(self.priceL.mas_right).offset(5);
|
|
58
|
+ make.height.mas_equalTo(45);
|
|
59
|
+ make.top.mas_equalTo(5);
|
|
60
|
+ }];
|
47
|
61
|
|
|
62
|
+ self.profitsLabel=[[UILabel alloc]initWithFrame:CGRectMake(backV.width-88, 11, 78, 28)];
|
|
63
|
+ self.profitsLabel.text=@"利润 --%";
|
|
64
|
+ self.profitsLabel.textColor=[UIColor whiteColor];
|
|
65
|
+ self.profitsLabel.font=[UIFont systemFontOfSize:16];
|
|
66
|
+ self.profitsLabel.backgroundColor=[UIColor gradientOneColor:[UIColor colorWithHexString:@"#FF235F"] toColor:[UIColor colorWithHexString:@"#FF7676"] Width:78];
|
|
67
|
+ self.profitsLabel.layer.cornerRadius=6;
|
|
68
|
+ self.profitsLabel.layer.masksToBounds=YES;
|
|
69
|
+ self.profitsLabel.textAlignment=NSTextAlignmentCenter;
|
|
70
|
+ [backV addSubview:self.profitsLabel];
|
48
|
71
|
//原件
|
49
|
72
|
NSString *textStr =@"¥---";
|
50
|
73
|
|
|
@@ -53,17 +76,18 @@
|
53
|
76
|
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:textStr attributes:attribtDic];
|
54
|
77
|
self.originalLabel.attributedText=attribtStr;
|
55
|
78
|
|
56
|
|
- self.volumeL=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-150, self.originalLabel.top, 140, 14)];
|
|
79
|
+ self.volumeL=[[UILabel alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-150, self.detailTitleL.bottom+5, 140, 14)];
|
57
|
80
|
self.volumeL.textAlignment=NSTextAlignmentRight;
|
58
|
81
|
self.volumeL.text=@"月销:--";
|
59
|
82
|
self.volumeL.textColor=[UIColor colorWithHexString:@"#a9a9a9"];
|
60
|
83
|
self.volumeL.font=[UIFont systemFontOfSize:10];
|
61
|
84
|
[self addSubview:self.volumeL];
|
62
|
85
|
|
|
86
|
+
|
63
|
87
|
[self addSubview:self.couponImgV];
|
|
88
|
+
|
64
|
89
|
[self.couponImgV addSubview:self.couponPriceL];
|
65
|
|
-
|
66
|
|
- self.couponImgV.frame=CGRectMake(SCREEN_WIDTH-70, self.priceL.top, 60, 16);
|
|
90
|
+ self.couponImgV.frame=CGRectMake(self.detailTitleL.left, self.volumeL.top-1, 60, 16);
|
67
|
91
|
self.couponPriceL.frame=CGRectMake(20, 0, 40, 16);
|
68
|
92
|
|
69
|
93
|
|
|
@@ -88,27 +112,20 @@
|
88
|
112
|
if (model.title.length<=0) {
|
89
|
113
|
return;
|
90
|
114
|
}
|
91
|
|
- self.detailTitleL.attributedText=[KDPublicMethod sethanggaoWithStr:[NSString stringWithFormat:@" %@",model.title] linSpacing:5];
|
92
|
|
- if (model.shop_type.integerValue == 1) {
|
93
|
|
- self.shopImgV.image =[UIImage imageNamed:@"tm_icon"];
|
94
|
|
- }else{
|
95
|
|
- self.shopImgV.image =[UIImage imageNamed:@"taobao_icon"];
|
96
|
|
-
|
97
|
|
- }
|
|
115
|
+ self.detailTitleL.attributedText=[KDPublicMethod sethanggaoWithStr:[NSString stringWithFormat:@"%@",model.title] linSpacing:5];
|
98
|
116
|
|
99
|
117
|
self.volumeL.text=[NSString stringWithFormat:@"月销 %@",model.volume];
|
100
|
118
|
|
101
|
|
- NSString *timetitle= [NSString stringWithFormat:@"¥%@/利润%@",model.discount_price,model.commission_rate];
|
102
|
|
- NSString *prices =[NSString stringWithFormat:@"¥%@/",model.discount_price];
|
|
119
|
+ NSString *timetitle= [NSString stringWithFormat:@"利润 %@",model.commission_rate];
|
|
120
|
+
|
103
|
121
|
NSMutableAttributedString *timestr = [[NSMutableAttributedString alloc] initWithString:timetitle];
|
104
|
|
- [timestr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:@"#333333"] range:NSMakeRange(0,prices.length)];
|
105
|
|
- [timestr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:16] range:NSMakeRange(prices.length,2)]; //设置字体字号和字体类别
|
106
|
|
- [timestr addAttribute:NSForegroundColorAttributeName value:[UIColor colorWithHexString:ThemeColor] range:NSMakeRange(prices.length,timetitle.length-prices.length)];
|
|
122
|
+ [timestr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0,3)]; //设置字体
|
|
123
|
+ self.profitsLabel.attributedText=timestr;
|
|
124
|
+
|
|
125
|
+ self.priceL.text=[NSString stringWithFormat:@"¥%@",model.discount_price];
|
107
|
126
|
|
108
|
|
- self.priceL.attributedText=timestr;
|
109
|
127
|
//原价
|
110
|
128
|
NSString *textStr =[NSString stringWithFormat:@"¥%@",model.price];
|
111
|
|
-
|
112
|
129
|
//中划线
|
113
|
130
|
NSDictionary *attribtDic = @{NSStrikethroughStyleAttributeName: [NSNumber numberWithInteger:NSUnderlineStyleSingle]};
|
114
|
131
|
NSMutableAttributedString *attribtStr = [[NSMutableAttributedString alloc]initWithString:textStr attributes:attribtDic];
|
|
@@ -120,7 +137,6 @@
|
120
|
137
|
[array addObjectsFromArray:model.small_img];
|
121
|
138
|
self.imgView.imageURLStringsGroup=array;
|
122
|
139
|
|
123
|
|
-
|
124
|
140
|
if (model.coupon_price.floatValue>0) {
|
125
|
141
|
self.couponImgV.hidden=NO;
|
126
|
142
|
self.couponPriceL.text=model.coupon_price;
|