This commit is contained in:
启星
2025-08-11 10:43:19 +08:00
commit fb2c58d96f
8839 changed files with 709982 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
//
// SPHomepageVC.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "BaseTableViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepageVC : BaseTableViewController
@property (nonatomic, copy) NSString *userId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,324 @@
//
// SPHomepageVC.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageVC.h"
#import "SPHomepageHeader.h"
#import "SPHomepageInfoView.h"
#import "SPHomepageGiftView.h"
#import "SPTrendListCell.h"
#import "SPTrendDetailVC.h"
#import "SPHomepagePhotoView.h"
#import "YYHomepageGiftVC.h"
@interface SPHomepageVC ()
@property (nonatomic, strong) SPHomepageHeader *headerView;
@property (nonatomic, strong) SPHomepageInfoView *infoView;
//@property (nonatomic, strong) SPHomepageGiftView *giftView;
@property (nonatomic, strong) SPHomepagePhotoView *photoView;
@property (nonatomic, strong) UIButton *blackBtn;
@property (nonatomic, strong) UIButton *focusBtn;
@property (nonatomic, strong) UIButton *msgBtn;
@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, strong) SPHomepageModel *model;
@end
@implementation SPHomepageVC
- (void)viewDidLoad {
[super viewDidLoad];
[self showNaviBarWithTitle:@""];
[self onChangeNaviWhiteStyle];
[self.naviView.backBtn setImage:ImageNamed(@"whiteBack") forState:UIControlStateNormal];
self.naviView.hidden = YES;
[self createUI];
[self fetchHomepageData];
[self fetchData];
}
- (void)fetchHomepageData {
NSDictionary *params = @{@"from_id":C_string(self.userId)};
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"api/player/player_home_page" Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
SPHomepageModel *model = [SPHomepageModel mj_objectWithKeyValues:responseDic[@"data"]];
self.model = model;
self.focusBtn.selected = model.is_follow == 2;
self.blackBtn.selected = model.is_black == 1;
self.headerView.model = model;
CGFloat headerH = 420;
if ([model.user_room_visitor.rid integerValue] > 0) {
headerH = 480;
}else{
headerH = 420;
}
self.headerView.frame = CGRectMake(0, 0, ScreenWidth, headerH);
self.tableView.tableHeaderView = self.headerView;
// self.giftView.model = model;
// CGFloat itemH = 125;
// NSInteger lines = model.receive_gift_list.count%3 == 0 ? model.receive_gift_list.count/3 : model.receive_gift_list.count/3+1;
// self.giftView.frame = CGRectMake(0, 0, ScreenWidth, itemH*lines+20);
[self onChangeIndex];
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)fetchData {
NSDictionary *params = @{@"from_id":C_string(self.userId), @"page":@(self.page), @"page_limit":@(10)};
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/user_zone/get_user_zone_list" Loading:YES Hud:NO Success:^(id _Nonnull responseDic) {
if (self.page == 1) {
[self.dataArray removeAllObjects];
[self.tableView reloadData];
}
[self endRefresh];
NSArray *arr = [SPTrendListModel mj_objectArrayWithKeyValuesArray:responseDic[@"data"]];
[self.dataArray addObjectsFromArray:arr];
[self.tableView reloadData];
if (arr.count > 0) {
[self endFooterRefreshWithMore];
}else {
[self endFooterRefreshWithNoMore];
}
//
// if (self.dataArray.count <= 0) {
// [self showNoContentView];
// } else {
// [self hideNoContentView];
// }
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)refreshFetchData {
self.page = 1;
[self fetchData];
}
- (void)fetchMoreData {
self.page ++;
[self fetchData];
}
-(void)createUI {
[self.tableView registerNib:[UINib nibWithNibName:@"SPTrendListCell" bundle:nil] forCellReuseIdentifier:@"SPTrendListCell"];
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.estimatedRowHeight = 152;
self.tableView.backgroundColor = kClearColor;
self.view.backgroundColor = kWhiteColor;
UIImageView *bgImgV = [[UIImageView alloc] initWithImage:ImageNamed(@"home_bg")];
[self.view addSubview:bgImgV];
[self.view sendSubviewToBack:bgImgV];
[bgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self.view);
make.height.mas_equalTo(ScreenWidth/375*812);
}];
BOOL isSelf = NO;
if ([self.userId integerValue] == [BJUserManager.userInfo.uid integerValue]) {
isSelf = YES;
}
CGFloat tabBottomCon = isSelf ? SAFE_AREA_INSERTS_BOTTOM : (79+SAFE_AREA_INSERTS_BOTTOM);
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.left.right.equalTo(self.view);
make.bottom.equalTo(self.view).offset(-tabBottomCon);
}];
UIButton *msgBtn = [ControlCreator createButton:nil rect:CGRectZero text:@"" font:YBBoldFont(14) color:HEXCOLOR(0x333333) backguoundColor:nil imageName:@"homepage_chat" target:self action:@selector(onMsg)];
// msgBtn.layer.masksToBounds = YES;
// msgBtn.layer.cornerRadius = 20;
// [msgBtn setJianBianWithCGSize:CGSizeMake(150, 49)];
[self.view addSubview:msgBtn];
self.msgBtn = msgBtn;
UIButton *focusBtn = [ControlCreator createButton:nil rect:CGRectZero text:@"" font:YBBoldFont(14) color:mainDeepColor backguoundColor:nil imageName:@"homepage_focus_nor" target:self action:@selector(onFocus)];
[focusBtn setImage:ImageNamed(@"homepage_focus_sel") forState:UIControlStateSelected];
// [focusBtn setTitle:@"已关注" forState:UIControlStateSelected];
// focusBtn.layer.masksToBounds = YES;
// focusBtn.layer.cornerRadius = 20;
// focusBtn.layer.borderWidth = 1;
// focusBtn.layer.borderColor = mainDeepColor.CGColor;
[self.view addSubview:focusBtn];
self.focusBtn = focusBtn;
[focusBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view).offset(15);
make.bottom.equalTo(self.view).offset(-SAFE_AREA_INSERTS_BOTTOM);
make.size.mas_equalTo(CGSizeMake(135, 44));
}];
[msgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.view).offset(-15);
make.centerY.equalTo(focusBtn);
make.size.mas_equalTo(CGSizeMake(195, 44));
}];
msgBtn.hidden = focusBtn.hidden = isSelf;
self.blackBtn = [ControlCreator createButton:self.view rect:CGRectMake(ScreenWidth-50-12, 60, 50, 30) text:@"加入黑名单" font:YBMediumFont(12) color:kWhiteColor backguoundColor:nil imageName:nil target:self action:@selector(onBlack)];
[self.blackBtn setTitle:@"移除黑名单" forState:UIControlStateSelected];
self.blackBtn.hidden = isSelf;
// WEAK_SELF
// [[RCCoreClient sharedCoreClient] getBlacklistStatus:C_string(self.userId) success:^(int bizStatus) {
// //bizStatus 0
// RCMicMainThread(^{
// if (isSelf) {
// weakSelf.blackBtn.hidden = YES;
// }else {
// weakSelf.blackBtn.hidden = bizStatus == 0;
// }
// });
// } error:^(RCErrorCode status) {
//
// }];
}
- (void)onBlack {
NSString *urlStr = self.model.is_black == 1 ? @"/api/user_tencent/remove_blacklist" : @"/api/user_tencent/add_blacklist";
NSDictionary *params = @{@"user_id":minStr(self.userId)};
[[AFNetworkRequset shared] postRequestWithParams:params Path:urlStr Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
if (self.model.is_black == 1) {
self.model.is_black = 2;
self.blackBtn.selected = NO;
}else {
self.model.is_black = 1;
self.blackBtn.selected = YES;
}
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)onMsg {
TXSingleChatVC *vc = [[TXSingleChatVC alloc] init];
vc.userId = self.userId;
vc.titleStr = self.model.nick_name;
[self.navigationController pushViewController:vc animated:YES];
}
- (void)onFocus {
NSDictionary *params = @{@"follow_uid":self.userId};
NSString *urlStr = self.model.is_follow == 2 ? @"api/user/unfollow_user" : @"api/user/follow_user";
[[AFNetworkRequset shared] postRequestWithParams:params Path:urlStr Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
self.model.is_follow = self.model.is_follow == 2 ? 1 : 2;
self.focusBtn.selected = self.model.is_follow == 2;
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)onChangeIndex {
if (self.currentIndex == 0) {
self.infoView.model = self.model;
self.tableView.tableFooterView = self.infoView;
}else if (self.currentIndex == 1) {
self.tableView.tableFooterView = nil;
}else if (self.currentIndex == 2) {
// self.giftView.model = self.model;
// self.tableView.tableFooterView = self.giftView;
YYHomepageGiftVC *giftvc = [[YYHomepageGiftVC alloc] init];
[self addChildViewController:giftvc];
// self.photoView.model = self.model;
// self.tableView.tableFooterView = self.photoView;
giftvc.model = self.model;
giftvc.view.frame = CGRectMake(0, 0, APPW, 600);
self.tableView.tableFooterView = giftvc.view;
}
[self.tableView reloadData];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.currentIndex == 1 ? self.dataArray.count : 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
SPTrendListCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SPTrendListCell" forIndexPath:indexPath];
cell.selectionStyle = NO;
SPTrendListModel *model = self.dataArray[indexPath.row];
cell.model = model;
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
SPTrendListModel *model = self.dataArray[indexPath.row];
SPTrendDetailVC *vc = [[SPTrendDetailVC alloc] init];
vc.zid = model.zid;
WEAK_SELF
vc.onDeleteBlock = ^(NSString * _Nonnull zid) {
[weakSelf.dataArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
SPTrendListModel *topicObj = obj;
if ([topicObj.zid isEqualToString:zid]) {
[weakSelf.dataArray removeObject:topicObj];
}
}];
[weakSelf.tableView reloadData];
};
[self.navigationController pushViewController:vc animated:YES];
}
- (SPHomepageHeader *)headerView {
if (!_headerView) {
_headerView = [[NSBundle mainBundle] loadNibNamed:@"SPHomepageHeader" owner:self options:nil].firstObject;
WEAK_SELF
_headerView.onSelectIndexBlock = ^(NSInteger index) {
weakSelf.currentIndex = index;
[weakSelf onChangeIndex];
};
}
return _headerView;
}
- (SPHomepageInfoView *)infoView {
if (!_infoView) {
_infoView = [[NSBundle mainBundle] loadNibNamed:@"SPHomepageInfoView" owner:self options:nil].firstObject;
_infoView.frame = CGRectMake(0, 0, ScreenWidth, 700);
}
return _infoView;
}
//- (SPHomepageGiftView *)giftView {
// if (!_giftView) {
// _giftView = [[SPHomepageGiftView alloc] initWithFrame:CGRectZero];
// }
// return _giftView;
//}
- (SPHomepagePhotoView *)photoView {
if (!_photoView) {
CGFloat itemH = (ScreenWidth-20*2-12*2)/2 + 12;
_photoView = [[SPHomepagePhotoView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, itemH*3)];
}
return _photoView;
}
@end

View File

@@ -0,0 +1,19 @@
//
// YYHomepageGiftVC.h
// SweetParty
//
// Created by bj_szd on 2023/12/21.
//
#import "BaseViewController.h"
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface YYHomepageGiftVC : BaseViewController
@property (nonatomic, strong) SPHomepageModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,187 @@
//
// YYHomepageGiftVC.m
// SweetParty
//
// Created by bj_szd on 2023/12/21.
//
#import "YYHomepageGiftVC.h"
#import "SPHomepageGiftCell.h"
@interface YYHomepageGiftVC () <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, JXCategoryViewDelegate>
@property (weak, nonatomic) IBOutlet UIImageView *avatarImgV;
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab;
@property (weak, nonatomic) IBOutlet UIView *titleBgView;
@property (weak, nonatomic) IBOutlet UIView *bottomBgView;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, assign) NSInteger page;
@property (nonatomic, assign) NSInteger currentIndex;
@end
@implementation YYHomepageGiftVC
- (void)viewDidLoad {
[super viewDidLoad];
// [self showNaviBarWithTitle:@"礼物墙"];
// self.naviView.backgroundColor = kClearColor;
self.titles = @[@"已点亮", @"未点亮"];
self.dataArray = [NSMutableArray arrayWithCapacity:0];
self.page = 1;
[self createUI];
[self fetchData];
}
- (void)fetchData {
NSString *urlStr = @"";
if (0 == self.currentIndex) {
urlStr = @"/api/user/get_user_illume_gift_wall";
}else {
urlStr = @"/api/user/get_user_unillume_gift_wall";
}
NSDictionary *params = @{@"user_id":C_string(self.model.uid), @"page":@(self.page), @"page_limit":@"1000"};
[AFNetworkRequset.shared postRequestWithParams:params Path:urlStr Loading:NO Hud:NO Success:^(id _Nonnull responseDic) {
if (self.page == 1) {
[self.dataArray removeAllObjects];
[self.collectionView reloadData];
}
[self endRefresh];
NSArray *arr = [SPHomepageGiftModel mj_objectArrayWithKeyValuesArray:responseDic[@"data"]];
[self.dataArray addObjectsFromArray:arr];
[self.collectionView reloadData];
} Failure:^(id _Nonnull errorData) {
[self endRefresh];
}];
}
- (void)createUI {
self.view.backgroundColor = kClearColor;
[self.titleBgView addSubview:self.categoryView];
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.centerY.mas_equalTo(0);
make.width.mas_equalTo(215);
make.height.mas_equalTo(32);
}];
[self.bottomBgView styleShadowWithRedius:10];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
CGFloat itemW = (ScreenWidth-30*2-15*2)/3;
layout.itemSize = CGSizeMake(itemW, 130);
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 10;
layout.sectionInset = UIEdgeInsetsMake(15, 15, 0, 15);
_collectionView.collectionViewLayout = layout;
_collectionView.delegate = self;
_collectionView.dataSource = self;
[_collectionView registerNib:[UINib nibWithNibName:@"SPHomepageGiftCell" bundle:nil] forCellWithReuseIdentifier:@"SPHomepageGiftCell"];
[self.avatarImgV sd_setImageWithURL:[NSURL URLWithString:self.model.head_pic] placeholderImage:kDefaultUserIcon];
self.nicknameLab.text = self.model.nick_name;
//
self.collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshFetchData)];
self.collectionView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(fetchMoreData)];
}
- (void)refreshFetchData {
self.page = 1;
[self fetchData];
}
- (void)fetchMoreData {
self.page ++;
[self fetchData];
}
- (void)endRefresh {
if ([self.collectionView.mj_header isRefreshing]) {
[self.collectionView.mj_header endRefreshing];
} else if ([self.collectionView.mj_footer isRefreshing]) {
[self.collectionView.mj_footer endRefreshing];
}
}
#pragma mark -------- collectionView ------
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SPHomepageGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SPHomepageGiftCell" forIndexPath:indexPath];
SPHomepageGiftModel *model = self.dataArray[indexPath.row];
cell.model = model;
if (0 == self.currentIndex) {
// cell.bgImgV.image = ImageNamed(@"homepage_gift_bg");
// cell.bgImgV.backgroundColor = HEXCOLOR(0xECD4FF);
cell.numBgView.hidden = cell.maxHeadImgV.hidden = NO;
cell.contentView.alpha = 1;
}else {
// cell.bgImgV.image = ImageNamed(@"homepage_gift_bg_gray");
// cell.bgImgV.backgroundColor = HEXCOLOR(0xFFFFFF);
cell.numBgView.hidden = cell.maxHeadImgV.hidden = YES;
cell.contentView.alpha = 1;
}
return cell;
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
self.currentIndex = index;
[self refreshFetchData];
}
//
- (JXCategoryTitleView *)categoryView {
if (!_categoryView) {
_categoryView = [[JXCategoryTitleView alloc] init];
_categoryView.delegate = self;
_categoryView.titleFont = YBBoldFont(14);
_categoryView.titleSelectedFont = YBBoldFont(14);
_categoryView.titleColor = HEXCOLOR(0x999999);
_categoryView.titleSelectedColor = HEXCOLOR(0x333333);
_categoryView.cellSpacing = 64;
_categoryView.averageCellSpacingEnabled = NO;
_categoryView.contentEdgeInsetLeft = 32;
_categoryView.contentEdgeInsetRight = 32;
_categoryView.backgroundColor = HEXCOLORA(0xFFFFFF, 0.5);
_categoryView.layer.cornerRadius = 16;
_categoryView.layer.masksToBounds = YES;
_categoryView.titles = self.titles;
JXCategoryIndicatorBackgroundView *backgroundView = [[JXCategoryIndicatorBackgroundView alloc] init];
backgroundView.indicatorWidth = 95;
backgroundView.indicatorHeight = 28;
backgroundView.indicatorCornerRadius = 14;
backgroundView.indicatorColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(120, 28) direction:FXGradientChangeDirectionHorizontal startColor:mainLightColor endColor:mainDeepColor];
_categoryView.indicators = @[backgroundView];
}
return _categoryView;
}
@end

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" 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="21679"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="YYHomepageGiftVC">
<connections>
<outlet property="avatarImgV" destination="ihd-tf-LRe" id="sNi-DD-dzJ"/>
<outlet property="bottomBgView" destination="NUe-fU-rYb" id="pgC-mQ-fbd"/>
<outlet property="collectionView" destination="wxZ-kY-69K" id="FCV-JT-3zq"/>
<outlet property="nicknameLab" destination="PmA-ht-GGI" id="88x-Vs-iTX"/>
<outlet property="titleBgView" destination="l3p-6x-fzW" id="hYo-In-jXq"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ihd-tf-LRe">
<rect key="frame" x="155.5" y="58" width="64" height="64"/>
<constraints>
<constraint firstAttribute="height" constant="64" id="f4a-MX-BcD"/>
<constraint firstAttribute="width" constant="64" id="kgc-wF-cpi"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="32"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="昵称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PmA-ht-GGI">
<rect key="frame" x="173" y="127" width="29" height="17"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="l3p-6x-fzW">
<rect key="frame" x="0.0" y="0.0" width="375" height="40"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="t0f-ds-VhS"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NUe-fU-rYb">
<rect key="frame" x="0.0" y="40" width="375" height="772"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="wxZ-kY-69K">
<rect key="frame" x="0.0" y="0.0" width="375" height="772"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="gB7-Qg-UUA">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
</collectionView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="wxZ-kY-69K" firstAttribute="leading" secondItem="NUe-fU-rYb" secondAttribute="leading" id="64x-N5-5Lv"/>
<constraint firstAttribute="bottom" secondItem="wxZ-kY-69K" secondAttribute="bottom" id="HJ5-2E-qOF"/>
<constraint firstItem="wxZ-kY-69K" firstAttribute="top" secondItem="NUe-fU-rYb" secondAttribute="top" id="Ofv-TP-OXG"/>
<constraint firstAttribute="trailing" secondItem="wxZ-kY-69K" secondAttribute="trailing" id="bw0-7C-egb"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="NUe-fU-rYb" secondAttribute="bottom" id="DdK-Fz-60g"/>
<constraint firstItem="ihd-tf-LRe" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" constant="58" id="OHz-Ny-cZO"/>
<constraint firstItem="l3p-6x-fzW" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="Oor-O9-Pbd"/>
<constraint firstItem="NUe-fU-rYb" firstAttribute="top" secondItem="l3p-6x-fzW" secondAttribute="bottom" id="UHY-Sx-8iR"/>
<constraint firstAttribute="trailing" secondItem="l3p-6x-fzW" secondAttribute="trailing" id="VHy-cj-4pD"/>
<constraint firstItem="NUe-fU-rYb" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="f8Z-H7-ghg"/>
<constraint firstAttribute="trailing" secondItem="NUe-fU-rYb" secondAttribute="trailing" id="iAX-sS-AKd"/>
<constraint firstItem="l3p-6x-fzW" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="jkC-A2-Ubr"/>
<constraint firstItem="ihd-tf-LRe" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="l9e-v8-Z7l"/>
<constraint firstItem="PmA-ht-GGI" firstAttribute="top" secondItem="ihd-tf-LRe" secondAttribute="bottom" constant="5" id="opO-hN-fzI"/>
<constraint firstItem="PmA-ht-GGI" firstAttribute="centerX" secondItem="ihd-tf-LRe" secondAttribute="centerX" id="plZ-Fo-Mo9"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<point key="canvasLocation" x="132" y="72"/>
</view>
</objects>
<resources>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>

View File

@@ -0,0 +1,98 @@
//
// SPHomepageModel.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class SPHomepageGiftModel;
@class SPHomepageAlbumModel;
@class SPHomepageInRoomModel;
@class SPHomepageLevelModel;
@class SPHomepageGuildinfoModel;
@interface SPHomepageModel : NSObject
@property(nonatomic, copy) NSString *head_pic;
@property(nonatomic, copy) NSString *nick_name;
@property(nonatomic, assign) NSInteger sex;
@property(nonatomic, copy) NSString *uid;
@property(nonatomic, copy) NSString *special_uid;
@property(nonatomic, copy) NSString *user_room_rid;
@property(nonatomic, copy) NSString *follow_num;
@property(nonatomic, copy) NSString *fans_num;
@property(nonatomic, copy) NSString *room_collect_num;
@property(nonatomic, copy) NSString *cp_num;
@property(nonatomic, copy) NSString *ip_address;
@property(nonatomic, copy) NSString *autograph;
@property(nonatomic, copy) NSString *constellation;
@property(nonatomic, strong) SPHomepageLevelModel *user_charm_contribution_info;
@property(nonatomic, strong) SPHomepageInRoomModel *user_room_visitor;
@property(nonatomic, strong) SPHomepageGuildinfoModel *guild_info;
@property(nonatomic, copy) NSString *birthday;
@property(nonatomic, strong) NSArray *user_albums_list;
@property(nonatomic, strong) NSArray *receive_gift_list;
@property(nonatomic, assign) NSInteger is_follow;//1未关注 2已关注
@property(nonatomic, assign) NSInteger is_black;
@property(nonatomic, copy) NSString *nobility_image;
@property(nonatomic, assign) NSInteger is_online;
@property(nonatomic, assign) NSInteger is_join_guild; //1 已加入公会 2未加入公会
@end
@interface SPHomepageGiftModel : NSObject
@property (nonatomic, copy) NSString *gid;
@property (nonatomic, copy) NSString *gift_name;
@property (nonatomic, copy) NSString *gift_price;
@property (nonatomic, copy) NSString *gift_total_sum;
@property (nonatomic, copy) NSString *gift_total_price;
@property (nonatomic, copy) NSString *base_image;
@property (nonatomic, copy) NSString *num;
@property (nonatomic, strong) NSDictionary *max_gift_num_user;
@end
@interface SPHomepageAlbumModel : NSObject
@property (nonatomic, copy) NSString *aid;
@property (nonatomic, copy) NSString *image;
@end
@interface SPHomepageInRoomModel : NSObject
@property (nonatomic, copy) NSString *rid;
@property (nonatomic, copy) NSString *room_name;
@property (nonatomic, copy) NSString *room_cover;
@end
@interface SPHomepageLevelModel : NSObject
@property (nonatomic, copy) NSString *contribution_level_image;
@property (nonatomic, copy) NSString *charm_level_image;
@end
@interface SPHomepageGuildinfoModel : NSObject
@property (nonatomic, copy) NSString *gid;
@property (nonatomic, copy) NSString *guild_special_id;
@property (nonatomic, copy) NSString *uid;
@property (nonatomic, copy) NSString *guild_name;
@property (nonatomic, copy) NSString *cover;
@property (nonatomic, copy) NSString *num;
@property (nonatomic, copy) NSString *ghz_head_pic;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,42 @@
//
// SPHomepageModel.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageModel.h"
@implementation SPHomepageModel
+ (NSDictionary *)mj_objectClassInArray {
return @{@"user_albums_list":@"SPHomepageAlbumModel", @"receive_gift_list":@"SPHomepageGiftModel", @"guild_info":[SPHomepageGuildinfoModel class]};
}
@end
@implementation SPHomepageAlbumModel
@end
@implementation SPHomepageGiftModel
@end
@implementation SPHomepageInRoomModel
@end
@implementation SPHomepageLevelModel
@end
@implementation SPHomepageGuildinfoModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName{
return @{
@"gid" : @"id",
};
}
@end

View File

@@ -0,0 +1,28 @@
//
// SPHomepageGiftCell.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <UIKit/UIKit.h>
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepageGiftCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *bgImgV;
@property (weak, nonatomic) IBOutlet UIView *numBgView;
@property (weak, nonatomic) IBOutlet UILabel *numLab;
@property (weak, nonatomic) IBOutlet UIImageView *maxHeadImgV;
@property (weak, nonatomic) IBOutlet UILabel *nameLab;
@property (weak, nonatomic) IBOutlet UILabel *priceLab;
@property (weak, nonatomic) IBOutlet UIImageView *imgV;
@property (weak, nonatomic) IBOutlet UIImageView *zhezhaoImgV;
@property (nonatomic, strong) SPHomepageGiftModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,39 @@
//
// SPHomepageGiftCell.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageGiftCell.h"
#import "SPMostGiftsView.h"
@implementation SPHomepageGiftCell
- (void)awakeFromNib {
[super awakeFromNib];
WEAK_SELF
[self.maxHeadImgV dg_Tapped:^{
SPMostGiftsView *view = LoadNib(@"SPMostGiftsView");
view.frame = [UIScreen mainScreen].bounds;
[KEYWINDOW addSubview:view];
view.dataDict = weakSelf.model.max_gift_num_user;
}];
}
- (void)setModel:(SPHomepageGiftModel *)model {
_model = model;
[self.imgV sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.nameLab.text = model.gift_name;
self.priceLab.text = model.gift_price;
self.numLab.text = [NSString stringWithFormat:@"x%@", model.num];
[self.maxHeadImgV sd_setImageWithURL:[NSURL URLWithString:[model.max_gift_num_user safeStringForKey:@"head_pic"]]];
[self.numBgView layoutIfNeeded];
// [self.numBgView styleGradiBlueColor];
}
@end

View File

@@ -0,0 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" 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="22504"/>
<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="SPHomepageGiftCell">
<rect key="frame" x="0.0" y="0.0" width="105" height="130"/>
<autoresizingMask key="autoresizingMask"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="105" height="130"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="y7e-gW-SnK">
<rect key="frame" x="0.0" y="0.0" width="105" height="130"/>
<color key="backgroundColor" red="0.75686274509803919" green="1" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ohd-Q2-DxS">
<rect key="frame" x="22.5" y="15" width="60" height="60"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="TYO-P0-blh"/>
<constraint firstAttribute="height" constant="60" id="VnI-rv-nBX"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="name" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BfD-zc-auh">
<rect key="frame" x="36" y="84" width="33" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HD6-cg-dsu">
<rect key="frame" x="58" y="0.0" width="47" height="24"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_num_bg" translatesAutoresizingMaskIntoConstraints="NO" id="dTD-fJ-4BN">
<rect key="frame" x="0.0" y="0.0" width="47" height="24"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="x1" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="C54-7g-rf7">
<rect key="frame" x="17" y="5" width="13.5" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="C54-7g-rf7" firstAttribute="centerY" secondItem="HD6-cg-dsu" secondAttribute="centerY" id="9nr-2b-GL5"/>
<constraint firstItem="C54-7g-rf7" firstAttribute="centerX" secondItem="HD6-cg-dsu" secondAttribute="centerX" id="IZS-UC-gKZ"/>
<constraint firstItem="C54-7g-rf7" firstAttribute="centerY" secondItem="HD6-cg-dsu" secondAttribute="centerY" id="O61-tk-nze"/>
<constraint firstItem="dTD-fJ-4BN" firstAttribute="top" secondItem="HD6-cg-dsu" secondAttribute="top" id="RDV-FK-hy2"/>
<constraint firstAttribute="bottom" secondItem="dTD-fJ-4BN" secondAttribute="bottom" id="VmI-n4-ZKI"/>
<constraint firstAttribute="width" constant="47" id="Vz2-X0-Jbh"/>
<constraint firstItem="dTD-fJ-4BN" firstAttribute="leading" secondItem="HD6-cg-dsu" secondAttribute="leading" id="oAc-lb-auI"/>
<constraint firstAttribute="height" constant="24" id="owd-9g-3Pd"/>
<constraint firstAttribute="trailing" secondItem="dTD-fJ-4BN" secondAttribute="trailing" id="xQh-nj-jXG"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView clipsSubviews="YES" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="H0i-Jp-N5s">
<rect key="frame" x="5" y="5" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="HsE-fD-OZV"/>
<constraint firstAttribute="height" constant="24" id="ZBn-NZ-z9W"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="12"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RNO-SW-yHZ">
<rect key="frame" x="46" y="104.5" width="31" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="room_gift_coin" translatesAutoresizingMaskIntoConstraints="NO" id="k6t-vS-fNY">
<rect key="frame" x="27" y="104" width="16" height="16"/>
<constraints>
<constraint firstAttribute="width" constant="16" id="7Z4-WT-ChF"/>
<constraint firstAttribute="height" constant="16" id="9fS-cq-ks8"/>
</constraints>
</imageView>
</subviews>
</view>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="ohd-Q2-DxS" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="15" id="0L9-Id-Uj1"/>
<constraint firstItem="H0i-Jp-N5s" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" constant="5" id="DEa-er-oXa"/>
<constraint firstItem="BfD-zc-auh" firstAttribute="top" secondItem="ohd-Q2-DxS" secondAttribute="bottom" constant="9" id="Eee-dD-RSM"/>
<constraint firstItem="k6t-vS-fNY" firstAttribute="centerY" secondItem="RNO-SW-yHZ" secondAttribute="centerY" id="GaF-Wy-HwB"/>
<constraint firstItem="y7e-gW-SnK" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="MDo-j8-h85"/>
<constraint firstItem="y7e-gW-SnK" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="NUd-jc-VDq"/>
<constraint firstItem="BfD-zc-auh" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="TcB-Xt-wif"/>
<constraint firstItem="HD6-cg-dsu" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="WyH-vV-6OT"/>
<constraint firstItem="RNO-SW-yHZ" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" constant="9" id="aJl-3l-BhY"/>
<constraint firstAttribute="trailing" secondItem="y7e-gW-SnK" secondAttribute="trailing" id="ecz-4B-ocA"/>
<constraint firstAttribute="trailing" secondItem="HD6-cg-dsu" secondAttribute="trailing" id="iNF-91-Rc1"/>
<constraint firstItem="H0i-Jp-N5s" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" constant="5" id="iXQ-xb-zNu"/>
<constraint firstItem="RNO-SW-yHZ" firstAttribute="top" secondItem="BfD-zc-auh" secondAttribute="bottom" constant="6" id="qFB-lV-ihn"/>
<constraint firstAttribute="bottom" secondItem="y7e-gW-SnK" secondAttribute="bottom" id="sAL-O2-jbu"/>
<constraint firstItem="RNO-SW-yHZ" firstAttribute="leading" secondItem="k6t-vS-fNY" secondAttribute="trailing" constant="3" id="tVq-XP-Vm5"/>
<constraint firstItem="ohd-Q2-DxS" firstAttribute="centerX" secondItem="gTV-IL-0wX" secondAttribute="centerX" id="uGh-4M-Fm1"/>
</constraints>
<size key="customSize" width="103" height="110"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<outlet property="bgImgV" destination="y7e-gW-SnK" id="FY4-Oh-tCq"/>
<outlet property="imgV" destination="ohd-Q2-DxS" id="UBt-Wu-JPh"/>
<outlet property="maxHeadImgV" destination="H0i-Jp-N5s" id="6xy-5o-hiH"/>
<outlet property="nameLab" destination="BfD-zc-auh" id="JKc-14-pCf"/>
<outlet property="numBgView" destination="HD6-cg-dsu" id="lIK-ZU-hxX"/>
<outlet property="numLab" destination="C54-7g-rf7" id="zZZ-aU-OCy"/>
<outlet property="priceLab" destination="RNO-SW-yHZ" id="q84-bY-78F"/>
</connections>
<point key="canvasLocation" x="170.28985507246378" y="127.90178571428571"/>
</collectionViewCell>
</objects>
<resources>
<image name="gift_num_bg" width="47" height="24"/>
<image name="room_gift_coin" width="16" height="16"/>
</resources>
</document>

View File

@@ -0,0 +1,19 @@
//
// SPHomepageGiftView.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <UIKit/UIKit.h>
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepageGiftView : UIView
@property (nonatomic, strong) SPHomepageModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,87 @@
//
// SPHomepageGiftView.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageGiftView.h"
#import "SPHomepageGiftCell.h"
@interface SPHomepageGiftView () <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property (strong, nonatomic) UICollectionView *collectionView;
@property (strong, nonatomic) NSArray *dataArray;
@end
@implementation SPHomepageGiftView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self createUI];
}
return self;
}
- (void)setModel:(SPHomepageModel *)model {
_model = model;
self.dataArray = model.receive_gift_list;
[self.collectionView reloadData];
NSInteger lines = model.receive_gift_list.count%3 == 0 ? model.receive_gift_list.count/3 : model.receive_gift_list.count/3+1;
[self.collectionView mas_updateConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(125*lines+20);
}];
}
- (void)createUI {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
CGFloat itemW = (ScreenWidth-14*2-10*2)/3;
layout.itemSize = CGSizeMake(itemW, 125);
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 10;
layout.sectionInset = UIEdgeInsetsMake(10, 0, 0, 0);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = kClearColor;
// _collectionView.layer.cornerRadius = 15;
_collectionView.delegate = self;
_collectionView.dataSource = self;
[_collectionView registerNib:[UINib nibWithNibName:@"SPHomepageGiftCell" bundle:nil] forCellWithReuseIdentifier:@"SPHomepageGiftCell"];
[self addSubview:_collectionView];
[_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self);
make.left.equalTo(self).offset(14);
make.right.equalTo(self).offset(-14);
make.height.mas_equalTo(0);
}];
}
#pragma mark -------- collectionView ------
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.dataArray.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SPHomepageGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SPHomepageGiftCell" forIndexPath:indexPath];
SPHomepageGiftModel *model = self.dataArray[indexPath.row];
[cell.imgV sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
cell.nameLab.text = model.gift_name;
// [cell.numBtn setTitle:[NSString stringWithFormat:@"x%@", model.gift_total_sum] forState:UIControlStateNormal];
return cell;
}
@end

View File

@@ -0,0 +1,47 @@
//
// SPHomepageHeader.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <UIKit/UIKit.h>
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepageHeader : UIView
@property (weak, nonatomic) IBOutlet UIImageView *bgImgV;
@property (weak, nonatomic) IBOutlet UIImageView *avatarImgV;
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab;
@property (weak, nonatomic) IBOutlet UIImageView *sexImgV;
@property (weak, nonatomic) IBOutlet UIImageView *gxImgV;
@property (weak, nonatomic) IBOutlet UIImageView *mlImgV;
@property (weak, nonatomic) IBOutlet UIImageView *jueweiImgV;
@property (weak, nonatomic) IBOutlet UILabel *signLab;
@property (weak, nonatomic) IBOutlet UIButton *TARoomBtn;
@property (weak, nonatomic) IBOutlet UIView *fansBgView;
@property (weak, nonatomic) IBOutlet UILabel *focusLab;
@property (weak, nonatomic) IBOutlet UILabel *fansLab;
@property (weak, nonatomic) IBOutlet UILabel *collectLab;
@property (weak, nonatomic) IBOutlet UILabel *CPLab;
@property (weak, nonatomic) IBOutlet UIView *inRoomView;
@property (weak, nonatomic) IBOutlet UIButton *inRoomBtn;
@property (weak, nonatomic) IBOutlet UILabel *inRoomLab;
@property (weak, nonatomic) IBOutlet UIView *titleBgView;
@property (weak, nonatomic) IBOutlet UILabel *IDLab;
@property (weak, nonatomic) IBOutlet UIImageView *roomCover;
@property (weak, nonatomic) IBOutlet UIImageView *onlineStatus;
@property (weak, nonatomic) IBOutlet UIImageView *gonghuiCover;
@property (weak, nonatomic) IBOutlet UILabel *gonghuiNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *gonghuiNumLabel;
@property(nonatomic, copy)void(^onSelectIndexBlock)(NSInteger index);
@property (nonatomic, strong) SPHomepageModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,150 @@
//
// SPHomepageHeader.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageHeader.h"
#import "LMGonghuiDetailsViewController.h"
@interface SPHomepageHeader () <JXCategoryViewDelegate>
@property (nonatomic, strong) NSArray *titles;
@property (nonatomic, strong) JXCategoryTitleView *categoryView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *roomCoverHeight;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *guideCoverHerght;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleCoverTopLayout;
@property (weak, nonatomic) IBOutlet UIView *guildCover;
@end
@implementation SPHomepageHeader
- (void)awakeFromNib {
[super awakeFromNib];
self.titles = @[@"资料", @"动态", @"礼物墙"];
[self createUI];
}
- (void)createUI {
// [self.inRoomBtn setJianBianWithCGSize:CGSizeMake(57, 27)];
[self.titleBgView addSubview:self.categoryView];
[self.categoryView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.titleBgView);
}];
}
- (void)setModel:(SPHomepageModel *)model {
_model = model;
if (model.user_albums_list.count > 0) {
SPHomepageAlbumModel *obj = model.user_albums_list[0];
[self.bgImgV sd_setImageWithURL:[NSURL URLWithString:obj.image] placeholderImage:kDefaultUserIcon];
}else {
[self.bgImgV sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
}
[self.avatarImgV sd_setImageWithURL:[NSURL URLWithString:model.head_pic] placeholderImage:kDefaultUserIcon];
self.nicknameLab.text = model.nick_name;
self.sexImgV.image = model.sex == 1 ? ImageNamed(@"sex_nan") : ImageNamed(@"sex_nv");
[self.gxImgV sd_setImageWithURL:[NSURL URLWithString:model.user_charm_contribution_info.contribution_level_image]];
[self.mlImgV sd_setImageWithURL:[NSURL URLWithString:model.user_charm_contribution_info.charm_level_image]];
[self.jueweiImgV sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
self.TARoomBtn.hidden = [model.user_room_rid integerValue] <= 0;
if ([model.special_uid integerValue] > 0) {
self.IDLab.text = [NSString stringWithFormat:@"%@", model.special_uid];
}else {
self.IDLab.text = [NSString stringWithFormat:@"%@", model.uid];
}
self.signLab.text = model.autograph;
self.focusLab.text = model.follow_num;
self.fansLab.text = model.fans_num;
self.collectLab.text = model.room_collect_num;
self.CPLab.text = model.cp_num;
if ([model.user_room_visitor.rid integerValue] > 0) {
self.inRoomView.hidden = NO;
self.titleCoverTopLayout.constant = 110;
self.inRoomLab.text = [NSString stringWithFormat:@"当前正在:%@", model.user_room_visitor.room_name];
[self.roomCover sd_setImageWithURL:[NSURL URLWithString:model.user_room_visitor.room_cover] placeholderImage:kDefaultUserIcon];
self.roomCoverHeight.constant = 44;
}else {
self.inRoomView.hidden = YES;
self.roomCoverHeight.constant = 0;
self.titleCoverTopLayout.constant = 50;
}
if (model.is_online == 1){
self.onlineStatus.image = ImageNamed(@"msg_online");
}else{
self.onlineStatus.image = ImageNamed(@"msg_offline");
}
}
- (IBAction)onBack:(id)sender {
[[UIViewController currentViewController].navigationController popViewControllerAnimated:YES];
}
- (IBAction)onTARoom:(id)sender {
[UIViewController goMicRoomWithRid:C_string(self.model.user_room_rid) withPwd:nil];
}
- (IBAction)onInRoom:(id)sender {
[UIViewController goMicRoomWithRid:C_string(self.model.user_room_visitor.rid) withPwd:nil];
}
- (IBAction)onDuplicateID:(id)sender {
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
if ([self.model.special_uid integerValue] > 0) {
pasteboard.string = self.model.special_uid;
}else {
pasteboard.string = self.model.uid;
}
[HelpPageDefine showMessage:@"ID已复制"];
}
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
if (self.onSelectIndexBlock) {
self.onSelectIndexBlock(index);
}
}
- (JXCategoryTitleView *)categoryView {
if (!_categoryView) {
_categoryView = [[JXCategoryTitleView alloc] init];
_categoryView.delegate = self;
_categoryView.titleFont = YBMediumFont(18);
_categoryView.titleSelectedFont = YBBoldFont(20);
_categoryView.titleColor = HEXCOLOR(0x999999);
_categoryView.titleSelectedColor = HEXCOLOR(0x333333);
_categoryView.contentEdgeInsetLeft = 15;
_categoryView.cellSpacing = 30;
_categoryView.averageCellSpacingEnabled = NO;
_categoryView.titles = self.titles;
// JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
// lineView.indicatorImageViewSize = CGSizeMake(16, 16);
// lineView.indicatorImageView.image = ImageNamed(@"common_zhishi");
// lineView.verticalMargin = 28;
// lineView.horizontalMargin = 20;
// _categoryView.indicators = @[lineView];
// JXCategoryIndicatorLineView *lineView = [[JXCategoryIndicatorLineView alloc] init];
// lineView.indicatorWidth = 20;
// lineView.indicatorHeight = 3;
// lineView.indicatorCornerRadius = 1.5;
// lineView.indicatorColor = mainDeepColor;
// lineView.verticalMargin = 0;
// lineView.lineStyle = JXCategoryIndicatorLineStyle_Lengthen;
// _categoryView.indicators = @[lineView];
}
return _categoryView;
}
@end

View File

@@ -0,0 +1,514 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" 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="21679"/>
<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"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="SPHomepageHeader">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="Yot-z1-ALZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="360"/>
<constraints>
<constraint firstAttribute="height" constant="360" id="ODb-xO-qhx"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="pfT-Jl-5ie">
<rect key="frame" x="0.0" y="0.0" width="375" height="360"/>
<color key="backgroundColor" white="0.0" alpha="0.050000000000000003" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="u0O-MC-ZcP">
<rect key="frame" x="0.0" y="269" width="375" height="543"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_bg" translatesAutoresizingMaskIntoConstraints="NO" id="Zod-ze-dWF">
<rect key="frame" x="0.0" y="-269" width="375" height="812"/>
<constraints>
<constraint firstAttribute="width" secondItem="Zod-ze-dWF" secondAttribute="height" multiplier="375:812" id="Us9-Sd-sLi"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="昵称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="YDn-Bo-Pa8">
<rect key="frame" x="110" y="10" width="31" height="18"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<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" translatesAutoresizingMaskIntoConstraints="NO" id="ibV-kC-0DS">
<rect key="frame" x="149" y="9" width="40" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="F5w-nt-Pyr"/>
<constraint firstAttribute="height" constant="20" id="fSd-yC-MiX"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aKm-aC-pvc">
<rect key="frame" x="194" y="9" width="40" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="2HI-4B-HCb"/>
<constraint firstAttribute="width" constant="40" id="otQ-ED-DJW"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="95r-JZ-e0i">
<rect key="frame" x="239" y="4" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="WlW-V7-8vm"/>
<constraint firstAttribute="width" constant="30" id="iHr-ud-yMB"/>
</constraints>
</imageView>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jjV-ur-g65" userLabel="IDView">
<rect key="frame" x="110" y="33" width="99.5" height="20"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="party_ID" translatesAutoresizingMaskIntoConstraints="NO" id="ZTv-4n-HpH">
<rect key="frame" x="0.0" y="0.0" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="Azr-wR-5Sx"/>
<constraint firstAttribute="width" constant="20" id="uee-zD-sGr"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="123456" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B4I-wy-R5K">
<rect key="frame" x="23" y="3" width="46.5" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="RWL-qO-cXB">
<rect key="frame" x="74.5" y="0.0" width="20" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="AIz-wI-WeO"/>
<constraint firstAttribute="width" constant="20" id="Ypw-9u-bdu"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="mine_fuzhi">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="onDuplicateID:" destination="iN0-l3-epB" eventType="touchUpInside" id="ezX-Ny-JBb"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.29999999999999999" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="RWL-qO-cXB" firstAttribute="leading" secondItem="B4I-wy-R5K" secondAttribute="trailing" constant="5" id="027-2O-8Rl"/>
<constraint firstItem="ZTv-4n-HpH" firstAttribute="leading" secondItem="jjV-ur-g65" secondAttribute="leading" id="1R4-Ha-jn2"/>
<constraint firstItem="B4I-wy-R5K" firstAttribute="leading" secondItem="jjV-ur-g65" secondAttribute="leading" constant="23" id="BCc-iM-o5J"/>
<constraint firstItem="ZTv-4n-HpH" firstAttribute="centerY" secondItem="jjV-ur-g65" secondAttribute="centerY" id="I2H-Bf-jDc"/>
<constraint firstItem="RWL-qO-cXB" firstAttribute="centerY" secondItem="jjV-ur-g65" secondAttribute="centerY" id="Siy-Bl-UHl"/>
<constraint firstAttribute="height" constant="20" id="e3t-Bv-AV8"/>
<constraint firstItem="B4I-wy-R5K" firstAttribute="centerY" secondItem="jjV-ur-g65" secondAttribute="centerY" id="hFk-Kx-qHR"/>
<constraint firstAttribute="trailing" secondItem="RWL-qO-cXB" secondAttribute="trailing" constant="5" id="lOw-2H-jpF"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="10"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vj3-8N-jPs">
<rect key="frame" x="15" y="109" width="345" height="44"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_room_bg" translatesAutoresizingMaskIntoConstraints="NO" id="Tb2-DP-DoX">
<rect key="frame" x="0.0" y="0.0" width="345" height="44"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="ibb-mU-B89">
<rect key="frame" x="10" y="6" width="32" height="32"/>
<constraints>
<constraint firstAttribute="height" constant="32" id="PvV-lR-1In"/>
<constraint firstAttribute="width" constant="32" id="nAJ-U2-oxZ"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="当前正在:" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rUm-0c-JJG">
<rect key="frame" x="47" y="15" width="222" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="m0v-yX-S72">
<rect key="frame" x="279" y="8" width="56" height="28"/>
<constraints>
<constraint firstAttribute="width" constant="56" id="e87-kV-vAY"/>
<constraint firstAttribute="height" constant="28" id="hur-kF-HHG"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="homepage_room_cai">
<color key="titleColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</state>
<connections>
<action selector="onInRoom:" destination="iN0-l3-epB" eventType="touchUpInside" id="TKP-JI-jb4"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Tb2-DP-DoX" secondAttribute="bottom" id="2GE-Jf-fa8"/>
<constraint firstItem="rUm-0c-JJG" firstAttribute="leading" secondItem="ibb-mU-B89" secondAttribute="trailing" constant="5" id="8RN-8p-iCd"/>
<constraint firstItem="ibb-mU-B89" firstAttribute="leading" secondItem="Vj3-8N-jPs" secondAttribute="leading" constant="10" id="AEO-Qc-z4C"/>
<constraint firstAttribute="trailing" secondItem="m0v-yX-S72" secondAttribute="trailing" constant="10" id="M9E-Ig-S79"/>
<constraint firstItem="Tb2-DP-DoX" firstAttribute="leading" secondItem="Vj3-8N-jPs" secondAttribute="leading" id="OTJ-tn-MVl"/>
<constraint firstItem="m0v-yX-S72" firstAttribute="centerY" secondItem="Vj3-8N-jPs" secondAttribute="centerY" id="Vi8-4S-9Fw"/>
<constraint firstItem="Tb2-DP-DoX" firstAttribute="top" secondItem="Vj3-8N-jPs" secondAttribute="top" id="chj-bg-nay"/>
<constraint firstAttribute="trailing" secondItem="Tb2-DP-DoX" secondAttribute="trailing" id="fpw-XU-4h5"/>
<constraint firstAttribute="height" constant="44" id="hGR-uy-cg8"/>
<constraint firstItem="ibb-mU-B89" firstAttribute="centerY" secondItem="Vj3-8N-jPs" secondAttribute="centerY" id="uBf-lG-tHG"/>
<constraint firstItem="rUm-0c-JJG" firstAttribute="centerY" secondItem="Vj3-8N-jPs" secondAttribute="centerY" id="ve7-qj-rnE"/>
<constraint firstItem="m0v-yX-S72" firstAttribute="leading" secondItem="rUm-0c-JJG" secondAttribute="trailing" constant="10" id="wOD-bB-dKb"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ghX-mH-Hw2">
<rect key="frame" x="0.0" y="60" width="375" height="40"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ktI-r9-H27">
<rect key="frame" x="22" y="0.0" width="50" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="关注" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="zsn-0I-XZD">
<rect key="frame" x="11.5" y="24" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.066666666666666666" green="0.066666666666666666" blue="0.066666666666666666" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uDQ-r3-xVA">
<rect key="frame" x="20.5" y="0.0" width="9" height="21"/>
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="zsn-0I-XZD" firstAttribute="centerX" secondItem="ktI-r9-H27" secondAttribute="centerX" id="Dyi-jl-xy6"/>
<constraint firstAttribute="width" constant="50" id="ILn-LX-hoQ"/>
<constraint firstItem="uDQ-r3-xVA" firstAttribute="top" secondItem="ktI-r9-H27" secondAttribute="top" id="Opl-Xw-Rp2"/>
<constraint firstAttribute="height" constant="40" id="WUg-wE-Epi"/>
<constraint firstItem="uDQ-r3-xVA" firstAttribute="centerX" secondItem="ktI-r9-H27" secondAttribute="centerX" id="dnb-Dg-yGQ"/>
<constraint firstAttribute="bottom" secondItem="zsn-0I-XZD" secondAttribute="bottom" id="hCA-96-d0u"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2kJ-GO-5Lv">
<rect key="frame" x="115.5" y="0.0" width="50" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="粉丝" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZBf-PK-pOv">
<rect key="frame" x="11.5" y="24" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="H1Y-Tv-yj9">
<rect key="frame" x="20.5" y="0.0" width="9" height="21"/>
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="ZBf-PK-pOv" secondAttribute="bottom" id="IuE-Kw-YGL"/>
<constraint firstItem="H1Y-Tv-yj9" firstAttribute="centerX" secondItem="2kJ-GO-5Lv" secondAttribute="centerX" id="JAz-jd-mEG"/>
<constraint firstAttribute="height" constant="40" id="cjC-S6-2mi"/>
<constraint firstItem="ZBf-PK-pOv" firstAttribute="centerX" secondItem="2kJ-GO-5Lv" secondAttribute="centerX" id="g4A-wW-9Q2"/>
<constraint firstItem="H1Y-Tv-yj9" firstAttribute="top" secondItem="2kJ-GO-5Lv" secondAttribute="top" id="kXq-nB-OnW"/>
<constraint firstAttribute="width" constant="50" id="qtA-zm-oY1"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Hc-5K-nu7">
<rect key="frame" x="209.5" y="0.0" width="50" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="收藏" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yXp-Yt-qu1">
<rect key="frame" x="11.5" y="24" width="27" height="16"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hYw-st-NZb">
<rect key="frame" x="20.5" y="0.0" width="9" height="21"/>
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="yXp-Yt-qu1" secondAttribute="bottom" id="CWs-89-1lO"/>
<constraint firstAttribute="height" constant="40" id="Hu8-wo-U8F"/>
<constraint firstItem="yXp-Yt-qu1" firstAttribute="centerX" secondItem="1Hc-5K-nu7" secondAttribute="centerX" id="PZf-ni-yhH"/>
<constraint firstAttribute="width" constant="50" id="SBL-la-vkh"/>
<constraint firstItem="hYw-st-NZb" firstAttribute="top" secondItem="1Hc-5K-nu7" secondAttribute="top" id="r2F-vz-vFk"/>
<constraint firstItem="hYw-st-NZb" firstAttribute="centerX" secondItem="1Hc-5K-nu7" secondAttribute="centerX" id="sm2-ot-NMj"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="87z-dh-mbu">
<rect key="frame" x="303" y="0.0" width="50" height="40"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="CP" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6Ky-FN-sKD">
<rect key="frame" x="16" y="24" width="18" height="16"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<color key="textColor" red="0.066666666669999999" green="0.066666666669999999" blue="0.066666666669999999" alpha="0.59999999999999998" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="i18-aA-Gy4">
<rect key="frame" x="20.5" y="0.0" width="9" height="21"/>
<fontDescription key="fontDescription" name="DINAlternate-Bold" family="DIN Alternate" pointSize="18"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="width" constant="50" id="5O1-Va-tNg"/>
<constraint firstAttribute="bottom" secondItem="6Ky-FN-sKD" secondAttribute="bottom" id="KEX-Fn-PbS"/>
<constraint firstItem="i18-aA-Gy4" firstAttribute="centerX" secondItem="87z-dh-mbu" secondAttribute="centerX" id="LTK-zD-Bh6"/>
<constraint firstItem="6Ky-FN-sKD" firstAttribute="centerX" secondItem="87z-dh-mbu" secondAttribute="centerX" id="NxL-ex-203"/>
<constraint firstAttribute="height" constant="40" id="UgB-C0-pxt"/>
<constraint firstItem="i18-aA-Gy4" firstAttribute="top" secondItem="87z-dh-mbu" secondAttribute="top" id="vnv-Ib-44x"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="7qQ-VL-Noh"/>
<constraint firstItem="ktI-r9-H27" firstAttribute="centerX" secondItem="ghX-mH-Hw2" secondAttribute="centerX" multiplier="0.25" id="8cv-FZ-dNp"/>
<constraint firstItem="ktI-r9-H27" firstAttribute="centerY" secondItem="ghX-mH-Hw2" secondAttribute="centerY" id="UKF-C9-MhE"/>
<constraint firstItem="1Hc-5K-nu7" firstAttribute="centerX" secondItem="ghX-mH-Hw2" secondAttribute="centerX" multiplier="1.25" id="hFg-9H-Ual"/>
<constraint firstItem="2kJ-GO-5Lv" firstAttribute="centerY" secondItem="ghX-mH-Hw2" secondAttribute="centerY" id="hpe-Qu-JkH"/>
<constraint firstItem="87z-dh-mbu" firstAttribute="centerX" secondItem="ghX-mH-Hw2" secondAttribute="centerX" multiplier="1.75" id="ksf-Z8-vJb"/>
<constraint firstItem="2kJ-GO-5Lv" firstAttribute="centerX" secondItem="ghX-mH-Hw2" secondAttribute="centerX" multiplier="0.75" id="niT-EL-EjY"/>
<constraint firstItem="87z-dh-mbu" firstAttribute="centerY" secondItem="ghX-mH-Hw2" secondAttribute="centerY" id="vyL-NC-zWv"/>
<constraint firstItem="1Hc-5K-nu7" firstAttribute="centerY" secondItem="ghX-mH-Hw2" secondAttribute="centerY" id="ws6-Uu-BGX"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UI4-v2-Sm1">
<rect key="frame" x="0.0" y="163" width="375" height="54"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="54" id="Xgn-fW-auC"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="15"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ngo-Bv-Qin">
<rect key="frame" x="15" y="217" width="345" height="1"/>
<color key="backgroundColor" white="0.0" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="292-Ji-FQQ"/>
</constraints>
</view>
<view hidden="YES" clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="DV9-f4-LAs">
<rect key="frame" x="15" y="75" width="345" height="88"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="Igj-xL-U8L">
<rect key="frame" x="10" y="10" width="68" height="68"/>
<constraints>
<constraint firstAttribute="width" constant="68" id="e4O-US-paw"/>
<constraint firstAttribute="height" constant="68" id="tWi-cr-dno"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="34"/>
</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="peb-JV-lUV">
<rect key="frame" x="88" y="20" width="65.5" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.23921568627450979" green="0.23921568627450979" blue="0.23921568627450979" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0人" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AjT-nK-LPM">
<rect key="frame" x="88" y="53.5" width="20.5" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jiantou_hui" translatesAutoresizingMaskIntoConstraints="NO" id="ssJ-69-KtY">
<rect key="frame" x="324.5" y="39" width="5.5" height="10"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.5725490196078431" green="0.28627450980392155" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="ssJ-69-KtY" firstAttribute="centerY" secondItem="DV9-f4-LAs" secondAttribute="centerY" id="3If-6I-HBj"/>
<constraint firstAttribute="trailing" secondItem="ssJ-69-KtY" secondAttribute="trailing" constant="15" id="5IZ-gE-G9E"/>
<constraint firstAttribute="height" constant="88" id="6gn-FE-caB"/>
<constraint firstItem="peb-JV-lUV" firstAttribute="top" secondItem="DV9-f4-LAs" secondAttribute="top" constant="20" id="MZQ-la-qPr"/>
<constraint firstItem="Igj-xL-U8L" firstAttribute="leading" secondItem="DV9-f4-LAs" secondAttribute="leading" constant="10" id="OQQ-WT-Hr6"/>
<constraint firstItem="Igj-xL-U8L" firstAttribute="centerY" secondItem="DV9-f4-LAs" secondAttribute="centerY" id="Ojc-n3-BPJ"/>
<constraint firstItem="peb-JV-lUV" firstAttribute="leading" secondItem="Igj-xL-U8L" secondAttribute="trailing" constant="10" id="Vpa-ot-f3S"/>
<constraint firstItem="AjT-nK-LPM" firstAttribute="top" secondItem="peb-JV-lUV" secondAttribute="bottom" constant="14" id="hOh-BB-lBU"/>
<constraint firstItem="AjT-nK-LPM" firstAttribute="leading" secondItem="peb-JV-lUV" secondAttribute="leading" id="vTB-gb-jVu"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="ibV-kC-0DS" firstAttribute="leading" secondItem="YDn-Bo-Pa8" secondAttribute="trailing" constant="8" id="4wc-Cr-ecO"/>
<constraint firstItem="YDn-Bo-Pa8" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" constant="110" id="5jX-m3-aZC"/>
<constraint firstItem="ibV-kC-0DS" firstAttribute="centerY" secondItem="YDn-Bo-Pa8" secondAttribute="centerY" id="6Ht-KA-faB"/>
<constraint firstItem="jjV-ur-g65" firstAttribute="top" secondItem="YDn-Bo-Pa8" secondAttribute="bottom" constant="5" id="7rz-lg-e7I"/>
<constraint firstItem="ngo-Bv-Qin" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" constant="15" id="8Qt-Xb-WBA"/>
<constraint firstItem="ghX-mH-Hw2" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" id="D3y-w2-c36"/>
<constraint firstItem="YDn-Bo-Pa8" firstAttribute="top" secondItem="u0O-MC-ZcP" secondAttribute="top" constant="10" id="GMq-5c-X8w"/>
<constraint firstItem="95r-JZ-e0i" firstAttribute="leading" secondItem="aKm-aC-pvc" secondAttribute="trailing" constant="5" id="GSH-xN-GbY"/>
<constraint firstItem="Zod-ze-dWF" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" id="HpL-LN-yPx"/>
<constraint firstItem="ghX-mH-Hw2" firstAttribute="top" secondItem="u0O-MC-ZcP" secondAttribute="top" constant="60" id="JDw-M4-uE4"/>
<constraint firstAttribute="trailing" secondItem="Zod-ze-dWF" secondAttribute="trailing" id="JOL-l6-Ie1"/>
<constraint firstItem="ngo-Bv-Qin" firstAttribute="top" secondItem="UI4-v2-Sm1" secondAttribute="bottom" id="Jcg-BZ-ZPM"/>
<constraint firstItem="UI4-v2-Sm1" firstAttribute="top" secondItem="jjV-ur-g65" secondAttribute="bottom" constant="110" id="L0V-SN-6jj"/>
<constraint firstItem="aKm-aC-pvc" firstAttribute="centerY" secondItem="ibV-kC-0DS" secondAttribute="centerY" id="P8r-pE-R9a"/>
<constraint firstItem="UI4-v2-Sm1" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" id="Qch-ZA-3MI"/>
<constraint firstItem="Zod-ze-dWF" firstAttribute="top" secondItem="u0O-MC-ZcP" secondAttribute="top" constant="-269" id="RGn-SK-zJj"/>
<constraint firstItem="95r-JZ-e0i" firstAttribute="centerY" secondItem="aKm-aC-pvc" secondAttribute="centerY" id="T0a-Ro-tHg"/>
<constraint firstAttribute="trailing" secondItem="ngo-Bv-Qin" secondAttribute="trailing" constant="15" id="Tdm-Gd-dAV"/>
<constraint firstAttribute="trailing" secondItem="DV9-f4-LAs" secondAttribute="trailing" constant="15" id="VYc-wy-qyR"/>
<constraint firstItem="aKm-aC-pvc" firstAttribute="leading" secondItem="ibV-kC-0DS" secondAttribute="trailing" constant="5" id="WRn-UR-Pm0"/>
<constraint firstAttribute="trailing" secondItem="ghX-mH-Hw2" secondAttribute="trailing" id="bcn-sy-x1E"/>
<constraint firstItem="DV9-f4-LAs" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" constant="15" id="fnx-FP-UPS"/>
<constraint firstItem="jjV-ur-g65" firstAttribute="leading" secondItem="YDn-Bo-Pa8" secondAttribute="leading" id="gtq-O9-N6a"/>
<constraint firstItem="UI4-v2-Sm1" firstAttribute="top" secondItem="Vj3-8N-jPs" secondAttribute="bottom" constant="10" id="kAK-2d-XY6"/>
<constraint firstAttribute="trailing" secondItem="Vj3-8N-jPs" secondAttribute="trailing" constant="15" id="kIa-Cu-kxk"/>
<constraint firstItem="UI4-v2-Sm1" firstAttribute="top" secondItem="DV9-f4-LAs" secondAttribute="bottom" id="nXR-Yo-tlq"/>
<constraint firstAttribute="trailing" secondItem="UI4-v2-Sm1" secondAttribute="trailing" id="nzb-Ue-Br1"/>
<constraint firstItem="Vj3-8N-jPs" firstAttribute="leading" secondItem="u0O-MC-ZcP" secondAttribute="leading" constant="15" id="vM8-YG-jIx"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="4H9-Mj-dI1">
<rect key="frame" x="15" y="243" width="80" height="80"/>
<constraints>
<constraint firstAttribute="height" constant="80" id="CHq-km-FUS"/>
<constraint firstAttribute="width" constant="80" id="ixU-3O-Rzc"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="40"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="2"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="msg_online" translatesAutoresizingMaskIntoConstraints="NO" id="2JZ-MN-Ccm">
<rect key="frame" x="31" y="307" width="48" height="16"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="I1a-fT-WrA">
<rect key="frame" x="207" y="60" width="88" height="32"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="homepage_TA_room"/>
<connections>
<action selector="onTARoom:" destination="iN0-l3-epB" eventType="touchUpInside" id="p9n-0S-XB2"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8Yv-Fg-aMM">
<rect key="frame" x="67" y="81" width="70" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="13"/>
<inset key="titleEdgeInsets" minX="8" minY="0.0" maxX="0.0" maxY="0.0"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="8" maxY="0.0"/>
<state key="normal" title="派对"/>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jT3-Fb-fQt">
<rect key="frame" x="0.0" y="51" width="50" height="50"/>
<constraints>
<constraint firstAttribute="height" constant="50" id="BKU-PD-kXm"/>
<constraint firstAttribute="width" constant="50" id="nQG-pL-jwo"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="whiteBack"/>
<connections>
<action selector="onBack:" destination="iN0-l3-epB" eventType="touchUpInside" id="ufj-Tw-hwY"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="4H9-Mj-dI1" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="5cF-5P-vBb"/>
<constraint firstItem="2JZ-MN-Ccm" firstAttribute="centerX" secondItem="4H9-Mj-dI1" secondAttribute="centerX" id="795-DV-cMA"/>
<constraint firstItem="pfT-Jl-5ie" firstAttribute="trailing" secondItem="Yot-z1-ALZ" secondAttribute="trailing" id="ALr-eM-N4b"/>
<constraint firstItem="4H9-Mj-dI1" firstAttribute="top" secondItem="u0O-MC-ZcP" secondAttribute="top" constant="-26" id="Ee9-HD-WKo"/>
<constraint firstItem="I1a-fT-WrA" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="60" id="FI4-db-dCI"/>
<constraint firstItem="jT3-Fb-fQt" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Gg2-5t-mpM"/>
<constraint firstItem="Yot-z1-ALZ" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="K87-xm-pY1"/>
<constraint firstItem="pfT-Jl-5ie" firstAttribute="bottom" secondItem="Yot-z1-ALZ" secondAttribute="bottom" id="MzW-jc-gCx"/>
<constraint firstItem="pfT-Jl-5ie" firstAttribute="top" secondItem="Yot-z1-ALZ" secondAttribute="top" id="U05-QM-vgI"/>
<constraint firstItem="pfT-Jl-5ie" firstAttribute="leading" secondItem="Yot-z1-ALZ" secondAttribute="leading" id="Wxt-N6-YNV"/>
<constraint firstItem="u0O-MC-ZcP" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="X3Y-QQ-Fqr"/>
<constraint firstItem="I1a-fT-WrA" firstAttribute="centerY" secondItem="jT3-Fb-fQt" secondAttribute="centerY" id="aO2-mn-YLH"/>
<constraint firstAttribute="trailing" secondItem="u0O-MC-ZcP" secondAttribute="trailing" id="d56-9A-UEA"/>
<constraint firstAttribute="trailing" secondItem="Yot-z1-ALZ" secondAttribute="trailing" id="dhv-fy-kAk"/>
<constraint firstItem="u0O-MC-ZcP" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="269" id="eFU-eB-Z1J"/>
<constraint firstAttribute="trailing" secondItem="I1a-fT-WrA" secondAttribute="trailing" constant="80" id="f7f-7X-kMh"/>
<constraint firstItem="2JZ-MN-Ccm" firstAttribute="bottom" secondItem="4H9-Mj-dI1" secondAttribute="bottom" id="nEc-Sn-z4k"/>
<constraint firstAttribute="bottom" secondItem="u0O-MC-ZcP" secondAttribute="bottom" id="qm4-zS-wdP"/>
<constraint firstItem="Yot-z1-ALZ" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="y7S-Z4-KDa"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="CPLab" destination="i18-aA-Gy4" id="EkG-GD-bT7"/>
<outlet property="IDLab" destination="B4I-wy-R5K" id="6Id-SU-epY"/>
<outlet property="TARoomBtn" destination="I1a-fT-WrA" id="nFG-Bt-58P"/>
<outlet property="avatarImgV" destination="4H9-Mj-dI1" id="cQr-g7-UkD"/>
<outlet property="bgImgV" destination="Yot-z1-ALZ" id="mTn-jD-c5h"/>
<outlet property="collectLab" destination="hYw-st-NZb" id="Hts-6w-0M5"/>
<outlet property="fansLab" destination="H1Y-Tv-yj9" id="Sgu-AP-maR"/>
<outlet property="focusLab" destination="uDQ-r3-xVA" id="Hdl-PC-K5u"/>
<outlet property="gonghuiCover" destination="Igj-xL-U8L" id="k6y-Wm-pCe"/>
<outlet property="gonghuiNameLabel" destination="peb-JV-lUV" id="sOa-wW-h96"/>
<outlet property="gonghuiNumLabel" destination="AjT-nK-LPM" id="1cE-Z8-Uhv"/>
<outlet property="guideCoverHerght" destination="6gn-FE-caB" id="4TH-VE-5Sw"/>
<outlet property="guildCover" destination="DV9-f4-LAs" id="biG-zz-aRo"/>
<outlet property="gxImgV" destination="ibV-kC-0DS" id="9fL-lJ-1rA"/>
<outlet property="inRoomBtn" destination="m0v-yX-S72" id="maT-Zs-xkR"/>
<outlet property="inRoomLab" destination="rUm-0c-JJG" id="ZzH-HV-Dpr"/>
<outlet property="inRoomView" destination="Vj3-8N-jPs" id="bSJ-Pm-rqL"/>
<outlet property="jueweiImgV" destination="95r-JZ-e0i" id="IGH-0y-qej"/>
<outlet property="mlImgV" destination="aKm-aC-pvc" id="uFE-6F-JID"/>
<outlet property="nicknameLab" destination="YDn-Bo-Pa8" id="kKf-Vq-GIj"/>
<outlet property="onlineStatus" destination="2JZ-MN-Ccm" id="mQT-0h-4Jn"/>
<outlet property="roomCover" destination="ibb-mU-B89" id="N8O-AN-xfg"/>
<outlet property="roomCoverHeight" destination="hGR-uy-cg8" id="7Ll-CT-1lX"/>
<outlet property="titleBgView" destination="UI4-v2-Sm1" id="LoD-OW-IPO"/>
<outlet property="titleCoverTopLayout" destination="L0V-SN-6jj" id="vL5-0R-OKJ"/>
</connections>
<point key="canvasLocation" x="186" y="-58"/>
</view>
</objects>
<resources>
<image name="default_userIcon" width="512" height="512"/>
<image name="home_bg" width="375" height="812"/>
<image name="homepage_TA_room" width="88" height="32"/>
<image name="homepage_room_bg" width="345" height="44"/>
<image name="homepage_room_cai" width="56" height="28"/>
<image name="jiantou_hui" width="5.5" height="10"/>
<image name="mine_fuzhi" width="16" height="16"/>
<image name="msg_online" width="48" height="16"/>
<image name="party_ID" width="20" height="20"/>
<image name="whiteBack" width="8.5" height="15"/>
</resources>
</document>

View File

@@ -0,0 +1,35 @@
//
// SPHomepageInfoView.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <UIKit/UIKit.h>
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepageInfoView : UIView
@property (weak, nonatomic) IBOutlet UILabel *sexLab;
@property (weak, nonatomic) IBOutlet UILabel *ageLab;
@property (weak, nonatomic) IBOutlet UILabel *xingzuoLab;
@property (weak, nonatomic) IBOutlet UILabel *IDLab;
@property (weak, nonatomic) IBOutlet UILabel *locationLab;
@property (weak, nonatomic) IBOutlet UILabel *signLab;
@property (weak, nonatomic) IBOutlet UICollectionView *collectionView;
@property (weak, nonatomic) IBOutlet UIView *giftBgView;
@property (weak, nonatomic) IBOutlet UIImageView *giftImgV_1;
@property (weak, nonatomic) IBOutlet UIImageView *giftImgV_2;
@property (weak, nonatomic) IBOutlet UIImageView *giftImgV_3;
@property (weak, nonatomic) IBOutlet UIImageView *gxImgV;
@property (weak, nonatomic) IBOutlet UIImageView *mlImgV;
@property (weak, nonatomic) IBOutlet UIImageView *jueweiImgV;
@property (weak, nonatomic) IBOutlet UIImageView *bottomBgImgV;
@property (nonatomic, strong) SPHomepageModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,284 @@
//
// SPHomepageInfoView.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepageInfoView.h"
#import "SPPickPhotoCell.h"
#import "MLNetWorkHelper.h"
#import "KNPhotoBrowser.h"
#import "YYHomepageGiftVC.h"
#import "LMGonghuiDetailsViewController.h"
@interface SPHomepageInfoView () <TZImagePickerControllerDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, KNPhotoBrowserDelegate>
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, assign) BOOL isSelf;
@property (weak, nonatomic) IBOutlet UILabel *gonghuiTitleLab;
@property (weak, nonatomic) IBOutlet UIView *guildCover;
@property (weak, nonatomic) IBOutlet UIImageView *gonghuiCover;
@property (weak, nonatomic) IBOutlet UILabel *gonghuiNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *gonghuiNumLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topConstraint;
@end
@implementation SPHomepageInfoView
- (void)awakeFromNib {
[super awakeFromNib];
self.dataArray = [NSMutableArray arrayWithCapacity:0];
[self createUI];
}
- (void)setModel:(SPHomepageModel *)model {
_model = model;
if ([model.uid integerValue] == [BJUserManager.userInfo.uid integerValue]) {
self.isSelf = YES;
}
self.sexLab.text = model.sex == 1 ? @"男" : @"女";
self.ageLab.text = model.birthday;
self.xingzuoLab.text = model.constellation;
if ([model.special_uid integerValue] > 0) {
self.IDLab.text = model.special_uid;
}else {
self.IDLab.text = model.uid;
}
self.signLab.text = model.autograph;
self.locationLab.text = model.ip_address;
[self.gxImgV sd_setImageWithURL:[NSURL URLWithString:model.user_charm_contribution_info.contribution_level_image]];
[self.mlImgV sd_setImageWithURL:[NSURL URLWithString:model.user_charm_contribution_info.charm_level_image]];
[self.jueweiImgV sd_setImageWithURL:[NSURL URLWithString:model.nobility_image]];
NSArray *giftImgVArr = @[_giftImgV_1, _giftImgV_2, _giftImgV_3];
for (NSInteger i = 0; i < model.receive_gift_list.count; i++) {
if (i < giftImgVArr.count) {
SPHomepageGiftModel *obj = model.receive_gift_list[i];
UIImageView *imgV = giftImgVArr[i];
[imgV sd_setImageWithURL:[NSURL URLWithString:obj.base_image]];
}
}
[self.dataArray removeAllObjects];
[self.dataArray addObjectsFromArray:model.user_albums_list];
[self.collectionView reloadData];
if (model.is_join_guild == 1) {
self.gonghuiTitleLab.hidden = NO;
self.guildCover.hidden = NO;
self.topConstraint.constant = 140;
self.gonghuiNameLabel.text = model.guild_info.guild_name;
self.gonghuiNumLabel.text = [NSString stringWithFormat:@"%@人",model.guild_info.num];
[self.guildCover dg_Tapped:^{
LMGonghuiDetailsViewController *vc = [[LMGonghuiDetailsViewController alloc] init];
vc.guild_id = model.guild_info.gid;
[vc pushSelf];
}];
}else {
self.gonghuiTitleLab.hidden = YES;
self.guildCover.hidden = YES;
self.topConstraint.constant = 10;
}
}
- (void)createUI {
[self.giftBgView styleShadowWithRedius:10];
[self.bottomBgImgV styleShadowWithRedius:10];
WEAK_SELF
[self.giftBgView dg_Tapped:^{
YYHomepageGiftVC *vc = [[YYHomepageGiftVC alloc] init];
vc.model = weakSelf.model;
[vc pushSelf];
}];
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
CGFloat itemW = (ScreenWidth-30-10*3)/4;
layout.itemSize = CGSizeMake(itemW, itemW);
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 10;
layout.sectionInset = UIEdgeInsetsMake(0, 0, 0, 0);
_collectionView.collectionViewLayout = layout;
_collectionView.delegate = self;
_collectionView.dataSource = self;
[_collectionView registerNib:[UINib nibWithNibName:@"SPPickPhotoCell" bundle:nil] forCellWithReuseIdentifier:@"SPPickPhotoCell"];
}
#pragma mark -------- collectionView ------
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (self.isSelf) {
if (self.dataArray.count < 6) {
return self.dataArray.count + 1;
}else {
return 6;
}
}else {
return self.dataArray.count;
}
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SPPickPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SPPickPhotoCell" forIndexPath:indexPath];
if (indexPath.row < self.dataArray.count) {
SPHomepageAlbumModel *model = self.dataArray[indexPath.row];
cell.deleteBtn.hidden = YES;
[cell.imgV sd_setImageWithURL:[NSURL URLWithString:model.image]];
if (self.isSelf) {
cell.deleteBtn.hidden = NO;
cell.deleteBtn.tag = indexPath.row;
[cell.deleteBtn addTarget:self action:@selector(deleteBtnClik:) forControlEvents:UIControlEventTouchUpInside];
}
}else {
cell.imgV.image = [UIImage imageNamed:@"trend_pick_photo"];
cell.deleteBtn.hidden = YES;
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row >= self.dataArray.count) {
[self pushTZImagePickerController];
}else {
[self onPreviewImage:indexPath.row];
}
}
#pragma mark - TZImagePickerController
- (void)pushTZImagePickerController {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:6-self.dataArray.count columnNumber:4 delegate:self pushPhotoPickerVc:YES];
// 4.
imagePickerVc.sortAscendingByModificationDate = YES;
imagePickerVc.statusBarStyle = UIStatusBarStyleLightContent;
imagePickerVc.showSelectedIndex = YES;
imagePickerVc.allowPickingOriginalPhoto = NO;
imagePickerVc.allowPickingImage = YES;
imagePickerVc.allowPickingVideo = NO;
// imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
[[self getCurrentVC] presentViewController:imagePickerVc animated:YES completion:nil];
}
#pragma mark - TZImagePickerControllerDelegate
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos {
[self onUploadImages:photos];
}
-(void)onUploadImages:(NSArray *)photos {
NSString *urlStr = [NSString stringWithFormat:@"%@api/upload/img_upload", VERSION_HTTPS_SERVER];
NSDictionary *params = @{@"login_token":GVUSER.token};
[MLNetWorkHelper uploadImagesWithURL:urlStr parameters:params name:@"file[]" images:photos fileNames:nil imageScale:0.5 imageType:@"png" progress:nil success:^(id responseObject) {
NSArray *imgArr = responseObject[@"data"];
NSString *imgsUrl = [imgArr componentsJoinedByString:@","];
[self onAddPhotos:imgsUrl];
} failure:^(NSError *error) {
}];
}
-(void)onAddPhotos:(NSString *)imagesStr {
NSDictionary *params = @{@"image":imagesStr};
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/user/add_user_albums" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
[self onReloadAlbumData];
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)deleteBtnClik:(UIButton *)sender {
if (sender.tag < self.dataArray.count) {
NSInteger index = sender.tag;
SPHomepageAlbumModel *model = self.dataArray[index];
NSDictionary *params = @{@"aid":model.aid};
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/user/delete_user_albums" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
[self.dataArray removeObjectAtIndex:index];
[self.collectionView reloadData];
} Failure:^(id _Nonnull errorData) {
}];
}
}
-(void)onReloadAlbumData {
NSDictionary *params = @{@"from_id":C_string(self.model.uid)};
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"api/player/player_home_page" Loading:YES Hud:NO Success:^(id _Nonnull responseDic) {
SPHomepageModel *model = [SPHomepageModel mj_objectWithKeyValues:responseDic[@"data"]];
self.model = model;
} Failure:^(id _Nonnull errorData) {
}];
}
-(void)onPreviewImage:(NSInteger)index {
NSMutableArray *mArr = [NSMutableArray arrayWithCapacity:0];
for (SPHomepageAlbumModel *model in self.dataArray) {
KNPhotoItems *items = [[KNPhotoItems alloc] init];
items.url = model.image;
[mArr addObject:items];
}
KNPhotoBrowser *photoBrowser = [[KNPhotoBrowser alloc] init];
photoBrowser.itemsArr = [mArr copy];
photoBrowser.currentIndex = index;
photoBrowser.delegate = self;
photoBrowser.isNeedPageNumView = YES;
photoBrowser.isNeedRightTopBtn = YES;
[photoBrowser present];
}
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser rightBtnOperationActionWithIndex:(NSInteger)index{
KNActionSheet *actionSheet = [[KNActionSheet share] initWithTitle:@""
cancelTitle:@"取消"
titleArray:@[@"保存到相册"].mutableCopy
destructiveArray:@[].mutableCopy
actionSheetBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 0) {
[UIDevice deviceAlbumAuth:^(BOOL isAuthor) {
if (isAuthor == NO) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"无法访问相册" message:@"请在iPhone的""设置-隐私-相册""中允许访问相册" preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertController addAction:[UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}]];
[[UIViewController currentViewController] presentViewController:alertController animated:YES completion:nil];
}else {
[photoBrowser downloadImageOrVideoToAlbum];
}
}];
}
}];
[actionSheet showOnView:photoBrowser.view];
}
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser
state:(KNPhotoDownloadState)state
progress:(float)progress
photoItemRelative:(KNPhotoItems *)photoItemRe
photoItemAbsolute:(KNPhotoItems *)photoItemAb {
if (progress >= 1) {
[HelpPageDefine showMessage:@"保存成功"];
}
}
@end

View File

@@ -0,0 +1,355 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" 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="21679"/>
<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"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="SPHomepageInfoView">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView hidden="YES" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="7CG-tl-oVf">
<rect key="frame" x="15" y="6" width="345" height="233"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<view hidden="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="9zg-oQ-mVj">
<rect key="frame" x="15" y="0.0" width="345" height="55"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_gift_title" translatesAutoresizingMaskIntoConstraints="NO" id="dHH-10-J9t">
<rect key="frame" x="0.0" y="1.5" width="119" height="52"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_gift_enter" translatesAutoresizingMaskIntoConstraints="NO" id="SCv-iN-MUD">
<rect key="frame" x="315.5" y="20" width="8.5" height="15.5"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gzF-rk-3E1">
<rect key="frame" x="281.5" y="15.5" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="1ys-A2-x32"/>
<constraint firstAttribute="height" constant="24" id="4Lu-6z-BYi"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="SU1-wW-0yO">
<rect key="frame" x="252.5" y="15.5" width="24" height="24"/>
<constraints>
<constraint firstAttribute="width" constant="24" id="l8y-S0-HfG"/>
<constraint firstAttribute="height" constant="24" id="rgy-FQ-xOK"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="xKg-Rw-Hsy">
<rect key="frame" x="223.5" y="15.5" width="24" height="24"/>
<constraints>
<constraint firstAttribute="height" constant="24" id="V1I-kT-6UT"/>
<constraint firstAttribute="width" constant="24" id="mUI-xy-d5V"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="xKg-Rw-Hsy" firstAttribute="centerY" secondItem="gzF-rk-3E1" secondAttribute="centerY" id="3Yb-Wm-dLi"/>
<constraint firstItem="dHH-10-J9t" firstAttribute="centerY" secondItem="9zg-oQ-mVj" secondAttribute="centerY" id="9Ht-rX-Dlp"/>
<constraint firstItem="SU1-wW-0yO" firstAttribute="centerY" secondItem="gzF-rk-3E1" secondAttribute="centerY" id="Ovu-wJ-O6Z"/>
<constraint firstItem="gzF-rk-3E1" firstAttribute="leading" secondItem="SU1-wW-0yO" secondAttribute="trailing" constant="5" id="Po7-tz-ARV"/>
<constraint firstItem="SCv-iN-MUD" firstAttribute="centerY" secondItem="9zg-oQ-mVj" secondAttribute="centerY" id="Pqq-Az-N1g"/>
<constraint firstItem="dHH-10-J9t" firstAttribute="leading" secondItem="9zg-oQ-mVj" secondAttribute="leading" id="TFU-sz-Rjy"/>
<constraint firstAttribute="trailing" secondItem="SCv-iN-MUD" secondAttribute="trailing" constant="21" id="Yh7-0y-fWD"/>
<constraint firstItem="SCv-iN-MUD" firstAttribute="leading" secondItem="gzF-rk-3E1" secondAttribute="trailing" constant="10" id="ZLe-tv-9EB"/>
<constraint firstAttribute="height" constant="55" id="kys-Jq-8c8"/>
<constraint firstItem="SU1-wW-0yO" firstAttribute="leading" secondItem="xKg-Rw-Hsy" secondAttribute="trailing" constant="5" id="w4E-gk-z6p"/>
<constraint firstItem="gzF-rk-3E1" firstAttribute="centerY" secondItem="9zg-oQ-mVj" secondAttribute="centerY" id="wir-AZ-Btx"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HIE-W6-t1V">
<rect key="frame" x="0.0" y="10" width="375" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="性别" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="GTC-1H-CfR">
<rect key="frame" x="15" y="14" width="29" height="17"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7oB-2O-hpO">
<rect key="frame" x="59" y="22.5" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="GTC-1H-CfR" firstAttribute="leading" secondItem="HIE-W6-t1V" secondAttribute="leading" constant="15" id="4TV-Rl-PQv"/>
<constraint firstAttribute="height" constant="45" id="5Hp-nm-6j1"/>
<constraint firstItem="7oB-2O-hpO" firstAttribute="centerY" secondItem="GTC-1H-CfR" secondAttribute="centerY" id="Yaw-um-bR4"/>
<constraint firstItem="GTC-1H-CfR" firstAttribute="centerY" secondItem="HIE-W6-t1V" secondAttribute="centerY" id="bJb-Zm-LgO"/>
<constraint firstItem="7oB-2O-hpO" firstAttribute="leading" secondItem="GTC-1H-CfR" secondAttribute="trailing" constant="15" id="qiJ-0d-Bm2"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="iRE-JK-0vz">
<rect key="frame" x="0.0" y="55" width="375" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="年龄" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R9n-5D-Uo4">
<rect key="frame" x="15" y="14" width="29" height="17"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nOB-pt-7PU">
<rect key="frame" x="59" y="22.5" width="0.0" height="0.0"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="nOB-pt-7PU" firstAttribute="leading" secondItem="R9n-5D-Uo4" secondAttribute="trailing" constant="15" id="P7r-5t-a5J"/>
<constraint firstItem="R9n-5D-Uo4" firstAttribute="leading" secondItem="iRE-JK-0vz" secondAttribute="leading" constant="15" id="fIf-Se-vL3"/>
<constraint firstItem="R9n-5D-Uo4" firstAttribute="centerY" secondItem="iRE-JK-0vz" secondAttribute="centerY" id="jUa-1N-Wln"/>
<constraint firstAttribute="height" constant="45" id="tEp-9r-2px"/>
<constraint firstItem="nOB-pt-7PU" firstAttribute="centerY" secondItem="R9n-5D-Uo4" secondAttribute="centerY" id="tij-ER-5Hz"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="WCQ-7X-xv3">
<rect key="frame" x="0.0" y="190" width="375" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="个性签名" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DD1-jK-QHf">
<rect key="frame" x="15" y="14" width="62" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="62" id="sGH-r4-k94"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pcl-tf-Qel">
<rect key="frame" x="92" y="22.5" width="249" height="0.0"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="DD1-jK-QHf" firstAttribute="leading" secondItem="WCQ-7X-xv3" secondAttribute="leading" constant="15" id="JHf-aq-YD4"/>
<constraint firstItem="pcl-tf-Qel" firstAttribute="centerY" secondItem="WCQ-7X-xv3" secondAttribute="centerY" id="VOg-vd-gov"/>
<constraint firstItem="pcl-tf-Qel" firstAttribute="leading" secondItem="DD1-jK-QHf" secondAttribute="trailing" constant="15" id="WPX-oC-UsK"/>
<constraint firstAttribute="height" constant="45" id="sBY-e5-Pie"/>
<constraint firstItem="DD1-jK-QHf" firstAttribute="centerY" secondItem="WCQ-7X-xv3" secondAttribute="centerY" id="sgl-52-Ysl"/>
<constraint firstAttribute="trailing" secondItem="pcl-tf-Qel" secondAttribute="trailing" constant="34" id="wYL-hv-XAp"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="照片墙" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZUi-OH-RkR">
<rect key="frame" x="15" y="375" width="49" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="所在公会" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9W5-nt-PFu">
<rect key="frame" x="15" y="245" width="65.5" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="v2R-fg-7uL">
<rect key="frame" x="0.0" y="100" width="375" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="等级" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="MA0-kY-E9e">
<rect key="frame" x="15" y="14" width="29" height="17"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="1Av-EO-lee">
<rect key="frame" x="59" y="12.5" width="40" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="ATS-6b-NBx"/>
<constraint firstAttribute="height" constant="20" id="Sgy-eg-4jj"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="lur-BC-a6J">
<rect key="frame" x="104" y="12.5" width="40" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="40" id="2kj-4f-w7a"/>
<constraint firstAttribute="height" constant="20" id="9u9-Wt-t4E"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="gxW-gD-mrP">
<rect key="frame" x="149" y="7.5" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="9mr-Zn-iqQ"/>
<constraint firstAttribute="width" constant="30" id="VxA-1I-Y7c"/>
</constraints>
</imageView>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="lur-BC-a6J" firstAttribute="centerY" secondItem="v2R-fg-7uL" secondAttribute="centerY" id="9eh-8C-DRj"/>
<constraint firstItem="1Av-EO-lee" firstAttribute="centerY" secondItem="v2R-fg-7uL" secondAttribute="centerY" id="Ima-vP-KaO"/>
<constraint firstAttribute="height" constant="45" id="Kwz-bF-XTS"/>
<constraint firstItem="lur-BC-a6J" firstAttribute="leading" secondItem="1Av-EO-lee" secondAttribute="trailing" constant="5" id="Nvi-d3-JrW"/>
<constraint firstItem="MA0-kY-E9e" firstAttribute="leading" secondItem="v2R-fg-7uL" secondAttribute="leading" constant="15" id="P7W-dB-XOG"/>
<constraint firstItem="1Av-EO-lee" firstAttribute="leading" secondItem="MA0-kY-E9e" secondAttribute="trailing" constant="15" id="YQq-BH-974"/>
<constraint firstItem="gxW-gD-mrP" firstAttribute="leading" secondItem="lur-BC-a6J" secondAttribute="trailing" constant="5" id="poq-sb-MGP"/>
<constraint firstItem="MA0-kY-E9e" firstAttribute="centerY" secondItem="v2R-fg-7uL" secondAttribute="centerY" id="q4S-o7-8Qv"/>
<constraint firstItem="gxW-gD-mrP" firstAttribute="centerY" secondItem="v2R-fg-7uL" secondAttribute="centerY" id="qdo-sd-saK"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="7xg-AR-vTu">
<rect key="frame" x="0.0" y="145" width="375" height="45"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="定位" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Tdz-oB-1GV">
<rect key="frame" x="15" y="14" width="29" height="17"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="中国" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="evC-ep-7Cn">
<rect key="frame" x="59" y="14" width="29" height="17"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="Tdz-oB-1GV" firstAttribute="centerY" secondItem="7xg-AR-vTu" secondAttribute="centerY" id="25x-Gb-PAk"/>
<constraint firstItem="Tdz-oB-1GV" firstAttribute="leading" secondItem="7xg-AR-vTu" secondAttribute="leading" constant="15" id="HeB-wL-z5d"/>
<constraint firstItem="evC-ep-7Cn" firstAttribute="centerY" secondItem="Tdz-oB-1GV" secondAttribute="centerY" id="d5N-zS-vdN"/>
<constraint firstItem="evC-ep-7Cn" firstAttribute="leading" secondItem="Tdz-oB-1GV" secondAttribute="trailing" constant="15" id="hSF-mz-kvz"/>
<constraint firstAttribute="height" constant="45" id="vzG-iv-5td"/>
</constraints>
</view>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="9n4-fO-gOe">
<rect key="frame" x="15" y="404.5" width="345" height="250"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="height" constant="250" id="hVV-L8-zK1"/>
</constraints>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="Il2-dm-W10">
<size key="itemSize" width="128" height="128"/>
<size key="headerReferenceSize" width="0.0" height="0.0"/>
<size key="footerReferenceSize" width="0.0" height="0.0"/>
<inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
</collectionViewFlowLayout>
</collectionView>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="NkD-WA-om6">
<rect key="frame" x="15" y="275" width="345" height="88"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="default_userIcon" translatesAutoresizingMaskIntoConstraints="NO" id="wWg-Rp-WTo">
<rect key="frame" x="10" y="10" width="68" height="68"/>
<constraints>
<constraint firstAttribute="height" constant="68" id="1fp-Q1-2uB"/>
<constraint firstAttribute="width" constant="68" id="ja2-vb-xG0"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="34"/>
</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="PM1-e9-EpM">
<rect key="frame" x="88" y="20" width="65.5" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.23921568630000001" green="0.23921568630000001" blue="0.23921568630000001" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0人" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Rpy-FO-Gta">
<rect key="frame" x="88" y="53.5" width="20.5" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jiantou_hui" translatesAutoresizingMaskIntoConstraints="NO" id="Zt2-gz-LLl">
<rect key="frame" x="324.5" y="39" width="5.5" height="10"/>
</imageView>
</subviews>
<color key="backgroundColor" red="0.57254901960000004" green="0.28627450980000002" blue="1" alpha="0.10000000000000001" colorSpace="custom" customColorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="PM1-e9-EpM" firstAttribute="leading" secondItem="wWg-Rp-WTo" secondAttribute="trailing" constant="10" id="4BH-AD-hZT"/>
<constraint firstItem="Zt2-gz-LLl" firstAttribute="centerY" secondItem="NkD-WA-om6" secondAttribute="centerY" id="A3H-Br-WAX"/>
<constraint firstItem="wWg-Rp-WTo" firstAttribute="centerY" secondItem="NkD-WA-om6" secondAttribute="centerY" id="BxT-Tv-n8t"/>
<constraint firstItem="PM1-e9-EpM" firstAttribute="top" secondItem="NkD-WA-om6" secondAttribute="top" constant="20" id="GYn-xg-D7j"/>
<constraint firstAttribute="height" constant="88" id="LOQ-6x-69d"/>
<constraint firstAttribute="trailing" secondItem="Zt2-gz-LLl" secondAttribute="trailing" constant="15" id="LsS-j7-Z2q"/>
<constraint firstItem="Rpy-FO-Gta" firstAttribute="top" secondItem="PM1-e9-EpM" secondAttribute="bottom" constant="14" id="cjc-Z2-shT"/>
<constraint firstItem="wWg-Rp-WTo" firstAttribute="leading" secondItem="NkD-WA-om6" secondAttribute="leading" constant="10" id="jGp-HK-dkq"/>
<constraint firstItem="Rpy-FO-Gta" firstAttribute="leading" secondItem="PM1-e9-EpM" secondAttribute="leading" id="u99-LD-0FX"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="HIE-W6-t1V" secondAttribute="trailing" id="0A7-yU-f7i"/>
<constraint firstAttribute="trailing" secondItem="v2R-fg-7uL" secondAttribute="trailing" id="0gj-Ug-ijo"/>
<constraint firstItem="9zg-oQ-mVj" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="7aR-uN-75i"/>
<constraint firstItem="ZUi-OH-RkR" firstAttribute="top" secondItem="WCQ-7X-xv3" secondAttribute="bottom" constant="140" id="8lR-ki-R97"/>
<constraint firstAttribute="trailing" secondItem="iRE-JK-0vz" secondAttribute="trailing" id="FsP-Hs-Kkx"/>
<constraint firstItem="NkD-WA-om6" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="ImT-dp-bcd"/>
<constraint firstItem="9n4-fO-gOe" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="J8z-ni-kS3"/>
<constraint firstItem="iRE-JK-0vz" firstAttribute="top" secondItem="HIE-W6-t1V" secondAttribute="bottom" id="JIi-Wv-bFs"/>
<constraint firstItem="9W5-nt-PFu" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="JnL-Bi-gfH"/>
<constraint firstItem="7CG-tl-oVf" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="MQD-DB-RtI"/>
<constraint firstAttribute="trailing" secondItem="7xg-AR-vTu" secondAttribute="trailing" id="MYQ-ub-JIn"/>
<constraint firstItem="v2R-fg-7uL" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="NdR-E3-dNH"/>
<constraint firstItem="NkD-WA-om6" firstAttribute="top" secondItem="WCQ-7X-xv3" secondAttribute="bottom" constant="40" id="OzX-s8-Iek"/>
<constraint firstItem="7xg-AR-vTu" firstAttribute="top" secondItem="v2R-fg-7uL" secondAttribute="bottom" id="QJf-X8-gCp"/>
<constraint firstItem="9n4-fO-gOe" firstAttribute="top" secondItem="ZUi-OH-RkR" secondAttribute="bottom" constant="10" id="RYT-iB-vWF"/>
<constraint firstAttribute="trailing" secondItem="9zg-oQ-mVj" secondAttribute="trailing" constant="15" id="SA5-P7-5i7"/>
<constraint firstItem="7xg-AR-vTu" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="bYr-xa-sQG"/>
<constraint firstItem="WCQ-7X-xv3" firstAttribute="top" secondItem="v2R-fg-7uL" secondAttribute="bottom" constant="45" id="bxz-7y-YZb"/>
<constraint firstItem="iRE-JK-0vz" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="dGm-lT-F5v"/>
<constraint firstAttribute="trailing" secondItem="NkD-WA-om6" secondAttribute="trailing" constant="15" id="fZ0-vw-jtB"/>
<constraint firstAttribute="trailing" secondItem="WCQ-7X-xv3" secondAttribute="trailing" id="hBG-my-bLf"/>
<constraint firstItem="v2R-fg-7uL" firstAttribute="top" secondItem="iRE-JK-0vz" secondAttribute="bottom" id="hd5-9Z-jMU"/>
<constraint firstItem="9W5-nt-PFu" firstAttribute="top" secondItem="WCQ-7X-xv3" secondAttribute="bottom" constant="10" id="iBq-hN-5f4"/>
<constraint firstItem="7CG-tl-oVf" firstAttribute="bottom" secondItem="WCQ-7X-xv3" secondAttribute="bottom" constant="4" id="jE9-bv-gnb"/>
<constraint firstAttribute="trailing" secondItem="9n4-fO-gOe" secondAttribute="trailing" constant="15" id="leE-IG-lVy"/>
<constraint firstItem="7CG-tl-oVf" firstAttribute="top" secondItem="HIE-W6-t1V" secondAttribute="top" constant="-4" id="nVn-ak-D8s"/>
<constraint firstAttribute="trailing" secondItem="7CG-tl-oVf" secondAttribute="trailing" constant="15" id="p9z-OT-nt5"/>
<constraint firstItem="9zg-oQ-mVj" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="qcx-Nc-Znp"/>
<constraint firstItem="HIE-W6-t1V" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="vi9-mK-Ylg"/>
<constraint firstItem="ZUi-OH-RkR" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="yl7-ee-rUF"/>
<constraint firstItem="HIE-W6-t1V" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="zlg-tK-DHW"/>
<constraint firstItem="WCQ-7X-xv3" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="zp5-8w-8UY"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="ageLab" destination="nOB-pt-7PU" id="ayc-dS-tEP"/>
<outlet property="bottomBgImgV" destination="7CG-tl-oVf" id="fJR-LA-gAq"/>
<outlet property="collectionView" destination="9n4-fO-gOe" id="Su4-gb-EW3"/>
<outlet property="giftBgView" destination="9zg-oQ-mVj" id="b3p-Kn-7xX"/>
<outlet property="giftImgV_1" destination="gzF-rk-3E1" id="Hen-tz-9rM"/>
<outlet property="giftImgV_2" destination="SU1-wW-0yO" id="VMX-C6-gbX"/>
<outlet property="giftImgV_3" destination="xKg-Rw-Hsy" id="ogE-e2-CgP"/>
<outlet property="gonghuiCover" destination="wWg-Rp-WTo" id="Jym-5U-7hz"/>
<outlet property="gonghuiNameLabel" destination="PM1-e9-EpM" id="3TB-EZ-jMl"/>
<outlet property="gonghuiNumLabel" destination="Rpy-FO-Gta" id="L9r-MH-bWn"/>
<outlet property="gonghuiTitleLab" destination="9W5-nt-PFu" id="AHG-Bc-jKF"/>
<outlet property="guildCover" destination="NkD-WA-om6" id="Z2t-yg-hku"/>
<outlet property="gxImgV" destination="1Av-EO-lee" id="CBv-xN-jNY"/>
<outlet property="jueweiImgV" destination="gxW-gD-mrP" id="kat-Nm-fkK"/>
<outlet property="locationLab" destination="evC-ep-7Cn" id="czo-dO-j0B"/>
<outlet property="mlImgV" destination="lur-BC-a6J" id="r4f-cq-eb4"/>
<outlet property="sexLab" destination="7oB-2O-hpO" id="gO4-H0-sZv"/>
<outlet property="signLab" destination="pcl-tf-Qel" id="emh-jM-wWf"/>
<outlet property="topConstraint" destination="8lR-ki-R97" id="dTR-cp-FgH"/>
</connections>
<point key="canvasLocation" x="131.8840579710145" y="102.45535714285714"/>
</view>
</objects>
<resources>
<image name="default_userIcon" width="512" height="512"/>
<image name="homepage_gift_enter" width="8.5" height="15.5"/>
<image name="homepage_gift_title" width="119" height="52"/>
<image name="jiantou_hui" width="5.5" height="10"/>
</resources>
</document>

View File

@@ -0,0 +1,19 @@
//
// SPHomepageInfoView.h
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import <UIKit/UIKit.h>
#import "SPHomepageModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface SPHomepagePhotoView : UIView
@property (nonatomic, strong) SPHomepageModel *model;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,232 @@
//
// SPHomepagePhotoView.m
// SweetParty
//
// Created by bj_szd on 2022/6/2.
//
#import "SPHomepagePhotoView.h"
#import "SPPickPhotoCell.h"
#import "MLNetWorkHelper.h"
#import "KNPhotoBrowser.h"
@interface SPHomepagePhotoView () <TZImagePickerControllerDelegate, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource, KNPhotoBrowserDelegate>
@property (strong, nonatomic) UICollectionView *collectionView;
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, assign) BOOL isSelf;
@end
@implementation SPHomepagePhotoView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.dataArray = [NSMutableArray arrayWithCapacity:0];
[self createUI];
}
return self;
}
- (void)setModel:(SPHomepageModel *)model {
_model = model;
if ([model.uid integerValue] == [BJUserManager.userInfo.uid integerValue]) {
self.isSelf = YES;
}
[self.dataArray removeAllObjects];
[self.dataArray addObjectsFromArray:model.user_albums_list];
[self.collectionView reloadData];
}
- (void)createUI {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
CGFloat itemW = (ScreenWidth-20*2-12)/2;
layout.itemSize = CGSizeMake(itemW, itemW);
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 20, 0, 20);
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
_collectionView.backgroundColor = kClearColor;
_collectionView.collectionViewLayout = layout;
_collectionView.delegate = self;
_collectionView.dataSource = self;
[_collectionView registerNib:[UINib nibWithNibName:@"SPPickPhotoCell" bundle:nil] forCellWithReuseIdentifier:@"SPPickPhotoCell"];
[self addSubview:_collectionView];
[_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
}
#pragma mark -------- collectionView ------
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
if (self.isSelf) {
if (self.dataArray.count < 6) {
return self.dataArray.count + 1;
}else {
return 6;
}
}else {
return self.dataArray.count;
}
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
SPPickPhotoCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"SPPickPhotoCell" forIndexPath:indexPath];
if (indexPath.row < self.dataArray.count) {
SPHomepageAlbumModel *model = self.dataArray[indexPath.row];
cell.deleteBtn.hidden = YES;
[cell.imgV sd_setImageWithURL:[NSURL URLWithString:model.image]];
if (self.isSelf) {
cell.deleteBtn.hidden = NO;
cell.deleteBtn.tag = indexPath.row;
[cell.deleteBtn addTarget:self action:@selector(deleteBtnClik:) forControlEvents:UIControlEventTouchUpInside];
}
}else {
cell.imgV.image = [UIImage imageNamed:@"trend_pick_photo"];
cell.deleteBtn.hidden = YES;
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row >= self.dataArray.count) {
[self pushTZImagePickerController];
}else {
[self onPreviewImage:indexPath.row];
}
}
#pragma mark - TZImagePickerController
- (void)pushTZImagePickerController {
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:6-self.dataArray.count columnNumber:4 delegate:self pushPhotoPickerVc:YES];
// 4.
imagePickerVc.sortAscendingByModificationDate = YES;
imagePickerVc.statusBarStyle = UIStatusBarStyleLightContent;
imagePickerVc.showSelectedIndex = YES;
imagePickerVc.allowPickingOriginalPhoto = NO;
imagePickerVc.allowPickingImage = YES;
imagePickerVc.allowPickingVideo = NO;
// imagePickerVc.modalPresentationStyle = UIModalPresentationFullScreen;
[[self getCurrentVC] presentViewController:imagePickerVc animated:YES completion:nil];
}
#pragma mark - TZImagePickerControllerDelegate
- (void)imagePickerController:(TZImagePickerController *)picker didFinishPickingPhotos:(NSArray<UIImage *> *)photos sourceAssets:(NSArray *)assets isSelectOriginalPhoto:(BOOL)isSelectOriginalPhoto infos:(NSArray<NSDictionary *> *)infos {
[self onUploadImages:photos];
}
-(void)onUploadImages:(NSArray *)photos {
NSString *urlStr = [NSString stringWithFormat:@"%@api/upload/img_upload", VERSION_HTTPS_SERVER];
NSDictionary *params = @{@"login_token":GVUSER.token};
[MLNetWorkHelper uploadImagesWithURL:urlStr parameters:params name:@"file[]" images:photos fileNames:nil imageScale:0.5 imageType:@"png" progress:nil success:^(id responseObject) {
NSArray *imgArr = responseObject[@"data"];
NSString *imgsUrl = [imgArr componentsJoinedByString:@","];
[self onAddPhotos:imgsUrl];
} failure:^(NSError *error) {
}];
}
-(void)onAddPhotos:(NSString *)imagesStr {
NSDictionary *params = @{@"image":imagesStr};
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/user/add_user_albums" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
[self onReloadAlbumData];
} Failure:^(id _Nonnull errorData) {
}];
}
- (void)deleteBtnClik:(UIButton *)sender {
if (sender.tag < self.dataArray.count) {
NSInteger index = sender.tag;
SPHomepageAlbumModel *model = self.dataArray[index];
NSDictionary *params = @{@"aid":model.aid};
[AFNetworkRequset.shared postRequestWithParams:params Path:@"api/user/delete_user_albums" Loading:YES Hud:YES Success:^(id _Nonnull responseDic) {
[self.dataArray removeObjectAtIndex:index];
[self.collectionView reloadData];
} Failure:^(id _Nonnull errorData) {
}];
}
}
-(void)onReloadAlbumData {
NSDictionary *params = @{@"from_id":C_string(self.model.uid)};
[[AFNetworkRequset shared] postRequestWithParams:params Path:@"api/player/player_home_page" Loading:YES Hud:NO Success:^(id _Nonnull responseDic) {
SPHomepageModel *model = [SPHomepageModel mj_objectWithKeyValues:responseDic[@"data"]];
self.model = model;
} Failure:^(id _Nonnull errorData) {
}];
}
-(void)onPreviewImage:(NSInteger)index {
NSMutableArray *mArr = [NSMutableArray arrayWithCapacity:0];
for (SPHomepageAlbumModel *model in self.dataArray) {
KNPhotoItems *items = [[KNPhotoItems alloc] init];
items.url = model.image;
[mArr addObject:items];
}
KNPhotoBrowser *photoBrowser = [[KNPhotoBrowser alloc] init];
photoBrowser.itemsArr = [mArr copy];
photoBrowser.currentIndex = index;
photoBrowser.delegate = self;
photoBrowser.isNeedPageNumView = YES;
photoBrowser.isNeedRightTopBtn = YES;
[photoBrowser present];
}
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser rightBtnOperationActionWithIndex:(NSInteger)index{
KNActionSheet *actionSheet = [[KNActionSheet share] initWithTitle:@""
cancelTitle:@"取消"
titleArray:@[@"保存到相册"].mutableCopy
destructiveArray:@[].mutableCopy
actionSheetBlock:^(NSInteger buttonIndex) {
if (buttonIndex == 0) {
[UIDevice deviceAlbumAuth:^(BOOL isAuthor) {
if (isAuthor == NO) {
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"无法访问相册" message:@"请在iPhone的""设置-隐私-相册""中允许访问相册" preferredStyle:UIAlertControllerStyleAlert];
[alertController addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:nil]];
[alertController addAction:[UIAlertAction actionWithTitle:@"设置" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
}]];
[[UIViewController currentViewController] presentViewController:alertController animated:YES completion:nil];
}else {
[photoBrowser downloadImageOrVideoToAlbum];
}
}];
}
}];
[actionSheet showOnView:photoBrowser.view];
}
- (void)photoBrowser:(KNPhotoBrowser *)photoBrowser
state:(KNPhotoDownloadState)state
progress:(float)progress
photoItemRelative:(KNPhotoItems *)photoItemRe
photoItemAbsolute:(KNPhotoItems *)photoItemAb {
if (progress >= 1) {
[HelpPageDefine showMessage:@"保存成功"];
}
}
@end

View File

@@ -0,0 +1,24 @@
//
// SPMostGiftsView.h
// YaYin
//
// Created by bj_szd on 2023/7/12.
// Copyright © 2023 YaYin. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface SPMostGiftsView : UIView
@property (weak, nonatomic) IBOutlet UIImageView *touchImgV;
@property (weak, nonatomic) IBOutlet UIImageView *avatarImgV_1;
@property (weak, nonatomic) IBOutlet UILabel *nicknameLab_1;
@property (weak, nonatomic) IBOutlet UILabel *numLab;
@property (nonatomic, strong) NSDictionary *dataDict;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,52 @@
//
// SPMostGiftsView.m
// YaYin
//
// Created by bj_szd on 2023/7/12.
// Copyright © 2023 YaYin. All rights reserved.
//
#import "SPMostGiftsView.h"
@interface SPMostGiftsView ()
@property (weak, nonatomic) IBOutlet UIView *containerView;
@property (weak, nonatomic) IBOutlet UIButton *knowBtn;
@end
@implementation SPMostGiftsView
- (void)awakeFromNib {
[super awakeFromNib];
[self createUI];
}
- (void)createUI {
WEAK_SELF
[self.touchImgV dg_Tapped:^{
[weakSelf removeFromSuperview];
}];
// self.containerView.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(ScreenWidth, 300) direction:FXGradientChangeDirectionVertical startColor:HEXCOLOR(0xD9CDFF) endColor:HEXCOLOR(0xFFFFFF)];
self.knowBtn.backgroundColor = [UIColor bm_colorGradientChangeWithSize:CGSizeMake(ScreenWidth-34*2, 48) direction:FXGradientChangeDirectionHorizontal startColor:mainLightColor endColor:mainDeepColor];
}
- (void)setDataDict:(NSDictionary *)dataDict {
_dataDict = dataDict;
//
NSString *nick_name1 = [dataDict safeStringForKey:@"nick_name"];
NSString *head_pic1 = [dataDict safeStringForKey:@"head_pic"];
[self.avatarImgV_1 sd_setImageWithURL:[NSURL URLWithString:head_pic1] placeholderImage:kDefaultUserIcon];
self.nicknameLab_1.text = nick_name1;
self.numLab.text = [NSString stringWithFormat:@"礼物总数量:%@", dataDict[@"num"]];
}
- (IBAction)closeButtonClick:(UIButton *)sender {
[self removeFromSuperview];
}
@end

View File

@@ -0,0 +1,161 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="22505" 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="22504"/>
<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"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="SPMostGiftsView">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Tg5-mr-M63">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<color key="backgroundColor" white="0.0" alpha="0.49647200190000002" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</imageView>
<view clipsSubviews="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="e3c-c8-hjW">
<rect key="frame" x="15" y="189" width="345" height="272"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="homepage_most_bg" translatesAutoresizingMaskIntoConstraints="NO" id="mJ2-Ui-FG3">
<rect key="frame" x="0.0" y="0.0" width="345" height="272"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vht-zk-e2H">
<rect key="frame" x="138.5" y="30" width="68" height="68"/>
<constraints>
<constraint firstAttribute="width" constant="68" id="7al-3g-jm2"/>
<constraint firstAttribute="height" constant="68" id="bRT-we-ypL"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="34"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="2"/>
</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="ohr-v8-m7S">
<rect key="frame" x="156" y="108" width="33" height="19.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="16"/>
<color key="textColor" red="0.23921568627450979" green="0.23921568627450979" blue="0.23921568627450979" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zBm-E4-g5r">
<rect key="frame" x="90" y="139.5" width="165" height="28"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gift_totalnum_bg" translatesAutoresizingMaskIntoConstraints="NO" id="Lcm-Os-uFR">
<rect key="frame" x="0.0" y="0.0" width="165" height="28"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="礼物总数量0" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Psb-zv-Wbn">
<rect key="frame" x="41.5" y="6.5" width="82" height="14.5"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="12"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Lcm-Os-uFR" secondAttribute="bottom" id="7ZS-Le-b9N"/>
<constraint firstAttribute="height" constant="28" id="AHt-Jf-CiI"/>
<constraint firstAttribute="width" constant="165" id="Ajn-th-tVt"/>
<constraint firstItem="Lcm-Os-uFR" firstAttribute="top" secondItem="zBm-E4-g5r" secondAttribute="top" id="D2Y-WL-Wcv"/>
<constraint firstAttribute="trailing" secondItem="Lcm-Os-uFR" secondAttribute="trailing" id="Uxc-wV-dAW"/>
<constraint firstItem="Psb-zv-Wbn" firstAttribute="centerX" secondItem="zBm-E4-g5r" secondAttribute="centerX" id="c7x-EB-JQE"/>
<constraint firstItem="Psb-zv-Wbn" firstAttribute="centerY" secondItem="zBm-E4-g5r" secondAttribute="centerY" id="eu6-z9-pbB"/>
<constraint firstItem="Lcm-Os-uFR" firstAttribute="leading" secondItem="zBm-E4-g5r" secondAttribute="leading" id="lTb-H4-wLW"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YBk-4a-LgM">
<rect key="frame" x="300" y="15" width="30" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="30" id="N8D-Sq-4G3"/>
<constraint firstAttribute="height" constant="30" id="s4W-Fm-lPX"/>
</constraints>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" image="young_close_alert"/>
<connections>
<action selector="closeButtonClick:" destination="iN0-l3-epB" eventType="touchUpInside" id="Bsb-Hg-51A"/>
</connections>
</button>
<button opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="g83-x0-0xn">
<rect key="frame" x="30" y="198" width="285" height="44"/>
<color key="backgroundColor" red="0.050980392156862744" green="1" blue="0.72549019607843135" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="rBD-gn-4bB"/>
</constraints>
<fontDescription key="fontDescription" type="boldSystem" pointSize="18"/>
<inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
<state key="normal" title="知道了">
<color key="titleColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="22"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<connections>
<action selector="closeButtonClick:" destination="iN0-l3-epB" eventType="touchUpInside" id="bDz-S4-huK"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="mJ2-Ui-FG3" firstAttribute="top" secondItem="e3c-c8-hjW" secondAttribute="top" id="166-Fh-NC1"/>
<constraint firstItem="ohr-v8-m7S" firstAttribute="top" secondItem="vht-zk-e2H" secondAttribute="bottom" constant="10" id="2OX-a2-3bu"/>
<constraint firstAttribute="trailing" secondItem="YBk-4a-LgM" secondAttribute="trailing" constant="15" id="6aw-4i-fTO"/>
<constraint firstAttribute="trailing" secondItem="g83-x0-0xn" secondAttribute="trailing" constant="30" id="8Iq-VY-Cvj"/>
<constraint firstAttribute="width" secondItem="e3c-c8-hjW" secondAttribute="height" multiplier="345:272" id="FIR-Te-2IY"/>
<constraint firstAttribute="bottom" secondItem="mJ2-Ui-FG3" secondAttribute="bottom" id="JAF-6d-zdl"/>
<constraint firstAttribute="bottom" secondItem="g83-x0-0xn" secondAttribute="bottom" constant="30" id="MOv-yF-Vot"/>
<constraint firstItem="vht-zk-e2H" firstAttribute="top" secondItem="e3c-c8-hjW" secondAttribute="top" constant="30" id="Pba-ax-4xd"/>
<constraint firstItem="YBk-4a-LgM" firstAttribute="top" secondItem="e3c-c8-hjW" secondAttribute="top" constant="15" id="SXG-KG-feB"/>
<constraint firstAttribute="trailing" secondItem="mJ2-Ui-FG3" secondAttribute="trailing" id="W4f-68-1JU"/>
<constraint firstItem="zBm-E4-g5r" firstAttribute="centerX" secondItem="e3c-c8-hjW" secondAttribute="centerX" id="Xfa-Tc-Bqc"/>
<constraint firstItem="mJ2-Ui-FG3" firstAttribute="leading" secondItem="e3c-c8-hjW" secondAttribute="leading" id="hDc-JA-W36"/>
<constraint firstItem="vht-zk-e2H" firstAttribute="centerX" secondItem="e3c-c8-hjW" secondAttribute="centerX" id="kn0-Vb-oFY"/>
<constraint firstItem="g83-x0-0xn" firstAttribute="leading" secondItem="e3c-c8-hjW" secondAttribute="leading" constant="30" id="lBT-SR-LPZ"/>
<constraint firstItem="ohr-v8-m7S" firstAttribute="centerX" secondItem="vht-zk-e2H" secondAttribute="centerX" id="vmf-yX-Lur"/>
<constraint firstItem="zBm-E4-g5r" firstAttribute="top" secondItem="ohr-v8-m7S" secondAttribute="bottom" constant="12" id="xUS-b9-7qx"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="16"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="e3c-c8-hjW" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" multiplier="0.8" id="0zQ-W3-YEK"/>
<constraint firstItem="Tg5-mr-M63" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Ajp-Bi-NrC"/>
<constraint firstItem="Tg5-mr-M63" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="C1U-cI-Wga"/>
<constraint firstAttribute="bottom" secondItem="Tg5-mr-M63" secondAttribute="bottom" id="edO-pm-1fM"/>
<constraint firstAttribute="trailing" secondItem="e3c-c8-hjW" secondAttribute="trailing" constant="15" id="phH-ga-80f"/>
<constraint firstAttribute="trailing" secondItem="Tg5-mr-M63" secondAttribute="trailing" id="tQS-q4-FdB"/>
<constraint firstItem="e3c-c8-hjW" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="15" id="uGX-78-j8U"/>
</constraints>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<connections>
<outlet property="avatarImgV_1" destination="vht-zk-e2H" id="Zle-St-2q4"/>
<outlet property="containerView" destination="e3c-c8-hjW" id="8kA-rP-gSa"/>
<outlet property="knowBtn" destination="g83-x0-0xn" id="TKF-Cw-F1l"/>
<outlet property="nicknameLab_1" destination="ohr-v8-m7S" id="7AF-eA-wKm"/>
<outlet property="numLab" destination="Psb-zv-Wbn" id="UyO-wu-iHy"/>
<outlet property="touchImgV" destination="Tg5-mr-M63" id="rZP-D8-cyf"/>
</connections>
<point key="canvasLocation" x="118" y="112"/>
</view>
</objects>
<resources>
<image name="gift_totalnum_bg" width="165" height="28"/>
<image name="homepage_most_bg" width="345" height="272"/>
<image name="young_close_alert" width="24" height="24"/>
</resources>
</document>