Commit 2f84822d by ludi

完成私房通话,所有有可能废弃的页面已经标记,有可能会有遗漏的,后续再看看

parent 1d7ba804
Showing with 506 additions and 245 deletions
......@@ -47,6 +47,9 @@
// 先获取系统为我们计算好的rect,这样大小图片在左右时我们就不要自己去计算,我门要改变的,仅仅是origin
CGRect imageRect = [super imageRectForContentRect:contentRect];
CGRect titleRect = [super titleRectForContentRect:contentRect];
if (@available(iOS 15.0, *)){
return titleRect;
}
if (!self.currentTitle) { // 如果没有文字,则图片占据整个button,空格算一个文字
return imageRect;
}
......@@ -74,6 +77,9 @@
- (CGRect)titleRectForContentRect:(CGRect)contentRect {
CGRect titleRect = [super titleRectForContentRect:contentRect];
CGRect imageRect = [super imageRectForContentRect:contentRect];
if (@available(iOS 15.0, *)){
return titleRect;
}
if (!self.currentImage) { // 如果没有图片
return titleRect;
}
......@@ -103,6 +109,10 @@
// 这个super很重要,它能保证下面使用的self.frame的值是系统计算好的结果
[super sizeToFit];
if (@available(iOS 15.0, *)){
return;
}
CGRect myFrame = self.frame;
switch (self.imagePosition) {
case SPButtonImagePositionLeft:
......@@ -124,6 +134,31 @@
self.frame = myFrame;
}
-(void)fus_config15{
NSDirectionalRectEdge imagePlacement = NSDirectionalRectEdgeLeading;
switch (self.imagePosition) {
case SPButtonImagePositionLeft:
imagePlacement = NSDirectionalRectEdgeLeading;
break;
case SPButtonImagePositionRight:
imagePlacement = NSDirectionalRectEdgeTrailing;
break;
case SPButtonImagePositionTop:
imagePlacement = NSDirectionalRectEdgeTop;
break;
case SPButtonImagePositionBottom:
imagePlacement = NSDirectionalRectEdgeBottom;
break;
default:
break;
}
UIButtonConfiguration *configuration = [UIButtonConfiguration plainButtonConfiguration];
configuration.imagePlacement = imagePlacement;
configuration.imagePadding = self.imageTitleSpace;
configuration.contentInsets = NSDirectionalEdgeInsetsMake(0, 0, 0, 0);
self.configuration = configuration;
}
#pragma - private
// ----------------------------------------------------- left -----------------------------------------------------
......@@ -577,11 +612,17 @@
- (void)setImagePosition:(SPButtonImagePosition)imagePosition {
_imagePosition = imagePosition;
[self setNeedsLayout];
if (@available(iOS 15.0, *)){
[self fus_config15];
}
}
- (void)setImageTitleSpace:(CGFloat)imageTitleSpace {
_imageTitleSpace = imageTitleSpace;
[self setNeedsLayout];
if (@available(iOS 15.0, *)){
[self fus_config15];
}
}
- (void)setContentHorizontalAlignment:(UIControlContentHorizontalAlignment)contentHorizontalAlignment {
......
......@@ -72,12 +72,12 @@
/// App Version
- (NSString *)appVersion {
return @"7591";
return @"7600";
}
/// App Dot Version
- (NSString *)appDotVersion {
return @"7.5.9.1";
return @"7.6.0.0";
}
/// App Id
......
......@@ -146,6 +146,9 @@ public extension [String: Any] {
if let rltValue = self[key] as? Int {
return rltValue
}
else if let rltValue = self[key] as? String {
return Int(rltValue) ?? 0
}
return 0
}
......@@ -157,3 +160,34 @@ public extension [String: Any] {
}
}
public extension [AnyHashable: Any] {
func fus_intValue(key: String) -> Int {
if let rltValue = self[key] as? Int {
return rltValue
}
else if let rltValue = self[key] as? String {
return Int(rltValue) ?? 0
}
return 0
}
func fus_stringValue(key: String) -> String {
if let rltValue = self[key] as? String {
return rltValue
}
return ""
}
func fus_floatValue(key: String) -> Float {
if let rltValue = self[key] as? Float {
return rltValue
}
else if let rltValue = self[key] as? String {
return Float(rltValue) ?? 0
}
return 0
}
}
......@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
008B375C2D101C6A00A859A9 /* FUSTopImageButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 008B375B2D101C6A00A859A9 /* FUSTopImageButton.swift */; };
008D23EE2CF87FFB0095A8D0 /* FUSChatCallHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 008D23ED2CF87FFB0095A8D0 /* FUSChatCallHelper.swift */; };
008DF8C72CFD8E1F009F6495 /* FUSChatCallView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 008DF8C62CFD8E1F009F6495 /* FUSChatCallView.swift */; };
008DF8C92CFD94C8009F6495 /* FUSCallDiamondShortageAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 008DF8C82CFD94C8009F6495 /* FUSCallDiamondShortageAlertView.swift */; };
......@@ -557,6 +558,7 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
008B375B2D101C6A00A859A9 /* FUSTopImageButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSTopImageButton.swift; sourceTree = "<group>"; };
008D23ED2CF87FFB0095A8D0 /* FUSChatCallHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSChatCallHelper.swift; sourceTree = "<group>"; };
008DF8C62CFD8E1F009F6495 /* FUSChatCallView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSChatCallView.swift; sourceTree = "<group>"; };
008DF8C82CFD94C8009F6495 /* FUSCallDiamondShortageAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FUSCallDiamondShortageAlertView.swift; sourceTree = "<group>"; };
......@@ -1166,6 +1168,7 @@
00C5A4DE2D08476F00D44B37 /* FUSCallDiamondAgainPayAlertView.swift */,
00C2E5D92D0981590024B0A6 /* FUSCallFreeTimeIsUpAlertView.swift */,
00A1773F2D0A8A300015BE63 /* FUSCallOneToOnePanelView.swift */,
008B375B2D101C6A00A859A9 /* FUSTopImageButton.swift */,
);
path = CallView;
sourceTree = "<group>";
......@@ -2818,6 +2821,7 @@
BED3D1F02C58D9FE0028E28F /* FUSIntimateFriendCell.m in Sources */,
BE189B3E2C732D570008418B /* FSRFriendsOfficialViewController.m in Sources */,
BED3D22C2C58D9FF0028E28F /* FUSChatDetailViewController.m in Sources */,
008B375C2D101C6A00A859A9 /* FUSTopImageButton.swift in Sources */,
BED3D1A92C58D9FD0028E28F /* FUSSingleChatDBOperate.m in Sources */,
BE189B222C732D570008418B /* FSRDetailVideoVoiceModel.m in Sources */,
BED65C182C5DE65900668116 /* FUSChatCenterBunble.m in Sources */,
......
......@@ -7,12 +7,12 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>72</integer>
<integer>74</integer>
</dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>73</integer>
<integer>72</integer>
</dict>
</dict>
</dict>
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "callCenter_FreeTime_Countdown_title_Img@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "callCenter_FreeTime_Countdown_title_Img@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
......@@ -1656,7 +1656,7 @@
[FUSTalkingData fus_trackEvent:FUSChatEventTrackParams.fus_EVENT_CHATPAGE_MORE_CAMERA];
[self fus_endEditState];
if ([FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone) {
if ([FUSChatCallHelper shared].isInChatCalling) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"正在通話中,不能拍攝哦"]];
return;
}
......@@ -1700,23 +1700,28 @@
}
// 判断对方的视讯价格
[[FUSIMChatService shareInstance] fus_checkAndStartConversationWithCallType:callType
startType:FUSConversationStartTypeChatDetailVc
userID:_talkID
nick:_talkName
icon:_talkIcon
hasVerified:self.chatModel.friendIsAuth
chatWith:chatWith
diamondIsNoEnough:^{
// [[FUSIMChatService shareInstance] fus_checkAndStartConversationWithCallType:callType
// startType:FUSConversationStartTypeChatDetailVc
// userID:_talkID
// nick:_talkName
// icon:_talkIcon
// hasVerified:self.chatModel.friendIsAuth
// chatWith:chatWith
// diamondIsNoEnough:^{
//
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"宝石不足"]];
// [FUSRechargeViewController fus_showRechargeViewControllerForRootVC:self rechargePageFrom:FUSRechargePageFromGEMsLack];
// } jumpToChatPage:^(NSInteger editState) {
// if (editState == 0) {
// [self fus_beginEditState];
// } else if (editState == 1) {
// [self fus_showSendGiftState];
// }
// }];
[[FUSChatCallHelper shared] fus_makeCallWithType:callType == FUSConversationCallTypeVideo ? FUSAgoraSessionTypeVideo : FUSAgoraSessionTypeAudio from:FUSConversationStartTypeChatDetailVc fid:_talkID success:^{
} failure:^(NSString * _Nonnull msg, NSInteger code) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"宝石不足"]];
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:self rechargePageFrom:FUSRechargePageFromGEMsLack];
} jumpToChatPage:^(NSInteger editState) {
if (editState == 0) {
[self fus_beginEditState];
} else if (editState == 1) {
[self fus_showSendGiftState];
}
}];
}
......@@ -2002,7 +2007,7 @@
break;
case FUSMsgContentTypeVideo: //视频
{
if ([FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone) {
if ([FUSChatCallHelper shared].isInChatCalling) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"正在通话中,无法播放视频"]];
}else if (FUSConfig.sharedInstanced.liveConfigs.isAudience) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"正在房間中,不能播放視頻哦"]];
......@@ -2041,7 +2046,7 @@
case FUSSystemNoticeTypeReceivePrivateVoiceLive: // 设置声优聊天
case FUSSystemNoticeTypeReceivePrivateVideoLive: // 设置视讯
{
if ([FUSIMChatService shareInstance].conversationIsCaller == NO&&[FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone) {
if ([FUSChatCallHelper shared].isInChatCalling) {
NSString *message = message = [NSString fus_localString:@"您正在通话视讯,结束后再来设置哦~"];
[FUSDialogView fus_showDialog:message];
return;
......
......@@ -137,7 +137,7 @@ class FUSSwiftAgoraSession: NSObject {
agoraEngine?.enableAudio()
agoraEngine?.setExternalVideoSource(true, useTexture: true, sourceType: .videoFrame)
captureHelper = FUSStreamCaptureHelper()
captureHelper = FUSStreamCaptureHelper.fus_captureHepler()
captureHelper?.fus_pauseCapture()
self.audioEnable = true
......
......@@ -220,6 +220,9 @@ enum FUSIMMessageCMD: Int {
// return params
// }
func fus_valueString() -> String {
return "\(self.rawValue)"
}
}
extension AnyHashable {
......
......@@ -17,6 +17,8 @@
#import "FUSIMChatVideoFillScreenPlayerView.h"
#import "FUSIMChatCellCoverButton.h"
#import <FUSChatCenterModule/FUSChatCenterModule-Swift.h>
@interface FUSIMChatCellEvent ()
@property (nonatomic, weak) FUSIMChatAudioCellView *audioView; //当前cell的语音消息View
......@@ -334,7 +336,7 @@
}
// 判断是否正在视频或语音通话中
if ([FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone) {
if ([FUSChatCallHelper shared].isInChatCalling) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"正在通話中,不能播放語音哦"]];
return;
}
......
......@@ -340,9 +340,20 @@
}
/// 发送通话评价
+ (void)fus_requestSendCallGradeWith:(NSString *)orderId level:(NSInteger)level success:(void (^)(void))success failure:(void (^)(NSString *, int))failure{
if ([NSString isNull:orderId]){
if (failure) failure(@"参数错误", ERROR_CODE);
return;
}
if (level < 0 || level > 5) {
if (failure) failure(@"参数错误", ERROR_CODE);
return;
}
NSDictionary *parm = @{@"callid": orderId,
@"level": [NSString stringWithFormat:@"%ld",level]};
[FUSHttpHelper postRequestBinaryWithUrl:FUSChatCenterURLs.fus_URL_sendCallGrade params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
[FUSHttpHelper postRequestBinaryWithUrl:FUSChatCenterURLs.fus_URL_CONVERSATION_GRADE_STARS params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
success();
} failure:^(NSDictionary * _Nullable dataDict, int code) {
if (failure) {
......
......@@ -8,7 +8,7 @@
#import <Foundation/Foundation.h>
#import "FUSChatDetailFrameModel.h"
#import "FUSIMConversationViewHelper.h"
//#import "FUSIMConversationViewHelper.h"
#import "FUSAgoraSessionHelper.h"
#import "FUSSendMsgInfoModel.h"
@class FUSRoomInfoModel;
......@@ -73,62 +73,52 @@
/**
当前用户的通话状态
*/
@property (nonatomic,assign,readonly) FUSConversationCurrentState callCurrentState;
//@property (nonatomic,assign,readonly) FUSConversationCurrentState callCurrentState;
/**
整个通话流程中自己是否是拨打者
*/
@property (nonatomic,assign,readonly) BOOL conversationIsCaller;
//@property (nonatomic,assign,readonly) BOOL conversationIsCaller;
/**
整个通话流程中对方的UID
*/
@property (nonatomic,copy,readonly) NSString *callOtherUid;
//@property (nonatomic,copy,readonly) NSString *callOtherUid;
/**
整个通话流程中产生消费的订单号
*/
@property (nonatomic,copy,readonly) NSString *callOrderId;
//@property (nonatomic,copy,readonly) NSString *callOrderId;
/**
被拨打者的声优聊天价格
*/
@property (nonatomic,copy,readonly) NSString *callVoicePrice;
//@property (nonatomic,copy,readonly) NSString *callVoicePrice;
/**
被拨打者的视讯价格
*/
@property (nonatomic,copy,readonly) NSString *callVideoPrice;
//@property (nonatomic,copy,readonly) NSString *callVideoPrice;
/**
被拨打者是否认证
*/
@property (nonatomic,assign,readonly) BOOL calledUserHasVerified;
//@property (nonatomic,assign,readonly) BOOL calledUserHasVerified;
/**
这次订单免费的秒数(为0则不免费)
*/
@property (nonatomic,copy,readonly) NSString *callFreeSecCount;
//@property (nonatomic,copy,readonly) NSString *callFreeSecCount;
/**
后台开始扣款的秒数,这个参数由后台控制
*/
@property (nonatomic,copy,readonly) NSString *severChargeSecCount;
//@property (nonatomic,copy,readonly) NSString *severChargeSecCount;
/**
试聊通话超过免费秒数之后 用户是否不愿意继续付费
*/
@property (nonatomic,assign) BOOL tryToCallUserDoNotWantPay;
/**
通话各种视图的管理器
*/
@property (nonatomic,strong,readonly) FUSIMConversationViewHelper *conversationViewHelper;
/**
声网SDK的通话对象(二次封装)
*/
@property (nonatomic,strong,readonly) FUSAgoraSessionHelper *agoraSessionHelper;
//@property (nonatomic,assign) BOOL tryToCallUserDoNotWantPay;
/**
聊天服务的代理对象
......@@ -479,27 +469,27 @@ needRefreshGiftListBlock:(void(^)(void))needRefreshGiftListBlock;
@param icon 对方头像
@param diamondIsNoEnough 宝石不足的回调
*/
- (void)fus_checkAndStartConversationWithCallType:(FUSConversationCallType)callType
startType:(FUSConversationStartType)startType
userID:(NSString *)userID
nick:(NSString *)nick
icon:(NSString *)icon
hasVerified:(BOOL)hasVerified
chatWith:(NSDictionary *)chatWith
diamondIsNoEnough:(void(^)(void))diamondIsNoEnough
jumpToChatPage:(void(^)(NSInteger editState))jumpToChatPage;
//- (void)fus_checkAndStartConversationWithCallType:(FUSConversationCallType)callType
// startType:(FUSConversationStartType)startType
// userID:(NSString *)userID
// nick:(NSString *)nick
// icon:(NSString *)icon
// hasVerified:(BOOL)hasVerified
// chatWith:(NSDictionary *)chatWith
// diamondIsNoEnough:(void(^)(void))diamondIsNoEnough
// jumpToChatPage:(void(^)(NSInteger editState))jumpToChatPage;
/**
结束当前通话
*/
- (void)fus_endCurrentConversationWithReason:(FUSConversationEndType)reason;
//- (void)fus_endCurrentConversationWithReason:(FUSConversationEndType)reason;
/**
上报已经弹出是否接听电话的 View
@param preId preId
*/
- (void)fus_reportSucceedAddingCallingViewWithPreId:(NSString *)preId;
//- (void)fus_reportSucceedAddingCallingViewWithPreId:(NSString *)preId;
/**
......@@ -508,12 +498,12 @@ needRefreshGiftListBlock:(void(^)(void))needRefreshGiftListBlock;
@param orderId 订单号
@param starNum 星星数(1 - 5)
*/
- (void)fus_conversationDidEndAndGradeStarsWithOrderId:(NSString *)orderId starNum:(NSNumber *)starNum success:(void(^)(void))success failure:(void(^)(NSString *errorMsg,NSInteger errorCode))failure;
//- (void)fus_conversationDidEndAndGradeStarsWithOrderId:(NSString *)orderId starNum:(NSNumber *)starNum success:(void(^)(void))success failure:(void(^)(NSString *errorMsg,NSInteger errorCode))failure;
/**
视讯过程中宝石不足弹出倒计时的情况下 跳转到储值界面储值成功的情况
*/
- (void)fus_privateLiveDurationRechargeSuccessToUpdateConversationViewState;
//- (void)fus_privateLiveDurationRechargeSuccessToUpdateConversationViewState;
/**
发送一条礼物透传消息(视讯声播状态下)
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2017/10/27.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// ludy: 此页已废弃,连同相关页面废弃
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
......
......@@ -17,6 +17,7 @@
#import "FUSIMChatService.h"
#import "FUSIMUserService.h"
#import <FUSChatCenterModule/FUSChatCenterModule-Swift.h>
@interface FUSIMVoiceButtonView ()<UIGestureRecognizerDelegate>
......@@ -228,7 +229,7 @@
}
// 判断是否正在视频或语音通话中
if ([FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone) {
if ([FUSChatCallHelper shared].isInChatCalling) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"正在通話中,不能錄製語音哦"]];
return;
}
......
......@@ -119,12 +119,12 @@ class FUSCallEndCallDetailAlertView: FUSBaseView {
}
let lineView = UIView()
lineView.backgroundColor = .fus_line()
lineView.backgroundColor = .white.withAlphaComponent(0.15)
contentView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(20)
make.top.equalTo(callTimeTextLabel.snp.bottom).offset(14)
make.height.equalTo(0.5)
make.height.equalTo(1.0/UIScreen.screenScale())
}
callTimeIncomeTextLabel.font = .fus_themeMediumFont(15)
......@@ -143,12 +143,12 @@ class FUSCallEndCallDetailAlertView: FUSBaseView {
}
let lineView2 = UIView()
lineView2.backgroundColor = .fus_line()
lineView2.backgroundColor = .white.withAlphaComponent(0.15)
contentView.addSubview(lineView2)
lineView2.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(20)
make.top.equalTo(callTimeIncomeTextLabel.snp.bottom).offset(14)
make.height.equalTo(0.5)
make.height.equalTo(1.0/UIScreen.screenScale())
}
giftIncomeTextLable.font = .fus_themeMediumFont(15)
......@@ -198,8 +198,8 @@ class FUSCallEndCallDetailAlertView: FUSBaseView {
}).disposed(by: disposeBag)
self.nickName.bind(to: self.nickNameLabel.rx.text).disposed(by: disposeBag)
self.headerImageView.setWebImageWithSubURLString(self.faceURL.value ?? "", placeholder: .fus_defaultIcon())
self.bgImageView.setWebImageWithSubURLString(self.faceURL.value ?? "", placeholder: .fus_defaultIcon())
self.faceURL.bind(to: self.headerImageView.rx.fus_imageUrl).disposed(by: disposeBag)
self.faceURL.bind(to: self.bgImageView.rx.fus_imageUrl).disposed(by: disposeBag)
Observable.combineLatest(self.isCaller, self.incomeModel)
.subscribe(onNext: {[weak self] isCaller, incomeModel in
......
......@@ -88,7 +88,7 @@ class FUSCallOneToOnePanelView: FUSBaseView {
let bgBtn = UIButton(type: .custom)
var contentViewHeight = 216 + UIView.fus_SafeBottom()
let contentView = FUSPanGestureAlertView(frame: CGRectMake(0, 0, UIView.fus_screenW(), 216))
var btnList: [SPButton] = .init()
var btnList: [UIButton] = .init()
let beautParameterView: FUSPublicLiveBeautyParameterView = FUSRouter.live().fus_createLiveBeautyParameterView(withFrame: UIView.fus_screenFrame())
override func makeUI() {
......@@ -104,8 +104,6 @@ class FUSCallOneToOnePanelView: FUSBaseView {
})
}).disposed(by: disposeBag)
beautParameterView.beautyViewFrom = .singleLive
contentViewHeight = 216
contentView.addRoundedCorners(UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), withRadii: CGSizeMake(14, 14))
......@@ -130,14 +128,15 @@ class FUSCallOneToOnePanelView: FUSBaseView {
let itemInRow = index % btnMaxItemOfRow
let row = index / btnMaxItemOfRow
let tempBtn = SPButton(imagePosition: .top)
tempBtn.imageTitleSpace = 12
let tempBtn = FUSTopImageButton(type: .custom)
// tempBtn.imageTitleSpace = 12
tempBtn.frame = CGRectMake(CGFloat(itemInRow) * btnSize.width, btnTopSpace + CGFloat(row)*btnSize.height, btnSize.width, btnSize.height)
tempBtn.setTitleColor(.fus_textColorLight2(), for: .normal)
tempBtn.titleLabel?.font = .fus_themeFont(11)
tempBtn.setTitleColor(.fus_textColorRich(), for: .selected)
// tempBtn.titleLabel?.font = .fus_themeFont(11)
tempBtn.fus_setTitleFont(.fus_themeFont(11))
tempBtn.setTitle(btnType.btnName, for: .normal)
tempBtn.setTitle(btnType.btnName, for: .selected)
tempBtn.setTitleColor(.fus_textColorLight2(), for: .normal)
tempBtn.setTitleColor(.fus_textColorRich(), for: .selected)
tempBtn.setImage(btnType.image, for: .normal)
tempBtn.setImage(btnType.selectedImage, for: .selected)
tempBtn.tag = btnType.rawValue
......@@ -178,7 +177,9 @@ class FUSCallOneToOnePanelView: FUSBaseView {
override func bindViewModel() {
super.bindViewModel()
// 美颜下降的时候,显示出自己
beautParameterView.beautyViewFrom = .singleLive
// 美颜下降的时候,显示出自己
self.beautParameterView.fus_dismissComplete = {[weak self] in
self?.fus_showWithAnimation(complete: {})
}
......@@ -188,7 +189,7 @@ class FUSCallOneToOnePanelView: FUSBaseView {
/// method
extension FUSCallOneToOnePanelView {
func fus_btnDidClicked(sender: SPButton, type: FFCallOneToOnePanelClickType){
func fus_btnDidClicked(sender: UIButton, type: FFCallOneToOnePanelClickType){
switch type {
case .beauty:
......
......@@ -89,9 +89,9 @@ class FUSCallPaidDataView: FUSBaseView {
make.append(.fus_versionLocalString("私房价格") + ":").textColor(.white.withAlphaComponent(0.5))
make.append { make in
make.image = .fus_diamonIcon()
make.bounds = CGRectMake(0, 0, 22, 22)
make.alignment = .center
}
make.append(" ")
make.append("\(orderModel.callPrice)" + "/" + .fus_versionLocalString("分钟")).textColor(.fus_diamondBlue())
make.font(.fus_themeFont(self?.contentFontSize ?? 15))
})
......@@ -142,9 +142,9 @@ class FUSCallPaidDataView: FUSBaseView {
make.append(.fus_versionLocalString("累计") + currencyText + ":").textColor(.white.withAlphaComponent(0.5))
make.append { make in
make.image = iconImg
make.bounds = CGRectMake(0, 0, 22, 22)
make.alignment = .center
}
make.append(" ")
make.append("\(timeIncomeTotal.total)").textColor(numColor)
make.font(.fus_themeFont(self?.contentFontSize ?? 15))
})
......
......@@ -74,18 +74,13 @@ enum FUSCallViewAction: Equatable {
self.isCaller = isCaller
self.type = type
super.init(frame: UIView.fus_screenFrame())
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private override init(frame: CGRect) {
self.isCaller = true
self.type = .voice
super.init(frame: frame)
makeBaseView()
makeGiftView()
}
@MainActor required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
/// 最小化宽高比
static public let miniScreenHeightRate = 16.0/9.0
......@@ -155,9 +150,7 @@ enum FUSCallViewAction: Equatable {
FUSChatCallHelper.shared.callOtherInfo
.map { $0?.faceUrl }
.subscribe(onNext: {[weak self] faceUrl in
self?.bgImageView.setWebImageWithSubURLString(faceUrl)
})
.bind(to: self.bgImageView.rx.fus_imageUrl)
.disposed(by: disposeBag)
FUSChatCallHelper.shared.state.distinctUntilChanged().subscribe(onNext: {[weak self] state in
......@@ -195,6 +188,12 @@ enum FUSCallViewAction: Equatable {
.bind(to: maximumBtn.rx.isHidden)
.disposed(by: disposeBag)
isMinimize
.subscribe(onNext: {[weak self] isMinimize in
self?.connectingView?.isMinimize.accept(isMinimize)
})
.disposed(by: disposeBag)
maximumBtn.rx.tap.subscribe(onNext: {[weak self] _ in
self?.maximiumCallView()
}).disposed(by: disposeBag)
......@@ -240,7 +239,7 @@ enum FUSCallViewAction: Equatable {
func makeWaitingView(){
self.waitingView?.removeFromSuperview()
let waitingView = FUSChatCallWaitingView(frame: CGRectZero)
let waitingView = FUSChatCallWaitingView(frame: self.bounds)
self.addSubview(waitingView)
self.waitingView = waitingView
self.waitingView?.snp.makeConstraints { make in
......@@ -296,12 +295,46 @@ extension FUSChatCallView{
if FUSChatCallHelper.shared.paymentState.value == .freeTimeOverRemind {
return
}
guard let connectingView = self.connectingView else { return }
let miniGesture = self.ff_getMiniTouchGesture()
self.addGestureRecognizer(miniGesture)
self.miniTouchGesture = miniGesture
self.connectingView?.fus_scaleToMin()
// self.connectingView?.fus_scaleToMin()
connectingView.connectingBgView.isHidden = false
for view in connectingView.connectingBgView.subviews {
view.isHidden = true
}
let smallWidth = (UIView.fus_screenW() / 375.0) * 94
let smallHeight = smallWidth * FUSChatCallView.miniScreenHeightRate
let smallX = UIView.fus_screenW() - smallWidth - 20
let smallY = UIView.fus_StatusBarAndNavgationBarHeight() + 70
let faceWidth = smallWidth * (2 / 3)
connectingView.localView.isHidden = true
connectingView.scaleTypeBeforeMinimze = connectingView.scaleType.value
connectingView.scaleType.accept(.maxRemoteVideo)
// 重置一下状态,因为回来会触发变max,并且开始请求是否足够下一分钟的接口,就怕本身是0,然后要缩小去充值,充值回来后先触发了max,然后请求还没到这个地方还是0,所以再给你弹一个
FUSChatCallHelper.shared.diamondAgainPay.accept(1)
connectingView.voiceFaceImageView.stopAnimation()
connectingView.voiceFaceImageView.isHidden = FUSChatCallHelper.shared.callOtherVideoEnable.value == true
connectingView.voiceFaceImageViewAnimate.accept(true)
UIView.animate(withDuration: 0.25, delay: 0, options: .curveLinear) {[weak self] in
self?.frame = .init(x: smallX, y: smallY, width: smallWidth, height: smallHeight)
connectingView.voiceFaceImageView.size = .init(width: faceWidth, height: faceWidth)
connectingView.voiceFaceImageView.centerX = smallWidth / 2.0
connectingView.voiceFaceImageView.centerY = smallHeight / 2.0
} completion: {[weak self] finish in
self?.isMinimize.accept(true)
connectingView.voiceFaceImageView.isHidden = true
connectingView.voiceFaceImageViewAnimate.accept(false)
}
self.bringSubviewToFront(maximumBtn)
self.layer.cornerRadius = 14
......@@ -312,6 +345,7 @@ extension FUSChatCallView{
if FUSChatCallHelper.shared.paymentState.value == .freeTimeOverRemind {
return
}
guard let connectingView = self.connectingView else { return }
if let miniGesture = self.miniTouchGesture {
self.removeGestureRecognizer(miniGesture)
......@@ -326,7 +360,36 @@ extension FUSChatCallView{
currentRechargeVC?.pop()
}
self.connectingView?.fus_scaleToMax()
// self.connectingView?.fus_scaleToMax()
connectingView.connectingBgView.isHidden = false
for view in connectingView.connectingBgView.subviews {
view.isHidden = false
}
connectingView.scaleType.accept(connectingView.scaleTypeBeforeMinimze)
connectingView.voiceFaceImageView.stopAnimation()
connectingView.voiceFaceImageView.isHidden = FUSChatCallHelper.shared.callOtherVideoEnable.value == true
connectingView.voiceFaceImageViewAnimate.accept(true)
UIView.animate(withDuration: 0.25, delay: 0, options: .curveLinear) {[weak self] in
self?.frame = UIView.fus_screenFrame()
connectingView.voiceFaceImageView.size = .init(width: .fus_callViewFaceImageFullScreenWidth, height: .fus_callViewFaceImageFullScreenWidth)
connectingView.voiceFaceImageView.centerX = UIView.fus_screenW() / 2.0
connectingView.voiceFaceImageView.y = .fus_callViewFaceImageFullScreenTop
} completion: {[weak self] finish in
self?.isMinimize.accept(false)
UIWindow.fus_keyWindow?.endEditing(true)
connectingView.voiceFaceImageView.isHidden = true
connectingView.voiceFaceImageViewAnimate.accept(false)
}
// 销毁上次的收益动画
connectingView.earnAddLabel.layer.removeAllAnimations()
connectingView.earnAddLabel.isHidden = true
connectingView.earnAddLabel.alpha = 1
connectingView.earnAddLabel.transform = .identity
connectingView.showingEarnAddAnimation = false
self.layer.cornerRadius = 0
}
......
//
// FUSTopImageButton.swift
// FUSChatCenterModule
//
// Created by aaa on 2024/12/16.
//
import UIKit
@objcMembers public class FUSTopImageButton: UIButton {
public override var isSelected: Bool{
didSet{
self.titleBtn.isSelected = isSelected
self.imagebtn.isSelected = isSelected
}
}
public override var isEnabled: Bool{
didSet{
self.titleBtn.isEnabled = isEnabled
self.imagebtn.isEnabled = isEnabled
}
}
let imagebtn = UIButton(type: .custom)
let titleBtn = UIButton(type: .custom)
override init(frame: CGRect) {
super.init(frame: frame)
makeUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func makeUI(){
let centerView = UIView()
self.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.center.equalToSuperview()
}
imagebtn.isUserInteractionEnabled = false
centerView.addSubview(imagebtn)
imagebtn.snp.makeConstraints { make in
make.centerX.equalToSuperview()
make.top.equalToSuperview()
}
titleBtn.isUserInteractionEnabled = false
centerView.addSubview(titleBtn)
titleBtn.snp.makeConstraints { make in
make.bottom.equalToSuperview()
make.centerX.equalToSuperview()
make.top.equalTo(imagebtn.snp.bottom).offset(10)
}
}
public override func setImage(_ image: UIImage?, for state: UIControl.State) {
imagebtn.setImage(image, for: state)
}
public override func setTitle(_ title: String?, for state: UIControl.State) {
titleBtn.setTitle(title, for: state)
}
public override func setTitleColor(_ color: UIColor?, for state: UIControl.State) {
titleBtn.setTitleColor(color, for: state)
}
func fus_setTitleFont(_ font: UIFont) {
titleBtn.titleLabel?.font = font
}
}
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/22.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
#import "FUSVideoChatGiftView.h"
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/22.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
#import "FUSVideoChatModel.h"
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/22.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/22.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger, FUSVideoChatSateBtnType) {
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/28.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
@class FUSVideoChatModel;
......
......@@ -5,6 +5,7 @@
// Created by 辰远 on 2018/5/31.
// Copyright © 2024年 FusiClub. All rights reserved.
//
// 此页已废弃
#import <UIKit/UIKit.h>
typedef NS_ENUM(NSUInteger,FUSVideoChatSettingType) {
......
......@@ -16,86 +16,86 @@
@end
@implementation FUSVideoChatSetItem
- (instancetype)initWithFrame:(CGRect)frame type:(FUSVideoChatSettingType)type {
self = [super initWithFrame:frame];
if (self) {
self = [[[FUSChatCenterBunble bundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject];
self.frame = frame;
_type = type;
[self setupUI];
}
return self;
}
- (void)setupUI {
_imageView.image = [FUSChatCenterBunble imageNamed:[self fus_getImageWithType:_type]];
_titleLabel.text = [self fus_getTitleWithType:_type];
_clickBtn.tag = _type;
}
- (IBAction)onClickBtnAction:(UIButton *)sender {
sender.selected = !sender.selected;
if (sender.tag == FUSVideoChatSettingTypeThunderLight && sender.selected) {
if ([[[FUSIMChatService shareInstance] agoraSessionHelper] captureHelper].cameraPosition == AVCaptureDevicePositionFront)
{
[FUSAlertView showAlertWithTitle:[NSString fus_localString:@"请先切换后置摄像头"] message:nil cancelButtonTitle:[NSString fus_localString:@"确定"] otherButtonTitles:nil clickBlock:nil];
return;
}
_titleLabel.text = [NSString fus_localString:@"闪光关闭"];
}else if (sender.tag == FUSVideoChatSettingTypeThunderLight && !sender.selected){
if ([[[FUSIMChatService shareInstance] agoraSessionHelper] captureHelper].cameraPosition == AVCaptureDevicePositionFront) return;
_titleLabel.text = [NSString fus_localString:@"闪光开启"];
}else if (sender.tag == FUSVideoChatSettingTypeSkinBeauty) {
}
if (_didClickSetItemBlock) _didClickSetItemBlock (sender.tag,sender.selected);
}
- (NSString *)fus_getTitleWithType:(FUSVideoChatSettingType)type {
switch (type) {
case FUSVideoChatSettingTypeSkinBeauty:
{
return [NSString fus_localString:@"美颜设置"];
}
break;
case FUSVideoChatSettingTypeThunderLight:
{
return [NSString fus_localString:@"闪光开启"];
}
break;
case FUSVideoChatSettingTypeCamera:
{
return [NSString fus_localString:@"反转镜头"];
}
break;
default:
break;
}
return @"";
}
- (NSString *)fus_getImageWithType:(FUSVideoChatSettingType)type {
switch (type) {
case FUSVideoChatSettingTypeSkinBeauty:
{
return @"video_chat_skin_beauty";
}
break;
case FUSVideoChatSettingTypeThunderLight:
{
return @"video_chat_thunder_light";
}
break;
case FUSVideoChatSettingTypeCamera:
{
return @"video_chat_camera";
}
break;
default:
break;
}
return @"";
}
//- (instancetype)initWithFrame:(CGRect)frame type:(FUSVideoChatSettingType)type {
// self = [super initWithFrame:frame];
// if (self) {
// self = [[[FUSChatCenterBunble bundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] firstObject];
// self.frame = frame;
// _type = type;
// [self setupUI];
// }
// return self;
//}
//
//- (void)setupUI {
// _imageView.image = [FUSChatCenterBunble imageNamed:[self fus_getImageWithType:_type]];
// _titleLabel.text = [self fus_getTitleWithType:_type];
// _clickBtn.tag = _type;
//}
//
//- (IBAction)onClickBtnAction:(UIButton *)sender {
// sender.selected = !sender.selected;
// if (sender.tag == FUSVideoChatSettingTypeThunderLight && sender.selected) {
// if ([[[FUSIMChatService shareInstance] agoraSessionHelper] captureHelper].cameraPosition == AVCaptureDevicePositionFront)
// {
// [FUSAlertView showAlertWithTitle:[NSString fus_localString:@"请先切换后置摄像头"] message:nil cancelButtonTitle:[NSString fus_localString:@"确定"] otherButtonTitles:nil clickBlock:nil];
// return;
// }
// _titleLabel.text = [NSString fus_localString:@"闪光关闭"];
// }else if (sender.tag == FUSVideoChatSettingTypeThunderLight && !sender.selected){
// if ([[[FUSIMChatService shareInstance] agoraSessionHelper] captureHelper].cameraPosition == AVCaptureDevicePositionFront) return;
// _titleLabel.text = [NSString fus_localString:@"闪光开启"];
// }else if (sender.tag == FUSVideoChatSettingTypeSkinBeauty) {
//
// }
//
// if (_didClickSetItemBlock) _didClickSetItemBlock (sender.tag,sender.selected);
//}
//
//- (NSString *)fus_getTitleWithType:(FUSVideoChatSettingType)type {
// switch (type) {
// case FUSVideoChatSettingTypeSkinBeauty:
// {
// return [NSString fus_localString:@"美颜设置"];
// }
// break;
// case FUSVideoChatSettingTypeThunderLight:
// {
// return [NSString fus_localString:@"闪光开启"];
// }
// break;
// case FUSVideoChatSettingTypeCamera:
// {
// return [NSString fus_localString:@"反转镜头"];
// }
// break;
// default:
// break;
// }
// return @"";
//}
//
//- (NSString *)fus_getImageWithType:(FUSVideoChatSettingType)type {
// switch (type) {
// case FUSVideoChatSettingTypeSkinBeauty:
// {
// return @"video_chat_skin_beauty";
// }
// break;
// case FUSVideoChatSettingTypeThunderLight:
// {
// return @"video_chat_thunder_light";
// }
// break;
// case FUSVideoChatSettingTypeCamera:
// {
// return @"video_chat_camera";
// }
// break;
// default:
// break;
// }
// return @"";
//}
@end
......@@ -14,6 +14,7 @@
#import "FUSZhaiXinHttpHelper.h"
#import "FUSSingleLiveGradePopView.h"
#import "FUSIMChatHttpHelper.h"
#define CELL_IDENTIFIER @"FUSSingleLiveRecordV2TableViewCell"
......@@ -212,7 +213,7 @@
FUSSingleLiveGradePopView *pradeView = [[FUSSingleLiveGradePopView alloc]initWithFrame:UIView.fus_screenFrame category:recordModel.category.integerValue];
pradeView.pradeStarsConfirmBlock = ^(NSNumber *pradeStar) {
[FUSLoadingView fus_showProgressViewWithMessage:nil];
[[FUSIMChatService shareInstance] fus_conversationDidEndAndGradeStarsWithOrderId:orderId starNum:pradeStar success:^{
[FUSIMChatHttpHelper fus_requestSendCallGradeWith:orderId level:pradeStar.integerValue success:^{
[FUSLoadingView fus_dismissProgressView];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"评分成功"]];
// 改为已评价
......@@ -220,7 +221,7 @@
recordModel.level = pradeStar.description;
// 本地刷新这行cell
[weakSelf.recordTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationRight];
} failure:^(NSString *errorMsg, NSInteger errorCode) {
} failure:^(NSString *msg, int code) {
[FUSLoadingView fus_dismissProgressView];
}];
};
......
......@@ -140,9 +140,6 @@ NS_ASSUME_NONNULL_BEGIN
/// 主动方拉取通话信息
+(NSString *)fus_URL_getCallerInfo;
/// 发送通话评价
+(NSString *)fus_URL_sendCallGrade;
/// 结束当前通话
+(NSString *)fus_URL_endCallOrder;
......
......@@ -214,10 +214,6 @@
+(NSString *)fus_URL_getCallerInfo{
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/chatWith/getCaller.html"];
}
/// 发送通话评价
+(NSString *)fus_URL_sendCallGrade{
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/chatWith/sendcomment.html"];
}
/// 结束当前通话
+(NSString *)fus_URL_endCallOrder{
return [FUSConfig.sharedInstanced.pathConfigs apiUrl:@"/onetoone/call/over"];
......
......@@ -47,16 +47,19 @@
#pragma mark - Public Methods
- (NSString *)callOrderId {
return FUSIMChatService.shareInstance.callOrderId;
// return FUSIMChatService.shareInstance.callOrderId;
return FUSChatCallHelper.shared.oc_callOrderId;
}
- (BOOL)conversationIsCaller {
return FUSIMChatService.shareInstance.conversationIsCaller;
// return FUSIMChatService.shareInstance.conversationIsCaller;
return FUSChatCallHelper.shared.oc_isCaller;
}
/// 是否正在打声视讯
- (BOOL)isCalling {
return [FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone;
// return [FUSIMChatService shareInstance].callCurrentState != FUSConversationCurrentStateNone;
return FUSChatCallHelper.shared.isInChatCalling ;
}
- (FUSPublicIMEmojiView *)createImEmojiViewWithFrame:(CGRect)frame {
......@@ -131,7 +134,8 @@
}
- (void)fus_initiativeHandUpConversation {
[[FUSIMChatService shareInstance] fus_endCurrentConversationWithReason:FUSConversationEndTypeHangUpInitiative];
// [[FUSIMChatService shareInstance] fus_endCurrentConversationWithReason:FUSConversationEndTypeHangUpInitiative];
[FUSChatCallHelper.shared endCallWithReason:FUSCallEndReasonHangUpInitiative];
}
/**
......@@ -226,28 +230,34 @@
icon:(NSString *)icon
hasVerified:(BOOL)hasVerified
chatWith:(NSDictionary *)chatWith {
[[FUSIMChatService shareInstance] fus_checkAndStartConversationWithCallType:callType
startType:FUSConversationStartTypeZoneVc
userID:userID
nick:nick
icon:icon
hasVerified:hasVerified
chatWith:chatWith
diamondIsNoEnough:^{
// [[FUSIMChatService shareInstance] fus_checkAndStartConversationWithCallType:callType
// startType:FUSConversationStartTypeZoneVc
// userID:userID
// nick:nick
// icon:icon
// hasVerified:hasVerified
// chatWith:chatWith
// diamondIsNoEnough:^{
//
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"宝石不足"]];
// [FUSRechargeViewController fus_showRechargeViewControllerForRootVC:[UIViewController fus_topViewController] rechargePageFrom:FUSRechargePageFromGEMsLack];
// } jumpToChatPage:^(NSInteger editState) {
//
// FUSChatDetailViewController *chatVC = [FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userID nickName:nick face:icon];
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
//
// if (editState == 0) {
// [chatVC fus_beginEditState];
// } else if (editState == 1) {
// [chatVC fus_showSendGiftState];
// }
// });
// }];
FUSAgoraSessionType type = callType == FUSConversationCallTypeVoice ? FUSAgoraSessionTypeAudio : FUSAgoraSessionTypeVideo;
[[FUSChatCallHelper shared] fus_makeCallWithType:type from:startType fid:userID success:^{
[FUSDialogView fus_showDialog:[NSString fus_localString:@"宝石不足"]];
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:[UIViewController fus_topViewController] rechargePageFrom:FUSRechargePageFromGEMsLack];
} jumpToChatPage:^(NSInteger editState) {
} failure:^(NSString * _Nonnull msg, NSInteger code) {
FUSChatDetailViewController *chatVC = [FUSChatDetailViewController fus_showChatDetailVCWithRootVC:[UIViewController fus_topViewController] uid:userID nickName:nick face:icon];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
if (editState == 0) {
[chatVC fus_beginEditState];
} else if (editState == 1) {
[chatVC fus_showSendGiftState];
}
});
}];
}
......@@ -266,47 +276,47 @@
if (![NSDictionary isNull:diamondDict]) {
[FUSCacheDataShare shareStore].userDetailInfo.diamond = [diamondDict[@"diamond"] description];
[[FUSIMChatService shareInstance] fus_privateLiveDurationRechargeSuccessToUpdateConversationViewState];
// [[FUSIMChatService shareInstance] fus_privateLiveDurationRechargeSuccessToUpdateConversationViewState];
}
}
if (messageModel.cid == CID_SINGLE_LIVE_UNUSUAL) { // 音视频通话异常结束的情况
NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
NSNumber *singleLiveState = [messageModel fus_getJsonDict][@"state"];
// 正在通话中并且服务器传来的订单号和当前通话订单号一致 则挂电话
if (singleLiveState.integerValue != -1 && [serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
[[FUSIMChatService shareInstance] fus_endCurrentConversationWithReason:FUSConversationEndTypeYaServerForcedHangUp];
}
}
// if (messageModel.cid == CID_SINGLE_LIVE_UNUSUAL) { // 音视频通话异常结束的情况
//
// NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
// NSNumber *singleLiveState = [messageModel fus_getJsonDict][@"state"];
//
// // 正在通话中并且服务器传来的订单号和当前通话订单号一致 则挂电话
// if (singleLiveState.integerValue != -1 && [serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
// [[FUSIMChatService shareInstance] fus_endCurrentConversationWithReason:FUSConversationEndTypeYaServerForcedHangUp];
// }
// }
if (messageModel.cid == CID_SINGLE_LIVE_EARNINGS) { // 音视频通话主播每分钟加萤火
NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
if ([serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
NSString *currentEarnings = [[messageModel fus_getJsonDict][@"bonds"] description];
NSString *totalEarnings = [[messageModel fus_getJsonDict][@"bondsTotal"] description];
[[FUSIMChatService shareInstance].conversationViewHelper fus_showCostMarkLabelWithTicket:totalEarnings increaseTicket:currentEarnings];
}
}
// if (messageModel.cid == CID_SINGLE_LIVE_EARNINGS) { // 音视频通话主播每分钟加萤火
//
// NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
//
// if ([serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
// NSString *currentEarnings = [[messageModel fus_getJsonDict][@"bonds"] description];
// NSString *totalEarnings = [[messageModel fus_getJsonDict][@"bondsTotal"] description];
//
// [[FUSIMChatService shareInstance].conversationViewHelper fus_showCostMarkLabelWithTicket:totalEarnings increaseTicket:currentEarnings];
// }
// }
if (messageModel.cid == CID_SINGLE_LIVE_DIAMOND_EXPEND) { // 通话扣费主叫方宝石变化消息
NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
if ([serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
NSString *diamond = [[messageModel fus_getJsonDict][@"diamond"] description];
NSString *diamondTotal = [[messageModel fus_getJsonDict][@"diamondTotal"] description];
if (diamondTotal > 0) {
[[FUSIMChatService shareInstance].conversationViewHelper fus_showExpendDiamond:diamondTotal increaseDiamond:diamond];
}
}
}
// if (messageModel.cid == CID_SINGLE_LIVE_DIAMOND_EXPEND) { // 通话扣费主叫方宝石变化消息
//
// NSString *serverOrderId = [messageModel fus_getJsonDict][@"preId"];
//
// if ([serverOrderId isEqualToString:[FUSIMChatService shareInstance].callOrderId]) {
//
// NSString *diamond = [[messageModel fus_getJsonDict][@"diamond"] description];
// NSString *diamondTotal = [[messageModel fus_getJsonDict][@"diamondTotal"] description];
//
// if (diamondTotal > 0) {
// [[FUSIMChatService shareInstance].conversationViewHelper fus_showExpendDiamond:diamondTotal increaseDiamond:diamond];
// }
// }
// }
if (messageModel.cid == CID_SINGLE_LIVE_DIAMOND_RETURN) { // 退回用户已扣除宝石费用
......
......@@ -7,7 +7,7 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>77</integer>
<integer>73</integer>
</dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict>
......
......@@ -7,7 +7,7 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>74</integer>
<integer>77</integer>
</dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict>
......
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