Commit 76827dc4 by ludi

完成新注册推荐,首页tag动画标识,接入客服,正在做原生客服兼容

parent 8ac63cb6
Showing with 430 additions and 56 deletions
...@@ -60,9 +60,9 @@ static dispatch_queue_t get_image_clip_queue(){ ...@@ -60,9 +60,9 @@ static dispatch_queue_t get_image_clip_queue(){
if ([urlString containsString:@"boy"] if ([urlString containsString:@"boy"]
|| [urlString containsString:@"girl"]) { || [urlString containsString:@"girl"]) {
[self cancelCurrentImageRequest]; [self cancelCurrentImageRequest];
self.image = [UIImage fus_ImageNamed:@"icon_baofang_cover_boy"]; self.image = [UIImage fus_defaultIcon];
if (completion) { if (completion) {
completion([UIImage fus_ImageNamed:@"icon_baofang_cover_boy"], completion([UIImage fus_defaultIcon],
[NSURL URLWithString:urlString], [NSURL URLWithString:urlString],
YYWebImageFromMemoryCacheFast, YYWebImageFromMemoryCacheFast,
YYWebImageStageFinished, YYWebImageStageFinished,
......
...@@ -204,6 +204,7 @@ static FUSAlertView *sharedAlertView = nil; ...@@ -204,6 +204,7 @@ static FUSAlertView *sharedAlertView = nil;
// [self.bgView addSubview:separatorView]; // [self.bgView addSubview:separatorView];
// [self.separatorArr addObject:separatorView]; // [self.separatorArr addObject:separatorView];
self.cancelBtn.hidden = NO;
// 只显示一行的情况 // 只显示一行的情况
CGFloat btnWholeH = BTN_HEIGHT; CGFloat btnWholeH = BTN_HEIGHT;
if ((self.confirmBtnArr.count == 1 || ([NSString isNull:self.cancelBtn.titleLabel.text]&&self.confirmBtnArr.count == 2)) if ((self.confirmBtnArr.count == 1 || ([NSString isNull:self.cancelBtn.titleLabel.text]&&self.confirmBtnArr.count == 2))
...@@ -211,6 +212,8 @@ static FUSAlertView *sharedAlertView = nil; ...@@ -211,6 +212,8 @@ static FUSAlertView *sharedAlertView = nil;
if (![NSString isNull:self.cancelBtn.titleLabel.text]) { if (![NSString isNull:self.cancelBtn.titleLabel.text]) {
[self.confirmBtnArr insertObject:self.cancelBtn atIndex:0]; [self.confirmBtnArr insertObject:self.cancelBtn atIndex:0];
}else {
self.cancelBtn.hidden = YES;
} }
CGFloat btnWholeW = alertViewW - btnX * 2 - itemSpace * (self.confirmBtnArr.count - 1); CGFloat btnWholeW = alertViewW - btnX * 2 - itemSpace * (self.confirmBtnArr.count - 1);
......
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
// 设置默认视图底色 // 设置默认视图底色
self.view.backgroundColor = UIColor.fus_appBGColor; self.view.backgroundColor = UIColor.fus_appBGColor;
self.backBtnStyle = FUSNavigationBackBtnStyleBlack; self.backBtnStyle = FUSNavigationBackBtnStyleBlack;
_animated = YES;
// 初始化导航栏 // 初始化导航栏
[self initBaseNavigation]; [self initBaseNavigation];
......
...@@ -57,11 +57,11 @@ ...@@ -57,11 +57,11 @@
_emptyContentBgView = [[UIView alloc] init]; _emptyContentBgView = [[UIView alloc] init];
_emptyButton = [[FUSStyleButton alloc] init]; _emptyButton = [[FUSStyleButton alloc] init];
_emptyButton.style = FUSButtonStyleBlueBorder; _emptyButton.style = FUSButtonStyleBlue;
_emptyButton.hidden = YES; _emptyButton.hidden = YES;
_emptyButton.titleLabel.font = [UIFont fus_themeFont:15]; _emptyButton.titleLabel.font = [UIFont fus_themeFont:15];
[_emptyButton addTarget:self action:@selector(onClickEmptyButton) forControlEvents:UIControlEventTouchUpInside]; [_emptyButton addTarget:self action:@selector(onClickEmptyButton) forControlEvents:UIControlEventTouchUpInside];
[_emptyButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [_emptyButton setTitleColor:[UIColor fus_textColorRich] forState:UIControlStateNormal];
_emptyTitleLabel = [[YYLabel alloc] init]; _emptyTitleLabel = [[YYLabel alloc] init];
_emptyTitleLabel.textColor = [UIColor colorWithHex:@"#B3B3B3"]; _emptyTitleLabel.textColor = [UIColor colorWithHex:@"#B3B3B3"];
......
...@@ -363,7 +363,9 @@ ...@@ -363,7 +363,9 @@
} }
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: 暂时先改成这个,正式服使用上面那个
urlString = @"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))}];
......
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
00A44A5D2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A5C2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m */; }; 00A44A5D2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A5C2C2BC14E003FDF44 /* FUSSingleLiveRecordV2TableViewCell.m */; };
00A44A602C2C04FC003FDF44 /* FUSChatIntimacyV2View.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A5F2C2C04FC003FDF44 /* FUSChatIntimacyV2View.m */; }; 00A44A602C2C04FC003FDF44 /* FUSChatIntimacyV2View.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A5F2C2C04FC003FDF44 /* FUSChatIntimacyV2View.m */; };
00A44A632C2C4345003FDF44 /* FUSUserTradeRemindModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A622C2C4345003FDF44 /* FUSUserTradeRemindModel.m */; }; 00A44A632C2C4345003FDF44 /* FUSUserTradeRemindModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A44A622C2C4345003FDF44 /* FUSUserTradeRemindModel.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 */; };
BE02D73D2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */; }; BE02D73D2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE02D73C2C255ECA006FD462 /* FUSLiveFunctionViewHalfWebManager.swift */; };
...@@ -1492,6 +1493,8 @@ ...@@ -1492,6 +1493,8 @@
00A44A5F2C2C04FC003FDF44 /* FUSChatIntimacyV2View.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSChatIntimacyV2View.m; sourceTree = "<group>"; }; 00A44A5F2C2C04FC003FDF44 /* FUSChatIntimacyV2View.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSChatIntimacyV2View.m; sourceTree = "<group>"; };
00A44A612C2C4345003FDF44 /* FUSUserTradeRemindModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSUserTradeRemindModel.h; sourceTree = "<group>"; }; 00A44A612C2C4345003FDF44 /* FUSUserTradeRemindModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSUserTradeRemindModel.h; sourceTree = "<group>"; };
00A44A622C2C4345003FDF44 /* FUSUserTradeRemindModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSUserTradeRemindModel.m; sourceTree = "<group>"; }; 00A44A622C2C4345003FDF44 /* FUSUserTradeRemindModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSUserTradeRemindModel.m; sourceTree = "<group>"; };
00A452992C2FEDB2004EC526 /* FUSControllerPushHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSControllerPushHelper.h; sourceTree = "<group>"; };
00A4529A2C2FEDB2004EC526 /* FUSControllerPushHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSControllerPushHelper.m; sourceTree = "<group>"; };
00A6F0962C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSVideoOfficialEndV2View.h; sourceTree = "<group>"; }; 00A6F0962C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSVideoOfficialEndV2View.h; sourceTree = "<group>"; };
00A6F0972C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSVideoOfficialEndV2View.m; sourceTree = "<group>"; }; 00A6F0972C2EAAF700162BA0 /* FUSVideoOfficialEndV2View.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSVideoOfficialEndV2View.m; sourceTree = "<group>"; };
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>"; };
...@@ -3736,6 +3739,8 @@ ...@@ -3736,6 +3739,8 @@
00A2D4512C1AEFBF00A15ECA /* FUSMultiDelegate.m */, 00A2D4512C1AEFBF00A15ECA /* FUSMultiDelegate.m */,
00A36A572C1D9FD6004D28FA /* FUSLeftPopScrollView.h */, 00A36A572C1D9FD6004D28FA /* FUSLeftPopScrollView.h */,
00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */, 00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */,
00A452992C2FEDB2004EC526 /* FUSControllerPushHelper.h */,
00A4529A2C2FEDB2004EC526 /* FUSControllerPushHelper.m */,
); );
path = Others; path = Others;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -9622,6 +9627,7 @@ ...@@ -9622,6 +9627,7 @@
BE0397C52C134566003EB21B /* TextCompositionLayer.swift in Sources */, BE0397C52C134566003EB21B /* TextCompositionLayer.swift in Sources */,
BED0FC392C0C49CA0017B285 /* FUSReportOptionModel.m in Sources */, BED0FC392C0C49CA0017B285 /* FUSReportOptionModel.m in Sources */,
BE0397E62C134566003EB21B /* Repeater.swift in Sources */, BE0397E62C134566003EB21B /* Repeater.swift in Sources */,
00A4529B2C2FEDB2004EC526 /* FUSControllerPushHelper.m in Sources */,
00A2D4A12C1AEFBF00A15ECA /* FUSHomePageViewController.m in Sources */, 00A2D4A12C1AEFBF00A15ECA /* FUSHomePageViewController.m in Sources */,
BED0F9372C0C49C90017B285 /* FUSWebShareView.m in Sources */, BED0F9372C0C49C90017B285 /* FUSWebShareView.m in Sources */,
BE0397C42C134566003EB21B /* SolidCompositionLayer.swift in Sources */, BE0397C42C134566003EB21B /* SolidCompositionLayer.swift in Sources */,
......
...@@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -18,6 +18,10 @@ NS_ASSUME_NONNULL_BEGIN
- (void)fus_refreshTagImagesWithModel:(FUSBaoFangAnchorModel *)model; - (void)fus_refreshTagImagesWithModel:(FUSBaoFangAnchorModel *)model;
- (void)fus_startAllTagsAnim;
- (void)fus_stopAllTagsAnim;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@interface FUSBaoFangTagView () @interface FUSBaoFangTagView ()
@property (nonatomic, strong) NSMutableArray<UIImageView *> *tagImageViews; @property (nonatomic, strong) NSMutableArray<YYAnimatedImageView *> *tagImageViews;
@end @end
...@@ -66,8 +66,9 @@ ...@@ -66,8 +66,9 @@
for (NSInteger i = 0; i < model.tag.count; i++) { for (NSInteger i = 0; i < model.tag.count; i++) {
if (self.tagImageViews.count < i + 1) { if (self.tagImageViews.count < i + 1) {
UIImageView *imageView = [[UIImageView alloc] init]; YYAnimatedImageView *imageView = [[YYAnimatedImageView alloc] init];
imageView.contentMode = UIViewContentModeScaleAspectFit; imageView.contentMode = UIViewContentModeScaleAspectFit;
imageView.runloopMode = NSDefaultRunLoopMode;
[self.tagImageViews addObject:imageView]; [self.tagImageViews addObject:imageView];
[self addSubview:imageView]; [self addSubview:imageView];
} }
...@@ -75,15 +76,39 @@ ...@@ -75,15 +76,39 @@
self.tagImageViews[i].hidden = YES; self.tagImageViews[i].hidden = YES;
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
NSString *string = model.tag[i]; NSString *tagString = model.tag[i];
if (![NSString isNull:string]) { if (![NSString isNullWithString:tagString]) {
[self.tagImageViews[i] setWebImageWithSubURLString:string [self.tagImageViews[i] setWebImageWithSubURLString:tagString placeholder:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
placeholder:nil if ([image isKindOfClass:[YYImage class]]) {
completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) { ((YYImage *)image).preloadAllAnimatedImageFrames = YES;
}
weakSelf.tagImageViews[i].image = image;
[weakSelf fus_resetFrameWithImage:image tagAtIndex:i]; [weakSelf fus_resetFrameWithImage:image tagAtIndex:i];
}]; }];
} }
} }
// for (NSInteger i = 0; i < model.tag.count; i++) {
//
// if (self.tagImageViews.count < i + 1) {
// UIImageView *imageView = [[UIImageView alloc] init];
// imageView.contentMode = UIViewContentModeScaleAspectFit;
// [self.tagImageViews addObject:imageView];
// [self addSubview:imageView];
// }
//
// self.tagImageViews[i].hidden = YES;
// __weak typeof(self) weakSelf = self;
//
// NSString *string = model.tag[i];
// if (![NSString isNull:string]) {
// [self.tagImageViews[i] setWebImageWithSubURLString:string
// placeholder:nil
// completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
// [weakSelf fus_resetFrameWithImage:image tagAtIndex:i];
// }];
// }
// }
} }
- (void)fus_resetFrameWithImage:(UIImage *)image - (void)fus_resetFrameWithImage:(UIImage *)image
...@@ -121,4 +146,17 @@ ...@@ -121,4 +146,17 @@
self.frame = selfFrame; self.frame = selfFrame;
} }
- (void)fus_startAllTagsAnim {
for (UIImageView *imageView in self.tagImageViews) {
[imageView startAnimating];
}
}
- (void)fus_stopAllTagsAnim {
for (UIImageView *imageView in self.tagImageViews) {
[imageView stopAnimating];
}
}
@end @end
...@@ -392,6 +392,11 @@ ...@@ -392,6 +392,11 @@
// 珍爱团引导弹窗 // 珍爱团引导弹窗
#define UDKEY_LIVE_FANS_GROUP_GUIDE_POP_ALERT @"UDKEY_LIVE_FANS_GROUP_GUIDE_POP_ALERT" #define UDKEY_LIVE_FANS_GROUP_GUIDE_POP_ALERT @"UDKEY_LIVE_FANS_GROUP_GUIDE_POP_ALERT"
// 沙盒-账号相关-用户首次开播弹出协议提示
#define UDKEY_ACCOUNT_FIRST_STAR_LIVE_SHOW_PROTOCOL @"UDKEY_ACCOUNT_FIRST_STAR_LIVE_SHOW_PROTOCOL"
// 沙盒-账号相关-用户首次发布动态协议提示
#define UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL @"UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL"
#pragma mark - 系统级提示文本配置 #pragma mark - 系统级提示文本配置
// 直播间”撩一下”储值tips // 直播间”撩一下”储值tips
......
//
// FUSControllerPushHelper.h
// FuSiLive
//
// Created by aaa on 2024/6/29.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSControllerPushHelper : NSObject
@end
@interface UINavigationController (FUSPushHelper)
/// 跳转到kf
-(void)fus_pushToServiceControllerWithAnimate:(BOOL)animate;
/// 详细设置跳转到kf
/// - Parameters:
/// - uid: kf的uid
/// - facePath: kf的face
/// - nikename: kf的名字
/// - welcomeStr: 欢迎语句
/// - animate: 动画
-(void)fus_pushToServiceControllerWithUID:(NSString * _Nullable )uid face:(NSString * _Nullable)facePath nikename:(NSString * _Nullable)nikename welcome:(NSString * _Nullable)welcomeStr animate:(BOOL)animate;
@end
NS_ASSUME_NONNULL_END
//
// FUSControllerPushHelper.m
// FuSiLive
//
// Created by aaa on 2024/6/29.
//
#import "FUSControllerPushHelper.h"
#import "FUSSingleChatViewController.h"
@implementation FUSControllerPushHelper
@end
@implementation UINavigationController (FUSPushHelper)
- (void)fus_pushToServiceControllerWithAnimate:(BOOL)animate{
[self fus_pushToServiceControllerWithUID:@(SERVEICE_UID).stringValue face:nil nikename:nil welcome:nil animate:animate];
}
-(void)fus_pushToServiceControllerWithUID:(NSString *)uid face:(NSString *)facePath nikename:(NSString *)nikename welcome:(NSString *)welcomeStr animate:(BOOL)animate{
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]) {
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;
// if (![NSString isNull:welcomeStr]) {
// serviceChat.welcomeStr = welcomeStr;
// }
// vc = serviceChat;
// } else {
//
// FUSWKWebViewController *webVC = [[FUSWKWebViewController alloc] init];
// NSString *webURL = FUSLocalizationHelper.isArbicLanguage ? URL_WEB_ARBIC_HELP : URL_WEB_HELP;
// webVC.webUrlString = [NSString stringWithFormat:@"%@?lang=%@", webURL,FUSLocalizationHelper.fus_currentLanguage.languageID];
// 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];
}
@end
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#import "FUSDefine.h" #import "FUSDefine.h"
#import "FUSBaoFangHttpHelper.h" #import "FUSBaoFangHttpHelper.h"
#import "FUSSingleDailyCheckInView.h" #import "FUSSingleDailyCheckInView.h"
#import "FUSZhaixinRecommendedViewController.h"
// 导入通知框架 // 导入通知框架
#import <UserNotifications/UserNotifications.h> #import <UserNotifications/UserNotifications.h>
...@@ -38,24 +39,24 @@ ...@@ -38,24 +39,24 @@
self.hiddenNavigationBar = YES; self.hiddenNavigationBar = YES;
self.firstLoad = YES; self.firstLoad = YES;
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:UNAuthorizationOptionBadge|UNAuthorizationOptionSound|UNAuthorizationOptionAlert completionHandler:^(BOOL granted, NSError * _Nullable error) {
}];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(fus_applicationDidBecomeActiveNotification:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[self fus_setupProperties];
[self fus_createTabbarView]; [self fus_createTabbarView];
[self fus_createHomeScrollView]; [self fus_createHomeScrollView];
[self.view bringSubviewToFront:self.tabbarView]; [self.view bringSubviewToFront:self.tabbarView];
[self fus_getDailyCheckInData]; [self fus_getDailyCheckInData];
[self fus_registNotification];
} }
-(void)fus_setupProperties{ -(void)fus_registNotification{
[[UNUserNotificationCenter currentNotificationCenter] requestAuthorizationWithOptions:UNAuthorizationOptionBadge|UNAuthorizationOptionSound|UNAuthorizationOptionAlert completionHandler:^(BOOL granted, NSError * _Nullable error) {
}];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(fus_applicationDidBecomeActiveNotification:)
name:UIApplicationDidBecomeActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newRegistRecommend:) name:NEW_REGISTER_RECOMMEND object:nil];
} }
-(void)fus_createHomeScrollView{ -(void)fus_createHomeScrollView{
...@@ -148,12 +149,29 @@ ...@@ -148,12 +149,29 @@
}; };
} }
#pragma mark --- observer #pragma mark --- notification
-(void)fus_applicationDidBecomeActiveNotification:(NSNotification *)noti{ -(void)fus_applicationDidBecomeActiveNotification:(NSNotification *)noti{
[self.contentViewList enumerateObjectsUsingBlock:^(FUSHomePageBaseView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [self.contentViewList enumerateObjectsUsingBlock:^(FUSHomePageBaseView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
[obj fus_applicationDidBecomeActiveNotification:noti]; [obj fus_applicationDidBecomeActiveNotification:noti];
}]; }];
} }
- (void)newRegistRecommend:(NSNotification *)notification {
NSArray *array = notification.object;
FUSZhaixinRecommendedViewController *remVc = [[FUSZhaixinRecommendedViewController alloc] initWithDataArray:array];
UINavigationController *remNav = [[UINavigationController alloc] initWithRootViewController:remVc];
if (remVc) {
BOOL isNew = [[[NSUserDefaults standardUserDefaults] objectForKey:NEW_USER_REGIST] boolValue];
if (isNew) {
[self presentViewController:remNav animated:YES completion:nil];
}
}
// __weak typeof(self) weakSelf = self;
remVc.deallocBlock = ^{
};
}
#pragma mark --- FUSHomeViewBaseDelegate #pragma mark --- FUSHomeViewBaseDelegate
- (void)fus_homeView:(UIView *)view didUpdateCollectionCntentMaxHeightWithFloor:(CGFloat)maxHeight{ - (void)fus_homeView:(UIView *)view didUpdateCollectionCntentMaxHeightWithFloor:(CGFloat)maxHeight{
......
...@@ -32,6 +32,8 @@ typedef enum :NSInteger{ ...@@ -32,6 +32,8 @@ typedef enum :NSInteger{
-(void)fus_setButton:(FUSHomeNaviViewClickType)btnType selected:(BOOL)selected; -(void)fus_setButton:(FUSHomeNaviViewClickType)btnType selected:(BOOL)selected;
-(UIButton *)fus_getNaviButton:(FUSHomeNaviViewClickType)btnType;
-(BOOL)fus_isButtonSelected:(FUSHomeNaviViewClickType)btnType; -(BOOL)fus_isButtonSelected:(FUSHomeNaviViewClickType)btnType;
@end @end
......
...@@ -76,6 +76,13 @@ ...@@ -76,6 +76,13 @@
UIButton *tempBtn = self.btnList[btnType]; UIButton *tempBtn = self.btnList[btnType];
return tempBtn.isSelected; return tempBtn.isSelected;
} }
- (UIButton *)fus_getNaviButton:(FUSHomeNaviViewClickType)btnType{
if (btnType > self.btnList.count) {
return nil;
}
UIButton *tempBtn = self.btnList[btnType];
return tempBtn;
}
#pragma mark --- button did clicked #pragma mark --- button did clicked
......
...@@ -13,9 +13,9 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -13,9 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
@protocol FUSHomeViewBaseDelegate <NSObject> @protocol FUSHomeViewBaseDelegate <NSObject>
@optional @optional
/// 提醒显示navi,tabbar /// 提醒显示navi,tabbar(现在仅仅支持home)
-(void)fus_scrollview:(UIScrollView *)view shouldHideNavigationBar:(BOOL)hidden; -(void)fus_scrollview:(UIScrollView *)view shouldHideNavigationBar:(BOOL)hidden;
/// 提醒隐藏navi,tabbr /// 提醒隐藏navi,tabbr(现在仅仅支持home)
-(void)fus_scrollview:(UIScrollView *)view shouldShowNavigationBar:(BOOL)hidden; -(void)fus_scrollview:(UIScrollView *)view shouldShowNavigationBar:(BOOL)hidden;
/// 返回collection或者tableview的内容最大高度,向下取整,用于决定外面的tabbar透明还是非透明,过高就透明 /// 返回collection或者tableview的内容最大高度,向下取整,用于决定外面的tabbar透明还是非透明,过高就透明
...@@ -24,6 +24,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -24,6 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
/// - maxHeight: 最大高度 /// - maxHeight: 最大高度
-(void)fus_homeView:(UIView *)view didUpdateCollectionCntentMaxHeightWithFloor:(CGFloat)maxHeight; -(void)fus_homeView:(UIView *)view didUpdateCollectionCntentMaxHeightWithFloor:(CGFloat)maxHeight;
@end @end
@interface FUSHomePageBaseView : UIView @interface FUSHomePageBaseView : UIView
......
...@@ -45,6 +45,9 @@ ...@@ -45,6 +45,9 @@
@property (nonatomic, assign) CGFloat rowMargin; //每一行之间的间距 @property (nonatomic, assign) CGFloat rowMargin; //每一行之间的间距
@property (nonatomic, assign) int columnsCount; //显示多少列 @property (nonatomic, assign) int columnsCount; //显示多少列
/// 追踪列表需要刷新
@property (nonatomic, assign) BOOL followNeedUpdate;
@end @end
@implementation FUSHomeView @implementation FUSHomeView
...@@ -53,12 +56,16 @@ ...@@ -53,12 +56,16 @@
{ {
self = [super init]; self = [super init];
if (self) { if (self) {
self.followNeedUpdate = NO;
[self fus_setup]; [self fus_setup];
[self fus_createUI]; [self fus_createUI];
self.languageSegmentView.otherNamesList = self.viewModel.otherLanguageNamesList; self.languageSegmentView.otherNamesList = self.viewModel.otherLanguageNamesList;
self.languageSegmentView.selectName = self.viewModel.selectLanguageName; self.languageSegmentView.selectName = self.viewModel.selectLanguageName;
[self.collectionView.mj_header beginRefreshing]; [self.collectionView.mj_header beginRefreshing];
[self fus_reagiestNotification];
} }
return self; return self;
} }
...@@ -117,6 +124,10 @@ ...@@ -117,6 +124,10 @@
}]; }];
} }
-(void)fus_reagiestNotification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fu_followDidUpdate:) name:FocusBaoFang_Refresh object:nil];
}
- (void)layoutSubviews{ - (void)layoutSubviews{
[super layoutSubviews]; [super layoutSubviews];
...@@ -129,6 +140,15 @@ ...@@ -129,6 +140,15 @@
} }
} }
- (void)fus_viewWillShow{
}
#pragma mark --- notification
-(void)fu_followDidUpdate:(NSNotification *)noti{
self.followNeedUpdate = YES;
}
#pragma mark --- method #pragma mark --- method
-(void)fus_enterRoom:(FUSBaoFangAnchorModel *)model index:(NSInteger)index{ -(void)fus_enterRoom:(FUSBaoFangAnchorModel *)model index:(NSInteger)index{
[FUSBaoFangViewHelper fus_clickBaofangItemAtIndex:model type:FUSAnchorHotData controllerType:FUSBaoFangControllerTypeMainLive index:index onLiveRooms:self.viewModel.onlyLiveRoomList]; [FUSBaoFangViewHelper fus_clickBaofangItemAtIndex:model type:FUSAnchorHotData controllerType:FUSBaoFangControllerTypeMainLive index:index onLiveRooms:self.viewModel.onlyLiveRoomList];
...@@ -227,29 +247,59 @@ ...@@ -227,29 +247,59 @@
//点击追踪 //点击追踪
BOOL isSelected = [naviView fus_isButtonSelected:FUSHomeNaviViewClickTypeFollow]; BOOL isSelected = [naviView fus_isButtonSelected:FUSHomeNaviViewClickTypeFollow];
FUSHomeViewAnchorListType turnToType = isSelected ? FUSHomeViewAnchorListTypeNormal : FUSHomeViewAnchorListTypeFollow; FUSHomeViewAnchorListType turnToType = isSelected ? FUSHomeViewAnchorListTypeNormal : FUSHomeViewAnchorListTypeFollow;
if (![self.viewModel fus_switchToList:turnToType]) {
self.viewModel.anchorListType = turnToType; //如果跳转到的状态被判定为必须刷新的,那么就直接刷新,后续如果需要刷新普通列表的也在这里添加||判定就好
[self.viewModel fus_reloadData]; if (turnToType == FUSHomeViewAnchorListTypeFollow && self.followNeedUpdate) {
[self fusTurnToTypeAndHeaderRefresh:turnToType];
}else {
if (![self.viewModel fus_trySwitchToCacheList:turnToType]) {
[self fusTurnToTypeAndHeaderRefresh:turnToType];
}
} }
} }
break; break;
case FUSHomeNaviViewClickTypeShare:{ case FUSHomeNaviViewClickTypeShare:{
[FUSResponsibilityConfirmAlertView fus_showOn:self.parentController.view type:1 clickHandler:^(NSInteger clickType) {
}]; FUSWKWebViewController *wkwVC = [[FUSWKWebViewController alloc] init];
wkwVC.shouldShowShareBtn = NO;
wkwVC.needShowReload = YES;
wkwVC.from = FUSFromInvitShare;
wkwVC.shouldIncludeIdentifyInfo = YES;
wkwVC.webUrlString = URL_WEB_AGENT_INVITE_SHARE;
// 包含用户信息参数
[self.parentController.navigationController pushViewController:wkwVC animated:YES];
} }
break; break;
case FUSHomeNaviViewClickTypeStartLive:{ case FUSHomeNaviViewClickTypeStartLive:{
// [FUSResponsibilityConfirmAlertView fus_showOn:self.parentController.view type:0 clickHandler:^(NSInteger clickType) {
// NSLog(@"FUSResponsibilityConfirmAlertViewCLicktype:%ld",clickType); NSString *isFirstStarLiveProtocolShow = [NSUserDefaults fus_readCurrentUserObjectWithKey:UDKEY_ACCOUNT_FIRST_STAR_LIVE_SHOW_PROTOCOL];
// }]; if (isFirstStarLiveProtocolShow == nil || isFirstStarLiveProtocolShow.length <= 0) {
[FUSResponsibilityConfirmAlertView fus_showOn:self.parentController.view type:0 clickHandler:^(NSInteger clickType) {
if (clickType == 0) {
// 未勾选完所有就点确定
[FUSAlertView showAlertWithTitle:nil message:[NSString fus_versionLocalString:@"您需要勾選所有確認事項後 開啟直播"] cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_versionLocalString:@"確認"]] clickBlock:^(NSInteger buttonIndex) {
}];
}else if (clickType == 1) {
// 勾选完点确定
[NSUserDefaults fus_setCurrentUserObjectKey:UDKEY_ACCOUNT_FIRST_STAR_LIVE_SHOW_PROTOCOL value:@"1"];
[FUSLiveHelper fus_pushLive]; [FUSLiveHelper fus_pushLive];
}else if (clickType == 2) {
// 点击直播公约
}
}];
}else {
[FUSLiveHelper fus_pushLive];
}
} }
break; break;
case FUSHomeNaviViewClickTypeSearch:{ case FUSHomeNaviViewClickTypeSearch:{
// [FUSMyEditNameAlertView fus_showOn:self.parentController.view type:0 clickHandler:^(BOOL suc, NSInteger code, NSString * _Nonnull msg) {
//
// }];
FUSSearchViewController *searchVC = [[FUSSearchViewController alloc] init]; FUSSearchViewController *searchVC = [[FUSSearchViewController alloc] init];
searchVC.searchType = FUSSearchVcTypePeopleNetwork; searchVC.searchType = FUSSearchVcTypePeopleNetwork;
...@@ -277,6 +327,13 @@ ...@@ -277,6 +327,13 @@
} }
} }
-(void)fusTurnToTypeAndHeaderRefresh:(FUSHomeViewAnchorListType)type{
self.followNeedUpdate = NO;
self.viewModel.anchorListType = type;
[self.collectionView.mj_header beginRefreshing];
[self.naviView fus_getNaviButton:FUSHomeNaviViewClickTypeFollow].enabled = NO;
}
#pragma mark --- FUSHomeViewViewModelDelegate #pragma mark --- FUSHomeViewViewModelDelegate
-(void)fus_homeViewViewModelLanguageListDidUpdate:(NSString *)selectTitle others:(NSArray<NSString *> *)otherTitlesList{ -(void)fus_homeViewViewModelLanguageListDidUpdate:(NSString *)selectTitle others:(NSArray<NSString *> *)otherTitlesList{
self.languageSegmentView.otherNamesList = otherTitlesList; self.languageSegmentView.otherNamesList = otherTitlesList;
...@@ -291,8 +348,10 @@ ...@@ -291,8 +348,10 @@
[self.naviView fus_setButton:FUSHomeNaviViewClickTypeFollow selected:type == FUSHomeViewAnchorListTypeFollow ? YES : NO]; [self.naviView fus_setButton:FUSHomeNaviViewClickTypeFollow selected:type == FUSHomeViewAnchorListTypeFollow ? YES : NO];
[self.collectionView reloadData]; [self.collectionView reloadData];
[self.naviView fus_getNaviButton:FUSHomeNaviViewClickTypeFollow].enabled = YES;
if (type == FUSHomeViewAnchorListTypeFollow && [NSArray isNull:self.viewModel.dataList]) { if (type == FUSHomeViewAnchorListTypeFollow && [NSArray isNull:self.viewModel.dataList]) {
[self.viewModel fus_switchToList:FUSHomeViewAnchorListTypeNormal]; [self.viewModel fus_trySwitchToCacheList:FUSHomeViewAnchorListTypeNormal];
if (isLastSelected == NO) { if (isLastSelected == NO) {
//上一次是普通,然后点了追踪,发现没追踪,则先还原回普通,再弹出这个 //上一次是普通,然后点了追踪,发现没追踪,则先还原回普通,再弹出这个
if (self.viewModel.recommendModel != nil) { if (self.viewModel.recommendModel != nil) {
......
...@@ -59,9 +59,13 @@ typedef enum :NSInteger{ ...@@ -59,9 +59,13 @@ typedef enum :NSInteger{
-(void)fus_selectLanguage:(NSInteger)index; -(void)fus_selectLanguage:(NSInteger)index;
/// 根据主播列表类型刷新主播列表,语言 /// 根据主播列表类型刷新主播列表,语言
-(void)fus_reloadData; -(void)fus_reloadData;
/// 切换到另外一个列表,返回是否能直接切换,能直接切换则切换,不能直接切换则是因为数据还没请求,需要reload /// 尝试切换到另外一个列表,返回是否能直接切换,能直接切换则切换,不能直接切换则是因为数据还没请求,需要reload
/// - Parameter anchorListType: 列表类型 /// - Parameter anchorListType: 列表类型
-(BOOL)fus_switchToList:(FUSHomeViewAnchorListType)anchorListType; -(BOOL)fus_trySwitchToCacheList:(FUSHomeViewAnchorListType)anchorListType;
/// 仅仅更新某个列表,不切换
/// - Parameter anchorListType: 列表类型
-(void)fus_updateList:(FUSHomeViewAnchorListType)anchorListType;
@end @end
......
...@@ -43,6 +43,13 @@ ...@@ -43,6 +43,13 @@
} }
#pragma mark --- net work #pragma mark --- net work
- (void)fus_updateList:(FUSHomeViewAnchorListType)anchorListType{
if (anchorListType == FUSHomeViewAnchorListTypeFollow) {
[self fus_loadhomeVestFollowGetlistAutoCall:NO];
}else if (anchorListType == FUSHomeViewAnchorListTypeNormal) {
[self fus_loadvestRoomGetlistAutoCall:NO readFrom:ReadCacheFromTypeServer];
}
}
/// 请求语言列表 /// 请求语言列表
-(void)fus_loadHomeLanguageListWithAnchorList:(BOOL)shouldLoadAnchorList readFrom:(ReadCacheFromType)readFrom{ -(void)fus_loadHomeLanguageListWithAnchorList:(BOOL)shouldLoadAnchorList readFrom:(ReadCacheFromType)readFrom{
...@@ -171,7 +178,7 @@ ...@@ -171,7 +178,7 @@
[self fus_loadhomeVestFollowGetlistAutoCall:YES]; [self fus_loadhomeVestFollowGetlistAutoCall:YES];
} }
} }
- (BOOL)fus_switchToList:(FUSHomeViewAnchorListType)anchorListType{ - (BOOL)fus_trySwitchToCacheList:(FUSHomeViewAnchorListType)anchorListType{
if (anchorListType == FUSHomeViewAnchorListTypeNormal) { if (anchorListType == FUSHomeViewAnchorListTypeNormal) {
if (self.homeLanguageGetList == nil || self.homeLanguageGetList.count <= 0 || self.anchorOriginalList == nil) { if (self.homeLanguageGetList == nil || self.homeLanguageGetList.count <= 0 || self.anchorOriginalList == nil) {
......
...@@ -65,6 +65,10 @@ ...@@ -65,6 +65,10 @@
@implementation FUSHomeAnchorCollectionViewSmallCell @implementation FUSHomeAnchorCollectionViewSmallCell
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
......
...@@ -30,6 +30,14 @@ ...@@ -30,6 +30,14 @@
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
[self fus_createUI]; [self fus_createUI];
[[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];
} }
return self; return self;
} }
...@@ -88,6 +96,16 @@ ...@@ -88,6 +96,16 @@
return self.bgImageView; return self.bgImageView;
} }
#pragma mark --- notification
- (void)fus_enterLiveRoom {
[self.tagView fus_stopAllTagsAnim];
}
- (void)fus_quickLiveRoom {
//pk动画
[self.tagView fus_startAllTagsAnim];
}
#pragma mark --- getter and setter #pragma mark --- getter and setter
- (void)setNovaModel:(FUSHomeNovaListModel *)novaModel{ - (void)setNovaModel:(FUSHomeNovaListModel *)novaModel{
_novaModel = novaModel; _novaModel = novaModel;
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "FUSSegmentControlView.h" #import "FUSSegmentControlView.h"
#import "FUSMyZoneViewController.h" #import "FUSMyZoneViewController.h"
#import "FUSDefine.h" #import "FUSDefine.h"
#import "FUSControllerPushHelper.h"
@interface FUSHomeNovaListViewController ()<FUSSegmentControlViewDelegate,UIScrollViewDelegate> @interface FUSHomeNovaListViewController ()<FUSSegmentControlViewDelegate,UIScrollViewDelegate>
...@@ -36,10 +37,10 @@ ...@@ -36,10 +37,10 @@
// 标题栏 // 标题栏
@property (nonatomic, strong) UIView *navView; @property (nonatomic, strong) UIView *navView;
////rightBarButtonItem ///榜单按钮
//@property (nonatomic, strong) UIButton *rightBtn; @property (nonatomic, strong) UIButton *rankBtn;
///// 客服按钮 /// 客服按钮
//@property (nonatomic, strong) UIButton *serviceBtn; @property (nonatomic, strong) UIButton *serviceBtn;
@end @end
...@@ -102,6 +103,28 @@ ...@@ -102,6 +103,28 @@
make.height.offset(40); make.height.offset(40);
}]; }];
//榜单在最右边
self.rankBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.rankBtn setImage:[UIImage imageNamed:@"fus_home_navi_rank_icon"] forState:UIControlStateNormal];
[self.segmentView addSubview:self.rankBtn];
[self.rankBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.top.bottom.offset(0);
make.width.equalTo(self.rankBtn.mas_height);
}];
self.serviceBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.serviceBtn setImage:[UIImage imageNamed:@"fus_common_navi_service_btn"] forState:UIControlStateNormal];
[self.segmentView addSubview:self.serviceBtn];
[self.serviceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.offset(0);
make.right.equalTo(self.rankBtn.mas_left);
make.width.equalTo(self.serviceBtn.mas_height);
}];
[self.serviceBtn addTarget:self action:@selector(fus_serviceBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.rankBtn addTarget:self action:@selector(fus_rankBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
// CGFloat btn_w = 40; // CGFloat btn_w = 40;
// //
// //右按钮,皇冠 // //右按钮,皇冠
...@@ -246,13 +269,26 @@ ...@@ -246,13 +269,26 @@
[self.navView addSubview:backBtn]; [self.navView addSubview:backBtn];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.navView.width - 200) / 2.0, self.navView.height - 44, 200, 44)]; UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake((self.navView.width - 200) / 2.0, self.navView.height - 44, 200, 44)];
titleLabel.text = FUSLocalizationHelper.versionLocalString(@"FIREFLY 新星"); titleLabel.text = FUSLocalizationHelper.versionLocalString(@"FUSI 新星");
titleLabel.textColor = [UIColor fus_textColorRich]; titleLabel.textColor = [UIColor fus_textColorRich];
titleLabel.font = [UIFont fus_themeBoldFont:17]; titleLabel.font = [UIFont fus_themeBoldFont:17];
titleLabel.textAlignment = NSTextAlignmentCenter; titleLabel.textAlignment = NSTextAlignmentCenter;
[self.navView addSubview:titleLabel]; [self.navView addSubview:titleLabel];
} }
#pragma mark --- button did clicked
-(void)fus_serviceBtnDidClicked:(UIButton *)btn{
[self.navigationController fus_pushToServiceControllerWithAnimate:YES];
}
-(void)fus_rankBtnDidClicked:(UIButton *)btn{
FUSWKWebViewController *wkwVC = [[FUSWKWebViewController alloc] init];
wkwVC.needHideWebTitleBar = YES;
wkwVC.closeToPopAllWebView = NO;
//TODO: 暂时写死榜单的,等阿甘回来再说,URL_WEB_HOME_RANK这个定义里有地址
wkwVC.webUrlString = @"https://ceshi.yabolive.tv/fusi/allRank/index.html";
[self.navigationController pushViewController:wkwVC animated:YES];
}
#pragma mark --------- method #pragma mark --------- method
-(void)ffreloadFollowAllStatus{ -(void)ffreloadFollowAllStatus{
......
...@@ -855,7 +855,7 @@ ...@@ -855,7 +855,7 @@
UIViewController *vc = (UIViewController *)UIApplication.sharedApplication.keyWindow.rootViewController; UIViewController *vc = (UIViewController *)UIApplication.sharedApplication.keyWindow.rootViewController;
if (![vc presentedViewController]) { if (![vc presentedViewController]) {
[vc presentViewController:[[FUSLiveHelper shareInstance] navLive] animated:anim completion:completion]; [vc presentViewController:[[FUSLiveHelper shareInstance] navLive] animated:anim completion:completion];
// [[NSNotificationCenter defaultCenter] postNotificationName:LiveNotification.enterLiveRoomNotification object:nil]; [[NSNotificationCenter defaultCenter] postNotificationName:ENTER_LIVE_ROOM object:nil];
} }
} }
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#import "FUSImagePickerViewController.h" #import "FUSImagePickerViewController.h"
#import "FUSTextView.h" #import "FUSTextView.h"
#import "UISwitch+FUSRTL.h" #import "UISwitch+FUSRTL.h"
#import "FUSResponsibilityConfirmAlertView.h"
// font 18 textview显示一行的consize的高度就 38 // font 18 textview显示一行的consize的高度就 38
#define INPUTTEXTVIEW_H 38 #define INPUTTEXTVIEW_H 38
...@@ -119,14 +120,14 @@ FUSImagePickerViewControllerDelegate> ...@@ -119,14 +120,14 @@ FUSImagePickerViewControllerDelegate>
[self.postBtn setTitleColor:[UIColor colorWithHex:@"02f2f2"] forState:UIControlStateNormal]; [self.postBtn setTitleColor:[UIColor colorWithHex:@"02f2f2"] forState:UIControlStateNormal];
[self.postBtn setTitleColor:[UIColor colorWithHex:@"808080"] forState:UIControlStateDisabled]; [self.postBtn setTitleColor:[UIColor colorWithHex:@"808080"] forState:UIControlStateDisabled];
self.postBtn.titleLabel.font = [UIFont fus_themeFont:15]; self.postBtn.titleLabel.font = [UIFont fus_themeFont:15];
[self.postBtn addTarget:self action:@selector(goPublish) forControlEvents:UIControlEventTouchUpInside]; [self.postBtn addTarget:self action:@selector(fus_pushBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
self.postBtn.enabled = NO; self.postBtn.enabled = NO;
UIBarButtonItem *itemR = [[UIBarButtonItem alloc] initWithCustomView:self.postBtn]; UIBarButtonItem *itemR = [[UIBarButtonItem alloc] initWithCustomView:self.postBtn];
self.navigationItem.rightBarButtonItems = @[itemR]; self.navigationItem.rightBarButtonItems = @[itemR];
UIBarButtonItem *itemL = [[UIBarButtonItem alloc] initWithTitle:FUSLocalizationHelper.localString(@"取消") style:UIBarButtonItemStylePlain target:self action:@selector(popToLastPage)]; UIBarButtonItem *itemL = [[UIBarButtonItem alloc] initWithTitle:FUSLocalizationHelper.localString(@"取消") style:UIBarButtonItemStylePlain target:self action:@selector(popToLastPage)];
[itemL setTintColor:[UIColor colorWithHex:@"#8A888C"]]; [itemL setTintColor:[UIColor fus_textColorRich]];
self.navigationItem.leftBarButtonItems = @[itemL]; self.navigationItem.leftBarButtonItems = @[itemL];
} }
...@@ -217,13 +218,13 @@ FUSImagePickerViewControllerDelegate> ...@@ -217,13 +218,13 @@ FUSImagePickerViewControllerDelegate>
UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, toolBgView.height/3.0)]; UIView *view1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, toolBgView.height/3.0)];
UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view1.width/2.0 - 22, view1.height)]; UILabel *lb = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view1.width/2.0 - 22, view1.height)];
lb.textColor = [UIColor colorWithHex:@"#999999"]; lb.textColor = [UIColor fus_textColorRich];
lb.text = FUSLocalizationHelper.localString(@"阅览价格"); lb.text = FUSLocalizationHelper.localString(@"阅览价格");
[view1 addSubview:lb]; [view1 addSubview:lb];
_priceLb = [[UILabel alloc] init]; _priceLb = [[UILabel alloc] init];
_priceLb.text = FUSLocalizationHelper.localString(@"免费"); _priceLb.text = FUSLocalizationHelper.localString(@"免费");
_priceLb.textColor = [UIColor colorWithHex:@"#999999"]; _priceLb.textColor = [UIColor fus_textColorRich];
[_priceLb sizeToFit]; [_priceLb sizeToFit];
_priceLb.x = CGRectGetMaxX(lb.frame); _priceLb.x = CGRectGetMaxX(lb.frame);
_priceLb.width = view1.width/2.0 - 30; _priceLb.width = view1.width/2.0 - 30;
...@@ -247,7 +248,7 @@ FUSImagePickerViewControllerDelegate> ...@@ -247,7 +248,7 @@ FUSImagePickerViewControllerDelegate>
UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, (toolBgView.height/3.0)*1, UIView.fus_screenW, toolBgView.height/3.0)]; UIView *view2 = [[UIView alloc] initWithFrame:CGRectMake(0, (toolBgView.height/3.0)*1, UIView.fus_screenW, toolBgView.height/3.0)];
_addressLb2 = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view2.width - 90, view2.height)]; _addressLb2 = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view2.width - 90, view2.height)];
_addressLb2.text = FUSLocalizationHelper.localString(@"定位"); _addressLb2.text = FUSLocalizationHelper.localString(@"定位");
_addressLb2.textColor = [UIColor colorWithHex:@"#999999"]; _addressLb2.textColor = [UIColor fus_textColorRich];
[view2 addSubview:_addressLb2]; [view2 addSubview:_addressLb2];
UIButton *btn = [[UIButton alloc] initWithFrame:view2.bounds]; UIButton *btn = [[UIButton alloc] initWithFrame:view2.bounds];
[btn addTarget:self action:@selector(getAddress) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:self action:@selector(getAddress) forControlEvents:UIControlEventTouchUpInside];
...@@ -262,7 +263,7 @@ FUSImagePickerViewControllerDelegate> ...@@ -262,7 +263,7 @@ FUSImagePickerViewControllerDelegate>
UIView *view3 = [[UIView alloc] initWithFrame:CGRectMake(0, (toolBgView.height/3.0)*2, UIView.fus_screenW, toolBgView.height/3.0)]; UIView *view3 = [[UIView alloc] initWithFrame:CGRectMake(0, (toolBgView.height/3.0)*2, UIView.fus_screenW, toolBgView.height/3.0)];
UILabel *lb3 = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view3.width - 90, view3.height)]; UILabel *lb3 = [[UILabel alloc] initWithFrame:CGRectMake(22, 0, view3.width - 90, view3.height)];
lb3.text = FUSLocalizationHelper.localString(@"同步到相册"); lb3.text = FUSLocalizationHelper.localString(@"同步到相册");
lb3.textColor = [UIColor colorWithHex:@"#999999"]; lb3.textColor = [UIColor fus_textColorRich];
[view3 addSubview:lb3]; [view3 addSubview:lb3];
_switchSync = [[UISwitch alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lb3.frame), 0, 40, view3.height)]; _switchSync = [[UISwitch alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lb3.frame), 0, 40, view3.height)];
...@@ -673,6 +674,32 @@ FUSImagePickerViewControllerDelegate> ...@@ -673,6 +674,32 @@ FUSImagePickerViewControllerDelegate>
} }
} }
-(void)fus_pushBtnDidClicked:(UIButton *)btn{
NSString *isShow = [NSUserDefaults fus_readCurrentUserObjectWithKey:UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL];
if (isShow == nil || isShow.length <= 0) {
[FUSResponsibilityConfirmAlertView fus_showOn:self.view type:1 clickHandler:^(NSInteger clickType) {
if (clickType == 0) {
// 未勾选完所有就点确定
[FUSAlertView showAlertWithTitle:nil message:[NSString fus_versionLocalString:@"您需要勾選所有確認事項後發佈"] cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_versionLocalString:@"確認"]] clickBlock:^(NSInteger buttonIndex) {
}];
}else if (clickType == 1) {
// 勾选完点确定
[NSUserDefaults fus_setCurrentUserObjectKey:UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL value:@"1"];
[self goPublish];
}else if (clickType == 2) {
// 点击直播公约
}
}];
}else {
[self goPublish];
}
}
/// 发布 /// 发布
- (void)goPublish{ - (void)goPublish{
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
#import <HWPanModal/HWPanModal.h> #import <HWPanModal/HWPanModal.h>
#import "FUSMainSearchViewController.h" #import "FUSMainSearchViewController.h"
#import "FUSCacheDataShare.h" #import "FUSCacheDataShare.h"
#import "FUSResponsibilityConfirmAlertView.h"
// APP sever 的环境路径 // APP sever 的环境路径
...@@ -129,7 +130,7 @@ WKScriptMessageHandler ...@@ -129,7 +130,7 @@ WKScriptMessageHandler
[self.rightBtn setTitleColor:[UIColor colorWithHex:@"02f2f2"] forState:UIControlStateNormal]; [self.rightBtn setTitleColor:[UIColor colorWithHex:@"02f2f2"] forState:UIControlStateNormal];
[self.rightBtn setTitleColor:[UIColor colorWithHex:@"808080"] forState:UIControlStateDisabled]; [self.rightBtn setTitleColor:[UIColor colorWithHex:@"808080"] forState:UIControlStateDisabled];
self.rightBtn.titleLabel.font = [UIFont fus_themeFont:15]; self.rightBtn.titleLabel.font = [UIFont fus_themeFont:15];
[self.rightBtn addTarget:self action:@selector(getHTML) forControlEvents:UIControlEventTouchUpInside]; [self.rightBtn addTarget:self action:@selector(fus_publishDidClicked:) forControlEvents:UIControlEventTouchUpInside];
self.rightBtn.enabled = NO; self.rightBtn.enabled = NO;
UIBarButtonItem *itemR = [[UIBarButtonItem alloc] initWithCustomView:self.rightBtn]; UIBarButtonItem *itemR = [[UIBarButtonItem alloc] initWithCustomView:self.rightBtn];
...@@ -201,6 +202,35 @@ WKScriptMessageHandler ...@@ -201,6 +202,35 @@ WKScriptMessageHandler
[self.navigationController pushViewController:resultVc animated:YES]; [self.navigationController pushViewController:resultVc animated:YES];
}]; }];
} }
-(void)fus_publishDidClicked:(UIButton *)btn{
[self.view endEditing:YES];
NSString *isShow = [NSUserDefaults fus_readCurrentUserObjectWithKey:UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL];
if (isShow == nil || isShow.length <= 0) {
[FUSResponsibilityConfirmAlertView fus_showOn:self.view type:1 clickHandler:^(NSInteger clickType) {
if (clickType == 0) {
// 未勾选完所有就点确定
[FUSAlertView showAlertWithTitle:nil message:[NSString fus_versionLocalString:@"您需要勾選所有確認事項後發佈"] cancelButtonTitle:nil otherButtonTitles:@[[NSString fus_versionLocalString:@"確認"]] clickBlock:^(NSInteger buttonIndex) {
}];
}else if (clickType == 1) {
// 勾选完点确定
[NSUserDefaults fus_setCurrentUserObjectKey:UDKEY_ACCOUNT_FIRST_PUBLISH_AND_SHARE_PROTOCOL value:@"1"];
[self getHTML];
}else if (clickType == 2) {
// 点击直播公约
}
}];
}else {
[self getHTML];
}
}
- (void)getHTML{ - (void)getHTML{
[self.view endEditing:YES]; [self.view endEditing:YES];
......
...@@ -117,6 +117,7 @@ static CGFloat collectionViewMargin = 0; ...@@ -117,6 +117,7 @@ static CGFloat collectionViewMargin = 0;
// self.navigationItem.title = _model.name; // self.navigationItem.title = _model.name;
self.titleBtn = [UIButton buttonWithType:UIButtonTypeCustom]; self.titleBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.titleBtn setTitleColor:[UIColor fus_textColorRich] forState:UIControlStateNormal];
self.titleBtn.frame = CGRectMake(0, 0, 60, 44); self.titleBtn.frame = CGRectMake(0, 0, 60, 44);
[self.titleBtn setTitle:_model.name forState:UIControlStateNormal]; [self.titleBtn setTitle:_model.name forState:UIControlStateNormal];
[self.titleBtn setImage:[UIImage imageNamed:@"fireFly_board_down_arrow"] forState:UIControlStateNormal]; [self.titleBtn setImage:[UIImage imageNamed:@"fireFly_board_down_arrow"] forState:UIControlStateNormal];
......
...@@ -52,7 +52,10 @@ class FUSSearchViewController: FUSBaseViewController, UITableViewDelegate, UITab ...@@ -52,7 +52,10 @@ class FUSSearchViewController: FUSBaseViewController, UITableViewDelegate, UITab
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
self.searchTextField.becomeFirstResponder() // self.searchTextField.becomeFirstResponder()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
self?.searchTextField.becomeFirstResponder()
}
} }
override func viewDidLayoutSubviews() { override func viewDidLayoutSubviews() {
......
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
self.textView.backgroundColor = UIColor.fus_searchColor; self.textView.backgroundColor = UIColor.fus_searchColor;
self.textView.layer.cornerRadius = 8; self.textView.layer.cornerRadius = 8;
self.textView.layer.masksToBounds = YES; self.textView.layer.masksToBounds = YES;
self.textView.textColor = [UIColor whiteColor]; self.textView.textColor = [UIColor fus_textColorRich];
} }
return _textView; return _textView;
......
...@@ -1253,7 +1253,8 @@ static NSString *FUSWebRightBtnExtraInfoKey = @"FUSWebRightBtnExtraInfoKey"; ...@@ -1253,7 +1253,8 @@ static NSString *FUSWebRightBtnExtraInfoKey = @"FUSWebRightBtnExtraInfoKey";
if ([UIViewController fus_topViewController].navigationController) { if ([UIViewController fus_topViewController].navigationController) {
if ([UIViewController fus_topViewController].navigationController.viewControllers.count != 1) { if ([UIViewController fus_topViewController].navigationController.viewControllers.count != 1) {
[[UIViewController fus_topViewController].navigationController popToRootViewControllerAnimated:YES]; // [[UIViewController fus_topViewController].navigationController popToRootViewControllerAnimated:YES];
[[UIViewController fus_topViewController].navigationController popViewControllerAnimated:YES];
} else { } else {
[[UIViewController fus_topViewController].navigationController dismissViewControllerAnimated:YES completion:nil]; [[UIViewController fus_topViewController].navigationController dismissViewControllerAnimated:YES completion:nil];
} }
......
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