邀请码

This commit is contained in:
liyuhua
2024-03-28 09:58:59 +08:00
parent 84f2877bd2
commit a054d160ea
15 changed files with 438 additions and 28 deletions

View File

@@ -225,7 +225,8 @@
23E1708C2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E1708B2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m */; };
23EEB0622B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23EEB0612B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m */; };
23F8BFF82A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */; };
23FE47CC2BB2B17B00F09D23 /* YinUploadFileModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FE47CB2BB2B17B00F09D23 /* YinUploadFileModel.m */; };
23FE47CF2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FE47CE2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.m */; };
23FE47D22BB2D98300F09D23 /* YinMineSettingPopUpView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23FE47D12BB2D98300F09D23 /* YinMineSettingPopUpView.m */; };
73FFADDC93E195344047A2EC /* Pods_xplan_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_xplan_ios.framework */; };
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; };
@@ -1197,6 +1198,7 @@
E8B825CA26EA1231009E8E9F /* LoginVerifCodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825C826EA1231009E8E9F /* LoginVerifCodeViewController.m */; };
E8B825CD26EA18C8009E8E9F /* ThemeColor.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825CC26EA18C8009E8E9F /* ThemeColor.m */; };
E8B825D026EA3825009E8E9F /* LoginPasswordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B825CF26EA3825009E8E9F /* LoginPasswordViewController.m */; };
E8B846BC26FD7C1200A777FE /* UploadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846BB26FD7C1200A777FE /* UploadImage.m */; };
E8B846BF26FD827900A777FE /* XPMineUserInfoAlbumViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846BE26FD827900A777FE /* XPMineUserInfoAlbumViewController.m */; };
E8B846C226FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */; };
E8B846C526FDB41A00A777FE /* XPMineUserInfolbumPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846C426FDB41A00A777FE /* XPMineUserInfolbumPresenter.m */; };
@@ -1839,8 +1841,10 @@
23EEB0612B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMainHomeEmptyCell.m; sourceTree = "<group>"; };
23F8BFF62A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessagePrivilegeCardCell.h; sourceTree = "<group>"; };
23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessagePrivilegeCardCell.m; sourceTree = "<group>"; };
23FE47CA2BB2B17B00F09D23 /* YinUploadFileModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YinUploadFileModel.h; sourceTree = "<group>"; };
23FE47CB2BB2B17B00F09D23 /* YinUploadFileModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YinUploadFileModel.m; sourceTree = "<group>"; };
23FE47CD2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YinMineSettingFillCodeView.h; sourceTree = "<group>"; };
23FE47CE2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YinMineSettingFillCodeView.m; sourceTree = "<group>"; };
23FE47D02BB2D98300F09D23 /* YinMineSettingPopUpView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YinMineSettingPopUpView.h; sourceTree = "<group>"; };
23FE47D12BB2D98300F09D23 /* YinMineSettingPopUpView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YinMineSettingPopUpView.m; sourceTree = "<group>"; };
7DB00EC07F1D0ADFF900B38D /* Pods-xplan-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.debug.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.debug.xcconfig"; sourceTree = "<group>"; };
9B0086C427BA392B0032BD2B /* AnchorStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorStageView.h; sourceTree = "<group>"; };
9B0086C527BA392B0032BD2B /* AnchorStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorStageView.m; sourceTree = "<group>"; };
@@ -3644,6 +3648,8 @@
E8B825CC26EA18C8009E8E9F /* ThemeColor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThemeColor.m; sourceTree = "<group>"; };
E8B825CE26EA3825009E8E9F /* LoginPasswordViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoginPasswordViewController.h; sourceTree = "<group>"; };
E8B825CF26EA3825009E8E9F /* LoginPasswordViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LoginPasswordViewController.m; sourceTree = "<group>"; };
E8B846BA26FD7C1200A777FE /* UploadImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UploadImage.h; sourceTree = "<group>"; };
E8B846BB26FD7C1200A777FE /* UploadImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UploadImage.m; sourceTree = "<group>"; };
E8B846BD26FD827900A777FE /* XPMineUserInfoAlbumViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumViewController.h; sourceTree = "<group>"; };
E8B846BE26FD827900A777FE /* XPMineUserInfoAlbumViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoAlbumViewController.m; sourceTree = "<group>"; };
E8B846C026FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoAlbumCollectionViewCell.h; sourceTree = "<group>"; };
@@ -4508,6 +4514,7 @@
E82D5C77276B25B000858D6D /* SpriteSheetManager */,
E865964E2701A1A900846EBD /* StatisticsService */,
E89DA6612700590A008483C1 /* IAPHelper */,
E8B846B926FD7BE600A777FE /* UploadImage */,
E8EEB8EA26FC2050007C6EBA /* SDPhotoBrowser */,
E81366E426F0A4820076364C /* NSString */,
E82109AA26F1C86E00FC3319 /* CountDown */,
@@ -5192,8 +5199,6 @@
children = (
9B33E3C927D85379003B0E62 /* UploadFile.m */,
9B33E3CA27D85379003B0E62 /* UploadFile.h */,
23FE47CA2BB2B17B00F09D23 /* YinUploadFileModel.h */,
23FE47CB2BB2B17B00F09D23 /* YinUploadFileModel.m */,
);
path = File;
sourceTree = "<group>";
@@ -8122,6 +8127,10 @@
237B89DE2A933F52005DB380 /* XPMineUserGameCell.m */,
237B89EC2A945F81005DB380 /* XPMineUserGameTypeCell.h */,
237B89ED2A945F81005DB380 /* XPMineUserGameTypeCell.m */,
23FE47CD2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.h */,
23FE47CE2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.m */,
23FE47D02BB2D98300F09D23 /* YinMineSettingPopUpView.h */,
23FE47D12BB2D98300F09D23 /* YinMineSettingPopUpView.m */,
);
path = MineInfo;
sourceTree = "<group>";
@@ -8877,6 +8886,15 @@
path = Model;
sourceTree = "<group>";
};
E8B846B926FD7BE600A777FE /* UploadImage */ = {
isa = PBXGroup;
children = (
E8B846BA26FD7C1200A777FE /* UploadImage.h */,
E8B846BB26FD7C1200A777FE /* UploadImage.m */,
);
path = UploadImage;
sourceTree = "<group>";
};
E8B846D026FDDBCD00A777FE /* Recharge */ = {
isa = PBXGroup;
children = (
@@ -10841,7 +10859,6 @@
E89DCF602900F4FB001647EC /* XPWishGiftEnterView.m in Sources */,
E81366E326F0A1FC0076364C /* LoginBindPhoneViewController.m in Sources */,
9B2EA7CC2804245500ED17BF /* XPAnchorPKPanelUserView.m in Sources */,
23FE47CC2BB2B17B00F09D23 /* YinUploadFileModel.m in Sources */,
E851E46527FF1F53002F3ACB /* XPMineGuildSetNameViewController.m in Sources */,
231EBB4E2B341DE0006F782E /* MewMainHomeHotRoomModel.m in Sources */,
9B85B6DA279FDC5200A0A1AC /* XPUserCardSkillCollectionViewCell.m in Sources */,
@@ -10866,6 +10883,7 @@
E81C1B1C27705F6B0020D1E4 /* XPArrangeMicPresenter.m in Sources */,
184862CE27213FD7005FC5DC /* ZegoRtcImpl.m in Sources */,
E8A88D2727E8193400CA8837 /* XPRoomPKSelectUserView.m in Sources */,
23FE47CF2BB2C8CE00F09D23 /* YinMineSettingFillCodeView.m in Sources */,
9B734F7C288AB05A00CBDAA9 /* XPMIneGameCollectionViewCell.m in Sources */,
9B0E1C5926E77022005D4442 /* BaseNavigationController.m in Sources */,
E8664ED927E4355C000171BA /* XPRoomPKRecordTableViewCell.m in Sources */,
@@ -10972,6 +10990,7 @@
E8C1CD6A27D8937800376F83 /* XPRoomFaceCollectionViewCell.m in Sources */,
E8DBB6F927B639A300AA285D /* LittleGameStageView.m in Sources */,
9B2EA7C02804037700ED17BF /* AnchorPKStageView.m in Sources */,
23FE47D22BB2D98300F09D23 /* YinMineSettingPopUpView.m in Sources */,
E811FFF72742367B00918544 /* XPGiftEmptyCollectionViewCell.m in Sources */,
E8A86E0827BA38DB001C21F9 /* UIImage+RW.m in Sources */,
E800807927FD84560055A8AB /* ClanInfoModel.m in Sources */,
@@ -11324,6 +11343,7 @@
237B8A092A95A52B005DB380 /* XPMineGameOrderItemVC.m in Sources */,
E839533F276A0CDB00CF2F24 /* XPMineNameplateTableViewCell.m in Sources */,
9B73CD11279AE99B006AF255 /* XPSkillCardListCell.m in Sources */,
E8B846BC26FD7C1200A777FE /* UploadImage.m in Sources */,
9BCE6144277D657600CC0358 /* XPReleaseRadioTableViewCell.m in Sources */,
9B16A34827E17D9B00E13A98 /* XPRoomTrumpetViewController.m in Sources */,
186A534D26FC6ED900D67B2C /* TTActionSheetView.m in Sources */,

View File

@@ -145,6 +145,8 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,strong) NSArray<UserGameInfoVo *> *userGamePartner;
///pk时不能禁麦
@property(nonatomic,assign) BOOL isNoProhibitMic;
///控制是否有补填弹窗入口
@property(nonatomic,assign) BOOL canRefillInviteCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -299,6 +299,10 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion 完成
/// @param uid 用户id
+(void)requestGamePartnerInfoList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid;
/// 补填邀请码
/// @param completion 完成
/// @param inviteCode 邀请码
+(void)requestInviteCode:(HttpRequestHelperCompletion)completion inviteCode:(NSString *)inviteCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -336,4 +336,10 @@
+(void)requestGamePartnerInfoList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid{
[self makeRequest:@"gamePartnerInfo/list" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__,uid, nil];
}
///
/// @param completion
/// @param inviteCode
+(void)requestInviteCode:(HttpRequestHelperCompletion)completion inviteCode:(NSString *)inviteCode{
[self makeRequest:@"inviteCode/refillInviteCode" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__,inviteCode, nil];
}
@end

View File

@@ -23,6 +23,7 @@ typedef NS_ENUM(NSInteger, XPMineSettingItemType){
XPMineSettingItemType_Clear_Memory,///清楚缓存
XPMineSettingItemType_About_Us,///关于我们
XPMineSettingItemType_CheckUpdate,///检查更新
XPMineSettingItemType_InvitationCode,///填写邀请码
};
@interface XPMineSettingItemModel : NSObject

View File

@@ -23,7 +23,8 @@ NS_ASSUME_NONNULL_BEGIN
///获取版本更新
- (void)getVersionUpdate;
/// 补填邀请码
-(void)fillInviteCode:(NSString *)inviteCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -64,6 +64,14 @@
blackListItem.title = @"黑名单管理";
blackListItem.subTitle = @"";
blackListItem.type = XPMineSettingItemType_Black_Manager;
XPMineSettingItemModel * invitationCodeItem = [[XPMineSettingItemModel alloc] init];
invitationCodeItem.title = @"填写邀请码";
invitationCodeItem.subTitle = @"";
invitationCodeItem.type = XPMineSettingItemType_InvitationCode;
XPMineSettingItemModel * payItem = [[XPMineSettingItemModel alloc] init];
payItem.title = @"支付密码";
@@ -108,6 +116,9 @@
NSArray * oneSection = @[phoneItem];
NSArray * twoSection = @[loginItem,payItem, notificaItem, blackListItem];
if (userinfo.canRefillInviteCode == YES){
twoSection = @[loginItem,payItem, notificaItem, blackListItem,invitationCodeItem];
}
NSArray * threeSection = @[privacyItem];
NSArray * fourthSection = @[helperItem, clearMemoryItem, updateItem, aboutusItem];
@@ -163,4 +174,12 @@
} errorToast:NO] appVersion:appVersion os:os channel:channel];
}
///
-(void)fillInviteCode:(NSString *)inviteCode{
[Api requestInviteCode:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
[[self getView]fillInviteCodeSuccess];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView]fillInviteCodeFail:code];
} showLoading:YES errorToast:YES] inviteCode:inviteCode];
}
@end

View File

@@ -23,7 +23,11 @@ NS_ASSUME_NONNULL_BEGIN
- (void)getVersionUpdateFail;
///版本更新
-(void)getVersionUpdate:(XPVersionUpdateModel *)model;
///补填邀请码成功
-(void)fillInviteCodeSuccess;
///补填邀请码失败
-(void)fillInviteCodeFail:(NSInteger)code;
@end
NS_ASSUME_NONNULL_END

View File

@@ -26,6 +26,9 @@
#import "TTAlertConfig.h"
#import "TTPopup.h"
#import "XPUpgradeView.h"
#import "YinMineSettingFillCodeView.h"
#import "YinMineSettingPopUpView.h"
///P
#import "XPMineSettingPresent.h"
#import "XPMineSettingProtocol.h"
@@ -44,7 +47,7 @@
#import "XPLoginBindPhoneResultViewController.h"
@interface XPMineSettingViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineSettingProtocol>
@interface XPMineSettingViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineSettingProtocol,YinMineSettingFillCodeViewDelegate,YinMineSettingPopUpViewDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
///
@@ -205,6 +208,14 @@
[self.presenter getVersionUpdate];
}
break;
case XPMineSettingItemType_InvitationCode:
{
YinMineSettingFillCodeView *codeView = [[YinMineSettingFillCodeView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
codeView.delegate = self;
[TTPopup popupView:codeView style:TTPopupStyleAlert];
break;
}
default:
break;
}
@@ -283,7 +294,18 @@
self.userInfo = userInfo;
[self.presenter getMineSettingDataSourceWith:userInfo];
}
///
-(void)fillInviteCodeSuccess{
self.userInfo.canRefillInviteCode = YES;
[self.presenter getMineSettingDataSourceWith:self.userInfo];
}
///
-(void)fillInviteCodeFail:(NSInteger)code{
if (code == 211185 || code == 211186){
self.userInfo.canRefillInviteCode = YES;
[self.presenter getMineSettingDataSourceWith:self.userInfo];
}
}
- (void)logoutCurrentAccountSuccess {
[self.navigationController popToRootViewControllerAnimated:NO];
}
@@ -312,7 +334,17 @@
service.shouldDismissOnBackgroundTouch = NO;
[TTPopup popupWithConfig:service];
}
#pragma mark - YinMineSettingFillCodeViewDelegate
- (void)showFillInviteCodeView:(NSString *)code{
YinMineSettingPopUpView *popUpView = [[YinMineSettingPopUpView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
popUpView.code = code;
popUpView.delegate = self;
[TTPopup popupView:popUpView style:TTPopupStyleAlert];
}
#pragma mark - YinMineSettingPopUpViewDelegate
-(void)confirmFillInviteCode:(NSString *)code{
[self.presenter fillInviteCode:code];
}
#pragma mark - Event Response
- (void)logoutButtonAction:(UIButton *)sender {
[self.presenter logoutCurrentAccount];

View File

@@ -152,7 +152,7 @@
[self.idStackView addArrangedSubview:self.copysIdImageView];
///
[self.tagStackView addArrangedSubview:self.clanBtn];
[self.tagStackView addArrangedSubview:self.newUserImageView];
[self.tagStackView addArrangedSubview:self.officalImageView];
[self.tagStackView addArrangedSubview:self.experImageView];
@@ -286,11 +286,11 @@
make.height.mas_equalTo(22);
}];
[self.clanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(22);
}];
// [self.clanBtn mas_makeConstraints:^(MASConstraintMaker *make) {
// make.height.mas_equalTo(22);
//
// }];
//
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(36);
make.height.mas_equalTo(18);

View File

@@ -0,0 +1,22 @@
//
// YinMineSettingFillCodeView.h
// xplan-ios
//
// Created by duoban on 2024/3/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol YinMineSettingFillCodeViewDelegate <NSObject>
-(void)showFillInviteCodeView:(NSString *)code;
@end
@interface YinMineSettingFillCodeView : UIView
@property(nonatomic,weak) id<YinMineSettingFillCodeViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,158 @@
//
// YinMineSettingFillCodeView.m
// xplan-ios
//
// Created by duoban on 2024/3/26.
//
#import "YinMineSettingFillCodeView.h"
@interface YinMineSettingFillCodeView()<UITextFieldDelegate>
@property(nonatomic,strong) UIButton *backView;
@property(nonatomic,strong) UIView *bgView;
@property(nonatomic,strong) UILabel *titleView;
@property(nonatomic,strong) UITextField *textField;
@property(nonatomic,strong) UILabel *explainView;
@property(nonatomic,strong) UIButton *confirmBtn;
@end
@implementation YinMineSettingFillCodeView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.4];
[self addSubview:self.backView];
[self addSubview:self.bgView];
[self.bgView addSubview:self.titleView];
[self.bgView addSubview:self.textField];
[self.bgView addSubview:self.explainView];
[self.bgView addSubview:self.confirmBtn];
}
-(void)installConstraints{
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(307));
make.height.mas_equalTo(kGetScaleWidth(274));
make.center.equalTo(self);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(28));
make.centerX.equalTo(self.bgView);
}];
[self.textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(74));
make.width.mas_equalTo(kGetScaleWidth(255));
make.height.mas_equalTo(kGetScaleWidth(48));
make.centerX.equalTo(self.bgView);
}];
[self.explainView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(26));
make.trailing.mas_equalTo(-kGetScaleWidth(26));
make.top.mas_equalTo(kGetScaleWidth(134));
make.height.mas_equalTo(kGetScaleWidth(60));
}];
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(210));
make.width.mas_equalTo(kGetScaleWidth(244));
make.height.mas_equalTo(kGetScaleWidth(40));
make.centerX.equalTo(self.bgView);
}];
}
-(void)backAction{
[TTPopup dismiss];
}
-(void)textDidChange:(UITextField *)textField{
if (textField.text.length > 10){
textField.text = [textField.text substringToIndex:10];
}
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
if (string.length == 0){
return YES;
}
NSString *regex =@"^[a-zA-Z0-9]+$";
NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
if ([pred evaluateWithObject:string]) {
return YES;
}
return NO;
}
-(void)confirmBtnAction{
if (self.textField.text.length <= 0){
[XCHUDTool showErrorWithMessage:@"请填写邀请码"];
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(showFillInviteCodeView:)]){
[self.delegate showFillInviteCodeView:self.textField.text];
}
[TTPopup dismiss];
}
#pragma mark -
- (UIButton *)backView{
if(!_backView){
_backView = [UIButton new];
[_backView addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backView;
}
- (UIView *)bgView{
if(!_bgView){
_bgView = [UIView new];
_bgView.backgroundColor = [UIColor whiteColor];
[_bgView setCornerWithLeftTopCorner:kGetScaleWidth(20) rightTopCorner:kGetScaleWidth(20) bottomLeftCorner:kGetScaleWidth(20) bottomRightCorner:kGetScaleWidth(20) size:CGSizeMake(kGetScaleWidth(307), kGetScaleWidth(274))];
}
return _bgView;
}
- (UILabel *)titleView{
if(!_titleView){
_titleView = [UILabel labelInitWithText:@"填写邀请码" font:kFontSemibold(16) textColor:UIColorFromRGB(0x2B2D33)];
}
return _titleView;
}
- (UITextField *)textField{
if(!_textField){
_textField = [UITextField new];
NSAttributedString *att = [[NSAttributedString alloc]initWithString:@"请输入要填写的邀请码" attributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0x878B9C)}];
_textField.attributedPlaceholder = att;
_textField.textAlignment = NSTextAlignmentCenter;
_textField.backgroundColor = UIColorFromRGB(0xF3F5FA);
[_textField setCornerWithLeftTopCorner:kGetScaleWidth(8) rightTopCorner:kGetScaleWidth(8) bottomLeftCorner:kGetScaleWidth(8) bottomRightCorner:kGetScaleWidth(8) size:CGSizeMake(kGetScaleWidth(255), kGetScaleWidth(48))];
[_textField addTarget:self action:@selector(textDidChange:) forControlEvents:UIControlEventEditingChanged];
_textField.delegate = self;
}
return _textField;
}
- (UILabel *)explainView{
if(!_explainView){
_explainView = [UILabel new];
_explainView.numberOfLines = 0;
NSMutableAttributedString *att = [[NSMutableAttributedString alloc]initWithString:@"填写说明:\n请填写邀请人的邀请码\n邀请码只能填写一次请勿随意填写" attributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0xB3B3C3)}];
[att addAttributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0x2B2D33)} range:[att.string rangeOfString:@"填写说明:"]];
}
return _explainView;
}
- (UIButton *)confirmBtn{
if(!_confirmBtn){
_confirmBtn = [UIButton new];
_confirmBtn.backgroundColor = UIColorFromRGB(0xFFDA24);
_confirmBtn.layer.cornerRadius = kGetScaleWidth(40)/2;
_confirmBtn.layer.masksToBounds = true;
[_confirmBtn setTitle:@"确认" forState:UIControlStateNormal];
[_confirmBtn setTitleColor:UIColorFromRGB(0x2B2D33) forState:UIControlStateNormal];
_confirmBtn.titleLabel.font = kFontMedium(14);
[_confirmBtn addTarget:self action:@selector(confirmBtnAction) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmBtn;
}
@end

View File

@@ -0,0 +1,21 @@
//
// YinMineSettingPopUpView.h
// xplan-ios
//
// Created by duoban on 2024/3/26.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@protocol YinMineSettingPopUpViewDelegate <NSObject>
-(void)confirmFillInviteCode:(NSString *)code;
@end
@interface YinMineSettingPopUpView : UIView
@property(nonatomic,copy) NSString *code;
@property(nonatomic,weak) id<YinMineSettingPopUpViewDelegate>delegate;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,115 @@
//
// YinMineSettingPopUpView.m
// xplan-ios
//
// Created by duoban on 2024/3/26.
//
#import "YinMineSettingPopUpView.h"
@interface YinMineSettingPopUpView()
@property(nonatomic,strong) UIView *bgView;
@property(nonatomic,strong) UILabel *contextView;
@property(nonatomic,strong) UIButton *cancelBtn;
@property(nonatomic,strong) UIButton *confirmBtn;
@end
@implementation YinMineSettingPopUpView
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self addSubview:self.bgView];
[self.bgView addSubview:self.contextView];
[self.bgView addSubview:self.cancelBtn];
[self.bgView addSubview:self.confirmBtn];
}
-(void)installConstraints{
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(307));
make.height.mas_equalTo(kGetScaleWidth(176));
make.center.equalTo(self);
}];
[self.contextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(32));
make.centerX.equalTo(self.bgView);
}];
[self.cancelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(112));
make.leading.mas_equalTo(kGetScaleWidth(22));
make.width.mas_equalTo(kGetScaleWidth(124));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
[self.confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(kGetScaleWidth(112));
make.trailing.mas_equalTo(-kGetScaleWidth(22));
make.width.mas_equalTo(kGetScaleWidth(124));
make.height.mas_equalTo(kGetScaleWidth(40));
}];
}
- (void)setCode:(NSString *)code{
_code = code;
NSMutableAttributedString *att = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"确认填写 邀请码【%@】?\n\n注意邀请码只能填写1次",_code] attributes:@{NSFontAttributeName:kFontRegular(14),NSForegroundColorAttributeName:UIColorFromRGB(0x2B2D33)}];
[att addAttributes:@{NSFontAttributeName:kFontMedium(14),NSForegroundColorAttributeName:UIColorFromRGB(0x2B2D33)} range:[att.string rangeOfString:[NSString stringWithFormat:@"【%@】",_code]]];
[att addAttributes:@{NSFontAttributeName:kFontSemibold(16),NSForegroundColorAttributeName:UIColorFromRGB(0xFFDA24)} range:[att.string rangeOfString:@"1次"]];
_contextView.attributedText = att;
}
-(void)cancelBtnAction{
[TTPopup dismiss];
}
-(void)confirmBtnAction{
[TTPopup dismiss];
if (self.delegate && [self.delegate respondsToSelector:@selector(confirmFillInviteCode:)]){
[self.delegate confirmFillInviteCode:self.code];
}
}
#pragma mark -
- (UIView *)bgView{
if(!_bgView){
_bgView = [UIView new];
_bgView.backgroundColor = [UIColor whiteColor];
[_bgView setCornerWithLeftTopCorner:kGetScaleWidth(20) rightTopCorner:kGetScaleWidth(20) bottomLeftCorner:kGetScaleWidth(20) bottomRightCorner:kGetScaleWidth(20) size:CGSizeMake(kGetScaleWidth(307), kGetScaleWidth(176))];
}
return _bgView;
}
- (UILabel *)contextView{
if(!_contextView){
_contextView = [UILabel new];
_contextView.textAlignment = NSTextAlignmentCenter;
_contextView.numberOfLines = 3;
}
return _contextView;
}
- (UIButton *)cancelBtn{
if(!_cancelBtn){
_cancelBtn = [UIButton new];
_cancelBtn.backgroundColor = UIColorRGBAlpha(0xFFDA24, 0.2);
_cancelBtn.layer.cornerRadius = kGetScaleWidth(40)/2;
_cancelBtn.layer.masksToBounds = true;
[_cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
[_cancelBtn setTitleColor:UIColorFromRGB(0x2B2D33) forState:UIControlStateNormal];
_cancelBtn.titleLabel.font = kFontMedium(14);
[_cancelBtn addTarget:self action:@selector(cancelBtnAction) forControlEvents:UIControlEventTouchUpInside];
}
return _cancelBtn;
}
- (UIButton *)confirmBtn{
if(!_confirmBtn){
_confirmBtn = [UIButton new];
_confirmBtn.backgroundColor = UIColorFromRGB(0xFFDA24);
_confirmBtn.layer.cornerRadius = kGetScaleWidth(40)/2;
_confirmBtn.layer.masksToBounds = true;
[_confirmBtn setTitle:@"确认" forState:UIControlStateNormal];
[_confirmBtn setTitleColor:UIColorFromRGB(0x2B2D33) forState:UIControlStateNormal];
_confirmBtn.titleLabel.font = kFontMedium(14);
[_confirmBtn addTarget:self action:@selector(confirmBtnAction) forControlEvents:UIControlEventTouchUpInside];
}
return _confirmBtn;
}
@end

View File

@@ -1125,10 +1125,9 @@
///gif
- (void)beginGifAnimation:(NSString *)giftUrl startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint {
FLAnimatedImageView * giftImageView = [self.giftReuseArray anyObject];
CGFloat width = (kGetScaleWidth(256)/3) ;
CGFloat heigth = (kGetScaleWidth(144)/3) ;
if (giftImageView == nil) {
CGFloat width = (kGetScaleWidth(256)/3) ;
CGFloat heigth = (kGetScaleWidth(144)/3) ;
giftImageView = [[FLAnimatedImageView alloc]initWithFrame:CGRectMake(0, 0 , width, heigth)];
giftImageView.center = startPoint;
giftImageView.alpha = 1;
@@ -1138,6 +1137,8 @@
}else {
[self.giftReuseArray removeObject:giftImageView];
}
giftImageView.frame = CGRectMake(0, 0 , width, heigth);
giftImageView.center = startPoint;
giftImageView.hidden = NO;
giftImageView.layer.cornerRadius = 6;
giftImageView.layer.masksToBounds = YES;
@@ -1175,10 +1176,9 @@
///
- (void)beginGiftAnimation:(NSString *)giftUrl startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint {
FLAnimatedImageView * giftImageView = [self.giftReuseArray anyObject];
CGFloat width = 55;
CGFloat heigth = 55;
if (giftImageView == nil) {
CGFloat width = 55;
CGFloat heigth = 55;
giftImageView = [[FLAnimatedImageView alloc]initWithFrame:CGRectMake(0, 0 , width, heigth)];
giftImageView.center = startPoint;
giftImageView.alpha = 1;
@@ -1188,12 +1188,17 @@
}else {
[self.giftReuseArray removeObject:giftImageView];
}
giftImageView.frame = CGRectMake(0, 0 , width, heigth);
giftImageView.center = startPoint;
giftImageView.hidden = NO;
[giftImageView sd_setImageWithURL:[NSURL URLWithString:giftUrl]];
[self.lowLevelView addSubview:giftImageView];
CAAnimationGroup *group = [XPRoomAnimationTool createGiftAnimationStartPoint:startPoint endPoint:endPoint];
[giftImageView.layer addAnimation:group forKey:@"giftDisplayViewAnimation"];
[self performSelector:@selector(aniationDidFinish:) withObject:giftImageView afterDelay:(3.2+0.25)];
[giftImageView sd_setImageWithURL:[NSURL URLWithString:giftUrl]completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
[self.lowLevelView addSubview:giftImageView];
CAAnimationGroup *group = [XPRoomAnimationTool createGiftAnimationStartPoint:startPoint endPoint:endPoint];
[giftImageView.layer addAnimation:group forKey:@"giftDisplayViewAnimation"];
[self performSelector:@selector(aniationDidFinish:) withObject:giftImageView afterDelay:(3.2+0.25)];
}];
}
- (void)aniationVideoViewDidFinish:(UIView *)videoView{