100% 完成需求

This commit is contained in:
edwinQQQ
2024-12-18 17:12:03 +08:00
parent e82939f767
commit a0b2dea116
50 changed files with 1301 additions and 360 deletions

View File

@@ -498,6 +498,7 @@
23FF428E2AAB2D3A0055733C /* XPCandyTreeBuyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FF428D2AAB2D3A0055733C /* XPCandyTreeBuyView.m */; };
4C1892992CF84349004D4426 /* RoomCahtCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1892982CF84349004D4426 /* RoomCahtCell.m */; };
4C5C37232D0C1C7900BA9AB8 /* RegionListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5C37222D0C1C7900BA9AB8 /* RegionListViewController.m */; };
4C6C92C02D1172D9000A4693 /* RegionListInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */; };
4C6E1F752CEAEC3C0073D0A3 /* ShoppingMallTagView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F742CEAEC3C0073D0A3 /* ShoppingMallTagView.m */; };
4C6E1F792CEB12780073D0A3 /* UIView+GradientLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F782CEB12780073D0A3 /* UIView+GradientLayer.m */; };
4C6E1F7C2CEB25B10073D0A3 /* ShoppingMallItemPreview.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6E1F7B2CEB25B10073D0A3 /* ShoppingMallItemPreview.m */; };
@@ -2592,6 +2593,8 @@
4C1892982CF84349004D4426 /* RoomCahtCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomCahtCell.m; sourceTree = "<group>"; };
4C5C37212D0C1C7900BA9AB8 /* RegionListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegionListViewController.h; sourceTree = "<group>"; };
4C5C37222D0C1C7900BA9AB8 /* RegionListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RegionListViewController.m; sourceTree = "<group>"; };
4C6C92BE2D1172D9000A4693 /* RegionListInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegionListInfo.h; sourceTree = "<group>"; };
4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RegionListInfo.m; sourceTree = "<group>"; };
4C6E1F732CEAEC3C0073D0A3 /* ShoppingMallTagView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShoppingMallTagView.h; sourceTree = "<group>"; };
4C6E1F742CEAEC3C0073D0A3 /* ShoppingMallTagView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShoppingMallTagView.m; sourceTree = "<group>"; };
4C6E1F772CEB12780073D0A3 /* UIView+GradientLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+GradientLayer.h"; sourceTree = "<group>"; };
@@ -10705,6 +10708,8 @@
E81C27AA26EF2D920031E639 /* ThirdUserInfo.m */,
E818DD1D2A48974300F163F7 /* LoginAreaModel.h */,
E818DD1E2A48974300F163F7 /* LoginAreaModel.m */,
4C6C92BE2D1172D9000A4693 /* RegionListInfo.h */,
4C6C92BF2D1172D9000A4693 /* RegionListInfo.m */,
);
path = Model;
sourceTree = "<group>";
@@ -11778,6 +11783,7 @@
E8751E6328A646400056EF44 /* XPSailingRankView.m in Sources */,
23C9DFCC2B85DD8B00B51558 /* PIGuildAnchorIncomeSectionView.m in Sources */,
9BD9A18027A0EFC7004186FE /* XPMineVisitorTableViewCell.m in Sources */,
4C6C92C02D1172D9000A4693 /* RegionListInfo.m in Sources */,
233423D02AAEFBC300B1253F /* PICandyTreeSetModel.m in Sources */,
E85E7B112A4EB0D200B6D00A /* GuildPersonIncomeRecordModel.m in Sources */,
54283CEB2CE48B71009729B5 /* ShoppingMallCategoryListView.m in Sources */,

View File

@@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "usercard_invite_micro_normal@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "usercard_invite_micro_normal@3x.png",
"filename" : "切图 30@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -5,12 +5,11 @@
"scale" : "1x"
},
{
"filename" : "usercard_invite_micro_disable@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "usercard_invite_micro_disable@3x.png",
"filename" : "勾选@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -9,7 +9,7 @@
"scale" : "2x"
},
{
"filename" : "2@3x (3).png",
"filename" : "2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (1).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (3).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "组 8307@3x (2).png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -128,7 +128,7 @@
_headWearSvgaImageView = [[SVGAImageView alloc]init];
_headWearSvgaImageView.backgroundColor = [UIColor clearColor];
_headWearSvgaImageView.frame = self.bounds;
_headWearSvgaImageView.userInteractionEnabled = YES;
_headWearSvgaImageView.userInteractionEnabled = NO;
_headWearSvgaImageView.autoPlay = YES;
}
return _headWearSvgaImageView;

View File

@@ -0,0 +1,26 @@
//
// RegionListInfo.h
// YuMi
//
// Created by P on 2024/12/17.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface RegionListInfo : PIBaseModel
@property(nonatomic, assign) BOOL checked;
@property(nonatomic, copy) NSString *code;
@property(nonatomic, copy) NSString *icon;
@property(nonatomic, copy) NSString *id;
@property(nonatomic, copy) NSString *name;
@property(nonatomic, copy) NSString *partitionDesc;
@property(nonatomic, assign) NSInteger partitionId;
@property(nonatomic, copy) NSString *regionDesc;
@property(nonatomic, assign) NSInteger seq;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// RegionListInfo.m
// YuMi
//
// Created by P on 2024/12/17.
//
#import "RegionListInfo.h"
@implementation RegionListInfo
@end

View File

@@ -8,7 +8,7 @@
#import "BaseMvpPresenter.h"
NS_ASSUME_NONNULL_BEGIN
@class ThirdUserInfo;
@class ThirdUserInfo, RegionListInfo;
@interface LoginFullInfoPresenter : BaseMvpPresenter
/// 获取保存的第三方的数据模型
@@ -31,7 +31,10 @@ NS_ASSUME_NONNULL_BEGIN
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel;
shareChannel:(NSString * __nullable)shareChannel
regionId:(NSString *)regionId;
- (void)loadAllRegionInfo:(void(^)(NSArray <RegionListInfo *>*array))success failure:(void(^)(NSError *error))failure;
@end

View File

@@ -14,6 +14,7 @@
#import "AccountInfoStorage.h"
///Model
#import "ThirdUserInfo.h"
#import "RegionListInfo.h"
@implementation LoginFullInfoPresenter
@@ -52,7 +53,8 @@
inviteCode:(NSString * __nullable)inviteCode
roomUid:(NSString * __nullable)roomUid
shareUid:(NSString * __nullable)shareUid
shareChannel:(NSString * __nullable)shareChannel {
shareChannel:(NSString * __nullable)shareChannel
regionId:(NSString *)regionId{
NSString * uid = [[AccountInfoStorage instance] getUid];
NSString * ticket = [[AccountInfoStorage instance] getTicket];
NSMutableDictionary * params = [NSMutableDictionary dictionary];
@@ -61,6 +63,9 @@
[params safeSetObject:nick forKey:@"nick"];
[params safeSetObject:uid forKey:@"uid"];
[params safeSetObject:ticket forKey:@"ticket"];
if (regionId.length > 0) {
[params safeSetObject:regionId forKey:@"regionId"];
}
if (inviteCode.length > 0) {
[params safeSetObject:inviteCode forKey:@"inviteCode"];
}
@@ -83,4 +88,19 @@
} errorToast:YES] userInfo:params];
}
- (void)loadAllRegionInfo:(void(^)(NSArray <RegionListInfo *>*array))success failure:(void(^)(NSError *error))failure {
[Api requestAllRegionInfoCompletion:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
if (data.code == 200) {
NSArray *array = [RegionListInfo modelsWithArray:data.data];
if (success) {
success(array);
}
}
} fail:^(NSInteger code, NSString * _Nullable msg) {
if (failure) {
failure([NSError errorWithDomain:msg code:code userInfo:nil]);
}
} showLoading:YES errorToast:YES]];
}
@end

View File

@@ -28,6 +28,8 @@
#import "RegionListViewController.h"
#import "RegionListInfo.h"
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol, UIViewControllerTransitioningDelegate>
///
@@ -73,6 +75,9 @@
///
@property (nonatomic,copy) NSString *sexString;
@property(nonatomic, copy) NSArray <RegionListInfo *> *regionInfoList;
@property(nonatomic, strong) RegionListInfo *selectedRegion;
@end
@implementation LoginFullInfoViewController
@@ -90,6 +95,7 @@
[self initSubViews];
[self initSubViewConstraints];
[self initEvents];
[self loadAllRegions];
ClientConfig *config = [ClientConfig shareConfig];
if (config.inviteCode.length > 0){
self.inviteCode = config.inviteCode;
@@ -101,6 +107,16 @@
[self.view endEditing:YES];
}
- (void)loadAllRegions {
@kWeakify(self);
[self.presenter loadAllRegionInfo:^(NSArray<RegionListInfo *> * _Nonnull array) {
@kStrongify(self);
self.regionInfoList = array;
} failure:^(NSError * _Nonnull error) {
}];
}
#pragma mark - Private Method
- (void)initSubViews {
self.view.backgroundColor = [UIColor whiteColor];
@@ -131,11 +147,16 @@
self.regionFlagImageView,
self.regionLabel
]];
regionStack.spacing = 4;
[self.regionContainView addSubview:regionStack];
[regionStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(24));
make.centerY.mas_equalTo(self.regionContainView);
}];
[self.regionFlagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(0, 18));
}];
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].userName.length > 0) {
self.textField.text = [self.presenter getThirdUserInfo].userName;
@@ -148,7 +169,7 @@
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.equalTo(self.view);
make.height.mas_equalTo(kGetScaleWidth(418));
make.height.mas_equalTo(kGetScaleWidth(140));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -252,22 +273,57 @@
}
- (void)didTapRegionButton {
// TODO: display list
RegionListViewController *vc = [[RegionListViewController alloc] initForHomeTags];
__block RegionListViewController *vc;
if (self.regionInfoList.count == 0) {
@kWeakify(self);
[self.presenter loadAllRegionInfo:^(NSArray<RegionListInfo *> * _Nonnull array) {
@kStrongify(self);
self.regionInfoList = array;
vc = [[RegionListViewController alloc] initForRegionList:array];
[self presentViewController:vc animated:YES completion:nil];
@kWeakify(self);
[vc setHandleTapRegionComfirm:^(RegionListInfo * _Nonnull regionInfo) {
@kStrongify(self);
[self updateRegion:regionInfo];
}];
} failure:^(NSError * _Nonnull error) {
}];
} else {
vc = [[RegionListViewController alloc] initForRegionList:self.regionInfoList];
[self presentViewController:vc animated:YES completion:nil];
@kWeakify(self);
[vc setHandleTapRegionComfirm:^(RegionListInfo * _Nonnull regionInfo) {
@kStrongify(self);
[self updateRegion:regionInfo];
}];
}
}
- (void)updateRegion:(RegionListInfo *)model {
self.selectedRegion = model;
self.regionLabel.text = model.name;
self.regionFlagImageView.imageUrl = model.icon;
self.regionLabel.textColor = UIColorFromRGB(0x313131);
// vc.modalPresentationStyle = UIModalPresentationPageSheet; // UIModalPresentationCustom
// vc.preferredContentSize = CGSizeMake(self.view.bounds.size.width, 100); // 300
[self.regionFlagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 18));
}];
[self.regionContainView layoutIfNeeded];
// vc.modalPresentationStyle = UIModalPresentationCustom;
// vc.transitioningDelegate = self; //
// [self.navigationController pushViewController:vc animated:YES];
[self presentViewController:vc animated:YES completion:nil];
[self updateNextButton];
}
///
- (void)updateUserInfo {
[XNDJTDDLoadingTool showOnlyView:self.view];
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text inviteCode:self.codeTextField.text roomUid:nil shareUid:nil shareChannel:nil];
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl]
gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text
inviteCode:self.codeTextField.text
roomUid:nil
shareUid:nil
shareChannel:nil
regionId:self.selectedRegion.id];
}
///
@@ -282,34 +338,13 @@
}
- (void)updateNextButton {
if (self.textField.text.length > 0 && self.sexString.length > 0) {
if (self.textField.text.length > 0 && self.sexString.length > 0 && self.selectedRegion) {
self.nextButton.enabled = YES;
} else {
self.nextButton.enabled = NO;
}
}
#pragma mark - UIViewControllerTransitioningDelegate
//
//- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented
// presentingViewController:(UIViewController *)presenting
// sourceViewController:(UIViewController *)source {
// CustomPresentationController *customPresentationController =
// [[CustomPresentationController alloc] initWithPresentedViewController:presented
// presentingViewController:presenting];
// customPresentationController.preferredHeight = 400; //
// return customPresentationController;
//}
//
//- (CGSize)sizeForChildContentContainer:(id<UIContentContainer>)container withParentContainerSize:(CGSize)parentSize {
// return CGSizeMake(parentSize.width, 300); // 300
//}
//
//- (CGRect)frameOfPresentedViewInContainerView {
// CGRect containerBounds = self.presentingViewController.view.bounds;
// return CGRectMake(0, containerBounds.size.height - 300, containerBounds.size.width, 300); // 300
//}
#pragma mark - LoginFullInfoProtocol
- (void)requestRandomNickSuccess:(NSString *)nick {
self.textField.text = nick;
@@ -375,8 +410,8 @@
- (UIImageView *)bgImageView{
if(!_bgImageView){
_bgImageView = [[UIImageView alloc]init];
_bgImageView.image = kImage(@"login_phone_pwd_bg");
_bgImageView.contentMode = 2;
_bgImageView.image = kImage(@"home_top_bg");
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _bgImageView;
}
@@ -558,7 +593,8 @@
_regionContainView.backgroundColor = UIColorFromRGB(0xF5F6FA);
[_regionContainView setCornerRadius:kGetScaleWidth(52)/2];
UIImageView *arrow = [[UIImageView alloc] initWithImage:kImage(@"room_setting_arrow")];
UIImageView *arrow = [[UIImageView alloc] initWithImage:kImage(@"grey_arrow")];
// arrow.layer.contentsRect = CGRectMake(0.1, 0.1, 0.8, 0.8);
arrow.contentMode = UIViewContentModeScaleAspectFit;
[_regionContainView addSubview:arrow];
[arrow mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -6,16 +6,17 @@
//
#import "MvpViewController.h"
@class PIHomeCategoryTitleModel, RegionListInfo;
NS_ASSUME_NONNULL_BEGIN
@interface RegionListViewController : MvpViewController
@property(nonatomic, copy) void(^handleDismiss)(void);
@property(nonatomic, copy) void(^handleTapComfirm)(id obj);
@property(nonatomic, copy) void(^handleTapCategiryComfirm)(PIHomeCategoryTitleModel *tagModel);
@property(nonatomic, copy) void(^handleTapRegionComfirm)(RegionListInfo *regionInfo);
- (instancetype)initForRegionList;
- (instancetype)initForHomeTags;
- (instancetype)initForRegionList:(NSArray <RegionListInfo *>*)regionInfoList;
- (instancetype)initForHomeTags:(NSArray <PIHomeCategoryTitleModel*>*)tags currentItem:(PIHomeCategoryTitleModel *)itemModel;
@end

View File

@@ -7,8 +7,17 @@
#import "RegionListViewController.h"
#import "PIHomeCategoryTitleModel.h"
#import "LoginFullInfoPresenter.h"
#import "RegionListInfo.h"
@interface RegionListCell : UICollectionViewCell
@property(nonatomic, strong) UIStackView *contentStack;
@property(nonatomic, strong) RegionListInfo *regionModel;
@property(nonatomic, strong) PIHomeCategoryTitleModel *tagModel;
@property(nonatomic, strong) UIView *selectedBG;
@property(nonatomic, strong) UIImageView *selectedMark;
@property(nonatomic, strong) NetImageView *flagImageView;
@property(nonatomic, strong) UILabel *titleLabel;
@@ -26,46 +35,96 @@
indexPath:(NSIndexPath *)indexPath {
RegionListCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([self class])
forIndexPath:indexPath];
cell.backgroundColor = [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:1];
// [cell.contentView setBackgroundColor:UIColorFromRGB(0xF7F7F7)];
// [cell setCornerRadius:19];
return cell;
}
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
[self.contentView addSubview:self.contentStack];
[self.contentStack mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
make.height.mas_equalTo(18);
}];
[self.contentView addSubview:self.flagImageView];
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.selectedMark];
[self.flagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(24, 18));
make.leading.mas_equalTo(14);
make.centerY.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(30, 22));
}];
#if DEBUG
self.flagImageView.imageUrl = @"https://cdn3.iconfinder.com/data/icons/142-mini-country-flags-16x16px/32/flag-usa2x.png";
self.titleLabel.text = @"Make UAS great again!";
#endif
[self.selectedMark mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-14);
make.centerY.mas_equalTo(self.contentView);
make.size.mas_equalTo(CGSizeMake(20, 20));
}];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.flagImageView.mas_trailing).offset(6);
make.trailing.mas_equalTo(self.selectedMark.mas_leading).offset(-6);
make.centerY.mas_equalTo(self.contentView);
make.height.mas_equalTo(20);
}];
UIView *line = [[UIView alloc] init];
line.backgroundColor = UIColorFromRGB(0xe4e4e4);
[self.contentView addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(self.contentView);
make.trailing.mas_equalTo(self.selectedMark);
make.leading.mas_equalTo(self.flagImageView);
make.height.mas_equalTo(1);
}];
// [self.contentView addSubview:self.selectedBG];
// [self.selectedBG mas_makeConstraints:^(MASConstraintMaker *make) {
// make.edges.mas_equalTo(self.contentView);
// }];
}
return self;
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
// self.selectedBG.hidden = !selected;
self.selectedMark.hidden = !selected;
// if (selected) {
// [self.contentView setBackgroundColor:UIColorFromRGB(0xFFFAF5)];
// } else {
// [self.contentView setBackgroundColor:UIColorFromRGB(0xF7F7F7)];
// }
}
- (void)prepareForReuse {
[super prepareForReuse];
self.flagImageView.image = nil;
}
- (void)setTagModel:(PIHomeCategoryTitleModel *)tagModel {
_tagModel = tagModel;
self.flagImageView.imageUrl = tagModel.icon;
self.titleLabel.text = tagModel.name;
}
- (void)setRegionModel:(RegionListInfo *)regionModel {
_regionModel = regionModel;
self.flagImageView.imageUrl = regionModel.icon;
self.titleLabel.text = regionModel.name;
}
#pragma mark -
- (UIStackView *)contentStack {
if (!_contentStack) {
_contentStack = [[UIStackView alloc] initWithArrangedSubviews:@[
self.flagImageView,
self.titleLabel
]];
_contentStack.axis = UILayoutConstraintAxisHorizontal;
_contentStack.distribution = UIStackViewDistributionEqualCentering;
_contentStack.alignment = UIStackViewAlignmentCenter;
- (UIView *)selectedBG {
if (!_selectedBG) {
_selectedBG = [[UIView alloc] init];
[_selectedBG setCornerRadius:19
corners:kCALayerMaxXMaxYCorner | kCALayerMaxXMinYCorner | kCALayerMinXMaxYCorner | kCALayerMinXMinYCorner
borderWidth:1
borderColor:UIColorFromRGB(0xFF8C03)];
_selectedBG.hidden = YES;
}
return _contentStack;
return _selectedBG;
}
- (NetImageView *)flagImageView {
@@ -78,13 +137,20 @@
- (UILabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [UILabel labelInitWithText:@"" font:kFontMedium(13) textColor:UIColorFromRGB(0x313131)];
_titleLabel = [UILabel labelInitWithText:@"" font:kFontMedium(15) textColor:UIColorFromRGB(0x313131)];
}
return _titleLabel;
}
@end
- (UIImageView *)selectedMark {
if (!_selectedMark) {
_selectedMark = [[UIImageView alloc] initWithImage:kImage(@"region_list_selected")];
_selectedMark.hidden = YES;
}
return _selectedMark;
}
@end
@interface RegionListViewController () <UISearchBarDelegate, UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@@ -95,23 +161,58 @@
@property(nonatomic, strong) UICollectionView *collectionView;
@property(nonatomic, strong) UIButton *comfirmButton;
@property(nonatomic, strong) UIView *bgView;
@property(nonatomic, strong) UIView *emptyView;
@property(nonatomic, copy) NSArray <PIHomeCategoryTitleModel*> *tagDataSource;
@property(nonatomic, strong) PIHomeCategoryTitleModel *selectedTag;
@property(nonatomic, copy) NSArray <RegionListInfo *> *regionList;
@property(nonatomic, strong) NSMutableArray <RegionListInfo *> *filteredRegionList;
@property(nonatomic, strong) RegionListInfo *selectedRegion;
@property(nonatomic, assign) NSInteger defaultIndex;
@end
@implementation RegionListViewController
- (instancetype)initForRegionList {
- (LoginFullInfoPresenter *)createPresenter {
return [[LoginFullInfoPresenter alloc] init];
}
- (instancetype)initForRegionList:(NSArray <RegionListInfo *>*)regionInfoList {
if (self = [super init]) {
self.type = 1;
self.displayHeight = KScreenHeight;
self.displayHeight = KScreenHeight/2;
self.regionList = regionInfoList;
self.filteredRegionList = [regionInfoList mutableCopy];
[self.collectionView reloadData];
}
return self;
}
- (instancetype)initForHomeTags{
- (instancetype)initForHomeTags:(NSArray <PIHomeCategoryTitleModel*>*)tags
currentItem:(nonnull PIHomeCategoryTitleModel *)itemModel {
if (self = [super init]) {
self.type = 2;
// self.modalPresentationStyle = UIModalPresentationFullScreen;
self.displayHeight = KScreenHeight/2;
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
self.displayHeight = KScreenHeight*2/3;
NSMutableArray *temp = @[].mutableCopy;
for (PIHomeCategoryTitleModel *model in tags) {
if (![NSString isEmpty:model.regionId]) {
[temp addObject:model];
}
}
self.defaultIndex = [temp indexOfObject:itemModel];
self.selectedTag = itemModel;
self.tagDataSource = temp;
[self.collectionView reloadData];
[self.collectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:self.defaultIndex inSection:0]
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
}
return self;
}
@@ -133,15 +234,28 @@
}
- (void)setupUIForFullDisplay {
self.view.backgroundColor = [UIColor clearColor];
self.view.backgroundColor = [UIColor whiteColor];
self.comfirmButton.frame = CGRectMake(0, 0, 48, 44);
UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.comfirmButton];
self.navigationItem.rightBarButtonItem = rightBarButtonItem;
// self.comfirmButton.frame = CGRectMake(0, 0, 48, 44);
// UIBarButtonItem *rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.comfirmButton];
// self.navigationItem.rightBarButtonItem = rightBarButtonItem;
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(10);
make.centerX.mas_equalTo(self.view);
make.height.mas_equalTo(34);
}];
[self.view addSubview:self.comfirmButton];
[self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.trailing.mas_equalTo(-15);
}];
[self.view addSubview:self.searchBar];
[self.searchBar mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(KScreenHeight - self.displayHeight);
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(10);
make.leading.trailing.mas_equalTo(self.view).inset(16);
make.height.mas_equalTo(34);
}];
@@ -151,14 +265,18 @@
make.top.mas_equalTo(self.searchBar.mas_bottom).offset(8);
make.bottom.leading.trailing.mas_equalTo(0);
}];
[self.view addSubview:self.emptyView];
[self.emptyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.collectionView).offset(8);
make.centerX.mas_equalTo(self.collectionView);
make.size.mas_equalTo(CGSizeMake(120, 120));
}];
}
- (void)setupUIForHalfScreen {
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapSpace)];
[self.view addGestureRecognizer:tap];
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(KScreenHeight - self.displayHeight);
@@ -169,7 +287,7 @@
[self.view addSubview:self.comfirmButton];
[self.comfirmButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.titleLabel);
make.trailing.mas_equalTo(-8);
make.trailing.mas_equalTo(-15);
}];
[self.view addSubview:self.collectionView];
@@ -180,28 +298,31 @@
[self.view insertSubview:self.bgView belowSubview:self.titleLabel];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(KScreenHeight - self.displayHeight -40);
make.top.mas_equalTo(self.titleLabel).offset(-10);
make.leading.bottom.trailing.mas_equalTo(self.view);
}];
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
[b addTarget:self action:@selector(didTapSpace) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:b atIndex:0];
[b mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.leading.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(KScreenHeight/2);
}];
}
- (void)didTapComfirm {
// TODO: call api or call handleTapComfirm
switch (self.type) {
case 1:
[self dismissViewControllerAnimated:YES completion:nil];
break;
case 2:{
[self dismissViewControllerAnimated:YES completion:^{
if (self.handleTapComfirm) {
self.handleTapComfirm(@"");
}
}];
if (self.type == 1) {
if (self.handleTapRegionComfirm) {
self.handleTapRegionComfirm(self.selectedRegion);
}
} else if (self.type == 2) {
if (self.handleTapCategiryComfirm) {
self.handleTapCategiryComfirm(self.selectedTag);
}
break;
default:
break;
}
[self dismissViewControllerAnimated:YES completion:^{}];
}
- (void)didTapSpace {
@@ -214,31 +335,63 @@
}];
}
#pragma mark - UISearchBarDelegate
// "Search"
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder]; //
NSLog(@"User searched for: %@", searchBar.text);
}
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText {
if (searchText.length == 0) {
//
self.filteredRegionList = [self.regionList copy];
} else {
//
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name CONTAINS[cd] %@", searchText];
self.filteredRegionList = [[self.regionList filteredArrayUsingPredicate:predicate] mutableCopy];
}
[self.collectionView reloadData];
// API
// [self fetchSearchResultsForQuery:searchBar.text];
self.emptyView.hidden = self.filteredRegionList.count > 0;
}
//
- (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
[searchBar resignFirstResponder];
searchBar.text = @"";
self.filteredRegionList = [self.regionList mutableCopy];
[self.collectionView reloadData];
}
#pragma mark -
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
// TODO: 使 api
return 100;
if (self.type == 1) {
return self.filteredRegionList.count;
} else if (self.type == 2) {
return self.tagDataSource.count;
}
return 0;
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
RegionListCell *cell = [RegionListCell cellFor:collectionView indexPath:indexPath];
if (self.type == 1) {
cell.regionModel = [self.filteredRegionList xpSafeObjectAtIndex:indexPath.row];
} else if (self.type == 2) {
cell.tagModel = [self.tagDataSource xpSafeObjectAtIndex:indexPath.row];
}
return cell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
if (self.type == 1) {
self.selectedRegion = [self.filteredRegionList xpSafeObjectAtIndex:indexPath.row];
} else if (self.type == 2) {
self.selectedTag = [self.tagDataSource xpSafeObjectAtIndex:indexPath.row];
if (self.handleTapCategiryComfirm) {
self.handleTapCategiryComfirm(self.selectedTag);
}
}
}
#pragma mark -
@@ -265,10 +418,15 @@
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.itemSize = CGSizeMake(KScreenWidth - 32, 48);
// if (self.type == 1) {
layout.itemSize = CGSizeMake(KScreenWidth - 30, 38);
// } else if (self.type == 2) {
// layout.itemSize = CGSizeMake(kGetScaleWidth(166), 38);
// }
layout.sectionInset = UIEdgeInsetsMake(0, 16, kSafeAreaBottomHeight, 16);
layout.minimumLineSpacing = 0;
layout.minimumInteritemSpacing = 0;
layout.minimumLineSpacing = 10;
layout.minimumInteritemSpacing = 10;
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 44, KScreenWidth, KScreenHeight-44)
collectionViewLayout:layout];
_collectionView.delegate = self;
@@ -321,4 +479,30 @@
}
return _bgView;
}
- (UIView *)emptyView {
if (!_emptyView) {
_emptyView = [[UIView alloc] init];
UIImageView *icon = [[UIImageView alloc] initWithImage:[UIImageConstant defaultEmptyPlaceholder_UFO]];
[_emptyView addSubview:icon];
[icon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.centerX.mas_equalTo(_emptyView);
make.size.mas_equalTo(CGSizeMake(80, 80));
}];
UILabel *emptyTitle = [UILabel labelInitWithText:YMLocalizedString(@"XPMomentsRecommendViewController0")
font:kFontRegular(14)
textColor:[UIColor colorWithWhite:0 alpha:0.4]];
emptyTitle.textAlignment = NSTextAlignmentCenter;
[_emptyView addSubview:emptyTitle];
[emptyTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(_emptyView);
make.top.mas_equalTo(icon.mas_bottom).offset(6);
make.height.mas_equalTo(22);
}];
_emptyView.hidden = YES;
}
return _emptyView;
}
@end

View File

@@ -144,6 +144,7 @@ HWDMP4PlayDelegate>
@property (nonatomic,strong) NetImageView *rechargeImageView;
///
@property (nonatomic,strong) NetImageView *vipPlateImageView;
@property (nonatomic,strong) NetImageView *agentPlateImageView;
///
@property (nonatomic,strong) UIImageView *newUserImageView;
///
@@ -426,6 +427,7 @@ HWDMP4PlayDelegate>
[stack addArrangedSubview:self.experImageView];
[stack addArrangedSubview:self.charmImageView];
[stack addArrangedSubview:self.vipPlateImageView];
[stack addArrangedSubview:self.agentPlateImageView];
[self.beautIDView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
@@ -452,6 +454,10 @@ HWDMP4PlayDelegate>
make.height.mas_equalTo(24);
make.width.mas_equalTo(60);
}];
[self.agentPlateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(24);
make.width.mas_equalTo(60);
}];
}
- (void)setupNameplateArea {
@@ -734,11 +740,18 @@ HWDMP4PlayDelegate>
}
self.charmImageView.hidden = userInfo.userLevelVo.charmUrl.length <= 0;
if (userInfo.userVipInfoVO.nameplateUrl.length > 0) {
[self loadNamePlate:userInfo.userVipInfoVO.nameplateUrl];
[self loadNamePlate:userInfo.userVipInfoVO.nameplateUrl targetView:self.vipPlateImageView];
self.vipPlateImageView.hidden = NO;
} else {
self.vipPlateImageView.hidden = YES;
}
if (userInfo.guildNameplateIcon.length > 0) {
[self loadNamePlate:userInfo.guildNameplateIcon targetView:self.agentPlateImageView];
self.agentPlateImageView.hidden = NO;
} else {
self.agentPlateImageView.hidden = YES;
}
self.rechargeImageView.hidden = !_userInfo.isRechargeUser;
[self.userPhotoArray removeAllObjects];
@@ -781,14 +794,14 @@ HWDMP4PlayDelegate>
}
}
- (void)loadNamePlate:(NSString *)imagePath {
[self.vipPlateImageView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
- (void)loadNamePlate:(NSString *)imagePath targetView:(NetImageView *)targetView {
[targetView loadImageWithUrl:imagePath completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
if (image) {
CGSize size = image.size;
[self.vipPlateImageView mas_updateConstraints:^(MASConstraintMaker *make) {
[targetView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(round(size.width * 24/size.height));
}];
self.vipPlateImageView.image = image;
targetView.image = image;
}
}];
}
@@ -1181,6 +1194,20 @@ HWDMP4PlayDelegate>
return _vipPlateImageView;
}
- (NetImageView *)agentPlateImageView {
if (!_agentPlateImageView) {
NetImageConfig * config = [[NetImageConfig alloc] init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserCardLevel;
_agentPlateImageView = [[NetImageView alloc] initWithConfig:config];
_agentPlateImageView.userInteractionEnabled = YES;
_agentPlateImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _agentPlateImageView;
}
- (UIImageView *)newUserImageView {
if (!_newUserImageView) {
_newUserImageView = [[UIImageView alloc] init];

View File

@@ -16,6 +16,8 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,copy) NSString *name;
@property(nonatomic,copy) NSString *id;
@property(nonatomic,assign) BOOL isHomeRecommend;
@property(nonatomic, copy) NSString *icon;
@property(nonatomic, copy) NSString *regionId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -91,6 +91,11 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
return self;
}
- (void)setCellModel:(PIHomeCategoryTitleModel *)cellModel {
_cellModel = cellModel;
self.iconImageView.imageUrl = cellModel.icon;
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
self.selectedBackground.hidden = !selected;
@@ -124,12 +129,14 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@interface HomeCategoryTabList : UIView <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@property(nonatomic, strong) UIButton *arrowButton;
@property(nonatomic, strong) UIView *gradientMask;
@property(nonatomic, strong) UICollectionView *tabCollectionView;
@property(nonatomic, copy) NSArray <PIHomeCategoryTitleModel*> *tabArray;
@property(nonatomic, copy) void(^didTapCategoryModel)(PIHomeCategoryTitleModel *model);
@property(nonatomic, copy) void(^didTapArrow)(void);
- (void)closeArrow;
- (void)updateIndex:(NSInteger)index;
@end
@@ -137,7 +144,15 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
- (instancetype)init {
if (self = [super init]) {
self.backgroundColor = [[ClientConfig shareConfig] bgColor];;
self.backgroundColor = [[ClientConfig shareConfig] bgColor];
[self addSubview:self.tabCollectionView];
[self.tabCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.mas_equalTo(self);
make.leading.mas_equalTo(0);
make.trailing.mas_equalTo(self).offset(-15);
}];
[self addSubview:self.arrowButton];
[self.arrowButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
@@ -145,12 +160,18 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
make.trailing.mas_equalTo(-15);
}];
[self addSubview:self.tabCollectionView];
[self.tabCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
_gradientMask = [[UIView alloc] init];
[_gradientMask addGradientBackgroundWithColors:@[
UIColorRGBAlpha(0xffffff, 0),
[[ClientConfig shareConfig] bgColor],
] startPoint:CGPointMake(0, 0.5) endPoint:CGPointMake(0.3, 0.5) cornerRadius:0];
[self insertSubview:self.gradientMask belowSubview:self.arrowButton];
[self.gradientMask mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.arrowButton);
make.top.bottom.mas_equalTo(self);
make.leading.mas_equalTo(0);
make.trailing.mas_equalTo(self.arrowButton.mas_leading);
make.width.mas_equalTo(30);
}];
}
return self;
}
@@ -162,9 +183,23 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}
- (void)setTabArray:(NSArray<PIHomeCategoryTitleModel *> *)tabArray {
// NSMutableArray *temp = @[].mutableCopy;
// for (PIHomeCategoryTitleModel *model in tabArray) {
// if (![NSString isEmpty:model.regionId]) {
// [temp addObject:model];
// }
// }
_tabArray = tabArray;
if (46 * _tabArray.count + 12 * (_tabArray.count-1) > KScreenWidth-30) {
self.gradientMask.hidden = NO;
self.arrowButton.hidden = NO;
} else {
self.gradientMask.hidden = YES;
self.arrowButton.hidden = YES;
}
[self.tabCollectionView reloadData];
if (tabArray.count > 0) {
if (_tabArray.count > 0) {
[self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]
animated:NO
scrollPosition:UICollectionViewScrollPositionNone];
@@ -175,6 +210,11 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
}
- (void)updateIndex:(NSInteger)index {
[self.tabCollectionView selectItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] animated:YES scrollPosition:UICollectionViewScrollPositionNone];
// [self.tabCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:YES];
}
#pragma mark -
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.tabArray.count;
@@ -197,7 +237,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
- (UIButton *)arrowButton {
if (!_arrowButton) {
_arrowButton = [UIButton buttonWithType:UIButtonTypeCustom];
_arrowButton.backgroundColor = [UIColor yellowColor];
_arrowButton.backgroundColor = [UIColor clearColor];
[_arrowButton setImage:kImage(@"common_down_arrow")
forState:UIControlStateNormal];
[_arrowButton addTarget:self
@@ -213,7 +253,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
layout.itemSize = CGSizeMake(46, 30);
layout.minimumLineSpacing = 12;
layout.minimumInteritemSpacing = 12;
layout.sectionInset = UIEdgeInsetsMake(0, 14, 0, 0);
layout.sectionInset = UIEdgeInsetsMake(0, 14, 0, 30);
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
_tabCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
@@ -442,14 +482,18 @@ XPHomeRecommendViewControllerDelegate>
}
- (void)showAllTags {
RegionListViewController *vc = [[RegionListViewController alloc] initForHomeTags];
RegionListViewController *vc = [[RegionListViewController alloc] initForHomeTags:self.tagModelList
currentItem:self.tagModelList[self.titleView.selectedIndex]];
@kWeakify(self);
vc.handleDismiss = ^{
@kStrongify(self);
[self.categoryTagList closeArrow];
};
vc.handleTapComfirm = ^(id _Nonnull obj) {
vc.handleTapCategiryComfirm = ^(PIHomeCategoryTitleModel *tagModel) {
@kStrongify(self);
NSInteger index = [self.tagModelList indexOfObject:tagModel];
[self.titleView selectItemAtIndex:index];
[self.categoryTagList updateIndex:index];
};
[self presentViewController:vc animated:YES completion:^{ }];
}

View File

@@ -70,6 +70,7 @@
#import "XPAnchorPKFinishView.h"
#import "XPSendGiftView.h"
#import "XPUserCardViewController.h"
#import "UserRoomCardViewController.h"
#import "XPRoomViewController.h"
#import "AcrossRoomPKPrizeModel.h"
#import "XPMineUserInfoViewController.h"
@@ -1139,8 +1140,10 @@
model.roomInfo = roomInfo;
model.micQueue = self.delegate.getMicroQueue;
model.superMangerList = self.delegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.delegate.getCurrentNav presentViewController:userCardVC animated:NO completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.delegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
}
#pragma mark - XPAnchorPkPanelViewDelegate

View File

@@ -45,7 +45,6 @@
#import "TreasureFailryMessageModel.h"
#import "NetImageView.h"
#import "XPUserCardViewController.h"
#import "XPRoomTopicAlertView.h"
#import "XPRoomSendTextView.h"
#import "XPRoomPKResultView.h"
@@ -56,6 +55,7 @@
#import "QEmotionHelper.h"
#import "BoomInfoModel.h"
#import "UserRoomCardViewController.h"
@implementation XPRoomMessageParser
@@ -1349,8 +1349,9 @@
model.roomInfo = roomInfo;
model.delegate = self.hostDelegate;
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:vc animated:YES completion:nil];
}
#pragma mark - private base methods

View File

@@ -21,10 +21,6 @@
@property (nonatomic,strong) UILabel *nickLabel;
///
@property (nonatomic,strong) NetImageView *tagImageView;
///🔥
@property (nonatomic,strong) UIImageView *hotImageView;
///线
@property (nonatomic,strong) UILabel *numberLabel;
@end
@@ -45,8 +41,6 @@
[self addSubview:self.avatarImageView];
[self addSubview:self.nickLabel];
[self addSubview:self.tagImageView];
[self addSubview:self.hotImageView];
[self addSubview:self.numberLabel];
}
- (void)initSubViewConstraints {
@@ -63,20 +57,9 @@
}];
[self.tagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.nickLabel);
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(12);
make.width.mas_equalTo(43);
make.height.mas_equalTo(18);
make.top.mas_equalTo(self.nickLabel.mas_bottom).mas_offset(12);
}];
[self.hotImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.tagImageView.mas_trailing).mas_offset(12);
make.width.height.mas_equalTo(13);
make.centerY.mas_equalTo(self.tagImageView);
}];
[self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.hotImageView.mas_trailing).mas_offset(3);
make.centerY.mas_equalTo(self.tagImageView);
make.trailing.mas_equalTo(0);
make.height.mas_equalTo(12);
}];
}
#pragma mark - Getters And Setters
@@ -84,8 +67,20 @@
_model = model;
self.avatarImageView.imageUrl = model.avatar;
self.nickLabel.text = model.title;
self.tagImageView.imageUrl = model.tagPict;
self.numberLabel.text = [NSString stringWithFormat:@"%ld", model.onlineNum];
self.tagImageView.hidden = [NSString isEmpty:model.tagPict];
if (! [NSString isEmpty:model.tagPict]) {
@kWeakify(self);
[self.tagImageView loadImageWithUrl:model.tagPict completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
@kStrongify(self);
if (image) {
self.tagImageView.image = image;
[self.tagImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(image.size.width/image.size.height * 18);
}];
[self layoutIfNeeded];
}
}];
}
}
- (NetImageView *)avatarImageView {
@@ -108,15 +103,6 @@
return _tagImageView;
}
- (UIImageView *)hotImageView {
if (!_hotImageView) {
_hotImageView = [[UIImageView alloc] init];
_hotImageView.userInteractionEnabled = YES;
_hotImageView.image = [UIImage imageNamed:@"room_like_collect_room_hot"];
}
return _hotImageView;
}
- (UILabel *)nickLabel {
if (!_nickLabel) {
_nickLabel = [[UILabel alloc] init];
@@ -126,13 +112,5 @@
return _nickLabel;
}
- (UILabel *)numberLabel {
if (!_numberLabel) {
_numberLabel = [[UILabel alloc] init];
_numberLabel.font = [UIFont systemFontOfSize:12];
_numberLabel.textColor = [UIColor whiteColor];
}
return _numberLabel;
}
@end

View File

@@ -26,10 +26,10 @@
#import "XPRoomOnlineTableViewCell.h"
#import "XPRoomRoleEmptyTableViewCell.h"
///VC
#import "XPUserCardViewController.h"
#import "UserRoomCardViewController.h"
#import "XPRoomSettingPresenter.h"
#import "XPRoomSettingProtocol.h"
@interface XPRoomOnLineViewController ()<XPUserCardViewControllerDelegate,UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate,XPRoomSettingProtocol>
@interface XPRoomOnLineViewController ()<UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate,XPRoomSettingProtocol>
///
@property (nonatomic,strong) UIView * navView;
///
@@ -225,9 +225,16 @@
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
model.micQueue = self.hostDelegate.getMicroQueue;
model.hideSendGiftItem = YES;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
userCardVC.delegate = self;
[self.navigationController presentViewController:userCardVC animated:YES completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self];
@kWeakify(self);
[[NSNotificationCenter defaultCenter] addObserverForName:@"PopAfterUserCardAction" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull notification) {
@kStrongify(self);
[self clickChatAction];
}];
}
}

View File

@@ -25,8 +25,8 @@
#import "XPUserCardInfoModel.h"
///View
#import "AnchorPKMicroView.h"
#import "XPUserCardViewController.h"
#import "XPAnchorRandomPKRuleView.h"
#import "UserRoomCardViewController.h"
// 58 + 5
#define ownerWidth (85 + 5)
@@ -263,9 +263,11 @@
model.roomInfo = roomInfo;
model.micQueue = self.getMicroQueue;
model.delegate = self.hostDelegate;
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
return;
}
}

View File

@@ -22,7 +22,7 @@
#import "AttachmentModel.h"
///View
#import "AnchorMicroView.h"
#import "XPUserCardViewController.h"
#import "UserRoomCardViewController.h"
#import "XPRoomInviteUserViewController.h"
// 150 + 5
@@ -144,8 +144,11 @@
model.micQueue = self.getMicroQueue;
model.delegate = self.hostDelegate;
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:YES completion:nil];
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
return;
}

View File

@@ -266,6 +266,7 @@
- (void)userSpeaking {
UserInfoModel * userInfo = self.microModel.userInfo;
if (!userInfo.micCircle.length) {
[self.animationView startWaveAnimation];
return;

View File

@@ -56,14 +56,12 @@
[self.firstView.layer removeAllAnimations];
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.firstView];
self.firstView.hidden = YES;
}
- (void)initSubViewConstraints {
[self.firstView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self);

View File

@@ -37,7 +37,6 @@
#import "RoomPKChooseUserModel.h"
// Views
#import "NetImageView.h"
#import "XPUserCardViewController.h"
#import "XPRoomInviteUserViewController.h"
#import "UserRoomCardViewController.h"
@@ -844,18 +843,10 @@
model.micQueue = self.micQueue;
model.delegate = self.hostDelegate;
model.superMangerList = self.hostDelegate.getRoomSuperAdminList;
#if DEBUG
UserRoomCardViewController *vc = [[UserRoomCardViewController alloc] initWithUser:model];
vc.modalPresentationStyle = UIModalPresentationOverFullScreen;
[self.hostDelegate.getCurrentNav presentViewController:vc animated:NO completion:nil];
return;
#endif
XPUserCardViewController * userCardVC = [[XPUserCardViewController alloc] initWithUser:model];
[self.hostDelegate.getCurrentNav presentViewController:userCardVC animated:NO completion:nil];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_mike_click eventAttributes:@{@"actionType" : @"userCard"}];
return;
}
if (roomInfo.leaveMode && roomInfo.uid == [AccountInfoStorage instance].getUid.integerValue) {

View File

@@ -175,8 +175,23 @@
XPUserCardItemModel * item = [[XPUserCardItemModel alloc] init];
item.type = UserCardItemType_Invite_Micro;
if (i == 0) {
item.title = roomInfo.roomModeType == RoomModeType_Open_Blind ? YMLocalizedString(@"XPUserCardPresenter0") : YMLocalizedString(@"XPUserCardPresenter1");
item.imageName = roomInfo.leaveMode ? @"usercard_invite_micro_owner_disable" : @"usercard_invite_micro_owner";
if (roomInfo.roomModeType == RoomModeType_Open_Blind) {
item.title = YMLocalizedString(@"XPUserCardPresenter0");
} else {
switch (roomInfo.type) {
case RoomType_Game:
item.title = YMLocalizedString(@"XPUserCardPresenter1");
break;
case RoomType_Anchor:
item.title = YMLocalizedString(@"XPMoreMenuPresenter12");
break;
default:
item.title = [NSString stringWithFormat:YMLocalizedString(@"XPUserCardPresenter4"), i];
break;
}
}
// item.title = roomInfo.roomModeType == RoomModeType_Open_Blind ? YMLocalizedString(@"XPUserCardPresenter0") : YMLocalizedString(@"XPUserCardPresenter1");
item.imageName = roomInfo.leaveMode ? @"usercard_invite_micro_owner_disable" : @"room_user_position_owner";
if (roomInfo.leaveMode) {
item.isEnable = NO;
}
@@ -196,10 +211,10 @@
MicroQueueModel * micModel = [micQueue objectForKey:[NSString stringWithFormat:@"%d", i -1]];
if ((micModel && micModel.userInfo && micModel.userInfo.uid > 0) || micModel.microState.position == -1) {
item.isEnable = NO;
item.imageName = @"usercard_invite_micro_disable";
item.imageName = @"room_user_position_used";
} else {
item.isEnable = YES;
item.imageName = @"usercard_invite_micro_normal";
item.imageName = @"room_user_position_empty";
}
item.position = [NSString stringWithFormat:@"%d", (i - 1)];
[self.functionArray addObject:item];
@@ -227,7 +242,7 @@
upDownItem.status = userInfo.position.length > 0 ? YES : NO;
upDownItem.type = UserCardMicroType_UpDown;
upDownItem.uid = userInfo.uid;
upDownItem.iconImage = @"room_user_card_out_mic";
upDownItem.iconImage = @"room_user_card_up_mic";
XPUserCardMicroItemModel * lockItem = [[XPUserCardMicroItemModel alloc] init];
lockItem.title = userInfo.posState == MicroPosStateType_Free ? YMLocalizedString(@"XPUserCardPresenter10") : YMLocalizedString(@"XPUserCardPresenter11");
@@ -235,8 +250,6 @@
lockItem.status = userInfo.posState == MicroPosStateType_Free;
lockItem.type = UserCardMicroType_Lock;
XPUserCardMicroItemModel * giftValueItem = [[XPUserCardMicroItemModel alloc] init];
giftValueItem.title = YMLocalizedString(@"XPUserCardPresenter12");
giftValueItem.iconImage = @"room_user_card_clean_gift_value";

View File

@@ -6,8 +6,7 @@
//
#import "MvpViewController.h"
@class XPUserCardInfoModel;
#import "XPUserCardInfoModel.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -753,7 +753,7 @@
cardModel.imageName = @"usercard_sendgift_normal";
cardModel.selectImageName = @"usercard_sendgift_normal";
[list insertObject:cardModel atIndex:0];
}
for (XPUserCardMicroItemModel * model in array) {
XPUserCardItemModel *cardModel = [XPUserCardItemModel new];

View File

@@ -357,12 +357,12 @@ XPCandyTreeInsufficientBalanceViewDelegate>
[self setupForBoom];
[self handleGiftComboCallBack];
#if DEBUG
//#if DEBUG
// UIButton *b = [UIButton buttonWithType:UIButtonTypeInfoLight];
// b.frame = CGRectMake(100, 100, 100, 100);
// [self.view addSubview:b];
// [b addTarget:self action:@selector(test) forControlEvents:UIControlEventTouchUpInside];
#endif
//#endif
}
- (void)test {
@@ -841,10 +841,10 @@ XPCandyTreeInsufficientBalanceViewDelegate>
} else if (roomInfo.type == RoomType_MiniGame) {
return [LittleGameScrollStageView class];
} else if (roomInfo.type == RoomType_15Mic) {
#if DEBUG
return [NineteenMicStageView class];
//#if DEBUG
// return [NineteenMicStageView class];
// return [TwentyMicStageView class];
#endif
//#endif
return [FifteenMicStageView class];
} else if (roomInfo.type == RoomType_10Mic) {
@@ -1879,12 +1879,12 @@ XPCandyTreeInsufficientBalanceViewDelegate>
} else if (self.roomInfo.type == RoomType_15Mic) {
[self __layoutFifteenMicStage];
[self changeStageViewOnRoomUpdate];
#if DEBUG
//#if DEBUG
// [self.twentyMicStageView onRoomUpdate];
[self.nineteenMicStageView onRoomUpdate];
#else
// [self.nineteenMicStageView onRoomUpdate];
//#else
[self.fifteenMicStageView onRoomUpdate];
#endif
//#endif
} else if (self.roomInfo.type == RoomType_10Mic) {
[self __layoutTenMicStage];
[self changeStageViewOnRoomUpdate];

View File

@@ -92,6 +92,8 @@ NS_ASSUME_NONNULL_BEGIN
//联系客服
+(void)requestContactCustomerServiceCompletion:(HttpRequestHelperCompletion)completion;
+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion;
@end
NS_ASSUME_NONNULL_END

View File

@@ -140,4 +140,8 @@
[self makeRequest:@"charge/guide/contact" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
+ (void)requestAllRegionInfoCompletion:(HttpRequestHelperCompletion)completion {
[self makeRequest:@"regionInfo/listAll" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
}
@end

View File

@@ -4031,7 +4031,8 @@ ineHeadView12" = "الحمل";
"1.0.30_text_30" = "يرجى إدخال سبب الحظر، والذي سيكون مرئيًا في الخلفية";
"1.0.30_text_31" = "حظر";
"1.0.31_text_0" = "Country/Region";
"1.0.31_text_1" = "Select Country/Region";
"1.0.31_text_2" = "Country/Region List";
"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_0" = "البلد/المنطقة";
"1.0.31_text_1" = "حدد بلدك";
"1.0.31_text_2" = "قائمة الدول/المناطق";
//"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_4" = "موقف الميكروفون";

View File

@@ -3825,7 +3825,7 @@
"1.0.30_text_31" = "Block";
"1.0.31_text_0" = "Country/Region";
"1.0.31_text_1" = "Select Country/Region";
"1.0.31_text_1" = "Select your Country/Region";
"1.0.31_text_2" = "Country/Region List";
"1.0.31_text_3" = "Selective cardiography";
//"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_4" = "Mic Position";

View File

@@ -3430,8 +3430,8 @@
"XPIncomeRecordCoinsDetailsPickViewView3"="Yıl";
"XPIncomeRecordCoinsDetailsPickViewView4"="Ay";
"XPIncomeRecordCoinsDetailsPickViewView5"="Gün";
"XPTreasureFairyViewController5"="Yetersiz Sikke bakiyesi, lütfen şarj yapın";
"XPTreasureFairyViewController6"="Şarj";
"XPTreasureFairyViewController5"="Yetersiz jeton bakiyesi, lütfen yükleme yapın";
"XPTreasureFairyViewController6"="Yükle";
"XPTreasureFairyViewController7"="Daha fazla veri yok~";
"XPTreasureFairyViewController8"="Kazanç sonuçlarını gösterme";
"XPTreasureFairyViewController9"="Parça satın alma başarılı";
@@ -3610,7 +3610,8 @@
"1.0.30_text_30" = "Lütfen arka planda görünecek olan engelleme nedenini girin";
"1.0.30_text_31" = "Engelleme";
"1.0.31_text_0" = "Country/Region";
"1.0.31_text_1" = "Select Country/Region";
"1.0.31_text_2" = "Country/Region List";
"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_0" = "Ülke/Bölge";
"1.0.31_text_1" = "Ülkenizi seçin";
"1.0.31_text_2" = "Ülke/Bölge Listesi";
//"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_4" = "Mikrofon pozisyonu";

View File

@@ -3482,7 +3482,8 @@
"1.0.30_text_30" = "请输入封禁原因,该原因将在后台可见";
"1.0.30_text_31" = "封禁";
"1.0.31_text_0" = "Country/Region";
"1.0.31_text_1" = "Select Country/Region";
"1.0.31_text_2" = "Country/Region List";
"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_0" = "國家/地區";
"1.0.31_text_1" = "選擇你的國家/地區";
"1.0.31_text_2" = "國家/地區列表";
//"1.0.31_text_3" = "Selective cardiography";
"1.0.31_text_4" = "選擇麥位";