MOLiveCell.m 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. //
  2. // MOLiveCell.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2023/10/18.
  6. //
  7. #define TitleFont 10.0
  8. #define ImageViewWidthAndHeight 15.0
  9. #define ImageViewX 10.0
  10. #import "MOLiveCell.h"
  11. #import "MOLiveBadge.h"
  12. #import "UIView+Extension.h"
  13. #import "UILabel+MOBezierAnimation.h"
  14. #import "MOLiveTagArrayView.h"
  15. @implementation MOStatusButton
  16. - (void)layoutSubviews{
  17. [super layoutSubviews];
  18. if(self.imageView.image != nil)
  19. {
  20. self.imageView.width = ImageViewWidthAndHeight;
  21. self.imageView.height = ImageViewWidthAndHeight;
  22. self.imageView.x = ImageViewX;
  23. self.imageView.y = 2.0;
  24. UIFont *customFont = [UIFont fontWithName:kNormalContentFontStr size:10.0];
  25. if(!customFont){
  26. customFont = [MOTextTools MODisplayFontWithSize:10.0 bold:YES itatic:YES weight:UIFontWeightMedium];
  27. }
  28. CGFloat width = [MOTools getWidthWithString:self.titleLabel.text font:customFont] + 2.0;
  29. CGFloat maxWidth = SCREENWIDTH - 15.0 * 2 - 30.0 - 100.0;
  30. if(width > maxWidth){
  31. width = maxWidth;
  32. }
  33. self.titleLabel.frame = CGRectMake(CGRectGetMaxX(self.imageView.frame) + 2, 0, width, (TitleFont + 2.0));
  34. self.titleLabel.centerY = self.imageView.centerY;
  35. self.titleLabel.textAlignment = NSTextAlignmentCenter;
  36. }
  37. }
  38. @end
  39. @interface MOLiveCell ()
  40. @property (nonatomic, strong) UIButton *multiButton;//多人直播标记
  41. @property (nonatomic, strong) UIButton *pkButton;//pk标记
  42. @property (nonatomic, strong) MOLiveTagArrayView *tagArrayView;
  43. @end
  44. @implementation MOLiveCell
  45. - (instancetype)initWithFrame:(CGRect)frame
  46. {
  47. if (self = [super initWithFrame:frame])
  48. {
  49. [self setupUI];
  50. }
  51. return self;
  52. }
  53. - (void)setupUI
  54. {
  55. [self.contentView addSubview:self.bgView];
  56. [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.edges.equalTo(self.contentView);
  58. }];
  59. self.bgView.layer.cornerRadius = 16.0;
  60. self.bgView.layer.masksToBounds = YES;
  61. [self.bgView addSubview:self.bgImgView];
  62. [self.bgImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.edges.equalTo(self.bgView);
  64. }];
  65. [self.bgView addSubview:self.statusBtn];
  66. [self.statusBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  67. make.top.equalTo(self.bgView).offset(8.0);
  68. make.left.equalTo(self.bgView).offset(8.0);
  69. make.width.equalTo(@50.0);
  70. make.height.equalTo(@19.0);
  71. }];
  72. self.statusBtn.layer.cornerRadius = 4.0;
  73. self.statusBtn.layer.masksToBounds = YES;
  74. [self.bgView addSubview:self.multiButton];
  75. [self.multiButton mas_makeConstraints:^(MASConstraintMaker *make) {
  76. make.top.equalTo(self.bgView).offset(30.0);
  77. make.left.equalTo(self.bgView).offset(8.0);
  78. make.width.equalTo(@75.0);
  79. make.height.equalTo(@18.0);
  80. }];
  81. self.multiButton.hidden = YES;
  82. [self.bgView addSubview:self.pkButton];
  83. [self.pkButton mas_makeConstraints:^(MASConstraintMaker *make) {
  84. make.top.equalTo(self.bgView).offset(30.0);
  85. make.left.equalTo(self.bgView).offset(8.0);
  86. make.width.equalTo(@38.0);
  87. make.height.equalTo(@18.0);
  88. }];
  89. self.pkButton.hidden = YES;
  90. [self.bgView addSubview:self.tagArrayView];
  91. [self.tagArrayView mas_makeConstraints:^(MASConstraintMaker *make) {
  92. make.top.mas_equalTo(8);
  93. make.right.mas_equalTo(-8);
  94. make.height.mas_equalTo(18);
  95. }];
  96. CGFloat collectionWidth = (SCREENWIDTH - 13.0 * 2 - 7.0) / 2.0;
  97. [self.bgView addSubview:self.shadowView];
  98. [self.shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
  99. make.left.right.bottom.equalTo(self.bgView);
  100. make.height.equalTo(@60.0);
  101. }];
  102. NSArray *colorArr = @[[MOTools colorWithHexString:@"#0000000" alpha:0.0],[MOTools colorWithHexString:@"#000000" alpha:0.5]];
  103. UIImage *image = [MOTools createGradientRectImageWithBounds:CGRectMake(0, 0, collectionWidth, 60.0) Colors:colorArr GradientType:1];
  104. [self.shadowView setImage:image];
  105. [self.bgView addSubview:self.moreBtn];
  106. [self.moreBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  107. make.right.equalTo(self.bgView).offset(-3.0);
  108. make.width.height.equalTo(@20.0);
  109. make.bottom.equalTo(self.bgView).offset(-7.0);
  110. }];
  111. [self.bgView addSubview:self.countryImgView];
  112. [self.countryImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  113. make.left.equalTo(self.bgView).offset(8.0);
  114. make.bottom.equalTo(self.bgView).offset(-10.0);
  115. make.width.equalTo(@16.0);
  116. make.height.equalTo(@16.0);
  117. }];
  118. [self.bgView addSubview:self.numButton];
  119. [self.numButton mas_makeConstraints:^(MASConstraintMaker *make) {
  120. make.centerY.equalTo(self.countryImgView);
  121. make.right.mas_equalTo(-8);
  122. // make.width.mas_lessThanOrEqualTo(27);
  123. }];
  124. [self.bgView addSubview:self.nameLab];
  125. [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
  126. make.left.equalTo(self.bgView).offset(30.0);
  127. make.right.equalTo(self.numButton.mas_left).offset(-5.0);
  128. make.centerY.equalTo(self.countryImgView.mas_centerY);
  129. make.height.equalTo(@15.0);
  130. }];
  131. [self.bgView addSubview:self.titleLab];
  132. [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
  133. make.left.equalTo(self.bgView).offset(8.0);
  134. make.right.equalTo(self.bgView).offset(-20.0);
  135. make.height.equalTo(@20.0);
  136. make.bottom.equalTo(self.countryImgView.mas_top).offset(-6.0);
  137. }];
  138. [self.bgView addSubview:self.hotImgView];
  139. [self.hotImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  140. make.left.equalTo(self.bgView).offset(-1.0);
  141. make.right.equalTo(self.bgView).offset(1.0);
  142. make.top.equalTo(self.bgView).offset(-1.0);
  143. make.bottom.equalTo(self.bgView).offset(1.0);
  144. }];
  145. self.hotImgView.hidden = YES;
  146. [self.bgView addSubview:self.moreView];
  147. [self.moreView mas_makeConstraints:^(MASConstraintMaker *make) {
  148. make.edges.equalTo(self.bgView);
  149. }];
  150. [self.moreView addSubview:self.noLikeBtn];
  151. [self.noLikeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  152. make.height.mas_equalTo(36.0);
  153. make.center.equalTo(self.moreView);
  154. make.width.mas_equalTo(140);
  155. }];
  156. }
  157. - (void)setModel:(MOLiveList *)model{
  158. _model = model;
  159. self.titleLab.text = model.name;
  160. self.nameLab.text = model.anchorUser.nickname;
  161. [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:model.logo] placeholderImage:[UIImage imageNamed:@"icon_base_img_placeHolder"]];
  162. MOCountryList *countryModel;
  163. if(model.anchorUser.country.length != 0){
  164. countryModel = (MOCountryList *)[[MODataCache sharedYYCache] objectForKey:[NSString stringWithFormat:@"%@_%@",kCountryArrInfo,model.anchorUser.country]];
  165. }
  166. if(countryModel){
  167. self.countryImgView.hidden = NO;
  168. __weak typeof(self) weakSelf = self;
  169. [self.countryImgView sd_setImageWithURL:[NSURL URLWithString:countryModel.icon] completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
  170. __strong typeof(self) strongSelf = weakSelf; if (!strongSelf) return;
  171. if (!image) return;
  172. [strongSelf.countryImgView mas_updateConstraints:^(MASConstraintMaker *make) {
  173. make.width.equalTo(@(image.size.width * 16.0 / image.size.height));
  174. }];
  175. }];
  176. [self.nameLab mas_updateConstraints:^(MASConstraintMaker *make) {
  177. make.left.equalTo(self.bgView).offset(30.0);
  178. }];
  179. }
  180. else{
  181. self.countryImgView.hidden = YES;
  182. [self.countryImgView sd_setImageWithURL:[NSURL URLWithString:@""]];
  183. [self.nameLab mas_updateConstraints:^(MASConstraintMaker *make) {
  184. make.left.equalTo(self.bgView).offset(8.0);
  185. }];
  186. }
  187. NSString *numText = [NSString stringWithFormat:@"%.f",model.visitNum];
  188. CGFloat numTextWidth = [MOTools getWidthWithString:numText font:self.numButton.titleLabel.font] + 16.0;
  189. [self.numButton setTitle:numText forState:UIControlStateNormal];
  190. [self.numButton mas_remakeConstraints:^(MASConstraintMaker *make) {
  191. make.centerY.equalTo(self.countryImgView);
  192. make.right.mas_equalTo(-8);
  193. make.width.equalTo(@(numTextWidth));
  194. }];
  195. [self.contentView setNeedsLayout];
  196. [self.contentView layoutIfNeeded];
  197. CGFloat multiBgViewTop = 30.0;
  198. CGFloat tagArrTop = 8.0;
  199. self.statusBtn.hidden = NO;
  200. if(model.liveBadge.type == 1){
  201. [self.statusBtn sd_setImageWithURL:[NSURL URLWithString:model.liveBadge.icon] forState:UIControlStateNormal];
  202. [self.statusBtn setTitle:model.liveBadge.name forState:UIControlStateNormal];
  203. [self.statusBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:@""] forState:UIControlStateNormal];
  204. if(model.liveBadge.bgColor.length > 0){
  205. self.statusBtn.backgroundColor = [MOTools colorWithHexString:model.liveBadge.bgColor alpha:1.0];
  206. }
  207. else{
  208. self.statusBtn.backgroundColor = [MOTools colorWithHexString:@"#120817" alpha:0.6];
  209. }
  210. CGFloat statusBtnWidth = [MOTools getWidthWithString:model.liveBadge.name font:[MOTextTools getTheFontWithSize:StatusFont AndFontName:kNormalContentFontStr]] + 10.0 + 30.0;
  211. CGFloat maxWidth = SCREENWIDTH - 15.0 * 2 - 30.0 - 100.0;
  212. if(statusBtnWidth > maxWidth){
  213. statusBtnWidth = maxWidth;
  214. }
  215. [self.statusBtn mas_updateConstraints:^(MASConstraintMaker *make) {
  216. make.width.equalTo(@(statusBtnWidth));
  217. }];
  218. if(model.liveBadge.liveTag){
  219. self.statusBtn.hidden = YES;
  220. multiBgViewTop = 8.0;
  221. }
  222. }
  223. else{
  224. self.statusBtn.backgroundColor = [UIColor clearColor];
  225. [self.statusBtn sd_setBackgroundImageWithURL:[NSURL URLWithString:model.liveBadge.bgImg] forState:UIControlStateNormal];
  226. [self.statusBtn setTitle:@"" forState:UIControlStateNormal];
  227. [self.statusBtn sd_setImageWithURL:[NSURL URLWithString:model.liveBadge.icon] forState:UIControlStateNormal];
  228. [self.statusBtn mas_updateConstraints:^(MASConstraintMaker *make) {
  229. make.width.equalTo(@(90.0));
  230. }];
  231. }
  232. self.multiButton.hidden = YES;
  233. if(model.multiple){
  234. self.multiButton.hidden = NO;
  235. if (!self.statusBtn.hidden) {
  236. [self.multiButton mas_updateConstraints:^(MASConstraintMaker *make) {
  237. make.top.equalTo(self.bgView).offset(30.0);
  238. }];
  239. } else {
  240. [self.multiButton mas_updateConstraints:^(MASConstraintMaker *make) {
  241. make.top.equalTo(self.bgView).offset(8.0);
  242. }];
  243. }
  244. }
  245. self.pkButton.hidden = YES;
  246. if (model.pk) {
  247. self.pkButton.hidden = NO;
  248. if (!self.statusBtn.hidden) {
  249. [self.pkButton mas_updateConstraints:^(MASConstraintMaker *make) {
  250. make.top.equalTo(self.bgView).offset(30.0);
  251. }];
  252. } else {
  253. [self.pkButton mas_updateConstraints:^(MASConstraintMaker *make) {
  254. make.top.equalTo(self.bgView).offset(8.0);
  255. }];
  256. }
  257. }
  258. self.tagArrayView.hidden = YES;
  259. NSMutableArray *tempArr = [NSMutableArray array];
  260. if(model.redEnvelope){
  261. [tempArr addObject:[UIImage imageNamed:@"icon_room_tag_red"]];
  262. }
  263. if(model.roomType == 2){
  264. [tempArr addObject:[UIImage imageNamed:@"icon_room_tag_ticket"]];
  265. }
  266. if(model.roomType == 3){
  267. [tempArr addObject:[UIImage imageNamed:@"icon_room_tag_psw"]];
  268. }
  269. if (tempArr.count > 0) {
  270. self.tagArrayView.hidden = NO;
  271. [self.tagArrayView setIcons:tempArr];
  272. }
  273. if(model.isViewSelect){
  274. self.moreView.hidden = NO;
  275. }
  276. else{
  277. self.moreView.hidden = YES;
  278. }
  279. if(model.bgBorder.length > 0){
  280. self.hotImgView.hidden = NO;
  281. [self.hotImgView sd_setImageWithURL:[NSURL URLWithString:model.bgBorder]];
  282. }
  283. else{
  284. self.hotImgView.hidden = YES;
  285. }
  286. }
  287. #pragma mark - Lazy
  288. - (UIView *)bgView
  289. {
  290. if (_bgView == nil)
  291. {
  292. _bgView = [UIView new];
  293. _bgView.backgroundColor = [MOTools colorWithHexString:@"#F5F1F6" alpha:1.0];
  294. }
  295. return _bgView;
  296. }
  297. - (UIButton *)pkButton {
  298. if (!_pkButton) {
  299. _pkButton = [[UIButton alloc] init];
  300. _pkButton.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.4];
  301. _pkButton.layer.masksToBounds = YES;
  302. _pkButton.layer.cornerRadius = 8;
  303. [_pkButton setImage:[UIImage imageNamed:@"icon_room_tag_pk"] forState:UIControlStateNormal];
  304. [_pkButton setTitle:@" PK" forState:UIControlStateNormal];
  305. [_pkButton setTitleColor:[MOTools colorWithHexString:@"#1AFFB3"] forState:UIControlStateNormal];
  306. _pkButton.titleLabel.font = [MOTextTools mediumFont:10];
  307. _pkButton.userInteractionEnabled = NO;
  308. }
  309. return _pkButton;
  310. }
  311. - (UIButton *)multiButton {
  312. if (!_multiButton) {
  313. _multiButton = [[UIButton alloc] init];
  314. _multiButton.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.4];
  315. _multiButton.layer.masksToBounds = YES;
  316. _multiButton.layer.cornerRadius = 8;
  317. [_multiButton setImage:[UIImage imageNamed:@"icon_link_mic"] forState:UIControlStateNormal];
  318. [_multiButton setTitle:@" Multi-call" forState:UIControlStateNormal];
  319. [_multiButton setTitleColor:[MOTools colorWithHexString:@"#1AFFB3"] forState:UIControlStateNormal];
  320. _multiButton.titleLabel.font = [MOTextTools mediumFont:10];
  321. _multiButton.userInteractionEnabled = NO;
  322. }
  323. return _multiButton;
  324. }
  325. - (UIView *)moreView
  326. {
  327. if (_moreView == nil)
  328. {
  329. _moreView = [UIView new];
  330. _moreView.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.4];
  331. _moreView.hidden = YES;
  332. UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cancelBtnClick)];
  333. [_moreView addGestureRecognizer:tap];
  334. }
  335. return _moreView;
  336. }
  337. - (UIImageView *)bgImgView{
  338. if (!_bgImgView)
  339. {
  340. _bgImgView = [[UIImageView alloc] init];
  341. _bgImgView.clipsToBounds = YES;
  342. _bgImgView.userInteractionEnabled = NO;
  343. _bgImgView.contentMode = UIViewContentModeScaleAspectFill;
  344. [_bgImgView setImage:[UIImage imageNamed:@""]];
  345. _bgView.userInteractionEnabled = YES;
  346. UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(moreBtnClick)];
  347. [_bgView addGestureRecognizer:longPress];
  348. }
  349. return _bgImgView;
  350. }
  351. - (UIImageView *)hotImgView{
  352. if (!_hotImgView)
  353. {
  354. _hotImgView = [[UIImageView alloc] init];
  355. _hotImgView.clipsToBounds = YES;
  356. _hotImgView.userInteractionEnabled = NO;
  357. _hotImgView.contentMode = UIViewContentModeScaleToFill;
  358. [_hotImgView setImage:[UIImage imageNamed:@""]];
  359. }
  360. return _hotImgView;
  361. }
  362. - (UIImageView *)shadowView{
  363. if (!_shadowView)
  364. {
  365. _shadowView = [[UIImageView alloc] init];
  366. _shadowView.clipsToBounds = YES;
  367. _shadowView.userInteractionEnabled = NO;
  368. _shadowView.contentMode = UIViewContentModeScaleAspectFill;
  369. }
  370. return _shadowView;
  371. }
  372. - (MOStatusButton *)statusBtn
  373. {
  374. if (!_statusBtn)
  375. {
  376. _statusBtn = [MOStatusButton buttonWithType:UIButtonTypeCustom];
  377. _statusBtn.frame = CGRectMake(0, 0, 100, 19.0);
  378. _statusBtn.backgroundColor = [MOTools colorWithHexString:@"#120817" alpha:0.6];
  379. _statusBtn.titleLabel.lineBreakMode = NSLineBreakByTruncatingTail;
  380. _statusBtn.userInteractionEnabled = NO;
  381. [_statusBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  382. _statusBtn.titleLabel.font = [MOTextTools getTheFontWithSize:StatusFont AndFontName:kNormalContentFontStr];
  383. _statusBtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
  384. _statusBtn.contentMode = UIViewContentModeScaleAspectFill;
  385. }
  386. return _statusBtn;
  387. }
  388. - (UILabel *)titleLab
  389. {
  390. if(!_titleLab)
  391. {
  392. _titleLab = [UILabel new];
  393. _titleLab.textColor = UIColorFromHex(0xFFFFFF);
  394. _titleLab.textAlignment = NSTextAlignmentLeft;
  395. _titleLab.font = [MOTextTools poppinsSemiBoldFont:14];
  396. _titleLab.backgroundColor = [UIColor clearColor];
  397. }
  398. return _titleLab;
  399. }
  400. - (UIImageView *)countryImgView{
  401. if(!_countryImgView){
  402. _countryImgView = [[UIImageView alloc] init];
  403. }
  404. return _countryImgView;
  405. }
  406. - (UILabel *)nameLab
  407. {
  408. if(!_nameLab)
  409. {
  410. _nameLab = [UILabel new];
  411. _nameLab.textColor = [MOTools colorWithHexString:@"#FFFFFF" alpha:0.8];
  412. _nameLab.textAlignment = NSTextAlignmentLeft;
  413. _nameLab.font = [MOTextTools regularFont:10];
  414. _nameLab.backgroundColor = [UIColor clearColor];
  415. }
  416. return _nameLab;
  417. }
  418. - (BigBtn *)numButton {
  419. if (!_numButton) {
  420. _numButton = [[BigBtn alloc] init];
  421. [_numButton setImage:[UIImage imageNamed:@"icon_online_num"] forState:UIControlStateNormal];
  422. _numButton.titleLabel.font = [MOTextTools regularFont:10];
  423. [_numButton setTitleColor:[MOTools colorWithHexString:@"#FFFFFF" alpha:0.8] forState:UIControlStateNormal];
  424. _numButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  425. }
  426. return _numButton;
  427. }
  428. - (void)moreBtnClick{
  429. self.moreView.hidden = NO;
  430. self.model.isViewSelect = YES;
  431. self.moreBtnBlock ? self.moreBtnBlock(self.model) : nil;
  432. }
  433. - (UIButton *)noLikeBtn
  434. {
  435. if (!_noLikeBtn)
  436. {
  437. _noLikeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  438. _noLikeBtn.backgroundColor = [UIColor whiteColor];
  439. _noLikeBtn.layer.cornerRadius = 36.0 / 2.0;
  440. _noLikeBtn.layer.masksToBounds = YES;
  441. [_noLikeBtn setFont:[MOTextTools regularFont:14]];
  442. [_noLikeBtn setTitle:NSLocalString(@"mimo_room_not_interested") forState:UIControlStateNormal];
  443. [_noLikeBtn setTitleColor:kBaseTextColor_1 forState:UIControlStateNormal];
  444. [_noLikeBtn addTarget:self action:@selector(noLikeBtnClick) forControlEvents:UIControlEventTouchUpInside];
  445. [_noLikeBtn setImage:[UIImage imageNamed:@"icon_not_insterest"] forState:UIControlStateNormal];
  446. [_noLikeBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 3, 0, 0)];
  447. [_noLikeBtn setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 3)];
  448. }
  449. return _noLikeBtn;
  450. }
  451. - (void)noLikeBtnClick{
  452. [self toSubmitTheNoLikeRoom];
  453. }
  454. - (void)toSubmitTheNoLikeRoom{
  455. if(self.model.id.length == 0){
  456. return;
  457. }
  458. NSDictionary *dict = @{@"id":self.model.id};
  459. WEAKSELF
  460. [kHttpManager toSubmitTheDisinterestRoomWithParams:dict andBlock:^(id _Nonnull data, NSError * _Nonnull error) {
  461. if(kCode_Success){
  462. // MOLogV(@"%@",[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:data options:0 error:nil] encoding:NSUTF8StringEncoding]);
  463. [MBProgressHUD showTipMessageInWindow:NSLocalString(@"mimo_common_success")];
  464. weakSelf.noLikeBlock ? weakSelf.noLikeBlock(weakSelf.model) : nil;
  465. }
  466. else{
  467. MOLogV(@"toSubmitTheNoLikeRoom 接口报错了");
  468. kShowNetError(data)
  469. }
  470. }];
  471. }
  472. - (void)cancelBtnClick{
  473. self.moreView.hidden = YES;
  474. self.model.isViewSelect = NO;
  475. self.cancelBtnBlock ? self.cancelBtnBlock(self.model) : nil;
  476. }
  477. - (MOLiveTagArrayView *)tagArrayView{
  478. if(!_tagArrayView){
  479. _tagArrayView = [[MOLiveTagArrayView alloc] init];
  480. _tagArrayView.layer.masksToBounds = YES;
  481. _tagArrayView.layer.cornerRadius = 8;
  482. _tagArrayView.backgroundColor = [MOTools colorWithHexString:@"#000000" alpha:0.4];
  483. }
  484. return _tagArrayView;
  485. }
  486. @end