|
@@ -26,7 +26,7 @@
|
|
|
|
|
|
@property (nonatomic, strong) UIButton *cpBt;
|
|
|
|
|
|
-@property (nonatomic, strong) UIImageView *usedTopV;
|
|
|
+@property (nonatomic, strong) UILabel *usedLb;
|
|
|
|
|
|
|
|
|
@end
|
|
@@ -60,6 +60,30 @@
|
|
|
self.dateLb.text = @"DTAE:2022/09/01-2022/09/30";
|
|
|
|
|
|
self.codeLb.text = @"3VIP55";
|
|
|
+
|
|
|
+ [self setStatus:arc4random()%2==1];
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setStatus:(BOOL)isUsed {
|
|
|
+ self.usedLb.hidden = !isUsed;
|
|
|
+ self.cpBt.hidden = isUsed;
|
|
|
+
|
|
|
+ self.titleLb.textColor = isUsed ? _DBDBDB : Col_000;
|
|
|
+ self.ruleLb.textColor = isUsed ? _DBDBDB : _043632;
|
|
|
+ self.dateLb.textColor = isUsed ? _DBDBDB : _128273;
|
|
|
+
|
|
|
+ self.codeTitleLb.textColor = isUsed ? Col_FFF : _043632;
|
|
|
+ self.codeLb.textColor = isUsed ? Col_FFF : _043632;
|
|
|
+
|
|
|
+ self.bg1.image = [UIImage imageNamed:isUsed ? @"uc_coupon_colorBg1_sel" : @"uc_coupon_colorBg1"];
|
|
|
+ self.bg2.image = [UIImage imageNamed:isUsed ? @"uc_coupon_colorBg2_sel" : @"uc_coupon_colorBg2"];
|
|
|
+
|
|
|
+ self.ln1.image = [UIImage imageNamed:isUsed ? @"uc_coupon_line1_sel" : @"uc_coupon_line1"];
|
|
|
+ self.ln2.image = [UIImage imageNamed:isUsed ? @"uc_coupon_line2_sel" : @"uc_coupon_line2"];
|
|
|
+
|
|
|
+ self.sep.image = [UIImage imageNamed:isUsed ? @"uc_coupon_sep_sel" : @"uc_coupon_sep"];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)loadSubVs {
|
|
@@ -89,7 +113,7 @@
|
|
|
make.width.equalTo(self.bgV).multipliedBy(106.0/(229+106));
|
|
|
}];
|
|
|
[self.sep mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.width.equalTo(@1);
|
|
|
+ make.width.equalTo(@3);
|
|
|
make.top.bottom.equalTo(self.bgV);
|
|
|
make.centerX.equalTo(self.bg2.mas_leading);
|
|
|
}];
|
|
@@ -160,6 +184,13 @@
|
|
|
|
|
|
st.transform = CGAffineTransformRotate(st.transform, -M_PI/2.0);
|
|
|
|
|
|
+ [self.bgV addSubview:self.usedLb];
|
|
|
+ [self.usedLb mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.center.equalTo(self.bgV);
|
|
|
+ }];
|
|
|
+
|
|
|
+ self.usedLb.transform = CGAffineTransformRotate(self.usedLb.transform, -M_PI/6.0);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (UIView *)bgV {
|
|
@@ -293,6 +324,19 @@
|
|
|
return _codeLb;
|
|
|
}
|
|
|
|
|
|
+- (UILabel *)usedLb {
|
|
|
+ if (!_usedLb) {
|
|
|
+ UILabel *lb = [UILabel baseLb];
|
|
|
+ lb.textAlignment = NSTextAlignmentCenter;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Bold size:48];
|
|
|
+ lb.textColor = Col_666;
|
|
|
+ lb.text = @"USED";
|
|
|
+ lb.hidden = true;
|
|
|
+ _usedLb = lb;
|
|
|
+ }
|
|
|
+ return _usedLb;
|
|
|
+}
|
|
|
+
|
|
|
- (UIButton *)cpBt {
|
|
|
if (!_cpBt) {
|
|
|
UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
|