Files
peko-ios/YuMi/Modules/YMMine/View/XPMineViewController.m

681 lines
23 KiB
Mathematica
Raw Normal View History

2023-07-14 18:50:55 +08:00
//
// XPMineViewController.m
// YuMi
//
// Created by YuMi on 2021/9/16.
//
#import "XPMineViewController.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "TTPopup.h"
#import "YUMIHtmlUrl.h"
#import "UIButton+EnlargeTouchArea.h"
#import "StatisticsServiceHelper.h"
#import "YUMIConstant.h"
#import "Api+Room.h"
#import "Api+RoomSetting.h"
#import "AccountInfoStorage.h"
#import "ClientConfig.h"
///Model
#import "XPMineItemModel.h"
#import "UserInfoModel.h"
#import "XPMineVisitorUnReadModel.h"
#import "ClanDetailInfoModel.h"
#import "HomeBannerInfoModel.h"
#import "XPMineFuntionItemModel.h"
#import "WalletInfoModel.h"
///P
#import "XPMineProtocol.h"
#import "XPMinePresent.h"
///View
#import "XPMineHeadItemTableViewCell.h"
#import "XPMineHeadView.h"
#import "XPHomeBannerTableViewCell.h"
#import "XPMineNewUserRechargeView.h"
#import "XPMineTheGuildCell.h"
#import "XPMinePersonalCenterCell.h"
#import "XPMineListCell.h"
///VC
#import "XPMineSettingViewController.h"
#import "XPMineUserInfoViewController.h"
#import "XPMineRechargeViewController.h"
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
#import "XPMineDressUpViewController.h"
#import "XPDressUpShopViewController.h"
#import "XPMineFansViewController.h"
#import "XPMineAttentionViewController.h"
#import "XPMineVisitorViewController.h"
#import "XPMineFansTeamViewController.h"
#import "XPMineClanViewController.h"
#import "XPMineGuildViewController.h"
#import "XPMineFootPrintViewController.h"
#import "XPMineCollectRoomListViewController.h"
#import "XPMineMainGuildListVC.h"
#import "XPMineGiveDiamondVC.h"
#import "XPIncomeRecordVC.h"
#import "XPNobleCenterViewController.h"
UIKIT_EXTERN NSString *kRequestRicket;
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
///
@property (nonatomic, strong) UIView *bgImageView;
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic, strong) NSMutableArray<XPMineFuntionItemModel *> *functionArray;
///banner
@property (nonatomic, strong) NSMutableArray<HomeBannerInfoModel *> *bannerArray;
///
@property (nonatomic,strong) XPMineHeadView *headView;
///
@property (nonatomic,strong) UserInfoModel *userInfo;
///
@property (nonatomic,strong) ClanDetailInfoModel *clanInfo;
///
@property (nonatomic,strong) XPMineItemModel *guildItemModel;
///
@property(nonatomic,assign)BOOL isHavePermission;
///
@property (nonatomic,assign) BOOL isRefreshRoomInfo;
///,
@property (nonatomic,assign) BOOL isRequestData;
@end
@implementation XPMineViewController
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (BOOL)isHiddenNavBar {
return YES;
}
- (XPMinePresent *)createPresenter {
return [[XPMinePresent alloc] init];;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
2023-07-19 14:41:04 +08:00
self.isRefreshRoomInfo = NO;
2023-07-14 18:50:55 +08:00
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_show];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_show];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
if([AccountInfoStorage instance].isRequestRicket == YES)return;
[self.presenter getUserInfo];
}
#pragma mark-
-(void)checkHaveGiveDiamondsPermission{
ClientConfig *config = [ClientConfig shareConfig];
NSArray *uidList = config.configInfo.giveDiamondErbanNoList;
for (id uid in uidList) {
NSString *getUid = [uid stringValue];
if([getUid isEqualToString:@(self.userInfo.erbanNo).stringValue]){
self.isHavePermission = YES;
break;
}
}
if(self.isHavePermission == YES)return;
for (id uid in config.configInfo.giveGiftErbanNoList) {
NSString *getUid = [uid stringValue];
if([getUid isEqualToString:@(self.userInfo.erbanNo).stringValue]){
self.isHavePermission = YES;
break;
}
}
if(self.isHavePermission == YES)return;
if(self.userInfo.userLevelVo.experLevelSeq >= config.configInfo.giveDiamondExperLevel){
self.isHavePermission = YES;
return;
}
if(self.userInfo.userLevelVo.experLevelSeq >= config.configInfo.giveGiftExperLevel){
self.isHavePermission = YES;
}
}
#pragma mark - Response
- (void)settingButtonAction {
XPMineSettingViewController * settingVC = [[XPMineSettingViewController alloc] init];
settingVC.userInfo = self.userInfo;
[self.navigationController pushViewController:settingVC animated:YES];
}
#pragma mark - Private Method
- (void)initSubViews {
XPMineFuntionItemModel *setItem = [XPMineFuntionItemModel new];
setItem.centerName = YMLocalizedString(@"XPMineSettingViewController0");
setItem.centerPic = @"mineview_set";
setItem.skipType = XPMineItemType_My_Set;
[self.functionArray addObject:setItem];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.tableView];
// [self.view addSubview:self.settingButton];
self.tableView.tableHeaderView = self.headView;
if (@available(iOS 15.0, *)) {//iOS1522
self.tableView.sectionHeaderTopPadding = 0;
}
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(requestRicketSuccess:) name:kRequestRicket object:nil];
}
-(void)requestRicketSuccess:(NSNotification *)not{
if([not.object isKindOfClass:[NSDictionary class]])return;
BOOL is = [not.object boolValue];
if(is == YES){
[self.presenter getUserInfo];
}
}
- (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(0);
}];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.view);
make.left.right.bottom.mas_equalTo(self.view);
}];
}
- (void)pushViewControllerWithType:(NSInteger)type functionItem:(XPMineFuntionItemModel *)item {
switch (type) {
case XPMineItemType_My_Set:{
[self settingButtonAction];
break;
}
case XPMineItemType_Match_Relevance_Account:
[self pushWebViewWIthUrl:item.centerUrl];
break;
case XPMineItemType_Foot_Print:
{
XPMineFootPrintViewController *vc = [[XPMineFootPrintViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
break;
case XPMineItemType_Account:
{
// XPMineRechargeViewController * rechargeVC
[self pushThirdPartyPayVC];
}
break;
case XPMineItemType_Personinfo:
{
XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init];
infoVC.uid = self.userInfo.uid;
[self.navigationController pushViewController:infoVC animated:YES];
}
break;
case XPMineItemType_My_Room:
{
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[XPRoomViewController openRoom:roomUid viewController:self];
}
break;
case XPMineItemType_Collect_Room://
{
XPMineCollectRoomListViewController *collectVC = [[XPMineCollectRoomListViewController alloc] init];
[self.navigationController pushViewController:collectVC animated:YES];
}
break;
case XPMineItemType_My_Dressup:
{
XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init];
[self.navigationController pushViewController:dressUpVC animated:YES];
}
break;
case XPMineItemType_DressUp_Market:
{
XPDressUpShopViewController *dressUpShopVc = [[XPDressUpShopViewController alloc] init];
[self.navigationController pushViewController:dressUpShopVc animated:YES];
}
break;
case XPMineItemType_Fans_List:
{
XPMineFansViewController * fansVC = [[XPMineFansViewController alloc] init];
fansVC.view.backgroundColor = [UIColor whiteColor];
[self.navigationController pushViewController:fansVC animated:YES];
}
break;
case XPMineItemType_Attention_List:
{
XPMineAttentionViewController * attentionVC = [[XPMineAttentionViewController alloc] init];
[self.navigationController pushViewController:attentionVC animated:YES];
}
break;
case XPMineItemType_Visitor:
{
self.headView.visitorUnReadCount = 0;
XPMineVisitorViewController *visitorVC = [[XPMineVisitorViewController alloc] init];
[self.navigationController pushViewController:visitorVC animated:YES];
}
break;
case XPMineItemType_Noble_Center:
{
XPNobleCenterViewController *nobleCenterVC = [[XPNobleCenterViewController alloc] init];
[self.navigationController pushViewController:nobleCenterVC animated:YES];
}
break;
case XPMineItemType_FansTeam: {
XPMineFansTeamViewController *fansTeamVc = [[XPMineFansTeamViewController alloc] init];
[self.navigationController pushViewController:fansTeamVc animated:YES];
}
break;
case XPMineItemType_My_Guild:
{
if (self.clanInfo.clan.elderUid.length > 0) {
XPMineClanViewController * clanVC = [[XPMineClanViewController alloc] init];
clanVC.uid = [NSString stringWithFormat:@"%ld", self.userInfo.uid];
[self.navigationController pushViewController:clanVC animated:YES];
} else if(self.clanInfo.hall.hallId.length > 0) {
XPMineGuildViewController * guildVC = [[XPMineGuildViewController alloc] init];
guildVC.ownerUid = self.clanInfo.hall.ownerUid;
guildVC.guildId = self.clanInfo.hall.hallId;
[self.navigationController pushViewController:guildVC animated:YES];
}
}
break;
default:
break;
}
}
- (void)pushWebViewWIthUrl:(NSString *)url {
XPWebViewController * webVC = [[XPWebViewController alloc] init];
webVC.url = url;
[self.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 3;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 2){
return self.functionArray.count;
}
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return 44;
}else if (indexPath.section == 1) {
return self.isHavePermission ? 134 : 99;
}
return 60;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
XPMineTheGuildCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineTheGuildCell class])];
cell.clanInfo = self.clanInfo;
return cell;
}else if (indexPath.section == 1) {
XPMinePersonalCenterCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])];
cell.isHaveGiveDiamond = self.isHavePermission;
@kWeakify(self)
cell.clickAction = ^(int type){
@kStrongify(self)
if (type == 0){
[self pushMyRoomVC];
} else if (type == 1){
[self pushEarningsRecordVC];
}else{
[self pushGiveDiamondVC];
}
};
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
XPMineListCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineListCell class])];
if (indexPath.row == 0 && self.functionArray.count > 1){
[cell setCornerWithIsTop:YES isBottom:NO];
}else if (indexPath.row == self.functionArray.count-1){
if(self.functionArray.count == 1){
[cell setCornerWithIsTop:YES isBottom:YES];
}else{
[cell setCornerWithIsTop:NO isBottom:YES];
}
}else{
[cell setCornerWithIsTop:NO isBottom:NO];
}
XPMineFuntionItemModel *model = self.functionArray[indexPath.row];
cell.itemModel = model;
return cell;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 16;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
UIView * view = [[UIView alloc] init];
view.backgroundColor = [UIColor clearColor];
return view;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0){
if( self.clanInfo.clan.elderUid > 0){
XPMineClanViewController * clanVC = [[XPMineClanViewController alloc] init];
clanVC.uid = self.clanInfo.clan.elderUid;
[self.navigationController pushViewController:clanVC animated:YES];
return;
}else {
if(self.clanInfo.hall.ownerUid > 0){
XPMineGuildViewController * hallVC = [[XPMineGuildViewController alloc] init];
hallVC.ownerUid = self.clanInfo.hall.ownerUid;
hallVC.guildId = self.clanInfo.hall.hallId;
[self.navigationController pushViewController:hallVC animated:YES];
return;
}
}
XPMineMainGuildListVC *gulidListVC = [XPMineMainGuildListVC new];
[self.navigationController pushViewController:gulidListVC animated:YES];
return;
}
if (indexPath.section != 2)return;
XPMineFuntionItemModel *item = self.functionArray[indexPath.row];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
[self pushViewControllerWithType:item.skipType functionItem:item];
}
///
-(void)pushGiveDiamondVC{
XPMineGiveDiamondVC *giveDiamondVC = [[XPMineGiveDiamondVC alloc]init];
giveDiamondVC.userInfo = self.userInfo;
[self.navigationController pushViewController:giveDiamondVC animated:YES];
}
///
-(void)pushThirdPartyPayVC{
2023-08-10 12:09:54 +08:00
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
2023-07-14 18:50:55 +08:00
}
///
-(void)pushEarningsRecordVC{
XPIncomeRecordVC *incomeRecordVC = [XPIncomeRecordVC new];
incomeRecordVC.clanInfo = self.clanInfo;
incomeRecordVC.userInfo = self.userInfo;
[self.navigationController pushViewController:incomeRecordVC animated:YES];
}
///
-(void)pushMyRoomVC{
if(self.isRefreshRoomInfo == YES)return;
self.isRefreshRoomInfo = YES;
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[XPRoomViewController openRoom:roomUid viewController:self];
}
#pragma mark - XPMineHeadViewDelegate
///
- (void)xPMineHeadView:(XPMineHeadView *)view didClickAvatar:(UserInfoModel *)info {
[self pushViewControllerWithType:XPMineItemType_Personinfo functionItem:nil];
}
///
- (void)xpMineHeadViewClickFans {
[self pushViewControllerWithType:XPMineItemType_Fans_List functionItem:nil];
}
///
- (void)xpMineHeadViewClickAttention {
[self pushViewControllerWithType:XPMineItemType_Attention_List functionItem:nil];
}
///
- (void)xpMineHeadViewClickSkillCard {
[self pushViewControllerWithType:XPMineItemType_Skill_Card functionItem:nil];
}
///
- (void)xpMineHeadViewClickAcount {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_click];
[self pushViewControllerWithType:XPMineItemType_Account functionItem:nil];
}
///
- (void)xPMineHeadViewCliekNobleCenter {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceMeClick];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_click];
[self pushViewControllerWithType:XPMineItemType_Noble_Center functionItem:nil];
}
#pragma mark - XPMineProtocol
///
- (void)onGetMineFuntionItemSuccess:(NSArray<XPMineFuntionItemModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
[self.functionArray removeAllObjects];
[self.functionArray addObjectsFromArray:items];
[self.functionArray enumerateObjectsUsingBlock:^(XPMineFuntionItemModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.skipType == XPMineItemType_CP || obj.skipType == XPMineItemType_My_Room) {
[self.functionArray removeObject:obj];
}
}];
NSMutableArray *array = [NSMutableArray array];
for (XPMineFuntionItemModel *item in self.functionArray) {
[array addObject:item.centerName];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_show eventAttributes:@{@"functionName" : trackName}];
dispatch_group_leave(group);
}
- (void)onGetMineFuntionItemFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///banner
- (void)onGetPersonalBannerListSuccess:(NSArray<HomeBannerInfoModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
[self.bannerArray removeAllObjects];
[self.bannerArray addObjectsFromArray:items];
dispatch_group_leave(group);
NSMutableArray *array = [NSMutableArray array];
for (HomeBannerInfoModel *item in self.bannerArray) {
[array addObject:item.bannerId];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_show eventAttributes:@{@"bannerId" : trackName}];
}
-(void)onGetPersonalBannerListFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
@synchronized (self.presenter) {
///401
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iosPhoneBind) {
return;
}
if (userInfo.nick == nil || userInfo.avatar == nil ) {
return;
}
if(self.isRequestData == YES){
return;
}
self.isRequestData = YES;
// group
dispatch_group_t group =dispatch_group_create();
//
dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getClanDetailInfoWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getUserWalletInfoWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getPersonItemListWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getMineBannerListWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getNobleInfoWithGroup:group];
});
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
self.isRequestData = NO;
self.userInfo = userInfo;
[self checkHaveGiveDiamondsPermission];
userInfo.idAtt = [self.headView creatNameplateIdLabelAttribute:userInfo];
[self.headView creatNameplateLevleAttribute:userInfo complete:^(NSMutableAttributedString *textAtt) {
userInfo.levelAtt = textAtt;
self.headView.userInfo = userInfo;
}];
[self.tableView reloadData];
});
}
}
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo WithGroup:(nonnull dispatch_group_t)group{
self.headView.walletInfo = balanceInfo;
dispatch_group_leave(group);
}
- (void)getUserWalletInfoFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///
- (void)getNobleCenterInfoSuccess:(NobleCenterModel *)model WithGroup:(nonnull dispatch_group_t)group {
self.headView.nobleInfo = model;
dispatch_group_leave(group);
}
-(void)getNobleCenterInfoFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///
- (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo WithGroup:(nonnull dispatch_group_t)group{
self.clanInfo = clanInfo;
dispatch_group_leave(group);
}
- (void)onGetClanDetailInfofailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
#pragma mark - XPMineHeadItemTableViewCellDelegate
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
[self pushViewControllerWithType:item.skipType functionItem:item];
}
#pragma mark - XPHomeBannerTableViewCellDelegate
///banner
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_click eventAttributes:@{@"bannerId" : info.bannerId}];
switch (info.skipType) {
case HomeBannerInfoSkipType_Room:
{
if (info.skipUri.length > 0) {
[XPRoomViewController openRoom:info.skipUri viewController:self];
}
}
break;
case HomeBannerInfoSkipType_Web:
{
XPWebViewController *vc = [[XPWebViewController alloc]init];
vc.url = info.skipUri;
[self.navigationController pushViewController:vc animated:YES];
}
break;
default:
break;
}
}
#pragma mark - NSNotification
- (void)onVisitorUnReadCountUpdate:(NSNotification *)noti {
XPMineVisitorUnReadModel *model = (XPMineVisitorUnReadModel *)noti.object;
self.headView.visitorUnReadCount = model.visitNum;
}
#pragma mark - Getters And Setters
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
2023-07-18 18:26:10 +08:00
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
2023-07-14 18:50:55 +08:00
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
[_tableView registerClass:[XPMineTheGuildCell class] forCellReuseIdentifier:NSStringFromClass([XPMineTheGuildCell class])];
[_tableView registerClass:[XPMinePersonalCenterCell class] forCellReuseIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])];
[_tableView registerClass:[XPMineListCell class] forCellReuseIdentifier:NSStringFromClass([XPMineListCell class])];
_tableView.backgroundColor = [UIColor clearColor];
}
return _tableView;
}
- (XPMineHeadView *)headView {
if (!_headView) {
CGFloat height = (KScreenWidth - 30 - 13) * 0.5 * 60 / 166;
_headView = [[XPMineHeadView alloc] initWithFrame:CGRectMake(0, 0,KScreenWidth , 146 + height + kStatusBarHeight)];
_headView.delegate = self;
}
return _headView;
}
- (UIView *)bgImageView {
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_head_bg"]];
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _bgImageView;
}
- (NSMutableArray<XPMineFuntionItemModel *> *)functionArray {
if (!_functionArray) {
_functionArray = [NSMutableArray array];
}
return _functionArray;
}
- (NSMutableArray<HomeBannerInfoModel *> *)bannerArray {
if (!_bannerArray) {
_bannerArray = [NSMutableArray array];
}
return _bannerArray;
}
-(UserInfoModel *)userInfo{
if(!_userInfo){
_userInfo = [UserInfoModel new];
_userInfo.uid = [[AccountInfoStorage instance].getUid integerValue];
}
return _userInfo;
}
@end