NearbyCell.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // NearbyCell.m
  3. // YBVideo
  4. //
  5. // Created by YunBao on 2018/7/27.
  6. // Copyright © 2018年 cat. All rights reserved.
  7. //
  8. #import "NearbyCell.h"
  9. @implementation NearbyCell
  10. - (void)awakeFromNib {
  11. [super awakeFromNib];
  12. _iconIV.layer.masksToBounds = YES;
  13. _iconIV.layer.cornerRadius = _iconIV.width/2;
  14. }
  15. -(void)setModel:(NearbyVideoModel *)model {
  16. _model = model;
  17. int videoCoin = [model.videoCoin intValue];
  18. _videoCoinBtn.hidden = YES;
  19. if (videoCoin > 0) {
  20. _videoCoinBtn.hidden = NO;
  21. [_videoCoinBtn setTitle:model.videoCoin forState:0];
  22. }
  23. [_coverIV sd_setImageWithURL:[NSURL URLWithString:_model.videoImage]];
  24. [_iconIV sd_setImageWithURL:[NSURL URLWithString:_model.userAvatar]];
  25. _unameL.text = [NSString stringWithFormat:@"%@",_model.userName];
  26. _distanceL.text = [NSString stringWithFormat:@"%@",_model.distance];
  27. //_videoTitleL.text = minstr(_model.videoTitle);
  28. if (_isSelfLoc) {
  29. _locIV.hidden = _distanceL.hidden = NO;
  30. }else {
  31. _locIV.hidden = _distanceL.hidden = YES;
  32. }
  33. }
  34. @end