123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570 |
- //
- // YOUPAIZYUserZiLiaoVC.m
- // VQU
- //
- // Created by 肖浩然的mac on 2021/7/10.
- // Copyright © 2021 leo. All rights reserved.
- //
- #import "YOUPAIZYUserZiLiaoVC.h"
- #import "YOUPAILCGuardModel.h"
- #import "YOUPAILCUserShowModel.h"
- #import "YOUPAIZYUserZiLiaoDTCell.h"
- #import "YOUPAIZYUserZiLiaoPJCell.h"
- #import "YOUPAIZYUserZiLiaoBHCell.h"
- #import "YOUPAIZYUserZiLiaoSHCell.h"
- #import "YOUPAIZYUserZiLiaoLWCell.h"
- #import "YOUPAIZYSearchVC.h"
- #import "YOUPAIZYUserDynamicVC.h"
- #import "YOUPAILPGuardBordeVC.h"
- #import "YOUPAIZYAsylumListVC.h"
- #import "YOUPAILCReceiveGiftVC.h"
- #import "YOUPAIZYUserZiLiaoBHNoDataCell.h"
- #import "YOUPAIZYUserZiLiaoSHNoDataCell.h"
- #import "YOUPAIZYBiHuVC.h"
- #import "YOUPAILPGuardHerVC.h"
- #import "UIViewController+TFPresent.h"
- #import "YOUPAIZYUserZiLiaoXZCell.h"
- #import "YOUPAILCDynamicArrayModel.h"
- #import "YOUPAIZYUserZiLiaoGRTopCell.h"
- #import "YOUPAIZYUserZiLiaoGRXXCell.h"
- typedef enum : NSUInteger {
-
- ZYUserZiLiaoCellType_SY,//声音和个性
- ZYUserZiLiaoCellType_MS,//信息详情
- ZYUserZiLiaoCellType_XZ,//勋章
- ZYUserZiLiaoCellType_DT,//动态
- ZYUserZiLiaoCellType_PJ,//评价
- ZYUserZiLiaoCellType_BH,//庇护
- ZYUserZiLiaoCellType_SH,//守护
- ZYUserZiLiaoCellType_LW//礼物
- } ZYUserZiLiaoCellType;
- @interface ZYUserZiLiaoModel : NSObject
- // 类型
- @property (nonatomic, assign) ZYUserZiLiaoCellType youpaiptype;
- // cell高
- @property (nonatomic, assign) CGFloat youpaipcellHeight;
- //是否展示更多(标签)
- @property (assign, nonatomic) BOOL youpaipisOpen;
- @end
- @implementation ZYUserZiLiaoModel
- @end
- @interface YOUPAIZYUserZiLiaoVC ()<UICollectionViewDelegate,UICollectionViewDataSource,ZYLabelViewDelegate,ZYDidCellOrBtnDelegate,ZYDidBHCellOrBtnDelegate,ZYDidSHCellOrBtnDelegate,ZYDidLWCellOrBtnDelegate,ZYBiHuDelegate,LPGuardHerDelegate>
- @property (strong, nonatomic) UICollectionView *youpaipcollectionView;
- @property(nonatomic,strong)NSMutableArray* youpaipalbumArray;//顶部相册
- @property(nonatomic,strong)NSMutableArray* youpaipdynamicArray;//动态
- @property(nonatomic,strong)NSMutableArray* youpaipgiftArray;//礼物
- @property(nonatomic,assign)UIStatusBarStyle youpaipbarStatus;
- @property(nonatomic,strong)YOUPAILCGuardModel *youpaipguardInfo;
- @property(nonatomic,strong)NSMutableArray *youpaipguardImageArray;//守护
- @property(nonatomic,strong)NSMutableArray *youpaipasylumImageArray;//庇护
- @property(nonatomic,strong)NSMutableArray *youpaiplabel_list;//标签
- @property(nonatomic,strong)NSMutableArray *youpaipbadge_all;//勋章
- @property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
- /* cell的数组 */
- @property (strong, nonatomic) NSMutableArray *youpaipcellDataArr;
- @property(nonatomic,strong)YOUPAILCUserShowModel* youpaipshowModel;
- /* 返回便签的高度 */
- @property (assign, nonatomic) CGFloat youpaippjHeight;
- @property (assign, nonatomic) BOOL youpaipisOpen;
- @property (strong, nonatomic) NSMutableArray *youpaipbasic_info;
- @end
- @implementation YOUPAIZYUserZiLiaoVC
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.youpaipalbumArray = [NSMutableArray array];
- self.youpaipbasic_info = [NSMutableArray array];
-
- self.youpaipdynamicArray = [NSMutableArray array];
- self.youpaipgiftArray = [NSMutableArray array];
- self.youpaipguardImageArray = [NSMutableArray array];
- self.youpaipasylumImageArray = [NSMutableArray array];
- self.youpaiplabel_list = [NSMutableArray array];
- self.youpaipcellDataArr = [NSMutableArray array];
- self.youpaipbadge_all = [NSMutableArray array];
- [self youpaipcollectionView];
- [self youpaifinitData];
- }
- - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
- ZYUserZiLiaoModel *model = self.youpaipcellDataArr[indexPath.section];
-
- return CGSizeMake(KScreenWidth, model.youpaipcellHeight);
-
- }
- - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
-
- return self.youpaipcellDataArr.count;
- }
- - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
-
-
- return 1;
- }
- - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
-
- YOUPAIZYLabelModel *model = self.youpaipcellDataArr[indexPath.section];
- switch (model.youpaiptype) {
- case ZYUserZiLiaoCellType_DT:
- {
- YOUPAIZYUserZiLiaoDTCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoDTCell class]) forIndexPath:indexPath];
- cell.youpaipdelegate = self;
- cell.youpaipalbumArray = self.youpaipdynamicArray;
- cell.backgroundColor = LCWhiteColor;
- cell.youpaiptitleLabel.attributedText = [LCTools setRichTextWithTitle:@"最新动态" subTitle:[NSString stringWithFormat:@"(%ld)",self.youpaipshowModel.youpaipdynamic_num] titleColor:HexColorFromRGB(0x363D50) subTitleColor:HexColorFromRGB(0xA3AABE) titleFontSize:14 subTitleFontSize:10 IsfirstFontBlod:YES];
- return cell;
- }
- break;
-
- case ZYUserZiLiaoCellType_SY:
- {
- YOUPAIZYUserZiLiaoGRTopCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoGRTopCell class]) forIndexPath:indexPath];
- cell.backgroundColor = LCWhiteColor;
- cell.youpaiptitleLabel.text = @"个人信息";
- cell.youpaipmodel = self.youpaipshowModel;
- return cell;
- }
- break;
- case ZYUserZiLiaoCellType_MS://个人信息详情item
- {
- YOUPAIZYUserZiLiaoGRXXCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoGRXXCell class]) forIndexPath:indexPath];
- cell.backgroundColor = LCWhiteColor;
- cell.youpaipaArr = self.youpaipbasic_info;
- return cell;
- }
- break;
- case ZYUserZiLiaoCellType_PJ:
- {
- YOUPAIZYUserZiLiaoPJCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoPJCell class]) forIndexPath:indexPath];
-
- cell.youpaiplabelArray = self.youpaiplabel_list;
- cell.backgroundColor = LCWhiteColor;
-
- cell.youpaiptitleLabel.text = @"标签";
- cell.youpaipmodel = self.youpaipshowModel;
- cell.youpaipdelegate = self;
- return cell;
- }
- break;
- case ZYUserZiLiaoCellType_XZ:
- {
- YOUPAIZYUserZiLiaoXZCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoXZCell class]) forIndexPath:indexPath];
-
- cell.youpaipdataArr = self.youpaipbadge_all;
- cell.backgroundColor = LCWhiteColor;
- cell.youpaiptitleLabel.text = @"勋章墙";
- // cell.delegate = self;
- return cell;
- }
- break;
- case ZYUserZiLiaoCellType_BH:
- {
-
- if (self.youpaipasylumImageArray.count>0) {
- YOUPAIZYUserZiLiaoBHCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoBHCell class]) forIndexPath:indexPath];
- cell.youpaipdelegate = self;
- cell.youpaipdataArr = self.youpaipasylumImageArray;
- cell.backgroundColor = LCWhiteColor;
- return cell;
- }else{
- YOUPAIZYUserZiLiaoBHNoDataCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoBHNoDataCell class]) forIndexPath:indexPath];
- // cell.delegate = self;
- cell.youpaipuserId = self.youpaipshowModel.youpaipuserid;
- cell.youpaipdataArr = self.youpaipasylumImageArray;
- cell.backgroundColor = LCWhiteColor;
- __weak __typeof(self)wself = self;
- [cell setYoupaipdidClickBH:^{
- [wself youpaifsetSelectBiHu];
- }];
- return cell;
- }
-
- }
- break;
- case ZYUserZiLiaoCellType_SH:
- {
-
-
- if (self.youpaipguardImageArray.count>0) {
- YOUPAIZYUserZiLiaoSHCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoSHCell class]) forIndexPath:indexPath];
-
- cell.youpaipdelegate = self;
- cell.youpaipdataArr = self.youpaipguardImageArray;
- cell.backgroundColor = LCWhiteColor;
- return cell;
- }else{
- YOUPAIZYUserZiLiaoSHNoDataCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoSHNoDataCell class]) forIndexPath:indexPath];
- cell.youpaipuserId = self.youpaipshowModel.youpaipuserid;
- // cell.delegate = self;
- cell.youpaipdataArr = self.youpaipguardImageArray;
- cell.backgroundColor = LCWhiteColor;
- __weak __typeof(self)wself = self;
-
- return cell;
- }
-
-
- }
- break;
- case ZYUserZiLiaoCellType_LW:
- {
- YOUPAIZYUserZiLiaoLWCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoLWCell class]) forIndexPath:indexPath];
- cell.youpaipdelegate = self;
- cell.youpaipdataArr = self.youpaipgiftArray;
- cell.backgroundColor = LCWhiteColor;
- cell.youpaiptitleLabel.attributedText = [LCTools setRichTextWithTitle:@"收到礼物" subTitle:[NSString stringWithFormat:@"(%ld)",self.youpaipshowModel.youpaipgift_list.count] titleColor:HexColorFromRGB(0x363D50) subTitleColor:HexColorFromRGB(0xA3AABE) titleFontSize:14 subTitleFontSize:10 IsfirstFontBlod:YES];
- return cell;
- }
- break;
- default:
- break;
- }
-
-
- return nil;
- }
- -(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
- YOUPAIZYLabelModel *model = self.youpaipcellDataArr[indexPath.section];
- switch (model.youpaiptype) {
- case ZYUserZiLiaoCellType_DT:
- {
- YOUPAIZYUserDynamicVC *vc = [YOUPAIZYUserDynamicVC new];
- vc.youpaipuserId = self.youpaipuserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- break;
- case ZYUserZiLiaoCellType_PJ:
- {
-
- }
- break;
- case ZYUserZiLiaoCellType_BH:
- {
- YOUPAIZYAsylumListVC* VC = [[YOUPAIZYAsylumListVC alloc]init];
- VC.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- [self.navigationController pushViewController:VC animated:YES];
- }
- break;
- case ZYUserZiLiaoCellType_SH:
- {
- YOUPAILPGuardBordeVC* userDynamic = [[YOUPAILPGuardBordeVC alloc]init];
- userDynamic.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- [self.navigationController pushViewController:userDynamic animated:YES];
- }
- break;
- case ZYUserZiLiaoCellType_LW:
- {
-
- YOUPAILCReceiveGiftVC* receiveGift = [[YOUPAILCReceiveGiftVC alloc]init];
- receiveGift.youpaipuserId = self.youpaipshowModel.youpaipuserid;
- [self.navigationController pushViewController:receiveGift animated:YES];
- }
- break;
- default:
- break;
- }
-
-
- }
- #pragma mark-ZYDelegate
- //动态
- - (void)youpaifDTDidCellOrBtnclick{
- YOUPAIZYUserDynamicVC *vc = [YOUPAIZYUserDynamicVC new];
- vc.youpaipuserId = self.youpaipuserId;
- [self.navigationController pushViewController:vc animated:YES];
- }
- //庇护
- - (void)youpaifBHDidCellOrBtnclick:(BOOL)isBiHu{
- if (isBiHu) {
- [self youpaifsetSelectBiHu];
-
- }else{
- YOUPAIZYAsylumListVC* VC = [[YOUPAIZYAsylumListVC alloc]init];
- VC.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- [self.navigationController pushViewController:VC animated:YES];
- }
- }
- -(void)youpaifsetSelectBiHu{
- YOUPAIZYBiHuVC *VC= [[YOUPAIZYBiHuVC alloc]init];
- VC.youpaipdelegate = self;
- VC.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- VC.vWidth = KScreenWidth *(320.0/375.0);
- VC.vHeight = (VC.vWidth*165)/320.0+195;
- VC.isTouchDismiss = YES;
- [self TFPresentVC:VC completion:^{
- }];
- }
- -(void)youpaifsetSelectShouHu{
- YOUPAILPGuardHerVC *VC= [[YOUPAILPGuardHerVC alloc]init];
- VC.youpaipdelegate = self;
- VC.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- VC.vWidth = KScreenWidth-54;
- VC.vHeight = ((KScreenWidth-54)*165)/321.0+261.5;
- VC.youpaipinfoModel = self.youpaipguardInfo;
- VC.isTouchDismiss = YES;
- if(VC.youpaipinfoModel!=nil)
- [self TFPresentVC:VC completion:^{
-
- }];
- }
- //守护
- - (void)youpaifSHDidCellOrBtnclick:(BOOL)isShouHu{
- if (isShouHu) {
- [self youpaifsetSelectShouHu];
-
- }else{
- YOUPAILPGuardBordeVC* userDynamic = [[YOUPAILPGuardBordeVC alloc]init];
- userDynamic.youpaipuser_id = self.youpaipshowModel.youpaipuserid;
- [self.navigationController pushViewController:userDynamic animated:YES];
- }
- }
- -(void)youpaifaddBiHuSuccess{
-
-
- }
- //守护成功
- -(void)youpaifaddGuardSuccess
- {
- [LCHttpHelper requestWithURLString:UserShowPage parameters:@{@"user_id":self.youpaipuserId,@"no_visitor":@"1"} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
- NSDictionary* dict = (NSDictionary*)responseObject;
- NSInteger code = [[dict objectForKey:@"code"] integerValue];
- if (code==0) {//成功
- self.youpaipshowModel = [YOUPAILCUserShowModel mj_objectWithKeyValues:[dict objectForKey:@"data"]];
- self.youpaipguardInfo = self.youpaipshowModel.youpaipguard;
- //守护数组
- if(self.youpaipguardInfo!=nil)
- {
- [self.youpaipguardImageArray removeAllObjects];
- for(NSString *urlStr in self.youpaipguardInfo.youpaiplist)
- {
- [self.youpaipguardImageArray addObject:[NSString stringWithFormat:@"%@/%@",[LCSaveData getImageUrl]?[LCSaveData getImageUrl]:BaseImgUrl,urlStr]];
- }
- }
- // [self.headView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
- // [self setupInfoView];
- //守护成功以后 刷新介绍页面
-
- }
- } failure:^(NSError *error) {
-
- }];
- }
- ////礼物
- //- (void)youpaifLWDidCellOrBtnclick{
- //
- // YOUPAILCReceiveGiftVC* receiveGift = [[YOUPAILCReceiveGiftVC alloc]init];
- // receiveGift.youpaipuserId = self.youpaipshowModel.youpaipinfo.youpaipuserid;
- // [self.navigationController pushViewController:receiveGift animated:YES];
- //}
- -(void)youpaifclickLabel:(YOUPAIZYLabelModel *)labelModel{
- // YOUPAIZYSearchVC* seach = [[YOUPAIZYSearchVC alloc]init];
- // seach.isLabelSearch = YES;
- // seach.isSearch = YES;
- // seach.label_id = labelModel.tag_id;
- // seach.label_name = labelModel.name;
- // [self pushEffectPresentToVC:seach];
-
- }
- -(void)youpaifupdateShowCells{
-
- @synchronized (self) {
- [self.youpaipcellDataArr removeAllObjects];
- if (self.youpaipdynamicArray.count) {//动态
- ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- model.youpaiptype = ZYUserZiLiaoCellType_DT;
- model.youpaipcellHeight = 92+17+9;
- [self.youpaipcellDataArr addObject:model];
- }
- NSString *content = self.youpaipshowModel.youpaipsign;
- CGFloat height = [content boundingRectWithSize:CGSizeMake(KScreenWidth - 28.0f, MAXFLOAT)
- options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin
- attributes:@{ NSFontAttributeName : LCFont12 } context:nil].size.height;
- height+=26;
- CGFloat voiceHeight = 0;
- if (self.youpaipshowModel.youpaipvoice.youpaipvoice_status == 1){
- voiceHeight = 61;
- }
- //声音展示和个性签名
- ZYUserZiLiaoModel *symodel = [ZYUserZiLiaoModel new];
- symodel.youpaiptype = ZYUserZiLiaoCellType_SY;
- symodel.youpaipcellHeight = height+9+17+voiceHeight+10;
- [self.youpaipcellDataArr addObject:symodel];
-
-
- //个人信息item
- NSInteger rowCount = (self.youpaipbasic_info.count/3);
- if ((self.youpaipbasic_info.count%3)!=0) {
- rowCount+=1;
- }
- ZYUserZiLiaoModel *msmodel = [ZYUserZiLiaoModel new];
- msmodel.youpaiptype = ZYUserZiLiaoCellType_MS;
- msmodel.youpaipcellHeight = rowCount*49+rowCount*9+20;;
- [self.youpaipcellDataArr addObject:msmodel];
-
- if (self.youpaiplabel_list.count) {//评价
- ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- model.youpaiptype = ZYUserZiLiaoCellType_PJ;
- if (self.youpaipshowModel.youpaiplabel_list.count>5) {
- model.youpaipcellHeight= 49+9+20+30;
- }else{
- model.youpaipcellHeight= 24.5+20+30;
- }
-
- [self.youpaipcellDataArr addObject:model];
- }
-
- // if (self.asylumImageArray.count) {//庇护
- // ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- // model.youpaiptype = ZYUserZiLiaoCellType_BH;
- // model.youpaipcellHeight = 43+72;
- // [self.youpaipcellDataArr addObject:model];
- // }
- // if (self.guardImageArray.count) {//守护
- // ZYUserZiLiaoModel *guardModel = [ZYUserZiLiaoModel new];
- // guardModel.youpaiptype = ZYUserZiLiaoCellType_SH;
- // guardModel.youpaipcellHeight = 43+72;
- // [self.youpaipcellDataArr addObject:guardModel];
- // }
- if (self.youpaipgiftArray.count) {//礼物
- ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- model.youpaiptype = ZYUserZiLiaoCellType_LW;
- model.youpaipcellHeight = 95+9+17+30;
- [self.youpaipcellDataArr addObject:model];
- }
- // if (self.badge_all.count) {//勋章
- // if (self.showModel.is_user == 1) {
- // ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- // model.type = ZYUserZiLiaoCellType_XZ;
- // model.cellHeight = 43+52;
- //
- // [self.cellDataArr addObject:model];
- //
- // }else{
- // ZYUserZiLiaoModel *model = [ZYUserZiLiaoModel new];
- // model.type = ZYUserZiLiaoCellType_XZ;
- // model.cellHeight = 43+52;
- //
- // [self.cellDataArr addObject:model];
- // }
- //
- // }
- [self.youpaipcollectionView reloadData];
- }
-
-
-
- }
- //懒加载tableView
- - (UICollectionView *)youpaipcollectionView{
- if (_youpaipcollectionView == nil) {
- _youpaipcollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:[[UICollectionViewFlowLayout alloc]init]];
- _youpaipcollectionView.backgroundColor = LCWhiteColor;
- _youpaipcollectionView.delegate = self;
- _youpaipcollectionView.dataSource = self;
- [self.view addSubview:_youpaipcollectionView ];
- [_youpaipcollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.mas_equalTo(0);
- make.right.mas_equalTo(0);
- make.top.mas_equalTo(0);
- make.bottom.mas_equalTo(0);
- }];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoDTCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoDTCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoPJCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoPJCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoBHCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoBHCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoSHCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoSHCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoLWCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoLWCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoBHNoDataCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoBHNoDataCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoSHNoDataCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoSHNoDataCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoXZCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoXZCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoGRTopCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoGRTopCell class])];
- [_youpaipcollectionView registerClass:[YOUPAIZYUserZiLiaoGRXXCell class] forCellWithReuseIdentifier:NSStringFromClass([YOUPAIZYUserZiLiaoGRXXCell class])];
-
-
- }
- return _youpaipcollectionView;
- }
- - (void)youpaifinitData{
- NSLog(@"%@",self.youpaipuserId);
- [LCHttpHelper requestWithURLString:GetUserInfo parameters:@{@"user_id":self.youpaipuserId} needToken:YES type:(HttpRequestTypePost) success:^(id responseObject) {
- NSDictionary* dict = (NSDictionary*)responseObject;
- NSInteger code = [[dict objectForKey:@"code"] integerValue];
- if (code==0) {//成功
- self.youpaipshowModel = [YOUPAILCUserShowModel mj_objectWithKeyValues:[dict objectForKey:@"data"]];
-
- self.youpaipguardInfo = self.youpaipshowModel.youpaipguard;
- //守护数组
- if(self.youpaipguardInfo!=nil)
- for(NSString *urlStr in self.youpaipguardInfo.youpaiplist)
- {
- [self.youpaipguardImageArray addObject:[NSString stringWithFormat:@"%@/%@",[LCSaveData getImageUrl]?[LCSaveData getImageUrl]:BaseImgUrl,urlStr]];
- }
-
-
- for (YOUPAIBasicInfo *model in self.youpaipshowModel.youpaibasic_info) {
- [self.youpaipbasic_info addObject:model];
- }
- for (YOUPAIAlbumModel *model in self.youpaipshowModel.youpaipalbum) {
- [self.youpaipalbumArray addObject:model];
- }
-
- for (YOUPAILCDynamicArrayModel* model in self.youpaipshowModel.youpaipdynamic) {
- [self.youpaipdynamicArray addObject:model];
- }
- for (YOUPAILCGiftModel* giftModel in self.youpaipshowModel.youpaipgift_list) {
- [self.youpaipgiftArray addObject:giftModel];
- }
- for (YOUPAILZVipCarModel* badgeModel in self.youpaipshowModel.youpaipbadge_all) {
- [self.youpaipbadge_all addObject:badgeModel];
- }
- for (YOUPAIZYLabelModel* labelModel in self.youpaipshowModel.youpaiplabel_list) {
- [self.youpaiplabel_list addObject:labelModel];
- }
- for (YOUPAIZYAsylumModel* asylumModel in self.youpaipshowModel.youpaipasylum_list) {
- [self.youpaipasylumImageArray addObject:[NSString stringWithFormat:@"%@/%@",[LCSaveData getImageUrl]?[LCSaveData getImageUrl]:BaseImgUrl,asylumModel.youpaipavatar]];
- NSLog(@"%@",[NSString stringWithFormat:@"%@/%@",[LCSaveData getImageUrl]?[LCSaveData getImageUrl]:BaseImgUrl,asylumModel.youpaipavatar]);
- }
-
-
- [self youpaifupdateShowCells];
-
- }
- } failure:^(NSError *error) {
-
- }];
- }
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
- !self.scrollCallback ?: self.scrollCallback(scrollView);
- }
- #pragma mark - JXPagingViewListViewDelegate
- - (UIView *)listView{
- return self.view;
- }
- - (UIScrollView *)listScrollView{
- return self.youpaipcollectionView;
- }
- - (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
- self.scrollCallback = callback;
- }
- @end
|