Browse Source

优惠券展示优化

iOS-Abel 2 years ago
parent
commit
c8a780679f
18 changed files with 158 additions and 2 deletions
  1. 1 0
      Asteria/ASUI/ColorDefine.h
  2. 46 2
      Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponListCell.m
  3. 1 0
      Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponsListViewController.m
  4. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/Contents.json
  5. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/减去 6@2x.png
  6. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/减去 6@3x.png
  7. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/Contents.json
  8. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/减去 11@2x.png
  9. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/减去 11@3x.png
  10. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/Contents.json
  11. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/减去 8@2x.png
  12. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/减去 8@3x.png
  13. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/Contents.json
  14. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/路径 14935@2x.png
  15. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/路径 14935@3x.png
  16. 22 0
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/Contents.json
  17. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/路径 14933@2x.png
  18. BIN
      Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/路径 14933@3x.png

+ 1 - 0
Asteria/ASUI/ColorDefine.h

@@ -38,6 +38,7 @@
 
 #define _E5E5E5 ([UIColor colorWithHexString:@"#E5E5E5"])
 #define _F5F5F5 ([UIColor colorWithHexString:@"#F5F5F5"])
+#define _DBDBDB ([UIColor colorWithHexString:@"#DBDBDB"])
 
 #define _0E0E0F ([UIColor colorWithHexString:@"#0E0E0F"])
 #define _043632 ([UIColor colorWithHexString:@"#043632"])

+ 46 - 2
Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponListCell.m

@@ -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];

+ 1 - 0
Asteria/Fuction/UserCenter/ConponsAndGiftCard/ASCouponsListViewController.m

@@ -13,6 +13,7 @@
 @property (nonatomic, strong) UIView *colorBgV;
 @property (nonatomic, strong) UITableView *tableV;
 
+
 @end
 
 @implementation ASCouponsListViewController

+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "减去 6@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "减去 6@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/减去 6@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg1_sel.imageset/减去 6@3x.png


+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "减去 11@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "减去 11@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/减去 11@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_colorBg2_sel.imageset/减去 11@3x.png


+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "减去 8@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "减去 8@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/减去 8@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line1_sel.imageset/减去 8@3x.png


+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "路径 14935@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "路径 14935@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/路径 14935@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_line2_sel.imageset/路径 14935@3x.png


+ 22 - 0
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "路径 14933@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "路径 14933@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/路径 14933@2x.png


BIN
Asteria/Fuction/UserCenter/UserCenter.xcassets/coupons/uc_coupon_sep_sel.imageset/路径 14933@3x.png