新增阿拉伯语公会跳转

This commit is contained in:
liyuhua
2024-05-17 19:11:20 +08:00
parent 4549bac2f3
commit 2af0717970
8 changed files with 88 additions and 50 deletions

View File

@@ -68,7 +68,7 @@
return; return;
} }
[Api getNewClanDetailInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) { [Api getNewClanDetailInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
ClanDetailInfoModel * clanDetailInfo = [ClanDetailInfoModel modelWithDictionary:data.data]; ClanDetailMainInfoModel * clanDetailInfo = [ ClanDetailMainInfoModel modelWithDictionary:data.data];
[[self getView] onGetClanDetailInfoSuccess:clanDetailInfo]; [[self getView] onGetClanDetailInfoSuccess:clanDetailInfo];
}fail:^(NSInteger code, NSString * _Nullable msg) { }fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]onGetClanDetailInfofail]; [[self getView]onGetClanDetailInfofail];

View File

@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
///获取VIP信息失败 ///获取VIP信息失败
- (void)getNobleCenterInfoFail; - (void)getNobleCenterInfoFail;
///获取家族信息成功 ///获取家族信息成功
- (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo ; - (void)onGetClanDetailInfoSuccess:(ClanDetailMainInfoModel *)clanInfo ;
///获取家族信息失败 ///获取家族信息失败
- (void)onGetClanDetailInfofail; - (void)onGetClanDetailInfofail;
///获取个人中心功能 ///获取个人中心功能

View File

@@ -10,7 +10,8 @@
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
@interface XPMineTheGuildCell : UITableViewCell @interface XPMineTheGuildCell : UITableViewCell
@property (nonatomic,strong) ClanDetailInfoModel *clanInfo; @property (nonatomic,strong) ClanDetailMainInfoModel *clanInfo;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -74,23 +74,35 @@
}]; }];
} }
-(void)setClanInfo:(ClanDetailInfoModel *)clanInfo{ -(void)setClanInfo:(ClanDetailMainInfoModel *)clanInfo{
_clanInfo = clanInfo; _clanInfo = clanInfo;
if(_clanInfo.hall.ownerUid > 0 || _clanInfo.clan.elderUid > 0){ if([_clanInfo.clanMode isEqualToString: @"clan_hall"]){
_titleView.text = YMLocalizedString(@"XPMineTheGuildCell0"); if(_clanInfo.clan.hall.ownerUid > 0 || _clanInfo.clan.clan.elderUid > 0){
_leftIconView.hidden = YES; _titleView.text = YMLocalizedString(@"XPMineTheGuildCell0");
_rightIconBtn.selected = YES; _leftIconView.hidden = YES;
_headIconView.hidden = NO; _rightIconBtn.selected = YES;
NSString *imageUrl = @""; _headIconView.hidden = NO;
if (_clanInfo.clan.elderUid > 0){ NSString *imageUrl = @"";
imageUrl = _clanInfo.clan.avatar; if (_clanInfo.clan.clan.elderUid > 0){
}else{ imageUrl = _clanInfo.clan.clan.avatar;
if(_clanInfo.hall.ownerUid > 0){ }else{
imageUrl = _clanInfo.hall.ownerAvatar; if(_clanInfo.clan.hall.ownerUid > 0){
} imageUrl = _clanInfo.clan.hall.ownerAvatar;
} }
_headIconView.imageUrl = imageUrl; }
} _headIconView.imageUrl = imageUrl;
}
return;
}
if(_clanInfo.family.familyId){
_titleView.text = YMLocalizedString(@"XPMineTheGuildCell0");
_leftIconView.hidden = YES;
_rightIconBtn.selected = YES;
_headIconView.hidden = NO;
_headIconView.imageUrl = _clanInfo.family.ownerAvatar;
}
} }
#pragma mark - #pragma mark -

View File

@@ -18,5 +18,14 @@ NS_ASSUME_NONNULL_BEGIN
///当前用户是否是公会超管 ///当前用户是否是公会超管
@property (nonatomic, assign) BOOL manageHall; @property (nonatomic, assign) BOOL manageHall;
@end @end
@interface ClanDetailMainInfoModel : PIBaseModel
///家族信息
@property (nonatomic,strong) ClanDetailInfoModel *clan;
@property(nonatomic,copy) NSString *clanMode;
@property(nonatomic,strong) ClanInfoModel *family;
@end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -10,3 +10,7 @@
@implementation ClanDetailInfoModel @implementation ClanDetailInfoModel
@end @end
@implementation ClanDetailMainInfoModel
@end

View File

@@ -28,7 +28,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *levelIcon; @property (nonatomic, copy) NSString *levelIcon;
///是否有开通会员兑换权限的功能 ///是否有开通会员兑换权限的功能
@property (nonatomic,assign) BOOL elderHasExchangeManagerAuth; @property (nonatomic,assign) BOOL elderHasExchangeManagerAuth;
@property(nonatomic,copy) NSString *myFamilyUrl;
@property(nonatomic,copy) NSString *familyListUrl;
@property(nonatomic,copy) NSString *familyId;
@property(nonatomic,copy) NSString *ownerAvatar;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -83,7 +83,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
/// ///
@property (nonatomic,strong) UserInfoModel *userInfo; @property (nonatomic,strong) UserInfoModel *userInfo;
/// ///
@property (nonatomic,strong) ClanDetailInfoModel *clanInfo; @property (nonatomic,strong) ClanDetailMainInfoModel *clanInfo;
/// ///
@property (nonatomic,strong) XPMineItemModel *guildItemModel; @property (nonatomic,strong) XPMineItemModel *guildItemModel;
/// ///
@@ -312,17 +312,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
break; break;
case XPMineItemType_My_Guild: case XPMineItemType_My_Guild:
{ {
if (self.clanInfo.clan.elderUid.length > 0) { [self clickHallAction];
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; break;
default: default:
@@ -414,23 +405,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
} }
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0){ if (indexPath.section == 0){
if( self.clanInfo.clan.elderUid > 0){ [self clickHallAction];
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; return;
} }
if (indexPath.section != 2)return; if (indexPath.section != 2)return;
@@ -438,6 +413,40 @@ UIKIT_EXTERN NSString *kRequestRicket;
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}]; [StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
[self pushViewControllerWithType:item.skipType functionItem:item]; [self pushViewControllerWithType:item.skipType functionItem:item];
} }
///
-(void)clickHallAction{
if(self.clanInfo == nil)return;
if([self.clanInfo.clanMode isEqualToString:@"clan_hall"]){
if( self.clanInfo.clan.clan.elderUid > 0){
XPMineClanViewController * clanVC = [[XPMineClanViewController alloc] init];
clanVC.uid = self.clanInfo.clan.clan.elderUid;
[self.navigationController pushViewController:clanVC animated:YES];
return;
}else {
if(self.clanInfo.clan.hall.ownerUid > 0){
XPMineGuildViewController * hallVC = [[XPMineGuildViewController alloc] init];
hallVC.ownerUid = self.clanInfo.clan.hall.ownerUid;
hallVC.guildId = self.clanInfo.clan.hall.hallId;
[self.navigationController pushViewController:hallVC animated:YES];
return;
}
}
XPMineMainGuildListVC *gulidListVC = [XPMineMainGuildListVC new];
[self.navigationController pushViewController:gulidListVC animated:YES];
return;
}
if([self.clanInfo.clanMode isEqualToString:@"family"]){
XPWebViewController *webViewVC = [XPWebViewController new];
NSString *url = self.clanInfo.family.familyId ? self.clanInfo.family.myFamilyUrl : self.clanInfo.family.familyListUrl;
if([url hasPrefix:@"/"]){
url = [url substringFromIndex:1];
}
webViewVC.url = url;
[self.navigationController pushViewController:webViewVC animated:YES];
}
}
/// ///
-(void)pushGiveDiamondVC{ -(void)pushGiveDiamondVC{
XPMineGiveDiamondVC *giveDiamondVC = [[XPMineGiveDiamondVC alloc]init]; XPMineGiveDiamondVC *giveDiamondVC = [[XPMineGiveDiamondVC alloc]init];
@@ -641,7 +650,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
} }
/// ///
- (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo { - (void)onGetClanDetailInfoSuccess:(ClanDetailMainInfoModel *)clanInfo {
self.clanInfo = clanInfo; self.clanInfo = clanInfo;
[self.tableView reloadData]; [self.tableView reloadData];
} }