Commit 0d6d0d1e by pidan

添加私享屋提示的需求

parent 5a28074f
Showing with 452 additions and 31 deletions
...@@ -224,4 +224,9 @@ ...@@ -224,4 +224,9 @@
} }
} }
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
return NO;
}
@end @end
...@@ -112,6 +112,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -112,6 +112,9 @@ NS_ASSUME_NONNULL_BEGIN
// 获取用户数据交易提醒 // 获取用户数据交易提醒
+ (NSString *)fus_FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE; + (NSString *)fus_FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE;
// 接收到礼物消息
+ (NSString *)fus_FUS_NOTIFICATION_DidReceiveGiftMessage;
@end @end
......
...@@ -179,6 +179,10 @@ ...@@ -179,6 +179,10 @@
return @"FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE"; return @"FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE";
} }
// 接收到礼物消息
+ (NSString *)fus_FUS_NOTIFICATION_DidReceiveGiftMessage {
return @"fus_FUS_NOTIFICATION_DidReceiveGiftMessage";
}
@end @end
......
...@@ -205,3 +205,4 @@ ...@@ -205,3 +205,4 @@
#import "FUSConfig.h" #import "FUSConfig.h"
#import "UIColor+FUSTheme.h" #import "UIColor+FUSTheme.h"
#import "UIFont+FUSTheme.h" #import "UIFont+FUSTheme.h"
#import "UIView+FUSShakeAnim.h"
//
// UIView+FUSShakeAnim.h
// FUSFoundation
//
// Created by pppidan on 2025/7/3.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface UIView (FUSShakeAnim)
- (void)fus_startInfiniteShakeWithInterval:(NSTimeInterval)interval;
- (void)fus_stopInfiniteShake;
@end
NS_ASSUME_NONNULL_END
//
// UIView+FUSShakeAnim.m
// FUSFoundation
//
// Created by pppidan on 2025/7/3.
//
#import "UIView+FUSShakeAnim.h"
#import <QuartzCore/QuartzCore.h>
#import <objc/runtime.h>
@interface UIView (FUSShakePrivate)
@property (nonatomic, strong, nullable) NSTimer *shakeTimer;
@end
@implementation UIView (FUSShakeAnim)
- (void)fus_startInfiniteShakeWithInterval:(NSTimeInterval)interval {
[self fus_stopInfiniteShake]; // 先停止旧的动画
[self fus_shakeOnce];
__weak typeof(self) weakSelf = self;
self.shakeTimer = [NSTimer scheduledTimerWithTimeInterval:interval
target:self
selector:@selector(fus_shakeOnce)
userInfo:nil
repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:self.shakeTimer forMode:NSRunLoopCommonModes];
}
- (void)fus_shakeOnce {
[self.layer removeAnimationForKey:@"shake"];
// 定义 x 偏移序列:0 -> 3 -> 0 -> -3 -> 0
NSArray<NSNumber *> *values = @[@0.0, @3.0, @0.0, @-3.0, @0.0];
CAKeyframeAnimation *shake = [CAKeyframeAnimation animationWithKeyPath:@"transform.translation.x"];
shake.values = values;
shake.keyTimes = @[@0.0, @0.2, @0.5, @0.8, @1.0]; // 时间分布均匀
shake.duration = 0.4; // 整体动画时长
shake.removedOnCompletion = YES;
shake.fillMode = kCAFillModeForwards;
shake.repeatCount = 2;
[self.layer addAnimation:shake forKey:@"shake"];
}
- (void)fus_stopInfiniteShake {
if (self.shakeTimer) {
[self.shakeTimer invalidate];
self.shakeTimer = nil;
}
[self.layer removeAnimationForKey:@"shake"];
}
@end
// MARK: - Private Associated Object Extension
@implementation UIView (FUSShakePrivate)
@dynamic shakeTimer;
+ (void)load {
static char kShakeTimerKey;
objc_setAssociatedObject(self, &kShakeTimerKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (NSTimer *)shakeTimer {
return objc_getAssociatedObject(self, _cmd);
}
- (void)setShakeTimer:(NSTimer *)timer {
objc_setAssociatedObject(self, @selector(shakeTimer), timer, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
@end
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { 00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet; isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = ( membershipExceptions = (
"NotificationService-Info.plist", "NotificationService-Info.plist",
...@@ -112,7 +112,18 @@ ...@@ -112,7 +112,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ /* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
/* Begin PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFileSystemSynchronizedRootGroup section */
00E501F42E0543A800579DB0 /* NotificationService */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = NotificationService; sourceTree = "<group>"; }; 00E501F42E0543A800579DB0 /* NotificationService */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */,
);
explicitFileTypes = {
};
explicitFolders = (
);
path = NotificationService;
sourceTree = "<group>";
};
/* End PBXFileSystemSynchronizedRootGroup section */ /* End PBXFileSystemSynchronizedRootGroup section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -415,14 +426,10 @@ ...@@ -415,14 +426,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks.sh\"\n";
...@@ -436,14 +443,10 @@ ...@@ -436,14 +443,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources.sh\"\n";
......

53.1 KB | W: | H:

124 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-1024.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-1024.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-1024.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-1024.png
  • 2-up
  • Swipe
  • Onion skin

1.39 KB | W: | H:

600 Bytes | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20-ipad.png
  • 2-up
  • Swipe
  • Onion skin

2.99 KB | W: | H:

3.03 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png
  • 2-up
  • Swipe
  • Onion skin

1.72 KB | W: | H:

1.01 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29 1.png
  • 2-up
  • Swipe
  • Onion skin

1.72 KB | W: | H:

1.01 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29.png
  • 2-up
  • Swipe
  • Onion skin

4.3 KB | W: | H:

5.32 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png
  • 2-up
  • Swipe
  • Onion skin

2.13 KB | W: | H:

1.63 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40.png
  • 2-up
  • Swipe
  • Onion skin

3.92 KB | W: | H:

4.61 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x 1.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x 1.png
  • 2-up
  • Swipe
  • Onion skin

3.92 KB | W: | H:

4.6 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png
  • 2-up
  • Swipe
  • Onion skin

9.85 KB | W: | H:

13.2 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png
  • 2-up
  • Swipe
  • Onion skin

3.66 KB | W: | H:

4.29 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76.png
  • 2-up
  • Swipe
  • Onion skin

7.73 KB | W: | H:

10.7 KB | W: | H:

FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
FuSiLive/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png
  • 2-up
  • Swipe
  • Onion skin
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "chat_password_gift_message_tip_bg@2x.png",
"idiom" : "universal",
"resizing" : {
"cap-insets" : {
"bottom" : 62,
"top" : 62
},
"center" : {
"height" : 1,
"mode" : "stretch"
},
"mode" : "3-part-vertical"
},
"scale" : "2x"
},
{
"filename" : "chat_password_gift_message_tip_bg@3x.png",
"idiom" : "universal",
"resizing" : {
"cap-insets" : {
"bottom" : 94,
"top" : 93
},
"center" : {
"height" : 1,
"mode" : "stretch"
},
"mode" : "3-part-vertical"
},
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -37,13 +37,14 @@ ...@@ -37,13 +37,14 @@
#import "FUSChatCenterModule/FUSChatCenterModule-Swift.h" #import "FUSChatCenterModule/FUSChatCenterModule-Swift.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h> #import <FirebaseAnalytics/FirebaseAnalytics.h>
#import <FUSBDAlphaPlayer/BDAlphaPlayer.h>
#define CELL_IDENTIFIER @"FUSIMChatDetailCell" #define CELL_IDENTIFIER @"FUSIMChatDetailCell"
#define ADDFRIENDVIEW_H 50 #define ADDFRIENDVIEW_H 50
@interface FUSChatDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UIScrollViewDelegate,UINavigationBarDelegate,FUSIMChatServiceDelegate,FUSIMMoreButtonViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,FUSIMGiftViewDelegate,FUSIMChatDetailCellDelegate,FUSIMChatAudioManagerDelegate,UIGestureRecognizerDelegate,FUSImagePickerViewControllerDelegate> @interface FUSChatDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UIScrollViewDelegate,UINavigationBarDelegate,FUSIMChatServiceDelegate,FUSIMMoreButtonViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,FUSIMGiftViewDelegate,FUSIMChatDetailCellDelegate,FUSIMChatAudioManagerDelegate,UIGestureRecognizerDelegate,FUSImagePickerViewControllerDelegate,BDAlphaPlayerMetalViewDelegate>
/** /**
会话的名称 会话的名称
...@@ -132,6 +133,8 @@ ...@@ -132,6 +133,8 @@
@property (nonatomic, copy) NSString *jumpToGid; @property (nonatomic, copy) NSString *jumpToGid;
@property (nonatomic, strong) BDAlphaPlayerMetalView *giftPlayView;
@end @end
@implementation FUSChatDetailViewController @implementation FUSChatDetailViewController
...@@ -503,6 +506,10 @@ ...@@ -503,6 +506,10 @@
} else { } else {
self.navigationController.navigationBar.barTintColor = UIColor.fus_navBarColor; self.navigationController.navigationBar.barTintColor = UIColor.fus_navBarColor;
} }
[self.giftPlayView stop];
[self.giftPlayView removeFromSuperview];
self.giftPlayView = nil;
} }
- (void)dealloc - (void)dealloc
...@@ -2021,7 +2028,45 @@ ...@@ -2021,7 +2028,45 @@
break; break;
case FUSMsgContentTypeGift: //礼物 case FUSMsgContentTypeGift: //礼物
{ {
[self.giftPlayView stop];
[self.giftPlayView removeFromSuperview];
self.giftPlayView = nil;
if ([NSString isNullWithString:infoModel.giftID]) {
return;
}
FUSChatGiftDataModel *giftModel = FUSGiftDataCenter.sharedCenter.chatGiftDict[infoModel.giftID];
if ([NSString isNullWithString:giftModel.mp4Res]) {
return;
}
__weak typeof(self) weakSelf = self;
[[FUSGiftDataCenter sharedCenter] checkResourceDownloadWithResourceUrl:giftModel.mp4Res resourceMd5:giftModel.mp4Md5 gid:infoModel.giftID success:^{
NSString *filePath = [FUSConfig.sharedInstanced.pathConfigs downloadResourcePath:giftModel.mp4Res pathMd5:giftModel.mp4Md5];
if (filePath.length > 0) {
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.giftPlayView = [[BDAlphaPlayerMetalView alloc] initWithDelegate:self];
weakSelf.giftPlayView.frame = UIView.fus_screenFrame;
weakSelf.giftPlayView.contentMode = UIViewContentModeScaleAspectFit;
weakSelf.giftPlayView.backgroundColor = [UIColor clearColor];
[UIApplication.sharedApplication.keyWindow addSubview:weakSelf.giftPlayView];
BDAlphaPlayerMetalConfiguration *configuration = [BDAlphaPlayerMetalConfiguration defaultConfiguration];
configuration.directory = filePath;
CGRect renderSuperViewFrame = weakSelf.giftPlayView.frame;
configuration.renderSuperViewFrame = renderSuperViewFrame;
configuration.orientation = BDAlphaPlayerOrientationPortrait;
configuration.playAudio = true;
[weakSelf.giftPlayView playWithMetalConfiguration:configuration];
});
}
} failure:^(NSString *msg, int code) {
}];
} }
break; break;
case FUSMsgContentTypeVideo: //视频 case FUSMsgContentTypeVideo: //视频
...@@ -2144,6 +2189,17 @@ ...@@ -2144,6 +2189,17 @@
} }
} }
#pragma mark - BDAlphaPlayerMetalViewDelegate
- (void)metalView:(BDAlphaPlayerMetalView *)metalView didFinishPlayingWithError:(NSError *)error {
[UIView animateWithDuration:.35 animations:^{
self.giftPlayView.alpha = 0;
} completion:^(BOOL finished) {
[self.giftPlayView removeFromSuperview];
self.giftPlayView = nil;
}];
}
#pragma mark - FUSIMChatAudioManagerDelegate(语音播放结束回调) #pragma mark - FUSIMChatAudioManagerDelegate(语音播放结束回调)
- (void)fus_audioChatCellEndedPlayingWithMessageModel:(FUSChatDetailFrameModel *)model - (void)fus_audioChatCellEndedPlayingWithMessageModel:(FUSChatDetailFrameModel *)model
{ {
......
...@@ -56,6 +56,19 @@ ...@@ -56,6 +56,19 @@
#define CMD_INSTRUCT_CODE_USER_HAS_BLACK_ME 111000 // 用户拉黑了我 #define CMD_INSTRUCT_CODE_USER_HAS_BLACK_ME 111000 // 用户拉黑了我
#define CMD_INSTRUCT_CODE_USER_HAS_CANCEL_BLACK_ME 111001 // 用户取消拉黑了我 #define CMD_INSTRUCT_CODE_USER_HAS_CANCEL_BLACK_ME 111001 // 用户取消拉黑了我
typedef NS_ENUM(NSInteger, FUSIMChatMessageType) {
FUSIMChatMessageTypeDefault = 0,
FUSIMChatMessageTypeText = 1,
FUSIMChatMessageTypeVisitCart = 2,
FUSIMChatMessageTypeGift = 3,
FUSIMChatMessageTypeVoiceChat = 4,
FUSIMChatMessageTypeVideoChat = 5,
FUSIMChatMessageTypeSystemTip = 6,
FUSIMChatMessageTypeLiveRoomShare = 8,
};
#define kmessageTypeToStr(type) [NSString stringWithFormat:@"%ld",type]
@interface FUSIMChatService ()<EMChatManagerDelegate> @interface FUSIMChatService ()<EMChatManagerDelegate>
/** /**
...@@ -279,37 +292,37 @@ ...@@ -279,37 +292,37 @@
EMTextMessageBody *textBody = (EMTextMessageBody *)msg.body; EMTextMessageBody *textBody = (EMTextMessageBody *)msg.body;
switch ([msg.ext[@"text_type"] integerValue]) { switch ([msg.ext[@"text_type"] integerValue]) {
case 1: //文字 case FUSIMChatMessageTypeText: //文字
{ {
skeletonizeMsg = textBody.text; skeletonizeMsg = textBody.text;
} }
break; break;
case 2: //名片 case FUSIMChatMessageTypeVisitCart: //名片
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"名片"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"名片"]];
} }
break; break;
case 3: //礼物 case FUSIMChatMessageTypeGift: //礼物
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"礼物"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"礼物"]];
} }
break; break;
case 4: // 声优聊天 case FUSIMChatMessageTypeVoiceChat: // 声优聊天
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"声优"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"声优"]];
} }
break; break;
case 5: // 视讯 case FUSIMChatMessageTypeVideoChat: // 视讯
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"视讯"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"视讯"]];
} }
break; break;
case 6: // 系统提示 case FUSIMChatMessageTypeSystemTip: // 系统提示
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"系统提示"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"系统提示"]];
} }
break; break;
case 8: // 视频分享 case FUSIMChatMessageTypeLiveRoomShare: // 视频分享
{ {
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"直播间分享"]]; skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"直播间分享"]];
} }
...@@ -1184,14 +1197,14 @@ ...@@ -1184,14 +1197,14 @@
// FUSLogInfo(@"收到的文字是 txt -- %@",textBody.text); // FUSLogInfo(@"收到的文字是 txt -- %@",textBody.text);
switch ([extraDict[@"text_type"] integerValue]) { switch ([extraDict[@"text_type"] integerValue]) {
case 1: //文字 case FUSIMChatMessageTypeText: //文字
{ {
msgModel.messageContentType = FUSMsgContentTypeText; msgModel.messageContentType = FUSMsgContentTypeText;
msgModel.textWords = textBody.text; msgModel.textWords = textBody.text;
} }
break; break;
case 3: //礼物 case FUSIMChatMessageTypeGift: //礼物
{ {
msgModel.messageContentType = FUSMsgContentTypeGift; msgModel.messageContentType = FUSMsgContentTypeGift;
msgModel.giftID = textBody.text; msgModel.giftID = textBody.text;
...@@ -1207,7 +1220,7 @@ ...@@ -1207,7 +1220,7 @@
} }
} }
break; break;
case 4: // 声优聊天 case FUSIMChatMessageTypeVoiceChat: // 声优聊天
{ {
msgModel.messageContentType = FUSMsgContentTypeVoiceConversation; msgModel.messageContentType = FUSMsgContentTypeVoiceConversation;
msgModel.conversationResult = textBody.text; msgModel.conversationResult = textBody.text;
...@@ -1222,7 +1235,7 @@ ...@@ -1222,7 +1235,7 @@
} }
} }
break; break;
case 5: // 视讯 case FUSIMChatMessageTypeVideoChat: // 视讯
{ {
msgModel.messageContentType = FUSMsgContentTypeVideoConversation; msgModel.messageContentType = FUSMsgContentTypeVideoConversation;
msgModel.conversationResult = textBody.text; msgModel.conversationResult = textBody.text;
...@@ -1237,14 +1250,14 @@ ...@@ -1237,14 +1250,14 @@
} }
} }
break; break;
case 6: //系统提示 case FUSIMChatMessageTypeSystemTip: //系统提示
{ {
msgModel.messageContentType = FUSMsgContentTypeSystemNotice; msgModel.messageContentType = FUSMsgContentTypeSystemNotice;
msgModel.systemNoticeType = (FUSSystemNoticeType)[extraDict[@"system_notice_type"] integerValue]; msgModel.systemNoticeType = (FUSSystemNoticeType)[extraDict[@"system_notice_type"] integerValue];
msgModel.systemNoticeWords = textBody.text; msgModel.systemNoticeWords = textBody.text;
} }
break; break;
case 8: // 进入直播间 case FUSIMChatMessageTypeLiveRoomShare: // 进入直播间
{ {
msgModel.messageContentType = FUSMsgContentTypeLiveRoom; msgModel.messageContentType = FUSMsgContentTypeLiveRoom;
NSDictionary *infoDict = extraDict[@"cmd_msg_live"]; NSDictionary *infoDict = extraDict[@"cmd_msg_live"];
...@@ -1481,7 +1494,8 @@ ...@@ -1481,7 +1494,8 @@
msg.direction = EMMessageDirectionSend; msg.direction = EMMessageDirectionSend;
msg.isReadAcked = YES; msg.isReadAcked = YES;
}else{ }else{
msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":callType?@"5":@"4",@"isUnacceptedClick":isUnaccepted?@"0":@"1"}];
msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":callType?kmessageTypeToStr(FUSIMChatMessageTypeVideoChat):kmessageTypeToStr(FUSIMChatMessageTypeVoiceChat),@"isUnacceptedClick":isUnaccepted?@"0":@"1"}];
msg.direction = EMMessageDirectionReceive; msg.direction = EMMessageDirectionReceive;
if (isUnaccepted == YES) { if (isUnaccepted == YES) {
msg.isRead = NO; msg.isRead = NO;
...@@ -1612,11 +1626,11 @@ ...@@ -1612,11 +1626,11 @@
// 有头像类型 // 有头像类型
if (sysType == FUSSystemNoticeTypeServiceWelcomeWords) { if (sysType == FUSSystemNoticeTypeServiceWelcomeWords) {
msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":@"1",@"cmd_common_user_nickname":name,@"cmd_common_user_iconUrl":faceUrl}]; msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":kmessageTypeToStr(FUSIMChatMessageTypeText),@"cmd_common_user_nickname":name,@"cmd_common_user_iconUrl":faceUrl}];
msg.direction = EMMessageDirectionReceive; msg.direction = EMMessageDirectionReceive;
msg.isRead = NO; msg.isRead = NO;
}else{ // 无头像类型 }else{ // 无头像类型
msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":@"6",@"system_notice_type":[NSString stringWithFormat:@"%ld",sysType],@"cmd_common_user_nickname":name,@"cmd_common_user_iconUrl":faceUrl}]; msg = [[EMMessage alloc]initWithConversationID:talkID from:talkID to:[FUSIMUserService shareInstance].myUserID body:body ext:@{@"text_type":kmessageTypeToStr(FUSIMChatMessageTypeSystemTip),@"system_notice_type":[NSString stringWithFormat:@"%ld",sysType],@"cmd_common_user_nickname":name,@"cmd_common_user_iconUrl":faceUrl}];
// 这里一定要写EMMessageDirectionReceive 不然这条消息不会被计算未读个数 // 这里一定要写EMMessageDirectionReceive 不然这条消息不会被计算未读个数
msg.direction = EMMessageDirectionReceive; msg.direction = EMMessageDirectionReceive;
msg.isRead = NO; msg.isRead = NO;
...@@ -1904,7 +1918,7 @@ ...@@ -1904,7 +1918,7 @@
{ {
EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:text]; EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:text];
NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary]; NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary];
[cmdDict setObject:@"1" forKey:@"text_type"]; [cmdDict setObject:kmessageTypeToStr(FUSIMChatMessageTypeText) forKey:@"text_type"];
[self fus_sendPrivateMsgWithBody:body [self fus_sendPrivateMsgWithBody:body
toOtherUserWithUserID:userID toOtherUserWithUserID:userID
...@@ -2094,7 +2108,7 @@ ...@@ -2094,7 +2108,7 @@
if (![NSString isNull:faceStr]) { if (![NSString isNull:faceStr]) {
[cmdDict setObject:faceStr forKey:@"cmd_common_user_iconUrl"]; [cmdDict setObject:faceStr forKey:@"cmd_common_user_iconUrl"];
} }
[cmdDict setObject:@"3" forKey:@"text_type"]; [cmdDict setObject:kmessageTypeToStr(FUSIMChatMessageTypeGift) forKey:@"text_type"];
if ([FUSRouter.userRouter fus_selectIsInBlackListWithUid:userID] == YES){ // 判断是不是拉黑了 if ([FUSRouter.userRouter fus_selectIsInBlackListWithUid:userID] == YES){ // 判断是不是拉黑了
[self fus_createSystemNoticeMessageToDBWithSysType:FUSSystemNoticeTypeBlackList noticeWords:nil talkID:userID]; [self fus_createSystemNoticeMessageToDBWithSysType:FUSSystemNoticeTypeBlackList noticeWords:nil talkID:userID];
...@@ -2466,7 +2480,7 @@ ...@@ -2466,7 +2480,7 @@
failure:(void(^)(NSInteger refreshIndex,NSString *msgID,NSString *errorMsg))failure { failure:(void(^)(NSInteger refreshIndex,NSString *msgID,NSString *errorMsg))failure {
NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary]; NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary];
[cmdDict setObject:@"8" forKey:@"text_type"]; [cmdDict setObject:kmessageTypeToStr(FUSIMChatMessageTypeLiveRoomShare) forKey:@"text_type"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary]; NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
infoDict[@"roomId"] = roomId; infoDict[@"roomId"] = roomId;
...@@ -3576,6 +3590,11 @@ ...@@ -3576,6 +3590,11 @@
//本地推送 //本地推送
[self fus_sendLocalNotificationWithIsConversation:NO uid:msg.from nick:msg.ext[@"cmd_common_user_nickname"] pushContent:[self fus_analysisLastMsgSkeletonizeWithMsg:msg]]; [self fus_sendLocalNotificationWithIsConversation:NO uid:msg.from nick:msg.ext[@"cmd_common_user_nickname"] pushContent:[self fus_analysisLastMsgSkeletonizeWithMsg:msg]];
FUSChatDetailFrameModel *msgModel = newMessageList.firstObject;
if (FUSRouter.liveRouter.isAnchor && msgModel.msgModel.messageContentType == FUSMsgContentTypeGift) {
[[NSNotificationCenter defaultCenter] postNotificationName:FUSChatNotificationKeys.fus_FUS_NOTIFICATION_DidReceiveGiftMessage object:nil];
}
if (_chatDelegate) { // 界面内 if (_chatDelegate) { // 界面内
// 界面外别的好友发来的消息不处理 // 界面外别的好友发来的消息不处理
......
...@@ -11,6 +11,9 @@ ...@@ -11,6 +11,9 @@
#import <sys/sysctl.h> #import <sys/sysctl.h>
#import <Masonry/Masonry.h>
#import <FUSFoundation/FUSFoundation.h>
#define ROW_NUMBER 4 #define ROW_NUMBER 4
#define LINE_NUMBER 2 #define LINE_NUMBER 2
...@@ -50,6 +53,9 @@ ...@@ -50,6 +53,9 @@
@property (nonatomic, strong) FUSChatGiftDataModel *currentSelectedGiftModel;// 用户选中的 Model @property (nonatomic, strong) FUSChatGiftDataModel *currentSelectedGiftModel;// 用户选中的 Model
@property (nonatomic, assign) FUSIMGiftViewCell *lastCell; @property (nonatomic, assign) FUSIMGiftViewCell *lastCell;
@property (nonatomic, strong) UIView *giftMessageTipView;
@end @end
@implementation FUSIMGiftView @implementation FUSIMGiftView
...@@ -252,12 +258,74 @@ ...@@ -252,12 +258,74 @@
// 取出 model // 取出 model
self.currentSelectedGiftModel = giftModel; self.currentSelectedGiftModel = giftModel;
self.giftDesLabel.attributedText = [self handleGiftDescription:self.currentSelectedGiftModel]; self.giftDesLabel.attributedText = [self handleGiftDescription:self.currentSelectedGiftModel];
[self fus_showGiftMessageTipView:giftModel.name];
[self.giftCollectionView reloadData]; [self.giftCollectionView reloadData];
return; return;
} }
} }
} }
- (void)fus_showGiftMessageTipView:(NSString *)giftName {
[self fus_hideGiftMessageTipView];
self.giftMessageTipView = [[UIView alloc] init];
[self addSubview:self.giftMessageTipView];
__weak typeof(self) weakSelf = self;
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithActionBlock:^(id _Nonnull sender) {
[weakSelf fus_hideGiftMessageTipView];
}];
[self.giftMessageTipView addGestureRecognizer:tapGesture];
UIView *tipView = [[UIView alloc] init];
[self.giftMessageTipView addSubview:tipView];
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[FUSChatCenterBunble imageNamed:@"chat_password_gift_message_tip_bg"]];
bgImageView.contentMode = UIViewContentModeScaleToFill;
[tipView addSubview:bgImageView];
UILabel *tipLabel = [[UILabel alloc] init];
tipLabel.numberOfLines = 0;
NSString *tipStr = [NSString stringWithFormat:[NSString fus_versionLocalString:@"送“%@”礼物,更容易向主播索取密码哦~"], giftName];
NSRange hightlightRange = [tipStr rangeOfString:giftName];
NSMutableAttributedString *tipAttr = [[NSMutableAttributedString alloc] initWithString:tipStr attributes:@{NSForegroundColorAttributeName:[UIColor fus_textColorRich], NSFontAttributeName: [UIFont fus_themeBoldFont:12]}];
if (hightlightRange.location != kCFNotFound) {
[tipAttr addAttribute:NSForegroundColorAttributeName value:[UIColor fus_appMainColor] range:hightlightRange];
}
tipLabel.attributedText = tipAttr;
[tipView addSubview:tipLabel];
[self.giftMessageTipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
[tipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.giftMessageTipView);
make.centerY.equalTo(self.giftMessageTipView).mas_offset(-5);
}];
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(tipView);
make.width.mas_equalTo(164);
}];
[tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(21);
make.right.mas_equalTo(-21);
make.top.mas_equalTo(15);
make.bottom.mas_equalTo(-17);
}];
[tipView fus_startInfiniteShakeWithInterval:2];
}
- (void)fus_hideGiftMessageTipView {
[self.giftMessageTipView removeFromSuperview];
self.giftMessageTipView = nil;
}
#pragma mark - Collection Delegate #pragma mark - Collection Delegate
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView { - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
......
...@@ -1415,6 +1415,7 @@ ...@@ -1415,6 +1415,7 @@
BEF678172C6B156600A670FB /* live_userinfo_level_secrect.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */; }; BEF678172C6B156600A670FB /* live_userinfo_level_secrect.png in Resources */ = {isa = PBXBuildFile; fileRef = BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */; };
C50E4ED36D48026661F4283F /* Pods_FUSShowRoomModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B2CC1956F16144828BF43D /* Pods_FUSShowRoomModule.framework */; }; C50E4ED36D48026661F4283F /* Pods_FUSShowRoomModule.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B8B2CC1956F16144828BF43D /* Pods_FUSShowRoomModule.framework */; };
D210F35F2E0AB4F900C41733 /* live_password_room_anim.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */; }; D210F35F2E0AB4F900C41733 /* live_password_room_anim.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */; };
D2936DAE2E165E28005BB1F5 /* live_password_room_anim_en.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = D2936DAD2E165E28005BB1F5 /* live_password_room_anim_en.mp4 */; };
D2C6D57E2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */; }; D2C6D57E2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -2833,6 +2834,7 @@ ...@@ -2833,6 +2834,7 @@
BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_treasure_box_bg_img.png; sourceTree = "<group>"; }; BEF675EE2C6B156500A670FB /* live_treasure_box_bg_img.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_treasure_box_bg_img.png; sourceTree = "<group>"; };
BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_userinfo_level_secrect.png; sourceTree = "<group>"; }; BEF675EF2C6B156500A670FB /* live_userinfo_level_secrect.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = live_userinfo_level_secrect.png; sourceTree = "<group>"; };
D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_password_room_anim.mp4; sourceTree = "<group>"; }; D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_password_room_anim.mp4; sourceTree = "<group>"; };
D2936DAD2E165E28005BB1F5 /* live_password_room_anim_en.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = live_password_room_anim_en.mp4; sourceTree = "<group>"; };
D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSLiveStartSetPasswordView.swift; sourceTree = "<group>"; }; D2C6D57D2DFAB63200FB58E0 /* FUSLiveStartSetPasswordView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSLiveStartSetPasswordView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -5284,6 +5286,7 @@ ...@@ -5284,6 +5286,7 @@
BEF675A22C6B156500A670FB /* Anims */ = { BEF675A22C6B156500A670FB /* Anims */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
D2936DAD2E165E28005BB1F5 /* live_password_room_anim_en.mp4 */,
D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */, D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */,
00A66C322CCA21F500F366E9 /* PK_Cover_Animation */, 00A66C322CCA21F500F366E9 /* PK_Cover_Animation */,
BEF675EA2C6B156500A670FB /* welcomeEnterRoom */, BEF675EA2C6B156500A670FB /* welcomeEnterRoom */,
...@@ -6256,6 +6259,7 @@ ...@@ -6256,6 +6259,7 @@
BEF676C72C6B156600A670FB /* new_live_userlist_guardian_21@2x.png in Resources */, BEF676C72C6B156600A670FB /* new_live_userlist_guardian_21@2x.png in Resources */,
BEF676262C6B156500A670FB /* 1_live_activity_first_charge_bg_27.png in Resources */, BEF676262C6B156500A670FB /* 1_live_activity_first_charge_bg_27.png in Resources */,
BEF676D02C6B156600A670FB /* new_live_userlist_guardian_30@2x.png in Resources */, BEF676D02C6B156600A670FB /* new_live_userlist_guardian_30@2x.png in Resources */,
D2936DAE2E165E28005BB1F5 /* live_password_room_anim_en.mp4 in Resources */,
BEF677242C6B156600A670FB /* PK_Progress_Bar_Light_Spot_Animation_3@2x.png in Resources */, BEF677242C6B156600A670FB /* PK_Progress_Bar_Light_Spot_Animation_3@2x.png in Resources */,
BEF676572C6B156500A670FB /* common_broadcast_purple_type_bg_15@2x.png in Resources */, BEF676572C6B156500A670FB /* common_broadcast_purple_type_bg_15@2x.png in Resources */,
BEF677D12C6B156600A670FB /* DailyCheckInBigBg.png in Resources */, BEF677D12C6B156600A670FB /* DailyCheckInBigBg.png in Resources */,
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "live_receive_gift_message_tip_bg@2x.png",
"idiom" : "universal",
"resizing" : {
"cap-insets" : {
"left" : 45,
"right" : 46
},
"center" : {
"mode" : "tile",
"width" : 1
},
"mode" : "3-part-horizontal"
},
"scale" : "2x"
},
{
"filename" : "live_receive_gift_message_tip_bg@3x.png",
"idiom" : "universal",
"resizing" : {
"cap-insets" : {
"left" : 67,
"right" : 69
},
"center" : {
"mode" : "tile",
"width" : 1
},
"mode" : "3-part-horizontal"
},
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#import "FUSLiveBottomToolSubView.h" #import "FUSLiveBottomToolSubView.h"
#import <Masonry/Masonry.h>
// 红点角标 Tag // 红点角标 Tag
#define RED_POINT_BADGE_VIEW_TAG 10897 #define RED_POINT_BADGE_VIEW_TAG 10897
...@@ -85,6 +87,9 @@ ...@@ -85,6 +87,9 @@
@property (nonatomic, strong) NSMutableArray *allBtnTypes; @property (nonatomic, strong) NSMutableArray *allBtnTypes;
@property (nonatomic, strong) UIView *giftMessageTipView;
@end @end
@implementation FUSLiveBottomToolView @implementation FUSLiveBottomToolView
...@@ -580,6 +585,10 @@ ...@@ -580,6 +585,10 @@
} }
} }
if (sender.tag == FUSLiveBottomToolTypeTool) {
[self fus_hideGiftMessageTipView];
}
// FUSLiveFunctionLayerPKGame // FUSLiveFunctionLayerPKGame
FUSLiveFunctionLayer viewlayer = FUSLiveFunctionLayerManualPopView; FUSLiveFunctionLayer viewlayer = FUSLiveFunctionLayerManualPopView;
...@@ -622,6 +631,8 @@ ...@@ -622,6 +631,8 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveMessageUnreadNumberNotification:) name:FUSUserNotificationKeys.fus_Tabbar_Unread_Count object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveMessageUnreadNumberNotification:) name:FUSUserNotificationKeys.fus_Tabbar_Unread_Count object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_showGiftMessageTipView) name:FUSChatNotificationKeys.fus_FUS_NOTIFICATION_DidReceiveGiftMessage object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_refreshGameEntranceBtn:) name:FUSLiveNotificationKeys.fus_LIVE_GAME_ENTRANCE object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_refreshGameEntranceBtn:) name:FUSLiveNotificationKeys.fus_LIVE_GAME_ENTRANCE object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveMessageUnreadNumberNotification:) name:FUSLiveNotificationKeys.fus_LIVE_REFRESH_UNREAD_REDPOINT object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_recieveMessageUnreadNumberNotification:) name:FUSLiveNotificationKeys.fus_LIVE_REFRESH_UNREAD_REDPOINT object:nil];
...@@ -972,6 +983,65 @@ ...@@ -972,6 +983,65 @@
} }
- (void)fus_showGiftMessageTipView {
if (FUSLiveHelper.shareInstance.liveType != FUSLiveTypeAnchor
|| FUSLiveHelper.shareInstance.roomScopeType != FUSLiveRoomScopeTypePassword) {
return;
}
[self fus_hideGiftMessageTipView];
self.giftMessageTipView = [[UIView alloc] init];
[self addSubview:self.giftMessageTipView];
UIImageView *bgImageView = [[UIImageView alloc] initWithImage:[FUSShowRoomCenterBunble imageNamed:@"live_receive_gift_message_tip_bg"]];
bgImageView.contentMode = UIViewContentModeScaleToFill;
[self.giftMessageTipView addSubview:bgImageView];
UILabel *tipLabel = [[UILabel alloc] init];
NSString *hightlightStr = [NSString fus_versionLocalString:@"私信礼物"];
NSString *tipStr = [NSString stringWithFormat:[NSString fus_versionLocalString:@"收到%@"], hightlightStr];
NSRange hightlightRange = [tipStr rangeOfString:hightlightStr];
NSMutableAttributedString *tipAttr = [[NSMutableAttributedString alloc] initWithString:tipStr attributes:@{NSForegroundColorAttributeName:[UIColor fus_textColorRich], NSFontAttributeName: [UIFont fus_themeBoldFont:12]}];
if (hightlightRange.location != kCFNotFound) {
[tipAttr addAttribute:NSForegroundColorAttributeName value:[UIColor fus_appMainColor] range:hightlightRange];
}
tipLabel.attributedText = tipAttr;
[self.giftMessageTipView addSubview:tipLabel];
[tipLabel sizeToFit];
CGSize size = tipLabel.size;
[self.giftMessageTipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(10);
make.top.mas_equalTo(-40);
}];
[bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.giftMessageTipView);
make.height.mas_equalTo(46);
}];
[tipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(21);
make.right.mas_equalTo(-21);
make.top.mas_equalTo(15);
make.bottom.mas_equalTo(-17);
make.width.mas_equalTo(size.width);
make.height.mas_equalTo(size.height);
}];
[self.giftMessageTipView fus_startInfiniteShakeWithInterval:2];
}
- (void)fus_hideGiftMessageTipView {
[self.giftMessageTipView removeFromSuperview];
self.giftMessageTipView = nil;
}
#pragma mark - FUSLiveBottomToolSubViewDelegate #pragma mark - FUSLiveBottomToolSubViewDelegate
- (void)fus_bottomSubView:(id)bottomSubView didClickSendWithMessage:(NSString *)message atSomebady:(NSString *)uid isBullet:(BOOL)isBullets barrageType:(FUSbarrageType)barrageType liveChatModel:(FUSLiveChatModel *)liveChatModel finishHandler:(void (^)(NSDictionary * _Nonnull, int))finishHandler{ - (void)fus_bottomSubView:(id)bottomSubView didClickSendWithMessage:(NSString *)message atSomebady:(NSString *)uid isBullet:(BOOL)isBullets barrageType:(FUSbarrageType)barrageType liveChatModel:(FUSLiveChatModel *)liveChatModel finishHandler:(void (^)(NSDictionary * _Nonnull, int))finishHandler{
if (_delegate && [_delegate respondsToSelector:@selector(fus_bottomToolView:didClickSendWithMessage:atSomebady:isBullets:barrageType:liveChatModel:finishHandler:)]) { if (_delegate && [_delegate respondsToSelector:@selector(fus_bottomToolView:didClickSendWithMessage:atSomebady:isBullets:barrageType:liveChatModel:finishHandler:)]) {
......
...@@ -5880,6 +5880,9 @@ BDAlphaPlayerMetalViewDelegate ...@@ -5880,6 +5880,9 @@ BDAlphaPlayerMetalViewDelegate
[FUSLiveHelper.shareInstance.currentLiveVCView addSubview:self.passwordAnimPlayView]; [FUSLiveHelper.shareInstance.currentLiveVCView addSubview:self.passwordAnimPlayView];
NSString *animPath = [[FUSShowRoomCenterBunble bundle] pathForResource:@"live_password_room_anim" ofType:@"mp4"]; NSString *animPath = [[FUSShowRoomCenterBunble bundle] pathForResource:@"live_password_room_anim" ofType:@"mp4"];
if (FUSLocalizationHelper.fus_currentLanguage.languageType != FUSLanguageTypeChinese && FUSLocalizationHelper.fus_currentLanguage.languageType != FUSLanguageTypeChineseTranditional) {
animPath = [[FUSShowRoomCenterBunble bundle] pathForResource:@"live_password_room_anim_en" ofType:@"mp4"];
}
BDAlphaPlayerMetalConfiguration *configuration = [BDAlphaPlayerMetalConfiguration defaultConfiguration]; BDAlphaPlayerMetalConfiguration *configuration = [BDAlphaPlayerMetalConfiguration defaultConfiguration];
configuration.directory = animPath; configuration.directory = animPath;
configuration.renderSuperViewFrame = UIView.fus_screenFrame; configuration.renderSuperViewFrame = UIView.fus_screenFrame;
......
...@@ -69,7 +69,7 @@ import FUSCommon ...@@ -69,7 +69,7 @@ import FUSCommon
} }
contentView.frame = CGRectMake(0, UIView.fus_screenH(), UIView.fus_screenW(), contentViewHeight) contentView.frame = CGRectMake(0, UIView.fus_screenH(), UIView.fus_screenW(), contentViewHeight)
contentView.backgroundColor = .fus_appBG().withAlphaComponent(0.94) contentView.backgroundColor = .fus_appBG()
contentView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), withRadii: CGSizeMake(14, 14)) contentView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), withRadii: CGSizeMake(14, 14))
tapBgView.addSubview(contentView) tapBgView.addSubview(contentView)
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
#import "UIView+Corner.h" #import "UIView+Corner.h"
#import "UIView+Extend.h" #import "UIView+Extend.h"
#import "UIView+FrameExtend.h" #import "UIView+FrameExtend.h"
#import "UIView+FUSShakeAnim.h"
#import "UIView+Screen.h" #import "UIView+Screen.h"
#import "UIView+Shape.h" #import "UIView+Shape.h"
#import "UIView+SLAutolayout.h" #import "UIView+SLAutolayout.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment