// // QXDirectListCell.m // IsLandVoice // // Created by 启星 on 2025/3/6. // #import "QXDirectListCell.h" #import "QXMineNetwork.h" @interface QXDirectListCell() @end @implementation QXDirectListCell +(instancetype)cellWithTableView:(UITableView *)tableView{ static NSString *cellId = @"QXDirectListCell"; QXDirectListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; if (!cell) { cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject; } return cell; } - (IBAction)removeAction:(id)sender { MJWeakSelf [QXMineNetwork roomAddOrDeleteManagerIsAdd:NO type:1 roomId:self.roomId user_id:self.model.user_id successBlock:^(NSDictionary * _Nonnull dict) { if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(removeDirectSuccess)]) { [weakSelf.delegate removeDirectSuccess]; } } failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) { }]; } //-(void)setModel:(QXDirectListModel *)model{ // _model = model; // self.nameLabel.text = model.user_nickname; // [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.head_picture] placeholderImage:PLACEHOLDER_IMAGE]; // self.timeLabel.text = model.online_time; // self.scaleLabel.text = [NSString stringWithFormat:@"%@%%",model.earnings_ratio]; // self.priceLabel.text = model.earnings; //} -(void)setModel:(QXRoomOnlineList *)model{ _model = model; self.nameLabel.text = model.nickname; [self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]]; self.scaleLabel.text = [NSString stringWithFormat:@"%.2f%%",model.ratio.doubleValue]; self.priceLabel.text = [NSString stringWithFormat:@"%.4f",model.earnings.doubleValue]; } - (IBAction)setScaleAction:(id)sender { QXDirectSetScaleView *scaleView = [[QXDirectSetScaleView alloc] init]; scaleView.userId = self.model.user_id; scaleView.roomId = self.roomId; scaleView.delegate = self; for (UIWindow *w in [UIApplication sharedApplication].windows) { if ([w isKeyWindow]) { [scaleView showInView:w]; break; } } } -(void)setDirectRatioSuccess{ if (self.delegate && [self.delegate respondsToSelector:@selector(setDirectRatioSuccess)]) { [self.delegate setDirectRatioSuccess]; } } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code // Group 7049男性 // Group 7050 女性 } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end