Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e299b07f
authored
Jul 08, 2024
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复一系列bug,让首页可以自动播放
parent
0f200eae
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
278 additions
and
15 deletions
FuSiLive.xcodeproj/project.pbxproj
FuSiLive/Classes/BaoFang/Main/View/Cell/FUSBaofangBaseHomeLiveCell.m
FuSiLive/Classes/BaoFang/Main/View/Other/FUSBaofangStreamPlayerView.h
FuSiLive/Classes/BaoFang/Main/View/Other/FUSBaofangStreamPlayerView.m
FuSiLive/Classes/Foundation/Http/FUSURLDictionary.h
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSAnchorListAutoPlayTableView.h
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSAnchorListAutoPlayTableView.m
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSHomeView.m
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSMyView.m
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/ViewModel/FUSHomeViewViewModel.h
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/ViewModel/FUSHomeViewViewModel.m
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/cell/FUSHomeAnchorListSmallCell.m
FuSiLive/Classes/FusiVersionFeature/ViewController/NovaList/cell/FFHomeListNovaListCollectionViewSmallCell.m
FuSiLive/Classes/NewLive/Main/View/Push/FUSLiveStartView.m
FuSiLive/Classes/NewsFeed/RichEditor/Controller/FUSPublishNewsFeedViewController.m
FuSiLive/Classes/NewsFeed/RichEditor/Controller/WGBaseRichEditorViewController.m
FuSiLive/Classes/ZhaiXin/Official/Controller/FUSOfficialViewController.m
FuSiLive.xcodeproj/project.pbxproj
View file @
e299b07f
...
...
@@ -51,6 +51,7 @@
00A36A552C1D8A7C004D28FA
/* FUSHomeNovaListBroadcastHelper.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A36A542C1D8A7C004D28FA
/* FUSHomeNovaListBroadcastHelper.m */
;
};
00A36A592C1D9FD6004D28FA
/* FUSLeftPopScrollView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A36A582C1D9FD6004D28FA
/* FUSLeftPopScrollView.m */
;
};
00A3C86F2C37FCFA00A6F818
/* FUSIMZhaiXinViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A3C86E2C37FCFA00A6F818
/* FUSIMZhaiXinViewController.m */
;
};
00A3C8722C38125800A6F818
/* FUSAnchorListAutoPlayTableView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A3C8712C38125800A6F818
/* FUSAnchorListAutoPlayTableView.m */
;
};
00A44A5D2C2BC14E003FDF44
/* FUSSingleLiveRecordV2TableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A44A5C2C2BC14E003FDF44
/* FUSSingleLiveRecordV2TableViewCell.m */
;
};
00A44A602C2C04FC003FDF44
/* FUSChatIntimacyV2View.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A44A5F2C2C04FC003FDF44
/* FUSChatIntimacyV2View.m */
;
};
00A44A632C2C4345003FDF44
/* FUSUserTradeRemindModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
00A44A622C2C4345003FDF44
/* FUSUserTradeRemindModel.m */
;
};
...
...
@@ -1468,6 +1469,8 @@
00A36A582C1D9FD6004D28FA
/* FUSLeftPopScrollView.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSLeftPopScrollView.m
;
sourceTree
=
"<group>"
;
};
00A3C86D2C37FCFA00A6F818
/* FUSIMZhaiXinViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSIMZhaiXinViewController.h
;
sourceTree
=
"<group>"
;
};
00A3C86E2C37FCFA00A6F818
/* FUSIMZhaiXinViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSIMZhaiXinViewController.m
;
sourceTree
=
"<group>"
;
};
00A3C8702C38125800A6F818
/* FUSAnchorListAutoPlayTableView.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSAnchorListAutoPlayTableView.h
;
sourceTree
=
"<group>"
;
};
00A3C8712C38125800A6F818
/* FUSAnchorListAutoPlayTableView.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSAnchorListAutoPlayTableView.m
;
sourceTree
=
"<group>"
;
};
00A44A5B2C2BC14E003FDF44
/* FUSSingleLiveRecordV2TableViewCell.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSSingleLiveRecordV2TableViewCell.h
;
sourceTree
=
"<group>"
;
};
00A44A5C2C2BC14E003FDF44
/* FUSSingleLiveRecordV2TableViewCell.m */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
FUSSingleLiveRecordV2TableViewCell.m
;
sourceTree
=
"<group>"
;
};
00A44A5E2C2C04FC003FDF44
/* FUSChatIntimacyV2View.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FUSChatIntimacyV2View.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -3746,6 +3749,8 @@
00A2D4682C1AEFBF00A15ECA
/* FUSHomePageBaseView.m */
,
00A2D4692C1AEFBF00A15ECA
/* FUSHomeView.h */
,
00A2D46A2C1AEFBF00A15ECA
/* FUSHomeView.m */
,
00A3C8702C38125800A6F818
/* FUSAnchorListAutoPlayTableView.h */
,
00A3C8712C38125800A6F818
/* FUSAnchorListAutoPlayTableView.m */
,
00A2D46B2C1AEFBF00A15ECA
/* FUSMessageFunctionColumnView.h */
,
00A2D46C2C1AEFBF00A15ECA
/* FUSMessageFunctionColumnView.m */
,
00A2D46D2C1AEFBF00A15ECA
/* FUSMessageView.h */
,
...
...
@@ -10182,6 +10187,7 @@
BE03983F2C134566003EB21B
/* AnimationTextProvider.swift in Sources */
,
BED0FABC2C0C49C90017B285
/* FUSPkWinningStreakView.swift in Sources */
,
BED0FA0F2C0C49C90017B285
/* FUSLiveGiftSendToUserView.m in Sources */
,
00A3C8722C38125800A6F818
/* FUSAnchorListAutoPlayTableView.m in Sources */
,
BED0FA992C0C49C90017B285
/* FUSPKHelper.m in Sources */
,
BED0FC342C0C49CA0017B285
/* FUSMotoringWareHouseViewController.m in Sources */
,
BECDD3622C13099700576A03
/* FUSLiveChangeNumberAnimationView.m in Sources */
,
...
...
FuSiLive/Classes/BaoFang/Main/View/Cell/FUSBaofangBaseHomeLiveCell.m
View file @
e299b07f
...
...
@@ -67,7 +67,7 @@
-
(
BOOL
)
canAutoPlayStream
{
BOOL
isOnHomePage
=
[[
UIViewController
fus_topViewController
]
isKindOfClass
:
NSClassFromString
(
@"FUS
BaoFangHom
eViewController"
)];
BOOL
isOnHomePage
=
[[
UIViewController
fus_topViewController
]
isKindOfClass
:
NSClassFromString
(
@"FUS
HomePag
eViewController"
)];
BOOL
canAutoPlayStream
=
[[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
BAOFANG_COVER_AUTO_PLAT_SWITCH
]
boolValue
];
BOOL
isNoVideoChatting
=
[
FUSIMChatService
shareInstance
].
callCurrentState
==
FUSConversationCurrentStateNone
;
return
isOnHomePage
&&
canAutoPlayStream
&&
isNoVideoChatting
;
...
...
FuSiLive/Classes/BaoFang/Main/View/Other/FUSBaofangStreamPlayerView.h
View file @
e299b07f
...
...
@@ -6,13 +6,13 @@
// Copyright © 2024年 FuSiLive. All rights reserved.
//
#import "FUSStreamPlayView.h"
#import "FUS
Byte
StreamPlayView.h"
#import "FUSBaoFangAnchorModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FUSBaofangStreamPlayerView
:
FUSStreamPlayView
@interface
FUSBaofangStreamPlayerView
:
FUS
Byte
StreamPlayView
@property
(
nonatomic
,
strong
)
FUSBaoFangAnchorModel
*
model
;
...
...
FuSiLive/Classes/BaoFang/Main/View/Other/FUSBaofangStreamPlayerView.m
View file @
e299b07f
...
...
@@ -81,7 +81,7 @@
if
(
self
.
model
.
hasEndedLive
||
([
FUSLiveHelper
shareInstance
].
liveType
!=
FUSLiveTypeNone
&&
!
[
FUSLiveHelper
shareInstance
].
liveMinimizeView
)
||
!
[[
UIViewController
fus_topViewController
]
isKindOfClass
:
NSClassFromString
(
@"FUS
BaoFangHom
eViewController"
)]
||
!
[[
UIViewController
fus_topViewController
]
isKindOfClass
:
NSClassFromString
(
@"FUS
HomePag
eViewController"
)]
||
self
.
model
.
roomType
!=
0
)
{
if
([
self
fus_statusForUID
:
self
.
model
.
uid
]
==
FUSStreamPlayStatusPlaying
||
[
self
fus_statusForUID
:
self
.
model
.
uid
]
==
FUSStreamPlayStatusPause
)
{
...
...
FuSiLive/Classes/Foundation/Http/FUSURLDictionary.h
View file @
e299b07f
...
...
@@ -1058,7 +1058,7 @@
#define URL_WEB_ARBIC_HELP DNS_WEB(@"/Nesting/help/l7.html")
// 《直播 & 社区公约》
#define URL_WEB_REGULATION DNS_WEB(@"
/Nesting/rule/adminRule
.html")//DNS_WEB(@"/regulation.html")
#define URL_WEB_REGULATION DNS_WEB(@"
fusi/help/index
.html")//DNS_WEB(@"/regulation.html")
// 主播时长查询
#define URL_LIVE_TIME_SEARCH DNS_WEB(@"/Nesting/queryTime/index.html")
...
...
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSAnchorListAutoPlayTableView.h
0 → 100644
View file @
e299b07f
//
// FUSAnchorListAutoPlayTableView.h
// FuSiLive
//
// Created by aaa on 2024/7/5.
//
#import <UIKit/UIKit.h>
#import "FUSBaofangBaseHomeLiveCell.h"
NS_ASSUME_NONNULL_BEGIN
@interface
FUSAnchorListAutoPlayTableView
:
UICollectionView
#pragma mark --- 自动播放相关
/// 是否结束当前的请求
@property
(
nonatomic
,
assign
)
BOOL
isFinishLoadData
;
-
(
void
)
fus_playVideoIfNeeded
;
-
(
void
)
fus_stopVideoPlaying
;
@end
NS_ASSUME_NONNULL_END
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSAnchorListAutoPlayTableView.m
0 → 100644
View file @
e299b07f
//
// FUSAnchorListAutoPlayTableView.m
// FuSiLive
//
// Created by aaa on 2024/7/5.
//
#import "FUSAnchorListAutoPlayTableView.h"
#import "FUSLiveHelper.h"
#import "FUSIMChatService.h"
@interface
FUSAnchorListAutoPlayTableView
()
// 当前正在播放的视频
@property
(
nonatomic
,
weak
)
UICollectionViewCell
*
_Nullable
playingFeedCell
;
@end
@implementation
FUSAnchorListAutoPlayTableView
-
(
void
)
fus_endCurrentPlayingCell
{
[
self
fus_stopVideoPlaying
];
}
-
(
void
)
fus_startCellPlayerIfNeeded
{
[
self
fus_playVideoIfNeeded
];
}
-
(
void
)
fus_playVideoIfNeeded
{
if
(
!
self
.
isFinishLoadData
)
{
[
self
fus_stopVideoPlaying
];
return
;
}
if
(
self
.
playingFeedCell
&&
[
self
fus_isCellInsideScreen
:
self
.
playingFeedCell
])
{
// 如果当前播放中的View还在屏幕内。继续播放
if
([
self
.
playingFeedCell
respondsToSelector
:
@selector
(
fus_playVideoIfNeeded
)])
{
[
self
.
playingFeedCell
performSelector
:
@selector
(
fus_playVideoIfNeeded
)];
}
return
;
}
[
self
fus_stopVideoPlaying
];
if
([
FUSLiveHelper
shareInstance
].
liveType
!=
FUSLiveTypeNone
&&
!
[
FUSLiveHelper
shareInstance
].
liveMinimizeView
)
{
return
;
}
// 判断是否正在视频或语音通话中
if
([
FUSIMChatService
shareInstance
].
callCurrentState
!=
FUSConversationCurrentStateNone
)
{
return
;
}
AFNetworkReachabilityStatus
networkState
=
[
FUSHttpHelper
getNetworkStatus
];
if
(
networkState
!=
AFNetworkReachabilityStatusReachableViaWiFi
)
{
return
;
}
for
(
UICollectionViewCell
*
cell
in
self
.
visibleCells
)
{
// 如果当前cell在屏幕内
if
([
self
fus_isCellInsideScreen
:
cell
])
{
if
([
cell
isKindOfClass
:[
FUSBaofangBaseHomeLiveCell
class
]])
{
FUSBaofangBaseHomeLiveCell
*
liveCell
=
(
FUSBaofangBaseHomeLiveCell
*
)
cell
;
if
(
liveCell
.
model
.
roomType
!=
0
||
liveCell
.
model
.
fus_itemType
!=
0
)
{
continue
;
}
}
else
if
(
!
[
cell
respondsToSelector
:
@selector
(
fus_playVideoIfNeeded
)])
{
continue
;
}
if
(
!
self
.
playingFeedCell
)
{
self
.
playingFeedCell
=
cell
;
}
else
{
if
(
self
.
playingFeedCell
.
y
>
cell
.
y
)
{
self
.
playingFeedCell
=
cell
;
}
else
if
(
self
.
playingFeedCell
.
y
==
cell
.
y
)
{
if
(
self
.
playingFeedCell
.
x
>
cell
.
x
)
{
self
.
playingFeedCell
=
cell
;
}
}
}
}
}
if
(
self
.
playingFeedCell
&&
[
self
.
playingFeedCell
respondsToSelector
:
@selector
(
fus_playVideoIfNeeded
)])
{
[
self
.
playingFeedCell
performSelector
:
@selector
(
fus_playVideoIfNeeded
)];
}
}
-
(
void
)
fus_stopVideoPlaying
{
[
NSObject
cancelPreviousPerformRequestsWithTarget
:
self
selector
:
@selector
(
fus_startCellPlayerIfNeeded
)
object
:
nil
];
if
(
self
.
playingFeedCell
&&
[
self
.
playingFeedCell
respondsToSelector
:
@selector
(
fus_stopPlayCurrentVideo
)])
{
[
self
.
playingFeedCell
performSelector
:
@selector
(
fus_stopPlayCurrentVideo
)];
}
self
.
playingFeedCell
=
nil
;
}
-
(
BOOL
)
fus_isCellInsideScreen
:
(
UICollectionViewCell
*
)
cell
{
CGFloat
tabBarY
=
[
UIViewController
fus_topViewController
].
tabBarController
.
tabBar
.
y
;
if
(
tabBarY
<
UIView
.
fus_screenH
)
{
if
(
cell
.
y
>=
self
.
contentOffset
.
y
+
self
.
contentInset
.
top
&&
cell
.
y
<=
self
.
contentOffset
.
y
+
self
.
height
-
cell
.
height
-
UIView
.
fus_tabbarHeight
-
23
)
{
return
YES
;
}
}
else
{
if
(
cell
.
y
>=
self
.
contentOffset
.
y
&&
cell
.
y
<=
self
.
contentOffset
.
y
+
self
.
height
-
cell
.
height
)
{
return
YES
;
}
}
return
NO
;
}
@end
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSHomeView.m
View file @
e299b07f
...
...
@@ -18,6 +18,8 @@
#import "FUSResponsibilityConfirmAlertView.h"
#import "FUSMyEditNameAlertView.h"
#import "FUSHomeNovaListViewController.h"
#import "FUSAnchorListAutoPlayTableView.h"
#import "FUSMainViewControllerHelper.h"
#import "FuSiLive-Swift.h"
#import "FUSBaoFangMainLiveDataSource.h"
...
...
@@ -34,7 +36,7 @@
@property
(
nonatomic
,
strong
)
FUSBaoFangBroadcastView
*
broadcastView
;
#pragma mark collection
@property
(
nonatomic
,
strong
)
UICollection
View
*
collectionView
;
@property
(
nonatomic
,
strong
)
FUSAnchorListAutoPlayTable
View
*
collectionView
;
// 开始滚动的位置
@property
(
nonatomic
,
assign
)
CGFloat
newContentOffsetY
;
...
...
@@ -103,7 +105,7 @@
self
.
titleContainerView
.
height
=
self
.
broadcastView
.
bottom
+
3
;
// collection
self
.
collectionView
=
[[
UICollection
View
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenH
)
self
.
collectionView
=
[[
FUSAnchorListAutoPlayTable
View
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
UIView
.
fus_screenW
,
UIView
.
fus_screenH
)
collectionViewLayout
:[[
UICollectionViewFlowLayout
alloc
]
init
]];
self
.
collectionView
.
scrollsToTop
=
YES
;
// self.collectionView.contentInset = UIEdgeInsetsMake(self.titleContainerView.height + 0, 0, UIView.fus_tabbarHeight, 0);
...
...
@@ -130,6 +132,11 @@
-
(
void
)
fus_reagiestNotification
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
fu_followDidUpdate
:
)
name
:
FocusBaoFang_Refresh
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
fus_enterLiveRoom
)
name
:
ENTER_LIVE_ROOM
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
fus_quickLiveRoom
)
name
:
QUICK_LIVE_ROOM
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
fus_quickLiveRoom
)
name
:
Live_Room_Minimize_Anim_Finish_Notification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
fus_enterLiveRoom
)
name
:
Live_Room_Maximize_Anim_Finish_Notification
object
:
nil
];
}
-
(
void
)
layoutSubviews
{
...
...
@@ -146,13 +153,43 @@
-
(
void
)
fus_viewWillShow
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
fus_playHotCell
];
});
}
#pragma mark --- notification
-
(
void
)
fus_enterLiveRoom
{
[
self
fus_stopHotCell
];
}
-
(
void
)
fus_quickLiveRoom
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
fus_playHotCell
];
});
}
-
(
void
)
fu_followDidUpdate
:
(
NSNotification
*
)
noti
{
self
.
followNeedUpdate
=
YES
;
}
#pragma mark --- cell auto play
-
(
void
)
fus_playHotCell
{
if
(
!
[[
UIViewController
fus_topViewController
]
isEqual
:
self
.
parentController
])
{
[
self
fus_stopHotCell
];
return
;
}
if
([
FUSMainViewControllerHelper
fus_themeFontHelper
].
tabbarView
.
currentIndex
!=
1
)
{
[
self
fus_stopHotCell
];
return
;
}
[
self
.
collectionView
fus_playVideoIfNeeded
];
}
/// 停掉当前所有的播放器
-
(
void
)
fus_stopHotCell
{
[
self
.
collectionView
fus_stopVideoPlaying
];
}
#pragma mark --- method
-
(
void
)
fus_enterRoom
:
(
FUSBaoFangAnchorModel
*
)
model
index
:
(
NSInteger
)
index
{
[
FUSBaoFangViewHelper
fus_clickBaofangItemAtIndex
:
model
type
:
FUSAnchorHotData
controllerType
:
FUSBaoFangControllerTypeMainLive
index
:
index
onLiveRooms
:
self
.
viewModel
.
onlyLiveRoomList
];
...
...
@@ -331,6 +368,9 @@
BOOL
isLastSelected
=
[
self
.
naviView
fus_isButtonSelected
:
FUSHomeNaviViewClickTypeFollow
];
[
self
.
naviView
fus_setButton
:
FUSHomeNaviViewClickTypeFollow
selected
:
type
==
FUSHomeViewAnchorListTypeFollow
?
YES
:
NO
];
[
self
.
collectionView
reloadData
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
0
.
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
self
fus_playHotCell
];
});
[
self
.
naviView
fus_getNaviButton
:
FUSHomeNaviViewClickTypeFollow
].
enabled
=
YES
;
...
...
@@ -355,6 +395,9 @@
}
}
-
(
void
)
fus_homeViewViewModelDataLoadStateDidChangeWithIsLoading
:
(
BOOL
)
isLoading
{
self
.
collectionView
.
isFinishLoadData
=
!
isLoading
;
}
#pragma mark --- FUSHomeLanguageSegmentViewDelegate
-
(
void
)
fus_homeLanguageSegmentViewDidClicked
:
(
NSInteger
)
index
{
...
...
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/View/FUSMyView.m
View file @
e299b07f
...
...
@@ -611,7 +611,8 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
[
self
.
parentController
.
navigationController
pushViewController
:
serviceChat
animated
:
YES
];
}
else
{
FUSWKWebViewController
*
webVC
=
[[
FUSWKWebViewController
alloc
]
init
];
NSString
*
webURL
=
FUSLocalizationHelper
.
isArbicLanguage
?
URL_WEB_ARBIC_HELP
:
URL_WEB_HELP
;
// NSString *webURL = FUSLocalizationHelper.isArbicLanguage ? URL_WEB_ARBIC_HELP : URL_WEB_HELP;
NSString
*
webURL
=
@"https://www.footseen.com/agreement/agreement.html"
;
webVC
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?lang=%@"
,
webURL
,
FUSLocalizationHelper
.
fus_currentLanguage
.
languageID
];
[
self
.
parentController
.
navigationController
pushViewController
:
webVC
animated
:
YES
];
}
...
...
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/ViewModel/FUSHomeViewViewModel.h
View file @
e299b07f
...
...
@@ -31,6 +31,10 @@ typedef enum :NSInteger{
/// - Parameter type: 改变的列表类型
-
(
void
)
fus_homeViewViewModelAnchorListDidUpdate
:(
FUSHomeViewAnchorListType
)
type
;
/// 当前数据是否正在请求,用于给collectionview的自动播放让路
/// - Parameter isLoading: yes=正在请求,no=不是正在请求
-
(
void
)
fus_homeViewViewModelDataLoadStateDidChangeWithIsLoading
:(
BOOL
)
isLoading
;
@end
@interface
FUSHomeViewViewModel
:
NSObject
...
...
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/ViewModel/FUSHomeViewViewModel.m
View file @
e299b07f
...
...
@@ -26,6 +26,10 @@
@property
(
nonatomic
,
copy
)
NSMutableArray
<
FUSBaoFangAnchorModel
*>
*
followAnchorOriginalList
;
@property
(
nonatomic
,
assign
)
BOOL
isFirstLoad
;
/// 网络请求的锁,有请求+1,请求完毕-1,初始值是0,0的时候就是没有东西在请求了
@property
(
nonatomic
,
assign
)
NSInteger
loadingCount
;
/// 是否正在请求中
@property
(
nonatomic
,
assign
)
BOOL
isLoading
;
@end
...
...
@@ -36,6 +40,8 @@
self
=
[
super
init
];
if
(
self
)
{
self
.
isFirstLoad
=
YES
;
self
.
loadingCount
=
0
;
self
.
isLoading
=
NO
;
[
self
fus_loadHomeLanguageListWithAnchorList
:
YES
readFrom
:
ReadCacheFromTypeLocal
];
[
self
fus_loadhomeVestFollowGetlistAutoCall
:
NO
];
}
...
...
@@ -53,8 +59,10 @@
/// 请求语言列表
-
(
void
)
fus_loadHomeLanguageListWithAnchorList
:
(
BOOL
)
shouldLoadAnchorList
readFrom
:
(
ReadCacheFromType
)
readFrom
{
self
.
loadingCount
++
;
[
FUSBaoFangCacheOperate
fus_homeLanguageGetlist
:
readFrom
success
:
^
(
NSArray
<
FUSHomeLanguageGetlistModel
*>
*
languageList
)
{
self
.
loadingCount
--
;
self
.
homeLanguageGetList
=
languageList
;
if
(
self
.
isFirstLoad
&&
self
.
homeLanguageGetList
.
count
>
0
)
{
// 第一次加载
...
...
@@ -109,7 +117,7 @@
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
[
FUSDialogView
fus_showDialog
:
msg
];
self
.
loadingCount
--
;
// 为了让下拉刷新可以回调
if
(
shouldLoadAnchorList
)
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
fus_homeViewViewModelAnchorListDidUpdate
:)])
{
...
...
@@ -121,9 +129,10 @@
}
/// 请求主播列表
-
(
void
)
fus_loadvestRoomGetlistAutoCall
:
(
BOOL
)
autoCall
readFrom
:
(
ReadCacheFromType
)
readFrom
{
self
.
loadingCount
++
;
[
FUSBaoFangCacheOperate
fus_homeVestRoomGetlist
:
readFrom
success
:
^
(
NSArray
<
FUSBaoFangAnchorModel
*>
*
modelList
)
{
self
.
loadingCount
--
;
self
.
anchorOriginalList
=
modelList
;
[
self
.
onlyLiveRoomList
removeAllObjects
];
for
(
FUSBaoFangAnchorModel
*
tempModel
in
modelList
)
{
...
...
@@ -135,6 +144,7 @@
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
[
FUSDialogView
fus_showDialog
:
msg
];
self
.
loadingCount
--
;
if
(
autoCall
)
{
// 为了让下拉刷新可以回调
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
fus_homeViewViewModelAnchorListDidUpdate
:)])
{
...
...
@@ -146,15 +156,17 @@
///请求推荐列表
-
(
void
)
fus_loadhomeVestFollowGetlistAutoCall
:
(
BOOL
)
autoCall
{
self
.
loadingCount
++
;
[
FUSBaoFangHttpHelper
fus_requestHomeVestFollowGetlistType
:
0
success
:
^
(
NSMutableArray
<
FUSBaoFangAnchorModel
*>
*
modelList
,
FUSBaoFangAnchorModel
*
recommendModel
)
{
self
.
loadingCount
--
;
self
.
followAnchorOriginalList
=
modelList
;
self
.
recommendModel
=
recommendModel
;
[
self
fus_sortDataListAutoCall
:
autoCall
];
}
failure
:^
(
NSString
*
msg
,
int
code
)
{
self
.
loadingCount
--
;
if
(
autoCall
)
{
// 为了让下拉刷新可以回调
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
fus_homeViewViewModelAnchorListDidUpdate
:)])
{
...
...
@@ -274,6 +286,16 @@
}
#pragma mark --- setter
-
(
void
)
setLoadingCount
:
(
NSInteger
)
loadingCount
{
_loadingCount
=
loadingCount
;
BOOL
oldLoadingState
=
self
.
isLoading
;
self
.
isLoading
=
_loadingCount
>
0
?
YES
:
NO
;
if
(
oldLoadingState
!=
self
.
isLoading
)
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
fus_homeViewViewModelDataLoadStateDidChangeWithIsLoading
:)])
{
[
self
.
delegate
fus_homeViewViewModelDataLoadStateDidChangeWithIsLoading
:
self
.
isLoading
];
}
}
}
-
(
NSMutableArray
*
)
dataList
{
if
(
!
_dataList
)
{
_dataList
=
[[
NSMutableArray
alloc
]
init
];
...
...
FuSiLive/Classes/FusiVersionFeature/ViewController/HomePage/cell/FUSHomeAnchorListSmallCell.m
View file @
e299b07f
...
...
@@ -44,7 +44,6 @@
-
(
void
)
fus_createUI
{
self
.
bgImageView
=
[[
UIImageView
alloc
]
init
];
[
self
.
contentView
addSubview
:
self
.
bgImageView
];
[
self
.
bgImageView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
contentView
);
...
...
@@ -194,4 +193,17 @@
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
#pragma mark --- getter and setter
-
(
UIImageView
*
)
bgImageView
{
if
(
!
_bgImageView
)
{
_bgImageView
=
[[
UIImageView
alloc
]
init
];
}
return
_bgImageView
;
}
@end
FuSiLive/Classes/FusiVersionFeature/ViewController/NovaList/cell/FFHomeListNovaListCollectionViewSmallCell.m
View file @
e299b07f
...
...
@@ -648,4 +648,9 @@
return
_previewMarkImageView
;
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
@end
FuSiLive/Classes/NewLive/Main/View/Push/FUSLiveStartView.m
View file @
e299b07f
...
...
@@ -207,7 +207,9 @@
}
}
else
if
(
clickType
==
2
)
{
// 点击直播公约
FUSWKWebViewController
*
webVC
=
[[
FUSWKWebViewController
alloc
]
init
];
webVC
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?lang=%@"
,
URL_WEB_REGULATION
,
FUSLocalizationHelper
.
fus_currentLanguage
.
languageID
];
[[
UIViewController
fus_topViewController
].
navigationController
pushViewController
:
webVC
animated
:
YES
];
}
}];
...
...
FuSiLive/Classes/NewsFeed/RichEditor/Controller/FUSPublishNewsFeedViewController.m
View file @
e299b07f
...
...
@@ -693,7 +693,9 @@ FUSImagePickerViewControllerDelegate>
}
else
if
(
clickType
==
2
)
{
// 点击直播公约
FUSWKWebViewController
*
webVC
=
[[
FUSWKWebViewController
alloc
]
init
];
webVC
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?lang=%@"
,
URL_WEB_REGULATION
,
FUSLocalizationHelper
.
fus_currentLanguage
.
languageID
];
[[
UIViewController
fus_topViewController
].
navigationController
pushViewController
:
webVC
animated
:
YES
];
}
}];
}
else
{
...
...
FuSiLive/Classes/NewsFeed/RichEditor/Controller/WGBaseRichEditorViewController.m
View file @
e299b07f
...
...
@@ -223,7 +223,9 @@ WKScriptMessageHandler
}
else
if
(
clickType
==
2
)
{
// 点击直播公约
FUSWKWebViewController
*
webVC
=
[[
FUSWKWebViewController
alloc
]
init
];
webVC
.
webUrlString
=
[
NSString
stringWithFormat
:
@"%@?lang=%@"
,
URL_WEB_REGULATION
,
FUSLocalizationHelper
.
fus_currentLanguage
.
languageID
];
[[
UIViewController
fus_topViewController
].
navigationController
pushViewController
:
webVC
animated
:
YES
];
}
}];
}
else
{
...
...
FuSiLive/Classes/ZhaiXin/Official/Controller/FUSOfficialViewController.m
View file @
e299b07f
...
...
@@ -588,7 +588,22 @@
[
self
.
navigationController
pushViewController
:
userZoneVc
animated
:
YES
];
}
break
;
case
16
:{
}
break
;
case
17
:{
// 跳转客服页面
[
self
.
navigationController
fus_pushToServiceControllerWithAnimate
:
YES
];
}
break
;
case
18
:{
// 跳轉到任務中心頁面(奖励领取),这里好像跟11一样了
FUSZoneTaskCenterViewController
*
taskVC
=
[[
FUSZoneTaskCenterViewController
alloc
]
init
];
taskVC
.
startWithRewardType
=
4
;
[
self
.
navigationController
pushViewController
:
taskVC
animated
:
YES
];
}
break
;
default
:
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment