增加换肤功能
This commit is contained in:
26
QXLive/Dynamic(语圈)/View/QXDynamicLikeListView.h
Normal file
26
QXLive/Dynamic(语圈)/View/QXDynamicLikeListView.h
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// QXDynamicLikeListView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDynamicLikeListView : UIView
|
||||
@property (nonatomic,strong)NSString *Id;
|
||||
@property (nonatomic,strong)NSString *num;
|
||||
-(void)showInView:(UIView*)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@interface QXDynamicLikeListCell : UITableViewCell
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *infoLabel;
|
||||
@property (nonatomic,strong)QXDynamicLikeModel *model;
|
||||
+(instancetype)cellWithTableView:(UITableView*)tableView;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
187
QXLive/Dynamic(语圈)/View/QXDynamicLikeListView.m
Normal file
187
QXLive/Dynamic(语圈)/View/QXDynamicLikeListView.m
Normal file
@@ -0,0 +1,187 @@
|
||||
//
|
||||
// QXDynamicLikeListView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/3.
|
||||
//
|
||||
|
||||
#import "QXDynamicLikeListView.h"
|
||||
#import "QXDynamicNetwork.h"
|
||||
|
||||
@class QXDynamicLikeListCell;
|
||||
@interface QXDynamicLikeListView()<UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate>
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
@end
|
||||
@implementation QXDynamicLikeListView
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(347);
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXDynamicLikeListCell *cell = [QXDynamicLikeListCell cellWithTableView:tableView];
|
||||
cell.model = self.dataArray[indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.page = 1;
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
|
||||
tap.delegate = self;
|
||||
[self addGestureRecognizer:tap];
|
||||
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, ScaleWidth(347))];
|
||||
self.bgView.backgroundColor = [UIColor whiteColor];
|
||||
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 16, self.bgView.width-32, 27)];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+5, self.bgView.width, self.bgView.height-self.titleLabel.bottom-5) style:(UITableViewStylePlain)];
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.rowHeight = 53;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getLikeList];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackStateFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getLikeList];
|
||||
}];
|
||||
[self.bgView addSubview:self.tableView];
|
||||
}
|
||||
|
||||
-(void)setId:(NSString *)Id{
|
||||
_Id = Id;
|
||||
[self getLikeList];
|
||||
}
|
||||
-(void)setNum:(NSString *)num{
|
||||
_num = num;
|
||||
self.titleLabel.text = num;
|
||||
}
|
||||
-(void)getLikeList{
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork likeListWithId:self.Id page:self.page successBlock:^(NSArray<QXDynamicLikeModel *> * _Nonnull list) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
if (list.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXDynamicLikeListCell
|
||||
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString* cellId = @"QXDynamicLikeListCell";
|
||||
QXDynamicLikeListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXDynamicLikeListCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.headerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.headerImageView addRoundedCornersWithRadius:20];
|
||||
[self.contentView addSubview:self.headerImageView];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = QXConfig.textColor;
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
|
||||
self.infoLabel = [[UILabel alloc] init];
|
||||
self.infoLabel.textColor = RGB16(0x999999);
|
||||
self.infoLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.contentView addSubview:self.infoLabel];
|
||||
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.size.mas_equalTo(CGSizeMake(40, 40));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.headerImageView.mas_right).offset(8);
|
||||
make.height.mas_equalTo(21);
|
||||
make.top.equalTo(self.headerImageView).offset(-2);
|
||||
}];
|
||||
|
||||
[self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.headerImageView.mas_right).offset(8);
|
||||
make.height.mas_equalTo(21);
|
||||
make.top.equalTo(self.nameLabel.mas_bottom);
|
||||
}];
|
||||
}
|
||||
-(void)setModel:(QXDynamicLikeModel *)model{
|
||||
_model = model;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.nameLabel.text = model.nickname;
|
||||
self.infoLabel.text = [NSString stringWithFormat:@"%@/%@/%@",model.sex.intValue==1?@"男":@"女",model.age,model.constellation];
|
||||
}
|
||||
@end
|
||||
50
QXLive/Dynamic(语圈)/View/QXDynamicListCell.h
Executable file
50
QXLive/Dynamic(语圈)/View/QXDynamicListCell.h
Executable file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// QXDynamicListCell.h
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2022/6/1.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXDynamicModel.h"
|
||||
#import "QXSeatHeaderView.h"
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
QXDynamicListCellDynamic = 0,
|
||||
QXDynamicListCellDetail ,
|
||||
QXDynamicListCellHomePage ,
|
||||
}QXDynamicListCellType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDynamicListCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *bgView;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *avatarImgV;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *sexImgV;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLab;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *focusBtn;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *contentLab;
|
||||
@property (weak, nonatomic) IBOutlet UIView *imgsBgView;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imgsBgViewHeightCon;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *commentBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *zanBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *giveBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
|
||||
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImageView1;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImageView2;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *userImageView3;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *likeCountLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *likeViewBtn;
|
||||
|
||||
@property (nonatomic, copy) void(^onDeleteBlock)(QXDynamicModel*model);
|
||||
|
||||
|
||||
@property (nonatomic, strong) QXDynamicModel *model;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bgLeftCon;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bgRightCon;
|
||||
@property (nonatomic, assign) QXDynamicListCellType cellType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
418
QXLive/Dynamic(语圈)/View/QXDynamicListCell.m
Executable file
418
QXLive/Dynamic(语圈)/View/QXDynamicListCell.m
Executable file
@@ -0,0 +1,418 @@
|
||||
//
|
||||
// QXDynamicListCell.m
|
||||
// SweetParty
|
||||
//
|
||||
// Created by bj_szd on 2022/6/1.
|
||||
//
|
||||
|
||||
#import "QXDynamicListCell.h"
|
||||
//#import "UILabel+ChangeSpace.h"
|
||||
//#import "KNPhotoBrowser.h"
|
||||
//#import "SPTrendReportVC.h"
|
||||
#import "QXSendGiftView.h"
|
||||
#import "YBImageBrowser.h"
|
||||
#import "QXDynamicNetwork.h"
|
||||
#import "QXShareView.h"
|
||||
#import "QXAlertView.h"
|
||||
#import "QXDynamicDetailViewController.h"
|
||||
#import "QXUserHomePageViewController.h"
|
||||
#import "QXDynamicLikeListView.h"
|
||||
#import "QXReportViewController.h"
|
||||
|
||||
@interface QXDynamicListCell ()<QXShareViewDelegate>
|
||||
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *imgViewsArray;
|
||||
@property (nonatomic, strong)QXSendGiftView *sendView;
|
||||
@end
|
||||
|
||||
@implementation QXDynamicListCell
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
|
||||
self.imgViewsArray = [NSMutableArray arrayWithCapacity:6];
|
||||
self.zanBtn.needEventInterval = 0.5;
|
||||
[self createUI];
|
||||
}
|
||||
-(void)setCellType:(QXDynamicListCellType)cellType{
|
||||
_cellType = cellType;
|
||||
}
|
||||
|
||||
- (void)setModel:(QXDynamicModel *)model {
|
||||
_model = model;
|
||||
|
||||
[self.avatarImgV setHeadIcon:model.avatar dress:@""];
|
||||
self.nicknameLab.text = model.nickname;
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
|
||||
NSString*time = [formatter stringFromDate:date];
|
||||
self.zanBtn.selected = model.is_like.integerValue == 0?NO:YES;
|
||||
self.timeLab.text = time;
|
||||
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
|
||||
self.sexImageView.image = sexImage;
|
||||
// self.focusBtn.selected = model.is_follow;
|
||||
//// self.focusBtn.backgroundColor = model.is_follow ? HEXCOLOR(0x383841) : mainDeepColor;
|
||||
//
|
||||
// self.focusBtn.hidden = [BJUserManager.userInfo.uid integerValue] == [model.uid integerValue];
|
||||
NSString *topic = @"";
|
||||
for (QXTopicModel *md in model.title) {
|
||||
if (topic.length == 0) {
|
||||
topic = [topic stringByAppendingFormat:@"%@",md.title];
|
||||
}else{
|
||||
topic = [topic stringByAppendingFormat:@" %@",md.title];
|
||||
}
|
||||
}
|
||||
NSString *content = [NSString stringWithFormat:@"%@ %@",model.content,topic];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content];
|
||||
[attr yy_setColor:QXConfig.themeColor range:[content rangeOfString:topic]];
|
||||
self.contentLab.attributedText = attr;
|
||||
// [UILabel changeLineSpaceForLabel:self.contentLab WithSpace:5];
|
||||
//
|
||||
// NSString *topic = [model.title stringByReplacingOccurrencesOfString:@"#" withString:@""];
|
||||
// self.topicLabel.text = topic;
|
||||
[self.commentBtn setTitle:[NSString qx_showHotCountNum:model.comment_num.longLongValue] forState:UIControlStateNormal];
|
||||
[self.zanBtn setTitle:[NSString stringWithFormat:@"%@", [NSString qx_showHotCountNum:model.like_num.longLongValue]] forState:UIControlStateNormal];
|
||||
self.zanBtn.selected = [model.is_like isEqualToString:@"1"]?YES:NO;
|
||||
[self.giveBtn setTitle:[NSString qx_showHotCountNum:model.rewards_num.longLongValue] forState:(UIControlStateNormal)];
|
||||
self.imgsBgView.hidden = YES;
|
||||
self.imgsBgViewHeightCon.constant = 0;
|
||||
for (UIImageView *imgV in self.imgViewsArray) {
|
||||
imgV.hidden = YES;
|
||||
}
|
||||
CGFloat imgWidth = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
UIImageView *firstImgV = self.imgViewsArray.firstObject;
|
||||
[firstImgV mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(imgWidth, imgWidth));
|
||||
}];
|
||||
NSArray *images;
|
||||
if (model.images.length > 0) {
|
||||
images = [model.images componentsSeparatedByString:@","];
|
||||
}
|
||||
if (images.count > 0) {
|
||||
for (NSInteger i = 0; i < images.count; i++) {
|
||||
if (i < self.imgViewsArray.count) {
|
||||
UIImageView *imgV = self.imgViewsArray[i];
|
||||
imgV.hidden = NO;
|
||||
[imgV sd_setImageWithURL:[NSURL URLWithString:images[i]]];
|
||||
}
|
||||
}
|
||||
if (images.count == 1) {//特殊
|
||||
CGFloat itemW = (SCREEN_WIDTH-15-15-15)/2;
|
||||
CGFloat imgBgHeight = itemW;
|
||||
self.imgsBgView.hidden = NO;
|
||||
self.imgsBgViewHeightCon.constant = imgBgHeight;
|
||||
[firstImgV mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemW, imgBgHeight));
|
||||
}];
|
||||
}else {
|
||||
CGFloat itemW = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
CGFloat imgBgHeight = 0;
|
||||
NSInteger lines = images.count%3 == 0 ? images.count/3 : images.count/3+1;
|
||||
imgBgHeight = itemW*lines + 10*(lines-1);
|
||||
self.imgsBgView.hidden = NO;
|
||||
self.imgsBgViewHeightCon.constant = imgBgHeight;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (model.room_id.intValue > 0) {
|
||||
[self setBtnTypeWithIsFollow:YES];
|
||||
}else{
|
||||
[self setBtnTypeWithIsFollow:NO];
|
||||
}
|
||||
if (self.cellType == QXDynamicListCellDetail) {
|
||||
self.bgLeftCon.constant = 0;
|
||||
self.bgRightCon.constant = 0;
|
||||
if (model.like_list.count == 0) {
|
||||
self.userImageView1.hidden = YES;
|
||||
self.userImageView2.hidden = YES;
|
||||
self.userImageView3.hidden = YES;
|
||||
self.likeViewBtn.hidden = YES;
|
||||
self.likeCountLabel.hidden = YES;
|
||||
}else if (model.like_list.count == 1) {
|
||||
self.likeViewBtn.hidden = NO;
|
||||
self.likeCountLabel.hidden = NO;
|
||||
self.userImageView1.hidden = NO;
|
||||
QXDynamicLikeModel *md = model.like_list.firstObject;
|
||||
[self.userImageView1 sd_setImageWithURL:[NSURL URLWithString:md.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.userImageView2.hidden = YES;
|
||||
self.userImageView3.hidden = YES;
|
||||
self.likeCountLabel.text = [NSString localizedStringWithFormat:QXText(@"等%@人点赞"),self.zanBtn.titleLabel.text];
|
||||
}else if(model.like_list.count == 2){
|
||||
self.likeCountLabel.hidden = NO;
|
||||
self.userImageView1.hidden = NO;
|
||||
self.userImageView1.hidden = NO;
|
||||
self.userImageView2.hidden = NO;
|
||||
QXDynamicLikeModel *md1 = model.like_list.firstObject;
|
||||
[self.userImageView1 sd_setImageWithURL:[NSURL URLWithString:md1.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
QXDynamicLikeModel *md2 = model.like_list[1];
|
||||
[self.userImageView2 sd_setImageWithURL:[NSURL URLWithString:md2.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.userImageView3.hidden = YES;
|
||||
self.likeCountLabel.text = [NSString localizedStringWithFormat:QXText(@"等%@人点赞"),self.zanBtn.titleLabel.text];
|
||||
}else{
|
||||
self.likeCountLabel.hidden = NO;
|
||||
self.userImageView1.hidden = NO;
|
||||
self.userImageView1.hidden = NO;
|
||||
self.userImageView2.hidden = NO;
|
||||
self.userImageView3.hidden = NO;
|
||||
QXDynamicLikeModel *md1 = model.like_list.firstObject;
|
||||
[self.userImageView1 sd_setImageWithURL:[NSURL URLWithString:md1.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
QXDynamicLikeModel *md2 = model.like_list[1];
|
||||
[self.userImageView2 sd_setImageWithURL:[NSURL URLWithString:md2.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
QXDynamicLikeModel *md3 = model.like_list[2];
|
||||
[self.userImageView3 sd_setImageWithURL:[NSURL URLWithString:md3.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.likeCountLabel.text = [NSString localizedStringWithFormat:QXText(@"等%@人点赞"),self.zanBtn.titleLabel.text];
|
||||
}
|
||||
self.focusBtn.hidden = NO;
|
||||
}else if (self.cellType == QXDynamicListCellDynamic) {
|
||||
self.userImageView1.hidden = YES;
|
||||
self.userImageView2.hidden = YES;
|
||||
self.userImageView3.hidden = YES;
|
||||
self.likeViewBtn.hidden = YES;
|
||||
self.likeCountLabel.hidden = YES;
|
||||
self.focusBtn.hidden = NO;
|
||||
}else{
|
||||
self.userImageView1.hidden = YES;
|
||||
self.userImageView2.hidden = YES;
|
||||
self.userImageView3.hidden = YES;
|
||||
self.likeViewBtn.hidden = YES;
|
||||
self.likeCountLabel.hidden = YES;
|
||||
self.focusBtn.hidden = YES;
|
||||
}
|
||||
|
||||
if ([self.model.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
self.focusBtn.hidden = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createUI {
|
||||
CGFloat imgWidth = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
for (NSInteger i = 0; i < 9; i++) {
|
||||
UIImageView *imgV = [[UIImageView alloc] init];
|
||||
imgV.tag = i+100;
|
||||
imgV.userInteractionEnabled = YES;
|
||||
MJWeakSelf
|
||||
// [imgV dg_Tapped:^{
|
||||
// [weakSelf onPreviewImage:imgV];
|
||||
// }];
|
||||
[imgV addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf previewPhotoWithCurrentIndex:imgV.tag-100];
|
||||
}];
|
||||
imgV.hidden = YES;
|
||||
imgV.layer.masksToBounds = YES;
|
||||
imgV.layer.cornerRadius = 10;
|
||||
imgV.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.imgsBgView addSubview:imgV];
|
||||
[self.imgViewsArray addObject:imgV];
|
||||
|
||||
[imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.imgsBgView).offset((imgWidth+10)*(i/3));
|
||||
make.left.equalTo(self.imgsBgView).offset((imgWidth+10)*(i%3));
|
||||
make.size.mas_equalTo(CGSizeMake(imgWidth, imgWidth));
|
||||
}];
|
||||
}
|
||||
}
|
||||
-(void)previewPhotoWithCurrentIndex:(NSInteger)currentIndex{
|
||||
NSArray *images = [self.model.images componentsSeparatedByString:@","];
|
||||
YBImageBrowser *browser = [YBImageBrowser new];
|
||||
NSMutableArray *sourceArray = [NSMutableArray array];
|
||||
for (int i = 0 ; i <images.count;i++) {
|
||||
NSString *url = images[i];
|
||||
YBIBImageData *data = [[YBIBImageData alloc] init];
|
||||
data.imageURL = [NSURL URLWithString:url];
|
||||
UIImageView *imageView = [self viewWithTag:100+i];
|
||||
data.projectiveView = imageView;
|
||||
[sourceArray addObject:data];
|
||||
}
|
||||
browser.dataSourceArray = sourceArray;
|
||||
browser.currentPage = currentIndex;
|
||||
[browser show];
|
||||
}
|
||||
- (IBAction)onFocus:(id)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
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.navigationController];
|
||||
}
|
||||
}
|
||||
- (IBAction)commentAction:(id)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
switch (self.cellType) {
|
||||
case QXDynamicListCellDetail:
|
||||
|
||||
break;
|
||||
case QXDynamicListCellDynamic:{
|
||||
QXDynamicDetailViewController *vc = [[QXDynamicDetailViewController alloc] init];
|
||||
vc.model = self.model;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
break;
|
||||
case QXDynamicListCellHomePage:{
|
||||
QXDynamicDetailViewController *vc = [[QXDynamicDetailViewController alloc] init];
|
||||
vc.model = self.model;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)onZan:(UIButton*)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
BOOL isLike = !sender.selected;
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork likeDynamicWithId:self.model.id isLike:isLike successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
weakSelf.zanBtn.selected = !weakSelf.zanBtn.selected;
|
||||
if (weakSelf.zanBtn.selected) {
|
||||
[weakSelf.zanBtn setTitle:[NSString stringWithFormat:@"%ld", weakSelf.model.like_num.integerValue+1] forState:UIControlStateNormal];
|
||||
}else{
|
||||
[weakSelf.zanBtn setTitle:[NSString stringWithFormat:@"%ld", weakSelf.model.like_num.integerValue] forState:UIControlStateNormal];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
- (IBAction)onHomepage:(id)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
if (self.cellType == QXDynamicListCellHomePage) {
|
||||
return;
|
||||
}
|
||||
QXUserHomePageViewController *vc = [[QXUserHomePageViewController alloc] init];
|
||||
vc.user_id = self.model.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
- (IBAction)onMore:(id)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXShareView *shareView = [[QXShareView alloc] init];
|
||||
shareView.shareType = QXShareViewTypeFind;
|
||||
shareView.delegate = self;
|
||||
shareView.dynamicModel = self.model;
|
||||
[shareView showInView:KEYWINDOW];
|
||||
}
|
||||
- (IBAction)likeViewAction:(id)sender {
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
QXDynamicLikeListView *listView = [[QXDynamicLikeListView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
|
||||
listView.Id = self.model.id;
|
||||
listView.num = [NSString localizedStringWithFormat:QXText(@"已有%@人点赞"),self.zanBtn.titleLabel.text];
|
||||
[listView showInView:KEYWINDOW];
|
||||
}
|
||||
|
||||
-(void)didClickShareModel:(QXShareViewModel *)model{
|
||||
if ([model.name isEqualToString:QXText(@"删除")]) {
|
||||
MJWeakSelf
|
||||
QXAlertView *al = [[QXAlertView alloc] initWithFrame:CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(175))];
|
||||
al.type = QXAlertViewTypeDeleteDynamic;
|
||||
al.commitBlock = ^{
|
||||
[weakSelf deleteDynamic];
|
||||
};
|
||||
[[QXGlobal shareGlobal] showView:al popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}else if ([model.name isEqualToString:QXText(@"复制链接")]) {
|
||||
UIPasteboard *p = [UIPasteboard generalPasteboard];
|
||||
p.string = [NSString stringWithFormat:@"%@", self.model.share_url];
|
||||
showToast(@"复制成功");
|
||||
}else if ([model.name isEqualToString:QXText(@"举报")]) {
|
||||
QXReportViewController *reportVC = [[QXReportViewController alloc] init];
|
||||
reportVC.reportType = @"3";
|
||||
reportVC.fromId = self.model.id;
|
||||
[self.navigationController pushViewController:reportVC animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)deleteDynamic{
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork deleteDynamicWithId:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
if (weakSelf.onDeleteBlock) {
|
||||
weakSelf.onDeleteBlock(weakSelf.model);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)onReport {
|
||||
// SPTrendReportVC *vc = [[SPTrendReportVC alloc] init];
|
||||
// vc.userId = self.model.uid;
|
||||
// [vc pushSelf];
|
||||
}
|
||||
- (IBAction)giveAction:(id)sender {
|
||||
// QXAlertViewController *al = [[QXAlertViewController alloc] init];
|
||||
// al.alertView = sendView;
|
||||
// al.tapDismiss = YES;
|
||||
// al.popType = PopViewTypeBottomToUpActionSheet;
|
||||
// self.sendView.vc = self.viewController;
|
||||
if (!QXGlobal.shareGlobal.isLogin) {
|
||||
[[QXGlobal shareGlobal] logOut];
|
||||
return;
|
||||
}
|
||||
self.sendView.dynamicId = self.model.id;
|
||||
MJWeakSelf
|
||||
self.sendView.sendSuccessBlock = ^(NSString * _Nonnull dynamicId) {
|
||||
[weakSelf reloadDetail];
|
||||
[weakSelf.sendView hide];
|
||||
self->_sendView = nil;
|
||||
};
|
||||
[self.sendView showInView:KEYWINDOW];
|
||||
|
||||
// al.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
// [self.viewController presentViewController:al animated:NO completion:nil];
|
||||
}
|
||||
|
||||
-(void)reloadDetail{
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork dynamicPageWithId:self.model.id successBlock:^(QXDynamicModel * _Nonnull model) {
|
||||
weakSelf.model = model;
|
||||
[weakSelf setModel:model];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)setBtnTypeWithIsFollow:(BOOL)isFollow{
|
||||
[self.focusBtn setTitle:isFollow?QXText(@"跟随"):QXText(@"私信") forState:(UIControlStateNormal)];
|
||||
[self.focusBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
|
||||
self.focusBtn.backgroundColor = RGB16(0x333333);
|
||||
self.focusBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.focusBtn addRoundedCornersWithRadius:12.5];
|
||||
}
|
||||
-(QXSendGiftView *)sendView{
|
||||
if (!_sendView) {
|
||||
_sendView = [[QXSendGiftView alloc] initWithType:(QXSendGiftViewTypeFind)];
|
||||
// QXAlertViewController *al = [[QXAlertViewController alloc] init];
|
||||
// al.alertView = sendView;
|
||||
// al.tapDismiss = YES;
|
||||
// al.popType = PopViewTypeBottomToUpActionSheet;
|
||||
[_sendView reloadData];
|
||||
}
|
||||
return _sendView;
|
||||
}
|
||||
@end
|
||||
345
QXLive/Dynamic(语圈)/View/QXDynamicListCell.xib
Executable file
345
QXLive/Dynamic(语圈)/View/QXDynamicListCell.xib
Executable file
@@ -0,0 +1,345 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
|
||||
<device id="retina6_1" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="235" id="KGk-i7-Jjw" customClass="QXDynamicListCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="436" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="436" height="152"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FEa-6s-S1q">
|
||||
<rect key="frame" x="16" y="6" width="404" height="140"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="iFl-Jk-YzR">
|
||||
<rect key="frame" x="12" y="12" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="50" id="8Ho-cM-60x"/>
|
||||
<constraint firstAttribute="height" constant="50" id="h0K-eb-9YA"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<real key="value" value="25"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vk2-bh-wsO" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="12" y="12" width="50" height="50"/>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="nKt-dS-UFi">
|
||||
<rect key="frame" x="46" y="46" width="16" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="16" id="LAw-FW-P22"/>
|
||||
<constraint firstAttribute="width" constant="16" id="Rnl-1o-McO"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gzL-1m-sSx">
|
||||
<rect key="frame" x="72" y="19" width="40" height="18"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
|
||||
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="slU-4Q-xRo">
|
||||
<rect key="frame" x="118" y="20.5" width="15" height="15"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="15" id="OBm-DF-7Rk"/>
|
||||
<constraint firstAttribute="width" constant="15" id="vaN-Ip-2ve"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="s4f-xe-cfP">
|
||||
<rect key="frame" x="72" y="45" width="31.5" height="14.5"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XGd-g3-CJu">
|
||||
<rect key="frame" x="12" y="74" width="380" height="11"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
|
||||
<color key="textColor" red="0.12941176470588234" green="0.12941176470588234" blue="0.12941176470588234" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xKO-5c-aaJ">
|
||||
<rect key="frame" x="12" y="96" width="380" height="0.0"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" id="pz4-85-F5Q"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0i8-vW-sax">
|
||||
<rect key="frame" x="0.0" y="96" width="404" height="44"/>
|
||||
<subviews>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EKa-4e-K1g">
|
||||
<rect key="frame" x="172" y="7" width="70" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="70" id="V3Y-g1-oI6"/>
|
||||
<constraint firstAttribute="height" constant="30" id="dgb-HX-3qu"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
|
||||
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="5" maxY="0.0"/>
|
||||
<state key="normal" title="0" image="dynamic_comment">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="commentAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="KTj-Zd-Dnp"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="S5y-fG-SnS">
|
||||
<rect key="frame" x="247" y="8" width="70" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="Eev-1U-blc"/>
|
||||
<constraint firstAttribute="width" constant="70" id="JXW-ug-osW"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
|
||||
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="2" maxX="5" maxY="0.0"/>
|
||||
<state key="normal" title="0" image="dynamic_like">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="selected" image="dynamic_like_sel">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onZan:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="bEY-DV-IGu"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Jjl-ep-Ior">
|
||||
<rect key="frame" x="322" y="7" width="70" height="30"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="30" id="6Uo-qy-hOs"/>
|
||||
<constraint firstAttribute="width" constant="70" id="pcM-Th-kf6"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
|
||||
<inset key="titleEdgeInsets" minX="5" minY="0.0" maxX="0.0" maxY="0.0"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="2" maxX="5" maxY="0.0"/>
|
||||
<state key="normal" title="0" image="dynamic_give">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="selected" image="trend_zan_sel">
|
||||
<color key="titleColor" red="0.57254901960000004" green="0.28627450980000002" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="giveAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="81t-bQ-N6F"/>
|
||||
</connections>
|
||||
</button>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rSB-IC-yLc">
|
||||
<rect key="frame" x="12" y="15" width="14" height="14"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="14" id="Ljn-Kf-utR"/>
|
||||
<constraint firstAttribute="height" constant="14" id="p75-do-YHv"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="7"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="jZt-T7-Wn2">
|
||||
<rect key="frame" x="21" y="15" width="14" height="14"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="14" id="OcC-ac-TLM"/>
|
||||
<constraint firstAttribute="width" constant="14" id="PYK-z6-0qB"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="7"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="mgq-EX-fSI">
|
||||
<rect key="frame" x="30" y="15" width="14" height="14"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="14" id="Oyp-Lt-cfG"/>
|
||||
<constraint firstAttribute="height" constant="14" id="yeO-Qa-e2X"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="7"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SkL-b5-rlj">
|
||||
<rect key="frame" x="47" y="15" width="120" height="14.5"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Avw-XH-qrb">
|
||||
<rect key="frame" x="12" y="4.5" width="155" height="35"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="35" id="erH-l2-lcl"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<connections>
|
||||
<action selector="likeViewAction:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="ZTN-ot-yW2"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="jZt-T7-Wn2" firstAttribute="leading" secondItem="rSB-IC-yLc" secondAttribute="trailing" constant="-5" id="2Ib-Dy-i17"/>
|
||||
<constraint firstItem="Jjl-ep-Ior" firstAttribute="centerY" secondItem="0i8-vW-sax" secondAttribute="centerY" id="4f7-N6-bwy"/>
|
||||
<constraint firstItem="SkL-b5-rlj" firstAttribute="centerY" secondItem="rSB-IC-yLc" secondAttribute="centerY" id="9dX-bU-0tW"/>
|
||||
<constraint firstItem="mgq-EX-fSI" firstAttribute="top" secondItem="rSB-IC-yLc" secondAttribute="top" id="CGL-dM-rHg"/>
|
||||
<constraint firstItem="SkL-b5-rlj" firstAttribute="leading" secondItem="mgq-EX-fSI" secondAttribute="trailing" constant="3" id="JRF-TW-TOd"/>
|
||||
<constraint firstItem="S5y-fG-SnS" firstAttribute="centerY" secondItem="0i8-vW-sax" secondAttribute="centerY" constant="1" id="O7I-Td-ldi"/>
|
||||
<constraint firstItem="mgq-EX-fSI" firstAttribute="leading" secondItem="jZt-T7-Wn2" secondAttribute="trailing" constant="-5" id="P30-wH-iQV"/>
|
||||
<constraint firstItem="Avw-XH-qrb" firstAttribute="centerY" secondItem="rSB-IC-yLc" secondAttribute="centerY" id="PJy-0P-XVJ"/>
|
||||
<constraint firstItem="S5y-fG-SnS" firstAttribute="leading" secondItem="EKa-4e-K1g" secondAttribute="trailing" constant="5" id="PzI-EM-1dk"/>
|
||||
<constraint firstItem="jZt-T7-Wn2" firstAttribute="top" secondItem="rSB-IC-yLc" secondAttribute="top" id="Spz-Uu-qba"/>
|
||||
<constraint firstItem="Avw-XH-qrb" firstAttribute="leading" secondItem="rSB-IC-yLc" secondAttribute="leading" id="UcG-Dj-JzT"/>
|
||||
<constraint firstItem="Jjl-ep-Ior" firstAttribute="leading" secondItem="S5y-fG-SnS" secondAttribute="trailing" constant="5" id="ZiO-Ov-lfy"/>
|
||||
<constraint firstAttribute="height" constant="44" id="aJZ-Tj-Bff"/>
|
||||
<constraint firstItem="Avw-XH-qrb" firstAttribute="trailing" secondItem="SkL-b5-rlj" secondAttribute="trailing" id="c9I-mq-qTD"/>
|
||||
<constraint firstItem="EKa-4e-K1g" firstAttribute="leading" secondItem="SkL-b5-rlj" secondAttribute="trailing" constant="5" id="ktO-7i-Qrp"/>
|
||||
<constraint firstItem="rSB-IC-yLc" firstAttribute="centerY" secondItem="Jjl-ep-Ior" secondAttribute="centerY" id="og5-QO-H9q"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Jjl-ep-Ior" secondAttribute="trailing" constant="12" id="q5A-pu-iWj"/>
|
||||
<constraint firstItem="EKa-4e-K1g" firstAttribute="centerY" secondItem="0i8-vW-sax" secondAttribute="centerY" id="qBQ-fz-vcY"/>
|
||||
<constraint firstItem="rSB-IC-yLc" firstAttribute="leading" secondItem="0i8-vW-sax" secondAttribute="leading" constant="12" id="vTi-ga-8P8"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XnQ-EM-4IC">
|
||||
<rect key="frame" x="12" y="12" width="100" height="50"/>
|
||||
<connections>
|
||||
<action selector="onHomepage:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="H3O-BM-n0k"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jzI-eZ-gdm">
|
||||
<rect key="frame" x="362" y="0.0" width="40" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="jOd-F8-n6l"/>
|
||||
<constraint firstAttribute="width" constant="40" id="vEP-wn-0YJ"/>
|
||||
</constraints>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" image="dynamic_more"/>
|
||||
<connections>
|
||||
<action selector="onMore:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="ljO-t9-GAH"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="80W-MV-Snb">
|
||||
<rect key="frame" x="0.0" y="140" width="404" height="0.0"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.049149908987032316" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" id="Okg-di-KRQ"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="KBv-qN-JAr">
|
||||
<rect key="frame" x="287" y="12.5" width="70" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="25" id="JXr-Sj-Gnx"/>
|
||||
<constraint firstAttribute="width" constant="70" id="sja-gQ-iRl"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<state key="normal">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="selected" image="trend_focus_sel">
|
||||
<color key="titleColor" red="0.50196078431372548" green="0.50196078431372548" blue="0.59607843137254901" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onFocus:" destination="KGk-i7-Jjw" eventType="touchUpInside" id="j6Y-rX-j41"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="vk2-bh-wsO" firstAttribute="top" secondItem="iFl-Jk-YzR" secondAttribute="top" id="0s9-8o-8YE"/>
|
||||
<constraint firstItem="XnQ-EM-4IC" firstAttribute="bottom" secondItem="iFl-Jk-YzR" secondAttribute="bottom" id="2ac-w2-BKA"/>
|
||||
<constraint firstItem="s4f-xe-cfP" firstAttribute="leading" secondItem="gzL-1m-sSx" secondAttribute="leading" id="38p-VS-qLr"/>
|
||||
<constraint firstAttribute="bottom" secondItem="80W-MV-Snb" secondAttribute="bottom" id="3h2-58-lfe"/>
|
||||
<constraint firstItem="jzI-eZ-gdm" firstAttribute="top" secondItem="FEa-6s-S1q" secondAttribute="top" id="89I-UH-pXs"/>
|
||||
<constraint firstAttribute="trailing" secondItem="jzI-eZ-gdm" secondAttribute="trailing" constant="2" id="Cme-Hw-cqe"/>
|
||||
<constraint firstItem="0i8-vW-sax" firstAttribute="leading" secondItem="FEa-6s-S1q" secondAttribute="leading" id="F8G-QN-wtB"/>
|
||||
<constraint firstItem="XnQ-EM-4IC" firstAttribute="leading" secondItem="iFl-Jk-YzR" secondAttribute="leading" id="Hgn-gx-xME"/>
|
||||
<constraint firstAttribute="trailing" secondItem="0i8-vW-sax" secondAttribute="trailing" id="LDf-pd-BxE"/>
|
||||
<constraint firstItem="nKt-dS-UFi" firstAttribute="bottom" secondItem="vk2-bh-wsO" secondAttribute="bottom" id="Nja-UU-BcF"/>
|
||||
<constraint firstItem="vk2-bh-wsO" firstAttribute="leading" secondItem="iFl-Jk-YzR" secondAttribute="leading" id="P2L-Sd-ymb"/>
|
||||
<constraint firstItem="gzL-1m-sSx" firstAttribute="leading" secondItem="iFl-Jk-YzR" secondAttribute="trailing" constant="10" id="Pxx-kz-iUB"/>
|
||||
<constraint firstItem="XnQ-EM-4IC" firstAttribute="trailing" secondItem="gzL-1m-sSx" secondAttribute="trailing" id="RZH-11-ZZs"/>
|
||||
<constraint firstItem="iFl-Jk-YzR" firstAttribute="leading" secondItem="FEa-6s-S1q" secondAttribute="leading" constant="12" id="S1l-dI-KHD"/>
|
||||
<constraint firstItem="gzL-1m-sSx" firstAttribute="top" secondItem="iFl-Jk-YzR" secondAttribute="top" constant="7" id="VC5-4G-7Gw"/>
|
||||
<constraint firstItem="iFl-Jk-YzR" firstAttribute="top" secondItem="FEa-6s-S1q" secondAttribute="top" constant="12" id="Vjt-qY-whB"/>
|
||||
<constraint firstItem="0i8-vW-sax" firstAttribute="top" secondItem="xKO-5c-aaJ" secondAttribute="bottom" id="WDL-Wr-cuB"/>
|
||||
<constraint firstAttribute="bottom" secondItem="0i8-vW-sax" secondAttribute="bottom" id="Xon-6v-maS"/>
|
||||
<constraint firstItem="XGd-g3-CJu" firstAttribute="leading" secondItem="FEa-6s-S1q" secondAttribute="leading" constant="12" id="bKS-fP-sXh"/>
|
||||
<constraint firstItem="XnQ-EM-4IC" firstAttribute="top" secondItem="iFl-Jk-YzR" secondAttribute="top" id="dMG-bF-Wg3"/>
|
||||
<constraint firstItem="KBv-qN-JAr" firstAttribute="centerY" secondItem="jzI-eZ-gdm" secondAttribute="centerY" id="dcA-w8-qQN"/>
|
||||
<constraint firstItem="XGd-g3-CJu" firstAttribute="top" secondItem="iFl-Jk-YzR" secondAttribute="bottom" constant="12" id="eEd-f0-9fK"/>
|
||||
<constraint firstItem="xKO-5c-aaJ" firstAttribute="leading" secondItem="XGd-g3-CJu" secondAttribute="leading" id="fLw-df-ckN"/>
|
||||
<constraint firstItem="slU-4Q-xRo" firstAttribute="leading" secondItem="gzL-1m-sSx" secondAttribute="trailing" constant="6" id="g49-EX-wEM"/>
|
||||
<constraint firstItem="vk2-bh-wsO" firstAttribute="bottom" secondItem="iFl-Jk-YzR" secondAttribute="bottom" id="hsd-6k-jET"/>
|
||||
<constraint firstItem="xKO-5c-aaJ" firstAttribute="top" secondItem="XGd-g3-CJu" secondAttribute="bottom" constant="11" id="j8o-e5-R6g"/>
|
||||
<constraint firstAttribute="trailing" secondItem="80W-MV-Snb" secondAttribute="trailing" id="jB9-yk-qTN"/>
|
||||
<constraint firstItem="s4f-xe-cfP" firstAttribute="top" secondItem="gzL-1m-sSx" secondAttribute="bottom" constant="8" id="jff-zj-ite"/>
|
||||
<constraint firstItem="80W-MV-Snb" firstAttribute="leading" secondItem="FEa-6s-S1q" secondAttribute="leading" id="jnc-2p-hcR"/>
|
||||
<constraint firstItem="jzI-eZ-gdm" firstAttribute="leading" secondItem="KBv-qN-JAr" secondAttribute="trailing" constant="5" id="kv0-Li-FDy"/>
|
||||
<constraint firstItem="nKt-dS-UFi" firstAttribute="trailing" secondItem="vk2-bh-wsO" secondAttribute="trailing" id="nVC-Xf-S6M"/>
|
||||
<constraint firstItem="slU-4Q-xRo" firstAttribute="centerY" secondItem="gzL-1m-sSx" secondAttribute="centerY" id="p8d-jw-X6X"/>
|
||||
<constraint firstAttribute="trailing" secondItem="XGd-g3-CJu" secondAttribute="trailing" constant="12" id="sMu-dZ-CIe"/>
|
||||
<constraint firstItem="vk2-bh-wsO" firstAttribute="trailing" secondItem="iFl-Jk-YzR" secondAttribute="trailing" id="sYt-vO-dxf"/>
|
||||
<constraint firstItem="xKO-5c-aaJ" firstAttribute="trailing" secondItem="XGd-g3-CJu" secondAttribute="trailing" id="ufS-2M-IcL"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="FEa-6s-S1q" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="3Vj-wd-HM3"/>
|
||||
<constraint firstAttribute="bottom" secondItem="FEa-6s-S1q" secondAttribute="bottom" constant="6" id="716-YN-jJw"/>
|
||||
<constraint firstItem="FEa-6s-S1q" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="6" id="U2e-RQ-yQk"/>
|
||||
<constraint firstAttribute="trailing" secondItem="FEa-6s-S1q" secondAttribute="trailing" constant="16" id="p42-QY-zTx"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<connections>
|
||||
<outlet property="avatarImgV" destination="vk2-bh-wsO" id="PCS-cN-uVM"/>
|
||||
<outlet property="bgLeftCon" destination="3Vj-wd-HM3" id="Bsh-cK-7Tu"/>
|
||||
<outlet property="bgRightCon" destination="p42-QY-zTx" id="osh-v4-oXG"/>
|
||||
<outlet property="bgView" destination="FEa-6s-S1q" id="aia-HE-ZZo"/>
|
||||
<outlet property="commentBtn" destination="EKa-4e-K1g" id="RUU-d2-9X4"/>
|
||||
<outlet property="contentLab" destination="XGd-g3-CJu" id="79N-et-e2R"/>
|
||||
<outlet property="focusBtn" destination="KBv-qN-JAr" id="6hu-Wt-CaW"/>
|
||||
<outlet property="giveBtn" destination="Jjl-ep-Ior" id="zSP-AO-2Li"/>
|
||||
<outlet property="imgsBgView" destination="xKO-5c-aaJ" id="i8U-8p-HAZ"/>
|
||||
<outlet property="imgsBgViewHeightCon" destination="pz4-85-F5Q" id="BVd-Eq-IRQ"/>
|
||||
<outlet property="likeCountLabel" destination="SkL-b5-rlj" id="SCq-dQ-i87"/>
|
||||
<outlet property="likeViewBtn" destination="Avw-XH-qrb" id="TrC-Wd-RVW"/>
|
||||
<outlet property="nicknameLab" destination="gzL-1m-sSx" id="mJS-uW-MuX"/>
|
||||
<outlet property="sexImageView" destination="nKt-dS-UFi" id="uXD-tN-GaU"/>
|
||||
<outlet property="sexImgV" destination="slU-4Q-xRo" id="fsh-v7-Cfd"/>
|
||||
<outlet property="timeLab" destination="s4f-xe-cfP" id="d77-Je-mK5"/>
|
||||
<outlet property="userImageView1" destination="rSB-IC-yLc" id="zg2-hF-dBP"/>
|
||||
<outlet property="userImageView2" destination="jZt-T7-Wn2" id="uY6-kc-xWg"/>
|
||||
<outlet property="userImageView3" destination="mgq-EX-fSI" id="9A7-1p-619"/>
|
||||
<outlet property="zanBtn" destination="S5y-fG-SnS" id="Kq5-GZ-FlA"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="263.768115942029" y="150"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="dynamic_comment" width="24" height="24"/>
|
||||
<image name="dynamic_give" width="24" height="24"/>
|
||||
<image name="dynamic_like" width="24" height="24"/>
|
||||
<image name="dynamic_like_sel" width="24" height="24"/>
|
||||
<image name="dynamic_more" width="24" height="24"/>
|
||||
<image name="trend_focus_sel" width="59" height="28"/>
|
||||
<image name="trend_zan_sel" width="24" height="24"/>
|
||||
</resources>
|
||||
</document>
|
||||
20
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.h
Normal file
20
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.h
Normal file
@@ -0,0 +1,20 @@
|
||||
//
|
||||
// QXDynamicTopicCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXDynamicModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDynamicTopicCell : UICollectionViewCell
|
||||
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *topicImageView;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *tagImageView;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *countLabel;
|
||||
@property (nonatomic,strong)QXTopicModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
22
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.m
Normal file
22
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.m
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// QXDynamicTopicCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/9.
|
||||
//
|
||||
|
||||
#import "QXDynamicTopicCell.h"
|
||||
#import "NSString+QX.h"
|
||||
|
||||
@implementation QXDynamicTopicCell
|
||||
-(void)setModel:(QXTopicModel *)model{
|
||||
[self.topicImageView sd_setImageWithURL:[NSURL URLWithString:model.pic] placeholderImage:nil];
|
||||
self.titleLabel.text = model.title;
|
||||
self.countLabel.text = [NSString localizedStringWithFormat:QXText(@"%@条动态"),[NSString qx_showHotCountNum:model.count.longLongValue]];
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
@end
|
||||
82
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.xib
Normal file
82
QXLive/Dynamic(语圈)/View/QXDynamicTopicCell.xib
Normal file
@@ -0,0 +1,82 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="QXDynamicTopicCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="260" height="45"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
|
||||
<rect key="frame" x="0.0" y="0.0" width="260" height="45"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VZ2-zn-s54">
|
||||
<rect key="frame" x="0.0" y="0.0" width="45" height="45"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="VZ2-zn-s54" secondAttribute="height" multiplier="1:1" id="3ik-gC-t5O"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="4"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="# 萌新驾到" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="VEs-QB-WWq">
|
||||
<rect key="frame" x="52" y="0.0" width="78" height="20"/>
|
||||
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="dynamic_topic_tag" translatesAutoresizingMaskIntoConstraints="NO" id="RtE-EB-lWr">
|
||||
<rect key="frame" x="52" y="30" width="37" height="13"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="37" id="4j6-sN-hql"/>
|
||||
<constraint firstAttribute="height" constant="13" id="WTr-P2-WQj"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2.92w条动态" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rTU-7J-yig">
|
||||
<rect key="frame" x="93" y="26.666666666666671" width="72" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="VBn-jM-uVT"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
</view>
|
||||
<viewLayoutGuide key="safeArea" id="SEy-5g-ep8"/>
|
||||
<constraints>
|
||||
<constraint firstItem="VZ2-zn-s54" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="Esx-wY-aRk"/>
|
||||
<constraint firstItem="VEs-QB-WWq" firstAttribute="leading" secondItem="VZ2-zn-s54" secondAttribute="trailing" constant="7" id="Flk-Se-GPC"/>
|
||||
<constraint firstItem="RtE-EB-lWr" firstAttribute="leading" secondItem="VZ2-zn-s54" secondAttribute="trailing" constant="7" id="H4i-fy-dPr"/>
|
||||
<constraint firstAttribute="bottom" secondItem="VZ2-zn-s54" secondAttribute="bottom" id="WvW-oS-6y5"/>
|
||||
<constraint firstItem="VEs-QB-WWq" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="XCm-kM-T5b"/>
|
||||
<constraint firstItem="VZ2-zn-s54" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="gtA-uD-jZS"/>
|
||||
<constraint firstItem="rTU-7J-yig" firstAttribute="centerY" secondItem="RtE-EB-lWr" secondAttribute="centerY" id="jIt-Hm-jNG"/>
|
||||
<constraint firstAttribute="bottom" secondItem="RtE-EB-lWr" secondAttribute="bottom" constant="2" id="yw1-IM-rGt"/>
|
||||
<constraint firstItem="rTU-7J-yig" firstAttribute="leading" secondItem="RtE-EB-lWr" secondAttribute="trailing" constant="4" id="z97-ri-2VL"/>
|
||||
</constraints>
|
||||
<size key="customSize" width="439" height="156"/>
|
||||
<connections>
|
||||
<outlet property="countLabel" destination="rTU-7J-yig" id="ocw-kQ-niu"/>
|
||||
<outlet property="tagImageView" destination="RtE-EB-lWr" id="851-cF-Stg"/>
|
||||
<outlet property="titleLabel" destination="VEs-QB-WWq" id="c9M-Vu-nfH"/>
|
||||
<outlet property="topicImageView" destination="VZ2-zn-s54" id="LjS-Jk-r2L"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="435.87786259541986" y="57.04225352112676"/>
|
||||
</collectionViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="dynamic_topic_tag" width="37" height="13"/>
|
||||
</resources>
|
||||
</document>
|
||||
28
QXLive/Dynamic(语圈)/View/QXExpansionAppStoreView.h
Normal file
28
QXLive/Dynamic(语圈)/View/QXExpansionAppStoreView.h
Normal file
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// QXExpansionAppStoreView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/31.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXUserModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXExpansionAppStoreView : UIView
|
||||
@property (nonatomic,strong)NSArray<QXUserHomeModel*> *users;
|
||||
@property (nonatomic,copy)void(^userBlock)(QXUserHomeModel*user);
|
||||
@end
|
||||
|
||||
|
||||
@interface QXExpansionAppStoreSubView : UIView
|
||||
@property(nonatomic,strong)UIImageView *headerImageView;
|
||||
@property(nonatomic,strong)UILabel *nameLabel;
|
||||
@property(nonatomic,strong)UIImageView *sexImageView;
|
||||
@property(nonatomic,strong)QXUserHomeModel *model;
|
||||
|
||||
- (void)startSmoothFloatAnimation ;
|
||||
|
||||
- (void)stopFloatAnimation ;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
379
QXLive/Dynamic(语圈)/View/QXExpansionAppStoreView.m
Normal file
379
QXLive/Dynamic(语圈)/View/QXExpansionAppStoreView.m
Normal file
@@ -0,0 +1,379 @@
|
||||
//
|
||||
// QXExpansionAppStoreView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/7/31.
|
||||
//
|
||||
|
||||
#import "QXExpansionAppStoreView.h"
|
||||
#import "CKShimmerLabel.h"
|
||||
@interface QXExpansionAppStoreView()<CAAnimationDelegate>
|
||||
@property (nonatomic,strong)CKShimmerLabel *titleLabel;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@property (nonatomic,strong)UIImageView *fengcheImageView;
|
||||
@property (nonatomic,strong)UIButton *changeBtn;
|
||||
@property (nonatomic,strong)NSMutableArray *randomArray;
|
||||
|
||||
@property (nonatomic,strong)QXExpansionAppStoreSubView *userView1;
|
||||
@property (nonatomic,strong)QXExpansionAppStoreSubView *userView2;
|
||||
@property (nonatomic,strong)QXExpansionAppStoreSubView *userView3;
|
||||
@property (nonatomic,strong)QXExpansionAppStoreSubView *userView4;
|
||||
@property (nonatomic,strong)NSMutableArray *userViews;
|
||||
@end
|
||||
|
||||
@implementation QXExpansionAppStoreView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
|
||||
UIView *hitView= [super hitTest:point withEvent:event];
|
||||
if (hitView== self)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
return hitView;
|
||||
}
|
||||
}
|
||||
-(void)initSubviews{
|
||||
|
||||
|
||||
self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"expansion_bg"]];
|
||||
self.bgImageView.frame = CGRectMake((self.width-375)/2, (self.height-375)/2-20, 375, 375);
|
||||
[self addSubview:self.bgImageView];
|
||||
// [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.height.width.mas_equalTo(375);
|
||||
// make.centerX.centerY.equalTo(self);
|
||||
// }];
|
||||
|
||||
self.titleLabel = [[CKShimmerLabel alloc] init];
|
||||
self.titleLabel.shimmerWidth = 20;
|
||||
self.titleLabel.shimmerRadius = 20;
|
||||
self.titleLabel.shimmerColor = QXConfig.themeColor;
|
||||
self.titleLabel.shimmerType = ST_LeftToRight;
|
||||
self.titleLabel.repeat = YES;
|
||||
self.titleLabel.textColor = RGB16(0x333333);
|
||||
self.titleLabel.font = [UIFont fontWithName:@"YouSheBiaoTiHei" size:30];
|
||||
self.titleLabel.text = @"风车转转转,找寻新玩伴";
|
||||
self.titleLabel.top = 80;
|
||||
[self.titleLabel.contentLabel sizeToFit];
|
||||
self.titleLabel.width = self.titleLabel.contentLabel.width;
|
||||
self.titleLabel.centerX = self.centerX;
|
||||
|
||||
[self.titleLabel startShimmer];
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
|
||||
self.fengcheImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fengche"]];
|
||||
self.fengcheImageView.hidden = YES;
|
||||
self.fengcheImageView.frame = CGRectMake((self.width-70)/2, (self.height-70)/2-20, 70, 70);
|
||||
[self.fengcheImageView addRoundedCornersWithRadius:35];
|
||||
self.fengcheImageView.layer.borderWidth = 5;
|
||||
self.fengcheImageView.layer.borderColor = UIColor.whiteColor.CGColor;
|
||||
[self addSubview:self.fengcheImageView];
|
||||
// [self.fengcheImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerY.centerX.equalTo(self.bgImageView);
|
||||
// make.height.width.mas_offset(70);
|
||||
// }];
|
||||
|
||||
self.changeBtn = [[UIButton alloc] init];
|
||||
self.changeBtn.frame = self.fengcheImageView.frame;
|
||||
self.changeBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.changeBtn addRoundedCornersWithRadius:35];
|
||||
[self.changeBtn setTitle:@"换一批" forState:(UIControlStateNormal)];
|
||||
self.changeBtn.layer.borderWidth = 5;
|
||||
self.changeBtn.layer.borderColor = UIColor.whiteColor.CGColor;
|
||||
self.changeBtn.titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
[self.changeBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
[self.changeBtn addTarget:self action:@selector(changeAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.changeBtn];
|
||||
// [self.changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerY.centerX.equalTo(self.bgImageView);
|
||||
// make.height.width.mas_offset(70);
|
||||
// }];
|
||||
|
||||
self.userView1 = [[QXExpansionAppStoreSubView alloc] initWithFrame:CGRectMake(self.bgImageView.left+40, self.bgImageView.top+28, 100, 100)];
|
||||
[self addSubview:self.userView1];
|
||||
// [self.userView1 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.equalTo(self.bgImageView).offset(40);
|
||||
// make.top.equalTo(self.bgImageView).offset(32);
|
||||
// make.width.mas_equalTo(100);
|
||||
// make.height.mas_equalTo(100);
|
||||
// }];
|
||||
|
||||
self.userView2 = [[QXExpansionAppStoreSubView alloc] initWithFrame:CGRectMake(self.bgImageView.right-40-100, self.bgImageView.top+28, 100, 100)];
|
||||
[self addSubview:self.userView2];
|
||||
// [self.userView2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.right.equalTo(self.bgImageView).offset(-40);
|
||||
// make.top.equalTo(self.bgImageView).offset(32);
|
||||
// make.width.mas_equalTo(100);
|
||||
// make.height.mas_equalTo(100);
|
||||
// }];
|
||||
|
||||
self.userView3 = [[QXExpansionAppStoreSubView alloc] initWithFrame:CGRectMake(self.bgImageView.left+40, self.bgImageView.bottom-55-100, 100, 100)];
|
||||
[self addSubview:self.userView3];
|
||||
// [self.userView3 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.left.equalTo(self.bgImageView).offset(40);
|
||||
// make.bottom.equalTo(self.bgImageView).offset(-55);
|
||||
// make.width.mas_equalTo(100);
|
||||
// make.height.mas_equalTo(100);
|
||||
// }];
|
||||
|
||||
self.userView4 = [[QXExpansionAppStoreSubView alloc] initWithFrame:CGRectMake(self.bgImageView.right-40-100, self.bgImageView.bottom-55-100, 100, 100)];
|
||||
[self addSubview:self.userView4];
|
||||
// [self.userView4 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.right.equalTo(self.bgImageView).offset(-40);
|
||||
// make.bottom.equalTo(self.bgImageView).offset(-55);
|
||||
// make.width.mas_equalTo(100);
|
||||
// make.height.mas_equalTo(100);
|
||||
// }];
|
||||
[self.userViews addObject:self.userView1];
|
||||
[self.userViews addObject:self.userView2];
|
||||
[self.userViews addObject:self.userView3];
|
||||
[self.userViews addObject:self.userView4];
|
||||
MJWeakSelf
|
||||
[self.userView1 addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.userBlock) {
|
||||
weakSelf.userBlock(weakSelf.userView1.model);
|
||||
}
|
||||
}];
|
||||
|
||||
[self.userView2 addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.userBlock) {
|
||||
weakSelf.userBlock(weakSelf.userView2.model);
|
||||
}
|
||||
}];
|
||||
|
||||
[self.userView3 addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.userBlock) {
|
||||
weakSelf.userBlock(weakSelf.userView3.model);
|
||||
}
|
||||
}];
|
||||
|
||||
[self.userView4 addTapBlock:^(id _Nonnull obj) {
|
||||
if (weakSelf.userBlock) {
|
||||
weakSelf.userBlock(weakSelf.userView4.model);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)changeAction:(UIButton*)sender{
|
||||
[self.userView1 stopFloatAnimation];
|
||||
[self.userView2 stopFloatAnimation];
|
||||
[self.userView3 stopFloatAnimation];
|
||||
[self.userView4 stopFloatAnimation];
|
||||
|
||||
self.fengcheImageView.alpha = 0;
|
||||
self.fengcheImageView.hidden = NO;
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.changeBtn.alpha = 0;
|
||||
self.fengcheImageView.alpha = 1;
|
||||
|
||||
self.userView1.centerX = self.bgImageView.centerX;
|
||||
self.userView1.centerY = self.bgImageView.centerY;
|
||||
self.userView2.centerX = self.bgImageView.centerX;
|
||||
self.userView2.centerY = self.bgImageView.centerY;
|
||||
self.userView3.centerX = self.bgImageView.centerX;
|
||||
self.userView3.centerY = self.bgImageView.centerY;
|
||||
self.userView4.centerX = self.bgImageView.centerX;
|
||||
self.userView4.centerY = self.bgImageView.centerY;
|
||||
|
||||
|
||||
self.userView1.alpha = 0;
|
||||
self.userView2.alpha = 0;
|
||||
self.userView3.alpha = 0;
|
||||
self.userView4.alpha = 0;
|
||||
|
||||
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
self.changeBtn.hidden = YES;
|
||||
[self fengchezhuan];
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(void)fengchezhuan{
|
||||
CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
||||
//旋转角度
|
||||
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI];
|
||||
//每次旋转的时间(单位秒)
|
||||
rotationAnimation.duration = 0.2;
|
||||
// rotationAnimation.repeatCount = 15;
|
||||
rotationAnimation.delegate = self;
|
||||
rotationAnimation.cumulative = YES;
|
||||
rotationAnimation.removedOnCompletion = NO;
|
||||
//重复旋转的次数,如果你想要无数次,那么设置成MAXFLOAT
|
||||
rotationAnimation.repeatCount = 8;
|
||||
[self.fengcheImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
|
||||
}
|
||||
-(void)animationDidStop:(CAAnimation *)anim finished:(BOOL)flag{
|
||||
self.changeBtn.alpha = 0;
|
||||
self.changeBtn.hidden = NO;
|
||||
self.fengcheImageView.hidden = YES;
|
||||
[self configData];
|
||||
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.changeBtn.alpha = 1;
|
||||
self.userView1.frame = CGRectMake(self.bgImageView.left+40, self.bgImageView.top+28, 100, 100);
|
||||
self.userView2.frame = CGRectMake(self.bgImageView.right-40-100, self.bgImageView.top+28, 100, 100);
|
||||
self.userView3.frame = CGRectMake(self.bgImageView.left+40, self.bgImageView.bottom-55-100, 100, 100);
|
||||
self.userView4.frame = CGRectMake(self.bgImageView.right-40-100, self.bgImageView.bottom-55-100, 100, 100);
|
||||
self.userView1.alpha = 1;
|
||||
self.userView2.alpha = 1;
|
||||
self.userView3.alpha = 1;
|
||||
self.userView4.alpha = 1;
|
||||
|
||||
} completion:^(BOOL finished) {
|
||||
[self.userView1 startSmoothFloatAnimation];
|
||||
[self.userView2 startSmoothFloatAnimation];
|
||||
[self.userView3 startSmoothFloatAnimation];
|
||||
[self.userView4 startSmoothFloatAnimation];
|
||||
}];
|
||||
}
|
||||
-(void)setUsers:(NSArray *)users{
|
||||
_users = users;
|
||||
[self changeAction:self.changeBtn];
|
||||
}
|
||||
|
||||
-(void)configData{
|
||||
[self.randomArray removeAllObjects];
|
||||
if (_users.count <= 4) {
|
||||
[self.randomArray addObjectsFromArray:self.users];
|
||||
}else{
|
||||
NSArray *rArr = [self optimizedRandomFourNumbers];
|
||||
for (NSNumber *number in rArr) {
|
||||
[self.randomArray addObject:self.users[number.integerValue]];
|
||||
}
|
||||
}
|
||||
for (int i = 0 ; i < self.randomArray.count;i++) {
|
||||
QXUserHomeModel *md = self.randomArray[i];
|
||||
QXExpansionAppStoreSubView *v = self.userViews[i];
|
||||
v.model = md;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (NSArray *)optimizedRandomFourNumbers {
|
||||
NSMutableArray *allNumbers = [NSMutableArray arrayWithCapacity:self.users.count-1];
|
||||
for (int i = 1; i < self.users.count; i++) {
|
||||
[allNumbers addObject:@(i)];
|
||||
}
|
||||
|
||||
NSMutableArray *result = [NSMutableArray arrayWithCapacity:4];
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int remainingCount = (int)allNumbers.count;
|
||||
int randomIndex = arc4random_uniform(remainingCount);
|
||||
[result addObject:allNumbers[randomIndex]];
|
||||
[allNumbers removeObjectAtIndex:randomIndex];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)randomArray{
|
||||
if (!_randomArray) {
|
||||
_randomArray = [NSMutableArray array];
|
||||
}
|
||||
return _randomArray;
|
||||
}
|
||||
-(NSMutableArray *)userViews{
|
||||
if (!_userViews) {
|
||||
_userViews = [NSMutableArray array];
|
||||
}
|
||||
return _userViews;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXExpansionAppStoreSubView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setModel:(QXUserHomeModel *)model{
|
||||
_model = model;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.nameLabel.text = model.nickname;
|
||||
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
|
||||
self.sexImageView.image = sexImage;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.headerImageView = [[UIImageView alloc] init];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.headerImageView addRoundedCornersWithRadius:35];
|
||||
// self.headerImageView.backgroundColor = [UIColor brownColor];;
|
||||
[self addSubview:self.headerImageView];
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.centerX.equalTo(self);
|
||||
make.height.width.mas_offset(70);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = RGB16(0x333333);
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
// self.nameLabel.text = @"张三";
|
||||
[self addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.headerImageView.mas_bottom).offset(8);
|
||||
make.centerX.equalTo(self);
|
||||
make.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
self.sexImageView = [[UIImageView alloc] init];
|
||||
[self addSubview:self.sexImageView];
|
||||
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.right.equalTo(self.headerImageView);
|
||||
make.height.width.mas_offset(16);
|
||||
}];
|
||||
}
|
||||
- (void)startSmoothFloatAnimation {
|
||||
[self animateFloatUp];
|
||||
}
|
||||
|
||||
- (void)animateFloatUp {
|
||||
CGFloat floatDistance = 10.0f;
|
||||
CGFloat duration = 2.0f;
|
||||
|
||||
[UIView animateWithDuration:duration
|
||||
delay:0
|
||||
options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction
|
||||
animations:^{
|
||||
self.transform = CGAffineTransformMakeTranslation(0, -floatDistance);
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
[self animateFloatDown];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)animateFloatDown {
|
||||
CGFloat duration = 2.0f;
|
||||
|
||||
[UIView animateWithDuration:duration
|
||||
delay:0
|
||||
options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction
|
||||
animations:^{
|
||||
self.transform = CGAffineTransformIdentity;
|
||||
}
|
||||
completion:^(BOOL finished) {
|
||||
[self animateFloatUp];
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)stopFloatAnimation {
|
||||
[self.layer removeAllAnimations];
|
||||
[NSObject cancelPreviousPerformRequestsWithTarget:self];
|
||||
}
|
||||
@end
|
||||
27
QXLive/Dynamic(语圈)/View/QXExpansionCell.h
Normal file
27
QXLive/Dynamic(语圈)/View/QXExpansionCell.h
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// QXExpansionCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXUserModel.h"
|
||||
#import "QXSeatHeaderView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXExpansionCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *bgView;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet QXSeatHeaderView *avatarImgV;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *levelImgV;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *ageLabel;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *followBtn;
|
||||
@property (weak, nonatomic) IBOutlet UIView *imgsBgView;
|
||||
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *imgsBgViewHeightCon;
|
||||
@property (weak, nonatomic) IBOutlet UIImageView *sexImageView;
|
||||
@property (nonatomic, strong) QXUserHomeModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
136
QXLive/Dynamic(语圈)/View/QXExpansionCell.m
Normal file
136
QXLive/Dynamic(语圈)/View/QXExpansionCell.m
Normal file
@@ -0,0 +1,136 @@
|
||||
//
|
||||
// QXExpansionCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/27.
|
||||
//
|
||||
|
||||
#import "QXExpansionCell.h"
|
||||
#import "YBImageBrowser.h"
|
||||
#import "QXChatViewController.h"
|
||||
|
||||
@interface QXExpansionCell()
|
||||
@property (nonatomic, strong) NSMutableArray *imgViewsArray;
|
||||
@end
|
||||
@implementation QXExpansionCell
|
||||
|
||||
- (void)createUI {
|
||||
CGFloat imgWidth = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
for (NSInteger i = 0; i < 6; i++) {
|
||||
UIImageView *imgV = [[UIImageView alloc] init];
|
||||
imgV.tag = i+100;
|
||||
imgV.userInteractionEnabled = YES;
|
||||
MJWeakSelf
|
||||
[imgV addTapBlock:^(id _Nonnull obj) {
|
||||
[weakSelf previewPhotoWithCurrentIndex:imgV.tag-100];
|
||||
}];
|
||||
imgV.hidden = YES;
|
||||
imgV.layer.masksToBounds = YES;
|
||||
imgV.layer.cornerRadius = 10;
|
||||
imgV.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.imgsBgView addSubview:imgV];
|
||||
[self.imgViewsArray addObject:imgV];
|
||||
|
||||
[imgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.equalTo(self.imgsBgView).offset((imgWidth+10)*(i/3));
|
||||
make.left.equalTo(self.imgsBgView).offset((imgWidth+10)*(i%3));
|
||||
make.size.mas_equalTo(CGSizeMake(imgWidth, imgWidth));
|
||||
}];
|
||||
}
|
||||
}
|
||||
- (IBAction)chatAction:(id)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.navigationController];
|
||||
}
|
||||
}
|
||||
-(void)setModel:(QXUserHomeModel *)model{
|
||||
_model = model;
|
||||
[self.avatarImgV setHeadIcon:model.avatar dress:@""];
|
||||
self.nicknameLab.text = model.nickname;
|
||||
self.ageLabel.text = [NSString stringWithFormat:@"%ld岁 ip属地: %@",[model.birthday ageWithDateOfBirth],model.loginip];
|
||||
CGFloat imgWidth = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
UIImageView *firstImgV = self.imgViewsArray.firstObject;
|
||||
[firstImgV mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(imgWidth, imgWidth));
|
||||
}];
|
||||
UIImage *sexImage = [UIImage imageNamed:model.sex.intValue==1?@"user_sex_boy":@"user_sex_girl"];
|
||||
self.sexImageView.image = sexImage;
|
||||
NSArray *images;
|
||||
if (model.home_bgimages.length > 0) {
|
||||
images = [model.home_bgimages componentsSeparatedByString:@","];
|
||||
}
|
||||
for (UIImageView *imgV in self.imgViewsArray) {
|
||||
imgV.hidden = YES;
|
||||
}
|
||||
for (NSInteger i = 0; i < images.count; i++) {
|
||||
if (i < self.imgViewsArray.count) {
|
||||
UIImageView *imgV = self.imgViewsArray[i];
|
||||
imgV.hidden = NO;
|
||||
NSString *imageUrl = images[i];
|
||||
[imgV sd_setImageWithURL:[NSURL URLWithString:imageUrl]];
|
||||
}
|
||||
}
|
||||
self.imgsBgView.hidden = YES;
|
||||
if (images.count > 0) {
|
||||
if (images.count == 1) {//特殊
|
||||
CGFloat itemW = (SCREEN_WIDTH-15-15-15)/2;
|
||||
CGFloat imgBgHeight = itemW;
|
||||
self.imgsBgView.hidden = NO;
|
||||
self.imgsBgViewHeightCon.constant = imgBgHeight;
|
||||
[firstImgV mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(itemW, imgBgHeight));
|
||||
}];
|
||||
}else {
|
||||
CGFloat itemW = (SCREEN_WIDTH-16*2-12*2-10*2)/3;
|
||||
CGFloat imgBgHeight = 0;
|
||||
NSInteger lines = images.count%3 == 0 ? images.count/3 : images.count/3+1;
|
||||
imgBgHeight = itemW*lines + 10*(lines-1);
|
||||
self.imgsBgView.hidden = NO;
|
||||
if (images.count == 0) {
|
||||
self.imgsBgViewHeightCon.constant = 0;
|
||||
}else{
|
||||
self.imgsBgViewHeightCon.constant = imgBgHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (self.model.room_id.intValue > 0) {
|
||||
self.followBtn.selected = YES;
|
||||
}else{
|
||||
self.followBtn.selected = NO;
|
||||
}
|
||||
}
|
||||
|
||||
-(void)previewPhotoWithCurrentIndex:(NSInteger)currentIndex{
|
||||
NSArray *images = [self.model.home_bgimages componentsSeparatedByString:@","];
|
||||
YBImageBrowser *browser = [YBImageBrowser new];
|
||||
NSMutableArray *sourceArray = [NSMutableArray array];
|
||||
for (int i = 0 ; i <images.count;i++) {
|
||||
NSString *url = images[i];
|
||||
YBIBImageData *data = [[YBIBImageData alloc] init];
|
||||
data.imageURL = [NSURL URLWithString:url];
|
||||
UIImageView *imageView = [self viewWithTag:100+i];
|
||||
data.projectiveView = imageView;
|
||||
[sourceArray addObject:data];
|
||||
}
|
||||
browser.dataSourceArray = sourceArray;
|
||||
browser.currentPage = currentIndex;
|
||||
[browser show];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
self.imgViewsArray = [NSMutableArray arrayWithCapacity:6];
|
||||
[self createUI];
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
156
QXLive/Dynamic(语圈)/View/QXExpansionCell.xib
Normal file
156
QXLive/Dynamic(语圈)/View/QXExpansionCell.xib
Normal file
@@ -0,0 +1,156 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" rowHeight="184" id="BqF-kO-8SX" customClass="QXExpansionCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="371" height="95"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BqF-kO-8SX" id="ktB-xa-Y8j">
|
||||
<rect key="frame" x="0.0" y="0.0" width="371" height="95"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="d7u-yz-ciJ">
|
||||
<rect key="frame" x="16" y="6" width="339" height="83"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ij8-0l-yjh">
|
||||
<rect key="frame" x="12" y="12" width="50" height="50"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="50" id="Aa4-FN-u4i"/>
|
||||
<constraint firstAttribute="width" constant="50" id="b1V-LD-cvU"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<real key="value" value="25"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="SRz-S8-eVY" customClass="QXSeatHeaderView">
|
||||
<rect key="frame" x="12" y="12" width="50" height="50"/>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8cq-E3-DvJ">
|
||||
<rect key="frame" x="72" y="19" width="40" height="18"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="18" id="qwD-PD-2sr"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
|
||||
<color key="textColor" red="0.12941176469999999" green="0.12941176469999999" blue="0.12941176469999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gIi-P2-Y9S">
|
||||
<rect key="frame" x="118" y="20" width="42" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="42" id="Pa0-JD-WZI"/>
|
||||
<constraint firstAttribute="height" constant="16" id="nev-GJ-TTd"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SfJ-0f-fTV">
|
||||
<rect key="frame" x="72" y="45" width="31.666666666666671" height="14.666666666666664"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="14.67" id="ZBE-6b-COh"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="01B-he-W7N">
|
||||
<rect key="frame" x="12" y="12" width="100" height="50"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
</button>
|
||||
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WzX-5h-Rjx">
|
||||
<rect key="frame" x="254" y="24" width="73" height="26"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="73" id="xrz-si-tcM"/>
|
||||
<constraint firstAttribute="height" constant="26" id="zly-Ov-2fX"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="12"/>
|
||||
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<state key="normal" image="expansion_call">
|
||||
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<state key="selected" image="room_user_follow">
|
||||
<color key="titleColor" red="0.50196078430000002" green="0.50196078430000002" blue="0.59607843140000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="chatAction:" destination="BqF-kO-8SX" eventType="touchUpInside" id="1oh-Nh-GtV"/>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="aff-rQ-ltL">
|
||||
<rect key="frame" x="12" y="71" width="315" height="0.0"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" id="HM6-cc-JXk"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="rE2-Ub-cG3">
|
||||
<rect key="frame" x="46" y="46" width="16" height="16"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="16" id="hDn-pN-Z1j"/>
|
||||
<constraint firstAttribute="height" constant="16" id="txd-O6-q3p"/>
|
||||
</constraints>
|
||||
</imageView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<constraints>
|
||||
<constraint firstItem="SRz-S8-eVY" firstAttribute="top" secondItem="ij8-0l-yjh" secondAttribute="top" id="5SH-Nr-W30"/>
|
||||
<constraint firstItem="SRz-S8-eVY" firstAttribute="leading" secondItem="ij8-0l-yjh" secondAttribute="leading" id="5xK-a1-AgP"/>
|
||||
<constraint firstItem="aff-rQ-ltL" firstAttribute="leading" secondItem="d7u-yz-ciJ" secondAttribute="leading" constant="12" id="7W3-i0-a7h"/>
|
||||
<constraint firstItem="ij8-0l-yjh" firstAttribute="top" secondItem="d7u-yz-ciJ" secondAttribute="top" constant="12" id="7rj-T2-7ef"/>
|
||||
<constraint firstItem="gIi-P2-Y9S" firstAttribute="leading" secondItem="8cq-E3-DvJ" secondAttribute="trailing" constant="6" id="9a3-JM-DNn"/>
|
||||
<constraint firstItem="SfJ-0f-fTV" firstAttribute="leading" secondItem="ij8-0l-yjh" secondAttribute="trailing" constant="10" id="LpR-OW-ApF"/>
|
||||
<constraint firstItem="SRz-S8-eVY" firstAttribute="bottom" secondItem="ij8-0l-yjh" secondAttribute="bottom" id="PL9-sW-Etp"/>
|
||||
<constraint firstItem="8cq-E3-DvJ" firstAttribute="top" secondItem="d7u-yz-ciJ" secondAttribute="top" constant="19" id="QB4-FR-hQC"/>
|
||||
<constraint firstAttribute="trailing" secondItem="aff-rQ-ltL" secondAttribute="trailing" constant="12" id="UJy-KH-Me6"/>
|
||||
<constraint firstItem="rE2-Ub-cG3" firstAttribute="trailing" secondItem="SRz-S8-eVY" secondAttribute="trailing" id="Us7-e2-feo"/>
|
||||
<constraint firstItem="ij8-0l-yjh" firstAttribute="leading" secondItem="d7u-yz-ciJ" secondAttribute="leading" constant="12" id="VNZ-KS-lUT"/>
|
||||
<constraint firstItem="rE2-Ub-cG3" firstAttribute="bottom" secondItem="SRz-S8-eVY" secondAttribute="bottom" id="Wkl-qB-guz"/>
|
||||
<constraint firstItem="aff-rQ-ltL" firstAttribute="top" secondItem="ij8-0l-yjh" secondAttribute="bottom" constant="9" id="gpK-ex-dHB"/>
|
||||
<constraint firstItem="WzX-5h-Rjx" firstAttribute="centerY" secondItem="ij8-0l-yjh" secondAttribute="centerY" id="lzk-gK-Xr5"/>
|
||||
<constraint firstItem="SfJ-0f-fTV" firstAttribute="top" secondItem="8cq-E3-DvJ" secondAttribute="bottom" constant="8" symbolic="YES" id="pb7-FA-QT6"/>
|
||||
<constraint firstItem="gIi-P2-Y9S" firstAttribute="centerY" secondItem="8cq-E3-DvJ" secondAttribute="centerY" id="qez-UP-KMH"/>
|
||||
<constraint firstItem="SRz-S8-eVY" firstAttribute="trailing" secondItem="ij8-0l-yjh" secondAttribute="trailing" id="sL4-bA-4lX"/>
|
||||
<constraint firstItem="8cq-E3-DvJ" firstAttribute="leading" secondItem="ij8-0l-yjh" secondAttribute="trailing" constant="10" id="xsB-a1-v4y"/>
|
||||
<constraint firstAttribute="trailing" secondItem="WzX-5h-Rjx" secondAttribute="trailing" constant="12" id="yE0-Ql-MBm"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="16"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="d7u-yz-ciJ" secondAttribute="trailing" constant="16" id="ZEn-eg-5b1"/>
|
||||
<constraint firstItem="d7u-yz-ciJ" firstAttribute="top" secondItem="ktB-xa-Y8j" secondAttribute="top" constant="6" id="c2h-ex-5ar"/>
|
||||
<constraint firstItem="d7u-yz-ciJ" firstAttribute="leading" secondItem="ktB-xa-Y8j" secondAttribute="leading" constant="16" id="kQp-hc-1Ws"/>
|
||||
<constraint firstAttribute="bottom" secondItem="d7u-yz-ciJ" secondAttribute="bottom" constant="6" id="qmb-ae-zTV"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<connections>
|
||||
<outlet property="ageLabel" destination="SfJ-0f-fTV" id="sju-Ih-cv5"/>
|
||||
<outlet property="avatarImgV" destination="SRz-S8-eVY" id="mLt-Oj-Jpd"/>
|
||||
<outlet property="bgView" destination="d7u-yz-ciJ" id="xlK-4p-D30"/>
|
||||
<outlet property="followBtn" destination="WzX-5h-Rjx" id="c7X-9W-ZDG"/>
|
||||
<outlet property="imgsBgView" destination="aff-rQ-ltL" id="iQp-mS-jyp"/>
|
||||
<outlet property="imgsBgViewHeightCon" destination="HM6-cc-JXk" id="rZb-Ea-rwx"/>
|
||||
<outlet property="levelImgV" destination="gIi-P2-Y9S" id="74c-sq-nRX"/>
|
||||
<outlet property="nicknameLab" destination="8cq-E3-DvJ" id="sfo-Gt-g93"/>
|
||||
<outlet property="sexImageView" destination="rE2-Ub-cG3" id="zbU-Lq-BLy"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="216.03053435114504" y="132.04225352112678"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="expansion_call" width="73" height="26"/>
|
||||
<image name="room_user_follow" width="73" height="26"/>
|
||||
</resources>
|
||||
</document>
|
||||
32
QXLive/Dynamic(语圈)/View/QXGiveGiftListView.h
Normal file
32
QXLive/Dynamic(语圈)/View/QXGiveGiftListView.h
Normal file
@@ -0,0 +1,32 @@
|
||||
//
|
||||
// QXGiveGiftListView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXUserModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXGiveGiftListView : UIView
|
||||
/// 语圈id
|
||||
@property (nonatomic,strong)NSString* dynamicId;
|
||||
@property (nonatomic,strong)UIViewController *vc;
|
||||
-(void)showInView:(UIView *)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@interface QXGiveGiftListCell : UITableViewCell
|
||||
@property (nonatomic,strong)UIImageView *rankingImageView;
|
||||
@property (nonatomic,strong)UILabel *rankingLabel;
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *giftLabel;
|
||||
@property (nonatomic,strong)UIButton *followBtn;
|
||||
@property (nonatomic,strong)QXUserHomeModel *model;
|
||||
@property (nonatomic,copy)void(^clickUserBlock)(QXUserHomeModel *model);
|
||||
+(instancetype)cellWithTableView:(UITableView*)tableView;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
236
QXLive/Dynamic(语圈)/View/QXGiveGiftListView.m
Normal file
236
QXLive/Dynamic(语圈)/View/QXGiveGiftListView.m
Normal file
@@ -0,0 +1,236 @@
|
||||
//
|
||||
// QXGiveGiftListView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXGiveGiftListView.h"
|
||||
#import "QXDynamicNetwork.h"
|
||||
|
||||
@interface QXGiveGiftListView()<UITableViewDelegate,UITableViewDataSource,UIGestureRecognizerDelegate>
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@end
|
||||
|
||||
@implementation QXGiveGiftListView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
|
||||
tap.delegate = self;
|
||||
[self addGestureRecognizer:tap];
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, self.width, ScaleWidth(429)+kSafeAreaBottom)];
|
||||
self.bgView.backgroundColor = [UIColor whiteColor];
|
||||
[self.bgView addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
[self addSubview:self.bgView];
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 25, self.width-32, 27)];
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
self.titleLabel.textColor = RGB16(0x333333);
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
self.titleLabel.text = QXText(@"打赏榜单");
|
||||
[self.bgView addSubview:self.titleLabel];
|
||||
|
||||
[self.bgView addSubview:self.tableView];
|
||||
}
|
||||
-(void)setDynamicId:(NSString *)dynamicId{
|
||||
_dynamicId = dynamicId;
|
||||
[self getList];
|
||||
}
|
||||
|
||||
-(void)getList{
|
||||
MJWeakSelf
|
||||
[QXDynamicNetwork dynamicGiveGiftListWithId:self.dynamicId successBlock:^(NSArray<QXUserHomeModel *> * _Nonnull list) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
[weakSelf.dataArray addObjectsFromArray:list];
|
||||
[weakSelf.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXGiveGiftListCell *cell = [QXGiveGiftListCell cellWithTableView:tableView];
|
||||
if (indexPath.row == 0) {
|
||||
cell.rankingImageView.hidden = NO;
|
||||
cell.rankingLabel.hidden = YES;
|
||||
cell.rankingImageView.image = [UIImage imageNamed:@"ranking_first"];
|
||||
}else if (indexPath.row == 1){
|
||||
cell.rankingImageView.hidden = NO;
|
||||
cell.rankingLabel.hidden = YES;
|
||||
cell.rankingImageView.image = [UIImage imageNamed:@"ranking_second"];
|
||||
}else if (indexPath.row == 2){
|
||||
cell.rankingImageView.hidden = NO;
|
||||
cell.rankingLabel.hidden = YES;
|
||||
cell.rankingImageView.image = [UIImage imageNamed:@"ranking_third"];
|
||||
}else{
|
||||
cell.rankingImageView.hidden = YES;
|
||||
cell.rankingLabel.hidden = NO;
|
||||
cell.rankingLabel.text = [NSString stringWithFormat:@"%ld",indexPath.row];
|
||||
}
|
||||
QXUserHomeModel *model = self.dataArray[indexPath.row];
|
||||
cell.model = model;
|
||||
MJWeakSelf
|
||||
cell.clickUserBlock = ^(QXUserHomeModel * _Nonnull model) {
|
||||
[weakSelf hide];
|
||||
[weakSelf performSelector:@selector(chatAction:) withObject:model afterDelay:0.3];
|
||||
};
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT-ScaleWidth(429)-kSafeAreaBottom;
|
||||
}];
|
||||
}
|
||||
-(void)hide{
|
||||
[UIView animateWithDuration:0.3 animations:^{
|
||||
self.bgView.y = SCREEN_HEIGHT;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
-(void)chatAction:(QXUserHomeModel*)model{
|
||||
[[QXGlobal shareGlobal] chatWithUserID:model.user_id nickname:model.nickname avatar:model.avatar navagationController:self.vc.navigationController];
|
||||
}
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+6, self.width, self.height-self.titleLabel.bottom-6) style:UITableViewStylePlain];
|
||||
self.tableView.backgroundColor = [UIColor clearColor];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.rowHeight = 54;
|
||||
[self.tableView addRoundedCornersWithRadius:6];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation QXGiveGiftListCell
|
||||
|
||||
+(instancetype)cellWithTableView:(UITableView*)tableView{
|
||||
static NSString *cellId = @"QXGiveGiftListCell";
|
||||
QXGiveGiftListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXGiveGiftListCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.rankingImageView = [[UIImageView alloc] init];
|
||||
[self.contentView addSubview:self.rankingImageView];
|
||||
[self.rankingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.size.mas_equalTo(CGSizeMake(16, 16));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
self.rankingLabel = [[UILabel alloc] init];
|
||||
self.rankingLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.rankingLabel.textColor = RGB16(0x666666);
|
||||
self.rankingLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self.contentView addSubview:self.rankingLabel];
|
||||
[self.rankingLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.height.mas_equalTo(16);
|
||||
make.centerY.equalTo(self);
|
||||
make.width.mas_equalTo(25);
|
||||
}];
|
||||
|
||||
self.headerImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.contentView addSubview:self.headerImageView];
|
||||
[self.headerImageView addRoundedCornersWithRadius:20];
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.rankingImageView.mas_right).offset(12);
|
||||
make.size.mas_equalTo(CGSizeMake(40, 40));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
self.followBtn = [[UIButton alloc] init];
|
||||
[self.followBtn setImage:[UIImage imageNamed:@"expansion_call"] forState:(UIControlStateNormal)];
|
||||
[self.followBtn addTarget:self action:@selector(followAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.contentView addSubview:self.followBtn];
|
||||
[self.followBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.equalTo(self);
|
||||
make.height.mas_equalTo(24);
|
||||
make.width.mas_equalTo(70);
|
||||
make.right.mas_equalTo(-16);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.nameLabel.textColor = QXConfig.textColor;
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.headerImageView.mas_right).offset(8);
|
||||
make.top.equalTo(self.headerImageView.mas_top).offset(-2);
|
||||
make.height.mas_equalTo(21);
|
||||
make.right.equalTo(self.followBtn.mas_left).offset(-16);
|
||||
}];
|
||||
|
||||
|
||||
self.giftLabel = [[UILabel alloc] init];
|
||||
self.giftLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.giftLabel.textColor = RGB16(0xF4DF39);
|
||||
[self.contentView addSubview:self.giftLabel];
|
||||
[self.giftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.headerImageView.mas_right).offset(8);
|
||||
make.top.equalTo(self.nameLabel.mas_bottom);
|
||||
make.height.mas_equalTo(21);
|
||||
make.right.equalTo(self.followBtn.mas_left).offset(-16);
|
||||
}];
|
||||
}
|
||||
-(void)setModel:(QXUserHomeModel *)model{
|
||||
_model = model;
|
||||
self.nameLabel.text = model.nickname;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.giftLabel.text = model.total_price;
|
||||
}
|
||||
-(void)followAction{
|
||||
|
||||
if (self.clickUserBlock) {
|
||||
self.clickUserBlock(self.model);
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
34
QXLive/Dynamic(语圈)/View/QXMenuPopView.h
Normal file
34
QXLive/Dynamic(语圈)/View/QXMenuPopView.h
Normal file
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// QXMenuPopView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/28.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
QXMenuPopViewTypeArrowTop = 0,
|
||||
QXMenuPopViewTypeArrowBottom
|
||||
}QXMenuPopViewType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXMenuPopViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didSelectedIndex:(NSInteger)index menuTitle:(NSString*)menuTitle;
|
||||
|
||||
@end
|
||||
@interface QXMenuPopView : UIView
|
||||
@property (nonatomic,strong)NSArray *dataArray;
|
||||
@property (nonatomic,weak)id<QXMenuPopViewDelegate>delegate;
|
||||
|
||||
@property (nonatomic,assign)QXMenuPopViewType type;
|
||||
-(instancetype)initWithPoint:(CGPoint)point;
|
||||
|
||||
-(instancetype)initWithPoint:(CGPoint)point width:(CGFloat)width height:(CGFloat)height;
|
||||
|
||||
-(void)showInView:(UIView *)view;
|
||||
@end
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
165
QXLive/Dynamic(语圈)/View/QXMenuPopView.m
Normal file
165
QXLive/Dynamic(语圈)/View/QXMenuPopView.m
Normal file
@@ -0,0 +1,165 @@
|
||||
//
|
||||
// QXMenuPopView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/28.
|
||||
//
|
||||
|
||||
#import "QXMenuPopView.h"
|
||||
@interface QXMenuPopView()<UITableViewDataSource,UITableViewDelegate,UIGestureRecognizerDelegate>
|
||||
@property (nonatomic,strong)UIView *arrowView;
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,assign)CGPoint point;
|
||||
@property (nonatomic,assign)CGFloat width;
|
||||
@property (nonatomic,assign)CGFloat height;
|
||||
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@end
|
||||
@implementation QXMenuPopView
|
||||
|
||||
-(instancetype)initWithPoint:(CGPoint)point{
|
||||
if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
|
||||
self.frame = [UIScreen mainScreen].bounds;
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
_point = point;
|
||||
_width = 88;
|
||||
_height = 103;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(instancetype)initWithPoint:(CGPoint)point width:(CGFloat)width height:(CGFloat)height{
|
||||
if (self = [super initWithFrame:[UIScreen mainScreen].bounds]) {
|
||||
self.frame = [UIScreen mainScreen].bounds;
|
||||
self.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
|
||||
_point = point;
|
||||
_width = width;
|
||||
_height = height;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hide)];
|
||||
tap.delegate = self;
|
||||
[self addGestureRecognizer:tap];
|
||||
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(_point.x -_width/2, _point.y, _width, _height)];
|
||||
self.bgView.clipsToBounds = YES;
|
||||
[self addSubview:self.bgView];
|
||||
|
||||
|
||||
|
||||
|
||||
[self.bgView addSubview:self.tableView];
|
||||
}
|
||||
|
||||
-(void)setDataArray:(NSArray *)dataArray{
|
||||
_dataArray = dataArray;
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
-(void)setType:(QXMenuPopViewType)type{
|
||||
_type = type;
|
||||
switch (type) {
|
||||
case QXMenuPopViewTypeArrowTop:
|
||||
self.bgView.frame = CGRectMake(_point.x -_width/2, _point.y, _width, _height);
|
||||
self.arrowView.frame = CGRectMake((_width-12)/2, 3, 12, 12);
|
||||
self.tableView.frame = CGRectMake(0, self.arrowView.top+5, self.bgView.width, self.bgView.height-13);
|
||||
self.arrowView = [[UIView alloc] initWithFrame:CGRectMake((_width-12)/2, 3, 12, 12)];
|
||||
self.arrowView.backgroundColor = [UIColor whiteColor];
|
||||
self.arrowView.transform = CGAffineTransformMakeRotation(45 * M_PI/180.0);
|
||||
[self.bgView insertSubview:self.arrowView belowSubview:self.tableView];
|
||||
break;
|
||||
case QXMenuPopViewTypeArrowBottom:
|
||||
self.bgView.frame = CGRectMake(_point.x -_width/2, _point.y, _width, _height);
|
||||
self.tableView.frame = CGRectMake(0, 0, self.bgView.width, self.bgView.height-16);
|
||||
self.arrowView = [[UIView alloc] initWithFrame:CGRectMake((_width-12)/2, self.tableView.bottom-8, 12, 12)];
|
||||
self.arrowView.backgroundColor = [UIColor whiteColor];
|
||||
self.arrowView.transform = CGAffineTransformMakeRotation(45 * M_PI/180.0);
|
||||
[self.bgView insertSubview:self.arrowView belowSubview:self.tableView];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
|
||||
return touch.view == self;
|
||||
}
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QXMenuCell"];
|
||||
if (!cell) {
|
||||
cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"QXMenuCell"];
|
||||
}
|
||||
cell.textLabel.text = self.dataArray[indexPath.row];
|
||||
cell.textLabel.font = [UIFont systemFontOfSize:12];
|
||||
cell.textLabel.textColor = RGB16(0x999999);
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
[self hide];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didSelectedIndex:menuTitle:)]) {
|
||||
[self.delegate didSelectedIndex:indexPath.row menuTitle:self.dataArray[indexPath.row]];
|
||||
}
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.arrowView.top+5, self.bgView.width, self.bgView.height-13) style:UITableViewStylePlain];
|
||||
self.tableView.backgroundColor = [UIColor whiteColor];
|
||||
self.tableView.delegate = self;
|
||||
self.tableView.dataSource = self;
|
||||
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
self.tableView.rowHeight = 30;
|
||||
self.tableView.bounces = NO;
|
||||
[self.tableView addRoundedCornersWithRadius:6];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
-(void)showInView:(UIView *)view{
|
||||
if (self.type == QXMenuPopViewTypeArrowTop) {
|
||||
self.bgView.height = 0;
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.height = self.height;
|
||||
}];
|
||||
}else{
|
||||
self.bgView.height = 0;
|
||||
self.bgView.y = self.point.y+self.height;
|
||||
[view addSubview:self];
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.height = self.height;
|
||||
self.bgView.y = self.point.y;
|
||||
}];
|
||||
}
|
||||
|
||||
}
|
||||
-(void)hide{
|
||||
if (self.type == QXMenuPopViewTypeArrowTop) {
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.height = 0;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}else{
|
||||
[UIView animateWithDuration:0.1 animations:^{
|
||||
self.bgView.height = 0;
|
||||
self.bgView.y = self.point.y+self.height;
|
||||
} completion:^(BOOL finished) {
|
||||
[self removeFromSuperview];
|
||||
}];
|
||||
}
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
|
||||
|
||||
16
QXLive/Dynamic(语圈)/View/QXSelectedTopicView.h
Normal file
16
QXLive/Dynamic(语圈)/View/QXSelectedTopicView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXSelectedTopicView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXDynamicModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSelectedTopicView : UIView
|
||||
@property (nonatomic,strong)NSArray <QXTopicModel*> *selectedTopic;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
67
QXLive/Dynamic(语圈)/View/QXSelectedTopicView.m
Normal file
67
QXLive/Dynamic(语圈)/View/QXSelectedTopicView.m
Normal file
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// QXSelectedTopicView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/27.
|
||||
//
|
||||
|
||||
#import "QXSelectedTopicView.h"
|
||||
@interface QXSelectedTopicView()
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIImageView *arrowImageView;
|
||||
@end
|
||||
|
||||
@implementation QXSelectedTopicView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.text = QXText(@"选择话题");
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
|
||||
self.arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"arrowRight"]];
|
||||
[self addSubview:self.arrowImageView];
|
||||
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-12);
|
||||
make.size.mas_equalTo(CGSizeMake(16, 16));
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(12);
|
||||
make.right.equalTo(self.arrowImageView.mas_left).offset(-12);
|
||||
make.centerY.equalTo(self);
|
||||
}];
|
||||
|
||||
}
|
||||
-(void)setSelectedTopic:(NSArray< QXTopicModel *>*)selectedTopic{
|
||||
_selectedTopic = selectedTopic;
|
||||
NSString *topic = @"";
|
||||
for (QXTopicModel*md in selectedTopic) {
|
||||
if (topic.length == 0) {
|
||||
topic = [topic stringByAppendingFormat:@"%@",md.title];
|
||||
}else{
|
||||
topic = [topic stringByAppendingFormat:@",%@",md.title];
|
||||
}
|
||||
}
|
||||
self.titleLabel.text = topic;
|
||||
}
|
||||
@end
|
||||
118
QXLive/Dynamic(语圈)/View/QXSendGiftView.h
Normal file
118
QXLive/Dynamic(语圈)/View/QXSendGiftView.h
Normal file
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// QXSendGiftView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "JXCategoryView.h"
|
||||
#import "QXRoomModel.h"
|
||||
#import "QXGiftModel.h"
|
||||
#import "QXUserModel.h"
|
||||
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
/// 发现打赏
|
||||
QXSendGiftViewTypeFind = 0,
|
||||
/// 房间送礼
|
||||
QXSendGiftViewTypeRoom ,
|
||||
/// 拍卖
|
||||
QXSendGiftViewTypeAuction ,
|
||||
}QXSendGiftViewType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXSendGiftView : UIView
|
||||
-(instancetype)initWithType:(QXSendGiftViewType)type;
|
||||
|
||||
@property (nonatomic,assign)QXSendGiftViewType type;
|
||||
|
||||
@property (nonatomic,strong)NSMutableArray *titles;
|
||||
@property (nonatomic,strong)UINavigationController *navgationVC;
|
||||
@property (nonatomic,strong)UIViewController *vc;
|
||||
|
||||
@property (nonatomic,strong)NSArray *pitUsers;
|
||||
|
||||
/// 用户模型
|
||||
@property (nonatomic,strong)QXRoomPitModel *userModel;
|
||||
|
||||
/// 房间id 房间送礼物时传
|
||||
@property (nonatomic,strong)NSString* roomId;
|
||||
/// 语圈id
|
||||
@property (nonatomic,strong)NSString* dynamicId;
|
||||
/// 拍卖id
|
||||
@property (nonatomic,strong)NSString* auctionId;
|
||||
|
||||
@property (nonatomic,copy)void(^sendSuccessBlock)(NSString*dynamicId);
|
||||
|
||||
@property (nonatomic,copy)void(^roomSendSuccessBlock)(BOOL isAuction, QXGiftModel*giftModel,NSString*userId, NSString*auctionId);
|
||||
-(void)reloadData;
|
||||
|
||||
-(void)showInView:(UIView *)view;
|
||||
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@interface QXSendGiftCollectionView : UIView<UICollectionViewDelegate,UICollectionViewDataSource,JXCategoryListContentViewDelegate>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,strong)NSString *giftLabelId;
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
@property (nonatomic,copy)void(^selectetGiftBlock)(QXGiftModel *gift);
|
||||
@end
|
||||
|
||||
@interface QXSendGiftUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UILabel *titltLabel;
|
||||
@property (nonatomic,strong)UIButton *detailBtn;
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,strong)UIView *lineView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
/// 语圈id
|
||||
@property (nonatomic,strong)NSString* dynamicId;
|
||||
@property (nonatomic,strong)UIViewController *vc;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXSendGiftUserCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIImageView *imageView;
|
||||
@property (nonatomic,strong)QXRoomPitModel *pitModel;
|
||||
|
||||
@property (nonatomic,strong)QXUserHomeModel *sendUserModel;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXSendGiftPitUserView : UIView<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
/// 全麦
|
||||
@property (nonatomic,strong)UIButton *allBtn;
|
||||
/// 是否为麦位
|
||||
@property (nonatomic,assign)BOOL isPitUser;
|
||||
/// 是否是给单人送礼物
|
||||
@property (nonatomic,assign)BOOL isSingle;
|
||||
|
||||
@property (nonatomic,strong)NSArray* users;
|
||||
|
||||
@property (nonatomic,strong)NSMutableArray* selectedArray;
|
||||
@end
|
||||
|
||||
@interface QXSendGiftPitUserCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)QXRoomPitModel *pitModel;
|
||||
@end
|
||||
|
||||
|
||||
@interface QXContinuousGiftView : UIView<CAAnimationDelegate>
|
||||
@property (nonatomic,strong)CAShapeLayer *circleLayer;
|
||||
@property (nonatomic,strong)UIImageView *giftImageView;
|
||||
@property (nonatomic,strong)UIButton *sendBtn;
|
||||
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,assign)BOOL isAuction;
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
@property (nonatomic,strong)NSString *auctionId;
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
|
||||
@property (nonatomic,strong)CABasicAnimation *animation;
|
||||
@property (nonatomic,copy)void(^dissMissBlock)(QXGiftModel *gift);
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
1056
QXLive/Dynamic(语圈)/View/QXSendGiftView.m
Normal file
1056
QXLive/Dynamic(语圈)/View/QXSendGiftView.m
Normal file
File diff suppressed because it is too large
Load Diff
24
QXLive/Dynamic(语圈)/View/QXTopicListView.h
Normal file
24
QXLive/Dynamic(语圈)/View/QXTopicListView.h
Normal file
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// QXTopicListView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/28.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXDynamicNetwork.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXTopicListView : UIView
|
||||
@property (nonatomic,copy)void(^selecctedTopicBlock)(NSArray<QXTopicModel*>*topicArr);
|
||||
@end
|
||||
|
||||
|
||||
@interface QXTopicListViewCell : UITableViewCell
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *rightBtn;
|
||||
@property (nonatomic,strong)QXTopicModel *model;
|
||||
+(instancetype)cellWithTableView:(UITableView*)tableView;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
201
QXLive/Dynamic(语圈)/View/QXTopicListView.m
Normal file
201
QXLive/Dynamic(语圈)/View/QXTopicListView.m
Normal file
@@ -0,0 +1,201 @@
|
||||
//
|
||||
// QXTopicListView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/28.
|
||||
//
|
||||
|
||||
#import "QXTopicListView.h"
|
||||
|
||||
|
||||
@interface QXTopicListView()<UITableViewDelegate,UITableViewDataSource>
|
||||
@property (nonatomic,strong)UITableView *tableView;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,strong)NSMutableArray *selectedArray;
|
||||
@property (nonatomic,strong)UILabel* titleLabel;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
|
||||
@property (nonatomic,strong)UIButton* cancelBtn;
|
||||
@property (nonatomic,strong)UIButton* commitBtn;
|
||||
@end
|
||||
|
||||
@implementation QXTopicListView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.page = 1;
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
[self addRoundedCornersWithRadius:16 byRoundingCorners:(UIRectCornerTopLeft|UIRectCornerTopRight)];
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-100)/2, 16, 100, 27)];
|
||||
self.titleLabel.text = QXText(@"选择话题");
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
|
||||
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 12, 65, 35)];
|
||||
[self.cancelBtn setTitle:QXText(@"取消") forState:(UIControlStateNormal)];
|
||||
[self.cancelBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.cancelBtn];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-65, 12, 65, 35)];
|
||||
[self.commitBtn setTitle:QXText(@"确定") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
// self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn addRoundedCornersWithRadius:17.5];
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.commitBtn];
|
||||
|
||||
[self addSubview:self.tableView];
|
||||
[self getTopic];
|
||||
}
|
||||
|
||||
-(void)getTopic{
|
||||
MJWeakSelf
|
||||
[weakSelf.selectedArray removeAllObjects];
|
||||
[QXDynamicNetwork getTopicListWithPage:self.page isTopTopic:NO
|
||||
successBlock:^(NSArray<QXTopicModel *> * _Nonnull hotos) {
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:hotos];
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
if (hotos.count == 0) {
|
||||
weakSelf.tableView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.tableView.mj_header endRefreshing];
|
||||
[weakSelf.tableView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)cancelAction{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
MJWeakSelf
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
if (weakSelf.selecctedTopicBlock) {
|
||||
weakSelf.selecctedTopicBlock(weakSelf.selectedArray);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXTopicListViewCell *cell = [QXTopicListViewCell cellWithTableView:tableView];
|
||||
QXTopicModel *model = self.dataArray[indexPath.row];
|
||||
cell.model = model;
|
||||
return cell;
|
||||
}
|
||||
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXTopicModel *model = self.dataArray[indexPath.row];
|
||||
model.isSelected = !model.isSelected;
|
||||
[tableView reloadRow:indexPath.row inSection:indexPath.section withRowAnimation:(UITableViewRowAnimationAutomatic)];
|
||||
if (model.isSelected) {
|
||||
[self.selectedArray addObject:model];
|
||||
}else{
|
||||
[self.selectedArray removeObject:model];
|
||||
}
|
||||
}
|
||||
|
||||
-(UITableView *)tableView{
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+8, self.width, self.height-16-self.titleLabel.bottom-8) style:UITableViewStylePlain];
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
_tableView.rowHeight = 48;
|
||||
MJWeakSelf
|
||||
_tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
|
||||
weakSelf.page = 1;
|
||||
[weakSelf getTopic];
|
||||
}];
|
||||
_tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getTopic];
|
||||
}];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
-(NSMutableArray *)selectedArray{
|
||||
if (!_selectedArray) {
|
||||
_selectedArray = [NSMutableArray array];
|
||||
}
|
||||
return _selectedArray;
|
||||
}
|
||||
@end
|
||||
|
||||
|
||||
@implementation QXTopicListViewCell
|
||||
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString* cellId = @"QXTopicListViewCell";
|
||||
QXTopicListViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[QXTopicListViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:cellId];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
|
||||
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
|
||||
self.rightBtn = [[UIButton alloc] init];
|
||||
[self.rightBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
|
||||
[self.rightBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
|
||||
[self.contentView addSubview:self.rightBtn];
|
||||
[self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-16);
|
||||
make.height.width.mas_equalTo(20);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
}];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.height.mas_equalTo(24);
|
||||
make.centerY.equalTo(self.contentView);
|
||||
make.right.equalTo(self.rightBtn.mas_left).offset(-10);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)setModel:(QXTopicModel *)model{
|
||||
_model = model;
|
||||
self.titleLabel.text = model.title;
|
||||
self.rightBtn.selected = model.isSelected;
|
||||
}
|
||||
@end
|
||||
17
QXLive/Dynamic(语圈)/View/QXToppicDynamicTopView.h
Normal file
17
QXLive/Dynamic(语圈)/View/QXToppicDynamicTopView.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXToppicDynamicTopView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/3.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXDynamicModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXToppicDynamicTopView : UIView
|
||||
-(instancetype)initWithModel:(QXTopicModel*)model;
|
||||
@property (nonatomic,strong)QXTopicModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
77
QXLive/Dynamic(语圈)/View/QXToppicDynamicTopView.m
Normal file
77
QXLive/Dynamic(语圈)/View/QXToppicDynamicTopView.m
Normal file
@@ -0,0 +1,77 @@
|
||||
//
|
||||
// QXToppicDynamicTopView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/3.
|
||||
//
|
||||
|
||||
#import "QXToppicDynamicTopView.h"
|
||||
@interface QXToppicDynamicTopView()
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIImageView *topicImageView;
|
||||
@property (nonatomic,strong)UIImageView *tagImageView;
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
@property (nonatomic,strong)UILabel *contentLabel;
|
||||
@end
|
||||
|
||||
@implementation QXToppicDynamicTopView
|
||||
|
||||
-(void)setModel:(QXTopicModel *)model{
|
||||
_model = model;
|
||||
self.titleLabel.text = model.title;
|
||||
[self.topicImageView sd_setImageWithURL:[NSURL URLWithString:model.pic]];
|
||||
self.countLabel.text = [NSString localizedStringWithFormat:QXText(@"%@条动态"),[NSString qx_showHotCountNum:model.count.longLongValue]];
|
||||
self.contentLabel.text = model.content;
|
||||
}
|
||||
|
||||
//- (instancetype)initWithFrame:(CGRect)frame
|
||||
//{
|
||||
// self = [super initWithFrame:frame];
|
||||
// if (self) {
|
||||
// [self initSubviews];
|
||||
// }
|
||||
// return self;
|
||||
//}
|
||||
-(instancetype)initWithModel:(QXTopicModel *)model{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
_model = model;
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.topicImageView = [[UIImageView alloc] initWithFrame:CGRectMake(16, 12, 45, 45)];
|
||||
self.topicImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.topicImageView.clipsToBounds = YES;
|
||||
[self.topicImageView addRoundedCornersWithRadius:4];
|
||||
[self addSubview:self.topicImageView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.topicImageView.right+7, self.topicImageView.top, SCREEN_WIDTH-self.topicImageView.right-7-16, 24)];
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16.f];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
self.tagImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"dynamic_topic_tag"]];
|
||||
self.tagImageView.frame = CGRectMake(self.titleLabel.left, self.titleLabel.bottom+7, 37 , 13);
|
||||
[self addSubview:self.tagImageView];
|
||||
|
||||
self.countLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.tagImageView.right+4, self.titleLabel.bottom+4, SCREEN_WIDTH-self.tagImageView.right-4-16, 18)];
|
||||
self.countLabel.font = [UIFont systemFontOfSize:12.f];
|
||||
self.countLabel.textColor = RGB16(0x999999);
|
||||
[self addSubview:self.countLabel];
|
||||
|
||||
self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, self.topicImageView.bottom+12, SCREEN_WIDTH-32, 20)];
|
||||
self.contentLabel.textColor = RGB16(0x666666);
|
||||
self.contentLabel.font = [UIFont systemFontOfSize:12.f];;
|
||||
self.contentLabel.numberOfLines = 0;
|
||||
[self addSubview:self.contentLabel];
|
||||
[self setModel:self.model];
|
||||
|
||||
[self.contentLabel sizeToFit];
|
||||
self.contentLabel.frame = CGRectMake(16, self.topicImageView.bottom+12, SCREEN_WIDTH-32, self.contentLabel.height);
|
||||
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, self.contentLabel.bottom+3);
|
||||
|
||||
}
|
||||
@end
|
||||
23
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.h
Normal file
23
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// QXDynamicCommentCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXDynamicCommentCell : UITableViewCell
|
||||
@property (weak, nonatomic) IBOutlet UIView *topCornerView;
|
||||
@property (weak, nonatomic) IBOutlet UIView *bottomCornerView;
|
||||
@property (nonatomic,strong)QXDynamicCommentListModel *model;
|
||||
@property (nonatomic,copy)void(^longPressBlock)(QXDynamicCommentListModel *model);
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UILabel *commentLabel;
|
||||
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
61
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.m
Normal file
61
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.m
Normal file
@@ -0,0 +1,61 @@
|
||||
//
|
||||
// QXDynamicCommentCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import "QXDynamicCommentCell.h"
|
||||
|
||||
@implementation QXDynamicCommentCell
|
||||
+(instancetype)cellWithTableView:(UITableView *)tableView{
|
||||
static NSString *cellId = @"QXDynamicCommentCell";
|
||||
QXDynamicCommentCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
|
||||
if (!cell) {
|
||||
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
|
||||
cell.backgroundColor = [UIColor clearColor];
|
||||
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:cell action:@selector(handleLongPress:)];
|
||||
[cell addGestureRecognizer:longPress];
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)setModel:(QXDynamicCommentListModel *)model{
|
||||
_model = model;
|
||||
NSString *commentUser = @"";
|
||||
if (model.reply_to_user.length == 0) {
|
||||
commentUser = [NSString stringWithFormat:@"%@:",model.nickname];
|
||||
}else{
|
||||
commentUser = [NSString localizedStringWithFormat:QXText(@"%@ 回复 %@:"),model.nickname,model.reply_to_user];
|
||||
}
|
||||
NSString* content = [NSString stringWithFormat:@"%@%@",commentUser,model.content];
|
||||
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:content];
|
||||
[attr yy_setColor:RGB16(0x999999) range:[content rangeOfString:model.content]];
|
||||
[attr yy_setColor:RGB16(0x333333) range:[content rangeOfString:commentUser]];
|
||||
self.commentLabel.attributedText = attr;
|
||||
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
|
||||
NSString*time = [formatter stringFromDate:date];
|
||||
self.timeLabel.text = time;
|
||||
}
|
||||
|
||||
-(void)handleLongPress:(UILongPressGestureRecognizer *)gesture{
|
||||
if (gesture.state == UIGestureRecognizerStateBegan) {
|
||||
if (self.longPressBlock) {
|
||||
self.longPressBlock(self.model);
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)awakeFromNib {
|
||||
[super awakeFromNib];
|
||||
// Initialization code
|
||||
}
|
||||
|
||||
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
|
||||
[super setSelected:selected animated:animated];
|
||||
|
||||
// Configure the view for the selected state
|
||||
}
|
||||
|
||||
@end
|
||||
127
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.xib
Normal file
127
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentCell.xib
Normal file
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="23504" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="23506"/>
|
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
|
||||
<tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" rowHeight="141" id="KGk-i7-Jjw" customClass="QXDynamicCommentCell">
|
||||
<rect key="frame" x="0.0" y="0.0" width="428" height="141"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="428" height="141"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="xpB-b7-lGw">
|
||||
<rect key="frame" x="64" y="0.0" width="348" height="141"/>
|
||||
<subviews>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="wj3-tk-zlh">
|
||||
<rect key="frame" x="0.0" y="0.0" width="348" height="24"/>
|
||||
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="VRd-E6-wjg"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ujm-d6-5zi">
|
||||
<rect key="frame" x="0.0" y="12" width="348" height="117"/>
|
||||
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
</view>
|
||||
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Tn3-vd-O5b">
|
||||
<rect key="frame" x="0.0" y="117" width="348" height="24"/>
|
||||
<color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.97647058819999999" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="24" id="WbI-tI-87v"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="0"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</view>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MH7-oM-77U">
|
||||
<rect key="frame" x="12" y="12" width="324" height="98"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="14"/>
|
||||
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ovO-RW-ILy">
|
||||
<rect key="frame" x="12" y="116" width="31" height="20"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="PFb-yy-Wz2"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<color key="textColor" red="0.57647058823529407" green="0.57647058823529407" blue="0.57647058823529407" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" userInteractionEnabled="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="BDR-Dd-yF8">
|
||||
<rect key="frame" x="53" y="116" width="38" height="20"/>
|
||||
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="38" id="DYo-ky-Mwr"/>
|
||||
<constraint firstAttribute="height" constant="20" id="P7V-zS-ieb"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="12"/>
|
||||
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
|
||||
<state key="normal" title="回复">
|
||||
<color key="titleColor" red="0.57647058823529407" green="0.57647058823529407" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
|
||||
</state>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
|
||||
<integer key="value" value="5"/>
|
||||
</userDefinedRuntimeAttribute>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="MH7-oM-77U" firstAttribute="top" secondItem="xpB-b7-lGw" secondAttribute="top" constant="12" id="7HG-rN-ZXB"/>
|
||||
<constraint firstItem="ovO-RW-ILy" firstAttribute="top" secondItem="MH7-oM-77U" secondAttribute="bottom" constant="6" id="CDA-7f-DI4"/>
|
||||
<constraint firstItem="wj3-tk-zlh" firstAttribute="top" secondItem="xpB-b7-lGw" secondAttribute="top" id="CtL-8c-2EE"/>
|
||||
<constraint firstItem="Tn3-vd-O5b" firstAttribute="top" secondItem="Ujm-d6-5zi" secondAttribute="bottom" constant="-12" id="DXX-9k-jtw"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Ujm-d6-5zi" secondAttribute="trailing" id="FoU-Ue-edq"/>
|
||||
<constraint firstAttribute="bottom" secondItem="Tn3-vd-O5b" secondAttribute="bottom" id="GrF-LO-MKV"/>
|
||||
<constraint firstItem="wj3-tk-zlh" firstAttribute="leading" secondItem="xpB-b7-lGw" secondAttribute="leading" id="KIq-S2-f5X"/>
|
||||
<constraint firstAttribute="trailing" secondItem="MH7-oM-77U" secondAttribute="trailing" constant="12" id="LbR-uJ-Rnz"/>
|
||||
<constraint firstItem="BDR-Dd-yF8" firstAttribute="centerY" secondItem="ovO-RW-ILy" secondAttribute="centerY" id="Pl5-d4-uSY"/>
|
||||
<constraint firstAttribute="trailing" secondItem="wj3-tk-zlh" secondAttribute="trailing" id="WM9-UL-gVo"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Tn3-vd-O5b" secondAttribute="trailing" id="XBe-4U-aAO"/>
|
||||
<constraint firstItem="Tn3-vd-O5b" firstAttribute="leading" secondItem="xpB-b7-lGw" secondAttribute="leading" id="Z1D-TT-RqS"/>
|
||||
<constraint firstItem="Ujm-d6-5zi" firstAttribute="top" secondItem="wj3-tk-zlh" secondAttribute="bottom" constant="-12" id="foT-ME-nSA"/>
|
||||
<constraint firstItem="BDR-Dd-yF8" firstAttribute="leading" secondItem="ovO-RW-ILy" secondAttribute="trailing" constant="10" id="nVH-R6-2RG"/>
|
||||
<constraint firstItem="Ujm-d6-5zi" firstAttribute="leading" secondItem="xpB-b7-lGw" secondAttribute="leading" id="nqu-b6-z28"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ovO-RW-ILy" secondAttribute="bottom" constant="5" id="tAa-xh-nWW"/>
|
||||
<constraint firstItem="MH7-oM-77U" firstAttribute="leading" secondItem="xpB-b7-lGw" secondAttribute="leading" constant="12" id="vi3-5m-DoP"/>
|
||||
<constraint firstItem="ovO-RW-ILy" firstAttribute="leading" secondItem="xpB-b7-lGw" secondAttribute="leading" constant="12" id="z0e-oe-D3t"/>
|
||||
</constraints>
|
||||
</view>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="xpB-b7-lGw" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="64" id="3Yn-bs-fOw"/>
|
||||
<constraint firstItem="xpB-b7-lGw" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="D52-la-m9V"/>
|
||||
<constraint firstAttribute="bottom" secondItem="xpB-b7-lGw" secondAttribute="bottom" id="Ohy-Rl-W1F"/>
|
||||
<constraint firstAttribute="trailing" secondItem="xpB-b7-lGw" secondAttribute="trailing" constant="16" id="cP3-J2-kVq"/>
|
||||
</constraints>
|
||||
</tableViewCellContentView>
|
||||
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
|
||||
<connections>
|
||||
<outlet property="bottomCornerView" destination="Tn3-vd-O5b" id="Wgj-q4-Hzn"/>
|
||||
<outlet property="commentLabel" destination="MH7-oM-77U" id="d4v-SC-qU7"/>
|
||||
<outlet property="timeLabel" destination="ovO-RW-ILy" id="lPo-Fk-HLc"/>
|
||||
<outlet property="topCornerView" destination="wj3-tk-zlh" id="xnW-5L-NJs"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="221.37404580152671" y="32.74647887323944"/>
|
||||
</tableViewCell>
|
||||
</objects>
|
||||
</document>
|
||||
25
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentHeaderView.h
Normal file
25
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentHeaderView.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// QXDynamicCommentHeaderView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXDynamicCommentHeaderViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didClickDeleteComment:(QXDynamicCommentListModel*)model;
|
||||
|
||||
-(void)didClickReplyComment:(QXDynamicCommentListModel*)model;
|
||||
|
||||
@end
|
||||
@interface QXDynamicCommentHeaderView : UIView
|
||||
@property (nonatomic,strong)QXDynamicCommentListModel *model;
|
||||
|
||||
@property (nonatomic,weak)id<QXDynamicCommentHeaderViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
128
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentHeaderView.m
Normal file
128
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentHeaderView.m
Normal file
@@ -0,0 +1,128 @@
|
||||
//
|
||||
// QXDynamicCommentHeaderView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import "QXDynamicCommentHeaderView.h"
|
||||
@interface QXDynamicCommentHeaderView()
|
||||
@property (nonatomic,strong)UIImageView *headerImageView;
|
||||
@property (nonatomic,strong)UILabel *nameLabel;
|
||||
@property (nonatomic,strong)UILabel *contentLabel;
|
||||
@property (nonatomic,strong)UILabel *timeLabel;
|
||||
|
||||
@property (nonatomic,strong)UIButton *replyBtn;
|
||||
@property (nonatomic,strong)UIButton *deleteBtn;
|
||||
@end
|
||||
|
||||
@implementation QXDynamicCommentHeaderView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.headerImageView = [[UIImageView alloc] init];
|
||||
self.headerImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
[self.headerImageView addRoundedCornersWithRadius:20];
|
||||
[self addSubview:self.headerImageView];
|
||||
[self.headerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.height.width.mas_equalTo(40);
|
||||
make.top.mas_equalTo(12);
|
||||
}];
|
||||
|
||||
self.nameLabel = [[UILabel alloc] init];
|
||||
self.nameLabel.textColor = [UIColor blackColor];
|
||||
self.nameLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self addSubview:self.nameLabel];
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.headerImageView.mas_right).offset(7);
|
||||
make.height.mas_equalTo(16);
|
||||
make.top.mas_equalTo(12);
|
||||
make.right.mas_equalTo(-16);
|
||||
}];
|
||||
|
||||
self.contentLabel = [[UILabel alloc] init];
|
||||
self.contentLabel.textColor = [UIColor blackColor];
|
||||
self.contentLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.contentLabel.numberOfLines = 0;
|
||||
[self addSubview:self.contentLabel];
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.nameLabel);
|
||||
make.top.equalTo(self.nameLabel.mas_bottom).offset(7);
|
||||
make.right.mas_equalTo(-16);
|
||||
}];
|
||||
|
||||
self.timeLabel = [[UILabel alloc] init];
|
||||
self.timeLabel.textColor = RGB16(0x939393);
|
||||
self.timeLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self addSubview:self.timeLabel];
|
||||
[self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.nameLabel);
|
||||
make.height.mas_equalTo(20);
|
||||
make.top.equalTo(self.contentLabel.mas_bottom).offset(2);
|
||||
}];
|
||||
|
||||
self.replyBtn = [[UIButton alloc] init];
|
||||
[self.replyBtn setTitle:QXText(@"回复") forState:(UIControlStateNormal)];
|
||||
self.replyBtn.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self.replyBtn setTitleColor:RGB16(0x939393) forState:(UIControlStateNormal)];
|
||||
[self.replyBtn addRoundedCornersWithRadius:5];
|
||||
self.replyBtn.backgroundColor = RGB16(0xF5F5F5);
|
||||
[self.replyBtn addTarget:self action:@selector(replyAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.replyBtn];
|
||||
[self.replyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.timeLabel.mas_right).offset(12);
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_equalTo(ScaleWidth(38));
|
||||
make.centerY.equalTo(self.timeLabel);
|
||||
}];
|
||||
|
||||
self.deleteBtn = [[UIButton alloc] init];
|
||||
[self.deleteBtn setTitle:QXText(@"删除") forState:(UIControlStateNormal)];
|
||||
self.deleteBtn.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
[self.deleteBtn setTitleColor:RGB16(0x939393) forState:(UIControlStateNormal)];
|
||||
[self.deleteBtn addTarget:self action:@selector(deleteAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.deleteBtn];
|
||||
[self.deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.equalTo(self.replyBtn.mas_right).offset(6);
|
||||
make.height.mas_equalTo(20);
|
||||
make.width.mas_equalTo(ScaleWidth(38));
|
||||
make.centerY.equalTo(self.timeLabel);
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)setModel:(QXDynamicCommentListModel *)model{
|
||||
_model = model;
|
||||
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:model.avatar] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.nameLabel.text = model.nickname;
|
||||
self.contentLabel.text = model.content;
|
||||
NSDate *date = [NSDate dateWithTimeIntervalSince1970:model.createtime.longLongValue]; //此处根据项目需求,选择是否除以1000 , 如果时间戳精确到秒则去掉1000
|
||||
NSDateFormatter *formatter = [[NSDateFormatter alloc]init];
|
||||
formatter.dateFormat = @"yyyy-MM-dd HH:mm:ss";
|
||||
NSString*time = [formatter stringFromDate:date];
|
||||
self.timeLabel.text = time;
|
||||
if ([model.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
self.deleteBtn.hidden = NO;
|
||||
}else{
|
||||
self.deleteBtn.hidden = YES;
|
||||
}
|
||||
}
|
||||
-(void)replyAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickReplyComment:)]) {
|
||||
[self.delegate didClickReplyComment:self.model];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)deleteAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDeleteComment:)]) {
|
||||
[self.delegate didClickDeleteComment:self.model];
|
||||
}
|
||||
}
|
||||
@end
|
||||
27
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentInputView.h
Normal file
27
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentInputView.h
Normal file
@@ -0,0 +1,27 @@
|
||||
//
|
||||
// QXDynamicCommentInputView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXDynamicCommentInputViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
-(void)didClickSendWithText:(NSString*)text model:(QXDynamicCommentListModel*)model;
|
||||
|
||||
@end
|
||||
|
||||
@interface QXDynamicCommentInputView : UIView
|
||||
@property (nonatomic,strong)UITextField *textField;
|
||||
@property (nonatomic,strong)QXDynamicCommentListModel *model;
|
||||
@property (nonatomic,weak)id<QXDynamicCommentInputViewDelegate>delegate;
|
||||
|
||||
-(void)inputBecomeFirstResponder;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
113
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentInputView.m
Normal file
113
QXLive/Dynamic(语圈)/View/详情/QXDynamicCommentInputView.m
Normal file
@@ -0,0 +1,113 @@
|
||||
//
|
||||
// QXDynamicCommentInputView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/4.
|
||||
//
|
||||
|
||||
#import "QXDynamicCommentInputView.h"
|
||||
|
||||
@interface QXDynamicCommentInputView()<UITextFieldDelegate>
|
||||
@property (nonatomic,strong)UICollectionView *collectionViwew;
|
||||
@property (nonatomic,strong)UIView *inputBgView;
|
||||
@property (nonatomic,strong)UIView *inputShadowView;
|
||||
|
||||
@property (nonatomic,strong)UIButton *sendBtn;
|
||||
@end
|
||||
|
||||
@implementation QXDynamicCommentInputView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
|
||||
self.sendBtn = [[UIButton alloc] init];
|
||||
self.sendBtn.needEventInterval = 0.5;
|
||||
[self.sendBtn setTitle:QXText(@"发送") forState:(UIControlStateNormal)];
|
||||
self.sendBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.sendBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.sendBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.sendBtn addRoundedCornersWithRadius:17.5];
|
||||
[self.sendBtn addTarget:self action:@selector(sendAction) forControlEvents:(UIControlEventTouchUpInside)];;
|
||||
[self addSubview:self.sendBtn];
|
||||
[self.sendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-16);
|
||||
make.top.mas_equalTo(8);
|
||||
make.height.mas_equalTo(35);
|
||||
make.width.mas_equalTo(80);
|
||||
}];
|
||||
|
||||
|
||||
self.inputBgView = [[UIView alloc] init];
|
||||
self.inputBgView.backgroundColor = RGB16(0xF5F5F5);
|
||||
[self.inputBgView addRoundedCornersWithRadius:8];
|
||||
[self addSubview:self.inputBgView];
|
||||
[self.inputBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(16);
|
||||
make.right.equalTo(self.sendBtn.mas_left).offset(-12);
|
||||
make.centerY.equalTo(self.sendBtn);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
self.textField = [[UITextField alloc] init];
|
||||
self.textField.font = [UIFont systemFontOfSize:14];
|
||||
self.textField.textColor = QXConfig.textColor;
|
||||
self.textField.returnKeyType = UIReturnKeyDone;
|
||||
self.textField.delegate = self;
|
||||
[self.textField addTarget:self action:@selector(textDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
[self.inputBgView addSubview:self.textField];
|
||||
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(10);
|
||||
make.right.mas_equalTo(-10);
|
||||
make.top.bottom.equalTo(self.inputBgView);
|
||||
}];
|
||||
|
||||
self.inputShadowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 4)];
|
||||
self.inputShadowView.backgroundColor = [UIColor whiteColor];
|
||||
self.inputShadowView.layer.shadowColor = [UIColor grayColor].CGColor;
|
||||
self.inputShadowView.layer.shadowOpacity = 0.2;
|
||||
self.inputShadowView.layer.shadowOffset = CGSizeMake(0, -2);
|
||||
self.inputShadowView.layer.shadowRadius = 2;
|
||||
self.inputShadowView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.inputShadowView.bounds cornerRadius:self.inputShadowView.layer.cornerRadius].CGPath;
|
||||
self.inputShadowView.layer.cornerRadius = 2;
|
||||
self.inputShadowView.layer.masksToBounds = NO;
|
||||
[self addSubview:self.inputShadowView];
|
||||
// self.inputShadowView.layer.shadowColor = [UIColor grayColor].CGColor;
|
||||
// self.inputShadowView.layer.shadowOpacity = 0.5;
|
||||
// self.inputShadowView.layer.shadowOffset = CGSizeMake(0, -2);
|
||||
//// self.inputShadowView.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:self.bounds cornerRadius:0].CGPath;
|
||||
// self.inputShadowView.layer.masksToBounds = NO;
|
||||
}
|
||||
-(void)textDidChange:(UITextField*)textField{
|
||||
if (textField.text.length>50) {
|
||||
showToast(@"评论不得超过50个字符");
|
||||
textField.text = [textField.text substringToIndex:50];
|
||||
}
|
||||
}
|
||||
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
|
||||
[textField resignFirstResponder];
|
||||
return YES;
|
||||
}
|
||||
-(void)setModel:(QXDynamicCommentListModel *)model{
|
||||
_model = model;
|
||||
}
|
||||
-(void)inputBecomeFirstResponder{
|
||||
[self.textField becomeFirstResponder];
|
||||
}
|
||||
|
||||
-(void)sendAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickSendWithText:model:)]) {
|
||||
[self.delegate didClickSendWithText:self.textField.text model:self.model];
|
||||
}
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user