Files
midi_ios/QXLive/HomePage(声播)/View/首页/搜索/QXSearchUserCell.m
2025-09-29 17:21:49 +08:00

38 lines
1.2 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// QXSearchUserCell.m
// QXLive
//
// Created by 启星 on 2025/9/29.
//
#import "QXSearchUserCell.h"
@implementation QXSearchUserCell
-(void)setModel:(QXUserHomeModel *)model{
_model = model;
[self.avatarImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar]];
self.nameLabel.text = model.nickname;
self.IdLabel.text = [NSString stringWithFormat:@"ID%@",model.user_code];
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
self.sexImageView.image = sexImage;
if (self.model.room_id.intValue > 0) {
self.optionBtn.selected = YES;
}else{
self.optionBtn.selected = NO;
}
}
- (IBAction)chatAction:(UIButton *)sender {
if (self.model.room_id.intValue > 0) {
// 去房间
[[QXGlobal shareGlobal] joinRoomWithRoomId:self.model.room_id isRejoin:NO navagationController:self.navigationController];
}else{
[[QXGlobal shareGlobal] chatWithUserID:self.model.user_id nickname:self.model.nickname avatar:self.model.avatar navagationController:self.viewController.navigationController];
}
}
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
@end