YMCallRecordCellViewModel.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // YMCallRecordCellViewModel.m
  3. // MSYOUPAI
  4. //
  5. // Created by YoMi on 2024/3/20.
  6. // Copyright © 2024 MS. All rights reserved.
  7. //
  8. #import "YMCallRecordCellViewModel.h"
  9. #import "YMCallRecordModel.h"
  10. @interface YMCallRecordCellViewModel()
  11. /// 用户Id
  12. @property (nonatomic, assign, readwrite) NSInteger userId;
  13. /// 用户头像
  14. @property (nonatomic, strong, readwrite) NSString *userAvatar;
  15. /// 用户昵称
  16. @property (nonatomic, strong, readwrite) NSString *userNickname;
  17. /// 用户通话时长
  18. @property (nonatomic, strong, readwrite) NSString *userCallDuration;
  19. /// 用户通话日期
  20. @property (nonatomic, strong, readwrite) NSString *userCallDate;
  21. @end
  22. @implementation YMCallRecordCellViewModel
  23. - (void)ym_initialize{
  24. [super ym_initialize];
  25. if ([self.params[ParamsModel] isKindOfClass:[YMCallRecordModel class]]) {
  26. YMCallRecordModel *model = self.params[ParamsModel];
  27. self.userId = model.userid;
  28. self.userAvatar = model.avatar;
  29. self.userNickname = model.nickname;
  30. self.userCallDuration = stringFormat(@"通话时长:%@",model.time);
  31. self.userCallDate = model.date;
  32. }
  33. }
  34. @end