YMPersonalPageGiftWallCellViewModel.m 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // YMPersonalPageGiftWallCellViewModel.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/3/14.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMPersonalPageGiftWallCellViewModel.h"
  9. #import "YMPersonalInfoModel.h"
  10. @interface YMPersonalPageGiftWallCellViewModel ()
  11. /// 礼物Id
  12. @property (nonatomic, assign, readwrite) NSInteger giftId;
  13. /// 礼物名
  14. @property (nonatomic, copy, readwrite) NSString *giftName;
  15. /// 礼物图标
  16. @property (nonatomic, copy, readwrite) NSString *giftIcon;
  17. /// 礼物数量
  18. @property (nonatomic, copy, readwrite) NSString *giftNumber;
  19. @end
  20. @implementation YMPersonalPageGiftWallCellViewModel
  21. - (void)ym_initialize{
  22. [super ym_initialize];
  23. if ([self.params[ParamsModel] isKindOfClass:[YMGiftModel class]]) {
  24. YMGiftModel *model = self.params[ParamsModel];
  25. self.giftId = model.gift_id;
  26. self.giftName = model.name;
  27. self.giftIcon = model.img;
  28. self.giftNumber = stringFormat(@"x%@",model.total);
  29. }
  30. }
  31. @end