提交
This commit is contained in:
21
QXLive/Mine(音域)/View/个人主页/相册/QXImageCollectionViewCell.h
Normal file
21
QXLive/Mine(音域)/View/个人主页/相册/QXImageCollectionViewCell.h
Normal file
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// QXImageCollectionViewCell.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXPhotoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXImageCollectionViewCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIImageView *imageView;
|
||||
@property (nonatomic,strong)UIView *selectedBgView;
|
||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
||||
@property (nonatomic,strong)QXPhotoModel*model;
|
||||
@property (nonatomic,assign)NSInteger index;
|
||||
@property (nonatomic,assign)BOOL selectedState;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
75
QXLive/Mine(音域)/View/个人主页/相册/QXImageCollectionViewCell.m
Normal file
75
QXLive/Mine(音域)/View/个人主页/相册/QXImageCollectionViewCell.m
Normal file
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// QXImageCollectionViewCell.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import "QXImageCollectionViewCell.h"
|
||||
|
||||
@implementation QXImageCollectionViewCell
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
//-(void)setImageUrl:(NSString *)imageUrl{
|
||||
// _imageUrl = imageUrl;
|
||||
// if ([imageUrl hasPrefix:@"http"] || [imageUrl hasPrefix:@"https"]) {
|
||||
// [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageUrl] placeholderImage:nil];
|
||||
// }else{
|
||||
// self.imageView.image = [UIImage imageNamed:imageUrl];
|
||||
// }
|
||||
//}
|
||||
|
||||
-(void)setModel:(QXPhotoModel *)model{
|
||||
_model = model;
|
||||
[self.imageView sd_setImageWithURL:[NSURL URLWithString:model.image] placeholderImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.selectedBtn.selected = model.isSelected;
|
||||
}
|
||||
|
||||
-(void)setSelectedState:(BOOL)selectedState{
|
||||
_selectedState = selectedState;
|
||||
self.selectedBtn.hidden = !selectedState;
|
||||
self.selectedBgView.hidden = !selectedState;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.imageView = [[UIImageView alloc] init];
|
||||
[self.contentView addSubview:self.imageView];
|
||||
self.imageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.imageView.clipsToBounds = YES;
|
||||
[self.imageView addRoundedCornersWithRadius:10];
|
||||
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.left.right.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
self.selectedBgView = [[UIView alloc] init];
|
||||
self.selectedBgView.backgroundColor = RGB16A(0xffffff, 0.2);
|
||||
[self.selectedBgView addRoundedCornersWithRadius:10];
|
||||
self.selectedBgView.hidden = YES;
|
||||
[self.contentView addSubview:self.selectedBgView];
|
||||
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.left.right.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
self.selectedBtn = [[UIButton alloc] init];
|
||||
self.selectedBtn.userInteractionEnabled = NO;
|
||||
self.selectedBtn.hidden = YES;
|
||||
// [self.selectedBtn addTarget:self action:@selector(selectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
|
||||
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
|
||||
[self.contentView addSubview:self.selectedBtn];
|
||||
[self.selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.top.equalTo(self);
|
||||
make.size.mas_equalTo(CGSizeMake(25, 25));
|
||||
}];
|
||||
}
|
||||
//-(void)deleteAction:(UIButton*)sender{
|
||||
// if (self.delegate && [self.delegate respondsToSelector:@selector(didClickDelete:index:)]) {
|
||||
// [self.delegate didClickDelete:self.imageUrl index:self.index];
|
||||
// }
|
||||
//}
|
||||
@end
|
||||
22
QXLive/Mine(音域)/View/个人主页/相册/QXPhotoPasswordView.h
Normal file
22
QXLive/Mine(音域)/View/个人主页/相册/QXPhotoPasswordView.h
Normal file
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// QXPhotoPasswordView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXPhotoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXPhotoPasswordViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didClickCommitWithPassword:(NSString*)password model:(QXPhotoModel*)model;
|
||||
|
||||
@end
|
||||
@interface QXPhotoPasswordView : UIView
|
||||
@property (nonatomic,strong)QXPhotoModel *model;
|
||||
@property (nonatomic,weak)id<QXPhotoPasswordViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
99
QXLive/Mine(音域)/View/个人主页/相册/QXPhotoPasswordView.m
Normal file
99
QXLive/Mine(音域)/View/个人主页/相册/QXPhotoPasswordView.m
Normal file
@@ -0,0 +1,99 @@
|
||||
//
|
||||
// QXPhotoPasswordView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXPhotoPasswordView.h"
|
||||
@interface QXPhotoPasswordView()
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UIButton *closeBtn;
|
||||
@property (nonatomic,strong)UILabel *messageLabel;
|
||||
@property (nonatomic,strong)UIView *textBgView;
|
||||
@property (nonatomic,strong)UITextField *textField;
|
||||
@property (nonatomic,strong)UIButton*cancelBtn;
|
||||
@property (nonatomic,strong)UIButton*commitBtn;
|
||||
@end
|
||||
@implementation QXPhotoPasswordView
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
self.frame = CGRectMake(0, 0, ScaleWidth(300), ScaleWidth(200));
|
||||
self.backgroundColor = [UIColor whiteColor];
|
||||
[self addRoundedCornersWithRadius:16];
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 12, self.width-80, 24)];
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
self.titleLabel.text = QXText(@"温馨提示");
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
self.closeBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-40, 0, 40, 40)];
|
||||
[self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.closeBtn setImage:[UIImage imageNamed:@"wallet_close"] forState:(UIControlStateNormal)];
|
||||
[self addSubview:self.closeBtn];
|
||||
|
||||
self.messageLabel = [[UILabel alloc] initWithFrame:CGRectMake(12, self.titleLabel.bottom+12, self.width-24, 21)];
|
||||
self.messageLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.messageLabel.textColor = QXConfig.textColor;
|
||||
self.messageLabel.text = QXText(@"确认开启相册私密吗");
|
||||
[self addSubview:self.messageLabel];
|
||||
|
||||
self.textBgView = [[UIView alloc] initWithFrame:CGRectMake(12, self.messageLabel.bottom+12, self.width-24, 44)];
|
||||
[self.textBgView addRoundedCornersWithRadius:11];
|
||||
self.textBgView.backgroundColor = RGB16(0xeff2f8);
|
||||
[self addSubview:self.textBgView];
|
||||
|
||||
self.textField = [[UITextField alloc] initWithFrame:CGRectMake(12, 0, self.textBgView.width-24, 44)];
|
||||
self.textField.font = [UIFont systemFontOfSize:16];
|
||||
self.textField.textColor = QXConfig.textColor;
|
||||
self.textField.placeholder = QXText(@"请输入密码");
|
||||
[self.textBgView addSubview:self.textField];
|
||||
|
||||
CGFloat btnWidth = (self.width-19*2-16) / 2;
|
||||
self.cancelBtn = [[UIButton alloc] initWithFrame:CGRectMake(19, self.textBgView.bottom+23, btnWidth, 42)];
|
||||
[self.cancelBtn setTitle:QXText(@"取消") forState:(UIControlStateNormal)];
|
||||
[self.cancelBtn setTitleColor:RGB16(0x999999) forState:(UIControlStateNormal)];
|
||||
self.cancelBtn.backgroundColor = RGB16(0xf3f3f3);
|
||||
self.cancelBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.cancelBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.cancelBtn addRoundedCornersWithRadius:21];
|
||||
[self addSubview:self.cancelBtn];
|
||||
|
||||
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.cancelBtn.right+16, self.cancelBtn.top, btnWidth, 42)];
|
||||
[self.commitBtn setTitle:QXText(@"确认") forState:(UIControlStateNormal)];
|
||||
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
|
||||
self.commitBtn.backgroundColor = QXConfig.themeColor;
|
||||
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.commitBtn addRoundedCornersWithRadius:21];
|
||||
[self addSubview:self.commitBtn];
|
||||
}
|
||||
-(void)setModel:(QXPhotoModel *)model{
|
||||
_model = model;
|
||||
}
|
||||
-(void)closeAction{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)commitAction{
|
||||
MJWeakSelf
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
if (weakSelf.delegate && [self.delegate respondsToSelector:@selector(didClickCommitWithPassword:model:)]) {
|
||||
[weakSelf.delegate didClickCommitWithPassword:weakSelf.textField.text model:self.model];
|
||||
}
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
23
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosDetailTopView.h
Normal file
23
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosDetailTopView.h
Normal file
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// QXPhotosDetailTopView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXPhotoModel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXPhotosDetailTopViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didClickEditWith:(QXPhotoDetailModel*)model;
|
||||
|
||||
@end
|
||||
@interface QXPhotosDetailTopView : UIView
|
||||
@property (nonatomic,assign)BOOL isMe;
|
||||
@property (nonatomic,weak)id<QXPhotosDetailTopViewDelegate>delegate;
|
||||
@property (nonatomic,strong)QXPhotoDetailModel *model;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
124
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosDetailTopView.m
Normal file
124
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosDetailTopView.m
Normal file
@@ -0,0 +1,124 @@
|
||||
//
|
||||
// QXPhotosDetailTopView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import "QXPhotosDetailTopView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXCreatPhotosViewController.h"
|
||||
|
||||
@interface QXPhotosDetailTopView()
|
||||
@property (nonatomic,strong)UIImageView*bgImageView;
|
||||
@property (nonatomic,strong)UIView*coverView;
|
||||
@property (nonatomic,strong)UILabel*titleLabel;
|
||||
@property (nonatomic,strong)UIButton*editBtn;
|
||||
@property (nonatomic,strong)UIButton*countBtn;
|
||||
|
||||
@property (nonatomic,strong)UIButton*likeBtn;
|
||||
@property (nonatomic,strong)UIButton*seeBtn;
|
||||
@end
|
||||
@implementation QXPhotosDetailTopView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubview];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubview{
|
||||
self.bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
|
||||
self.bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.bgImageView.clipsToBounds = YES;
|
||||
[self addSubview:self.bgImageView];
|
||||
|
||||
// self.coverView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
|
||||
// self.coverView.backgroundColor = RGB16A(0xffffff, 0.65);
|
||||
// [self addSubview:self.coverView];
|
||||
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
|
||||
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
|
||||
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:effect];
|
||||
UIVisualEffectView *vibrancyView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
|
||||
vibrancyView.frame = self.bgImageView.frame;
|
||||
[blurView.contentView addSubview:vibrancyView];
|
||||
blurView.frame = self.bgImageView.frame;
|
||||
[self.bgImageView addSubview:blurView];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (self.height-25)/2, self.width, 25)];
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
self.titleLabel.textColor = RGB16(0x333333);
|
||||
self.titleLabel.textAlignment = NSTextAlignmentCenter;
|
||||
[self addSubview:self.titleLabel];
|
||||
|
||||
self.editBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.height-45)/2, 0, 45, 45)];
|
||||
self.editBtn.centerY = self.titleLabel.centerY;
|
||||
[self.editBtn setImage:[[UIImage imageNamed:@"photo_eidt"] imageByTintColor:RGB16(0x666666)] forState:(UIControlStateNormal)];
|
||||
[self.editBtn addTarget:self action:@selector(editAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.editBtn];
|
||||
|
||||
self.countBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+2, self.width, 25)];
|
||||
[self.countBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateNormal)];
|
||||
[self.countBtn setTitle:[NSString localizedStringWithFormat:QXText(@"%@张照片"),@"0"] forState:(UIControlStateNormal)];
|
||||
self.countBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self addSubview:self.countBtn];
|
||||
|
||||
self.likeBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, self.height-40-5, self.width/2, 40)];
|
||||
[self.likeBtn setImage:[UIImage imageNamed:@"photos_like"] forState:(UIControlStateNormal)];
|
||||
[self.likeBtn setImage:[[UIImage imageNamed:@"photos_like"] imageByTintColor:RGB16(0xFB4344)] forState:(UIControlStateSelected)];
|
||||
[self.likeBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
self.likeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.likeBtn setTitle:@" 0" forState:(UIControlStateNormal)];
|
||||
[self.likeBtn addTarget:self action:@selector(likeAction) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self addSubview:self.likeBtn];
|
||||
|
||||
self.seeBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width/2, self.height-40-5, self.width/2, 40)];
|
||||
[self.seeBtn setImage:[UIImage imageNamed:@"photos_see"] forState:(UIControlStateNormal)];
|
||||
[self.seeBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
|
||||
self.seeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[self.seeBtn setTitle:@" 0" forState:(UIControlStateNormal)];
|
||||
[self addSubview:self.seeBtn];
|
||||
}
|
||||
|
||||
-(void)editAction{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickEditWith:)]) {
|
||||
[self.delegate didClickEditWith:self.model];
|
||||
}
|
||||
}
|
||||
-(void)likeAction{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosLikeWithAlbumId:self.model.id successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
weakSelf.likeBtn.selected = !weakSelf.likeBtn.selected;
|
||||
if (weakSelf.likeBtn.selected) {
|
||||
[weakSelf.likeBtn setTitle:[NSString stringWithFormat:@" %ld", weakSelf.likeBtn.titleLabel.text.integerValue+1] forState:UIControlStateNormal];
|
||||
}else{
|
||||
[weakSelf.likeBtn setTitle:[NSString stringWithFormat:@" %ld", weakSelf.likeBtn.titleLabel.text.integerValue-1] forState:UIControlStateNormal];
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
-(void)setIsMe:(BOOL)isMe{
|
||||
_isMe = isMe;
|
||||
self.editBtn.hidden = !isMe;
|
||||
}
|
||||
-(void)setModel:(QXPhotoDetailModel *)model{
|
||||
_model = model;
|
||||
[self.bgImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
|
||||
self.titleLabel.text = model.name;
|
||||
self.likeBtn.selected = model.is_like.intValue == 1;
|
||||
[self.titleLabel sizeToFit];
|
||||
self.titleLabel.frame = CGRectMake((self.width-self.titleLabel.width)/2, (self.height-25)/2, self.titleLabel.width, 25);
|
||||
self.editBtn.frame = CGRectMake(self.titleLabel.right, self.titleLabel.top-10, 45, 45);
|
||||
if (model.pwd.length > 0) {
|
||||
[self.countBtn setImage:[UIImage imageNamed:@"photos_lock_state"] forState:(UIControlStateNormal)];
|
||||
}else{
|
||||
[self.countBtn setImage:nil forState:(UIControlStateNormal)];
|
||||
}
|
||||
[self.countBtn setTitle:[NSString localizedStringWithFormat:QXText(@"%@张照片"),model.count] forState:(UIControlStateNormal)];
|
||||
[self.likeBtn setTitle:[NSString stringWithFormat:@" %@",model.like_num] forState:(UIControlStateNormal)];
|
||||
[self.seeBtn setTitle:[NSString stringWithFormat:@" %@",model.read_num] forState:(UIControlStateNormal)];
|
||||
}
|
||||
@end
|
||||
17
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosMoveListView.h
Normal file
17
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosMoveListView.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// QXPhotosMoveListView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/6.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "QXPhotoModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPhotosMoveListView : UIView
|
||||
@property (nonatomic,strong)void(^selecctedModelBlock)(QXPhotoModel *model);
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
150
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosMoveListView.m
Normal file
150
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosMoveListView.m
Normal file
@@ -0,0 +1,150 @@
|
||||
//
|
||||
// QXPhotosMoveListView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/6.
|
||||
//
|
||||
|
||||
#import "QXPhotosMoveListView.h"
|
||||
#import "QXUserPhotosView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
|
||||
@interface QXPhotosMoveListView()<UICollectionViewDelegate,UICollectionViewDataSource>
|
||||
@property (nonatomic,strong)UILabel* titleLabel;
|
||||
|
||||
@property (nonatomic,strong)UIButton* cancelBtn;
|
||||
@property (nonatomic,strong)UIButton* commitBtn;
|
||||
|
||||
@property (nonatomic,strong)UICollectionView *collectionView;
|
||||
@property (nonatomic,assign)NSInteger page;
|
||||
@property (nonatomic,strong)NSMutableArray *dataArray;
|
||||
@property (nonatomic,assign)NSInteger selectedIndex;
|
||||
@end
|
||||
|
||||
@implementation QXPhotosMoveListView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)initSubviews{
|
||||
self.selectedIndex = -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];
|
||||
|
||||
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-13*3)/4, (SCREEN_WIDTH-16*2-13*3)/4+46);
|
||||
layout.minimumLineSpacing = 13;
|
||||
layout.minimumInteritemSpacing = 13;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, self.titleLabel.bottom+8, self.width, self.height-16-self.titleLabel.bottom-8) collectionViewLayout:layout];
|
||||
[self.collectionView registerClass:[QXUserPhotosCell class] forCellWithReuseIdentifier:@"QXUserPhotosCell"];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
self.collectionView.showsHorizontalScrollIndicator = NO;
|
||||
self.collectionView.backgroundColor = RGB16(0xf6f6f6);
|
||||
[self addSubview:self.collectionView];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getPhotoList];
|
||||
}];
|
||||
[self getPhotoList];
|
||||
}
|
||||
-(void)cancelAction{
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
if (self.selectedIndex == -1) {
|
||||
showToast(@"请选择相册");
|
||||
return;
|
||||
}
|
||||
MJWeakSelf
|
||||
[[QXGlobal shareGlobal] hideViewBlock:^{
|
||||
if (weakSelf.selecctedModelBlock) {
|
||||
weakSelf.selecctedModelBlock(weakSelf.dataArray[self.selectedIndex]);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)getPhotoList{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosListWithUserId:[QXGlobal shareGlobal].loginModel.user_id
|
||||
page:self.page
|
||||
successBlock:^(NSArray<QXPhotoModel *> * _Nonnull hotos) {
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:hotos];
|
||||
if (hotos.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXUserPhotosCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXUserPhotosCell" forIndexPath:indexPath];
|
||||
QXPhotoModel *model = self.dataArray[indexPath.row];
|
||||
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
|
||||
cell.titleLabel.text = model.name;
|
||||
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
|
||||
cell.isLock = NO;
|
||||
cell.selectedState = YES;
|
||||
if (indexPath.row == self.selectedIndex) {
|
||||
cell.selectedBtn.selected = YES;
|
||||
}else{
|
||||
cell.selectedBtn.selected = NO;
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
self.selectedIndex = indexPath.row;
|
||||
[collectionView reloadData];
|
||||
}
|
||||
|
||||
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray array];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
@end
|
||||
16
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosSectionView.h
Normal file
16
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosSectionView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// QXPhotosSectionView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXPhotosSectionView : UICollectionReusableView
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
26
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosSectionView.m
Normal file
26
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosSectionView.m
Normal file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// QXPhotosSectionView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import "QXPhotosSectionView.h"
|
||||
|
||||
@implementation QXPhotosSectionView
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, self.width-32, self.height)];
|
||||
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
[self addSubview:self.titleLabel];
|
||||
}
|
||||
@end
|
||||
25
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosToolsView.h
Normal file
25
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosToolsView.h
Normal file
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// QXPhotosToolsView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
typedef NS_ENUM(NSInteger) {
|
||||
QXPhotosToolsActionShare = 10,
|
||||
QXPhotosToolsActionMove,
|
||||
QXPhotosToolsActionDelete,
|
||||
}QXPhotosToolsActionType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol QXPhotosToolsViewDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
-(void)didClickActionType:(QXPhotosToolsActionType)type;
|
||||
|
||||
@end
|
||||
@interface QXPhotosToolsView : UIView
|
||||
@property (nonatomic,weak)id<QXPhotosToolsViewDelegate>delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
54
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosToolsView.m
Normal file
54
QXLive/Mine(音域)/View/个人主页/相册/QXPhotosToolsView.m
Normal file
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// QXPhotosToolsView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/6/5.
|
||||
//
|
||||
|
||||
#import "QXPhotosToolsView.h"
|
||||
#import "UIButton+QX.h"
|
||||
|
||||
@interface QXPhotosToolsView()
|
||||
@property (nonatomic,strong)NSArray *toolsTitleArray;
|
||||
@property (nonatomic,strong)NSArray *toolsImageArray;
|
||||
@end
|
||||
@implementation QXPhotosToolsView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, 1)];
|
||||
line.backgroundColor = RGB16(0xE2E2E2);
|
||||
[self addSubview:line];
|
||||
|
||||
self.toolsTitleArray = @[QXText(@"分享"),QXText(@"移动"),QXText(@"删除")];
|
||||
self.toolsImageArray = @[@"photos_share",@"photos_move",@"photos_delete"];
|
||||
CGFloat btnWidth = self.width/self.toolsImageArray.count;
|
||||
for (int i = 0; i < self.toolsTitleArray.count; i++) {
|
||||
NSString *title = self.toolsTitleArray[i];
|
||||
NSString *image = self.toolsImageArray[i];
|
||||
UIButton *btn = [[UIButton alloc] initWithFrame:CGRectMake(i*btnWidth, 1, btnWidth, 49)];
|
||||
[btn setTitle:title forState:(UIControlStateNormal)];
|
||||
[btn setTitleColor:QXConfig.textColor forState:(UIControlStateNormal)];
|
||||
btn.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
[btn setImage:[UIImage imageNamed:image] forState:(UIControlStateNormal)];
|
||||
btn.tag = 10+i;
|
||||
[btn addTarget:self action:@selector(btnAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[btn qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyleTop) imageTitleSpace:2];
|
||||
[self addSubview:btn];
|
||||
}
|
||||
}
|
||||
|
||||
-(void)btnAction:(UIButton*)sender{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickActionType:)]) {
|
||||
[self.delegate didClickActionType:sender.tag];
|
||||
}
|
||||
}
|
||||
@end
|
||||
31
QXLive/Mine(音域)/View/个人主页/相册/QXUserPhotosView.h
Normal file
31
QXLive/Mine(音域)/View/个人主页/相册/QXUserPhotosView.h
Normal file
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// QXUserPhotosView.h
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "JXPagerView.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXUserPhotosView : UIView<JXPagerViewListViewDelegate>
|
||||
@property (nonatomic, strong) UICollectionView *collectionView;
|
||||
@property (nonatomic, copy) void(^listScrollCallback)(UIScrollView *scrollView);
|
||||
@property (nonatomic,strong)NSString *user_id;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@interface QXUserPhotosCell : UICollectionViewCell
|
||||
@property (nonatomic,strong)UIImageView *photoImageView;
|
||||
@property (nonatomic,strong)UILabel *titleLabel;
|
||||
@property (nonatomic,strong)UILabel *countLabel;
|
||||
@property (nonatomic,strong)UIImageView *lockImageView;
|
||||
@property (nonatomic,strong)UIVisualEffectView *blurView;
|
||||
@property (nonatomic,assign)BOOL isLock;
|
||||
@property (nonatomic,strong)UIButton *selectedBtn;
|
||||
@property (nonatomic,strong)UIView *selectedBgView;
|
||||
@property (nonatomic,assign)BOOL selectedState;
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
361
QXLive/Mine(音域)/View/个人主页/相册/QXUserPhotosView.m
Normal file
361
QXLive/Mine(音域)/View/个人主页/相册/QXUserPhotosView.m
Normal file
@@ -0,0 +1,361 @@
|
||||
//
|
||||
// QXUserPhotosView.m
|
||||
// QXLive
|
||||
//
|
||||
// Created by 启星 on 2025/5/29.
|
||||
//
|
||||
|
||||
#import "QXUserPhotosView.h"
|
||||
#import "QXCreatPhotosViewController.h"
|
||||
#import "QXPhotoPasswordView.h"
|
||||
#import "QXMineNetwork.h"
|
||||
#import "QXPhotosDetailVC.h"
|
||||
|
||||
@interface QXUserPhotosView()<UICollectionViewDelegate,UICollectionViewDataSource,QXPhotoPasswordViewDelegate>
|
||||
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
||||
@property (nonatomic, strong) NSMutableArray *dataArray;
|
||||
@property (nonatomic, assign) NSInteger page;
|
||||
@property (nonatomic, assign) BOOL isMe;
|
||||
@end
|
||||
@implementation QXUserPhotosView
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
self.page = 1;
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(photosListReload) name:noticePhotosStatusChange object:nil];
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.itemSize = CGSizeMake((SCREEN_WIDTH-16*2-13)/2, (SCREEN_WIDTH-16*2-13)/2+46);
|
||||
layout.minimumLineSpacing = 13;
|
||||
layout.minimumInteritemSpacing = 13;
|
||||
layout.sectionInset = UIEdgeInsetsMake(0, 16, 0, 16);
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
|
||||
[self.collectionView registerClass:[QXUserPhotosCell class] forCellWithReuseIdentifier:@"QXUserPhotosCell"];
|
||||
self.collectionView.delegate = self;
|
||||
self.collectionView.dataSource = self;
|
||||
self.collectionView.showsHorizontalScrollIndicator = NO;
|
||||
self.collectionView.backgroundColor = RGB16(0xf6f6f6);
|
||||
[self addSubview:self.collectionView];
|
||||
[self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(12);
|
||||
make.top.mas_equalTo(12);
|
||||
make.height.mas_equalTo(ScaleWidth(76));
|
||||
make.right.mas_equalTo(-12);
|
||||
}];
|
||||
MJWeakSelf
|
||||
_collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
|
||||
weakSelf.page++;
|
||||
[weakSelf getPhotos];
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithOffsetY:(CGFloat)offsety {
|
||||
self = [self initWithFrame:CGRectZero];
|
||||
self.collectionView.contentOffset = CGPointMake(0, offsety);
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews {
|
||||
[super layoutSubviews];
|
||||
|
||||
self.collectionView.frame = self.bounds;
|
||||
}
|
||||
|
||||
-(void)setUser_id:(NSString *)user_id{
|
||||
_user_id = user_id;
|
||||
if ([user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
self.isMe = YES;
|
||||
}else{
|
||||
self.isMe = NO;
|
||||
}
|
||||
[self getPhotos];
|
||||
}
|
||||
|
||||
-(void)photosListReload{
|
||||
self.page = 1;
|
||||
[self getPhotos];
|
||||
}
|
||||
|
||||
-(void)getPhotos{
|
||||
MJWeakSelf
|
||||
[QXMineNetwork photosListWithUserId:self.user_id
|
||||
page:self.page
|
||||
successBlock:^(NSArray<QXPhotoModel *> * _Nonnull hotos) {
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
if (weakSelf.page == 1) {
|
||||
[weakSelf.dataArray removeAllObjects];
|
||||
}
|
||||
[weakSelf.dataArray addObjectsFromArray:hotos];
|
||||
if (hotos.count == 0) {
|
||||
weakSelf.collectionView.mj_footer.state = MJRefreshStateNoMoreData;
|
||||
}else{
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}
|
||||
[weakSelf.collectionView reloadData];
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
[weakSelf.collectionView.mj_footer endRefreshing];
|
||||
}];
|
||||
}
|
||||
|
||||
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
|
||||
if (self.isMe) {
|
||||
return self.dataArray.count+1;
|
||||
}else{
|
||||
return self.dataArray.count;
|
||||
}
|
||||
|
||||
}
|
||||
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
QXUserPhotosCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXUserPhotosCell" forIndexPath:indexPath];
|
||||
if (self.isMe) {
|
||||
if (indexPath.row == 0) {
|
||||
cell.photoImageView.image = [UIImage imageNamed:@"user_photos_add"];
|
||||
cell.titleLabel.text = @"";
|
||||
cell.countLabel.text = @"";
|
||||
cell.isLock = NO;
|
||||
}else{
|
||||
QXPhotoModel *model = self.dataArray[indexPath.row-1];
|
||||
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
|
||||
cell.titleLabel.text = model.name;
|
||||
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
|
||||
if (model.is_pwd.integerValue == 0) {
|
||||
cell.isLock = NO;
|
||||
}else{
|
||||
cell.isLock = YES;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
QXPhotoModel *model = self.dataArray[indexPath.row];
|
||||
[cell.photoImageView sd_setImageWithURL:[NSURL URLWithString:model.image]];
|
||||
cell.titleLabel.text = model.name;
|
||||
cell.countLabel.text = [NSString stringWithFormat:@"浏览 %@",model.read_num];
|
||||
if (model.is_pwd.integerValue == 0) {
|
||||
cell.isLock = NO;
|
||||
}else{
|
||||
cell.isLock = YES;
|
||||
}
|
||||
}
|
||||
return cell;
|
||||
}
|
||||
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
|
||||
MJWeakSelf
|
||||
if (self.isMe) {
|
||||
if (indexPath.row == 0) {
|
||||
QXCreatPhotosViewController *vc = [[QXCreatPhotosViewController alloc] init];
|
||||
vc.createSuccessBlock = ^{
|
||||
[weakSelf getPhotos];
|
||||
};
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXPhotoModel *model = self.dataArray[indexPath.row-1];
|
||||
if (model.is_pwd.integerValue == 0) {
|
||||
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
vc.albumId = model.id;
|
||||
vc.name = model.name;
|
||||
vc.photoList = self.dataArray;
|
||||
vc.userId = self.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
if ([self.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
vc.albumId = model.id;
|
||||
vc.name = model.name;
|
||||
vc.photoList = self.dataArray;
|
||||
vc.userId = self.user_id;
|
||||
vc.pwd = model.pwd;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXPhotoPasswordView *passwordView = [[QXPhotoPasswordView alloc] init];
|
||||
passwordView.model = model;
|
||||
passwordView.delegate = self;
|
||||
[[QXGlobal shareGlobal] showView:passwordView popType:(PopViewTypePopFromCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
QXPhotoModel *model = self.dataArray[indexPath.row];
|
||||
if (model.is_pwd.integerValue == 0) {
|
||||
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
vc.albumId = model.id;
|
||||
vc.name = model.name;
|
||||
vc.photoList = self.dataArray;
|
||||
vc.userId = self.user_id;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
if ([self.user_id isEqualToString:[QXGlobal shareGlobal].loginModel.user_id]) {
|
||||
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
vc.albumId = model.id;
|
||||
vc.name = model.name;
|
||||
vc.photoList = self.dataArray;
|
||||
vc.userId = self.user_id;
|
||||
vc.pwd = model.pwd;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
QXPhotoPasswordView *passwordView = [[QXPhotoPasswordView alloc] init];
|
||||
passwordView.model = model;
|
||||
passwordView.delegate = self;
|
||||
[[QXGlobal shareGlobal] showView:passwordView popType:(PopViewTypePopFromCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-(void)didClickCommitWithPassword:(NSString *)password model:(nonnull QXPhotoModel *)model{
|
||||
QXLOG(@"相册密码为%@",password);
|
||||
if ([password isEqualToString:model.pwd]) {
|
||||
QXPhotosDetailVC *vc = [[QXPhotosDetailVC alloc] init];
|
||||
vc.albumId = model.id;
|
||||
vc.name = model.name;
|
||||
vc.photoList = self.dataArray;
|
||||
vc.userId = self.user_id;
|
||||
vc.pwd = password;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}else{
|
||||
showToast(@"密码错误");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
||||
if (self.scrollCallback != nil) {
|
||||
self.scrollCallback(scrollView);
|
||||
}
|
||||
if (self.listScrollCallback != nil) {
|
||||
self.listScrollCallback(scrollView);
|
||||
}
|
||||
}
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
|
||||
- (UIScrollView *)listScrollView {
|
||||
return self.collectionView;
|
||||
}
|
||||
|
||||
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
|
||||
self.scrollCallback = callback;
|
||||
}
|
||||
|
||||
- (UIView *)listView {
|
||||
return self;
|
||||
}
|
||||
|
||||
-(NSMutableArray *)dataArray{
|
||||
if (!_dataArray) {
|
||||
_dataArray = [NSMutableArray arrayWithCapacity:1];
|
||||
}
|
||||
return _dataArray;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation QXUserPhotosCell
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
if (self) {
|
||||
[self initSubviews];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
-(void)setIsLock:(BOOL)isLock{
|
||||
_isLock = isLock;
|
||||
self.lockImageView.hidden = !isLock;
|
||||
self.blurView.hidden = !isLock;
|
||||
}
|
||||
|
||||
-(void)setSelectedState:(BOOL)selectedState{
|
||||
_selectedState = selectedState;
|
||||
self.selectedBtn.hidden = !selectedState;
|
||||
self.selectedBgView.hidden = !selectedState;
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
// user_photos_add
|
||||
self.photoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_header_placehoulder"]];
|
||||
self.photoImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
self.photoImageView.clipsToBounds = YES;
|
||||
[self.photoImageView addRoundedCornersWithRadius:6];
|
||||
[self.contentView addSubview:self.photoImageView];
|
||||
[self.photoImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.equalTo(self.contentView);
|
||||
make.height.equalTo(self.photoImageView.mas_width).multipliedBy(1);
|
||||
}];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.titleLabel.textColor = QXConfig.textColor;
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.contentView);
|
||||
make.top.equalTo(self.photoImageView.mas_bottom).offset(6);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
|
||||
self.countLabel = [[UILabel alloc] init];
|
||||
self.countLabel.font = [UIFont systemFontOfSize:14];
|
||||
self.countLabel.textColor = RGB16(0x999999);
|
||||
[self.contentView addSubview:self.countLabel];
|
||||
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.equalTo(self.contentView);
|
||||
make.top.equalTo(self.titleLabel.mas_bottom);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
self.lockImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"user_photos_lock"]];
|
||||
self.lockImageView.hidden = YES;
|
||||
[self.contentView addSubview:self.lockImageView];
|
||||
[self.lockImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.centerY.equalTo(self.photoImageView);
|
||||
make.size.mas_equalTo(CGSizeMake(ScaleWidth(22), ScaleWidth(22)));
|
||||
}];
|
||||
|
||||
self.selectedBgView = [[UIView alloc] init];
|
||||
self.selectedBgView.backgroundColor = RGB16A(0xffffff, 0.2);
|
||||
[self.selectedBgView addRoundedCornersWithRadius:10];
|
||||
self.selectedBgView.hidden = YES;
|
||||
[self.contentView addSubview:self.selectedBgView];
|
||||
[self.selectedBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.left.right.equalTo(self.contentView);
|
||||
}];
|
||||
|
||||
self.selectedBtn = [[UIButton alloc] init];
|
||||
self.selectedBtn.userInteractionEnabled = NO;
|
||||
self.selectedBtn.hidden = YES;
|
||||
// [self.selectedBtn addTarget:self action:@selector(selectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
|
||||
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_sel"] forState:(UIControlStateSelected)];
|
||||
[self.selectedBtn setImage:[UIImage imageNamed:@"login_agreement_nor"] forState:(UIControlStateNormal)];
|
||||
[self.contentView addSubview:self.selectedBtn];
|
||||
[self.selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.top.equalTo(self);
|
||||
make.size.mas_equalTo(CGSizeMake(25, 25));
|
||||
}];
|
||||
|
||||
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
|
||||
UIVisualEffectView *blurView = [[UIVisualEffectView alloc] initWithEffect:effect];
|
||||
UIVibrancyEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:effect];
|
||||
UIVisualEffectView *vibrancyView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
|
||||
[blurView.contentView addSubview:vibrancyView];
|
||||
self.blurView = blurView;
|
||||
self.blurView.hidden = YES;
|
||||
[self.photoImageView addSubview:blurView];
|
||||
[blurView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(self.photoImageView);
|
||||
}];
|
||||
[vibrancyView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.bottom.equalTo(blurView);
|
||||
}];
|
||||
}
|
||||
@end
|
||||
Reference in New Issue
Block a user