MOChatLimitView.m 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. //
  2. // MOChatLimitView.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2024/9/23.
  6. //
  7. #import "MOChatLimitView.h"
  8. #import "MOFirstRechargeRulesView.h"
  9. #import "MOTopUpVC.h"
  10. @interface MOChatLimitView ()
  11. @property (weak, nonatomic) IBOutlet UIImageView *topImgView;
  12. @property (weak, nonatomic) IBOutlet UIButton *topUpBtn;
  13. @property (weak, nonatomic) IBOutlet UILabel *topTipLab;
  14. @property (weak, nonatomic) IBOutlet UILabel *bottomTipLab;
  15. @end
  16. @implementation MOChatLimitView
  17. + (instancetype)moChatLimitView{
  18. return [[[NSBundle mainBundle] loadNibNamed:@"MOChatLimitView" owner:self options:nil] firstObject];
  19. }
  20. - (void)awakeFromNib{
  21. [super awakeFromNib];
  22. self.layer.cornerRadius = 16.0;
  23. self.layer.masksToBounds = YES;
  24. NSArray *colorArr = @[[MOTools colorWithHexString:@"#A5F3FF" alpha:1.0],[MOTools colorWithHexString:@"#EAB8FF" alpha:1.0]];
  25. UIImage *image = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, (SCREENWIDTH - 22.0 * 2), 152.0) Colors:colorArr GradientType:0];
  26. [self.topImgView setImage:image];
  27. self.topUpBtn.layer.cornerRadius = 46.0 / 2.0;
  28. self.topUpBtn.layer.masksToBounds = YES;
  29. MOMeDataInfo *userInfoData = (MOMeDataInfo *)[[MODataCache sharedYYCache] objectForKey:kMineUserInfo];
  30. self.topTipLab.text = [NSString stringWithFormat:@"Sorry, You level %.f you can only send one message",userInfoData.level];
  31. [self.topUpBtn setFont:[MOTextTools getTheFontWithSize:24.0 AndFontName:kNormalTitleFontStr]];
  32. self.topTipLab.font = [MOTextTools getTheFontWithSize:16.0 AndFontName:kNormalContentFontStr];
  33. self.bottomTipLab.font = [MOTextTools getTheFontWithSize:26.0 AndFontName:kNormalContentFontStr];
  34. }
  35. - (IBAction)topUpBtnClick:(id)sender {
  36. UIViewController *currentVC = [MOTools currentViewController];
  37. MOTopUpVC *vc = [[MOTopUpVC alloc] init];
  38. [currentVC.navigationController pushViewController:vc animated:YES];
  39. }
  40. - (IBAction)wenBtnClick:(id)sender {
  41. MOFirstRechargeRulesView *view = [MOFirstRechargeRulesView moFirstRechargeRulesView];
  42. view.ruleContentStr = NSLocalString(@"mimo_chat_rule");
  43. [view showFirstRechargeRulesView];
  44. }
  45. @end