Commit c16f3ee7 by ludi

Merge branch 'feature/私享房需求' of http://git.yabolive.net:88/pidan/FuSiLive into feature/私享房需求

# Conflicts:
#	DevelopmentPods/FUSFoundation/FUSFoundation/Assets/LocalizationString/Fusi_Chinese_Traditional.strings
parents 41746f20 cac2021d
Showing with 471 additions and 37 deletions
......@@ -224,4 +224,9 @@
}
}
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event {
return NO;
}
@end
......@@ -112,6 +112,9 @@ NS_ASSUME_NONNULL_BEGIN
// 获取用户数据交易提醒
+ (NSString *)fus_FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE;
// 接收到礼物消息
+ (NSString *)fus_FUS_NOTIFICATION_DidReceiveGiftMessage;
@end
......
......@@ -179,6 +179,10 @@
return @"FUS_NOTIFICATION_USER_TRADE_REMIND_CHANGE";
}
// 接收到礼物消息
+ (NSString *)fus_FUS_NOTIFICATION_DidReceiveGiftMessage {
return @"fus_FUS_NOTIFICATION_DidReceiveGiftMessage";
}
@end
......
......@@ -3172,3 +3172,10 @@
"请联系您的邀请人获得邀请QRCode" = "请联系您的邀请人获得邀请QRCode";
"送“%@”礼物,更容易向主播索取密码哦~" = "送“%@”礼物,更容易向主播索取密码哦~";
"已关闭窗帘,玩家输入密码打开" = "已关闭窗帘,玩家输入密码打开";
"私信礼物" = "私信礼物";
"收到%@" = "收到%@";
......@@ -3172,6 +3172,12 @@
"请联系您的邀请人获得邀请QRCode" = "請聯繫您的邀請人獲得邀請QRCode";
"#$1#天以上未登入#$2#的玩家,将会自动断开使者关系" = "#$1#天以上未登入#$2#的玩家,將會自動斷開使者關係";
"送“%@”礼物,更容易向主播索取密码哦~" = "送“%@”禮物,更容易向主播索取密碼哦~";
"已关闭窗帘,玩家输入密码打开" = "已關閉窗簾,玩家輸入密碼打開";
"#$1#天以上未登入#$2#的玩家,将会自动断开使者关系" = "#$1#天以上未登入#$2#的玩家,將會自動斷開使者關係";
"私信礼物" = "私信禮物";
"收到%@" = "收到%@";
......@@ -205,3 +205,4 @@
#import "FUSConfig.h"
#import "UIColor+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 @@
/* End PBXFileReference section */
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
00E501FF2E0543A800579DB0 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = {
00E501FF2E0543A800579DB0 /* Exceptions for "NotificationService" folder in "NotificationService" target */ = {
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
membershipExceptions = (
"NotificationService-Info.plist",
......@@ -112,7 +112,18 @@
/* End PBXFileSystemSynchronizedBuildFileExceptionSet 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 */
/* Begin PBXFrameworksBuildPhase section */
......@@ -415,14 +426,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-frameworks.sh\"\n";
......@@ -436,14 +443,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources-${CONFIGURATION}-output-files.xcfilelist",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-FuSiLive/Pods-FuSiLive-resources.sh\"\n";
......
......@@ -12,7 +12,7 @@
<key>NotificationService.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>85</integer>
<integer>87</integer>
</dict>
</dict>
</dict>
......

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
......@@ -12,7 +12,7 @@
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>88</integer>
<integer>85</integer>
</dict>
</dict>
</dict>
......
{
"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 @@
#import "FUSChatCenterModule/FUSChatCenterModule-Swift.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h>
#import <FUSBDAlphaPlayer/BDAlphaPlayer.h>
#define CELL_IDENTIFIER @"FUSIMChatDetailCell"
#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 @@
@property (nonatomic, copy) NSString *jumpToGid;
@property (nonatomic, strong) BDAlphaPlayerMetalView *giftPlayView;
@end
@implementation FUSChatDetailViewController
......@@ -503,6 +506,10 @@
} else {
self.navigationController.navigationBar.barTintColor = UIColor.fus_navBarColor;
}
[self.giftPlayView stop];
[self.giftPlayView removeFromSuperview];
self.giftPlayView = nil;
}
- (void)dealloc
......@@ -2021,7 +2028,45 @@
break;
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;
case FUSMsgContentTypeVideo: //视频
......@@ -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(语音播放结束回调)
- (void)fus_audioChatCellEndedPlayingWithMessageModel:(FUSChatDetailFrameModel *)model
{
......
......@@ -56,6 +56,19 @@
#define CMD_INSTRUCT_CODE_USER_HAS_BLACK_ME 111000 // 用户拉黑了我
#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>
/**
......@@ -279,37 +292,37 @@
EMTextMessageBody *textBody = (EMTextMessageBody *)msg.body;
switch ([msg.ext[@"text_type"] integerValue]) {
case 1: //文字
case FUSIMChatMessageTypeText: //文字
{
skeletonizeMsg = textBody.text;
}
break;
case 2: //名片
case FUSIMChatMessageTypeVisitCart: //名片
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"名片"]];
}
break;
case 3: //礼物
case FUSIMChatMessageTypeGift: //礼物
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"礼物"]];
}
break;
case 4: // 声优聊天
case FUSIMChatMessageTypeVoiceChat: // 声优聊天
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"声优"]];
}
break;
case 5: // 视讯
case FUSIMChatMessageTypeVideoChat: // 视讯
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"视讯"]];
}
break;
case 6: // 系统提示
case FUSIMChatMessageTypeSystemTip: // 系统提示
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"系统提示"]];
}
break;
case 8: // 视频分享
case FUSIMChatMessageTypeLiveRoomShare: // 视频分享
{
skeletonizeMsg = [NSString stringWithFormat:@"[%@]",[NSString fus_localString:@"直播间分享"]];
}
......@@ -1184,14 +1197,14 @@
// FUSLogInfo(@"收到的文字是 txt -- %@",textBody.text);
switch ([extraDict[@"text_type"] integerValue]) {
case 1: //文字
case FUSIMChatMessageTypeText: //文字
{
msgModel.messageContentType = FUSMsgContentTypeText;
msgModel.textWords = textBody.text;
}
break;
case 3: //礼物
case FUSIMChatMessageTypeGift: //礼物
{
msgModel.messageContentType = FUSMsgContentTypeGift;
msgModel.giftID = textBody.text;
......@@ -1207,7 +1220,7 @@
}
}
break;
case 4: // 声优聊天
case FUSIMChatMessageTypeVoiceChat: // 声优聊天
{
msgModel.messageContentType = FUSMsgContentTypeVoiceConversation;
msgModel.conversationResult = textBody.text;
......@@ -1222,7 +1235,7 @@
}
}
break;
case 5: // 视讯
case FUSIMChatMessageTypeVideoChat: // 视讯
{
msgModel.messageContentType = FUSMsgContentTypeVideoConversation;
msgModel.conversationResult = textBody.text;
......@@ -1237,14 +1250,14 @@
}
}
break;
case 6: //系统提示
case FUSIMChatMessageTypeSystemTip: //系统提示
{
msgModel.messageContentType = FUSMsgContentTypeSystemNotice;
msgModel.systemNoticeType = (FUSSystemNoticeType)[extraDict[@"system_notice_type"] integerValue];
msgModel.systemNoticeWords = textBody.text;
}
break;
case 8: // 进入直播间
case FUSIMChatMessageTypeLiveRoomShare: // 进入直播间
{
msgModel.messageContentType = FUSMsgContentTypeLiveRoom;
NSDictionary *infoDict = extraDict[@"cmd_msg_live"];
......@@ -1481,7 +1494,8 @@
msg.direction = EMMessageDirectionSend;
msg.isReadAcked = YES;
}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;
if (isUnaccepted == YES) {
msg.isRead = NO;
......@@ -1612,11 +1626,11 @@
// 有头像类型
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.isRead = NO;
}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 不然这条消息不会被计算未读个数
msg.direction = EMMessageDirectionReceive;
msg.isRead = NO;
......@@ -1904,7 +1918,7 @@
{
EMTextMessageBody *body = [[EMTextMessageBody alloc] initWithText:text];
NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary];
[cmdDict setObject:@"1" forKey:@"text_type"];
[cmdDict setObject:kmessageTypeToStr(FUSIMChatMessageTypeText) forKey:@"text_type"];
[self fus_sendPrivateMsgWithBody:body
toOtherUserWithUserID:userID
......@@ -2094,7 +2108,7 @@
if (![NSString isNull:faceStr]) {
[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){ // 判断是不是拉黑了
[self fus_createSystemNoticeMessageToDBWithSysType:FUSSystemNoticeTypeBlackList noticeWords:nil talkID:userID];
......@@ -2466,7 +2480,7 @@
failure:(void(^)(NSInteger refreshIndex,NSString *msgID,NSString *errorMsg))failure {
NSMutableDictionary *cmdDict = [NSMutableDictionary dictionary];
[cmdDict setObject:@"8" forKey:@"text_type"];
[cmdDict setObject:kmessageTypeToStr(FUSIMChatMessageTypeLiveRoomShare) forKey:@"text_type"];
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
infoDict[@"roomId"] = roomId;
......@@ -3576,6 +3590,11 @@
//本地推送
[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) { // 界面内
// 界面外别的好友发来的消息不处理
......
......@@ -11,6 +11,9 @@
#import <sys/sysctl.h>
#import <Masonry/Masonry.h>
#import <FUSFoundation/FUSFoundation.h>
#define ROW_NUMBER 4
#define LINE_NUMBER 2
......@@ -50,6 +53,9 @@
@property (nonatomic, strong) FUSChatGiftDataModel *currentSelectedGiftModel;// 用户选中的 Model
@property (nonatomic, assign) FUSIMGiftViewCell *lastCell;
@property (nonatomic, strong) UIView *giftMessageTipView;
@end
@implementation FUSIMGiftView
......@@ -252,12 +258,74 @@
// 取出 model
self.currentSelectedGiftModel = giftModel;
self.giftDesLabel.attributedText = [self handleGiftDescription:self.currentSelectedGiftModel];
[self fus_showGiftMessageTipView:giftModel.name];
[self.giftCollectionView reloadData];
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_localString:@"送“%@”礼物,更容易向主播索取密码哦~"], 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
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
......
......@@ -1415,6 +1415,7 @@
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 */; };
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 */; };
/* End PBXBuildFile section */
......@@ -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>"; };
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>"; };
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>"; };
/* End PBXFileReference section */
......@@ -5284,6 +5286,7 @@
BEF675A22C6B156500A670FB /* Anims */ = {
isa = PBXGroup;
children = (
D2936DAD2E165E28005BB1F5 /* live_password_room_anim_en.mp4 */,
D210F35E2E0AB4F900C41733 /* live_password_room_anim.mp4 */,
00A66C322CCA21F500F366E9 /* PK_Cover_Animation */,
BEF675EA2C6B156500A670FB /* welcomeEnterRoom */,
......@@ -6256,6 +6259,7 @@
BEF676C72C6B156600A670FB /* new_live_userlist_guardian_21@2x.png in Resources */,
BEF676262C6B156500A670FB /* 1_live_activity_first_charge_bg_27.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 */,
BEF676572C6B156500A670FB /* common_broadcast_purple_type_bg_15@2x.png in Resources */,
BEF677D12C6B156600A670FB /* DailyCheckInBigBg.png in Resources */,
......
......@@ -7,12 +7,12 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>87</integer>
<integer>89</integer>
</dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>86</integer>
<integer>88</integer>
</dict>
</dict>
</dict>
......
{
"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 @@
#import "FUSLiveBottomToolSubView.h"
#import <Masonry/Masonry.h>
// 红点角标 Tag
#define RED_POINT_BADGE_VIEW_TAG 10897
......@@ -85,6 +87,9 @@
@property (nonatomic, strong) NSMutableArray *allBtnTypes;
@property (nonatomic, strong) UIView *giftMessageTipView;
@end
@implementation FUSLiveBottomToolView
......@@ -580,6 +585,10 @@
}
}
if (sender.tag == FUSLiveBottomToolTypeTool) {
[self fus_hideGiftMessageTipView];
}
// FUSLiveFunctionLayerPKGame
FUSLiveFunctionLayer viewlayer = FUSLiveFunctionLayerManualPopView;
......@@ -621,6 +630,8 @@
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onClickGiftBtn) name:FUSLiveNotificationKeys.fus_FUS_LIVE_CLICK_GIFT 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];
......@@ -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_localString:@"私信礼物"];
NSString *tipStr = [NSString stringWithFormat:[NSString fus_localString:@"收到%@"], 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
- (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:)]) {
......
......@@ -5880,6 +5880,9 @@ BDAlphaPlayerMetalViewDelegate
[FUSLiveHelper.shareInstance.currentLiveVCView addSubview:self.passwordAnimPlayView];
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];
configuration.directory = animPath;
configuration.renderSuperViewFrame = UIView.fus_screenFrame;
......
......@@ -69,7 +69,7 @@ import FUSCommon
}
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))
tapBgView.addSubview(contentView)
......
......@@ -7,7 +7,7 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>89</integer>
<integer>86</integer>
</dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -80,6 +80,7 @@
#import "UIView+Corner.h"
#import "UIView+Extend.h"
#import "UIView+FrameExtend.h"
#import "UIView+FUSShakeAnim.h"
#import "UIView+Screen.h"
#import "UIView+Shape.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