Compare commits

..

1 Commits

Author SHA1 Message Date
liyuhua
4147ff923e 修复bug 2023-09-28 00:51:59 +08:00
126 changed files with 4253 additions and 4121 deletions

View File

@@ -66,6 +66,7 @@ target 'YuMi' do
pod 'mob_sharesdk/ShareSDKPlatforms/Apple'
pod 'mob_sharesdk/ShareSDKPlatforms/Line'
pod 'mob_sharesdk/ShareSDKExtension'
pod 'mob_sharesdk/ShareSDKPlatforms/Facebook_Lite'
pod 'UMCommon'
pod 'UMDevice'

File diff suppressed because it is too large Load Diff

View File

@@ -47,21 +47,19 @@ UIKIT_EXTERN NSString * adImageName;
- (void) configBugly {
BuglyConfig *config = [[BuglyConfig alloc] init];
config.channel = @"App Enterprise";
config.blockMonitorEnable = YES; //
config.blockMonitorTimeout = 5;
config.unexpectedTerminatingDetectionEnable = YES; // 退
#ifdef DEBUG
config.debugMode = YES; // debug
config.channel = [YYUtility getAppSource];; config.blockMonitorEnable = YES; //
config.reportLogLevel = BuglyLogLevelVerbose; //
[Bugly startWithAppId:@"86cf73b8d5" config:config];
#else
config.debugMode = NO; // release
config.channel = [YYUtility getAppSource];; config.blockMonitorEnable = NO; //
config.reportLogLevel = BuglyLogLevelWarn; //
NSString *buylyKey = isEnterprise == NO ? @"5334684d86" : @"d65df59a68";
[Bugly startWithAppId:buylyKey config:config];
[Bugly startWithAppId:@"0fcba36f9a" config:config];
#endif
}
@@ -69,7 +67,6 @@ UIKIT_EXTERN NSString * adImageName;
// NIMSDK
NSString *appKey = KeyWithType(KeyType_NetEase);
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
option.apnsCername = @"newPiko";
[[NIMSDK sharedSDK] registerWithOption:option];
// NIM SDK

View File

@@ -17,8 +17,6 @@
#import <GoogleSignIn/GoogleSignIn.h>
#import "GULAppDelegateSwizzler.h"
#import <GoogleSignIn/GoogleSignIn.h>
#import "XPLoginViewController.h"
#import "AccountModel.h"
@import Firebase;
UIKIT_EXTERN NSString * const kOpenRoomNotification;
@@ -29,22 +27,10 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
TabbarViewController *vc = [[TabbarViewController alloc] init];
BaseNavigationController *bnc = [[BaseNavigationController alloc] initWithRootViewController:vc];
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) {
XPLoginViewController *lvc = [[XPLoginViewController alloc] init];
BaseNavigationController * nav = [[BaseNavigationController alloc] initWithRootViewController:lvc];
nav.modalPresentationStyle = UIModalPresentationFullScreen;
self.window.rootViewController = nav;
}else{
TabbarViewController *vc = [[TabbarViewController alloc] init];
BaseNavigationController *bnc = [[BaseNavigationController alloc] initWithRootViewController:vc];
self.window.rootViewController = bnc;
}
self.window.rootViewController = bnc;
[self.window makeKeyAndVisible];
///广
[self setupLaunchADView];

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -10,7 +10,6 @@
"scale" : "2x"
},
{
"filename" : "room_menu_face@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -10,7 +10,6 @@
"scale" : "2x"
},
{
"filename" : "room_menu_more@3x.png",
"idiom" : "universal",
"scale" : "3x"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_menu_send_bg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_menu_send_bg@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_menu_voice_close@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_menu_voice_close@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,22 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_menu_voice_open@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_menu_voice_open@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -23,7 +23,6 @@ NS_ASSUME_NONNULL_BEGIN
///开箱子 大于等级 展示
@property (nonatomic, assign) NSInteger openCandyTreeLimitLevel;
@property (nonatomic,assign) BOOL canOpen;
@property(nonatomic,assign) BOOL isLoad;
///房间id用于分享房间跳转到房间
@property (nonatomic, copy) NSString *__nullable roomId;
///用户id用于外部h5跳转到聊天页面

View File

@@ -42,7 +42,7 @@
if (code == 200) {
self.retryCount = 0;
NSDictionary * initData = data.data;
self.canOpen = YES;
self.canOpen = ![initData[@"aModel"] boolValue];
self.iosPhoneBind = [initData[@"iosPhoneBind"] boolValue];
//
self.openCandyTree = [initData[@"openBoxSwitch"] boolValue];

View File

@@ -413,9 +413,9 @@ const int UIInputTextViewMaxHeight = 147;
self.recordButton.selected = YES;
///
if (!self.audioRecordView.superview) {
[kWindow addSubview:self.audioRecordView];
[[UIApplication sharedApplication].keyWindow addSubview:self.audioRecordView];
[self.audioRecordView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(kWindow);
make.center.mas_equalTo(self.audioRecordView.superview);
}];
[self.audioRecordView configAudioRecord:@"message_tool_audio_record_first" title:YMLocalizedString(@"QInputBarView2") isAnimation:YES];
[self.audioRecordView beginAudioRecord];

View File

@@ -16,6 +16,7 @@ UIKIT_EXTERN NSString * const kVisitorUnReadCountNotificationKey;
UIKIT_EXTERN NSString * const kHadShowNewUserGiftKey;
UIKIT_EXTERN NSString * const kRedPacketHistory;
UIKIT_EXTERN NSString * const kTuWenMessageHistory;///图文消息已读记录
UIKIT_EXTERN NSString * const kTeenagerStatusChange;
UIKIT_EXTERN NSString * const kRoomQuickMessageCloseCount;
UIKIT_EXTERN NSString * const kLoginMethod;
typedef NS_ENUM(NSUInteger, Pi_KeyType) {

View File

@@ -17,12 +17,14 @@ NSString * const kRoomBackMusicCaptureVolumeKey = @"9N5Ei+Ch6nkmH1LzZET4ZjYSzXKF
NSString * const kRoomBackMusicAudioMixingVolumeKey = @"JuJZKfNgZQ7s25PjQcGG97za686ecXI1lylS9PSLrayNeY2l1me4NyyYUXHGaJP0";///
NSString * const kRoomBackMusicPlayMusicOrderKey = @"xjtpOpnLgX00F9HgwT1FISMQPkxXj5cpE2vYc2acOR0=";/// 1 0
NSString * const kRoomBackMusicPlayMusicFinishKey = @"xjtpOpnLgX00F9HgwT1FIf5yt3rZb+KP9BT0F9AgD7I8M+2JTSYq+jDIEx1e6qdC";/// key
NSString * const kUserCompleteInfoFinishKey = @"0g1ARAbys7hdfKcXF32WZAASQwkJH//glyiNAZOS5Co=";///
NSString * const kHadShowNewUserGiftKey = @"OHIPXsTBvyt1zwNqr4f6YJkIycUshwhKIpC5Pm2nVVU=";//
NSString * const kNewUserRechargeKey = @"fmslcb104aFPWxdSGkMg6lmyehgB3uCu9V/FqzVpL+8=";//
NSString * const kFromSearchToHomeViewKey = @"pr5yHog50uSsZLKj2nA6Ono3Mq/bLTDyngBNDVRkhgg=";//
NSString * const kTabShowAnchorCardKey = @"MIO0LwD8MCBISnBOps47VF1waAwY+/XFOm2C3luic/k="; //tab
NSString * const kRedPacketHistory = @"nwKkblakw5CH37vvs9YcSjHhVHcOoeZMmE09gg7Ymhk";
NSString * const kTuWenMessageHistory = @"AMRtf6yOWYapbYqqOBK+m5IUPsFN5hfbOpPkrYvOr1E=";//
NSString * const kTeenagerStatusChange = @"Pn5RRk7StcSdlVksgBaunx8mADfiSN1UnkpU7FSBGis=";//
NSString * const kRoomQuickMessageCloseCount = @"bUi7KnisS+mmUMj45e9s4VycnvRvBViGvd/ouRS4SHo=";//
NSString * const kShieldingNotification = @"a1NoaWVsZGluZ05vdGlmaWNhdGlvbg==";///
NSString * const kRoomKickoutTime = @"a1Jvb21LaWNrb3V0VGltZQ==";///
@@ -33,7 +35,6 @@ NSString * const kGiveDiamondDailyNum = @"a0dpdmVEaWFtb25kRGFpbHlOdW0=";
NSString * const kShowFirstRechargeView = @"a1Nob3dGaXJzdFJlY2hhcmdlVmlldw==";
///
NSString * const kInviteMemeberSuccess = @"a0ludml0ZU1lbWViZXJTdWNjZXNz";
NSString * const kUserFirstRegisterKey = @"kUserFirstRegisterKey";
///
NSString * const kLoginMethod = @"a0xvZ2luTWV0aG9k";
NSString * const kRequestRicket = @"a1JlcXVlc3RSaWNrZXQ=";

View File

@@ -100,8 +100,7 @@ typedef NS_ENUM(NSUInteger, URLType) {
kTreasureRuleURL,
///夺宝记录
kTreasureRecordURL,
///第三方充值
kThirdPartyPay,
kChannelUrl,
};
NSString * const URLWithType(URLType type);

View File

@@ -17,6 +17,8 @@ NSString * const URLWithType(URLType type) {
prefix = [NSString stringWithFormat:@"%@k",prefix];
prefix = [NSString stringWithFormat:@"%@o",prefix];
NSDictionary *newDic = @{
@(kTreasureTicketBuyURL) : @"modules/act-treasureSnatching/index.html",///
@@ -26,7 +28,7 @@ NSString * const URLWithType(URLType type) {
@(kNobleRankURL) : @"modules/noble/index.html",///
@(kGoldEarningsRecord) : @"modules/myincome/index.html#/GoldLog",///
@(kCandyTreeRuleURL) : @"modules/rule/newWishingWellRule.html",/// modules/rank/index.html#/wishingWellRule
@(kThirdPartyPay) : @"modules/pay/index.html?channelType=%@&deviceId=%@",///
@(kChannelUrl) : @"modules/%@/index.html?channelType=%@&deviceId=%@",
};
NSString * newUrl = [newDic objectForKey:@(type)];
if(newUrl != nil){

View File

@@ -49,7 +49,7 @@ isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaIns
#define PI_App_Version @"2.0.8"
#define PI_App_Version @"2.0.7"
#ifdef DEBUG
#define API_HOST_URL [NSString stringWithFormat:@"%@%@",@"http://beta.api",@".pekolive.com"]

View File

@@ -96,8 +96,6 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>“Piko”需要您的同意,才可以访问进行拍照并上传您的图片,然后展示在您的个人主页上,便于他人查看</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>“Piko”需要您的同意,才可以进行定位服务,推荐附近好友</string>
<key>NSLocalNetworkUsageDescription</key>
<string>此App将可发现和连接到您所用网络上的设备。</string>
<key>NSMicrophoneUsageDescription</key>

View File

@@ -1,20 +0,0 @@
//
// PILoginManager.h
// YuMi
//
// Created by duoban on 2023/10/7.
//
#import <Foundation/Foundation.h>
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface PILoginManager : NSObject
///登录是否手机isLoginPhone
+(void)loginWithVC:(MvpViewController *)VC isLoginPhone:(BOOL)isLoginPhone;
///登录成功,回到首页
+(void)jumpToHomeVCWithInviteCode:(NSString *)inviteCode;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,104 +0,0 @@
//
// PILoginManager.m
// YuMi
//
// Created by duoban on 2023/10/7.
//
#import "PILoginManager.h"
///api
#import "Api+Main.h"
///vc
#import "LoginFullInfoViewController.h"
#import "TabbarViewController.h"
#import "BaseNavigationController.h"
#import "LoginVerifCodeViewController.h"
///Model
#import "ThirdUserInfo.h"
#import "AccountModel.h"
#import "UserInfoModel.h"
#import "XPLoginAuthCodeVC.h"
@implementation PILoginManager
+(void)loginWithVC:(MvpViewController *)VC isLoginPhone:(BOOL)isLoginPhone{
AccountModel *accountModel = [[AccountInfoStorage instance] getCurrentAccountInfo];
HomeUserModel *homeUserModel = [HomeUserModel new];
if (accountModel == nil || accountModel.uid == nil || accountModel.access_token == nil) {
[XNDJTDDLoadingTool hideOnlyView:VC.view];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"LoginPresenter1")];
return;
}
__block UserInfoModel *userInfo;
dispatch_group_t group = dispatch_group_create();
dispatch_queue_t queue =dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);
dispatch_group_enter(group);
dispatch_async(queue, ^{
[Api requestTicket:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
NSArray *tickets = [data.data valueForKey:@"tickets"];
NSString *ticket = [tickets[0] valueForKey:@"ticket"];
homeUserModel.ticket = ticket;
[[AccountInfoStorage instance] saveTicket:ticket];
}
dispatch_group_leave(group);
} access_token:accountModel.access_token issue_type:@"multi"];
});
dispatch_group_enter(group);
dispatch_async(queue, ^{
[Api getUserInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
userInfo = [UserInfoModel modelWithDictionary:data.data];
homeUserModel.nick = userInfo.nick;
homeUserModel.avatar = userInfo.avatar;
homeUserModel.isBindPhone = userInfo.isBindPhone;
}
dispatch_group_leave(group);
} uid:accountModel.uid];
});
__block NSString *isFlag = @"";
if(isLoginPhone == YES){
dispatch_group_enter(group);
dispatch_async(queue, ^{
[Api requestAuthorizationCodeInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
isFlag = [data.data boolValue] == YES ? @"1" : @"0" ;
}else{
isFlag = @"2";
}
dispatch_group_leave(group);
}];
});
}
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
[XNDJTDDLoadingTool hideOnlyView:VC.view];
if ([[AccountInfoStorage instance] getTicket].length <= 0 || userInfo == nil || [isFlag isEqualToString:@"2"]) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"LoginPresenter1")];
return;
}
[[AccountInfoStorage instance]saveHomeUserInfo:homeUserModel];
if (userInfo.nick == nil || userInfo.avatar == nil) {
if([isFlag isEqualToString:@"0"]){
XPLoginAuthCodeVC *vc = [[XPLoginAuthCodeVC alloc]init];
vc.pi_isPush = YES;
[VC.navigationController pushViewController:vc animated:YES];
}else{
LoginFullInfoViewController * FullVC = [[LoginFullInfoViewController alloc] init];
[VC.navigationController pushViewController:FullVC animated:YES];
}
return;
}
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"PKIDLoginViewController0")];
[PILoginManager jumpToHomeVCWithInviteCode:@""];
});
}
+(void)jumpToHomeVCWithInviteCode:(NSString *)inviteCode{
TabbarViewController *vc = [[TabbarViewController alloc] init];
vc.isFormLogin = YES;
vc.inviteCode = inviteCode;
BaseNavigationController *bnc = [[BaseNavigationController alloc] initWithRootViewController:vc];
kWindow.rootViewController = bnc;
}
@end

View File

@@ -23,8 +23,8 @@
///P
#import "LoginFullInfoPresenter.h"
#import "LoginFullInfoProtocol.h"
#import "PILoginManager.h"
UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
@interface LoginFullInfoViewController ()<LoginFullInfoProtocol>
@@ -261,10 +261,15 @@
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventLoginRepariSuccess];
/// ticket tabbaritem
[[AccountInfoStorage instance] saveTicket:nil];
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:^{
}];
[XPAdjustEvent registeringEvent];
NSString * inviteCode = self.codeTextField.text.length > 0 ? self.codeTextField.text : @"";
[PILoginManager jumpToHomeVCWithInviteCode:inviteCode];
[[NSNotificationCenter defaultCenter] postNotificationName:kUserCompleteInfoFinishKey object:inviteCode];
}
-(void)complementInfoFail{
[XNDJTDDLoadingTool hideOnlyView:self.view];

View File

@@ -17,7 +17,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPLoginAuthCodeVC : MvpViewController
@property(nonatomic,weak) id<XPLoginAuthCodeVCDelegate>delegate;
@property(nonatomic,assign) BOOL pi_isPush;
@end
NS_ASSUME_NONNULL_END

View File

@@ -9,7 +9,6 @@
#import "XPLoginInputView.h"
#import <ReactiveObjC.h>
#import "LoginVerifCodePresent.h"
#import "LoginFullInfoViewController.h"
@interface XPLoginAuthCodeVC ()
///
@property(nonatomic,strong) UIImageView *bgImageView;
@@ -23,9 +22,6 @@
@end
@implementation XPLoginAuthCodeVC
- (BOOL)isHiddenNavBar {
return YES;
}
- (LoginVerifCodePresent *)createPresenter {
return [[LoginVerifCodePresent alloc] init];
}
@@ -93,17 +89,11 @@
- (void)bindAuthorizationCodeSuccess{
[self hideHUD];
[self showSuccessToast:YMLocalizedString(@"XPLoginAuthCodeVC2")];
self.loginBtn.enabled = YES;
if(self.pi_isPush == YES){
LoginFullInfoViewController * FullVC = [[LoginFullInfoViewController alloc] init];
[self.navigationController pushViewController:FullVC animated:YES];
return;
}
[self dismissViewControllerAnimated:YES completion:nil];
if(self.delegate && [self.delegate respondsToSelector:@selector(bindCodeSuccess)]){
[self.delegate bindCodeSuccess];
}
self.loginBtn.enabled = YES;
}
-(void)bindAuthorizationCodeFail{
[self hideHUD];

View File

@@ -11,7 +11,7 @@
#import <ReactiveObjC.h>
#import "XPLoginInputView.h"
#import "PILoginManager.h"
#import "XPLoginPwdViewController.h"
#import "XPLoginAraeViewController.h"
#import "LoginVerifCodePresent.h"
@@ -231,13 +231,23 @@
[[NSUserDefaults standardUserDefaults]setValue:@(ThirdLoginType_Phone) forKey:@"kLoginSuccessType"];
[[NSUserDefaults standardUserDefaults]synchronize];
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
[PILoginManager loginWithVC:self isLoginPhone:YES];
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:NO];
}
- (void)loginSuccess {
[XNDJTDDLoadingTool hideOnlyView:self.view];
[[NSUserDefaults standardUserDefaults]removeObjectForKey:@"kLoginSuccessType"];
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
[PILoginManager loginWithVC:self isLoginPhone:NO];
UIViewController *vc = self.presentingViewController;
while (vc.presentingViewController) {
vc = vc.presentingViewController;
}
[vc dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:NO];
}
- (void)loginFailWithMsg:(NSString *)msg{
[self showErrorToast:msg];

View File

@@ -26,7 +26,7 @@
#import "AESUtils.h"
#import "LoginPresenter.h"
#import "LoginProtocol.h"
#import "PILoginManager.h"
UIKIT_EXTERN NSString * const kYouMiNumberCountKey;
NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
@@ -54,7 +54,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
///qq
@property (nonatomic, strong) UIButton *lineButtonView;
@property (nonatomic, strong) UIButton *appleButton;
///
@property (nonatomic,strong) GIDConfiguration *configuration;
@@ -89,10 +89,10 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
- (void)createUI {
self.view.backgroundColor = [UIColor whiteColor];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@"hadAgree" forKey:HadAgreePrivacy];
[defaults synchronize];
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.logoView];
[self.view addSubview:self.stackView];
@@ -104,7 +104,9 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
[self.view addSubview:self.authBubbleView];
[self.authBubbleView addSubview:self.authBubbleLabel];
if (@available(iOS 13.0, *)) {
[self.stackView addArrangedSubview:self.appleButton];
}
[self.stackView addArrangedSubview:self.googleButtonView];
[self.stackView addArrangedSubview:self.fbButtonView];
[self.stackView addArrangedSubview:self.lineButtonView];
@@ -122,7 +124,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(122));
make.top.mas_equalTo(self.self.logoView.mas_bottom).offset(kGetScaleWidth(60));
make.centerX.mas_equalTo(self.view);
}];
@@ -158,7 +160,10 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
make.bottom.mas_equalTo(self.authBubbleView).mas_offset(-6);
}];
[self.appleButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(295));
make.height.mas_equalTo(kGetScaleWidth(46));
}];
[self.googleButtonView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(kGetScaleWidth(295));
make.height.mas_equalTo(kGetScaleWidth(46));
@@ -174,17 +179,21 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
id type = [[NSUserDefaults standardUserDefaults]valueForKey:@"kLoginSuccessType"];
if(type != nil){
[self.view addSubview:self.nextView];
[self.nextView addSubview:self.nextLabel];
UIButton *typeButton ;
if([type intValue] == 8){
if([type intValue] == ThirdLoginType_Apple){
typeButton = self.appleButton;
}else if([type intValue] == ThirdLoginType_Gmail){
typeButton = self.googleButtonView;
}else if([type intValue] == 10){
}else if([type intValue] == ThirdLoginType_FB){
typeButton = self.fbButtonView;
}else{
}else if([type intValue] == ThirdLoginType_Line){
typeButton = self.lineButtonView;
}
if(typeButton == nil){
return;
}
[self.view addSubview:self.nextView];
[self.nextView addSubview:self.nextLabel];
[self.nextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-kGetScaleWidth(28));
make.width.mas_equalTo(kGetScaleWidth(70));
@@ -278,7 +287,7 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
#pragma mark - LoginProtocol
- (void)loginSuccess {
[PILoginManager loginWithVC:self isLoginPhone:NO];
[self dismissViewControllerAnimated:YES completion:nil];
[self showSuccessToast:YMLocalizedString(@"XPLoginViewController4")];
}
@@ -436,7 +445,22 @@ NSString * const HadAgreePrivacy = @"HadAgreePrivacy";
}
return _lineButtonView;
}
- (UIButton *)appleButton {
if (!_appleButton) {
_appleButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_appleButton setImage: [UIImage imageNamed:@"login_apple"] forState:UIControlStateNormal];
[_appleButton setTitle:YMLocalizedString(@"XPLoginViewController12") forState:UIControlStateNormal];
_appleButton.titleLabel.font = kFontMedium(16);
[_appleButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_appleButton setImageEdgeInsets:UIEdgeInsetsMake(0, kGetScaleWidth(28), 0, kGetScaleWidth(200))];
_appleButton.backgroundColor = UIColorFromRGB(0x141414);
_appleButton.layer.cornerRadius = kGetScaleWidth(46)/2;
_appleButton.layer.masksToBounds = YES;
_appleButton.tag = 1000 + ThirdLoginType_Apple;
[_appleButton addTarget:self action:@selector(loginDidClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _appleButton;
}
- (GIDConfiguration *)configuration{

View File

@@ -26,6 +26,7 @@
#import "XPRoomViewController.h"
#import "XPWebViewController.h"
#import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPMineUserInfoViewController.h"
#import "XPMineSimpleUserInfoViewController.h"
#import "XPMineDressUpViewController.h"
@@ -142,10 +143,10 @@
case SecretaryRouterType_Purse:
case SecretaryRouterType_Recharge:
{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
rechargeVC.type = @"4";
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
}
break;
case SecretaryRouterType_UserInfo:

View File

@@ -72,7 +72,7 @@
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset((10));
make.right.mas_lessThanOrEqualTo(self.findButton.mas_left).mas_offset(-0);
make.right.mas_lessThanOrEqualTo(self.findButton.mas_left).mas_offset(-(10));
make.height.mas_equalTo(((20)));
make.top.equalTo(self.avatarImageView.mas_top).mas_offset((3));
}];
@@ -96,15 +96,7 @@
make.right.mas_equalTo(self.contentView).offset(-(15));
}];
CGFloat width = 28 * 20 / 14;
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
}
#pragma mark - Event Response
@@ -119,9 +111,6 @@
_fansInfo = fansInfo;
if (_fansInfo) {
self.avatarImageView.imageUrl = _fansInfo.avatar;
if(_fansInfo.nick.length > 5){
_fansInfo.nick = [NSString stringWithFormat:@"%@...",[_fansInfo.nick substringToIndex:5]];
}
self.nickLabel.text = _fansInfo.nick;
self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : YMLocalizedString(@"XPMineAttentionTableViewCell0");
if (_fansInfo.useingType != ContactUseingType_In_Room && _fansInfo.useingType != ContactUseingType_Share) {
@@ -142,7 +131,35 @@
self.sexImageView.selected = _fansInfo.gender != GenderType_Male;
self.findButton.hidden = _fansInfo.userInRoomUid.length <= 0;
UIImage* image = self.experImageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_fansInfo.experUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage* charmImage = self.charmImageView.image;
if (charmImage) {
CGFloat scale = charmImage.size.width / charmImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_fansInfo.charmUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage *nobleImage = self.nobleImageView.image;
if (nobleImage) {
@@ -239,7 +256,7 @@
- (NetImageView *)experImageView {
if (!_experImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_experImageView = [[NetImageView alloc] initWithConfig:config];
_experImageView.layer.maskedCorners = YES;
_experImageView.contentMode = UIViewContentModeScaleAspectFit;
@@ -250,7 +267,7 @@
- (NetImageView *)charmImageView {
if (!_charmImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_charmImageView = [[NetImageView alloc] initWithConfig:config];
_charmImageView.layer.maskedCorners = YES;
_charmImageView.contentMode = UIViewContentModeScaleAspectFit;

View File

@@ -73,7 +73,7 @@
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset((10));
make.right.mas_lessThanOrEqualTo(self.attentionButton.mas_left).mas_offset(-0);
make.right.mas_lessThanOrEqualTo(self.attentionButton.mas_left).mas_offset(-(10));
make.height.mas_equalTo(20);
make.top.equalTo(self.avatarImageView.mas_top).mas_offset((3));
}];
@@ -97,15 +97,7 @@
make.right.mas_equalTo(self.contentView).offset(-(15));
}];
CGFloat width = 28 * 20 / 14;
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
}
#pragma mark - Event Response
@@ -120,9 +112,7 @@
_fansInfo = fansInfo;
if (_fansInfo) {
self.avatarImageView.imageUrl = _fansInfo.avatar;
if(_fansInfo.nick.length > 5){
_fansInfo.nick = [NSString stringWithFormat:@"%@...",[_fansInfo.nick substringToIndex:5]];
}
self.nickLabel.text = _fansInfo.nick;
self.signLabel.text = _fansInfo.userDesc && _fansInfo.userDesc.length > 0? _fansInfo.userDesc : YMLocalizedString(@"XPMineFansTableViewCell0");
if (_fansInfo.useingType != ContactUseingType_In_Room && _fansInfo.useingType != ContactUseingType_Share) {
@@ -147,7 +137,35 @@
BOOL isMyFriend = [[NIMSDK sharedSDK].userManager isMyFriend:_fansInfo.uid];
self.attentionButton.enabled = !isMyFriend;
self.attentionButton.hidden = NO;
UIImage* image = self.experImageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_fansInfo.experUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage* charmImage = self.charmImageView.image;
if (charmImage) {
CGFloat scale = charmImage.size.width / charmImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_fansInfo.charmUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage *nobleImage = self.nobleImageView.image;
if (nobleImage) {
@@ -245,7 +263,7 @@
- (NetImageView *)experImageView {
if (!_experImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_experImageView = [[NetImageView alloc] initWithConfig:config];
}
return _experImageView;
@@ -254,7 +272,7 @@
- (NetImageView *)charmImageView {
if (!_charmImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_charmImageView = [[NetImageView alloc] initWithConfig:config];
}
return _charmImageView;

View File

@@ -76,15 +76,7 @@
make.left.mas_equalTo(self.stackView);
make.top.mas_equalTo(self.stackView.mas_bottom).offset(7);
}];
CGFloat width = 28 * 20 / 14;
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
}
#pragma mark - Getters And Setters
@@ -103,7 +95,35 @@
self.sexImageView.backgroundColor = _userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC);
self.sexImageView.titleEdgeInsets = _userInfo.gender != GenderType_Male ? UIEdgeInsetsMake(0, 2, 0, 0):UIEdgeInsetsMake(0, -1, 0, 0);
self.sexImageView.selected = _userInfo.gender != GenderType_Male;
UIImage* image = self.experImageView.image;
if (image) {
CGFloat scale = image.size.width / image.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_userInfo.userLevelVo.experUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.experImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
UIImage* charmImage = self.charmImageView.image;
if (charmImage) {
CGFloat scale = charmImage.size.width / charmImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
} else {
NSURL *imgUrl = [NSURL URLWithString:_userInfo.userLevelVo.charmUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
[self.charmImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
}];
}
}
}
@@ -157,7 +177,7 @@
- (NetImageView *)experImageView {
if (!_experImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_experImageView = [[NetImageView alloc] initWithConfig:config];
}
return _experImageView;
@@ -166,7 +186,7 @@
- (NetImageView *)charmImageView {
if (!_charmImageView) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_charmImageView = [[NetImageView alloc] initWithConfig:config];
}
return _charmImageView;

View File

@@ -28,6 +28,7 @@
#import "XPMineDressUpViewController.h"
#import "XPDressUpShopCardViewController.h"
#import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
@interface XPDressUpShopViewController ()<JXCategoryViewDelegate, JXCategoryListContainerViewDelegate, SDCycleScrollViewDelegate>
@@ -232,10 +233,10 @@
}
- (void)rechargeButtonAction:(UIButton *)sender {
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
// XPMineRechargeViewController *vc = [[XPMineRechargeViewController alloc] init];
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
rechargeVC.type = @"4";
[self.navigationController pushViewController:rechargeVC animated:YES];
}
#pragma mark - Getters And Setters

View File

@@ -104,19 +104,19 @@
make.width.mas_equalTo(28);
}];
CGFloat width = 28 * 20 / 14;
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(28);
make.height.mas_equalTo(14);
}];
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(width);
make.width.mas_equalTo(28);
make.height.mas_equalTo(14);
}];
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(6);
make.height.mas_equalTo(20);
make.height.mas_equalTo(14);
make.bottom.mas_equalTo(self.avatarImageView.mas_centerY).offset(-3);
}];
@@ -163,13 +163,21 @@
if (_memberInfo.experUrl) {
if (self.experImageView.state == NetImageStateLoaded) {
self.experImageView.imageUrl = _memberInfo.experUrl;
CGFloat kImageScale = self.experImageView.image.size.width / self.experImageView.image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.experImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
} else {
@kWeakify(self);
[self.experImageView loadImageWithUrl:_memberInfo.experUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
self.experImageView.image = image;
CGFloat kImageScale = image.size.width / image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.experImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
}];
}
}
@@ -178,13 +186,21 @@
if (_memberInfo.charmUrl) {
if (self.charmImageView.state == NetImageStateLoaded) {
self.charmImageView.imageUrl = _memberInfo.charmUrl;
CGFloat kImageScale = self.charmImageView.image.size.width / self.charmImageView.image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.charmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
} else {
@kWeakify(self);
[self.charmImageView loadImageWithUrl:_memberInfo.charmUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@kStrongify(self);
self.charmImageView.image = image;
CGFloat kImageScale = image.size.width / image.size.height;
CGFloat imageWidth = 20 * kImageScale;
[self.charmImageView mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(imageWidth);
}];
}];
}
}
@@ -375,7 +391,7 @@
_nickStackView = [[UIStackView alloc] init];
_nickStackView.axis = UILayoutConstraintAxisHorizontal;
_nickStackView.distribution = UIStackViewDistributionFill;
_nickStackView.alignment = UIStackViewAlignmentCenter;
_nickStackView.alignment = UIStackViewAlignmentFill;
_nickStackView.spacing = 2;
}
return _nickStackView;
@@ -413,7 +429,7 @@
_experImageView = [[NetImageView alloc] initWithConfig:config];
_experImageView.userInteractionEnabled = YES;
_experImageView.hidden = YES;
_experImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _experImageView;
}
@@ -426,7 +442,7 @@
_charmImageView = [[NetImageView alloc] initWithConfig:config];
_charmImageView.userInteractionEnabled = YES;
_charmImageView.hidden = YES;
_charmImageView.contentMode = UIViewContentModeScaleAspectFit;
}
return _charmImageView;
}

View File

@@ -12,6 +12,7 @@
#import "XPWebViewController.h"
#import "XPExchangeDiamondsVC.h"
#import "XPIncomeRecordGoldDetailsVC.h"
#import "XPIAPRechargeViewController.h"
///Present
#import "XPIncomeRecordPresent.h"
///Protocol
@@ -115,9 +116,8 @@
}
case ClickType_Diamond_Pay:
{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
[self.navigationController pushViewController:webVC animated:YES];
break;
}
@@ -138,16 +138,16 @@
default:
{
NSString * myUid = [AccountInfoStorage instance].getUid;
if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
// NSString * myUid = [AccountInfoStorage instance].getUid;
// if(![self.clanInfo.clan.elderUid isEqualToString:myUid]){
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = URLWithType(kGoldEarningsRecord);
[self.navigationController pushViewController:webVC animated:YES];
return;
}
XPIncomeRecordGoldDetailsVC *goldDetailVC = [XPIncomeRecordGoldDetailsVC new];
[self.navigationController pushViewController:goldDetailVC animated:YES];
// return;
//
// }
// XPIncomeRecordGoldDetailsVC *goldDetailVC = [XPIncomeRecordGoldDetailsVC new];
// [self.navigationController pushViewController:goldDetailVC animated:YES];
break;
}
}

View File

@@ -38,7 +38,7 @@
UserInfoModel * infoModel = [UserInfoModel modelWithDictionary:data.data];
[[self getView] onGetUserInfoSuccess:infoModel];
} fail:^(NSInteger code, NSString * _Nullable msg) {
NSLog(@"111");
}] uid:uid];
}

View File

@@ -51,7 +51,7 @@
}];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.leading.bottom.equalTo(self);
make.height.mas_equalTo(319);
make.height.mas_equalTo(375);
}];
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(24);
@@ -158,7 +158,7 @@
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = 56;
_tableView.scrollEnabled = NO;
_tableView.backgroundColor = [UIColor whiteColor];
[_tableView registerClass:[XPNobleCenterPayCell class] forCellReuseIdentifier:NSStringFromClass([XPNobleCenterPayCell class])];
}
@@ -180,7 +180,7 @@
}
- (NSArray *)listData{
if(!_listData){
_listData = @[YMLocalizedString(@"XPNobleCenterPayView2")];
_listData = @[YMLocalizedString(@"XPNobleCenterPayView2"),@"Apple Pay"];
}
return _listData;
}

View File

@@ -17,7 +17,7 @@
#import "DJDKMIMOMColor.h"
#import "ThemeColor+NobleCenter.h"
#import "Api+NobleCenter.h"
#import "Api+Main.h"
#import "RechargeStorage.h"
#import "AccountInfoStorage.h"
@@ -31,6 +31,7 @@
#import "XPWebViewController.h"
#import "XPNobleSettingViewController.h"
#import "XPSkillCardPlayerManager.h"
#import "SessionViewController.h"
///P
#import "XPNobleCenterPresenter.h"
#import "Api+Gift.h"
@@ -42,6 +43,9 @@
#import "WalletInfoModel.h"
#import "XPNobleCenterPayView.h"
#import "XPNobleCenterProtocol.h"
#import "XPIAPRechargeViewController.h"
#import "YuMi-swift.h"
#import "ClientConfig.h"
@interface XPNobleCenterViewController ()<XPNobleCenterProtocol,XPNobleCenterPayViewDelegate,JXCategoryViewDelegate, JXCategoryListContainerViewDelegate,XPNobleCenterNavViewDelegate, NIMSystemNotificationManagerDelegate>
///
@property (nonatomic, strong) NSArray<NSString *> *titles;
@@ -78,6 +82,7 @@
@property (nonatomic, assign) NSInteger roomUid;
@property (nonatomic,strong) WalletInfoModel * infoModel;
@property(nonatomic,strong) UIButton *rankBtn;
@property(nonatomic,assign) BOOL pi_IsNative;
@end
@implementation XPNobleCenterViewController
@@ -96,14 +101,13 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.pi_IsNative = YES;
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
[self requestHttp];
[self initSubViews];
[self initSubViewConstraints];
}
- (BOOL)isHiddenNavBar {
return YES;
}
@@ -115,8 +119,8 @@
[self.presenter getUserInfo];
}
if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
}
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
}
}
- (XPNobleCenterPresenter *)createPresenter {
@@ -143,7 +147,7 @@
make.leading.top.trailing.mas_equalTo(self.view);
make.height.mas_equalTo(height);
}];
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self.view);
make.height.mas_equalTo(kNavigationHeight);
@@ -153,7 +157,7 @@
make.height.mas_equalTo(40);
make.top.mas_equalTo(self.navView.mas_bottom);
}];
[self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.bottom.mas_equalTo(self.view);
make.top.mas_equalTo(self.titleView.mas_bottom);
@@ -177,7 +181,7 @@
make.width.height.mas_equalTo(20);
make.centerY.equalTo(self.openNobleView);
make.trailing.equalTo(self.openNobleButton.mas_leading).mas_offset(-2);
}];
[self.rankBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(57);
@@ -185,7 +189,7 @@
make.trailing.mas_equalTo(-24);
make.top.mas_equalTo(139);
}];
}
#pragma mark - XPNobleCenterPayViewDelegate
- (void)payWithType:(NobleCenterPayType)type{
@@ -195,12 +199,11 @@
config.message = YMLocalizedString(@"XPNobleCenterViewController3");
config.actionStyle = TTAlertActionBothStyle;
[TTPopup alertWithConfig:config showBorder:NO confirmHandler:^{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"5",[YYUtility deviceID]];
webVC.isPush = YES;
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
[self.navigationController pushViewController:webVC animated:YES];
} cancelHandler:^{
}];
return;
}
@@ -208,10 +211,22 @@
[self.presenter openVipWithDiamondRoomUid:roomUid];
return;
}
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"5",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
if(self.pi_IsNative == NO){
XPWebViewController *vc = [[XPWebViewController alloc]init];
NSString *channel = @"p";
channel = [NSString stringWithFormat:@"%@a",channel];
channel = [NSString stringWithFormat:@"%@y",channel];
NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,@"5",[YYUtility deviceID]];
vc.url = url;
[self.navigationController pushViewController:vc animated:YES];
return;
}
if(self.rechargeModel.list.count == 0)return;
[XNDJTDDLoadingTool showOnlyView:kWindow];
RechargeListModel *rechargeModel = [self.rechargeModel.list safeObjectAtIndex1:0];
[self.presenter requestNobleIAPRechargeOrderWithChargeProdId:rechargeModel.chargeProdId roomUid:self.roomUid ? [NSString stringWithFormat:@"%zd", self.roomUid] : nil];
}
-(void)openVipWithDiamondSuccess{
[self requestHttp];
@@ -222,6 +237,7 @@
///
- (void)requestHttp {
[self.presenter getUserInfo];
[self checkTranscationIds];
[self.presenter getNobleChargeProductListWithChannelType:@"9"];
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
@@ -231,9 +247,36 @@
self.infoModel = model;
}
} uid:uid ticket:ticket];
if([ClientConfig shareConfig].canOpen){
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
if(data.data[@"isNative"] != nil){
self.pi_IsNative = [data.data[@"isNative"] boolValue];
}
}
}];
}
}
///
- (void)checkTranscationIds {
NSString * uid = [AccountInfoStorage instance].getUid;
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
for (NSDictionary *transcation in array) {
NSString *orderId = transcation[@"orderId"];
NSString *transcationId = transcation[@"transcationId"];
///
[self.presenter checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO];
}
}
#pragma mark - XPNobleCenterProtocol
///
@@ -276,29 +319,176 @@
self.openNobleButton.text = title;
}
///id
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
if (orderId.length > 0) {
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreStateResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
[self rechargeSuccess:transactionId];
}
break;
default:
{
}
break;
}
};
} else {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController10")];
}
} else {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
}
}
///
- (void)requestIAPRechargeOrderFail:(NSString *)message code:(NSInteger)code {
[self hideHUD];
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if(code == 50000){
TTAlertConfig *config = [[TTAlertConfig alloc]init];
config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
config.message = YMLocalizedString(@"XPIAPRechargeViewController8");
TTAlertButtonConfig *confirmButtonConfig = [[TTAlertButtonConfig alloc]init];
confirmButtonConfig.title = YMLocalizedString(@"XPIAPRechargeViewController9");
UIImage *image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x13E2F5),UIColorFromRGB(0x9DB4FF),UIColorFromRGB(0xCC67FF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(200, 200)];
confirmButtonConfig.backgroundColor = [UIColor colorWithPatternImage:image];
confirmButtonConfig.cornerRadius = 38/2;
config.confirmButtonConfig = confirmButtonConfig;
[TTPopup alertWithConfig:config confirmHandler:^{
[self.presenter getContactCustomerService];
} cancelHandler:^{
}];
return;
}
[self showErrorToast:message];
}
- (void)getContactCustomerServiceSuccessWithUid:(NSString *)uid{
[self hideHUD];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:sessionVC animated:YES];
});
}
///
- (void)checkReceiptSuccess:(NSString *)transcationId {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
self.orderId = nil;
//5
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (!self.userInfo.userVipInfoVO) {
///
[self.presenter getUserInfo];
}
});
}
- (void)checkReceiptFailWithCode:(NSInteger)code transcationId:(NSString *)transcationId{
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
}
}
///
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid];
if (deleteSuccess) {
#warning to do
}
}
- (void)checkTranscationIdsSuccess {
NSString * uid = [AccountInfoStorage instance].getUid;
[RechargeStorage delegateAllTranscationIdsWithUid:uid];
}
-(void)rankAction{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = URLWithType(kNobleRankURL);
[self.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
}else if (status == StoreStateResultUnowned) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController0")];
}
}
///id
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
///
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
///
[self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
}
///
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
[dictionary setObject:encodeStr forKey:@"recipt"];
[dictionary setObject:self.orderId forKey:@"orderId"];
NSString *reciptJson = [dictionary toJSONString];
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
if (!saveSuccess) {
#warning to do
}
}
#pragma mark - JXCategoryViewDelegate
@@ -371,7 +561,7 @@
payView.delegate = self;
[self.view addSubview:payView];
}
#pragma mark - Getters And Setters
@@ -448,7 +638,7 @@
_openNobleButton.textColor = [DJDKMIMOMColor mainTextColor];
_openNobleButton.numberOfLines = 0;
_openNobleButton.textAlignment = NSTextAlignmentCenter;
}
return _openNobleButton;
}

View File

@@ -119,7 +119,7 @@
NSString *channel = @"p";
channel = [NSString stringWithFormat:@"%@a",channel];
channel = [NSString stringWithFormat:@"%@y",channel];
NSString *url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),self.type,[YYUtility deviceID]];
NSString *url = [NSString stringWithFormat:URLWithType(kChannelUrl),channel,self.type,[YYUtility deviceID]];
vc.url = url;
[self addChildViewController:vc];
vc.view.frame = self.view.frame;
@@ -263,7 +263,7 @@
// }
// if(list.count > 0){
// if (@available(iOS 15.0, *)) {
// PIIAPRegulate *iap = [PIIAPRegulate shared];
// PIIAPManagers *iap = [PIIAPManagers shared];
// [iap allTransactionWithList:list completionHandler:^{
//
// }];
@@ -285,16 +285,9 @@
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
if(transactionIdentifier != nil){
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
}
if(encodeStr != nil){
[dictionary setObject:encodeStr forKey:@"recipt"];
}
if(self.orderId != nil){
[dictionary setObject:self.orderId forKey:@"orderId"];
}
if(dictionary.allKeys.count == 0)return;
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
[dictionary setObject:encodeStr forKey:@"recipt"];
[dictionary setObject:self.orderId forKey:@"orderId"];
NSString *reciptJson = [dictionary toJSONString];
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
@@ -319,12 +312,12 @@
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreConditionResult)status {
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
if (status == StoreConditionResultPay || status == StoreConditionResultStart || status == StoreConditionResultVerifiedServer) {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
}else if (status == StoreConditionResultUnowned) {
}else if (status == StoreStateResultUnowned) {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
[self showErrorToast:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
@@ -354,17 +347,17 @@
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap demandShopedThingWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.ConditionBlock = ^(enum StoreConditionResult state, NSDictionary<NSString *,id> * _Nullable result) {
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreConditionResultVerifiedServer:
case StoreStateResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
@@ -429,8 +422,8 @@
- (void)checkReceiptSuccess:(NSString *)transcationId {
[XNDJTDDLoadingTool hideHUDInView:kWindow];
if (@available(iOS 15.0, *)) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
@@ -447,8 +440,8 @@
[XNDJTDDLoadingTool hideHUDInView:kWindow];
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPRegulate *iap = [PIIAPRegulate shared];
[iap verifyBusinessFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}

View File

@@ -133,16 +133,9 @@
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
if(transactionIdentifier != nil){
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
}
if(encodeStr != nil){
[dictionary setObject:encodeStr forKey:@"recipt"];
}
if(self.orderId != nil){
[dictionary setObject:self.orderId forKey:@"orderId"];
}
if(dictionary.allKeys.count == 0)return;
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
[dictionary setObject:encodeStr forKey:@"recipt"];
[dictionary setObject:self.orderId forKey:@"orderId"];
NSString *reciptJson = [dictionary toJSONString];
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];

View File

@@ -55,8 +55,13 @@
#import "XPMineCollectRoomListViewController.h"
#import "XPMineMainGuildListVC.h"
#import "XPMineGiveDiamondVC.h"
#import "XPIAPRechargeViewController.h"
#import "XPIncomeRecordVC.h"
#import "XPNobleCenterViewController.h"
#import "LittleGameInfoModel.h"
#import "HomeLittleGameRoomModel.h"
#import "XPLittleGameRoomOpenView.h"
#import "XPMineGameTableViewCell.h"
UIKIT_EXTERN NSString *kRequestRicket;
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPHomeBannerTableViewCellDelegate>
@@ -82,6 +87,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
@property (nonatomic,assign) BOOL isRefreshRoomInfo;
///,
@property (nonatomic,assign) BOOL isRequestData;
///
@property (nonatomic, strong) NSMutableArray<LittleGameInfoModel *> *littleGameArray;
@end
@implementation XPMineViewController
@@ -174,9 +183,15 @@ UIKIT_EXTERN NSString *kRequestRicket;
if (@available(iOS 15.0, *)) {//iOS1522
self.tableView.sectionHeaderTopPadding = 0;
}
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(requestRicketSuccess:) name:kRequestRicket object:nil];
}
-(void)requestRicketSuccess:(NSNotification *)not{
if([not.object isKindOfClass:[NSDictionary class]])return;
BOOL is = [not.object boolValue];
if(is == YES){
[self.presenter getUserInfo];
}
}
- (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(0);
@@ -219,8 +234,22 @@ UIKIT_EXTERN NSString *kRequestRicket;
break;
case XPMineItemType_My_Room:
{
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[XPRoomViewController openRoom:roomUid viewController:self];
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
if (roomInfo.isReselect) {
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
roomOpenView.roomInfo = roomInfo;
roomOpenView.currentVC = self;
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
} else {
[XPRoomViewController openRoom:roomUid viewController:self];
}
} else {
[self showErrorToast:msg];
}
} uid:roomUid intoUid:roomUid];
}
break;
case XPMineItemType_Collect_Room://
@@ -408,10 +437,9 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
///
-(void)pushThirdPartyPayVC{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.type = @"4";
[self.navigationController pushViewController:webVC animated:YES];
}
///
-(void)pushEarningsRecordVC{
@@ -425,9 +453,24 @@ UIKIT_EXTERN NSString *kRequestRicket;
///
-(void)pushMyRoomVC{
if(self.isRefreshRoomInfo == YES)return;
self.isRefreshRoomInfo = YES;
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[XPRoomViewController openRoom:roomUid viewController:self];
self.isRefreshRoomInfo = YES;
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
self.isRefreshRoomInfo = NO;
if (code == 200) {
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
if (roomInfo.isReselect) {
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
roomOpenView.roomInfo = roomInfo;
roomOpenView.currentVC = self;
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
} else {
[XPRoomViewController openRoom:roomUid viewController:self];
}
} else {
[self showErrorToast:msg];
}
} uid:roomUid intoUid:roomUid];
}
#pragma mark - XPMineHeadViewDelegate
///
@@ -485,7 +528,21 @@ UIKIT_EXTERN NSString *kRequestRicket;
- (void)onGetMineFuntionItemFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///
- (void)onGetLittleGameListSuccess:(NSArray<LittleGameInfoModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
[self.littleGameArray removeAllObjects];
[self.littleGameArray addObjectsFromArray:items];
dispatch_group_leave(group);
NSMutableArray *array = [NSMutableArray array];
for (LittleGameInfoModel *item in self.littleGameArray) {
[array addObject:item.name];
}
NSString *trackName = [array componentsJoinedByString:@","];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_show eventAttributes:@{@"gameName" : trackName}];
}
- (void)onGetLittleGameListFailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///banner
- (void)onGetPersonalBannerListSuccess:(NSArray<HomeBannerInfoModel *> *)items WithGroup:(nonnull dispatch_group_t)group{
[self.bannerArray removeAllObjects];
@@ -534,7 +591,10 @@ UIKIT_EXTERN NSString *kRequestRicket;
dispatch_group_async(group, queue, ^{
[self.presenter getPersonItemListWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getLittleGameListWithGroup:group];
});
dispatch_group_enter(group);
dispatch_group_async(group, queue, ^{
[self.presenter getMineBannerListWithGroup:group];
@@ -543,6 +603,8 @@ UIKIT_EXTERN NSString *kRequestRicket;
dispatch_group_async(group, queue, ^{
[self.presenter getNobleInfoWithGroup:group];
});
dispatch_group_notify(group,dispatch_get_main_queue(), ^{
self.isRequestData = NO;
self.userInfo = userInfo;
@@ -580,6 +642,58 @@ UIKIT_EXTERN NSString *kRequestRicket;
- (void)onGetClanDetailInfofailWithGroup:(dispatch_group_t)group{
dispatch_group_leave(group);
}
///
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
if (roomInfo.isPick && roomInfo.uid.length > 0) {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomInfo.uid}];
[XPRoomViewController openRoom:roomInfo.uid viewController:self];
} else if (roomInfo.needOpenSelfRoom) {
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomUid}];
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
if (roomInfo.mgId != [mgId intValue]) {///
NSMutableDictionary * params = [NSMutableDictionary dictionary];
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[params setObject:ticket forKey:@"ticket"];
[params setObject:uid forKey:@"uid"];
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
if (roomInfo.title.length > 0) {
[params setObject:roomInfo.title forKey:@"title"];
}
if (roomInfo.roomPwd.length > 0) {
[params setObject:roomInfo.roomPwd forKey:@"roomPwd"];
} else{
[params setObject:@"" forKey:@"roomPwd"];
}
if (roomInfo.tagId > 0) {
[params setObject:[NSString stringWithFormat:@"%ld", roomInfo.tagId] forKey:@"tagId"];
}
[params setObject:@(RoomType_MiniGame) forKey:@"type"];
[params setObject:mgId forKey:@"mgId"];
[params setObject:@(roomInfo.hasAnimationEffect) forKey:@"hasAnimationEffect"];
[Api ownerUpdateRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
[XPRoomViewController openRoom:[AccountInfoStorage instance].getUid mgId:mgId viewController:self];
}
} params:params];
}
} else {
[self showErrorToast:msg];
}
} uid:roomUid intoUid:roomUid];
}
}
///
- (void)quickMatchLittleGameRoomFail:(NSString *)mgId {
[XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self];
}
#pragma mark - XPMineHeadItemTableViewCellDelegate
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
@@ -609,7 +723,11 @@ UIKIT_EXTERN NSString *kRequestRicket;
break;
}
}
#pragma mark - XPMineGameTableViewCellDelegate
///
- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item {
[self.presenter quickMatchLittleGameWithMgId:item.mgId];
}
#pragma mark - NSNotification
- (void)onVisitorUnReadCountUpdate:(NSNotification *)noti {
@@ -623,7 +741,6 @@ UIKIT_EXTERN NSString *kRequestRicket;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;;
[_tableView registerClass:[XPMineTheGuildCell class] forCellReuseIdentifier:NSStringFromClass([XPMineTheGuildCell class])];
[_tableView registerClass:[XPMinePersonalCenterCell class] forCellReuseIdentifier:NSStringFromClass([XPMinePersonalCenterCell class])];
@@ -656,6 +773,12 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
return _functionArray;
}
- (NSMutableArray<LittleGameInfoModel *> *)littleGameArray {
if (!_littleGameArray) {
_littleGameArray = [NSMutableArray array];
}
return _littleGameArray;
}
- (NSMutableArray<HomeBannerInfoModel *> *)bannerArray {
if (!_bannerArray) {

View File

@@ -44,6 +44,7 @@
#import "XPMineUserInfoViewController.h"
#import "XPMineSimpleUserInfoViewController.h"
#import "XPMineRechargeViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
#import "XPMineDressUpViewController.h"
@@ -58,6 +59,7 @@
#import "XPMineCollectRoomListViewController.h"
#import "XPMineFeedbackViewController.h"
#import "XPMineSimpleUserInfoViewController.h"
#import "XPIAPRechargeViewController.h"
@interface XPSimpleMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPHomeBannerTableViewCellDelegate, XPMineProtocol, XPSimpleMineHeaderViewDelegate>
@@ -135,10 +137,10 @@
break;
case XPMineItemType_Account:
{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
[self.navigationController pushViewController:webVC animated:YES];
// XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
XPIAPRechargeViewController *rechargeVC = [[XPIAPRechargeViewController alloc] init];
rechargeVC.type = @"4";
[self.navigationController pushViewController:rechargeVC animated:YES];
}
break;
case XPMineItemType_Personinfo:
@@ -439,7 +441,7 @@
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
[_tableView registerClass:[XPMineItemTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineItemTableViewCell class])];
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
_tableView.contentInset = UIEdgeInsetsMake(0, 0, 100, 0);
}
return _tableView;
}

View File

@@ -26,7 +26,7 @@
[[self getView] getMonentsAttentionListSuccess:listInfo state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getMonentsAttentionListFail:msg state:state];
} showLoading:NO] dynamicId:dynamicId pageSize:pageSizeStr types:@"0,2"];
} showLoading:YES] dynamicId:dynamicId pageSize:pageSizeStr types:@"0,2"];
}
///

View File

@@ -26,7 +26,7 @@
[[self getView] getMonentsLatestListSuccess:listInfo state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getMonentsLatestListFail:msg state:state];
} showLoading:NO] dynamicId:dynamicId pageSize:pageSizeStr types:@"0,2"];
} showLoading:YES] dynamicId:dynamicId pageSize:pageSizeStr types:@"0,2"];
}
///

View File

@@ -26,7 +26,7 @@
[[self getView] getMonentsRecommendListSuccess:array state:state];
} fail:^(NSInteger code, NSString * _Nullable msg) {
[[self getView] getMonentsRecommendListFail:msg state:state];
} showLoading:NO] page:pageStr pageSize:pageSizeStr types:@"0,2"];
} showLoading:YES] page:pageStr pageSize:pageSizeStr types:@"0,2"];
}
@@ -40,7 +40,7 @@
[Api monentsTopicList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [MonentsTopicModel modelsWithArray:data.data[@"records"]];
[[self getView] monentsTopicListSuccess:array];
}showLoading:NO] uid:uid page:pageStr pageSize:pageSizeStr worldTypeId:@"1"];
}] uid:uid page:pageStr pageSize:pageSizeStr worldTypeId:@"1"];
}
///

View File

@@ -58,9 +58,15 @@ UIKIT_EXTERN NSString *kRequestRicket;
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.tableView];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(requestRicketSuccess:) name:kRequestRicket object:nil];
}
-(void)requestRicketSuccess:(NSNotification *)not{
if([not.object isKindOfClass:[NSDictionary class]])return;
BOOL is = [not.object boolValue];
if(is == YES){
[self headerRefresh];
}
}
- (void)initSubViewConstraints {
@@ -82,7 +88,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
[self.tableView.mj_header beginRefreshing];
[self headerRefresh];
}

View File

@@ -64,9 +64,15 @@ UIKIT_EXTERN NSString *kRequestRicket;
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(requestRicketSuccess:) name:kRequestRicket object:nil];
}
-(void)requestRicketSuccess:(NSNotification *)not{
if([not.object isKindOfClass:[NSDictionary class]])return;
BOOL is = [not.object boolValue];
if(is == YES){
[self headerRefresh];
}
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
@@ -81,7 +87,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
[self.tableView.mj_header beginRefreshing];
[self headerRefresh];
}

View File

@@ -71,10 +71,18 @@ UIKIT_EXTERN NSString *kRequestRicket;
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(requestRicketSuccess:) name:kRequestRicket object:nil];
}
-(void)requestRicketSuccess:(NSNotification *)not{
if([not.object isKindOfClass:[NSDictionary class]])return;
BOOL is = [not.object boolValue];
if(is == YES){
[self headerRefresh];
}else{
[XNDJTDDLoadingTool hideOnlyView:self.tabBarController.view];
}
}
#pragma mark -
- (void)initHeaderAndFooterRrfresh {
@@ -89,13 +97,13 @@ UIKIT_EXTERN NSString *kRequestRicket;
footer.stateLabel.textColor = [DJDKMIMOMColor secondTextColor];
footer.stateLabel.font = [UIFont systemFontOfSize:10.0];
self.tableView.mj_footer = footer;
[self.tableView.mj_header beginRefreshing];
[self headerRefresh];
}
#pragma mark - fangfa
- (void)headerRefresh {
[XNDJTDDLoadingTool showOnlyView:self.tabBarController.view];
if([AccountInfoStorage instance].isRequestRicket == YES){
return;
}
@@ -241,6 +249,7 @@ UIKIT_EXTERN NSString *kRequestRicket;
}
[self.tableView.mj_footer endRefreshing];
}
[XNDJTDDLoadingTool hideOnlyView:self.tabBarController.view];
[self.tableView reloadData];
}

View File

@@ -46,7 +46,6 @@ NS_ASSUME_NONNULL_BEGIN
//是否为周榜top1
@property(nonatomic,assign) BOOL isWeekTop1;
@property(nonatomic,copy) NSString *inRoomUid;
//是否在麦位
@property(nonatomic,assign) BOOL inMic;
///是否在线

View File

@@ -135,11 +135,8 @@
}
///
-(void)getFriendListWithGroup:(dispatch_group_t)group{
if([AccountInfoStorage instance].getUid.length == 0){
[[self getView]getFriendListFailWithGroup:group];
return;
}
[Api requsetFriendListComplection:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
if([AccountInfoStorage instance].getUid.length == 0)return;
NSArray * array = [HomePlayRoomModel modelsWithArray:data.data];
[[self getView]getFriendListSuccess:array withGroup:group];
} fail:^(NSInteger code, NSString * _Nullable msg) {

View File

@@ -159,9 +159,9 @@
- (NetImageView *)bgImageView{
if(!_bgImageView){
NetImageConfig *config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
config.placeHolder = [UIImageConstant defalutEmptyPlaceholder];
_bgImageView = [[NetImageView alloc]initWithConfig:config];
[_bgImageView setCornerWithLeftTopCorner:kGetScaleWidth(16) rightTopCorner:kGetScaleWidth(16) bottomLeftCorner:kGetScaleWidth(16) bottomRightCorner:kGetScaleWidth(16) size:CGSizeMake(kGetScaleWidth(170), kGetScaleWidth(174))];
[_bgImageView setCornerWithLeftTopCorner:kGetScaleWidth(14) rightTopCorner:kGetScaleWidth(14) bottomLeftCorner:kGetScaleWidth(15) bottomRightCorner:kGetScaleWidth(14) size:CGSizeMake(kGetScaleWidth(170), kGetScaleWidth(174))];
}
return _bgImageView;
}

View File

@@ -24,7 +24,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface XPNewHomePartyTableViewCell : UITableViewCell
@property (nonatomic,strong) HomePlayRoomModel *roomInfo;
@property (nonatomic,strong) HomeRecommendRoomModel *roomInfo1;
@property(nonatomic,weak) id<XPNewHomePartyTableViewCellDelegate>delegate;
///声音卡时svga是否播放动画
-(void)setPlaySoundStatus:(BOOL)isPlay;

View File

@@ -243,14 +243,7 @@
-(void)setPlaySoundTime:(NSInteger)time{
_audioView.voiceDura = @(time).stringValue;
}
- (void)setRoomInfo1:(HomeRecommendRoomModel *)roomInfo1 {
_roomInfo1 = roomInfo1;
if (_roomInfo1) {
}
}
-(void)didSelectItemAction{

View File

@@ -92,8 +92,6 @@
_collectionView.delegate = self;
_collectionView.tag = 9000002;
_collectionView.backgroundColor = [UIColor clearColor];
_collectionView.showsVerticalScrollIndicator = NO;
_collectionView.showsHorizontalScrollIndicator = NO;
[_collectionView registerClass:[XPNewHomePlayItemCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPNewHomePlayItemCollectionViewCell class])];
}
return _collectionView;

View File

@@ -1,19 +0,0 @@
//
// PIPageControl.h
// YuMi
//
// Created by duoban on 2023/10/8.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface PIPageControl : UIView
@property(nonatomic,assign) NSInteger numberOfPages;
@property(nonatomic,assign) NSInteger currentPage;
@property(nonatomic,strong) UIColor *currentPageIndicatorTintColor;
@property(nonatomic,strong) UIColor *pageIndicatorTintColor;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,35 +0,0 @@
//
// PIPageControl.m
// YuMi
//
// Created by duoban on 2023/10/8.
//
#import "PIPageControl.h"
@implementation PIPageControl
-(void)setNumberOfPages:(NSInteger)numberOfPages{
_numberOfPages = numberOfPages;
for (int i = 0; i < _numberOfPages; i++) {
UIView *dosView = [[UIView alloc]init];
dosView.tag = 100 + i;
[self addSubview:dosView];
CGFloat left = i * kGetScaleWidth(7);
[dosView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(4));
make.top.equalTo(self);
make.left.mas_equalTo(left);
}];
dosView.layer.cornerRadius = kGetScaleWidth(4)/2;
dosView.layer.masksToBounds = YES;
}
}
- (void)setCurrentPage:(NSInteger)currentPage{
_currentPage = currentPage;
for (int i = 0; i < _numberOfPages; i++) {
UIView *dosView = [self viewWithTag:100 + i];
dosView.backgroundColor = _currentPage == i ? _currentPageIndicatorTintColor : _pageIndicatorTintColor;
}
}
@end

View File

@@ -8,12 +8,10 @@
#import "XPNewHomeHeadView.h"
#import <SDCycleScrollView/SDCycleScrollView.h>
#import "XPNewHomeItemCell.h"
#import "PIPageControl.h"
@interface XPNewHomeHeadView ()<SDCycleScrollViewDelegate,UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property(nonatomic,strong) UICollectionView *collectionView;
///
@property (nonatomic, strong) SDCycleScrollView *pi_BannerView;
@property(nonatomic,strong) PIPageControl *pageControl;
@end
@implementation XPNewHomeHeadView
@@ -28,7 +26,6 @@
-(void)installUI{
[self addSubview:self.collectionView];
[self addSubview:self.pi_BannerView];
[self addSubview:self.pageControl];
}
-(void)installConstraints{
@@ -44,7 +41,6 @@
make.height.mas_equalTo(kGetScaleWidth(80));
}];
}
#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
@@ -54,9 +50,7 @@
}
}
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index{
self.pageControl.currentPage = index;
}
#pragma mark - Getters And Setters
- (void)setBannerList:(NSArray<HomeBannerInfoModel *> *)bannerList {
_bannerList = bannerList;
@@ -69,16 +63,6 @@
}];
if (array.count > 0) {
self.pi_BannerView.imageURLStringsGroup = array;
CGFloat width = array.count * kGetScaleWidth(7) - kGetScaleWidth(3);
[self.pageControl mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-kGetScaleWidth(4));
make.height.mas_equalTo(kGetScaleWidth(4));
make.centerX.equalTo(self);
make.width.mas_equalTo(width);
}];
self.pageControl.numberOfPages = array.count;
self.pageControl.currentPage = 0;
[self.pi_BannerView autoScroll];
}
_pi_BannerView.hidden = NO;
@@ -136,25 +120,22 @@
- (SDCycleScrollView *)pi_BannerView {
if (!_pi_BannerView) {
_pi_BannerView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:[UIImageConstant defalutBannerPlaceholder]];
_pi_BannerView = [[SDCycleScrollView alloc] init];
_pi_BannerView.backgroundColor = [UIColor clearColor];
_pi_BannerView.layer.cornerRadius = 10;
_pi_BannerView.layer.masksToBounds = YES;
_pi_BannerView.showPageControl = NO;
_pi_BannerView.delegate = self;
_pi_BannerView.showPageControl = YES;
_pi_BannerView.autoScrollTimeInterval = 5.0;
_pi_BannerView.currentPageDotColor = UIColorFromRGB(0x9168FA);
_pi_BannerView.pageDotColor = UIColorRGBAlpha(0xB3B3C3, 0.4);
_pi_BannerView.pageControlDotSize = CGSizeMake(kGetScaleWidth(4), kGetScaleWidth(4));
_pi_BannerView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
_pi_BannerView.placeholderImage = [UIImageConstant defalutBannerPlaceholder];
_pi_BannerView.tag = 9000001;
_pi_BannerView.hidden = YES;
}
return _pi_BannerView;
}
- (PIPageControl *)pageControl{
if(!_pageControl){
_pageControl = [[PIPageControl alloc]init];
_pageControl.currentPageIndicatorTintColor = UIColorFromRGB(0x9168FA);
_pageControl.pageIndicatorTintColor = UIColorRGBAlpha(0xB3B3C3, 0.4);
}
return _pageControl;
}
@end

View File

@@ -47,8 +47,8 @@
[self.searchView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.height.mas_equalTo(34);
make.top.mas_equalTo(self).offset(statusbarHeight + 5);
make.height.mas_equalTo(32);
make.top.mas_equalTo(self).offset(statusbarHeight + 6);
make.right.mas_equalTo(self.rankButton.mas_left).offset(-15);
}];
@@ -100,8 +100,8 @@
- (UIView *)searchView {
if (!_searchView) {
_searchView = [[UIView alloc] init];
_searchView.backgroundColor = UIColorFromRGB(0xFAFBFC);
_searchView.layer.cornerRadius = 17;
_searchView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.5];
_searchView.layer.cornerRadius = 16;
_searchView.layer.masksToBounds = YES;
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer)];
[_searchView addGestureRecognizer:tap];
@@ -121,8 +121,8 @@
- (UILabel *)searchLabel {
if (!_searchLabel) {
_searchLabel = [[UILabel alloc] init];
_searchLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
_searchLabel.textColor = UIColorFromRGB(0xB8B7C7);
_searchLabel.font = [UIFont systemFontOfSize:12];
_searchLabel.textColor = [DJDKMIMOMColor secondTextColor];
_searchLabel.text = YMLocalizedString(@"XPNewHomeNavView0");
}
return _searchLabel;

View File

@@ -153,10 +153,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
if(self.refreshComplete){
self.refreshComplete();
}
if(self.cell == nil){///
[self.tableView reloadData];
}
[self.tableView reloadData];
});
@@ -461,6 +458,7 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
-(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didSelectChat:(HomePlayRoomModel *_Nonnull)roomModel{
if(roomModel.inMic == YES){
[XPRoomViewController openRoom:roomModel.inRoomUid fromNick:roomModel.nick fromType:UserEnterRoomFromType_Follow_User fromUid:roomModel.uid viewController:self];
return;
}

View File

@@ -435,7 +435,7 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
#pragma mark - Getters And Setters
- (PIHoemCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[PIHoemCategoryTitleView alloc] initWithFrame:CGRectZero];
_titleView = [[PIHoemCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.titles = self.titles;
_titleView.backgroundColor = [UIColor clearColor];

View File

@@ -162,12 +162,12 @@
}
-(void)resumeTimer{
if(self.giftEffectTimer != nil){
dispatch_source_cancel(self.giftEffectTimer);
dispatch_resume(self.giftEffectTimer);
self.giftEffectTimer = nil;
}
if(self.giftTimer != nil){
dispatch_source_cancel(self.giftTimer);
dispatch_resume(self.giftTimer);
self.giftTimer = nil;
}
[self.giftPagView removeListener:self];

View File

@@ -12,7 +12,7 @@
///
@property(nonatomic,strong) UIImageView *titleView;
///
@property(nonatomic,strong) UIImageView *pi_iconView;
@property(nonatomic,strong) UIImageView *iconView;
///
@property(nonatomic,strong) UIImageView *bgImageView;
@@ -41,7 +41,7 @@
[self addSubview:self.titleView];
[self.bgImageView addSubview:self.closeView];
[self.bgImageView addSubview:self.getView];
[self.bgImageView addSubview:self.pi_iconView];
[self.bgImageView addSubview:self.iconView];
[self.bgImageView addSubview:self.numView];
[self.bgImageView addSubview:self.chooseBnt];
[self.bgImageView addSubview:self.tipsView];
@@ -69,7 +69,7 @@
make.height.mas_equalTo(kGetScaleWidth(20));
make.centerX.equalTo(self.bgImageView);
}];
[self.pi_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(80));
make.centerX.equalTo(self.bgImageView);
make.top.equalTo(self.getView.mas_bottom).mas_offset(kGetScaleWidth(4));
@@ -77,7 +77,7 @@
[self.numView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bgImageView);
make.height.mas_equalTo(kGetScaleWidth(22));
make.top.equalTo(self.pi_iconView.mas_bottom).mas_offset(kGetScaleWidth(4));
make.top.equalTo(self.iconView.mas_bottom).mas_offset(kGetScaleWidth(4));
}];
[self.tipsView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bgImageView).mas_offset(kGetScaleWidth(6));
@@ -137,12 +137,12 @@
}
return _bgImageView;
}
-(UIImageView *)pi_iconView{
if(!_pi_iconView){
_pi_iconView = [UIImageView new];
_pi_iconView.image = kImage(@"room_candy_tree_buy_love_icon");
-(UIImageView *)iconView{
if(!_iconView){
_iconView = [UIImageView new];
_iconView.image = kImage(@"room_candy_tree_buy_love_icon");
}
return _pi_iconView;
return _iconView;
}
-(UIImageView *)titleView{
if(!_titleView){

View File

@@ -112,9 +112,9 @@
- (void)textFieldDidChange:(UITextField *)textField {
if(textField.text.integerValue <= 0){
textField.text = @"";
}else if(textField.text.integerValue > 99999){
}else if(textField.text.integerValue > 200){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPCandyTreeViewController5")];
textField.text = @"99999";
textField.text = @"200";
}
self.chooseNum = textField.text;
@@ -127,9 +127,9 @@
- (void)textFieldDidEndEditing:(UITextField *)textField{
if(textField.text.length <= 0){
textField.text = @"";
}else if(textField.text.integerValue > 99999){
}else if(textField.text.integerValue > 200){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPCandyTreeViewController5")];
textField.text = @"99999";
textField.text = @"200";
}
self.chooseNum = textField.text;
NSArray *btnArr = @[self.oneTapBtn,self.tenTapBtn,self.hundredTapBtn];
@@ -285,7 +285,6 @@
_textField.keyboardType = UIKeyboardTypeNumberPad;
_textField.textAlignment = NSTextAlignmentCenter;
_textField.delegate = self;
_textField.adjustsFontSizeToFitWidth = YES;
_textField.backgroundColor = [UIColor clearColor];
[_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
}

View File

@@ -70,9 +70,9 @@
- (void)textFieldDidChanged:(UITextField *)textField {
if(textField.text.integerValue <= 0){
textField.text = @"";
}else if(textField.text.integerValue > 99999){
}else if(textField.text.integerValue > 200){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPCandyTreeViewController5")];
textField.text = @"99999";
textField.text = @"200";
}
@@ -83,9 +83,9 @@
- (void)textFieldDidEndEditing:(UITextField *)textField{
if(textField.text.length <= 0){
textField.text = @"";
}else if(textField.text.integerValue > 99999){
}else if(textField.text.integerValue > 200){
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPCandyTreeViewController5")];
textField.text = @"99999";
textField.text = @"200";
}
if(self.delegate && [self.delegate respondsToSelector:@selector(inputLoveNum:)]){
@@ -114,8 +114,8 @@
-(void)addBtnAction{
NSInteger num = self.textFiled.text.integerValue + 10;
if(num > 99999){
num = 99999;
if(num > 200){
num = 200;
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPCandyTreeViewController5")];
}
self.textFiled.text = @(num).stringValue;

View File

@@ -12,7 +12,7 @@
@property(nonatomic,strong) UIButton *closeView;
///
@property(nonatomic,strong) UIImageView *pi_iconView;
@property(nonatomic,strong) UIImageView *iconView;
///
@property(nonatomic,strong) UIImageView *bgImageView;
///
@@ -91,7 +91,7 @@
[self addSubview:self.bgImageView];
[self addSubview:self.titleView];
[self.bgImageView addSubview:self.closeView];
[self.bgImageView addSubview:self.pi_iconView];
[self.bgImageView addSubview:self.iconView];
[self.bgImageView addSubview:self.numView];
[self.bgImageView addSubview:self.titleTipsView];
[self.bgImageView addSubview:self.buyBtn];
@@ -123,7 +123,7 @@
make.height.mas_equalTo(kGetScaleWidth(17));
make.centerX.equalTo(self.bgImageView);
}];
[self.pi_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(80));
make.centerX.equalTo(self.bgImageView);
make.top.equalTo(self.titleTipsView.mas_bottom).mas_offset(8);
@@ -131,7 +131,7 @@
[self.numView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bgImageView);
make.height.mas_equalTo(kGetScaleWidth(22));
make.top.equalTo(self.pi_iconView.mas_bottom).mas_offset(kGetScaleWidth(5));
make.top.equalTo(self.iconView.mas_bottom).mas_offset(kGetScaleWidth(5));
}];
[self.buyBtn mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -159,7 +159,7 @@
[self addSubview:self.titleView];
[self.bgImageView addSubview:self.closeView];
[self.bgImageView addSubview:self.titleTipsView];
[self.bgImageView addSubview:self.pi_iconView];
[self.bgImageView addSubview:self.iconView];
[self.bgImageView addSubview:self.numView];
[self.bgImageView addSubview:self.inputNumView];
[self.bgImageView addSubview:self.buyBtn];
@@ -188,7 +188,7 @@
make.height.mas_equalTo(kGetScaleWidth(17));
make.centerX.equalTo(self.bgImageView);
}];
[self.pi_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(80));
make.centerX.equalTo(self.bgImageView);
make.top.equalTo(self.titleTipsView.mas_bottom).mas_offset(kGetScaleWidth(8));
@@ -196,7 +196,7 @@
[self.numView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.bgImageView);
make.height.mas_equalTo(kGetScaleWidth(22));
make.top.equalTo(self.pi_iconView.mas_bottom).mas_offset(kGetScaleWidth(5));
make.top.equalTo(self.iconView.mas_bottom).mas_offset(kGetScaleWidth(5));
}];
[self.inputNumView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.numView.mas_bottom).mas_offset(kGetScaleWidth(5));
@@ -286,12 +286,12 @@
}
return _bgImageView;
}
-(UIImageView *)pi_iconView{
if(!_pi_iconView){
_pi_iconView = [UIImageView new];
_pi_iconView.image = kImage(@"room_candy_tree_buy_love_icon");
-(UIImageView *)iconView{
if(!_iconView){
_iconView = [UIImageView new];
_iconView.image = kImage(@"room_candy_tree_buy_love_icon");
}
return _pi_iconView;
return _iconView;
}
-(UIImageView *)titleView{
if(!_titleView){

View File

@@ -30,12 +30,10 @@
#import "XCCurrentVCStackManager.h"
#import "XPCandyTreeInsufficientBalanceView.h"
#import "XPWebViewController.h"
#import "XPIAPRechargeViewController.h"
#import "XPCandyTreeBuyView.h"
#import "XPCandyTreeConfirmBuyView.h"
#import "XPCandyTreeBuySuccessView.h"
///P
#import "XPCandyTreePresenter.h"
#import "XPCandyTreeProtocol.h"
@@ -456,14 +454,9 @@ UIKIT_EXTERN NSString * const kRoomReceivedCandyNotificationKey;
#pragma mark -XPCandyTreeInsufficientBalanceViewDelegate
- (void)payBalanceAction{
XPWebViewController * webVC =[[XPWebViewController alloc] init];
webVC.url = [NSString stringWithFormat:URLWithType(kThirdPartyPay),@"4",[YYUtility deviceID]];
webVC.isPush = YES;
@kWeakify(self)
webVC.CloseWebViewBlock = ^(BOOL result){
@kStrongify(self)
[self.presenter getCandyTreeInfo];
};
XPIAPRechargeViewController * webVC =[[XPIAPRechargeViewController alloc] init];
webVC.delegate = self;
webVC.type = @"4";
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - XPIAPRechargeViewControllerDelegate

View File

@@ -1,8 +1,8 @@
//
// XPFirstRechargeView.h
// xplan-ios
// YuMi
//
// Created by duoban on 2023/2/27.
// Created by YuMi on 2023/2/27.
//
#import <UIKit/UIKit.h>

View File

@@ -1,15 +1,26 @@
//
// XPFirstRechargeView.m
// xplan-ios
// YuMi
//
// Created by duoban on 2023/2/27.
// Created by YuMi on 2023/2/27.
//
///Third
#import <Masonry/Masonry.h>
#import <NIMSDK/NIMSDK.h>
///Tool
#import <Base64/MF_Base64Additions.h>
#import "YUMIMacroUitls.h"
#import "ThemeColor+FirstRecharge.h"
#import "UIImage+Utils.h"
#import "XPFirstRechargeFlowLayout.h"
#import "NSArray+Safe.h"
#import "XNDJTDDLoadingTool.h"
#import "AccountInfoStorage.h"
#import "YYUtility.h"
#import "Api+Mine.h"
#import "Api+Main.h"
#import "RechargeStorage.h"
///Model
#import "FirstRechargeModel.h"
///View
@@ -20,11 +31,14 @@
#import "XPFirstRechargeProtocol.h"
///VC
#import "XPMineRechargeViewController.h"
#import "XPWebViewController.h"
#import "XPFirstRechargeView.h"
#import "Api+FirstRecharge.h"
#import "FirstRechargeModel.h"
#import "XPSkillCardPlayerManager.h"
#import "YuMi-swift.h"
#import "ClientConfig.h"
@interface XPFirstRechargeView ()<UICollectionViewDelegate, UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
///
@property (nonatomic,strong) UIButton *backBtn;
@@ -56,16 +70,25 @@
@property (nonatomic,weak) UINavigationController * currentNav;
///
@property (nonatomic,strong) XPFirstRechargeCollectionView *rechargeView;
@property (nonatomic,strong) FirstRechargeModel *currentInfo;
@property (nonatomic,copy) NSString *orderId;
@property(nonatomic,assign) BOOL pi_IsNative;
@end
@implementation XPFirstRechargeView
- (void)dealloc {
}
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self initSubViews];
[self initSubViewConstraints];
[self getFirstRechargeRewardList];
}
return self;
}
@@ -81,6 +104,22 @@
}
[XNDJTDDLoadingTool showErrorWithMessage:msg];
} channelType:@"3"];
[self checkTranscationIds];
if([ClientConfig shareConfig].canOpen){
[Api requestMineChannel:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if(code == 200){
if(data.data[@"isNative"] != nil){
self.pi_IsNative = [data.data[@"isNative"] boolValue];
}
}
}];
}
}
#pragma mark - Private Method
- (void)initSubViews {
@@ -172,8 +211,8 @@
NSString * title = model.chargeProdTitle;
NSString * giveMoneyStr = [NSString stringWithFormat:@"%ld", model.giveMoney];
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:kFontRegular(12), NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
[attribute addAttribute:NSFontAttributeName value:kFontSemibold(12) range:[title rangeOfString:giveMoneyStr]];
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] initWithString:title attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12], NSForegroundColorAttributeName:UIColorFromRGB(0xBE5AF6)}];
[attribute addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12 weight:UIFontWeightSemibold] range:[title rangeOfString:giveMoneyStr]];
[self.extraButton setAttributedTitle:attribute forState:UIControlStateNormal];
}
@@ -182,6 +221,7 @@
if (array.count <= 0) return;
self.typeArrowView.hidden = NO;
self.originArray = array;
self.currentInfo = [array safeObjectAtIndex1:0];
if (self.segmentView.arrangedSubviews.count > 0) {
[[self.segmentView arrangedSubviews] enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[obj removeFromSuperview];
@@ -189,11 +229,11 @@
}
for (int i = 0 ; i < array.count; i++) {
FirstRechargeModel * modelInfo = [array safeObjectAtIndex1:i];
NSString * title = [NSString stringWithFormat:@"$%.2f ", modelInfo.chargeMoney];
NSString * title = [NSString stringWithFormat:@"$%.2f", modelInfo.chargeMoney];
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
button.titleLabel.font = kFontMedium(15);
button.titleLabel.font = [UIFont systemFontOfSize:15 weight:UIFontWeightMedium];
[button setTitle:title forState:UIControlStateNormal];
[button setTitle:title forState:UIControlStateSelected];
button.tag = i;
@@ -241,15 +281,198 @@
return cell;
}
#pragma mark -
///
/// @param chargeProdId id
- (void)requestIAPRechargeOrderWithChargeProdId:(NSString *)chargeProdId {
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
NSString * deviceInfo = [YYUtility deviceID];
NSString * clientIp= [YYUtility ipAddress];
[Api requestIAPRecharge:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {
NSString *orderId = (NSString *)data.data[@"recordId"];
NSString *uuid = (NSString *)data.data[@"appAccountToken"];
[self requestIAPRechargeOrderSuccess:orderId chargeProdId:chargeProdId uuid:uuid];
} else {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if(code == 50000){
if(self.delegate && [self.delegate respondsToSelector:@selector(contactCustomerService)]){
[self.delegate contactCustomerService];
}
[self backAction];
return;
}
[XNDJTDDLoadingTool showErrorWithMessage:msg];
}
} chargeProdId:chargeProdId uid:uid ticket:ticket deviceInfo:deviceInfo clientIp:clientIp];
}
- (void)requestIAPRechargeOrderSuccess:(NSString *)orderId chargeProdId:(NSString *)chargeProdId uuid:(NSString *)uuid{
if (orderId.length > 0) {
self.orderId = orderId;
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap requestBuyProductWithProductId:chargeProdId uuid:uuid completionHandler:^(NSError * _Nullable error) {
}];
@kWeakify(self);
iap.stateBlock = ^(enum StoreStateResult state, NSDictionary<NSString *,id> * _Nullable result) {
@kStrongify(self);
[self rechargeNewProcessStatus:state];
switch (state) {
case StoreStateResultVerifiedServer:
{
NSString *transactionId = result[@"transactionId"];
[self rechargeSuccess:transactionId];
}
break;
default:
{
}
break;
}
};
} else {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController10")];
}
}else{
[XNDJTDDLoadingTool hideOnlyView:kWindow];
}
}
#pragma mark - XPIAPHelperDelegate
///
- (void)rechargeNewProcessStatus:(StoreStateResult)status {
if (status == StoreStateResultPay || status == StoreStateResultStart || status == StoreStateResultVerifiedServer) {
}else if (status == StoreStateResultUnowned) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController1")];
}else{
[XNDJTDDLoadingTool hideOnlyView:kWindow];
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPIAPRechargeViewController0")];
}
}
///id
- (void)rechargeSuccess:(NSString *)transactionIdentifier {
///
[self saveRechageReciptWithTransactionIdentifier:transactionIdentifier];
///
[self checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier errorToast:YES];
}
///
- (void)saveRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSData *receipt = [NSData dataWithContentsOfURL:[[NSBundle mainBundle] appStoreReceiptURL]];
NSString *encodeStr = [receipt base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
[dictionary setObject:transactionIdentifier forKey:@"transcationId"];
[dictionary setObject:encodeStr forKey:@"recipt"];
[dictionary setObject:self.orderId forKey:@"orderId"];
NSString *reciptJson = [dictionary toJSONString];
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL saveSuccess = [RechargeStorage saveTranscationId:transactionIdentifier recipt:reciptJson uid:uid];
if (!saveSuccess) {
#warning to do
}
}
///
- (void)deleteRechageReciptWithTransactionIdentifier:(NSString *)transactionIdentifier {
NSString * uid = [AccountInfoStorage instance].getUid;
BOOL deleteSuccess = [RechargeStorage delegateTranscationId:transactionIdentifier uid:uid];
if (deleteSuccess) {
#warning to do
}
}
///
- (void)checkTranscationIds {
NSString * uid = [AccountInfoStorage instance].getUid;
NSArray * array = [RechargeStorage getAllReciptsWithUid:uid];
// [self.presenter checkReceiptWithOrderId:self.orderId transcationId:transactionIdentifier];
// NSMutableArray *list = [NSMutableArray array];
// for (NSDictionary *transcationDic in array) {
// NSString *transcationId = transcationDic[@"transcationId"];
// if(transcationId){
// [list addObject:transcationId];
// }
// }
// if(list.count > 0){
// if (@available(iOS 15.0, *)) {
// PIIAPManagers *iap = [PIIAPManagers shared];
// [iap allTransactionWithList:list completionHandler:^{
//
// }];
//
// }
// }
for (NSDictionary *transcation in array) {
NSString *orderId = transcation[@"orderId"];
NSString *transcationId = transcation[@"transcationId"];
///
[self checkReceiptWithOrderId:orderId transcationId:transcationId errorToast:NO] ;
}
}
- (void)checkReceiptWithOrderId:(NSString *)orderId transcationId:(NSString *)transcationId errorToast:(BOOL)errorToast{
NSString * uid = [AccountInfoStorage instance].getUid;
NSString * ticket = [AccountInfoStorage instance].getTicket;
[Api checkReceipt:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
[XNDJTDDLoadingTool hideOnlyView:kWindow];
if (code == 200) {
[self checkReceiptSuccess:transcationId];
} else {
if(code == 1444){
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
}
if(errorToast == YES){
[XNDJTDDLoadingTool showErrorWithMessage:msg];
}
}
} chooseEnv:@"true" chargeRecordId:orderId transcationId:transcationId uid:uid ticket:ticket];
}
///
- (void)checkReceiptSuccess:(NSString *)transcationId {
if (@available(iOS 15.0, *)) {
PIIAPManagers *iap = [PIIAPManagers shared];
[iap transactionFinishWithTransaction:[NSString stringWithFormat:@"%@",transcationId] completionHandler:^{
}];
}
[self deleteRechageReciptWithTransactionIdentifier:transcationId];
self.orderId = nil;
}
#pragma mark - Event Response
@@ -260,10 +483,23 @@
}
- (void)rechargeButtonAction {
if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
[self.delegate rechargeHandle];
if(self.pi_IsNative == NO){
if(self.delegate && [self.delegate respondsToSelector:@selector(rechargeHandle)]){
[self.delegate rechargeHandle];
}
[self backAction];
return;
}
if (self.currentInfo == nil|| self.currentInfo.chargeProdId == nil) {
return;
}
FirstRechargeModel *model = self.currentInfo;
if (model.chargeProdId) {
[XNDJTDDLoadingTool showOnlyView:kWindow];
[self requestIAPRechargeOrderWithChargeProdId:model.chargeProdId];
}
[self backAction];
}
-(void)backAction{
[self removeFromSuperview];
@@ -271,6 +507,7 @@
- (void)buttonAction:(UIButton *)sender {
if (sender.tag <= self.originArray.count) {
FirstRechargeModel * model = [self.originArray safeObjectAtIndex1:sender.tag];
self.currentInfo = model;
[self createExtraRewardAttrebute:model];
self.rewardArray = model.firstChargeRewardList;
self.collectionView.hidden = self.rewardArray.count < 2;
@@ -354,7 +591,7 @@
- (UIButton *)extraButton {
if (!_extraButton) {
_extraButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_extraButton setBackgroundImage:kImage(@"room_first_recharge_extra") forState:UIControlStateNormal];
[_extraButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_extra"] forState:UIControlStateNormal];
}
return _extraButton;
@@ -409,7 +646,7 @@
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateNormal];
[_rechargeButton setBackgroundImage:[UIImage imageNamed:@"room_first_recharge_recharge"] forState:UIControlStateSelected];
[_rechargeButton setTitle:YMLocalizedString(@"XPFirstRechargeViewController1") forState:UIControlStateNormal];
_rechargeButton.titleLabel.font = kFontSemibold(18);
_rechargeButton.titleLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightSemibold];
[_rechargeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_rechargeButton addTarget:self action:@selector(rechargeButtonAction) forControlEvents:UIControlEventTouchUpInside];
}
@@ -418,7 +655,7 @@
- (UIImageView *)typeArrowView{
if (!_typeArrowView){
_typeArrowView = [UIImageView new];
_typeArrowView.image = kImage(@"room_first_recharge_recharge_arrow");
_typeArrowView.image = [UIImage imageNamed:@"room_first_recharge_recharge_arrow"];
_typeArrowView.hidden = YES;
}
return _typeArrowView;
@@ -434,7 +671,7 @@
if (!_backBtn){
_backBtn = [UIButton new];
[_backBtn addTarget:self action:@selector(backAction) forControlEvents:UIControlEventTouchUpInside];
}
return _backBtn;
}

View File

@@ -118,7 +118,7 @@
- (NetImageView *)iconView{
if (!_iconView){
NetImageConfig *config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defaultEmptyAvatarPlaceholder];
config.placeHolder = [UIImageConstant defalutEmptyPlaceholder];
_iconView = [[NetImageView alloc]initWithConfig:config];
}

View File

@@ -98,7 +98,6 @@
}
+ (NSString *)getSDKVersion {
return [NSString stringWithFormat:@"v%@",[SudMGP getVersion]];
}

View File

@@ -8,7 +8,7 @@
#import "XPRoomLittleGameContainerView.h"
///Third
#import <Masonry/Masonry.h>
#import <SudMGP/SudMGP.h>
#import <NIMSDK/NIMSDK.h>
///Tool
#import "Api+LittleGame.h"
@@ -27,9 +27,10 @@
#import "XPKickUserModel.h"
#import "GuildSuperAdminInfoModel.h"
///P
#import <SudMGP/SudMGP-umbrella.h>
#import <SudMGP/ISudFSMMG.h>
#import <SudMGP/ISudFSTAPP.h>
#import <SudMGP/SudMGP.h>
#import <SudMGP/ISudFSMStateHandle.h>
@interface XPRoomLittleGameContainerView ()<RoomGuestDelegate,ISudFSMMG>
///ID
@property (nonatomic, assign) int64_t currentmgId;
@@ -102,7 +103,6 @@
#else
isTestEnv = NO;
#endif
[[SudMGP getCfg]setBackgroundMode:NO];
[SudMGP initSDK:KeyWithType(KeyType_SudGameAppID) appKey:KeyWithType(KeyType_SudGameAppKey) isTestEnv:isTestEnv listener:^(int retCode, const NSString *retMsg) {
if (retCode == 0) {
if (!self.currentmgId) {
@@ -124,7 +124,6 @@
language = @"zh-Hant"; //
}
self.fsmAPP2MG = [SudMGP loadMG:userId roomId:roomId code:self.code mgId:self.currentmgId language:[language isEqualToString:@"zh-Hant"]? @"zh-TW" : @"zh-CN" fsmMG:self rootView:self];
} else {
/// ,
NSLog(@"ISudFSMMG:initGameSDKWithAppID:初始化sdk失败 :%@",retMsg);

View File

@@ -10,15 +10,15 @@
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSInteger, XPRoomMenuItemType) {
XPRoomMenuItemType_Input = 1,
XPRoomMenuItemType_Mic,///话筒
XPRoomMenuItemType_Voice, ///声音
XPRoomMenuItemType_Face,///表情
XPRoomMenuItemType_Message,///房间私聊
XPRoomMenuItemType_More,///更多
XPRoomMenuItemType_ArrangeMic,///排麦
XPRoomMenuItemType_Gift,///礼物
XPRoomMenuItemType_Input = 1,
XPRoomMenuItemType_Mic,///话筒
XPRoomMenuItemType_Face,///表情
XPRoomMenuItemType_Message,///房间私聊
XPRoomMenuItemType_More,///更多
XPRoomMenuItemType_ArrangeMic,///排麦
XPRoomMenuItemType_Gift,///礼物
XPRoomMenuItemType_Noble,///贵族
XPRoomMenuItemType_Play,///更多玩法
};
@interface XPRoomMenuItem : NSObject

View File

@@ -1,8 +1,8 @@
//
// XPRoomBottomMenuView.m
// xplan-ios
// YMRoomBottomMenuView.m
// YUMI
//
// Created by on 2021/10/11.
// Created by YUMI on 2021/10/11.
//
#import "XPRoomMenuContainerView.h"
@@ -12,10 +12,12 @@
#import "AccountInfoStorage.h"
#import "TTPopup.h"
#import "RtcManager.h"
#import "XNDJTDDLoadingTool.h"
#import "StatisticsServiceHelper.h"
#import "DJDKMIMOMColor.h"
#import "YUMIMacroUitls.h"
#import "XCCurrentVCStackManager.h"
#import "UIImage+Utils.h"
#import "ClientConfig.h"
///Model
#import "XPRoomMenuItem.h"
#import "MicroQueueModel.h"
@@ -28,10 +30,12 @@
#import "XPSendGiftView.h"
#import "SessionListViewController.h"
#import "XPRoomMoreMenuViewController.h"
#import "XPNobleCenterViewController.h"
#import "XPRoomFaceViewController.h"
#import "XPRoomHalfMessageView.h"
#import "XPRoomMessageBubbleView.h"
#import "XPRoomMorePlayViewController.h"
NSString * const kRoomPlayEnterKey = @"kRoomPlayEnterKey";
@interface XPRoomMenuContainerView ()<XPRoomMessageBubbleViewDelegate>
///
@@ -42,8 +46,6 @@
@property (nonatomic,strong) UIButton *inputButton;
///
@property (nonatomic,strong) UIButton *micButton;
///
@property (nonatomic,strong) UIButton *voiceButton;
///
@property (nonatomic,strong) UIButton *faceButton;
///
@@ -67,133 +69,113 @@
@implementation XPRoomMenuContainerView
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
self = [super init];
if (self) {
self.delegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
self = [super init];
if (self) {
self.delegate = delegate;
[self initSubViews];
[self initSubViewConstraints];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showGiftView:) name:@"kShowGiftView" object:nil];
}
return self;
}
return self;
}
- (void)menuResignFirstResponder {
[self.inputTextView.editTextFiled resignFirstResponder];
[self.inputTextView.editTextFiled resignFirstResponder];
}
#pragma mark - Response
- (void)menuButtonAction:(UIButton *)sender {
XPRoomMenuItemType type = sender.tag;
switch (type) {
case XPRoomMenuItemType_Input:
{
if (self.delegate.getRoomInfo.isCloseScreen) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomMenuContainerView0")];
return;
}
if (self.delegate.getRoomInfo.type == RoomType_Anchor) {
self.inputTextView = [XPRoomSendTextView showTextView:self.superview.superview delegate:self.delegate atUid:nil atNick:nil];
} else {
self.inputTextView = [XPRoomSendTextView showTextView:self.superview delegate:self.delegate atUid:nil atNick:nil];
}
}
break;
XPRoomMenuItemType type = sender.tag;
switch (type) {
case XPRoomMenuItemType_Input:
{
if (self.delegate.getRoomInfo.isCloseScreen) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomMenuContainerView0")];
return;
}
if (self.delegate.getRoomInfo.type == RoomType_Anchor) {
self.inputTextView = [XPRoomSendTextView showTextView:self.superview.superview delegate:self.delegate atUid:nil atNick:nil];
} else {
self.inputTextView = [XPRoomSendTextView showTextView:self.superview delegate:self.delegate atUid:nil atNick:nil];
}
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_chatbox_click];
}
break;
case XPRoomMenuItemType_Mic: {
[RtcManager instance].localMuted = !self.micButton.isSelected;
if([RtcManager instance].localMuted == NO){
for (MicroQueueModel *sequence in [self.delegate getMicroQueue].allValues) {
if ([AccountInfoStorage instance].getUid.integerValue == sequence.userInfo.uid) {
[[RtcManager instance] broadcast:YES];
}
}
}
self.micButton.selected = [RtcManager instance].isLocalMuted;
}
break;
case XPRoomMenuItemType_Voice: {
[RtcManager instance].remoteMuted = !self.voiceButton.isSelected;
self.voiceButton.selected = [RtcManager instance].isRemoteMuted;
}
break;
case XPRoomMenuItemType_Face: {
XPRoomFaceViewController * faceVC = [[XPRoomFaceViewController alloc] init];
faceVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
faceVC.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
[self.delegate.getCurrentNav presentViewController:faceVC animated:YES completion:nil];
XPRoomFaceViewController * faceVC = [[XPRoomFaceViewController alloc] init];
faceVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
faceVC.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
[self.delegate.getCurrentNav presentViewController:faceVC animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_Gift: {
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid];
giftView.delegate = self.delegate;
case XPRoomMenuItemType_Gift: {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_gift_click];
NSString * roomUid = [NSString stringWithFormat:@"%ld", [self.delegate getRoomInfo].uid];
XPSendGiftView * giftView = [[XPSendGiftView alloc] initWithType:SendGiftType_Room uid:roomUid];
giftView.delegate = self.delegate;
giftView.freeModel = self.freeModel;
NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]];
[giftView configGiftUsers:giftUses];
[self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_Message:
{
UIViewController * controller = (UIViewController *)self.delegate;
XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight) controller:controller];
[controller.view addSubview:halfMessageView];
[UIView animateWithDuration:.35 animations:^{
CGRect rect = halfMessageView.frame;
rect.origin.y = 0;
halfMessageView.frame = rect;
}];
}
break;
case XPRoomMenuItemType_More: {
XPRoomMoreMenuViewController * moreMenuVC = [[XPRoomMoreMenuViewController alloc] initWithDelegate:self.delegate];
[self.delegate.getCurrentNav presentViewController:moreMenuVC animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_ArrangeMic:{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode && self.delegate.isRoomPKPlaying) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomMenuContainerView1")];
return;
}
self.arrangeMicButton.selected = NO;
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member;
if (error == nil) {
member = members.firstObject;
}
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
XPArrangeMicInfoModel * info = [[XPArrangeMicInfoModel alloc] init];
info.roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
info.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
info.nick = roomInfo.nick;
info.roomAvatar = roomInfo.avatar;
info.roomTitle = roomInfo.title;
info.micQueue = [self.delegate getMicroQueue];
info.isManager = (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager);
info.type = roomInfo.roomModeType == RoomModeType_Open_Blind ? ArrangeMicType_Dating : roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? ArrangeMicType_Room_PK : ArrangeMicType_Normal;
XPArrangeMicViewController * arrangeMicVC = [[XPArrangeMicViewController alloc] initWithInfo:info];
[self.delegate.getCurrentNav presentViewController:arrangeMicVC animated:YES completion:nil];
}];
}
break;
case XPRoomMenuItemType_Noble: {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceRoomClick];
XPNobleCenterViewController * nobleVC = [[XPNobleCenterViewController alloc] initWithRoomUid:self.delegate.getRoomInfo.uid];
[self.delegate.getCurrentNav pushViewController:nobleVC animated:YES];
}
break;
default:
break;
}
NSArray * giftUses = [self configGiftUsers:[self.delegate getMicroQueue]];
[giftView configGiftUsers:giftUses];
[self.delegate.getCurrentNav presentViewController:giftView animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_Message:
{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventroom_privateletter_click];
UIViewController * controller = (UIViewController *)self.delegate;
XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight) controller:controller];
[controller.view addSubview:halfMessageView];
[UIView animateWithDuration:.35 animations:^{
CGRect rect = halfMessageView.frame;
rect.origin.y = 0;
halfMessageView.frame = rect;
}];
}
break;
case XPRoomMenuItemType_More: {
XPRoomMoreMenuViewController * moreMenuVC = [[XPRoomMoreMenuViewController alloc] initWithDelegate:self.delegate];
[self.delegate.getCurrentNav presentViewController:moreMenuVC animated:YES completion:nil];
}
break;
case XPRoomMenuItemType_ArrangeMic:{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode && self.delegate.isRoomPKPlaying) {
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPRoomMenuContainerView1")];
return;
}
self.arrangeMicButton.selected = NO;
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member;
if (error == nil) {
member = members.firstObject;
}
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
XPArrangeMicInfoModel * info = [[XPArrangeMicInfoModel alloc] init];
info.roomUid = [NSString stringWithFormat:@"%ld", roomInfo.uid];
info.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
info.nick = roomInfo.nick;
info.roomAvatar = roomInfo.avatar;
info.roomTitle = roomInfo.title;
info.micQueue = [self.delegate getMicroQueue];
info.isManager = (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager);
info.type = roomInfo.roomModeType == RoomModeType_Open_Blind ? ArrangeMicType_Dating : roomInfo.roomModeType == RoomModeType_Open_PK_Mode ? ArrangeMicType_Room_PK : ArrangeMicType_Normal;
XPArrangeMicViewController * arrangeMicVC = [[XPArrangeMicViewController alloc] initWithInfo:info];
[self.delegate.getCurrentNav presentViewController:arrangeMicVC animated:YES completion:nil];
}];
}
break;
default:
break;
}
}
#pragma mark - notification
@@ -211,76 +193,70 @@
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.scrollView];
[self addSubview:self.giftButton];
[self.scrollView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.inputButton];
[self.stackView addArrangedSubview:self.micButton];
[self.stackView addArrangedSubview:self.voiceButton];
[self.stackView addArrangedSubview:self.faceButton];
[self.stackView addArrangedSubview:self.arrangeMicButton];
[self.stackView addArrangedSubview:self.messageButton];
[self.stackView addArrangedSubview:self.moreButton];
[self.stackView addArrangedSubview:self.nobleButton];
self.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.15);
CAShapeLayer * layer = [CAShapeLayer layer];
layer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth, 52 +kSafeAreaBottomHeight) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(25, 25)].CGPath;
self.layer.shadowColor = UIColorRGBAlpha(0xFFFFFF, 0.1).CGColor;
self.layer.shadowOffset = CGSizeMake(0, 5);
self.layer.mask = layer;
[self addSubview:self.scrollView];
[self addSubview:self.giftButton];
[self.scrollView addSubview:self.stackView];
[self.stackView addArrangedSubview:self.inputButton];
[self.stackView addArrangedSubview:self.micButton];
[self.stackView addArrangedSubview:self.faceButton];
[self.stackView addArrangedSubview:self.arrangeMicButton];
[self.stackView addArrangedSubview:self.messageButton];
[self.stackView addArrangedSubview:self.moreButton];
}
- (void)initSubViewConstraints {
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.right.mas_equalTo(self.giftButton.mas_left).offset(-10);
make.top.mas_equalTo(self).offset(8);
make.bottom.mas_equalTo(self).offset(-12 - kSafeAreaBottomHeight);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
}];
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(95, 32));
}];
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.scrollView);
make.right.mas_equalTo(self).offset(-20);
make.size.mas_equalTo(CGSizeMake(35, 35));
}];
[self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self).offset(15);
make.right.mas_equalTo(self.giftButton.mas_left).offset(-10);
make.top.bottom.mas_equalTo(self);
}];
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.leading.trailing.height.mas_equalTo(self.scrollView);
}];
if ([ClientConfig shareConfig].canOpen) {
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(100, 30));
}];
} else {
[self.inputButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(150, 30));
}];
}
[self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.right.mas_equalTo(self).offset(-15);
make.size.mas_equalTo(CGSizeMake(38, 38));
}];
}
- (NSArray<XPGiftUserInfoModel *> *)configGiftUsers:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
NSMutableArray * array = [NSMutableArray array];
for (MicroQueueModel * microModel in queue.allValues) {
if (microModel.userInfo && microModel.userInfo.uid >0) {
UserInfoModel * userInfo = microModel.userInfo;
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = userInfo.avatar;
userModel.vipMic = userInfo.vipMic;
userModel.position = [NSString stringWithFormat:@"%d", microModel.microState.position];
userModel.uid = userInfo.uid;
NSMutableArray * array = [NSMutableArray array];
for (MicroQueueModel * microModel in queue.allValues) {
if (microModel.userInfo && microModel.userInfo.uid >0) {
UserInfoModel * userInfo = microModel.userInfo;
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = userInfo.avatar;
userModel.vipMic = userInfo.vipMic;
userModel.position = [NSString stringWithFormat:@"%d", microModel.microState.position];
userModel.uid = userInfo.uid;
if (self.delegate.getRoomInfo.type == RoomType_Anchor && microModel.microState.position == -1) {///
continue;
}
[array addObject:userModel];
}
}
if (self.delegate.getRoomInfo.leaveMode) {
RoomInfoModel * roomInfo= self.delegate.getRoomInfo;
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = roomInfo.avatar;
userModel.position = @"-1";
userModel.uid = roomInfo.uid;
[array addObject:userModel];
[array addObject:userModel];
}
}
if (self.delegate.getRoomInfo.leaveMode) {
RoomInfoModel * roomInfo= self.delegate.getRoomInfo;
XPGiftUserInfoModel * userModel = [[XPGiftUserInfoModel alloc] init];
userModel.avatar = roomInfo.avatar;
userModel.position = @"-1";
userModel.uid = roomInfo.uid;
[array addObject:userModel];
} else if (self.delegate.getRoomInfo.type == RoomType_Anchor) {
RoomInfoModel * roomInfo= self.delegate.getRoomInfo;
BOOL hadContainerOwner = NO;
@@ -298,220 +274,222 @@
[array addObject:userModel];
}
}
return array;
return array;
}
- (MicroQueueModel *)findMySelfMicro:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
NSString * uid = [AccountInfoStorage instance].getUid;
for (MicroQueueModel * microModel in queue.allValues) {
if (microModel.userInfo && microModel.userInfo.uid == uid.integerValue) {
return microModel;
}
}
return nil;
NSString * uid = [AccountInfoStorage instance].getUid;
for (MicroQueueModel * microModel in queue.allValues) {
if (microModel.userInfo && microModel.userInfo.uid == uid.integerValue) {
return microModel;
}
}
return nil;
}
#pragma mark - RoomGuestDelegate
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
MicroQueueModel * model = [self findMySelfMicro:queue];
if (model) {
self.micButton.hidden = NO;
self.micButton.selected = model.microState.micState == MicroMicStateType_Close ? YES : [RtcManager instance].isLocalMuted;
self.micButton.enabled = model.microState.micState == MicroMicStateType_Open;
self.faceButton.hidden = NO;
} else {
self.micButton.hidden = YES;
MicroQueueModel * model = [self findMySelfMicro:queue];
if (model) {
self.micButton.hidden = NO;
self.micButton.selected = model.microState.micState == MicroMicStateType_Close ? YES : [RtcManager instance].isLocalMuted;
self.micButton.enabled = model.microState.micState == MicroMicStateType_Open;
if (![ClientConfig shareConfig].canOpen) {
self.faceButton.hidden = YES;
} else {
self.faceButton.hidden = NO;
}
} else {
self.micButton.hidden = YES;
self.faceButton.hidden = YES;
}
}
}
- (void)onRoomEntered {
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
[self onRoomUpdate];
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
[self onRoomUpdate];
}
- (void)onRoomUpdate {
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
UserInfoModel * userInfo = self.delegate.getUserInfo;
if (userInfo.isFirstCharge) {
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift_first_recharge"] forState:UIControlStateNormal];
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift_first_recharge"] forState:UIControlStateSelected];
} else {
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateNormal];
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected];
}
self.arrangeMicButton.hidden = roomInfo.roomModeType != RoomModeType_Open_Micro_Mode;
if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
if([AccountInfoStorage instance].getUid != nil){
request.userIds = @[[AccountInfoStorage instance].getUid];
}
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = members.firstObject;
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.arrangeMicButton.hidden = NO;
return;
}
}
self.arrangeMicButton.hidden = YES;
}];
}
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
UserInfoModel * userInfo = self.delegate.getUserInfo;
if (userInfo.isFirstCharge) {
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift_first_recharge"] forState:UIControlStateNormal];
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift_first_recharge"] forState:UIControlStateSelected];
} else {
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateNormal];
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected];
}
if (![ClientConfig shareConfig].canOpen) {
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift1"] forState:UIControlStateNormal];
[self.giftButton setImage:[UIImage imageNamed:@"room_menu_gift1"] forState:UIControlStateSelected];
}
self.arrangeMicButton.hidden = roomInfo.roomModeType != RoomModeType_Open_Micro_Mode;
if (roomInfo.roomModeType == RoomModeType_Open_Blind || roomInfo.roomModeType == RoomModeType_Open_PK_Mode || roomInfo.roomModeType == RoomModeType_Open_Micro_Mode) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
if (error == nil) {
NIMChatroomMember * member = members.firstObject;
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.arrangeMicButton.hidden = NO;
return;
}
}
self.arrangeMicButton.hidden = YES;
}];
}
}
- (void)handleNIMCustomMessage:(NIMMessage *)message {
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_Arrange_Mic || attachment.first == CustomMessageType_Room_PK) {
if (attachment.second == Custom_Message_Sub_Arrange_Mic_Non_Empty || attachment.second == Custom_Message_Sub_Arrange_Mic_Empty || attachment.second == Custom_Message_Sub_Room_PK_Empty || attachment.second == Custom_Message_Sub_Room_PK_Non_Empty) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member;
if (error == nil) {
member = members.firstObject;
}
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.arrangeMicButton.selected = (attachment.second == Custom_Message_Sub_Arrange_Mic_Non_Empty || attachment.second == Custom_Message_Sub_Room_PK_Non_Empty);
};
}];
}
}
}
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
if (obj.attachment != nil && [obj.attachment isKindOfClass:[AttachmentModel class]]) {
AttachmentModel *attachment = (AttachmentModel *)obj.attachment;
if (attachment.first == CustomMessageType_Arrange_Mic || attachment.first == CustomMessageType_Room_PK) {
if (attachment.second == Custom_Message_Sub_Arrange_Mic_Non_Empty || attachment.second == Custom_Message_Sub_Arrange_Mic_Empty || attachment.second == Custom_Message_Sub_Room_PK_Empty || attachment.second == Custom_Message_Sub_Room_PK_Non_Empty) {
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
request.roomId = [NSString stringWithFormat:@"%ld", self.delegate.getRoomInfo.roomId];
request.userIds = @[[AccountInfoStorage instance].getUid];
[[NIMSDK sharedSDK].chatroomManager fetchChatroomMembersByIds:request completion:^(NSError * _Nullable error, NSArray<NIMChatroomMember *> * _Nullable members) {
NIMChatroomMember * member;
if (error == nil) {
member = members.firstObject;
}
if (member.type == NIMChatroomMemberTypeCreator || member.type == NIMChatroomMemberTypeManager) {
self.arrangeMicButton.selected = (attachment.second == Custom_Message_Sub_Arrange_Mic_Non_Empty || attachment.second == Custom_Message_Sub_Room_PK_Non_Empty);
};
}];
}
}
}
}
- (void)handleNIMNotificationMessage:(NIMMessage *)message {
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
switch (content.eventType) {
case NIMChatroomEventTypeAddManager:
{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.arrangeMicButton.hidden = NO;
break;
}
}
}
}
break;
case NIMChatroomEventTypeRemoveManager:
{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.arrangeMicButton.hidden = YES;
break;
}
}
}
}
break;
default:
break;
}
NIMNotificationObject *notiMsg = (NIMNotificationObject *)message.messageObject;
NIMChatroomNotificationContent *content = (NIMChatroomNotificationContent *)notiMsg.content;
switch (content.eventType) {
case NIMChatroomEventTypeAddManager:
{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.arrangeMicButton.hidden = NO;
break;
}
}
}
}
break;
case NIMChatroomEventTypeRemoveManager:
{
if (self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_Blind || self.delegate.getRoomInfo.roomModeType == RoomModeType_Open_PK_Mode) {
for (NIMChatroomNotificationMember * member in content.targets) {
if (member.userId.intValue == [AccountInfoStorage instance].getUid.integerValue) {
self.arrangeMicButton.hidden = YES;
break;
}
}
}
}
break;
default:
break;
}
}
- (void)addNIMRecentSession:(NIMRecentSession *)session {
if (!self.miniMessageView.superview) {
[self.superview insertSubview:self.miniMessageView aboveSubview:self];
[self.miniMessageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.messageButton);
make.bottom.mas_equalTo(self.messageButton.mas_top).offset(-2);
make.size.mas_equalTo(CGSizeMake(87, 55));
}];
}
[self.miniMessageView addRecentSession:session];
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
if (!self.miniMessageView.superview) {
[self.superview insertSubview:self.miniMessageView aboveSubview:self];
[self.miniMessageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.messageButton);
make.bottom.mas_equalTo(self.messageButton.mas_top).offset(-2);
make.size.mas_equalTo(CGSizeMake(87, 55));
}];
}
[self.miniMessageView addRecentSession:session];
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
}
- (void)removeNIMRecentSession:(NIMRecentSession *)session {
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
NSInteger unreadCount = [[NIMSDK sharedSDK].conversationManager allUnreadCount];
self.messageButton.selected = unreadCount > 0;
}
#pragma mark - XPRoomMessageBubbleViewDelegate
- (void)xPRoomMessageBubbleView:(XPRoomMessageBubbleView *)view didSelectSession:(NIMRecentSession *)session {
UIViewController * controller = (UIViewController *)self.delegate;
XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight) controller:controller];
halfMessageView.chatUserId = session.session.sessionId;
[controller.view addSubview:halfMessageView];
[UIView animateWithDuration:.35 animations:^{
CGRect rect = halfMessageView.frame;
rect.origin.y = 0;
halfMessageView.frame = rect;
}];
UIViewController * controller = (UIViewController *)self.delegate;
XPRoomHalfMessageView *halfMessageView = [[XPRoomHalfMessageView alloc] initWithFrame:CGRectMake(0, KScreenHeight, KScreenWidth, KScreenHeight) controller:controller];
halfMessageView.chatUserId = session.session.sessionId;
[controller.view addSubview:halfMessageView];
[UIView animateWithDuration:.35 animations:^{
CGRect rect = halfMessageView.frame;
rect.origin.y = 0;
halfMessageView.frame = rect;
}];
}
#pragma mark - Getters And Setters
- (UIButton *)inputButton {
if (!_inputButton) {
_inputButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_inputButton setTitle:YMLocalizedString(@"XPRoomMenuContainerView2") forState:UIControlStateNormal];
[_inputButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_inputButton.titleLabel.font = [UIFont systemFontOfSize:12];
_inputButton.layer.masksToBounds = YES;
_inputButton.layer.cornerRadius = 15;
[_inputButton setBackgroundImage:[UIImage imageNamed:@"room_menu_send_bg"] forState:UIControlStateNormal];
_inputButton.tag = XPRoomMenuItemType_Input;
[_inputButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _inputButton;
if (!_inputButton) {
_inputButton = [UIButton buttonWithType:UIButtonTypeCustom];
if ([ClientConfig shareConfig].canOpen) {
[_inputButton setTitle:YMLocalizedString(@"XPRoomMenuContainerView2") forState:UIControlStateNormal];
} else {
[_inputButton setTitle:YMLocalizedString(@"XPRoomMenuContainerView3") forState:UIControlStateNormal];
}
[_inputButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
_inputButton.titleLabel.font = [UIFont systemFontOfSize:15];
_inputButton.layer.masksToBounds = YES;
_inputButton.layer.cornerRadius = 15;
_inputButton.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.3);
_inputButton.tag = XPRoomMenuItemType_Input;
[_inputButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _inputButton;
}
- (UIButton *)micButton {
if (!_micButton) {
_micButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_open"] forState:UIControlStateNormal];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_close"] forState:UIControlStateSelected];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_close"] forState:UIControlStateDisabled | UIControlStateSelected];
_micButton.tag = XPRoomMenuItemType_Mic;
[_micButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_micButton.hidden = YES;
}
return _micButton;
}
- (UIButton *)voiceButton {
if (!_voiceButton) {
_voiceButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_voiceButton setImage:[UIImage imageNamed:@"room_menu_voice_open"] forState:UIControlStateNormal];
[_voiceButton setImage:[UIImage imageNamed:@"room_menu_voice_close"] forState:UIControlStateSelected];
_voiceButton.tag = XPRoomMenuItemType_Voice;
[_voiceButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _voiceButton;
if (!_micButton) {
_micButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_open"] forState:UIControlStateNormal];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_close"] forState:UIControlStateSelected];
[_micButton setImage:[UIImage imageNamed:@"room_menu_mic_close"] forState:UIControlStateDisabled | UIControlStateSelected];
_micButton.tag = XPRoomMenuItemType_Mic;
[_micButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_micButton.hidden = YES;
}
return _micButton;
}
- (UIButton *)faceButton {
if (!_faceButton) {
_faceButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_faceButton setImage:[UIImage imageNamed:@"room_menu_face"] forState:UIControlStateNormal];
[_faceButton setImage:[UIImage imageNamed:@"room_menu_face"] forState:UIControlStateSelected];
_faceButton.tag = XPRoomMenuItemType_Face;
[_faceButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_faceButton.hidden = YES;
}
return _faceButton;
if (!_faceButton) {
_faceButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_faceButton setImage:[UIImage imageNamed:@"room_menu_face"] forState:UIControlStateNormal];
[_faceButton setImage:[UIImage imageNamed:@"room_menu_face"] forState:UIControlStateSelected];
_faceButton.tag = XPRoomMenuItemType_Face;
[_faceButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_faceButton.hidden = YES;
}
return _faceButton;
}
- (UIButton *)messageButton {
if (!_messageButton) {
_messageButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_messageButton setImage:[UIImage imageNamed:@"room_menu_message"] forState:UIControlStateNormal];
[_messageButton setImage:[UIImage imageNamed:@"room_menu_new_message"] forState:UIControlStateSelected];
_messageButton.tag = XPRoomMenuItemType_Message;
[_messageButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _messageButton;
if (!_messageButton) {
_messageButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_messageButton setImage:[UIImage imageNamed:@"room_menu_message"] forState:UIControlStateNormal];
[_messageButton setImage:[UIImage imageNamed:@"room_menu_new_message"] forState:UIControlStateSelected];
_messageButton.tag = XPRoomMenuItemType_Message;
[_messageButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _messageButton;
}
- (UIButton *)moreButton {
@@ -536,54 +514,54 @@
}
- (UIButton *)giftButton {
if (!_giftButton) {
_giftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateNormal];
[_giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected];
_giftButton.tag = XPRoomMenuItemType_Gift;
[_giftButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _giftButton;
if (!_giftButton) {
_giftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateNormal];
[_giftButton setImage:[UIImage imageNamed:@"room_menu_gift"] forState:UIControlStateSelected];
_giftButton.tag = XPRoomMenuItemType_Gift;
[_giftButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _giftButton;
}
- (UIStackView *)stackView {
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 12;
}
return _stackView;
if (!_stackView) {
_stackView = [[UIStackView alloc] init];
_stackView.axis = UILayoutConstraintAxisHorizontal;
_stackView.distribution = UIStackViewDistributionFill;
_stackView.alignment = UIStackViewAlignmentCenter;
_stackView.spacing = 8;
}
return _stackView;
}
- (UIButton *)arrangeMicButton {
if (!_arrangeMicButton) {
_arrangeMicButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_arrangeMicButton setImage:[UIImage imageNamed:@"room_menu_arrange_mic"] forState:UIControlStateNormal];
[_arrangeMicButton setImage:[UIImage imageNamed:@"room_menu_arrange_mic_new"] forState:UIControlStateSelected];
_arrangeMicButton.tag = XPRoomMenuItemType_ArrangeMic;
[_arrangeMicButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_arrangeMicButton.hidden = YES;
}
return _arrangeMicButton;
if (!_arrangeMicButton) {
_arrangeMicButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_arrangeMicButton setImage:[UIImage imageNamed:@"room_menu_arrange_mic"] forState:UIControlStateNormal];
[_arrangeMicButton setImage:[UIImage imageNamed:@"room_menu_arrange_mic_new"] forState:UIControlStateSelected];
_arrangeMicButton.tag = XPRoomMenuItemType_ArrangeMic;
[_arrangeMicButton addTarget:self action:@selector(menuButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_arrangeMicButton.hidden = YES;
}
return _arrangeMicButton;
}
- (UIScrollView *)scrollView {
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] init];
_scrollView.backgroundColor = [UIColor clearColor];
_scrollView.showsHorizontalScrollIndicator = NO;
}
return _scrollView;
if (!_scrollView) {
_scrollView = [[UIScrollView alloc] init];
_scrollView.backgroundColor = [UIColor clearColor];
_scrollView.showsHorizontalScrollIndicator = NO;
}
return _scrollView;
}
- (XPRoomMessageBubbleView *)miniMessageView {
if (!_miniMessageView) {
_miniMessageView = [[XPRoomMessageBubbleView alloc] init];
_miniMessageView.delegate = self;
}
return _miniMessageView;
if (!_miniMessageView) {
_miniMessageView = [[XPRoomMessageBubbleView alloc] init];
_miniMessageView.delegate = self;
}
return _miniMessageView;
}
@end

Some files were not shown because too many files have changed in this diff Show More