Commit 7a70fffb by pierce

Merge branch 'feature/UI修改版本' of http://git.yabolive.net:88/pidan/FuSiLive into feature/UI修改版本

parents f4110dd3 a0fa1f53
Showing with 607 additions and 75 deletions
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
00A36A522C1D8A69004D28FA /* FUSHomeNovaListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A512C1D8A69004D28FA /* FUSHomeNovaListModel.m */; }; 00A36A522C1D8A69004D28FA /* FUSHomeNovaListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A512C1D8A69004D28FA /* FUSHomeNovaListModel.m */; };
00A36A552C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A542C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m */; }; 00A36A552C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A542C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m */; };
00A36A592C1D9FD6004D28FA /* FUSLeftPopScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */; }; 00A36A592C1D9FD6004D28FA /* FUSLeftPopScrollView.m in Sources */ = {isa = PBXBuildFile; fileRef = 00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */; };
00B48E072C213CCD001E4872 /* FUSSettingInitDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */; };
BE0395D12C132E0F003EB21B /* BEComposerNodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BA2C132E0F003EB21B /* BEComposerNodeModel.m */; }; BE0395D12C132E0F003EB21B /* BEComposerNodeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BA2C132E0F003EB21B /* BEComposerNodeModel.m */; };
BE0395D22C132E0F003EB21B /* BEEffectDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BC2C132E0F003EB21B /* BEEffectDataManager.m */; }; BE0395D22C132E0F003EB21B /* BEEffectDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BC2C132E0F003EB21B /* BEEffectDataManager.m */; };
BE0395D32C132E0F003EB21B /* BEEffectManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BE2C132E0F003EB21B /* BEEffectManager.mm */; }; BE0395D32C132E0F003EB21B /* BEEffectManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = BE0395BE2C132E0F003EB21B /* BEEffectManager.mm */; };
...@@ -1455,6 +1456,8 @@ ...@@ -1455,6 +1456,8 @@
00A36A542C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSHomeNovaListBroadcastHelper.m; sourceTree = "<group>"; }; 00A36A542C1D8A7C004D28FA /* FUSHomeNovaListBroadcastHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FUSHomeNovaListBroadcastHelper.m; sourceTree = "<group>"; };
00A36A572C1D9FD6004D28FA /* FUSLeftPopScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSLeftPopScrollView.h; sourceTree = "<group>"; }; 00A36A572C1D9FD6004D28FA /* FUSLeftPopScrollView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FUSLeftPopScrollView.h; sourceTree = "<group>"; };
00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSLeftPopScrollView.m; sourceTree = "<group>"; }; 00A36A582C1D9FD6004D28FA /* FUSLeftPopScrollView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FUSLeftPopScrollView.m; 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>"; };
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>"; };
BE03959E2C132E0F003EB21B /* bef_effect_ai_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bef_effect_ai_api.h; sourceTree = "<group>"; }; BE03959E2C132E0F003EB21B /* bef_effect_ai_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bef_effect_ai_api.h; sourceTree = "<group>"; };
...@@ -5804,6 +5807,8 @@ ...@@ -5804,6 +5807,8 @@
BED0F3232C0C49C80017B285 /* FUSContryModel.m */, BED0F3232C0C49C80017B285 /* FUSContryModel.m */,
BED0F3242C0C49C80017B285 /* FUSUpdateModel.h */, BED0F3242C0C49C80017B285 /* FUSUpdateModel.h */,
BED0F3252C0C49C80017B285 /* FUSUpdateModel.m */, BED0F3252C0C49C80017B285 /* FUSUpdateModel.m */,
00B48E052C213CCD001E4872 /* FUSSettingInitDataModel.h */,
00B48E062C213CCD001E4872 /* FUSSettingInitDataModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -9298,6 +9303,7 @@ ...@@ -9298,6 +9303,7 @@
BED0F9D42C0C49C90017B285 /* FUSContryModel.m in Sources */, BED0F9D42C0C49C90017B285 /* FUSContryModel.m in Sources */,
BED0F8C02C0C49C80017B285 /* FUSBaofangPageTitleCell.m in Sources */, BED0F8C02C0C49C80017B285 /* FUSBaofangPageTitleCell.m in Sources */,
BE5F4D432C1D941E004B54AA /* FUSAudienceListView.m in Sources */, BE5F4D432C1D941E004B54AA /* FUSAudienceListView.m in Sources */,
00B48E072C213CCD001E4872 /* FUSSettingInitDataModel.m in Sources */,
BED0FC0A2C0C49CA0017B285 /* FUSIMZhaiXinViewController.m in Sources */, BED0FC0A2C0C49CA0017B285 /* FUSIMZhaiXinViewController.m in Sources */,
BED0FA772C0C49C90017B285 /* FUSAgoraHelper.m in Sources */, BED0FA772C0C49C90017B285 /* FUSAgoraHelper.m in Sources */,
BED0FB922C0C49CA0017B285 /* FUSSearchTableViewCell.swift in Sources */, BED0FB922C0C49CA0017B285 /* FUSSearchTableViewCell.swift in Sources */,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "FUSShareTipsModel.h" #import "FUSShareTipsModel.h"
#import "FUSBannerDataModel.h" #import "FUSBannerDataModel.h"
#import "FUSLangAreaCountryModel.h" #import "FUSLangAreaCountryModel.h"
#import "FUSSettingInitDataModel.h"
@interface FUSCacheDataShare : NSObject @interface FUSCacheDataShare : NSObject
...@@ -44,6 +45,9 @@ ...@@ -44,6 +45,9 @@
// 直播黑名单 // 直播黑名单
@property (nonatomic, strong) NSMutableDictionary *blockedListDict; @property (nonatomic, strong) NSMutableDictionary *blockedListDict;
/// 启动缓存的一些信息
@property (nonatomic, strong) FUSSettingInitDataModel *settingInitDataModel;
#pragma mark -- 热更新数据 #pragma mark -- 热更新数据
// 热数据MD5信息 // 热数据MD5信息
......
...@@ -10,9 +10,25 @@ ...@@ -10,9 +10,25 @@
#import "FUSZoneCacheOperate.h" #import "FUSZoneCacheOperate.h"
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN
typedef enum :NSInteger{
/// 个人空间
FUSMyHeaderButtonTypeMyZone = 0,
/// 亲密
FUSMyHeaderButtonTypeIntimacy,
/// 追踪
FUSMyHeaderButtonTypeFollow,
/// 粉丝
FUSMyHeaderButtonTypeFans,
/// 钻石
FUSMyHeaderButtonTypeDiamond,
/// 露水
FUSMyHeaderButtonTypeDew,
}FUSMyHeaderButtonType;
@interface FUSMyHeaderView : UIView @interface FUSMyHeaderView : UIView
@property (nonatomic, copy) void(^buttonDidClickedHander)(FUSMyHeaderButtonType type);
- (void)fus_setupHeaderViewWithModel:(FUSZoneInfosModel *)model; - (void)fus_setupHeaderViewWithModel:(FUSZoneInfosModel *)model;
/// 返回控件高度 /// 返回控件高度
......
...@@ -12,11 +12,10 @@ ...@@ -12,11 +12,10 @@
@interface FUSMyHeaderView () @interface FUSMyHeaderView ()
//@property (nonatomic, strong) UIButton *publishBtn;
//@property (nonatomic, strong) UIButton *myBtn;
@property (nonatomic, strong) UIButton *avatorBtn; @property (nonatomic, strong) UIButton *avatorBtn;
@property (nonatomic, strong) UILabel *nickNameLabel; @property (nonatomic, strong) UILabel *nickNameLabel;
@property (nonatomic, strong) UILabel *vipMarkLabel; //@property (nonatomic, strong) UILabel *vipMarkLabel;
@property (nonatomic, strong) UIImageView *vipMarkImgView;
@property (nonatomic, strong) UILabel *levelLabel; @property (nonatomic, strong) UILabel *levelLabel;
@property (nonatomic, strong) UIButton *ageBtn; @property (nonatomic, strong) UIButton *ageBtn;
@property (nonatomic, strong) UILabel *idLabel; @property (nonatomic, strong) UILabel *idLabel;
...@@ -87,23 +86,34 @@ ...@@ -87,23 +86,34 @@
make.left.top.bottom.equalTo(nickNameBgView); make.left.top.bottom.equalTo(nickNameBgView);
}]; }];
self.vipMarkLabel = [[UILabel alloc] init]; // self.vipMarkLabel = [[UILabel alloc] init];
self.vipMarkLabel.font = [UIFont fus_themeBoldFont:9]; // self.vipMarkLabel.font = [UIFont fus_themeBoldFont:9];
self.vipMarkLabel.textColor = [UIColor fus_textColorRich]; // self.vipMarkLabel.textColor = [UIColor fus_textColorRich];
self.vipMarkLabel.text = @"V"; // self.vipMarkLabel.text = @"V";
self.vipMarkLabel.textAlignment = NSTextAlignmentCenter; // self.vipMarkLabel.textAlignment = NSTextAlignmentCenter;
self.vipMarkLabel.layer.cornerRadius = 14 / 2.0f; // self.vipMarkLabel.layer.cornerRadius = 14 / 2.0f;
self.vipMarkLabel.layer.masksToBounds = YES; // self.vipMarkLabel.layer.masksToBounds = YES;
self.vipMarkLabel.backgroundColor = [UIColor fus_diamondBlue]; // self.vipMarkLabel.backgroundColor = [UIColor fus_diamondBlue];
[nickNameBgView addSubview:self.vipMarkLabel]; // [nickNameBgView addSubview:self.vipMarkLabel];
[self.vipMarkLabel mas_makeConstraints:^(MASConstraintMaker *make) { // [self.vipMarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.right.equalTo(nickNameBgView);
// make.centerY.equalTo(nickNameBgView.mas_centerY);
// make.left.equalTo(self.nickNameLabel.mas_right).offset(6);
// make.size.mas_equalTo(CGSizeMake(14, 14));
// }];
self.vipMarkImgView = [[UIImageView alloc] init];
self.vipMarkImgView.contentMode = UIViewContentModeScaleAspectFit;
[nickNameBgView addSubview:self.vipMarkImgView];
[self.vipMarkImgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(nickNameBgView); make.right.equalTo(nickNameBgView);
make.centerY.equalTo(nickNameBgView.mas_centerY); make.centerY.equalTo(nickNameBgView.mas_centerY);
make.left.equalTo(self.nickNameLabel.mas_right).offset(6); make.left.equalTo(self.nickNameLabel.mas_right).offset(6);
make.size.mas_equalTo(CGSizeMake(14, 14)); // make.size.mas_equalTo(CGSizeMake(14, 14));
make.height.offset(16);
}]; }];
UIView *sexBlankBgView = [[UIView alloc] init]; UIButton *sexBlankBgView = [UIButton buttonWithType:UIButtonTypeCustom];
[topBgView addSubview:sexBlankBgView]; [topBgView addSubview:sexBlankBgView];
[sexBlankBgView mas_makeConstraints:^(MASConstraintMaker *make) { [sexBlankBgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(nickNameBgView.mas_bottom).offset(4); make.top.equalTo(nickNameBgView.mas_bottom).offset(4);
...@@ -172,10 +182,14 @@ ...@@ -172,10 +182,14 @@
NSArray *labelsArray = @[self.intimacyNumLabel, self.followNumLabel, self.fansNumLabel]; NSArray *labelsArray = @[self.intimacyNumLabel, self.followNumLabel, self.fansNumLabel];
NSArray *titleArray = @[FUSLocalizationHelper.versionLocalString(@"親密"), FUSLocalizationHelper.versionLocalString(@"追蹤"), FUSLocalizationHelper.versionLocalString(@"粉絲")]; NSArray *titleArray = @[FUSLocalizationHelper.versionLocalString(@"親密"), FUSLocalizationHelper.versionLocalString(@"追蹤"), FUSLocalizationHelper.versionLocalString(@"粉絲")];
NSArray *intimacyTagList = @[@(FUSMyHeaderButtonTypeIntimacy), @(FUSMyHeaderButtonTypeFollow), @(FUSMyHeaderButtonTypeFans)];
NSMutableArray *intimacyBlankViewsArray = [[NSMutableArray alloc] init]; NSMutableArray *intimacyBlankViewsArray = [[NSMutableArray alloc] init];
for (int i = 0; i < titleArray.count; i++) { for (int i = 0; i < titleArray.count; i++) {
UIView *tempBgView = [[UIView alloc] init]; UIButton *tempBgView = [UIButton buttonWithType:UIButtonTypeCustom];
[topBottomBgImageView addSubview:tempBgView]; [topBottomBgImageView addSubview:tempBgView];
NSNumber *tagNum = intimacyTagList[i];
tempBgView.tag = [tagNum intValue];
[tempBgView addTarget:self action:@selector(fus_commondBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UILabel *tempNumLabel = labelsArray[i]; UILabel *tempNumLabel = labelsArray[i];
tempNumLabel.font = [UIFont fus_themeBoldFont:25]; tempNumLabel.font = [UIFont fus_themeBoldFont:25];
...@@ -221,10 +235,15 @@ ...@@ -221,10 +235,15 @@
NSArray *jewBlankImgNameList = @[@"fus_my_setting_header_jew_icon", @"fus_my_setting_header_dew_icon"]; NSArray *jewBlankImgNameList = @[@"fus_my_setting_header_jew_icon", @"fus_my_setting_header_dew_icon"];
NSArray *jewLabelsList = @[self.jewNumLabel, self.dewNumLabel]; NSArray *jewLabelsList = @[self.jewNumLabel, self.dewNumLabel];
NSArray *jewBtnTagList = @[@(FUSMyHeaderButtonTypeDiamond), @(FUSMyHeaderButtonTypeDew)];
NSMutableArray *jewBlankViewsList = [[NSMutableArray alloc] init]; NSMutableArray *jewBlankViewsList = [[NSMutableArray alloc] init];
for (int i = 0; i < jewBlankImgNameList.count; i++) { for (int i = 0; i < jewBlankImgNameList.count; i++) {
UIImageView *tempBgImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fus_my_setting_header_jewBlank_bg"]]; UIButton *tempBgImgView = [UIButton buttonWithType:UIButtonTypeCustom];
[tempBgImgView setBackgroundImage:[UIImage imageNamed:@"fus_my_setting_header_jewBlank_bg"] forState:UIControlStateNormal];
[self addSubview:tempBgImgView]; [self addSubview:tempBgImgView];
NSNumber *tagNum = jewBtnTagList[i];
tempBgImgView.tag = [tagNum intValue];
[tempBgImgView addTarget:self action:@selector(fus_commondBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
UIImageView *devImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:jewBlankImgNameList[i]]]; UIImageView *devImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:jewBlankImgNameList[i]]];
devImgView.contentMode = UIViewContentModeScaleAspectFit; devImgView.contentMode = UIViewContentModeScaleAspectFit;
...@@ -251,17 +270,24 @@ ...@@ -251,17 +270,24 @@
make.height.offset(94); make.height.offset(94);
}]; }];
// [self.avatorBtn setBackgroundColor:[UIColor yellowColor]]; self.avatorBtn.tag = FUSMyHeaderButtonTypeMyZone;
// self.idLabel.text = @"ID: 21412421"; [self.avatorBtn addTarget:self action:@selector(fus_commondBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
// self.levelLabel.text = @" 30 "; sexBlankBgView.tag = FUSMyHeaderButtonTypeMyZone;
// [self.ageBtn setTitle:@"30" forState:UIControlStateNormal]; [sexBlankBgView addTarget:self action:@selector(fus_commondBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
// self.dewNumLabel.text = @"3000";
// self.jewNumLabel.text = @"5000"; [copyBgBtn addTarget:self action:@selector(fus_copyBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
// self.fansNumLabel.text = @"32346"; }
// self.nickNameLabel.text = @"34h43rh34";
// self.followNumLabel.text = @"30"; #pragma mark --- button did clicked
// self.intimacyNumLabel.text = @"80"; -(void)fus_copyBtnDidClicked:(UIButton *)btn{
// self.fansNumAddedLabel.text = @" +20 "; [UIPasteboard generalPasteboard].string = _zoneModel.uid;
[FUSDialogView fus_showDialog:FUSLocalizationHelper.localString(@"复制成功")];
}
-(void)fus_commondBtnDidClicked:(UIButton *)btn{
if (self.buttonDidClickedHander) {
self.buttonDidClickedHander(btn.tag);
}
} }
#pragma mark --- method #pragma mark --- method
...@@ -318,6 +344,8 @@ ...@@ -318,6 +344,8 @@
[self.ageBtn mas_updateConstraints:^(MASConstraintMaker *make) { [self.ageBtn mas_updateConstraints:^(MASConstraintMaker *make) {
make.width.offset(ageStringSzie.width + 9 + 10); make.width.offset(ageStringSzie.width + 9 + 10);
}]; }];
self.vipMarkImgView.image = [UIImage fus_imageWithLevel:[model.level integerValue]];
} }
......
...@@ -15,13 +15,23 @@ ...@@ -15,13 +15,23 @@
#import "FUSSettingViewController.h" #import "FUSSettingViewController.h"
#import "FUSSingleChatViewController.h" #import "FUSSingleChatViewController.h"
#import "FUSZoneTaskCenterViewController.h" #import "FUSZoneTaskCenterViewController.h"
#import "FUSMyZoneViewController.h"
#import "FUSNewsFeedHelper.h"
#import "FUSIMZhaiXinViewController.h"
#import "FUSFocuseViewController.h"
#import "FUSFollowViewController.h"
#import "FUSRechargeViewController.h"
#import "FUSDewWebViewcontroller.h"
#import "FUSZoneSendJewelRankController.h"
#import "FUSMotoringWareHouseViewController.h"
#import "FUSBoundAgentInfoView.h"
typedef NS_ENUM(NSInteger, FUSMySettingItemType){ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
FUSMySettingItemTypeImAnchor = 0, FUSMySettingItemTypeImAnchor = 0,
FUSMySettingItemTypeSetIntitationCode, FUSMySettingItemTypeSetIntitationCode,
FUSMySettingItemTypeIntitationReward, FUSMySettingItemTypeIntitationReward,
FUSMySettingItemTypeTaskReward, FUSMySettingItemTypeTaskReward,
FUSMySettingItemTypeGiveAwayDew, FUSMySettingItemTypeGiveAwayDiamond,
FUSMySettingItemTypeBackpack, FUSMySettingItemTypeBackpack,
FUSMySettingItemTypeHelp, FUSMySettingItemTypeHelp,
FUSMySettingItemTypeSetting FUSMySettingItemTypeSetting
...@@ -39,6 +49,13 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -39,6 +49,13 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
@property (nonatomic, strong) UIButton *publishBtn; @property (nonatomic, strong) UIButton *publishBtn;
@property (nonatomic, strong) FUSMyHeaderView *headerView; @property (nonatomic, strong) FUSMyHeaderView *headerView;
// 存储填写邀请码的信息,这里需要频繁改动
@property (nonatomic, strong) NSTimer *inputInviteCodeTimer;
@property (nonatomic, strong) FUSCustomSettingItem *inputInviteCodeItem;
@property (nonatomic, strong) NSIndexPath *inputInviteCodeIndexPath;
/// 剩余时间
@property (nonatomic, assign) CGFloat leftTime;
/// 数据 /// 数据
@property (nonatomic, strong) FUSZoneInfosModel *zoneModel; @property (nonatomic, strong) FUSZoneInfosModel *zoneModel;
...@@ -51,8 +68,14 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -51,8 +68,14 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
self = [super init]; self = [super init];
if (self) { if (self) {
[self fus_createUI]; [self fus_createUI];
[self fus_createItems]; [self fus_rebuildItemsUI];
[self fus_updateDataSourceWithType:ReadMemoryBegin]; [self fus_updateDataSourceWithType:ReadMemoryBegin];
if (self.fus_needShowInviteTaskDewItems) {
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(receiveBoundAgentResult:) name:BOUND_AGENT_RESULT object:nil];
// 任务体系完成命令
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(recieveTaskCompleteNotification:) name:STR(ZONE_TASK_COMPLETE) object:nil];
}
} }
return self; return self;
} }
...@@ -98,30 +121,63 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -98,30 +121,63 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
make.width.equalTo(self.publishBtn.mas_height); make.width.equalTo(self.publishBtn.mas_height);
}]; }];
FUSWeakSelf(weakself);
self.headerView.buttonDidClickedHander = ^(FUSMyHeaderButtonType type) {
[weakself fus_headerItemDidClicked:type];
};
[self.myzoneBtn addTarget:self action:@selector(myzoneBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.myzoneBtn addTarget:self action:@selector(myzoneBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.publishBtn addTarget:self action:@selector(publishBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.publishBtn addTarget:self action:@selector(publishBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
} }
-(void)fus_createItems{ -(void)fus_rebuildItemsUI{
NSArray *section1 = @[@(FUSMySettingItemTypeImAnchor)]; NSArray *section1 = @[@(FUSMySettingItemTypeImAnchor)];
NSArray *section2 = @[@(FUSMySettingItemTypeSetIntitationCode), @(FUSMySettingItemTypeIntitationReward), @(FUSMySettingItemTypeTaskReward)]; // NSArray *section2 = @[@(FUSMySettingItemTypeSetIntitationCode), @(FUSMySettingItemTypeIntitationReward), @(FUSMySettingItemTypeTaskReward)];
NSArray *section3 = @[@(FUSMySettingItemTypeGiveAwayDew)]; NSMutableArray *section2 = [[NSMutableArray alloc] init];
NSArray *section3 = @[@(FUSMySettingItemTypeGiveAwayDiamond)];
NSArray *section4 = @[@(FUSMySettingItemTypeBackpack)]; NSArray *section4 = @[@(FUSMySettingItemTypeBackpack)];
NSArray *section5 = @[@(FUSMySettingItemTypeHelp), @(FUSMySettingItemTypeSetting)]; NSArray *section5 = @[@(FUSMySettingItemTypeHelp), @(FUSMySettingItemTypeSetting)];
NSArray *itemTypeSectionList = @[section1, section2, section3, section4, section5];
NSMutableArray *itemTypeSectionList = [[NSMutableArray alloc] init];
[itemTypeSectionList addObject:section1];
// 处理邀请有奖模块显示逻辑
if (self.fus_needShowInviteTaskDewItems){
NSDictionary *infoDic = [[NSUserDefaults standardUserDefaults] objectForKey:BOUND_AGENT_INFO];
if (infoDic != nil) {
if ([infoDic[@"bindagent"] integerValue] == 0){
if ([_zoneModel.invite[@"isShow"] boolValue]) {
[section2 addObject:@(FUSMySettingItemTypeIntitationReward)];
}
}else if ([infoDic[@"bindagent"] integerValue] == 1){
if ([_zoneModel.invite[@"isShow"] boolValue]) {
[section2 addObjectsFromArray:@[@(FUSMySettingItemTypeSetIntitationCode), @(FUSMySettingItemTypeIntitationReward)]];
}else {
[section2 addObject:@(FUSMySettingItemTypeSetIntitationCode)];
}
}
}
[section2 addObject:@(FUSMySettingItemTypeTaskReward)];
[itemTypeSectionList addObject:section2];
}
self.inputInviteCodeItem = nil;
self.inputInviteCodeIndexPath = nil;
[self.allGroups removeAllObjects]; [self.allGroups removeAllObjects];
for (NSArray *evSection in itemTypeSectionList) { [itemTypeSectionList addObjectsFromArray:@[section3, section4, section5]];
// for (NSArray *evSection in itemTypeSectionList) {
for (int i = 0; i < itemTypeSectionList.count; i++) {
NSArray *evSection = itemTypeSectionList[i];
FUSCustomSettingGroup *tempGroup = [self fus_createSettingGroup]; FUSCustomSettingGroup *tempGroup = [self fus_createSettingGroup];
NSMutableArray *groupItemList = [[NSMutableArray alloc] init]; NSMutableArray *groupItemList = [[NSMutableArray alloc] init];
if (evSection == itemTypeSectionList.lastObject) { if (evSection == itemTypeSectionList.lastObject) {
tempGroup.groupFooterHeight = UIView.fus_tabbarHeight; tempGroup.groupFooterHeight = UIView.fus_tabbarHeight;
} }
for (NSNumber *itemTypVaule in evSection) { // for (NSNumber *itemTypVaule in evSection) {
for (int j = 0; j < evSection.count; j++) {
NSNumber *itemTypVaule = evSection[j];
FUSCustomSettingItem *itemModel = [FUSCustomSettingItem fus_itemWithIcon:[self fus_getItemIconName:itemTypVaule.integerValue] title:[self fus_getItemTitle:itemTypVaule.integerValue] type:CustomSettingItemTypeShowTextAndArrow]; FUSCustomSettingItem *itemModel = [FUSCustomSettingItem fus_itemWithIcon:[self fus_getItemIconName:itemTypVaule.integerValue] title:[self fus_getItemTitle:itemTypVaule.integerValue] type:CustomSettingItemTypeShowTextAndArrow];
itemModel.font = [UIFont fus_themeBoldFont:17]; itemModel.font = [UIFont fus_themeBoldFont:17];
itemModel.titleColor = [UIColor fus_textColorRich]; itemModel.titleColor = [UIColor fus_textColorRich];
...@@ -136,13 +192,15 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -136,13 +192,15 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
// itemModel.rightShowText = @"23:06:23"; // itemModel.rightShowText = @"23:06:23";
itemModel.rightShowTextFont = [UIFont fus_themeFont:17]; itemModel.rightShowTextFont = [UIFont fus_themeFont:17];
itemModel.rightShowTextColor = [UIColor fus_textColorLight]; itemModel.rightShowTextColor = [UIColor fus_textColorLight];
self.inputInviteCodeItem = itemModel;
self.inputInviteCodeIndexPath = [NSIndexPath indexPathForRow:j inSection:i];
break; break;
case FUSMySettingItemTypeIntitationReward: case FUSMySettingItemTypeIntitationReward:
// itemModel.rightShowText = @"798"; // itemModel.rightShowText = @"798";
itemModel.rightShowTextColor = [UIColor fus_fireGreen]; itemModel.rightShowTextColor = [UIColor fus_fireGreen];
itemModel.rightShowImage = [UIImage fus_fireIcon]; itemModel.rightShowImage = [UIImage fus_fireIcon];
break; break;
case FUSMySettingItemTypeGiveAwayDew: case FUSMySettingItemTypeGiveAwayDiamond:
// itemModel.rightShowText = @"520"; // itemModel.rightShowText = @"520";
itemModel.rightShowTextColor = [UIColor fus_diamondBlue]; itemModel.rightShowTextColor = [UIColor fus_diamondBlue];
itemModel.rightShowImage = [UIImage imageNamed:@"fus_my_setting_header_jew_icon"]; itemModel.rightShowImage = [UIImage imageNamed:@"fus_my_setting_header_jew_icon"];
...@@ -159,7 +217,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -159,7 +217,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
FUSWeakSelf(weakself); FUSWeakSelf(weakself);
itemModel.itemClick = ^(FUSCustomSettingItem *item) { itemModel.itemClick = ^(FUSCustomSettingItem *item) {
[weakself fus_itemDidClicked:item.itemTag]; [weakself fus_itemDidClicked:item];
}; };
[groupItemList addObject:itemModel]; [groupItemList addObject:itemModel];
...@@ -169,7 +227,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -169,7 +227,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
} }
self.tableView.allGroups = self.allGroups; self.tableView.allGroups = self.allGroups;
[self.tableView reloadData]; [self fus_reloadItemData];
} }
- (FUSCustomSettingGroup *)fus_createSettingGroup { - (FUSCustomSettingGroup *)fus_createSettingGroup {
...@@ -196,7 +254,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -196,7 +254,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
case FUSMySettingItemTypeSetIntitationCode: return FUSLocalizationHelper.versionLocalString(@"填寫邀請碼"); case FUSMySettingItemTypeSetIntitationCode: return FUSLocalizationHelper.versionLocalString(@"填寫邀請碼");
case FUSMySettingItemTypeIntitationReward: return FUSLocalizationHelper.versionLocalString(@"邀請獎勵"); case FUSMySettingItemTypeIntitationReward: return FUSLocalizationHelper.versionLocalString(@"邀請獎勵");
case FUSMySettingItemTypeTaskReward: return FUSLocalizationHelper.versionLocalString(@"任務獎勵"); case FUSMySettingItemTypeTaskReward: return FUSLocalizationHelper.versionLocalString(@"任務獎勵");
case FUSMySettingItemTypeGiveAwayDew: return FUSLocalizationHelper.versionLocalString(@"贈出寶石"); case FUSMySettingItemTypeGiveAwayDiamond: return FUSLocalizationHelper.versionLocalString(@"贈出寶石");
case FUSMySettingItemTypeBackpack: return FUSLocalizationHelper.versionLocalString(@"背包"); case FUSMySettingItemTypeBackpack: return FUSLocalizationHelper.versionLocalString(@"背包");
case FUSMySettingItemTypeHelp: return FUSLocalizationHelper.versionLocalString(@"幫助"); case FUSMySettingItemTypeHelp: return FUSLocalizationHelper.versionLocalString(@"幫助");
case FUSMySettingItemTypeSetting: return FUSLocalizationHelper.versionLocalString(@"設置"); case FUSMySettingItemTypeSetting: return FUSLocalizationHelper.versionLocalString(@"設置");
...@@ -209,7 +267,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -209,7 +267,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
case FUSMySettingItemTypeSetIntitationCode: return @"fus_my_setting_item_invitationCode_icon"; case FUSMySettingItemTypeSetIntitationCode: return @"fus_my_setting_item_invitationCode_icon";
case FUSMySettingItemTypeIntitationReward: return @"fus_my_setting_item_invitationReward_icon"; case FUSMySettingItemTypeIntitationReward: return @"fus_my_setting_item_invitationReward_icon";
case FUSMySettingItemTypeTaskReward: return @"fus_my_setting_item_taskReward_icon"; case FUSMySettingItemTypeTaskReward: return @"fus_my_setting_item_taskReward_icon";
case FUSMySettingItemTypeGiveAwayDew: return @"fus_my_setting_item_giveAwayDew_icon"; case FUSMySettingItemTypeGiveAwayDiamond: return @"fus_my_setting_item_giveAwayDiamond_icon";
case FUSMySettingItemTypeBackpack: return @"fus_my_setting_item_backpack_icon"; case FUSMySettingItemTypeBackpack: return @"fus_my_setting_item_backpack_icon";
case FUSMySettingItemTypeHelp: return @"fus_my_setting_item_help_icon"; case FUSMySettingItemTypeHelp: return @"fus_my_setting_item_help_icon";
case FUSMySettingItemTypeSetting: return @"fus_my_setting_item_setting_icon"; case FUSMySettingItemTypeSetting: return @"fus_my_setting_item_setting_icon";
...@@ -218,7 +276,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -218,7 +276,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
} }
#pragma mark --- method #pragma mark --- method
-(void)fus_reloadItemUI{ -(void)fus_reloadItemData{
for (FUSCustomSettingGroup *sectionModel in self.allGroups) { for (FUSCustomSettingGroup *sectionModel in self.allGroups) {
for (FUSCustomSettingItem *itemModel in sectionModel.items) { for (FUSCustomSettingItem *itemModel in sectionModel.items) {
switch (itemModel.itemTag) { switch (itemModel.itemTag) {
...@@ -229,15 +287,139 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -229,15 +287,139 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
itemModel.rightShowText = _zoneModel.bonds; itemModel.rightShowText = _zoneModel.bonds;
} }
break; break;
case FUSMySettingItemTypeGiveAwayDew: case FUSMySettingItemTypeGiveAwayDiamond:
itemModel.rightShowText = _zoneModel.rich; itemModel.rightShowText = _zoneModel.rich;
break; break;
case FUSMySettingItemTypeSetIntitationCode:{
BOOL isClick = [[[NSUserDefaults standardUserDefaults] objectForKey:ZONE_BOUND_AGENT_RED_CLICK] boolValue];
itemModel.isShowRedCirclePoint = !isClick;
itemModel.rightShowText = @"";
}
break;
case FUSMySettingItemTypeIntitationReward:{
BOOL isClickInviteItem = [[[NSUserDefaults standardUserDefaults] objectForKey:INVITEITEM_IS_CLICK] boolValue];
itemModel.rightShowText = _zoneModel.invite[@"content"];
if ([_zoneModel.invite[@"isNotice"] boolValue]) {
itemModel.isShowRedCirclePoint = YES;
if (isClickInviteItem == NO) {
[[NSNotificationCenter defaultCenter] postNotificationName:ZONE_SHOW_RED_POINT object:nil];
}
} else {
itemModel.isShowRedCirclePoint = NO;
}
}
break;
default: default:
break; break;
} }
} }
} }
[self.tableView reloadData]; [self.tableView reloadData];
[self fus_startInputInviteCodeTimer];
}
/// 处理填写邀请码的timer倒计时
-(void)fus_startInputInviteCodeTimer{
if (self.inputInviteCodeTimer) {
[self.inputInviteCodeTimer invalidate];
self.inputInviteCodeTimer = nil;
}
if (FUSConfig.sharedInstanced.devConfigs.appStatus) {
return;
}
if (self.inputInviteCodeItem == nil || self.inputInviteCodeIndexPath == nil) {
return;
}
[self changeTimeFormatteWithLeftTime:nil];
self.inputInviteCodeTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:[YYWeakProxy proxyWithTarget:self] selector:@selector(fus_inputInviteCodeTimerRun:) userInfo:nil repeats:YES];
}
-(void)fus_inputInviteCodeTimerRun:(NSTimer *)timer{
self.leftTime--;
self.inputInviteCodeItem.rightShowText = [self changeTimeFormatteWithLeftTime:[NSString stringWithFormat:@"%f",_leftTime]];
if (self.leftTime <= 0) {
[self receiveBoundAgentResult:nil];
}
[self.tableView reloadRowAtIndexPath:self.inputInviteCodeIndexPath withRowAnimation:UITableViewRowAnimationNone];
}
- (BOOL)fus_needShowInviteTaskDewItems {
BOOL needShow = [[[NSUserDefaults standardUserDefaults] objectForKey:ZONE_TASK_INVITE_DEW_ITEM_SWITCH] boolValue];
return needShow;
}
- (NSString *)changeTimeFormatteWithLeftTime:(NSString *)leftTimeString {
CGFloat leftTime = 0.0;
if ([NSString isNull:leftTimeString]) {
leftTime = [self calculateLeftTime];
}else {
leftTime = leftTimeString.floatValue;
}
NSInteger hour = leftTime / 60 / 60;
NSInteger min = (leftTime - hour * 60 * 60) / 60;
NSInteger sec = leftTime - hour * 60 * 60 - min * 60;
NSString *timeFormatteString = [NSString stringWithFormat:@"%02ld:%02ld:%02ld",(long)hour,(long)min,(long)sec];
// return [NSString stringWithFormat:FUSLocalizationHelper.localString(@"%@内有效"),timeFormatteString];
return timeFormatteString;
}
- (CGFloat)calculateLeftTime {
NSDictionary *infoDic = [[NSUserDefaults standardUserDefaults] objectForKey:BOUND_AGENT_INFO];
if ([infoDic[@"bindagent"] integerValue] == 1) {
NSString *lastTimeString= infoDic[@"getResultDate"];
NSDateFormatter *lastFormat = [[NSDateFormatter alloc] init];
lastFormat.dateFormat = @"YYYY-MM-dd HH:mm";
NSDate *lastDate = [lastFormat dateFromString:lastTimeString];
NSDate *nowDate = [NSDate date];
NSTimeZone *timeZone = [NSTimeZone systemTimeZone];
//上次时间
lastDate = [lastDate dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:lastDate]];
//当前时间
nowDate = [nowDate dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:nowDate]];
//时间间隔
NSInteger intevalTime = [nowDate timeIntervalSinceReferenceDate] - [lastDate timeIntervalSinceReferenceDate];
// 计算剩余时间
CGFloat leftTime = [infoDic[@"bindagenttime"] floatValue] * 60 - intevalTime / 10;
// 记录剩余时间
_leftTime = leftTime;
return leftTime;
}
return 0;
}
#pragma mark --- notification
- (void)receiveBoundAgentResult:(NSNotification *)notifi {
if (!FUSConfig.sharedInstanced.devConfigs.appStatus) {
return;
}
if (self.fus_needShowInviteTaskDewItems && self.inputInviteCodeItem != nil) {
for (FUSCustomSettingGroup *tempGroup in self.allGroups) {
if ([tempGroup.items containsObject:self.inputInviteCodeItem]) {
NSMutableArray *items = [tempGroup.items mutableCopy];
[items removeObject:self.inputInviteCodeItem];
tempGroup.items = items;
break;
}
}
self.inputInviteCodeItem = nil;
self.inputInviteCodeIndexPath = nil;
[self.tableView reloadData];
}
[self.inputInviteCodeTimer invalidate];
self.inputInviteCodeTimer = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self name:BOUND_AGENT_RESULT object:nil];
} }
#pragma mark --- data #pragma mark --- data
...@@ -247,6 +429,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -247,6 +429,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
[FUSZoneCacheOperate fus_getMyZoneInfosWithType:type success:^(FUSZoneInfosModel *zoneModel) { [FUSZoneCacheOperate fus_getMyZoneInfosWithType:type success:^(FUSZoneInfosModel *zoneModel) {
weakSelf.zoneModel = zoneModel; weakSelf.zoneModel = zoneModel;
[weakSelf.headerView fus_setupHeaderViewWithModel:zoneModel]; [weakSelf.headerView fus_setupHeaderViewWithModel:zoneModel];
[weakSelf fus_rebuildItemsUI];
} failure:^(NSString *msg, NSInteger code) { } failure:^(NSString *msg, NSInteger code) {
...@@ -254,15 +437,134 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -254,15 +437,134 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
} }
#pragma mark --- button did clicked #pragma mark --- button did clicked
-(void)fus_itemDidClicked:(FUSMySettingItemType)type{ -(void)fus_headerItemDidClicked:(FUSMyHeaderButtonType)type{
switch (type) { switch (type) {
case FUSMyHeaderButtonTypeMyZone:{
FUSMyZoneViewController *myZoneVC = [[FUSMyZoneViewController alloc] init];
myZoneVC.zoneUid = self.zoneModel.uid;
myZoneVC.isFromLiveRoomChat = NO;
[self.parentController.navigationController pushViewController:myZoneVC animated:YES];
}
break;
case FUSMyHeaderButtonTypeIntimacy:{
if (FUSConfig.sharedInstanced.devConfigs.appStatus) return ;
FUSIMZhaiXinViewController *zhaixinVC = [[FUSIMZhaiXinViewController alloc] init];
zhaixinVC.vcType = FUSIMZhaiXinVCTypeFriend;
[self.parentController.navigationController pushViewController:zhaixinVC animated:YES];
}
break;
case FUSMyHeaderButtonTypeFollow:{
FUSFocuseViewController *focusVC = [[FUSFocuseViewController alloc] initWithUID:self.zoneModel.uid];
[self.parentController.navigationController pushViewController:focusVC animated:YES];
}
break;
case FUSMyHeaderButtonTypeFans:{
FUSFollowViewController *followVC = [[FUSFollowViewController alloc] init];
followVC.uid = self.zoneModel.uid;
[self.parentController.navigationController pushViewController:followVC animated:YES];
}
break;
case FUSMyHeaderButtonTypeDiamond:{
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:self.parentController];
}
break;
case FUSMyHeaderButtonTypeDew:{
FUSDewWebViewcontroller *dewVC = [[FUSDewWebViewcontroller alloc] init];
[self.parentController.navigationController pushViewController:dewVC animated:YES];
}
break;
default:
break;
}
}
-(void)fus_itemDidClicked:(FUSCustomSettingItem *)item{
switch (item.itemTag) {
case FUSMySettingItemTypeImAnchor:{ case FUSMySettingItemTypeImAnchor:{
FUSImAnchorViewController *vc = [[FUSImAnchorViewController alloc] init]; FUSImAnchorViewController *vc = [[FUSImAnchorViewController alloc] init];
vc.zoneModel = self.zoneModel; vc.zoneModel = self.zoneModel;
[[UINavigationController fus_topViewController].navigationController pushViewController:vc animated:YES]; [[UINavigationController fus_topViewController].navigationController pushViewController:vc animated:YES];
} }
break; break;
case FUSMySettingItemTypeSetIntitationCode:{
BOOL isClick = [[[NSUserDefaults standardUserDefaults] objectForKey:ZONE_BOUND_AGENT_RED_CLICK] boolValue];
[FUSTalkingData fus_trackEvent:EVENT_ME_FILLINGINVITINGCODE];
FUSBoundAgentInfoView *agentView = [[FUSBoundAgentInfoView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenH)];
agentView.leftTime = self.leftTime;
[agentView showWithView:[UIApplication sharedApplication].keyWindow];
self.inputInviteCodeItem.rightShowImage = [UIImage imageWithColor:[UIColor clearColor] size:CGSizeMake(8, 8)];
if (isClick) return;
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:ZONE_BOUND_AGENT_RED_CLICK];
[self.tableView reloadData];
}
break;
case FUSMySettingItemTypeIntitationReward:{
[FUSTalkingData fus_trackEvent:EVENT_ME_INVITATION_BONUS];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:INVITEITEM_IS_CLICK];
item.isShowRedCirclePoint = NO;
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];
[FUSZoneHttpRequest fus_reportZoneInviteRedPointSuccess:^{
} failure:^(NSString *msg, int code) {
}];
[self.tableView reloadData];
}
break;
case FUSMySettingItemTypeTaskReward:{
[FUSTalkingData fus_trackEvent:EVENT_ME_TASKCENTER];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:TASKCENTER_IS_CLICK];
// if (item.isShowRedCirclePoint) {
// item.isShowRedCirclePoint = NO;
// [weakSelf.tableView reloadData];
// }
FUSZoneTaskCenterViewController *taskCenterVC = [[FUSZoneTaskCenterViewController alloc] init];
[self.parentController.navigationController pushViewController:taskCenterVC animated:YES];
}
break;
case FUSMySettingItemTypeGiveAwayDiamond:{
FUSZoneSendJewelRankController *jewelRankVC = [[FUSZoneSendJewelRankController alloc] init];
[self.parentController.navigationController pushViewController:jewelRankVC animated:YES];
}
break;
case FUSMySettingItemTypeBackpack:{
switch (self.zoneModel.vehicleMall) {
case FUSZoneMotoJumpPageTypeDefalut: {
FUSMotoringWareHouseViewController *motorVC = [[FUSMotoringWareHouseViewController alloc] init];
[self.parentController.navigationController pushViewController:motorVC animated:YES];
break;
}
case FUSZoneMotoJumpPageTypeWebPage: {
FUSWKWebViewController *wkwVC = [[FUSWKWebViewController alloc] init];
wkwVC.needShowReload = YES;
wkwVC.shouldIncludeIdentifyInfo = YES;
wkwVC.needHideWebTitleBar = YES;
wkwVC.webUrlString = URL_WEB_MOTOCAR_SHOP;
// 包含用户信息参数
[self.parentController.navigationController pushViewController:wkwVC animated:YES];
break;
}
}
}
break;
case FUSMySettingItemTypeSetting:{ case FUSMySettingItemTypeSetting:{
FUSSettingViewController *settingVC = [[FUSSettingViewController alloc] init]; FUSSettingViewController *settingVC = [[FUSSettingViewController alloc] init];
[self.parentController.navigationController pushViewController:settingVC animated:YES]; [self.parentController.navigationController pushViewController:settingVC animated:YES];
...@@ -281,27 +583,22 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){ ...@@ -281,27 +583,22 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
[self.parentController.navigationController pushViewController:webVC animated:YES]; [self.parentController.navigationController pushViewController:webVC animated:YES];
} }
} }
case FUSMySettingItemTypeTaskReward:{
[FUSTalkingData fus_trackEvent:EVENT_ME_TASKCENTER];
[[NSUserDefaults standardUserDefaults] setObject:@(YES) forKey:TASKCENTER_IS_CLICK];
// if (item.isShowRedCirclePoint) {
// item.isShowRedCirclePoint = NO;
// [weakSelf.tableView reloadData];
// }
FUSZoneTaskCenterViewController *taskCenterVC = [[FUSZoneTaskCenterViewController alloc] init];
[self.parentController.navigationController pushViewController:taskCenterVC animated:YES];
}
break; break;
default: default:
break; break;
} }
} }
-(void)myzoneBtnDidClicked:(UIButton *)btn{ -(void)myzoneBtnDidClicked:(UIButton *)btn{
FUSMyZoneViewController *myZoneVC = [[FUSMyZoneViewController alloc] init];
myZoneVC.zoneUid = [FUSCacheDataShare shareStore].userDetailInfo.uid;
[self.parentController.navigationController pushViewController:myZoneVC animated:YES];
} }
-(void)publishBtnDidClicked:(UIButton *)btn{ -(void)publishBtnDidClicked:(UIButton *)btn{
btn.enabled = NO;
FUSNewsFeedPublishType type = FUSNewsFeedPublishTypeAll;
[FUSNewsFeedHelper fus_publishNewsFeedWithType:type complete:^{
btn.enabled = YES;
}];
} }
#pragma mark getter and setter #pragma mark getter and setter
......
...@@ -126,6 +126,12 @@ ...@@ -126,6 +126,12 @@
} failure:^(NSString *msg, int code) { } failure:^(NSString *msg, int code) {
[FUSDialogView fus_showDialog:msg]; [FUSDialogView fus_showDialog:msg];
if (autoCall) {
// 为了让下拉刷新可以回调
if (self.delegate && [self.delegate respondsToSelector:@selector(fus_homeViewViewModelAnchorListDidUpdate:)]) {
[self.delegate fus_homeViewViewModelAnchorListDidUpdate:FUSHomeViewAnchorListTypeNormal];
}
}
}]; }];
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "FUSImAnchorViewController.h" #import "FUSImAnchorViewController.h"
#import "FUSImAnchorHeaderView.h" #import "FUSImAnchorHeaderView.h"
#import "FUSSettingTableView.h" #import "FUSSettingTableView.h"
#import "FUSCacheDataShare.h"
typedef NS_ENUM(NSInteger, FUSImAnchorItemType){ typedef NS_ENUM(NSInteger, FUSImAnchorItemType){
FUSImAnchorItemTypeLiveTask = 1, FUSImAnchorItemTypeLiveTask = 1,
...@@ -85,8 +86,14 @@ typedef NS_ENUM(NSInteger, FUSImAnchorItemType){ ...@@ -85,8 +86,14 @@ typedef NS_ENUM(NSInteger, FUSImAnchorItemType){
}]; }];
FUSWeakSelf(weakself);
[self.publishBtn addTarget:self action:@selector(fus_publishBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside]; [self.publishBtn addTarget:self action:@selector(fus_publishBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
[self.returnBtn addTarget:self action:@selector(fus_popViewController) forControlEvents:UIControlEventTouchUpInside]; [self.returnBtn addTarget:self action:@selector(fus_popViewController) forControlEvents:UIControlEventTouchUpInside];
self.headerView.withdrawBtnClickedHandler = ^{
FUSWKWebViewController *vc = [[FUSWKWebViewController alloc] init];
vc.webUrlString = [FUSCacheDataShare shareStore].settingInitDataModel.withdrawAddress;
[weakself.navigationController pushViewController:vc animated:YES];
};
} }
-(void)fus_createItems{ -(void)fus_createItems{
...@@ -211,7 +218,35 @@ typedef NS_ENUM(NSInteger, FUSImAnchorItemType){ ...@@ -211,7 +218,35 @@ typedef NS_ENUM(NSInteger, FUSImAnchorItemType){
#pragma mark --- button did clicked #pragma mark --- button did clicked
-(void)fus_itemDidClicked:(FUSImAnchorItemType)type{ -(void)fus_itemDidClicked:(FUSImAnchorItemType)type{
switch (type) {
case FUSImAnchorItemTypeLiveTask:{
FUSWKWebViewController *vc = [[FUSWKWebViewController alloc] init];
vc.webUrlString = [FUSCacheDataShare shareStore].settingInitDataModel.liveTaskAddress;
[self.navigationController pushViewController:vc animated:YES];
}
break;
case FUSImAnchorItemTypePopular:{
FUSWKWebViewController *vc = [[FUSWKWebViewController alloc] init];
vc.webUrlString = [FUSCacheDataShare shareStore].settingInitDataModel.popularAddress;
[self.navigationController pushViewController:vc animated:YES];
}
break;
case FUSImAnchorItemTypeBroadcastBuild:{
FUSWKWebViewController *vc = [[FUSWKWebViewController alloc] init];
vc.webUrlString = [FUSCacheDataShare shareStore].settingInitDataModel.anchorNovaAddress;
[self.navigationController pushViewController:vc animated:YES];
}
break;
case FUSImAnchorItemTypeActivity:{
FUSWKWebViewController *vc = [[FUSWKWebViewController alloc] init];
vc.webUrlString = [FUSCacheDataShare shareStore].settingInitDataModel.activitiesAddress;
[self.navigationController pushViewController:vc animated:YES];
}
break;
default:
break;
}
} }
-(void)fus_publishBtnDidClicked:(UIButton *)btn{ -(void)fus_publishBtnDidClicked:(UIButton *)btn{
......
...@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface FUSImAnchorHeaderView : UIView @interface FUSImAnchorHeaderView : UIView
@property (nonatomic, copy) void(^withdrawBtnClickedHandler)(void);
- (void)fus_setupHeaderViewWithModel:(FUSZoneInfosModel *)model; - (void)fus_setupHeaderViewWithModel:(FUSZoneInfosModel *)model;
/// 返回控件高度 /// 返回控件高度
......
...@@ -13,11 +13,13 @@ ...@@ -13,11 +13,13 @@
@property (nonatomic, strong) UIButton *avatorBtn; @property (nonatomic, strong) UIButton *avatorBtn;
@property (nonatomic, strong) UILabel *nickNameLabel; @property (nonatomic, strong) UILabel *nickNameLabel;
@property (nonatomic, strong) UILabel *vipMarkLabel; //@property (nonatomic, strong) UILabel *vipMarkLabel;
@property (nonatomic, strong) UIImageView *vipMarkImgView;
@property (nonatomic, strong) UILabel *levelLabel; @property (nonatomic, strong) UILabel *levelLabel;
@property (nonatomic, strong) UIButton *ageBtn; @property (nonatomic, strong) UIButton *ageBtn;
@property (nonatomic, strong) UILabel *idLabel; @property (nonatomic, strong) UILabel *idLabel;
@property (nonatomic, strong) UILabel *fireNumLabel; @property (nonatomic, strong) UILabel *fireNumLabel;
@property (nonatomic, strong) UIButton *withdrawBtn;
/// 数据 /// 数据
@property (nonatomic, strong) FUSZoneInfosModel *zoneModel; @property (nonatomic, strong) FUSZoneInfosModel *zoneModel;
...@@ -86,20 +88,31 @@ ...@@ -86,20 +88,31 @@
make.left.top.bottom.equalTo(nickNameBgView); make.left.top.bottom.equalTo(nickNameBgView);
}]; }];
self.vipMarkLabel = [[UILabel alloc] init]; // self.vipMarkLabel = [[UILabel alloc] init];
self.vipMarkLabel.font = [UIFont fus_themeBoldFont:9]; // self.vipMarkLabel.font = [UIFont fus_themeBoldFont:9];
self.vipMarkLabel.textColor = [UIColor fus_textColorRich]; // self.vipMarkLabel.textColor = [UIColor fus_textColorRich];
self.vipMarkLabel.text = @"V"; // self.vipMarkLabel.text = @"V";
self.vipMarkLabel.textAlignment = NSTextAlignmentCenter; // self.vipMarkLabel.textAlignment = NSTextAlignmentCenter;
self.vipMarkLabel.layer.cornerRadius = 14 / 2.0f; // self.vipMarkLabel.layer.cornerRadius = 14 / 2.0f;
self.vipMarkLabel.layer.masksToBounds = YES; // self.vipMarkLabel.layer.masksToBounds = YES;
self.vipMarkLabel.backgroundColor = [UIColor fus_diamondBlue]; // self.vipMarkLabel.backgroundColor = [UIColor fus_diamondBlue];
[nickNameBgView addSubview:self.vipMarkLabel]; // [nickNameBgView addSubview:self.vipMarkLabel];
[self.vipMarkLabel mas_makeConstraints:^(MASConstraintMaker *make) { // [self.vipMarkLabel mas_makeConstraints:^(MASConstraintMaker *make) {
// make.right.equalTo(nickNameBgView);
// make.centerY.equalTo(nickNameBgView.mas_centerY);
// make.left.equalTo(self.nickNameLabel.mas_right).offset(6);
// make.size.mas_equalTo(CGSizeMake(14, 14));
// }];
self.vipMarkImgView = [[UIImageView alloc] init];
self.vipMarkImgView.contentMode = UIViewContentModeScaleAspectFit;
[nickNameBgView addSubview:self.vipMarkImgView];
[self.vipMarkImgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(nickNameBgView); make.right.equalTo(nickNameBgView);
make.centerY.equalTo(nickNameBgView.mas_centerY); make.centerY.equalTo(nickNameBgView.mas_centerY);
make.left.equalTo(self.nickNameLabel.mas_right).offset(6); make.left.equalTo(self.nickNameLabel.mas_right).offset(6);
make.size.mas_equalTo(CGSizeMake(14, 14)); // make.size.mas_equalTo(CGSizeMake(14, 14));
make.height.offset(16);
}]; }];
UIView *sexBlankBgView = [[UIView alloc] init]; UIView *sexBlankBgView = [[UIView alloc] init];
...@@ -164,6 +177,7 @@ ...@@ -164,6 +177,7 @@
UIImageView *bottomBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fus_my_imAnchor_header_fireBlank_bg"]]; UIImageView *bottomBgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fus_my_imAnchor_header_fireBlank_bg"]];
bottomBgImageView.userInteractionEnabled = YES;
[self addSubview:bottomBgImageView]; [self addSubview:bottomBgImageView];
[bottomBgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [bottomBgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.offset(0); make.bottom.offset(0);
...@@ -205,6 +219,21 @@ ...@@ -205,6 +219,21 @@
make.right.offset(-25); make.right.offset(-25);
make.top.offset(20); make.top.offset(20);
}]; }];
// 单独独立一个透明button出来好操控空间,不然等下gcp又说要特定区域能点
self.withdrawBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[bottomBgImageView addSubview:self.withdrawBtn];
[self.withdrawBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(bottomBgImageView);
}];
[self.withdrawBtn addTarget:self action:@selector(fus_withdrawBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
}
#pragma mark --- button did clicked
-(void)fus_withdrawBtnDidClicked:(UIButton *)btn{
if (self.withdrawBtnClickedHandler) {
self.withdrawBtnClickedHandler();
}
} }
#pragma mark --- method #pragma mark --- method
...@@ -237,6 +266,7 @@ ...@@ -237,6 +266,7 @@
}]; }];
self.fireNumLabel.text = model.bonds; self.fireNumLabel.text = model.bonds;
self.vipMarkImgView.image = [UIImage fus_imageWithLevel:[model.level integerValue]];
} }
+ (CGFloat)fus_viewHeight{ + (CGFloat)fus_viewHeight{
......
//
// FUSSettingInitDataModel.h
// FuSiLive
//
// Created by aaa on 2024/6/18.
//
#import <FUSFoundation/FUSFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSSettingInitDataModel : FUSBaseModel
/// 用户直播间入场消息折叠开关(0:关、1:开)默认是开
@property (nonatomic, assign) NSInteger enterRoomMsgFoldSwitch;
/// 座驾入场座驾音效控制按钮开关(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarAudioShowSwitch;
/// 座驾入场座驾音效默认选项(0:关、1:开)
@property (nonatomic, assign) NSInteger enterRoomCarDefaultOption;
/// 平台商城应用开关(0:关、1:开)
@property (nonatomic, assign) NSInteger platformStoreShowSwitch;
/// 平台商城应用购买地址
@property (nonatomic, copy) NSString *platformStoreBuyUrl;
/// App更新下载地址
@property (nonatomic, copy) NSString *appUpdateDownloadUrl;
/// 拥有新人签到资格 (0:无、1:有)
@property (nonatomic, assign) NSNumber *haveNoviceCheckIn;
/// App是否有存在更新的版本号(-1:无版本更新)
@property (nonatomic, assign) NSNumber *versionUpdate;
/// 最小化小窗功能启用开关(0:关、1:开)
@property (nonatomic, assign) NSNumber *smallWindowSwitch;
/// 房间活动运营框架配置
@property (nonatomic, strong) NSDictionary *roomWebFramework;
/// 横向h5地址
@property (nonatomic, copy) NSString *horizontalUrl;
/// 纵向h5地址
@property (nonatomic, copy) NSString *verticalUrl;
/// 邀请有奖访问地址
@property (nonatomic, copy) NSString *invitationAddress;
/// 应用内评分配置
@property (nonatomic, strong) NSDictionary *appRatingConfig;
/// 客服配置
@property (nonatomic, strong) NSDictionary *kfConfig;
/// 模式(1:APP原生客服、2:H5网页客服)
@property (nonatomic, assign) NSInteger model;
/// H5客服访问地址
@property (nonatomic, copy) NSString *url;
/// 直播预告配置
@property (nonatomic, strong) NSDictionary *previewLiveConfig;
/// 时间范围(单位:天)
@property (nonatomic, copy) NSString *modelTimeScope;
/// 直播任务访问地址
@property (nonatomic, copy) NSString *liveTaskAddress;
/// 人气加成访问地址
@property (nonatomic, copy) NSString *popularAddress;
/// 主播养成访问地址
@property (nonatomic, copy) NSString *anchorNovaAddress;
/// 平台活动访问地址
@property (nonatomic, copy) NSString *activitiesAddress;
/// 提现H5访问地址
@property (nonatomic, copy) NSString *withdrawAddress;
@end
NS_ASSUME_NONNULL_END
//
// FUSSettingInitDataModel.m
// FuSiLive
//
// Created by aaa on 2024/6/18.
//
#import "FUSSettingInitDataModel.h"
@implementation FUSSettingInitDataModel
@end
...@@ -1100,7 +1100,14 @@ ...@@ -1100,7 +1100,14 @@
/// 打开app只调用一次,进入后台再进入前台不需要调用 /// 打开app只调用一次,进入后台再进入前台不需要调用
+ (void)fus_requestSettingInitData { + (void)fus_requestSettingInitData {
[FUSHttpHelper postRequestBinaryWithUrl:URL_SETTING_INIT_DATA params:nil success:nil failure:nil]; [FUSHttpHelper postRequestBinaryWithUrl:URL_SETTING_INIT_DATA params:nil success:^(NSDictionary * _Nullable dataDict, int code) {
FUSSettingInitDataModel *initData = [FUSSettingInitDataModel fus_modelWithDict:dataDict];
[FUSCacheDataShare shareStore].settingInitDataModel = initData;
} failure:^(NSDictionary * _Nullable dataDict, int code) {
}];
} }
@end @end
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/> <device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22685"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="9dH-kC-IW1"> <imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="9dH-kC-IW1">
<rect key="frame" x="106" y="22.5" width="28" height="16"/> <rect key="frame" x="106" y="22.5" width="28" height="16"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="16" id="SEY-Vh-cAs"/> <constraint firstAttribute="height" constant="16" id="SEY-Vh-cAs"/>
......
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