优化及修复bug
This commit is contained in:
@@ -245,10 +245,6 @@
|
||||
23E9EA672A837BE400B792F2 /* XPTreasureFairyStoreView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9EA2A2A837BE400B792F2 /* XPTreasureFairyStoreView.m */; };
|
||||
23E9EA682A837BE400B792F2 /* Api+TreasureFairy.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9EA312A837BE400B792F2 /* Api+TreasureFairy.m */; };
|
||||
23E9EA6B2A83808000B792F2 /* ContentTreasureFairyModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9EA6A2A83808000B792F2 /* ContentTreasureFairyModel.m */; };
|
||||
23E9EA722A83813000B792F2 /* treasure_fairy_trials_high.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EA6D2A83813000B792F2 /* treasure_fairy_trials_high.mp4 */; };
|
||||
23E9EA732A83813000B792F2 /* treasure_fairy_ten.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EA6E2A83813000B792F2 /* treasure_fairy_ten.mp4 */; };
|
||||
23E9EA742A83813000B792F2 /* treasure_fairy_trials_middle.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EA6F2A83813000B792F2 /* treasure_fairy_trials_middle.mp4 */; };
|
||||
23E9EA752A83813000B792F2 /* treasure_fairy_one.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EA702A83813000B792F2 /* treasure_fairy_one.mp4 */; };
|
||||
23E9EA762A83813000B792F2 /* treasure_fairy_gift_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 23E9EA712A83813000B792F2 /* treasure_fairy_gift_bg.svga */; };
|
||||
23E9EA792A8385CC00B792F2 /* XPTreasureFairyGiftView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9EA772A8385CB00B792F2 /* XPTreasureFairyGiftView.m */; };
|
||||
23E9EA7C2A83977400B792F2 /* MessageContentTreasureFairyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9EA7B2A83977400B792F2 /* MessageContentTreasureFairyView.m */; };
|
||||
@@ -1821,10 +1817,6 @@
|
||||
23E9EA322A837BE400B792F2 /* Api+TreasureFairy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Api+TreasureFairy.h"; sourceTree = "<group>"; };
|
||||
23E9EA692A83808000B792F2 /* ContentTreasureFairyModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContentTreasureFairyModel.h; sourceTree = "<group>"; };
|
||||
23E9EA6A2A83808000B792F2 /* ContentTreasureFairyModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ContentTreasureFairyModel.m; sourceTree = "<group>"; };
|
||||
23E9EA6D2A83813000B792F2 /* treasure_fairy_trials_high.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_trials_high.mp4; sourceTree = "<group>"; };
|
||||
23E9EA6E2A83813000B792F2 /* treasure_fairy_ten.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_ten.mp4; sourceTree = "<group>"; };
|
||||
23E9EA6F2A83813000B792F2 /* treasure_fairy_trials_middle.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_trials_middle.mp4; sourceTree = "<group>"; };
|
||||
23E9EA702A83813000B792F2 /* treasure_fairy_one.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_one.mp4; sourceTree = "<group>"; };
|
||||
23E9EA712A83813000B792F2 /* treasure_fairy_gift_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = treasure_fairy_gift_bg.svga; sourceTree = "<group>"; };
|
||||
23E9EA772A8385CB00B792F2 /* XPTreasureFairyGiftView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPTreasureFairyGiftView.m; sourceTree = "<group>"; };
|
||||
23E9EA782A8385CC00B792F2 /* XPTreasureFairyGiftView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPTreasureFairyGiftView.h; sourceTree = "<group>"; };
|
||||
@@ -5066,10 +5058,6 @@
|
||||
23E9EA6C2A83813000B792F2 /* fairy */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23E9EA6D2A83813000B792F2 /* treasure_fairy_trials_high.mp4 */,
|
||||
23E9EA6E2A83813000B792F2 /* treasure_fairy_ten.mp4 */,
|
||||
23E9EA6F2A83813000B792F2 /* treasure_fairy_trials_middle.mp4 */,
|
||||
23E9EA702A83813000B792F2 /* treasure_fairy_one.mp4 */,
|
||||
23E9EA712A83813000B792F2 /* treasure_fairy_gift_bg.svga */,
|
||||
);
|
||||
path = fairy;
|
||||
@@ -9632,7 +9620,6 @@
|
||||
E80EC81528ACD84000D133C5 /* emoji_145@2x.png in Resources */,
|
||||
E80EC85428ACD84000D133C5 /* emoji_165@2x.png in Resources */,
|
||||
E80EC88728ACD84000D133C5 /* emoji_29@2x.png in Resources */,
|
||||
23E9EA722A83813000B792F2 /* treasure_fairy_trials_high.mp4 in Resources */,
|
||||
E80EC83728ACD84000D133C5 /* emoji_112@2x.png in Resources */,
|
||||
E80EC88C28ACD84000D133C5 /* emoji_46@2x.png in Resources */,
|
||||
E80EC86028ACD84000D133C5 /* emoji_30@2x.png in Resources */,
|
||||
@@ -9682,11 +9669,8 @@
|
||||
E80EC85F28ACD84000D133C5 /* emoji_65@2x.png in Resources */,
|
||||
E80EC84028ACD84000D133C5 /* emoji_75@2x.png in Resources */,
|
||||
23E9EB312A85E5D100B792F2 /* pi_app_logo_new_bg.png in Resources */,
|
||||
23E9EA742A83813000B792F2 /* treasure_fairy_trials_middle.mp4 in Resources */,
|
||||
E80EC88D28ACD84000D133C5 /* emoji_del_pressed@2x.png in Resources */,
|
||||
E80EC83A28ACD84000D133C5 /* emoji_82@2x.png in Resources */,
|
||||
23E9EA752A83813000B792F2 /* treasure_fairy_one.mp4 in Resources */,
|
||||
23E9EA732A83813000B792F2 /* treasure_fairy_ten.mp4 in Resources */,
|
||||
E80EC8B428ACD84100D133C5 /* emoji_89@2x.png in Resources */,
|
||||
E80EC89F28ACD84000D133C5 /* emoji_66@2x.png in Resources */,
|
||||
E80EC87128ACD84000D133C5 /* emoji_160@2x.png in Resources */,
|
||||
|
@@ -78,7 +78,9 @@
|
||||
}
|
||||
[Api completeUserInfo:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[[self getView] complementInfoSuccess];
|
||||
}showLoading:YES errorToast:YES] userInfo:params];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] complementInfoFail];
|
||||
} errorToast:YES] userInfo:params];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -71,7 +71,7 @@
|
||||
/// 第三方登录
|
||||
/// @param type 登录的类型
|
||||
- (void)thirdLoginWithType:(ThirdLoginType)type{
|
||||
|
||||
|
||||
SSDKPlatformType platformType;
|
||||
switch (type) {
|
||||
case ThirdLoginType_FB:
|
||||
@@ -133,14 +133,13 @@
|
||||
[self loginWithThirdPartWithType:type];
|
||||
} else if(state == SSDKResponseStateCancel) {///取消
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter0")];
|
||||
|
||||
} else if (state == SSDKResponseStateFail) {///失败
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
|
||||
}
|
||||
}];
|
||||
}
|
||||
-(void)loginWithThirdPartWithType:(ThirdLoginType)type{
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow];
|
||||
NSString * openid = [AccountInfoStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountInfoStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountInfoStorage instance].thirdUserInfo.unionid;
|
||||
@@ -150,11 +149,12 @@
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
[[self getView] loginSuccess];
|
||||
[XPAdjustEvent loginEvent];
|
||||
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[[NSUserDefaults standardUserDefaults]setValue:@(type) forKey:@"kLoginSuccessType"];
|
||||
[[NSUserDefaults standardUserDefaults]synchronize];
|
||||
}
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[[self getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)type]];
|
||||
|
||||
@@ -211,10 +211,12 @@
|
||||
}
|
||||
|
||||
-(void)loginWithThirdGoogle{
|
||||
[XNDJTDDLoadingTool showOnlyView:kWindow];
|
||||
NSString * openid = [AccountInfoStorage instance].thirdUserInfo.openid;
|
||||
NSString * access_token = [AccountInfoStorage instance].thirdUserInfo.access_token;
|
||||
NSString * unionid = [AccountInfoStorage instance].thirdUserInfo.unionid;
|
||||
[Api loginWithThirdPart:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
AccountModel * model = [AccountModel modelWithDictionary:data.data];
|
||||
if (model != nil) {
|
||||
[[AccountInfoStorage instance] saveAccountInfo:model];
|
||||
@@ -225,6 +227,7 @@
|
||||
}
|
||||
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[XNDJTDDLoadingTool hideOnlyView:kWindow];
|
||||
[[super getView] showErrorToast:YMLocalizedString(@"LoginPresenter1")];
|
||||
} showLoading:YES] openid:openid unionid:unionid access_token:access_token type:[NSString stringWithFormat:@"%lu", (unsigned long)ThirdLoginType_Gmail]];
|
||||
}
|
||||
|
@@ -49,7 +49,9 @@
|
||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||
}
|
||||
[[self getView] loginSuccess];
|
||||
} showLoading:YES errorToast:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] loginFail];
|
||||
} errorToast:YES] phone:desPhone code:code client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password" phoneAreaCode:phoneAreaCode];
|
||||
}
|
||||
/// 使用手机号和密码登录
|
||||
/// @param phone 手机号
|
||||
@@ -63,7 +65,9 @@
|
||||
[[AccountInfoStorage instance] saveAccountInfo:accountModel];
|
||||
}
|
||||
[[self getView] loginSuccess];
|
||||
} showLoading:YES errorToast:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
} fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] loginFail];
|
||||
} errorToast:YES] phone:desPhone password:desPassword client_secret:@"uyzjdhds" version:@"1" client_id:@"erban-client" grant_type:@"password"];
|
||||
}
|
||||
/// 绑定手机号
|
||||
/// @param phone 手机号
|
||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)requestRandomNickSuccess:(NSString *)nick;
|
||||
///补全资料成功
|
||||
- (void)complementInfoSuccess;
|
||||
///补全资料失败
|
||||
- (void)complementInfoFail;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)phoneSmsCodeSuccess;
|
||||
///登录成功
|
||||
- (void)loginSuccess;
|
||||
///登录失败
|
||||
- (void)loginFail;
|
||||
///绑定手机号成功
|
||||
- (void)bindPhoneSuccess;
|
||||
///绑定授权码成功
|
||||
|
@@ -229,6 +229,7 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
|
||||
|
||||
///更新用户信息
|
||||
- (void)updateUserInfo {
|
||||
[XNDJTDDLoadingTool showOnlyView:self.view];
|
||||
[self.presenter complectionInfoWithAvatar:[self getAvatarUrl] gender:self.maleView.selected ? @"1":@"2" nick:self.textField.text inviteCode:self.codeTextField.text roomUid:nil shareUid:nil shareChannel:nil];
|
||||
}
|
||||
|
||||
@@ -270,6 +271,9 @@ UIKIT_EXTERN NSString * kUserCompleteInfoFinishKey;
|
||||
NSString * inviteCode = self.codeTextField.text.length > 0 ? self.codeTextField.text : @"";
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kUserCompleteInfoFinishKey object:inviteCode];
|
||||
}
|
||||
-(void)complementInfoFail{
|
||||
[XNDJTDDLoadingTool hideOnlyView:self.view];
|
||||
};
|
||||
#pragma mark - Event Response
|
||||
- (void)nextButtonAction:(UIButton *)sender {
|
||||
if (self.codeTextField.text.length <= 0) {
|
||||
|
@@ -179,6 +179,7 @@
|
||||
|
||||
/// 登录
|
||||
- (void)loginBtnClicked {
|
||||
[XNDJTDDLoadingTool showOnlyView:self.view];
|
||||
if(self.selectType == 0){
|
||||
NSString *phone = self.accountView.inputTextField.text;
|
||||
NSString *password = self.accountPwdView.inputTextField.text;
|
||||
@@ -224,6 +225,7 @@
|
||||
|
||||
#pragma mark - LoginVerifCodeProtocol
|
||||
- (void)loginSuccess {
|
||||
[XNDJTDDLoadingTool hideOnlyView:self.view];
|
||||
[[NSUserDefaults standardUserDefaults]removeObjectForKey:@"kLoginSuccessType"];
|
||||
[self showSuccessToast:YMLocalizedString(@"XPLoginPhoneViewController1")];
|
||||
UIViewController *vc = self.presentingViewController;
|
||||
@@ -233,7 +235,9 @@
|
||||
[vc dismissViewControllerAnimated:YES completion:nil];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
}
|
||||
|
||||
- (void)loginFail{
|
||||
[XNDJTDDLoadingTool hideOnlyView:self.view];
|
||||
}
|
||||
-(void)backViewAction{
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
@@ -761,17 +761,18 @@
|
||||
NSString *viewUrl = [effectDict objectForKey:@"viewUrl"];
|
||||
NSString *carEffect = [effectDict objectForKey:@"effect"];
|
||||
if (viewUrl.length) {
|
||||
self.carVapEffectView.hidden = NO;
|
||||
if (self.carVapEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.carVapEffectView];
|
||||
[self.carVapEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
[self.vapParser parseWithURL:viewUrl completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
self.carVapEffectView.hidden = NO;
|
||||
if (self.carVapEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.carVapEffectView];
|
||||
[self.carVapEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
[self.carVapEffectView setMute:YES];
|
||||
[self.carVapEffectView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
@@ -779,16 +780,17 @@
|
||||
|
||||
}];
|
||||
} else if (carEffect.length) {
|
||||
if (self.carEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.carEffectView];
|
||||
[self.carEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
[self.parser parseWithURL:[NSURL URLWithString:carEffect] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
if (self.carEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.carEffectView];
|
||||
[self.carEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
@@ -1787,16 +1789,6 @@
|
||||
///播放礼物特效 SVGA的
|
||||
- (void)playGiftEffect:(NSString *)vggUrl {
|
||||
if ([self isInSudGame]) {return;}
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
[self.giftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
NSString *baseFileName = @"/GiftSvga";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vggUrl];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
@@ -1804,6 +1796,16 @@
|
||||
NSData *data=[NSData dataWithContentsOfFile:filePath options:0 error:NULL];
|
||||
[self.parser parseWithData:data cacheKey:nil completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
[self.giftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
@@ -1831,6 +1833,16 @@
|
||||
|
||||
[self.parser parseWithURL:[NSURL URLWithString:vggUrl] completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.giftEffectView.hidden = NO;
|
||||
if (self.giftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.giftEffectView];
|
||||
[self.giftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
@@ -1856,24 +1868,38 @@
|
||||
|
||||
///播放礼物特效 vap的
|
||||
- (void)playGiftEffectWithVapUrl:(NSString *)vapUrl {
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.vapGiftEffectView.hidden = NO;
|
||||
if (self.vapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.vapGiftEffectView];
|
||||
[self.vapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vapUrl];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
vapUrl = filePath;
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.vapGiftEffectView.hidden = NO;
|
||||
if (self.vapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.vapGiftEffectView];
|
||||
[self.vapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
[self.vapGiftEffectView setMute:YES];
|
||||
[self.vapGiftEffectView playHWDMP4:vapUrl repeatCount:1 delegate:self];
|
||||
return;
|
||||
}
|
||||
// NSString *baseFileName = @"/GiftMp4";
|
||||
// NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vapUrl];
|
||||
// NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
// if ([fileManager fileExistsAtPath:filePath]){
|
||||
// vapUrl = filePath;
|
||||
// }
|
||||
[self.vapParser parseWithURL:vapUrl completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
self.isLargeGiftAnimating = YES;
|
||||
self.vapGiftEffectView.hidden = NO;
|
||||
if (self.vapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.vapGiftEffectView];
|
||||
[self.vapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
[self.vapGiftEffectView setMute:YES];
|
||||
[self.vapGiftEffectView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
@@ -1885,15 +1911,7 @@
|
||||
///播放礼物特效 SVGA的
|
||||
- (void)playLuckyGiftEffect:(NSURL *)vggUrl {
|
||||
if ([self isInSudGame]) {return;}
|
||||
self.luckyGiftEffectView.hidden = NO;
|
||||
if (self.luckyGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyGiftEffectView];
|
||||
[self.luckyGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
NSString *baseFileName = @"/GiftSvga";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vggUrl.absoluteString];
|
||||
@@ -1902,6 +1920,15 @@
|
||||
NSData *data=[NSData dataWithContentsOfFile:filePath options:0 error:NULL];
|
||||
[self.parser parseWithData:data cacheKey:@"" completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.luckyGiftEffectView.hidden = NO;
|
||||
if (self.luckyGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyGiftEffectView];
|
||||
[self.luckyGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
@@ -1930,6 +1957,15 @@
|
||||
|
||||
[self.parser parseWithURL:vggUrl completionBlock:^(SVGAVideoEntity * _Nullable videoItem) {
|
||||
if (videoItem != nil) {
|
||||
self.luckyGiftEffectView.hidden = NO;
|
||||
if (self.luckyGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyGiftEffectView];
|
||||
[self.luckyGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
CGFloat width = videoItem.videoSize.width;
|
||||
CGFloat height = videoItem.videoSize.height;
|
||||
if (width > height) {
|
||||
@@ -1955,23 +1991,36 @@
|
||||
|
||||
///播放礼物特效 vap的
|
||||
- (void)playLuckyGiftEffectWithVapUrl:(NSString *)vapUrl {
|
||||
self.luckyVapGiftEffectView.hidden = NO;
|
||||
if (self.luckyVapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyVapGiftEffectView];
|
||||
[self.luckyVapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vapUrl];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
vapUrl = filePath;
|
||||
self.luckyVapGiftEffectView.hidden = NO;
|
||||
if (self.luckyVapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyVapGiftEffectView];
|
||||
[self.luckyVapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
[self.luckyVapGiftEffectView setMute:YES];
|
||||
[self.luckyVapGiftEffectView playHWDMP4:vapUrl repeatCount:1 delegate:self];
|
||||
return;
|
||||
}
|
||||
// NSString *baseFileName = @"/GiftMp4";
|
||||
// NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:vapUrl];
|
||||
// NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
// if ([fileManager fileExistsAtPath:filePath]){
|
||||
// vapUrl = filePath;
|
||||
// }
|
||||
[self.vapParser parseWithURL:vapUrl completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
self.luckyVapGiftEffectView.hidden = NO;
|
||||
if (self.luckyVapGiftEffectView.superview == nil) {
|
||||
[self.middleLevelView addSubview:self.luckyVapGiftEffectView];
|
||||
[self.luckyVapGiftEffectView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.center.mas_equalTo(self.middleLevelView);
|
||||
make.width.mas_equalTo(KScreenWidth);
|
||||
make.height.mas_equalTo(KScreenHeight);
|
||||
}];
|
||||
}
|
||||
[self.luckyVapGiftEffectView setMute:YES];
|
||||
[self.luckyVapGiftEffectView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
|
@@ -29,9 +29,8 @@
|
||||
}
|
||||
/// 请求缓存列表
|
||||
/// @param complection 完成
|
||||
/// @param roomUid 房间的roomuid
|
||||
+ (void)requestCacheGiftList:(HttpRequestHelperCompletion)complection {
|
||||
NSString * fang = @"gift/vgg";///gift/listV4
|
||||
NSString * fang = @"gift/vgg";
|
||||
[self makeRequest:fang method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
|
||||
}
|
||||
/// 请求福袋全服礼物全服记录
|
||||
|
@@ -12,7 +12,7 @@
|
||||
///Tool
|
||||
#import "NetImageView.h"
|
||||
|
||||
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
#import "TTPopup.h"
|
||||
#import "Api+TreasureFairy.h"
|
||||
|
||||
@@ -98,6 +98,8 @@
|
||||
@property (nonatomic,assign) BOOL isShowResult;
|
||||
///用户信息
|
||||
@property (nonatomic,strong) TreasureFairyUserInfoModel *userInfo;
|
||||
///VAP动画管理
|
||||
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
|
||||
@end
|
||||
|
||||
@implementation XPTreasureFairyStoreView
|
||||
@@ -464,9 +466,9 @@
|
||||
self.isFinish = NO;
|
||||
[Api treasureFailyForestDraw:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSString * animtionName = @"treasure_fairy_one";
|
||||
NSString * animtionName = @"https://image.hfighting.com/treasure_fairy_one.mp4";
|
||||
if (number == 10) {
|
||||
animtionName = @"treasure_fairy_ten";
|
||||
animtionName = @"https://image.hfighting.com/treasure_fairy_ten.mp4";
|
||||
}
|
||||
VAPView *view = [[VAPView alloc] initWithFrame:CGRectMake(0, 0, 159, 190)];
|
||||
view.contentMode = UIViewContentModeScaleAspectFill;
|
||||
@@ -478,9 +480,23 @@
|
||||
make.edges.mas_equalTo(self.forestImageView);
|
||||
}];
|
||||
|
||||
NSString *filePath = [[NSBundle mainBundle] pathForResource:animtionName ofType:@"mp4"];
|
||||
[view setMute:YES];
|
||||
[view playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:animtionName];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
[view setMute:YES];
|
||||
[view playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
|
||||
}else{
|
||||
[self.vapParser parseWithURL:filePath completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
[view setMute:YES];
|
||||
[view playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
NSArray * array = [TreasureFairyInfoModel modelsWithArray:data.data];
|
||||
self.resultList = array;
|
||||
@@ -904,6 +920,11 @@
|
||||
}
|
||||
return _forestView;
|
||||
}
|
||||
|
||||
- (XPRoomGiftAnimationParser *)vapParser {
|
||||
if (!_vapParser) {
|
||||
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
|
||||
}
|
||||
return _vapParser;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -25,7 +25,7 @@
|
||||
///View
|
||||
#import "XPTreasureFairyTrialsBallView.h"
|
||||
#import "XPTreasureFairyStoreResultSmallView.h"
|
||||
|
||||
#import "XPRoomGiftAnimationParser.h"
|
||||
@interface XPTreasureFairyTrialsContentView ()<HWDMP4PlayDelegate>
|
||||
///背景图
|
||||
@property (nonatomic,strong) UIImageView *backImageView;
|
||||
@@ -66,6 +66,8 @@
|
||||
///试炼的球
|
||||
@property (nonatomic,strong) NSMutableArray *ballList;
|
||||
@property (nonatomic,strong) NSArray *originBallList;
|
||||
///VAP动画管理
|
||||
@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser;
|
||||
@end
|
||||
|
||||
@implementation XPTreasureFairyTrialsContentView
|
||||
@@ -224,9 +226,9 @@
|
||||
[Api treasureFailyCompoundBall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
sender.userInteractionEnabled = YES;
|
||||
if (code == 200) {
|
||||
NSString * animtionName = @"treasure_fairy_trials_middle";
|
||||
NSString * animtionName = @"https://image.hfighting.com/treasure_fairy_trials_middle.mp4";
|
||||
if (self.isHigh) {
|
||||
animtionName = @"treasure_fairy_trials_high";
|
||||
animtionName = @"https://image.hfighting.com/treasure_fairy_trials_high.mp4";
|
||||
}
|
||||
if (!self.trialsView.superview) {
|
||||
[self.trialsBgImageView insertSubview:self.trialsView atIndex:0];
|
||||
@@ -234,9 +236,23 @@
|
||||
make.edges.mas_equalTo(self.trialsBgImageView);
|
||||
}];
|
||||
}
|
||||
NSString *filePath = [[NSBundle mainBundle] pathForResource:animtionName ofType:@"mp4"];
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:animtionName];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
|
||||
}else{
|
||||
[self.vapParser parseWithURL:filePath completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.9 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
///重置数据
|
||||
[self.ballList removeAllObjects];
|
||||
@@ -629,5 +645,10 @@
|
||||
}
|
||||
return _ballList;
|
||||
}
|
||||
|
||||
- (XPRoomGiftAnimationParser *)vapParser {
|
||||
if (!_vapParser) {
|
||||
_vapParser = [[XPRoomGiftAnimationParser alloc] init];
|
||||
}
|
||||
return _vapParser;
|
||||
}
|
||||
@end
|
||||
|
@@ -122,7 +122,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
@property (nonatomic,assign) BOOL isReload;
|
||||
///房间外的飘屏
|
||||
@property(nonatomic,strong) PIFullScreenBannerAnimation *roomAnimation;
|
||||
@property(nonatomic,strong) NSMutableArray *cacheList;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -286,7 +286,7 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
///
|
||||
-(void)requestGiftList{
|
||||
[self dealWithDefaultSvga];
|
||||
///保存时间,一天只请求一次
|
||||
// /保存时间,一天只请求一次
|
||||
NSString *time = [NSDate getNowTimeTimestamp];
|
||||
NSString *curTime = [NSDate timestampSwitchTime:[time integerValue] andFormatter:@"yyyy-MM-dd"];
|
||||
NSDictionary *timeDic = [[NSUserDefaults standardUserDefaults]valueForKey:@"kRequestGiftList"];
|
||||
@@ -323,9 +323,14 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
}
|
||||
|
||||
-(void)dealWithDefaultSvga{
|
||||
for (NSString *url in self.cacheList) {
|
||||
NSArray *loveList = @[@"https://image.hfighting.com/candyTree_light.svga",@"https://image.hfighting.com/candyTree_open.svga",@"https://image.hfighting.com/candyTree_transform.svga"];
|
||||
for (NSString *url in loveList) {
|
||||
[self dealWithGiftListWithUrl:url fileName:url isSvga:YES];
|
||||
}
|
||||
NSArray *elfList = @[@"https://image.hfighting.com/treasure_fairy_trials_middle.mp4",@"https://image.hfighting.com/treasure_fairy_ten.mp4",@"https://image.hfighting.com/treasure_fairy_trials_high.mp4",@"https://image.hfighting.com/treasure_fairy_one.mp4"];
|
||||
for (NSString *url in elfList) {
|
||||
[self dealWithGiftListWithUrl:url fileName:url isSvga:NO];
|
||||
}
|
||||
}
|
||||
-(void)dealWithGiftListWithUrl:(NSString *)url fileName:(NSString *)fileName isSvga:(BOOL)isSvga {
|
||||
NSString *baseFileName = isSvga ? @"/GiftSvga":@"/GiftMp4";
|
||||
@@ -1006,10 +1011,5 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
}
|
||||
return _roomAnimation;
|
||||
}
|
||||
- (NSMutableArray *)cacheList{
|
||||
if(!_cacheList){
|
||||
_cacheList = [[NSMutableArray alloc]initWithArray:@[@"https://image.hfighting.com/candyTree_light.svga",@"https://image.hfighting.com/candyTree_open.svga",@"https://image.hfighting.com/candyTree_transform.svga"]];
|
||||
}
|
||||
return _cacheList;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user