|
@@ -0,0 +1,536 @@
|
|
|
+//
|
|
|
+// ASBirthdayTreatViewController.m
|
|
|
+// Asteria
|
|
|
+//
|
|
|
+// Created by iOS on 2023/7/1.
|
|
|
+//
|
|
|
+
|
|
|
+#import "ASBirthdayTreatViewController.h"
|
|
|
+
|
|
|
+@interface ASBirthdayTreatViewController ()
|
|
|
+
|
|
|
+@property (nonatomic, strong) UIScrollView *scrollV;
|
|
|
+@property (nonatomic, strong) UIView *bgV;
|
|
|
+@property (nonatomic, strong) UIImageView *bgImgV;
|
|
|
+
|
|
|
+@property (nonatomic, strong) UIImageView *topImgV;
|
|
|
+@property (nonatomic, strong) UIImageView *titleImgV;
|
|
|
+@property (nonatomic, strong) UILabel * contentLB;
|
|
|
+
|
|
|
+@property (nonatomic, strong) UILabel * codeDesLB;
|
|
|
+
|
|
|
+@property (nonatomic, strong) UIView *btnV;
|
|
|
+@property (nonatomic, strong) UIButton *startBt;
|
|
|
+
|
|
|
+@property (nonatomic, strong) UIView *dateV;
|
|
|
+@property (nonatomic, strong) UILabel *monthLb;
|
|
|
+@property (nonatomic, strong) UILabel *dayLb;
|
|
|
+@property (nonatomic, strong) UIImageView *dayBgV;
|
|
|
+@property (nonatomic, strong) UILabel *yearLb;
|
|
|
+
|
|
|
+@end
|
|
|
+
|
|
|
+@implementation ASBirthdayTreatViewController
|
|
|
+
|
|
|
+- (void)viewDidLoad {
|
|
|
+ [super viewDidLoad];
|
|
|
+ // Do any additional setup after loading the view.
|
|
|
+ self.titleStr = @"Birthday Treat";
|
|
|
+ [self setNavRightSearch:^{
|
|
|
+
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self loadSubviews];
|
|
|
+ [self configSubVs];
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)viewWillAppear:(BOOL)animated {
|
|
|
+ [super viewWillAppear:animated];
|
|
|
+
|
|
|
+// KWLoginedUserModel *info = [KWLoginedManager.shareInstance getCurrentLoginedUser];
|
|
|
+// if (info.isBirthday) {
|
|
|
+// @weakify(self);
|
|
|
+// [self.vm getVIPCouponData:^(BOOL flag) {
|
|
|
+// if (flag) {
|
|
|
+// weak_self.codeDesLB.text = [NSString stringWithFormat: @"USE CODE: %@\nGET DISCOUNT & GIFTPACK", weak_self.vm.code];
|
|
|
+// NSString *birthStr = [NSString stringWithFormat: @"Our Gift To You?\n$%@ To Spend On Your\nFavorite Hair.", weak_self.vm.amount];
|
|
|
+// weak_self.contentLB.text = birthStr;
|
|
|
+// }
|
|
|
+//
|
|
|
+//
|
|
|
+// }];
|
|
|
+// }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+- (void)configSubVs {
|
|
|
+
|
|
|
+ self.statusBgV.backgroundColor = _E0FFF5;
|
|
|
+ self.customNavBar.backgroundColor = _F0FFFA;
|
|
|
+
|
|
|
+ self.titleImgV.image = [UIImage imageNamed:self.isBirthday ? @"birth_titleImg_2" : @"birth_titleImg_1"];
|
|
|
+ self.codeDesLB.hidden = !self.isBirthday;
|
|
|
+ self.btnV.hidden = !self.isBirthday;
|
|
|
+
|
|
|
+// KWLoginedUserModel *info = [KWLoginedManager.shareInstance getCurrentLoginedUser];
|
|
|
+// NSDate *date = [NSDate dateWithString:info.dob format:@"yyyy-MM-dd hh:mm:ss"];
|
|
|
+ NSDate *date = [NSDate new];
|
|
|
+
|
|
|
+ self.dayLb.text = [NSString stringWithFormat:@"%ld" ,date.day];
|
|
|
+
|
|
|
+ NSString *monStr = @"JANUARY";
|
|
|
+ NSInteger mon = date.month;
|
|
|
+ switch (mon) {
|
|
|
+ case 1:
|
|
|
+ monStr = @"JANUARY";
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ monStr = @"FEBRUARY";
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ monStr = @"MARCH";
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ monStr = @"APRIL";
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ monStr = @"MAY";
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ monStr = @"JUNE";
|
|
|
+ break;
|
|
|
+ case 7:
|
|
|
+ monStr = @"JULY";
|
|
|
+ break;
|
|
|
+ case 8:
|
|
|
+ monStr = @"AUGUST";
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ monStr = @"SEPTEMBER";
|
|
|
+ break;
|
|
|
+ case 10:
|
|
|
+ monStr = @"OCTOBER";
|
|
|
+ break;
|
|
|
+ case 11:
|
|
|
+ monStr = @"NOVEMBER";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ monStr = @"DECEMBER";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ self.monthLb.text = monStr;
|
|
|
+ self.yearLb.text = [NSString stringWithFormat:@"%ld" ,date.year];// @"2000";
|
|
|
+
|
|
|
+ NSString *birthStr = @"Our Gift To You?\n$30 To Spend On Your\nFavorite Hair.";
|
|
|
+ NSString *defualtStr = [NSString stringWithFormat: @"hello,%@ %@\nThanks for giving us the opportunity to celebratingyour birthday with you in the future.You’re going to receive our special birthday treat.\nLook forward to your special day to come.", @"USER", @"NAME"];//info.lastname, info.firstname];
|
|
|
+ self.contentLB.text = self.isBirthday ? birthStr : defualtStr;
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (void)loadSubviews {
|
|
|
+
|
|
|
+ [self.view addSubview:self.scrollV];
|
|
|
+ [self.scrollV addSubview:self.bgV];
|
|
|
+
|
|
|
+ [self.scrollV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.top.equalTo(self.customNavBar.mas_bottom);
|
|
|
+ make.right.left.bottom.equalTo(self.view);
|
|
|
+ }];
|
|
|
+ [self.bgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.edges.equalTo(self.scrollV);
|
|
|
+ make.width.equalTo(self.view);
|
|
|
+ make.height.greaterThanOrEqualTo([NSNumber numberWithFloat:SCREEN_HEIGHT - (NavigationBarHeight+StatusHeight)]);
|
|
|
+ }];
|
|
|
+
|
|
|
+// UIImageView *tl_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_top_left"]];
|
|
|
+// UIImageView *tr_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_top_right"]];
|
|
|
+// UIImageView *bl_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_bottom_left"]];
|
|
|
+// UIImageView *br_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_bottom_right"]];
|
|
|
+// UIImageView *top_line_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_line_top"]];
|
|
|
+// UIImageView *bottom_line_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_line_top"]];
|
|
|
+// UIImageView *left_line_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_line_left"]];
|
|
|
+// UIImageView *right_line_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_line_left"]];
|
|
|
+//
|
|
|
+// UIImageView *top_left_bg_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_top_left_bg"]];
|
|
|
+// UIImageView *bottom_right_bg_imgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_birth_top_left_bg"]];
|
|
|
+//
|
|
|
+// [self.bgV addSubview:top_left_bg_imgV];
|
|
|
+// [self.bgV addSubview:bottom_right_bg_imgV];
|
|
|
+// [self.bgV addSubview:tl_imgV];
|
|
|
+// [self.bgV addSubview:tr_imgV];
|
|
|
+// [self.bgV addSubview:bl_imgV];
|
|
|
+// [self.bgV addSubview:br_imgV];
|
|
|
+// [self.bgV addSubview:top_line_imgV];
|
|
|
+// [self.bgV addSubview:bottom_line_imgV];
|
|
|
+// [self.bgV addSubview:left_line_imgV];
|
|
|
+// [self.bgV addSubview:right_line_imgV];
|
|
|
+
|
|
|
+// [top_left_bg_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(@0);
|
|
|
+// make.left.equalTo(self.bgV).offset(0);
|
|
|
+// make.width.height.equalTo(@180);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [bottom_right_bg_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.bottom.equalTo(@0);
|
|
|
+// make.right.equalTo(self.bgV).offset(0);
|
|
|
+// make.width.height.equalTo(@180);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// bottom_right_bg_imgV.transform = CGAffineTransformMakeRotation(M_PI);
|
|
|
+//
|
|
|
+// [tl_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(@50);
|
|
|
+// make.left.equalTo(self.bgV).offset(20);
|
|
|
+// make.width.height.equalTo(@24);
|
|
|
+// }];
|
|
|
+// [tr_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.top.equalTo(@50);
|
|
|
+// make.right.equalTo(self.bgV).offset(-20);
|
|
|
+// make.width.height.equalTo(@24);
|
|
|
+// }];
|
|
|
+// [bl_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.bottom.equalTo(self.bgV).offset(-50);
|
|
|
+// make.left.equalTo(self.bgV).offset(20);
|
|
|
+// make.width.height.equalTo(@24);
|
|
|
+// }];
|
|
|
+// [br_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.bottom.equalTo(self.bgV).offset(-50);
|
|
|
+// make.right.equalTo(self.bgV).offset(-20);
|
|
|
+// make.width.height.equalTo(@24);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [top_line_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.centerX.equalTo(self.bgV);
|
|
|
+// make.width.equalTo(self.bgV).offset(-120);
|
|
|
+// make.top.equalTo(self.bgV).offset(50);
|
|
|
+// }];
|
|
|
+// [bottom_line_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.centerX.equalTo(self.bgV);
|
|
|
+// make.width.equalTo(self.bgV).offset(-120);
|
|
|
+// make.bottom.equalTo(self.bgV.mas_bottom).offset(-50);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [left_line_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.left.equalTo(tl_imgV.mas_left);
|
|
|
+// make.top.equalTo(tl_imgV.mas_bottom).offset(20);
|
|
|
+// make.bottom.equalTo(bl_imgV.mas_top).offset(-20);
|
|
|
+// }];
|
|
|
+//
|
|
|
+// [right_line_imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.right.equalTo(tr_imgV.mas_right);
|
|
|
+// make.top.equalTo(tr_imgV.mas_bottom).offset(20);
|
|
|
+// make.bottom.equalTo(br_imgV.mas_top).offset(-20);
|
|
|
+// }];
|
|
|
+
|
|
|
+
|
|
|
+ [self.bgV addSubview:self.bgImgV];
|
|
|
+ [self.bgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.edges.equalTo(self.bgV);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+ UIStackView *stackV = [[UIStackView alloc] init];
|
|
|
+ stackV.axis = UILayoutConstraintAxisVertical;
|
|
|
+ stackV.distribution = UIStackViewDistributionFill;
|
|
|
+ stackV.alignment = UIStackViewAlignmentFill;
|
|
|
+ stackV.spacing = 20;
|
|
|
+
|
|
|
+
|
|
|
+ [self.bgV addSubview:stackV];
|
|
|
+ [stackV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.equalTo(self.bgV);
|
|
|
+ make.width.equalTo([NSNumber numberWithFloat:SCREEN_WIDTH - 120]);
|
|
|
+ make.top.equalTo(self.bgV.mas_top).offset(38);
|
|
|
+ make.bottom.equalTo(self.bgV.mas_bottom).offset(-150);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+ UIStackView *topSt = [[UIStackView alloc] init];
|
|
|
+ topSt.axis = UILayoutConstraintAxisVertical;
|
|
|
+ topSt.distribution = UIStackViewDistributionFill;
|
|
|
+ topSt.alignment = UIStackViewAlignmentFill;
|
|
|
+ topSt.spacing = 8;
|
|
|
+
|
|
|
+ [topSt addArrangedSubview:self.topImgV];
|
|
|
+ [self.topImgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@102);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [topSt addArrangedSubview:self.titleImgV];
|
|
|
+ [self.titleImgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@68);
|
|
|
+ }];
|
|
|
+ [stackV addArrangedSubview:topSt];
|
|
|
+
|
|
|
+ [stackV addArrangedSubview:self.contentLB];
|
|
|
+// [stackV addArrangedSubview:self.lineV];
|
|
|
+// [self.lineV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.height.equalTo(@50);
|
|
|
+// }];
|
|
|
+
|
|
|
+ [stackV addArrangedSubview:self.btnV];
|
|
|
+
|
|
|
+ [self.btnV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@45);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self.btnV addSubview:self.startBt];
|
|
|
+
|
|
|
+ [self.startBt mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@45);
|
|
|
+ make.width.equalTo([NSNumber numberWithFloat:SCREEN_WIDTH-150]);
|
|
|
+ make.center.equalTo(self.btnV);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [stackV addArrangedSubview:self.codeDesLB];
|
|
|
+ [self.codeDesLB mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@48);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [stackV addArrangedSubview:self.dateV];
|
|
|
+ [self.dateV addSubview:self.monthLb];
|
|
|
+ [self.dateV addSubview:self.dayBgV];
|
|
|
+ [self.dateV addSubview:self.dayLb];
|
|
|
+ [self.dateV addSubview:self.yearLb];
|
|
|
+
|
|
|
+ [self.monthLb mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@17);
|
|
|
+ make.centerX.equalTo(self.dateV);
|
|
|
+ make.top.equalTo(self.dateV).offset(10);
|
|
|
+ }];
|
|
|
+ [self.dayBgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@45);
|
|
|
+ make.width.equalTo(@36.5);
|
|
|
+ make.centerX.equalTo(self.dateV);
|
|
|
+ make.top.equalTo(self.monthLb.mas_bottom).offset(5);
|
|
|
+ }];
|
|
|
+ [self.dayLb mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.center.equalTo(self.dayBgV);
|
|
|
+ make.height.equalTo(self.dayBgV);
|
|
|
+ make.width.equalTo(self.dayBgV);
|
|
|
+ }];
|
|
|
+ [self.yearLb mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.equalTo(@17);
|
|
|
+ make.centerX.equalTo(self.dateV);
|
|
|
+ make.top.equalTo(self.dayBgV.mas_bottom).offset(5);
|
|
|
+ make.bottom.equalTo(self.dateV).offset(-10);
|
|
|
+ }];
|
|
|
+
|
|
|
+
|
|
|
+ dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
+ [self viewAddLineColorBg:self.bgV colorArr:@[
|
|
|
+ (id)_E0FFF5.CGColor,
|
|
|
+ (id)Col_FFF.CGColor
|
|
|
+ ]];
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+- (UIScrollView *)scrollV {
|
|
|
+ if (!_scrollV) {
|
|
|
+ UIScrollView *v = [UIScrollView new];
|
|
|
+ v.showsVerticalScrollIndicator = false;
|
|
|
+ v.showsHorizontalScrollIndicator = false;
|
|
|
+ v.backgroundColor = Col_FFF;
|
|
|
+ _scrollV = v;
|
|
|
+ }
|
|
|
+ return _scrollV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView *)bgV {
|
|
|
+ if (!_bgV) {
|
|
|
+ UIView *v = [UIView new];
|
|
|
+ _bgV = v;
|
|
|
+ }
|
|
|
+ return _bgV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIImageView *)bgImgV {
|
|
|
+ if (!_bgImgV) {
|
|
|
+ UIImageView *v = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"birth_bg"]];
|
|
|
+ v.contentMode = UIViewContentModeScaleToFill;
|
|
|
+ _bgImgV = v;
|
|
|
+ }
|
|
|
+ return _bgImgV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIImageView *)topImgV {
|
|
|
+ if (!_topImgV) {
|
|
|
+ UIImageView *v = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"birth_topImg"]];
|
|
|
+ v.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
+ _topImgV = v;
|
|
|
+ }
|
|
|
+ return _topImgV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIImageView *)titleImgV {
|
|
|
+ if (!_titleImgV) {
|
|
|
+ UIImageView *v = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"birth_titleImg_1"]];
|
|
|
+ v.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
+ _titleImgV = v;
|
|
|
+ }
|
|
|
+ return _titleImgV;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+- (UILabel *)contentLB {
|
|
|
+ if (!_contentLB) {
|
|
|
+ UILabel *lb = [[UILabel alloc] init];
|
|
|
+ lb.numberOfLines = 0;
|
|
|
+ lb.textAlignment = NSTextAlignmentCenter;
|
|
|
+ lb.textColor = UIColor.blackColor;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Regular size:14];
|
|
|
+ lb.qmui_lineHeight = 24;
|
|
|
+ _contentLB = lb;
|
|
|
+ }
|
|
|
+ return _contentLB;
|
|
|
+}
|
|
|
+
|
|
|
+//- (UIView *)lineV {
|
|
|
+// if (!_lineV) {
|
|
|
+// UIView *v = [UIView new];
|
|
|
+// v.backgroundColor = UIColor.clearColor;
|
|
|
+// UIView *line = [UIView new];
|
|
|
+// line.backgroundColor = UIColor.blackColor;
|
|
|
+// [v addSubview:line];
|
|
|
+// [line mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+// make.width.equalTo([NSNumber numberWithFloat:SCREEN_WIDTH-140]);
|
|
|
+// make.height.equalTo(@1);
|
|
|
+// make.center.equalTo(v);
|
|
|
+// }];
|
|
|
+// _lineV = v;
|
|
|
+// }
|
|
|
+// return _lineV;
|
|
|
+//}
|
|
|
+
|
|
|
+- (UILabel *)codeDesLB {
|
|
|
+ if (!_codeDesLB) {
|
|
|
+ UILabel *lb = [[UILabel alloc] init];
|
|
|
+ lb.numberOfLines = 0;
|
|
|
+ lb.textColor = _043632;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Regular size:12];
|
|
|
+ lb.qmui_lineHeight = 24;
|
|
|
+ lb.textAlignment = NSTextAlignmentCenter;
|
|
|
+ lb.lineBreakMode = NSLineBreakByWordWrapping;
|
|
|
+ lb.text = @"USE CODE: BIRTHDAY\nGET DISCOUNT & GIFTPACK";
|
|
|
+ _codeDesLB = lb;
|
|
|
+ }
|
|
|
+ return _codeDesLB;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView *)btnV {
|
|
|
+ if (!_btnV) {
|
|
|
+ UIView *v = [UIView new];
|
|
|
+ v.backgroundColor = UIColor.clearColor;
|
|
|
+ _btnV = v;
|
|
|
+ }
|
|
|
+ return _btnV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIButton *)startBt {
|
|
|
+ if (!_startBt) {
|
|
|
+ UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ bt.backgroundColor = [UIColor blackColor];
|
|
|
+ bt.layer.cornerRadius = 4;
|
|
|
+ bt.layer.masksToBounds = true;
|
|
|
+ [bt setTitle:@"GET THE PARTY STARTED" forState:UIControlStateNormal];
|
|
|
+ [bt setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
|
|
+ bt.titleLabel.font = [UIFont fontWithName:Rob_Regular size:16];
|
|
|
+ [bt addTarget:self action:@selector(btnAction) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ _startBt = bt;
|
|
|
+ }
|
|
|
+ return _startBt;
|
|
|
+}
|
|
|
+
|
|
|
+- (void)btnAction {
|
|
|
+// if (![self.vm.typeId isEqualToString:@""]) {
|
|
|
+// KWProductListViewController *vc = [[KWProductListViewController alloc] init];
|
|
|
+// vc.titleName = @"HD Lace";
|
|
|
+// vc.type = self.vm.typeId;
|
|
|
+// [self.navigationController pushViewController:vc animated:YES];
|
|
|
+// } else {
|
|
|
+// [self.view makeToast:@"Get Birth Products Type Error"];
|
|
|
+// }
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView *)dateV {
|
|
|
+ if (!_dateV) {
|
|
|
+ UIView *v = [UIView new];
|
|
|
+ v.backgroundColor = UIColor.clearColor;
|
|
|
+ _dateV = v;
|
|
|
+ }
|
|
|
+ return _dateV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UILabel *)monthLb {
|
|
|
+ if (!_monthLb) {
|
|
|
+ UILabel *lb = [[UILabel alloc] init];
|
|
|
+ lb.numberOfLines = 0;
|
|
|
+ lb.textColor = UIColor.blackColor;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Regular size:14];
|
|
|
+ lb.qmui_lineHeight = 20;
|
|
|
+ _monthLb = lb;
|
|
|
+ }
|
|
|
+ return _monthLb;
|
|
|
+}
|
|
|
+
|
|
|
+- (UILabel *)dayLb {
|
|
|
+ if (!_dayLb) {
|
|
|
+ UILabel *lb = [[UILabel alloc] init];
|
|
|
+ lb.numberOfLines = 0;
|
|
|
+ lb.textColor = UIColor.blackColor;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Bold size:20];
|
|
|
+ lb.qmui_lineHeight = 20;
|
|
|
+ lb.textAlignment = NSTextAlignmentCenter;
|
|
|
+ _dayLb = lb;
|
|
|
+ }
|
|
|
+ return _dayLb;
|
|
|
+}
|
|
|
+
|
|
|
+- (UILabel *)yearLb {
|
|
|
+ if (!_yearLb) {
|
|
|
+ UILabel *lb = [[UILabel alloc] init];
|
|
|
+ lb.numberOfLines = 0;
|
|
|
+ lb.textColor = UIColor.blackColor;
|
|
|
+ lb.font = [UIFont fontWithName:Rob_Regular size:14];
|
|
|
+ lb.qmui_lineHeight = 20;
|
|
|
+ _yearLb = lb;
|
|
|
+ }
|
|
|
+ return _yearLb;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIImageView *)dayBgV {
|
|
|
+ if (!_dayBgV) {
|
|
|
+ UIImageView *v = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"birth_dayTime_bg"]];
|
|
|
+ v.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
+ _dayBgV = v;
|
|
|
+ }
|
|
|
+ return _dayBgV;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+- (void)viewAddLineColorBg:(UIView *)bgV colorArr:(NSArray *)colors {
|
|
|
+ CAGradientLayer *layer = [[CAGradientLayer alloc] init];
|
|
|
+ layer.frame = bgV.bounds;
|
|
|
+ layer.colors = colors;
|
|
|
+ layer.startPoint = CGPointMake(0.44, 0.2);
|
|
|
+ layer.endPoint = CGPointMake(0.5, 1);
|
|
|
+ layer.locations = @[@0,@1.0f];
|
|
|
+ layer.name = @"colorLayer";
|
|
|
+ [bgV.layer insertSublayer:layer atIndex:0];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+@end
|
|
|
+
|