Commit b231376f by ludi

完成原生客服的修复,修改新星模块显示

parent 76827dc4
Showing with 925 additions and 137 deletions
...@@ -365,7 +365,7 @@ ...@@ -365,7 +365,7 @@
if (![_webUrlString containsString:@"appname="]) { if (![_webUrlString containsString:@"appname="]) {
// urlString = [FUSHttpManager fus_getHttUrl:urlString params:@{@"appname":NSBundle.mainBundle.bundleIdentifier}]; // urlString = [FUSHttpManager fus_getHttUrl:urlString params:@{@"appname":NSBundle.mainBundle.bundleIdentifier}];
//TODO: 暂时先改成这个,正式服使用上面那个 //TODO: 暂时先改成这个,正式服使用上面那个
urlString = @"com.fusi.live.ios"; urlString = [FUSHttpManager fus_getHttUrl:urlString params:@{@"appname":@"com.fusi.live.ios"}];
} }
// 增加安全区高度数据注入 // 增加安全区高度数据注入
urlString = [FUSHttpManager fus_getHttUrl:urlString params:@{@"safeAreaTop":@((NSInteger)((UIView.fus_SafeTop / UIView.fus_screenH) * 100))}]; urlString = [FUSHttpManager fus_getHttUrl:urlString params:@{@"safeAreaTop":@((NSInteger)((UIView.fus_SafeTop / UIView.fus_screenH) * 100))}];
......
...@@ -54,6 +54,8 @@ ...@@ -54,6 +54,8 @@
00A4529B2C2FEDB2004EC526 /* FUSControllerPushHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A4529A2C2FEDB2004EC526 /* FUSControllerPushHelper.m */; }; 00A4529B2C2FEDB2004EC526 /* FUSControllerPushHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A4529A2C2FEDB2004EC526 /* FUSControllerPushHelper.m */; };
00A6F0982C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A6F0972C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m */; }; 00A6F0982C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A6F0972C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m */; };
00B48E072C213CCD001E4872 /* FUSSettingInitDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */; }; 00B48E072C213CCD001E4872 /* FUSSettingInitDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */; };
00CABAC72C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 00CABAC62C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.m */; };
00CABAC92C32BD8700D269B7 /* img_novaList_cell_new_animation.webp in Resources */ = {isa = PBXBuildFile; fileRef = 00CABAC82C32BD8700D269B7 /* img_novaList_cell_new_animation.webp */; };
BE02D73D2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */; }; BE02D73D2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */; };
BE02EA292C21C3360092264C /* VELPictureInPictureController.m in Sources */ = {isa = PBXBuildFile; fileRef = BE02EA282C21C3360092264C /* VELPictureInPictureController.m */; }; BE02EA292C21C3360092264C /* VELPictureInPictureController.m in Sources */ = {isa = PBXBuildFile; fileRef = BE02EA282C21C3360092264C /* VELPictureInPictureController.m */; };
BE0395D12C132E0F003EB21B /* BEComposerNodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BA2C132E0F003EB21B /* BEComposerNodeModel.m */; }; BE0395D12C132E0F003EB21B /* BEComposerNodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BA2C132E0F003EB21B /* BEComposerNodeModel.m */; };
...@@ -1500,6 +1502,9 @@ ...@@ -1500,6 +1502,9 @@
00B48E052C213CCD001E4872 /* FUSSettingInitDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSSettingInitDataModel.h; sourceTree = "<group>"; }; 00B48E052C213CCD001E4872 /* FUSSettingInitDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSSettingInitDataModel.h; sourceTree = "<group>"; };
00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSSettingInitDataModel.m; sourceTree = "<group>"; }; 00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSSettingInitDataModel.m; sourceTree = "<group>"; };
00B8649F2C2AF52B0061F6FF /* FuSiLive.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FuSiLive.entitlements; sourceTree = "<group>"; }; 00B8649F2C2AF52B0061F6FF /* FuSiLive.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FuSiLive.entitlements; sourceTree = "<group>"; };
00CABAC52C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FFHomeListNovaListCollectionViewSmallCell.h; sourceTree = "<group>"; };
00CABAC62C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FFHomeListNovaListCollectionViewSmallCell.m; sourceTree = "<group>"; };
00CABAC82C32BD8700D269B7 /* img_novaList_cell_new_animation.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = img_novaList_cell_new_animation.webp; sourceTree = "<group>"; };
6DFACA8A2DF329F3E7F7B2FF /* Pods-FuSiLive.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FuSiLive.debug.xcconfig"; path = "Target Support Files/Pods-FuSiLive/Pods-FuSiLive.debug.xcconfig"; sourceTree = "<group>"; }; 6DFACA8A2DF329F3E7F7B2FF /* Pods-FuSiLive.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FuSiLive.debug.xcconfig"; path = "Target Support Files/Pods-FuSiLive/Pods-FuSiLive.debug.xcconfig"; sourceTree = "<group>"; };
AD8AA4E093E761AA637769AD /* Pods-FuSiLive.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FuSiLive.release.xcconfig"; path = "Target Support Files/Pods-FuSiLive/Pods-FuSiLive.release.xcconfig"; sourceTree = "<group>"; }; AD8AA4E093E761AA637769AD /* Pods-FuSiLive.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-FuSiLive.release.xcconfig"; path = "Target Support Files/Pods-FuSiLive/Pods-FuSiLive.release.xcconfig"; sourceTree = "<group>"; };
BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSLiveFunctionViewHalfWebManager.swift; sourceTree = "<group>"; }; BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FUSLiveFunctionViewHalfWebManager.swift; sourceTree = "<group>"; };
...@@ -3901,6 +3906,7 @@ ...@@ -3901,6 +3906,7 @@
00A36A462C1D89AF004D28FA /* NovaList */ = { 00A36A462C1D89AF004D28FA /* NovaList */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
00CABAC42C32A25000D269B7 /* cell */,
00A36A4F2C1D8A55004D28FA /* Model */, 00A36A4F2C1D8A55004D28FA /* Model */,
00A36A4B2C1D8A1C004D28FA /* ViewModel */, 00A36A4B2C1D8A1C004D28FA /* ViewModel */,
00A36A4A2C1D8A16004D28FA /* View */, 00A36A4A2C1D8A16004D28FA /* View */,
...@@ -3939,6 +3945,15 @@ ...@@ -3939,6 +3945,15 @@
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
00CABAC42C32A25000D269B7 /* cell */ = {
isa = PBXGroup;
children = (
00CABAC52C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.h */,
00CABAC62C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.m */,
);
path = cell;
sourceTree = "<group>";
};
BE0395B82C132E0F003EB21B /* include */ = { BE0395B82C132E0F003EB21B /* include */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -8611,6 +8626,7 @@ ...@@ -8611,6 +8626,7 @@
BEDC66462C09DAE700505F76 /* live_link_micro_request_14.png */, BEDC66462C09DAE700505F76 /* live_link_micro_request_14.png */,
BEDC66472C09DAE700505F76 /* live_linkmic_bgImg.png */, BEDC66472C09DAE700505F76 /* live_linkmic_bgImg.png */,
BEDC66482C09DAE700505F76 /* live_treasure_box_bg_img.png */, BEDC66482C09DAE700505F76 /* live_treasure_box_bg_img.png */,
00CABAC82C32BD8700D269B7 /* img_novaList_cell_new_animation.webp */,
); );
path = live; path = live;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -8933,6 +8949,7 @@ ...@@ -8933,6 +8949,7 @@
00A0C5632C2676010044A41D /* FUSLoginPhoneViewController.xib in Resources */, 00A0C5632C2676010044A41D /* FUSLoginPhoneViewController.xib in Resources */,
BEDC6F0A2C09DAE800505F76 /* Firefly_Chinese.strings in Resources */, BEDC6F0A2C09DAE800505F76 /* Firefly_Chinese.strings in Resources */,
BEDC6ED72C09DAE800505F76 /* dew_sky_award_1.png in Resources */, BEDC6ED72C09DAE800505F76 /* dew_sky_award_1.png in Resources */,
00CABAC92C32BD8700D269B7 /* img_novaList_cell_new_animation.webp in Resources */,
BEDC6F372C09DAE900505F76 /* box_00008.png in Resources */, BEDC6F372C09DAE900505F76 /* box_00008.png in Resources */,
BEDC6F4E2C09DAE900505F76 /* live_link_micro_request_14.png in Resources */, BEDC6F4E2C09DAE900505F76 /* live_link_micro_request_14.png in Resources */,
BED0FBAE2C0C49CA0017B285 /* FUSChatSettingHeaderView.xib in Resources */, BED0FBAE2C0C49CA0017B285 /* FUSChatSettingHeaderView.xib in Resources */,
...@@ -9507,6 +9524,7 @@ ...@@ -9507,6 +9524,7 @@
BED0F8B92C0C49C80017B285 /* FUSBaoFangControllerHelper.m in Sources */, BED0F8B92C0C49C80017B285 /* FUSBaoFangControllerHelper.m in Sources */,
00A2D4A62C1AEFBF00A15ECA /* FUSTopRightBadgeButton.m in Sources */, 00A2D4A62C1AEFBF00A15ECA /* FUSTopRightBadgeButton.m in Sources */,
BED0FB732C0C49CA0017B285 /* FUSExchangeDewModel.m in Sources */, BED0FB732C0C49CA0017B285 /* FUSExchangeDewModel.m in Sources */,
00CABAC72C32A25A00D269B7 /* FFHomeListNovaListCollectionViewSmallCell.m in Sources */,
BE0398302C134566003EB21B /* AnimationFontProvider.swift in Sources */, BE0398302C134566003EB21B /* AnimationFontProvider.swift in Sources */,
BED0F9AD2C0C49C90017B285 /* FUSVideoChatStateView.m in Sources */, BED0F9AD2C0C49C90017B285 /* FUSVideoChatStateView.m in Sources */,
00A44A5D2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m in Sources */, 00A44A5D2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m in Sources */,
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_list_vchat_remark_star_half@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_list_vchat_remark_star_half@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_list_vchat_remark_star_light@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_list_vchat_remark_star_light@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_list_vchat_remark_star_whole_gray@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_list_vchat_remark_star_whole_gray@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "home_nova_list_previewMark_icon@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "home_nova_list_previewMark_icon@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -21,41 +21,45 @@ ...@@ -21,41 +21,45 @@
-(void)fus_pushToServiceControllerWithUID:(NSString *)uid face:(NSString *)facePath nikename:(NSString *)nikename welcome:(NSString *)welcomeStr animate:(BOOL)animate{ -(void)fus_pushToServiceControllerWithUID:(NSString *)uid face:(NSString *)facePath nikename:(NSString *)nikename welcome:(NSString *)welcomeStr animate:(BOOL)animate{
UIViewController *vc = nil; UIViewController *vc = nil;
FUSSingleChatViewController *serviceChat = [[FUSSingleChatViewController alloc] initWithUID:![NSString isNull:uid] ? uid : @(SERVEICE_UID).stringValue face:facePath nikename:nikename];
serviceChat.isServiceAccount = YES; // 测试原生客服
if (![NSString isNull:welcomeStr]) { // FUSSingleChatViewController *serviceChat = [[FUSSingleChatViewController alloc] initWithUID:![NSString isNull:uid] ? uid : @(SERVEICE_UID).stringValue face:facePath nikename:nikename];
serviceChat.welcomeStr = welcomeStr;
}
vc = serviceChat;
// if ([FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.model == 1) {
//
// if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
//
// FUSSingleChatViewController *serviceChat = [[FUSSingleChatViewController alloc] initWithUID:uid ? uid : @(SERVEICE_UID).stringValue face:facePath nikename:nikename];
// serviceChat.isServiceAccount = YES; // serviceChat.isServiceAccount = YES;
// if (![NSString isNull:welcomeStr]) { // if (![NSString isNull:welcomeStr]) {
// serviceChat.welcomeStr = welcomeStr; // serviceChat.welcomeStr = welcomeStr;
// } // }
// vc = serviceChat; // vc = serviceChat;
// } else {
// // 普通调起客服流程
// FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init]; if ([FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.model == 1) {
// NSString *webURL = FUSLocalizationHelper.isArbicLanguage ? URL_WEB_ARBIC_HELP : URL_WEB_HELP;
// webVC.webUrlString = [NSString stringWithFormat:@"%@?lang=%@", webURL,FUSLocalizationHelper.fus_currentLanguage.languageID]; if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
// vc = webVC;
// } FUSSingleChatViewController *serviceChat = [[FUSSingleChatViewController alloc] initWithUID:uid ? uid : @(SERVEICE_UID).stringValue face:facePath nikename:nikename];
// }else if ([FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.model == 2) { serviceChat.isServiceAccount = YES;
// if (![NSString isNull:welcomeStr]) {
// FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init]; serviceChat.welcomeStr = welcomeStr;
// NSString *webURL = [FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.url; }
// webVC.webUrlString = [NSString stringWithFormat:@"%@?lang=%@", webURL,FUSLocalizationHelper.fus_currentLanguage.languageID]; vc = serviceChat;
// vc = webVC; } else {
// }
// NSArray *viewControllers = self.viewControllers; FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init];
// UIViewController *viewVC = [viewControllers lastObject]; NSString *webURL = FUSLocalizationHelper.isArbicLanguage ? URL_WEB_ARBIC_HELP : URL_WEB_HELP;
// if ([viewVC isKindOfClass:[FUSSingleChatViewController class]]){ webVC.webUrlString = [NSString stringWithFormat:@"%@?lang=%@", webURL,FUSLocalizationHelper.fus_currentLanguage.languageID];
// return; vc = webVC;
// } }
}else if ([FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.model == 2) {
FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init];
NSString *webURL = [FUSCacheDataShare shareStore].settingInitDataModel.kfConfig.url;
webVC.webUrlString = [NSString stringWithFormat:@"%@?lang=%@", webURL,FUSLocalizationHelper.fus_currentLanguage.languageID];
vc = webVC;
}
NSArray *viewControllers = self.viewControllers;
UIViewController *viewVC = [viewControllers lastObject];
if ([viewVC isKindOfClass:[FUSSingleChatViewController class]]){
return;
}
[self pushViewController:vc animated:YES]; [self pushViewController:vc animated:YES];
} }
......
...@@ -12,8 +12,14 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -12,8 +12,14 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSLiveStateAnimationView : UIImageView @interface FUSLiveStateAnimationView : UIImageView
/// // 房间类型(0:视频直播房、2:聊天直播房,) /// 直播状态(0:未在直播、1:视频直播中、2:语音直播中)
@property (nonatomic, assign) NSInteger roomType; @property (nonatomic, assign) NSInteger liveState;
/// 視訊状态(-1:離線中、0:空閒中、2:視訊中)
@property (nonatomic, assign) NSInteger videoState;
/// 高亮时开始播放动画
@property (nonatomic, assign) BOOL startAnimWhenHighlighted;
@end @end
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
// 聊天室动画 // 聊天室动画
@property (nonatomic, strong) NSMutableArray<UIImage *> *chatingRoomLivingAniImageArr; @property (nonatomic, strong) NSMutableArray<UIImage *> *chatingRoomLivingAniImageArr;
/// 空闲
@property (nonatomic, strong) NSMutableArray<UIImage *> *watingAniImageArr;
/// 当前动画状态 /// 当前动画状态
@property (nonatomic, assign) BOOL currentAnimate; @property (nonatomic, assign) BOOL currentAnimate;
...@@ -36,6 +39,8 @@ ...@@ -36,6 +39,8 @@
{ {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
_liveState = 0;
_videoState = -1;
[self fus_createUI]; [self fus_createUI];
} }
return self; return self;
...@@ -47,6 +52,15 @@ ...@@ -47,6 +52,15 @@
self.currentAnimate = NO; self.currentAnimate = NO;
} }
- (void)setHighlighted:(BOOL)highlighted
{
[super setHighlighted:highlighted];
if (self.startAnimWhenHighlighted) {
[self startAnimating];
}
}
- (void)startAnimating{ - (void)startAnimating{
[super startAnimating]; [super startAnimating];
self.currentAnimate = YES; self.currentAnimate = YES;
...@@ -57,19 +71,36 @@ ...@@ -57,19 +71,36 @@
self.currentAnimate = NO; self.currentAnimate = NO;
} }
-(void)fus_reloadAnimateState{
#pragma mark --- getter and setter self.hidden = NO;
- (void)setRoomType:(NSInteger)roomType{
_roomType = roomType;
[super stopAnimating]; [super stopAnimating];
if (roomType == 2) { if (_liveState) {
self.animationImages = self.livingAniImage;
}else if (_videoState == -1){
self.hidden = YES;
}else if (_videoState == 0) {
self.animationImages = self.watingAniImageArr;
}else if (_videoState == 2){
self.animationImages = self.chatingRoomLivingAniImageArr; self.animationImages = self.chatingRoomLivingAniImageArr;
}else { }else {
self.animationImages = self.livingAniImage; self.hidden = YES;
} }
if (!self.hidden) {
if (self.currentAnimate) { if (self.currentAnimate) {
[super startAnimating]; [super startAnimating];
} }
}
}
#pragma mark --- getter and setter
- (void)setLiveState:(NSInteger)liveState{
_liveState = liveState;
[self fus_reloadAnimateState];
}
- (void)setVideoState:(NSInteger)videoState{
_videoState = videoState;
[self fus_reloadAnimateState];
} }
- (NSMutableArray *)livingAniImage { - (NSMutableArray *)livingAniImage {
...@@ -102,4 +133,18 @@ ...@@ -102,4 +133,18 @@
return _chatingRoomLivingAniImageArr; return _chatingRoomLivingAniImageArr;
} }
- (NSMutableArray<UIImage *> *)watingAniImageArr{
if (!_watingAniImageArr) {
_watingAniImageArr = [[NSMutableArray alloc] init];
for (int i = 0; i < 17; i ++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"baofang_icon_video_onlive_%d",i]];
if (image) {
[_watingAniImageArr addObject:image];
}
}
}
return _watingAniImageArr;
}
@end @end
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
if ([model.haveMC integerValue] == 1) { if ([model.haveMC integerValue] == 1) {
self.liveStateView.hidden = NO; self.liveStateView.hidden = NO;
[self.liveStateView startAnimating]; [self.liveStateView startAnimating];
self.liveStateView.roomType = 0; self.liveStateView.liveState = 1;
}else { }else {
self.liveStateView.hidden = YES; self.liveStateView.hidden = YES;
} }
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import "FUSCacheDataShare.h" #import "FUSCacheDataShare.h"
#import "FUSBaoFangHttpHelper.h" #import "FUSBaoFangHttpHelper.h"
#import "FUSControllerPushHelper.h"
#import "FUSZhaiXinSettingPopView.h"
// 导入通知框架 // 导入通知框架
#import <UserNotifications/UserNotifications.h> #import <UserNotifications/UserNotifications.h>
...@@ -165,6 +167,8 @@ ...@@ -165,6 +167,8 @@
[notificationRemindCloseBtn addTarget:self action:@selector(fus_notificationRemindCloseBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [notificationRemindCloseBtn addTarget:self action:@selector(fus_notificationRemindCloseBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[notificationOpenBtn addTarget:self action:@selector(fus_notificationOpenBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [notificationOpenBtn addTarget:self action:@selector(fus_notificationOpenBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.serviceBtn addTarget:self action:@selector(fus_serviceBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.settingBtn addTarget:self action:@selector(fus_settingBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
} }
-(void)fus_createMessageColumn{ -(void)fus_createMessageColumn{
...@@ -310,6 +314,12 @@ ...@@ -310,6 +314,12 @@
} }
#pragma mark --- button did clicked #pragma mark --- button did clicked
-(void)fus_serviceBtnDidClicked:(UIButton *)btn{
[self.parentController.navigationController fus_pushToServiceControllerWithAnimate:YES];
}
-(void)fus_settingBtnDidClicked:(UIButton *)btn{
[FUSZhaiXinSettingPopView fus_showFUSZhaiXinSettingPopView];
}
-(void)fus_notificationRemindCloseBtnDidClicked:(UIButton *)btn{ -(void)fus_notificationRemindCloseBtnDidClicked:(UIButton *)btn{
self.notificationRemindView.hidden = YES; self.notificationRemindView.hidden = YES;
self.isUserCloseNotificationRemind = YES; self.isUserCloseNotificationRemind = YES;
......
...@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSHomeAnchorListSmallCell : FUSBaofangBaseHomeLiveCell @interface FUSHomeAnchorListSmallCell : FUSBaofangBaseHomeLiveCell
/// 赋值这个的话就会变成新星模式 /// 赋值这个的话就会变成新星模式
@property (nonatomic, strong) FUSHomeNovaListModel *novaModel; //@property (nonatomic, strong) FUSHomeNovaListModel *novaModel;
@end @end
......
...@@ -107,19 +107,19 @@ ...@@ -107,19 +107,19 @@
} }
#pragma mark --- getter and setter #pragma mark --- getter and setter
- (void)setNovaModel:(FUSHomeNovaListModel *)novaModel{ //- (void)setNovaModel:(FUSHomeNovaListModel *)novaModel{
_novaModel = novaModel; // _novaModel = novaModel;
//
self.nickNameLabel.text = novaModel.nickname; // self.nickNameLabel.text = novaModel.nickname;
if ([NSString isNull:novaModel.addr]) { // if ([NSString isNull:novaModel.addr]) {
self.locationBtn.hidden = YES; // self.locationBtn.hidden = YES;
}else { // }else {
self.locationBtn.hidden = NO; // self.locationBtn.hidden = NO;
[self.locationBtn setTitle:novaModel.addr forState:UIControlStateNormal]; // [self.locationBtn setTitle:novaModel.addr forState:UIControlStateNormal];
} // }
self.hotNumBtn.hidden = YES; // self.hotNumBtn.hidden = YES;
[self.bgImageView setWebImageWithSubURLString:novaModel.cover placeholder:[UIImage fus_defaultIcon]]; // [self.bgImageView setWebImageWithSubURLString:novaModel.cover placeholder:[UIImage fus_defaultIcon]];
} //}
- (void)setModel:(FUSBaoFangAnchorModel *)model{ - (void)setModel:(FUSBaoFangAnchorModel *)model{
[super setModel:model]; [super setModel:model];
......
...@@ -124,31 +124,6 @@ ...@@ -124,31 +124,6 @@
[self.serviceBtn addTarget:self action:@selector(fus_serviceBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.serviceBtn addTarget:self action:@selector(fus_serviceBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.rankBtn addTarget:self action:@selector(fus_rankBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.rankBtn addTarget:self action:@selector(fus_rankBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
// CGFloat btn_w = 40;
//
// //右按钮,皇冠
// _rightBtn = [UIButton buttonWithType:UIButtonTypeCustom];
// _rightBtn.frame = CGRectMake(self.segmentView.width - btn_w, 0, btn_w, btn_w);
//
// YYAnimatedImageView *boardBtnImgView = [[YYAnimatedImageView alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
// boardBtnImgView.image = [HomeListBundle themeFestivalImageWebpNamed:@"img_roomlist_board_animation"];
//
// [_rightBtn addSubview:boardBtnImgView];
// boardBtnImgView.center = CGPointMake(_rightBtn.width/2, _rightBtn.height/2);
//
// [_rightBtn addTarget:self action:@selector(pushBoardViewController) forControlEvents:UIControlEventTouchUpInside];
// _rightBtn.contentMode = UIViewContentModeCenter;
// [self.segmentView addSubview:_rightBtn];
//
// self.serviceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
// self.serviceBtn.frame = CGRectMake(_rightBtn.left - btn_w, _rightBtn.top, btn_w, btn_w);
// [self.serviceBtn setImage:[FFViewSetBundle animatedImageFor:@"service_icon_" duration:1.5] forState:UIControlStateNormal];
// [self.segmentView addSubview:self.serviceBtn];
// [self.serviceBtn.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
// make.size.mas_equalTo(CGSizeMake(26, 26));
// }];
// [self.serviceBtn addTarget:self action:@selector(pushServiceViewController) forControlEvents:UIControlEventTouchUpInside];
} }
-(void)ffsetupBroadcastView{ -(void)ffsetupBroadcastView{
...@@ -276,6 +251,15 @@ ...@@ -276,6 +251,15 @@
[self.navView addSubview:titleLabel]; [self.navView addSubview:titleLabel];
} }
#pragma mark --------- method
-(void)ffreloadFollowAllStatus{
if (self.segmentIndex == 0) {
self.followAllBtn.enabled = !self.timeSortView.isFollowAll;
}else if (self.segmentIndex == 1) {
self.followAllBtn.enabled = !self.hotSortView.isFollowAll;
}
}
#pragma mark --- button did clicked #pragma mark --- button did clicked
-(void)fus_serviceBtnDidClicked:(UIButton *)btn{ -(void)fus_serviceBtnDidClicked:(UIButton *)btn{
[self.navigationController fus_pushToServiceControllerWithAnimate:YES]; [self.navigationController fus_pushToServiceControllerWithAnimate:YES];
...@@ -290,60 +274,6 @@ ...@@ -290,60 +274,6 @@
} }
#pragma mark --------- method
-(void)ffreloadFollowAllStatus{
if (self.segmentIndex == 0) {
self.followAllBtn.enabled = !self.timeSortView.isFollowAll;
}else if (self.segmentIndex == 1) {
self.followAllBtn.enabled = !self.hotSortView.isFollowAll;
}
}
#pragma mark --------- button did clicked
//-(void)pushServiceViewController{
// UIViewController *vc = [Bifrost handleURL:SingleChatRoute.serviceChatVC];
// [self.navigationController pushViewController:vc animated:YES];
//}
//
///**
// push榜单控制器
// */
//- (void)pushBoardViewController {
//
// FFWebViewController *boardVc = [[FFWebViewController alloc] init];
//
// UIView *loadingView = [boardVc.webView fus_showLoadingWithType:FFloadingTypeGrayColor];
// boardVc.webView.loadingStateChangedHandler = ^(BOOL isLoading, BOOL isSucceed) {
// if (!isLoading) {
// [loadingView fus_hideLoading];
// }
// };
//
// if (!BFModule(CommonService).application.checkVersionStatus) {
// boardVc.webUrlString = FFWebURL.checkBoardUrl;
// } else {
//
// NSString *liveBoardUrl = [NSString stringWithFormat:@"%@?isSpecialUser=%d",FFHomeListWebUrl.liveBoardUrl,BFModule(CommonService).oc_settingConfig.specialUserMark];
// boardVc.webUrlString = liveBoardUrl;
// }
//
// boardVc.hideWebTitleBar = YES;
// boardVc.hidesBottomBarWhenPushed = YES;
// [self.navigationController pushViewController:boardVc animated:YES];
// if (!BFModule(CommonService).application.checkVersionStatus) {
// __weak typeof(boardVc) weakBoardVc = boardVc;
// boardVc.webView.loadingStateChangedHandler = ^(BOOL isLoading, BOOL isSucceed) {
//
// if (!isSucceed) {
// return;
// }
//
// weakBoardVc.closeBtn.hidden = YES;
// weakBoardVc.showBackBtn = NO;
// };
// }
//}
-(void)follwAllBtnDidClicked:(UIButton *)btn{ -(void)follwAllBtnDidClicked:(UIButton *)btn{
if (self.segmentIndex == 0) { if (self.segmentIndex == 0) {
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#import "FUSHomeNovaListCollectionView.h" #import "FUSHomeNovaListCollectionView.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import "FUSHomeAnchorListSmallCell.h" #import "FFHomeListNovaListCollectionViewSmallCell.h"
#import "FUSDefine.h" #import "FUSDefine.h"
#import "FUSBaoFangHttpHelper.h" #import "FUSBaoFangHttpHelper.h"
#import <YYKit/YYKit.h> #import <YYKit/YYKit.h>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
make.edges.equalTo(self); make.edges.equalTo(self);
}]; }];
[self.collectionView registerClass:[FUSHomeAnchorListSmallCell class] forCellWithReuseIdentifier:@"FUSHomeAnchorListSmallCell"]; [self.collectionView registerClass:[FFHomeListNovaListCollectionViewSmallCell class] forCellWithReuseIdentifier:@"FFHomeListNovaListCollectionViewSmallCell"];
FUSWeakSelf(weakself); FUSWeakSelf(weakself);
self.collectionView.mj_header = [FUSRefreshHeader headerWithRefreshingBlock:^{ self.collectionView.mj_header = [FUSRefreshHeader headerWithRefreshingBlock:^{
...@@ -176,7 +176,7 @@ ...@@ -176,7 +176,7 @@
self.followAllStatusDidChange(); self.followAllStatusDidChange();
} }
} failure:^(NSString *msg, int code) { } failure:^(NSString *msg, int code) {
[FUSLoadingView fus_showProgressViewWithMessage:msg]; [FUSDialogView fus_showDialog:msg];
[self.collectionView.mj_header endRefreshing]; [self.collectionView.mj_header endRefreshing];
[self.collectionView.mj_footer endRefreshing]; [self.collectionView.mj_footer endRefreshing];
}]; }];
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
} }
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{ - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
FUSHomeAnchorListSmallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FUSHomeAnchorListSmallCell" forIndexPath:indexPath]; FFHomeListNovaListCollectionViewSmallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"FFHomeListNovaListCollectionViewSmallCell" forIndexPath:indexPath];
cell.novaModel = self.dataSourceList[indexPath.row]; cell.novaModel = self.dataSourceList[indexPath.row];
return cell; return cell;
} }
......
//
// FFHomeListNovaListCollectionViewSmallCell.h
// HomeList
//
// Created by aaa on 2024/3/21.
//
// 这个是新星最小的cell
#import <UIKit/UIKit.h>
#import "FUSHomeNovaListModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface FFHomeListNovaListCollectionViewSmallCell : UICollectionViewCell
@property (nonatomic, strong) FUSHomeNovaListModel *novaModel;
@end
NS_ASSUME_NONNULL_END
//
// FFHomeListNovaListCollectionViewSmallCell.m
// HomeList
//
// Created by aaa on 2024/3/21.
//
#import "FFHomeListNovaListCollectionViewSmallCell.h"
#import "FUSImageMessageView.h"
#import "FUSLiveStateAnimationView.h"
#define gray_color [UIColor hexColor:@"ffffff" alpha:1]
#define topIcon_mask_top 10
@interface FFHomeListNovaListCollectionViewSmallCell ()
@property (nonatomic, strong) UILabel *nikeName; //用户名
@property (nonatomic, strong) UIImageView *defaultImageView; //默认图
@property (nonatomic, strong) UIImageView *bgImageView; //用户图
@property (nonatomic, strong) NSMutableDictionary *levelDict; //等级字典
@property (nonatomic, strong) FUSImageMessageView *addressView; //主播地址
@property (nonatomic, strong) UIImageView *topAlphaBgView; //顶部的阴影View
@property (nonatomic, strong) UIImageView *bottomAlphaBgView; //底部的阴影View
@property (nonatomic, strong) FUSLiveStateAnimationView *onLiveAnimateView; //在线动画
@property (nonatomic, strong) UILabel *offTimeLabel; //上次在线时间
@property (nonatomic, strong) UILabel *onlineLabel; //online的label
@property (nonatomic, strong) UIView *liveStatusBgView; //在线的状态的背景View
// 已验证的按钮
@property (nonatomic, strong) UIButton *verifiedBtn;
@property (nonatomic, strong) UIView *bgView;
#pragma mark - 评分
// credit
@property (nonatomic, strong) UILabel *creditLabel;
@property (nonatomic, strong) UILabel *remarkLabel;
@property (nonatomic, strong) UIView *starBgView;
@property (nonatomic, strong) NSMutableArray *starImageViews;
// 显示年龄的btn
@property (nonatomic, strong) UIButton *ageBtn;
// 显示身高的label
@property (nonatomic, strong) UILabel *heightLabel;
// 显示体重的label
@property (nonatomic, strong) UILabel *weightLabel;
// 用户签名的label
@property (nonatomic, strong) UILabel *signLabel;
/// 新主播的标识(不要怀疑为什么不是new)
@property (nonatomic, strong) YYAnimatedImageView *niwImageView;
/// 预约了的主播标志
@property (nonatomic, strong) UIImageView *previewMarkImageView;
@end
@implementation FFHomeListNovaListCollectionViewSmallCell
- (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if (self) {
self.backgroundColor = [UIColor whiteColor];
// self.layer.cornerRadius = 4;
self.layer.masksToBounds = YES;
[self.contentView addSubview:self.defaultImageView];
[self.defaultImageView addSubview:self.bgImageView];
[self.contentView addSubview:self.liveStatusBgView];
[self.contentView addSubview:self.onLiveAnimateView];
[self.contentView addSubview:self.nikeName];
[self.contentView addSubview:self.onlineLabel];
[self.contentView addSubview:self.offTimeLabel];
[self.bgImageView addSubview:self.topAlphaBgView];
[self.bgImageView addSubview:self.bottomAlphaBgView];
[self.contentView addSubview:self.addressView];
[self.contentView addSubview:self.verifiedBtn];
[self.contentView addSubview:self.ageBtn];
[self.contentView addSubview:self.heightLabel];
[self.contentView addSubview:self.weightLabel];
[self.contentView addSubview:self.signLabel];
[self.contentView addSubview:self.niwImageView];
[self.contentView addSubview:self.previewMarkImageView];
if (![FUSConfig sharedInstanced].devConfigs.appStatus) {
[self.contentView addSubview:self.addressView];
[self.contentView addSubview:self.verifiedBtn];
}
[self initUI];
}
return self;
}
- (void)setHighlighted:(BOOL)highlighted{
[super setHighlighted:highlighted];
[self.onLiveAnimateView startAnimating];
}
- (void)initUI{
if (![FUSConfig sharedInstanced].devConfigs.appStatus) return;
_remarkLabel = [[UILabel alloc] init];
_remarkLabel.font = [UIFont fus_themeFont:9];
_remarkLabel.textColor = [UIColor colorWithHex:@"#53B9F3" alpha:1];
[self.contentView addSubview:_remarkLabel];
self.creditLabel = [[UILabel alloc] init];
self.creditLabel.font = [UIFont fus_themeFont:9];
self.creditLabel.text = [NSString fus_versionLocalString:@"Credit"];
self.creditLabel.textColor = [UIColor colorWithHex:@"#53B9F3" alpha:1];
[self.creditLabel sizeToFit];
[self.contentView addSubview:self.creditLabel];
_starBgView = [[UIView alloc] initWithFrame:CGRectMake(self.width - self.width*0.3, self.height - 15, self.width*0.3, 8)];
[self.contentView addSubview:_starBgView];
_starImageViews = [NSMutableArray array];
for (int i = 0; i < 5; i ++) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake((_starBgView.height+2)*i, 0, _starBgView.height, _starBgView.height)];
imageView.contentMode = UIViewContentModeScaleAspectFit;
[_starBgView addSubview:imageView];
[_starImageViews addObject:imageView];
}
_starBgView.width = _starBgView.height*5 + 2*4;
[[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)fus_enterLiveRoom {
[self.onLiveAnimateView stopAnimating];
}
- (void)fus_quickLiveRoom {
[self.onLiveAnimateView startAnimating];
}
#pragma mark - UI Layout
- (void)layout_contentViews{
//有时候切换layout时会出错,所以重新设置imageView的frame
self.defaultImageView.frame = CGRectMake(0, 0, self.width, self.width);
self.bgImageView.frame = CGRectMake(0, 0, self.width+1, self.width);
self.liveStatusBgView.y = topIcon_mask_top;
self.offTimeLabel.centerY = self.liveStatusBgView.centerY;
self.offTimeLabel.x = self.width - self.offTimeLabel.width - 10;
[self.nikeName sizeToFit];
self.nikeName.y = CGRectGetMaxY(self.bgImageView.frame) - self.nikeName.height - 8;
self.nikeName.x = 6;
self.nikeName.width = self.width - self.nikeName.x;
if (!self.ageBtn.isHidden) {
self.ageBtn.x = _nikeName.x;
self.ageBtn.y = topIcon_mask_top;
}
if (!self.heightLabel.isHidden) {
if (!self.ageBtn.isHidden) {
self.heightLabel.x = CGRectGetMaxX(self.ageBtn.frame) + 2;
} else {
self.heightLabel.x = _nikeName.x;
}
self.heightLabel.y = topIcon_mask_top;
}
if (!self.weightLabel.isHidden) {
if (!self.heightLabel.isHidden) {
self.weightLabel.x = CGRectGetMaxX(self.heightLabel.frame) + 2;
} else {
if (!self.ageBtn.isHidden) {
self.weightLabel.x = CGRectGetMaxX(self.ageBtn.frame) + 2;
} else {
self.weightLabel.x = _nikeName.x;
}
}
self.weightLabel.y = topIcon_mask_top;
}
//地址
self.addressView.frame = CGRectMake(self.nikeName.x, self.nikeName.y - self.addressView.height -4, self.addressView.width, self.addressView.height);
self.onlineLabel.centerY = self.liveStatusBgView.centerY;
self.onlineLabel.x = self.width - 15 - self.onlineLabel.width;
self.signLabel.x = _nikeName.x;
self.signLabel.width = self.width - self.signLabel.x * 2 - self.previewMarkImageView.width - 8;
self.signLabel.y = 28;
self.onLiveAnimateView.size = CGSizeMake(20, 15);
self.onLiveAnimateView.centerY = self.onlineLabel.centerY;
self.onLiveAnimateView.x = self.onlineLabel.x - 1 - self.onLiveAnimateView.width;
self.liveStatusBgView.width = self.onlineLabel.width + self.onLiveAnimateView.width + 10;
self.liveStatusBgView.centerX = self.onlineLabel.centerX - (self.onlineLabel.centerX - self.onLiveAnimateView.centerX)/2.0 + 5;
if ([FUSConfig sharedInstanced].devConfigs.appStatus) {
self.remarkLabel.centerY = self.nikeName.centerY;
self.remarkLabel.x = self.width - 10 - self.remarkLabel.width;
self.starBgView.centerY = self.remarkLabel.centerY;
self.starBgView.x = self.remarkLabel.x - 4 - self.starBgView.width;
self.creditLabel.centerY = self.remarkLabel.centerY;
self.creditLabel.x = self.starBgView.x - 4 - self.creditLabel.width;
self.verifiedBtn.x = CGRectGetMaxX(self.remarkLabel.frame) - self.verifiedBtn.width;
self.verifiedBtn.centerY = self.addressView.centerY;
if (!self.starBgView.hidden) {
self.nikeName.width = self.creditLabel.x - self.nikeName.x - 5;
if (!self.verifiedBtn.isHidden) {
self.addressView.maxWidth = self.verifiedBtn.x - self.addressView.x - 5;
}
} else {
if (!self.verifiedBtn.isHidden) {
self.verifiedBtn.centerY = self.nikeName.centerY;
self.nikeName.width = self.verifiedBtn.x - self.nikeName.x - 5;
}
}
}
self.niwImageView.right = self.width;
self.niwImageView.bottom = self.height;
self.previewMarkImageView.right = self.width - 8;
self.previewMarkImageView.top = self.onLiveAnimateView.bottom + 4;
[self.onLiveAnimateView startAnimating];
}
#pragma mark setter
- (void)setNovaModel:(FUSHomeNovaListModel *)model{
_novaModel = model;
if (![model isKindOfClass:[FUSHomeNovaListModel class]]) {
return;
}
//设置名字颜色
self.nikeName.text = model.nickname;
[self.nikeName sizeToFit];
//头像
FUSWeakSelf(weakSelf);
[self.bgImageView setWebImageWithSubURLString:model.cover placeholder:[UIImage fus_defaultIcon] completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
// 防止下载到图片的时候,cell已经被重用了
if (![url.absoluteString containsString:model.cover]) {
return;
}
if ([image isKindOfClass:[YYImage class]]) {
((YYImage *)image).preloadAllAnimatedImageFrames = YES;
}
weakSelf.bgImageView.image = image;
if (from != YYWebImageFromMemoryCache) {
weakSelf.bgImageView.alpha = 0;
[UIView animateWithDuration:0.1 animations:^{
weakSelf.bgImageView.alpha = 1;
}];
}
}];
self.onLiveAnimateView.hidden = NO;
self.onlineLabel.hidden = NO;
self.offTimeLabel.hidden = YES;
self.onlineLabel.textColor = [UIColor whiteColor];
self.liveStatusBgView.hidden = NO;
self.onLiveAnimateView.liveState = model.liveState;
self.onLiveAnimateView.videoState = model.videoState;
//直播中
if (model.liveState) {
// self.onLiveAnimateView.animationImages = UIImage.livingAnimatedImageArray;
self.onlineLabel.text = @"Live";
self.onlineLabel.textColor = [UIColor whiteColor];
//离线
}else if(model.videoState == -1){
// self.onLiveAnimateView.hidden = YES;
self.liveStatusBgView.hidden = YES;
self.onlineLabel.hidden = YES;
self.offTimeLabel.hidden = YES;
// self.offTimeLabel.text = model.offlineTime;
// [self.offTimeLabel sizeToFit];
//空闲
}else if(model.videoState == 0){
// self.onLiveAnimateView.animationImages = UIImage.waitingAnimatedImageArray;
self.onlineLabel.text = [NSString fus_versionLocalString:@"online"];
self.onlineLabel.textColor = [UIColor whiteColor];
//正在私聊中
}else if(model.videoState == 2){
// self.onLiveAnimateView.animationImages = UIImage.callingAnimatedImageArray;
self.onlineLabel.text = [NSString fus_versionLocalString:@"calling"];
self.onlineLabel.textColor = [UIColor colorWithHex:@"#3AC1FF" alpha:1];
}
[self.onlineLabel sizeToFit];
if (![FUSConfig sharedInstanced].devConfigs.appStatus
&& [model.addr isEqualToString:@"中國大陸"]) {
model.addr = @"香港";
}
//地址
if ([NSString isNullWithString:model.addr]) {
self.addressView.hidden = YES;
}else{
self.addressView.hidden = NO;
[self.addressView fus_setIcon:[UIImage imageNamed:@"BaoFang_icon_address"] title:model.addr];
}
//设置评分
[self fus_setStarCountWithMark:-1];
self.verifiedBtn.hidden = YES;
if (model.sex.integerValue == 0) {
[self.ageBtn setImage:[UIImage fus_girlIcon] forState:UIControlStateNormal];
self.ageBtn.layer.borderColor = [UIColor colorWithHex:@"#FFA3B9" alpha:1].CGColor;
[self.ageBtn setTitleColor:[UIColor colorWithHex:@"#FFA3B9" alpha:1] forState:UIControlStateNormal];
} else if (model.sex.integerValue == 1) {
[self.ageBtn setImage:[UIImage fus_boyIcon] forState:UIControlStateNormal];
self.ageBtn.layer.borderColor = [UIColor colorWithHex:@"#91BBFB" alpha:1].CGColor;
[self.ageBtn setTitleColor:[UIColor colorWithHex:@"#91BBFB" alpha:1] forState:UIControlStateNormal];
} else {
[self.ageBtn setImage:nil forState:UIControlStateNormal];
self.ageBtn.layer.borderColor = [UIColor colorWithHex:@"#e9c589" alpha:1].CGColor;
[self.ageBtn setTitleColor:[UIColor colorWithHex:@"#e9c589" alpha:1] forState:UIControlStateNormal];
}
self.ageBtn.width = 16;
if (model.age.integerValue > 0) {
[self.ageBtn setTitle:model.age forState:UIControlStateNormal];
self.ageBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 2);
self.ageBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 2, 0, 0);
self.ageBtn.hidden = NO;
if (model.sex.integerValue == 0 || model.sex.integerValue == 1) {
self.ageBtn.width = 30;
} else {
self.ageBtn.width = 25;
}
self.ageBtn.height = 16;
} else {
[self.ageBtn setTitle:@"" forState:UIControlStateNormal];
self.ageBtn.imageEdgeInsets = UIEdgeInsetsZero;
self.ageBtn.titleEdgeInsets = UIEdgeInsetsZero;
if (model.sex.integerValue == 0 || model.sex.integerValue == 1) {
self.ageBtn.hidden = NO;
} else {
self.ageBtn.hidden = YES;
}
}
if ([NSString isNullWithString:model.height]) {
self.heightLabel.hidden = YES;
} else {
self.heightLabel.hidden = NO;
self.heightLabel.text = [NSString stringWithFormat:@"%@cm",model.height];
[self.heightLabel sizeToFit];
self.heightLabel.height = 16;
self.heightLabel.width += 10;
}
if ([NSString isNullWithString:model.weight]) {
self.weightLabel.hidden = YES;
} else {
self.weightLabel.hidden = NO;
self.weightLabel.text = [NSString stringWithFormat:@"%@kg",model.weight];
[self.weightLabel sizeToFit];
self.weightLabel.height = 16;
self.weightLabel.width += 10;
}
if ([NSString isNullWithString:model.sign]) {
self.signLabel.hidden = YES;
} else {
self.signLabel.hidden = NO;
self.signLabel.text = model.sign;
[self.signLabel sizeThatFits:CGSizeMake(self.width - 12, MAXFLOAT)];
}
self.previewMarkImageView.hidden = model.previewLive == 0;
//布局
[self layout_contentViews];
if (![FUSConfig sharedInstanced].devConfigs.appStatus) {
self.offTimeLabel.hidden = YES;
self.starBgView.hidden = YES;
self.remarkLabel.hidden = YES;
self.addressView.hidden = YES;
}
}
- (void)fus_setStarCountWithMark:(CGFloat )mark{
if (mark > 0.0) {
self.creditLabel.hidden = NO;
_starBgView.hidden = NO;
_remarkLabel.hidden = NO;
}else{
self.creditLabel.hidden = YES;
_starBgView.hidden = YES;
_remarkLabel.hidden = YES;
return;
}
//整数
NSInteger integer = floor(mark);
//余数
CGFloat remainder = mark - integer;
if (remainder < 0.5) {
remainder = 0;
}
for (int i = 0; i < _starImageViews.count; i++) {
UIImageView *imageView = _starImageViews[i];
if (i < integer) {
imageView.image = [UIImage imageNamed:@"home_list_vchat_remark_star_light"];
}else{
imageView.image = [UIImage imageNamed:@"home_list_vchat_remark_star_whole_gray"];
}
}
if (remainder != 0 && integer < _starImageViews.count) {
UIImageView *imageView = _starImageViews[integer];
imageView.image = [[UIImage imageNamed:@"home_list_vchat_remark_star_half"] fusrtl_imageFlippedForRightToLeftLayoutDirection];
}
}
#pragma mark - getter
- (UILabel *)nikeName{
if (!_nikeName) {
_nikeName = [[UILabel alloc] initWithFrame:CGRectMake(2, self.defaultImageView.height+8, 10, 10)];
_nikeName.font = [UIFont fus_themeFont:13];
_nikeName.textAlignment = NSTextAlignmentLeft;
_nikeName.textColor = [UIColor whiteColor];
}
return _nikeName;
}
- (FUSImageMessageView *)addressView{
if (!_addressView) {
_addressView = [[FUSImageMessageView alloc] init];
_addressView.msgLb.font = [UIFont fus_themeFont:11];
[_addressView.msgLb sizeToFitAllScreen];
_addressView.msgLb.shadowOffset = CGSizeMake(0, 0);
_addressView.msgLb.textColor = [UIColor whiteColor];
}
return _addressView;
}
- (UIImageView *)defaultImageView{
if (!_defaultImageView) {
_defaultImageView= [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.width+5)];
_defaultImageView.image = [UIImage fus_defaultIcon];
_defaultImageView.clipsToBounds = YES;
_defaultImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:_defaultImageView];
}
return _defaultImageView;
}
- (UIImageView *)bgImageView{
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.width+1, self.width+5)];
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
_bgImageView.clipsToBounds = YES;
}
return _bgImageView;
}
- (FUSLiveStateAnimationView *)onLiveAnimateView{
if (!_onLiveAnimateView) {
_onLiveAnimateView = [[FUSLiveStateAnimationView alloc] initWithFrame:CGRectMake(self.width - 55, 0, 0, 0)];
_onLiveAnimateView.startAnimWhenHighlighted = YES;
_onLiveAnimateView.contentMode = UIViewContentModeScaleAspectFit;
_onLiveAnimateView.animationDuration = 1.0;
}
return _onLiveAnimateView;
}
- (UILabel *)offTimeLabel{
if (!_offTimeLabel) {
_offTimeLabel = [[UILabel alloc] init];
_offTimeLabel.font = [UIFont fus_themeFont:10];
_offTimeLabel.textColor = [UIColor whiteColor];
}
return _offTimeLabel;
}
- (NSMutableDictionary *)levelDict{
if (!_levelDict) {
_levelDict = [NSMutableDictionary dictionary];
}
return _levelDict;
}
- (UILabel *)onlineLabel{
if (!_onlineLabel) {
_onlineLabel = [[UILabel alloc] init];
_onlineLabel.text = [NSString fus_versionLocalString:@"Live"];
_onlineLabel.font = [UIFont fus_themeFont:10];
_onlineLabel.textColor = [UIColor whiteColor];
[_onlineLabel sizeToFit];
}
return _onlineLabel;
}
- (UIImageView *)topAlphaBgView{
if (!_topAlphaBgView) {
CGFloat height = self.bgImageView.width / 184.0f * 52.0f;
_topAlphaBgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.bgImageView.width, height)];
_topAlphaBgView.image = [UIImage imageNamed:@"baofang_video_list_top_mask"];
}
return _topAlphaBgView;
}
- (UIView *)bottomAlphaBgView{
if (!_bottomAlphaBgView) {
CGFloat height = self.bgImageView.width / 375.0f * 121.0f;
_bottomAlphaBgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, self.bgImageView.height - height, self.bgImageView.width, height)];
_bottomAlphaBgView.image = [UIImage imageNamed:@"baofang_video_list_bottom_mask"];
}
return _bottomAlphaBgView;
}
- (UIButton *)verifiedBtn {
if (!_verifiedBtn) {
_verifiedBtn = [UIButton buttonWithType:UIButtonTypeCustom];
_verifiedBtn.frame = CGRectMake(0, 0, 42, 13);
_verifiedBtn.userInteractionEnabled = NO;
[_verifiedBtn setBackgroundImage:[UIImage imageNamed:@"baofang_vchat_verified_img"] forState:UIControlStateNormal];
}
return _verifiedBtn;
}
- (UIView *)liveStatusBgView{
if (!_liveStatusBgView) {
_liveStatusBgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 16)];
_liveStatusBgView.layer.cornerRadius = _liveStatusBgView.height/2.0;
_liveStatusBgView.backgroundColor = [UIColor.blackColor colorWithAlphaComponent:0.3];
_liveStatusBgView.clipsToBounds = YES;
}
return _liveStatusBgView;
}
- (UIButton *)ageBtn {
if (!_ageBtn) {
_ageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
_ageBtn.titleLabel.font = [UIFont fus_themeFont:8];
_ageBtn.height = 16;
_ageBtn.x = 6;
_ageBtn.layer.cornerRadius = _ageBtn.height / 2;
_ageBtn.layer.masksToBounds = YES;
_ageBtn.layer.borderWidth = 1;
_ageBtn.userInteractionEnabled = NO;
_ageBtn.hidden = YES;
}
return _ageBtn;
}
- (UILabel *)heightLabel {
if (!_heightLabel) {
_heightLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 16, 16)];
_heightLabel.font = [UIFont fus_themeFont:8];
_heightLabel.textColor = [UIColor whiteColor];
_heightLabel.layer.cornerRadius = _heightLabel.height / 2.0f;
_heightLabel.layer.masksToBounds = YES;
_heightLabel.layer.borderWidth = 1;
_heightLabel.layer.borderColor = [UIColor whiteColor].CGColor;
_heightLabel.textAlignment = NSTextAlignmentCenter;
_heightLabel.hidden = YES;
}
return _heightLabel;
}
- (UILabel *)weightLabel {
if (!_weightLabel) {
_weightLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 16, 16)];
_weightLabel.font = [UIFont fus_themeFont:8];
_weightLabel.textColor = [UIColor whiteColor];
_weightLabel.layer.cornerRadius = _heightLabel.height / 2.0f;
_weightLabel.layer.masksToBounds = YES;
_weightLabel.layer.borderWidth = 1;
_weightLabel.layer.borderColor = [UIColor whiteColor].CGColor;
_weightLabel.textAlignment = NSTextAlignmentCenter;
_weightLabel.hidden = YES;
}
return _weightLabel;
}
- (UILabel *)signLabel {
if (!_signLabel) {
_signLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, 28)];
_signLabel.font = [UIFont fus_themeFont:10];
_signLabel.numberOfLines = 2;
_signLabel.textColor = [UIColor whiteColor];
_signLabel.hidden = YES;
}
return _signLabel;
}
- (UIImageView *)niwImageView{
if (!_niwImageView) {
_niwImageView = [[YYAnimatedImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 40)];
_niwImageView.contentMode = UIViewContentModeScaleAspectFit;
NSData *resourceData = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"img_novaList_cell_new_animation.webp" ofType:nil]];
YYImage *yyImage = [YYImage imageWithData:resourceData];
_niwImageView.image = yyImage;
}
return _niwImageView;
}
- (UIImageView *)previewMarkImageView{
if (!_previewMarkImageView) {
_previewMarkImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)];
_previewMarkImageView.contentMode = UIViewContentModeScaleAspectFit;
_previewMarkImageView.image = [UIImage imageNamed:@"home_nova_list_previewMark_icon"];
}
return _previewMarkImageView;
}
@end
...@@ -215,6 +215,13 @@ ...@@ -215,6 +215,13 @@
[zhaiXinModel fus_setValueWithModel:userInfo]; [zhaiXinModel fus_setValueWithModel:userInfo];
[zhaiXinModelArray addObject:zhaiXinModel]; [zhaiXinModelArray addObject:zhaiXinModel];
zhaiXinModel.typeId = [NSString stringWithFormat:@"%@%@",SINGLE_CHAT,fid]; zhaiXinModel.typeId = [NSString stringWithFormat:@"%@%@",SINGLE_CHAT,fid];
// ludy:这里为了兼容客服错乱,因为这个b东西,分为三个系统,客服页面发送是用socket,普通聊天页面发送是走寨信,然后显示又是另外一个系统。
// 这个地方是负责显示的,所以是需要让显示层的tableview知道,这一条是需要显示跟哪一个人说
// 由于最老的构架先天没有from uid 的设定,也就是没有from谁,那么这里的uid自然就得用来显示别人,毕竟总不能自己跟自己说话
if ([zhaiXinModel.uid isEqualToString:[FUSCacheDataShare shareStore].userDetailInfo.uid]) {
zhaiXinModel.uid = fid;
}
switch (socketModel.cid) { switch (socketModel.cid) {
case 2002: // 图片 case 2002: // 图片
zhaiXinModel.content = [NSString stringWithFormat:@"[%@]",FUSLocalizationHelper.localString(@"图片")]; zhaiXinModel.content = [NSString stringWithFormat:@"[%@]",FUSLocalizationHelper.localString(@"图片")];
......
...@@ -277,6 +277,8 @@ ...@@ -277,6 +277,8 @@
return NO; return NO;
} }
// FUSLogInfo(@"ludy[fus_writeMultiDataToZhaiXinInfosTableWithModelArray]:\n%@", [modelArray modelToJSONObject]);
return [FUSDBHelper fus_writeMultiModeToTableWithName:ZHAI_XIN_INFOS_TABLE modeArr:modelArray keyArray:keyArray]; return [FUSDBHelper fus_writeMultiModeToTableWithName:ZHAI_XIN_INFOS_TABLE modeArr:modelArray keyArray:keyArray];
} }
......
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