BogoInviteDetailTopView.m 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // BogoInviteDetailTopView.m
  3. // UniversalApp
  4. //
  5. // Created by Mac on 2021/6/10.
  6. // Copyright © 2021 voidcat. All rights reserved.
  7. //
  8. #import "BogoInviteDetailTopView.h"
  9. @interface BogoInviteDetailTopView ()
  10. @property (weak, nonatomic) IBOutlet UILabel *moneyLabel;
  11. @end
  12. @implementation BogoInviteDetailTopView
  13. - (void)awakeFromNib{
  14. [super awakeFromNib];
  15. self.frame = CGRectMake(15, 15, kScreenW - 30, 98);
  16. CAGradientLayer *gl = [CAGradientLayer layer];
  17. gl.frame = CGRectMake(0, 0, kScreenW - 30, 98);
  18. gl.startPoint = CGPointMake(1, 0.5);
  19. gl.endPoint = CGPointMake(0, 0.5);
  20. gl.colors = @[(__bridge id)[UIColor colorWithRed:249/255.0 green:168/255.0 blue:32/255.0 alpha:1.0].CGColor, (__bridge id)[UIColor colorWithRed:245/255.0 green:85/255.0 blue:14/255.0 alpha:1.0].CGColor];
  21. gl.locations = @[@(0), @(1.0f)];
  22. [self.layer insertSublayer:gl atIndex:0];
  23. self.logBtn.imagePosition = QMUIButtonImagePositionRight;
  24. self.logBtn.spacingBetweenImageAndTitle = 5;
  25. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(upldateTopViewMoney:) name:@"upldateTopViewMoney" object:nil];
  26. for (UIView *subView in self.subviews) {
  27. [subView setLocalizedString];
  28. }
  29. }
  30. - (void)upldateTopViewMoney:(NSNotification *)noti{
  31. NSString *money = (NSString *)noti.object;
  32. self.moneyLabel.text = money;
  33. }
  34. - (IBAction)logBtnAction:(QMUIButton *)sender {
  35. if (self.delegate && [self.delegate respondsToSelector:@selector(topView:didClickLogBtn:)]) {
  36. [self.delegate topView:self didClickLogBtn:sender];
  37. }
  38. }
  39. - (IBAction)withDrawBtnAction:(UIButton *)sender {
  40. if (self.delegate && [self.delegate respondsToSelector:@selector(topView:didClickWithDrawBtn:)]) {
  41. [self.delegate topView:self didClickWithDrawBtn:sender];
  42. }
  43. }
  44. @end