粉丝团任务弹窗
@@ -215,6 +215,11 @@
|
||||
9BDA3E7D27FD47AB00517FE6 /* XPAnchorFansTeamPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BDA3E7C27FD47AB00517FE6 /* XPAnchorFansTeamPresenter.m */; };
|
||||
9BE29A6B27D1BFF700446AB5 /* anchor_room_speak.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */; };
|
||||
9BE29A6D27D210A500446AB5 /* anchor_room_bg.svga in Resources */ = {isa = PBXBuildFile; fileRef = 9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */; };
|
||||
9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */; };
|
||||
9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FB27FED2E100667200 /* XPAnchorFansJoinModel.m */; };
|
||||
9BE9F0FF27FED76500667200 /* XPAnchorFansTaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F0FE27FED76500667200 /* XPAnchorFansTaskModel.m */; };
|
||||
9BE9F10227FEE5C200667200 /* XPAnchorFansTaskDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F10127FEE5C200667200 /* XPAnchorFansTaskDetailModel.m */; };
|
||||
9BE9F10527FF04CF00667200 /* XPAnchorFansTaskTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BE9F10427FF04CF00667200 /* XPAnchorFansTaskTableViewCell.m */; };
|
||||
9BEE3D0E27853BD000C83219 /* ThemeColor+NobleCenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D0D27853BD000C83219 /* ThemeColor+NobleCenter.m */; };
|
||||
9BEE3D11278584FE00C83219 /* XPNobleCenterEmptyView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D10278584FE00C83219 /* XPNobleCenterEmptyView.m */; };
|
||||
9BEE3D142785884A00C83219 /* XPNobleCenterResidueView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BEE3D132785884A00C83219 /* XPNobleCenterResidueView.m */; };
|
||||
@@ -1024,6 +1029,16 @@
|
||||
9BDA3E7F27FD480D00517FE6 /* XPAnchorFansTeamProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansTeamProtocol.h; sourceTree = "<group>"; };
|
||||
9BE29A6927D1BFF700446AB5 /* anchor_room_speak.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_speak.svga; sourceTree = "<group>"; };
|
||||
9BE29A6C27D210A500446AB5 /* anchor_room_bg.svga */ = {isa = PBXFileReference; lastKnownFileType = file; path = anchor_room_bg.svga; sourceTree = "<group>"; };
|
||||
9BE9F0F727FED12D00667200 /* XPAnchorFansPrivilegeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansPrivilegeModel.h; sourceTree = "<group>"; };
|
||||
9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansPrivilegeModel.m; sourceTree = "<group>"; };
|
||||
9BE9F0FA27FED2E100667200 /* XPAnchorFansJoinModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansJoinModel.h; sourceTree = "<group>"; };
|
||||
9BE9F0FB27FED2E100667200 /* XPAnchorFansJoinModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansJoinModel.m; sourceTree = "<group>"; };
|
||||
9BE9F0FD27FED76500667200 /* XPAnchorFansTaskModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansTaskModel.h; sourceTree = "<group>"; };
|
||||
9BE9F0FE27FED76500667200 /* XPAnchorFansTaskModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansTaskModel.m; sourceTree = "<group>"; };
|
||||
9BE9F10027FEE5C200667200 /* XPAnchorFansTaskDetailModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansTaskDetailModel.h; sourceTree = "<group>"; };
|
||||
9BE9F10127FEE5C200667200 /* XPAnchorFansTaskDetailModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansTaskDetailModel.m; sourceTree = "<group>"; };
|
||||
9BE9F10327FF04CF00667200 /* XPAnchorFansTaskTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPAnchorFansTaskTableViewCell.h; sourceTree = "<group>"; };
|
||||
9BE9F10427FF04CF00667200 /* XPAnchorFansTaskTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPAnchorFansTaskTableViewCell.m; sourceTree = "<group>"; };
|
||||
9BEE3D0C27853BD000C83219 /* ThemeColor+NobleCenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ThemeColor+NobleCenter.h"; sourceTree = "<group>"; };
|
||||
9BEE3D0D27853BD000C83219 /* ThemeColor+NobleCenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "ThemeColor+NobleCenter.m"; sourceTree = "<group>"; };
|
||||
9BEE3D0F278584FE00C83219 /* XPNobleCenterEmptyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPNobleCenterEmptyView.h; sourceTree = "<group>"; };
|
||||
@@ -3016,6 +3031,8 @@
|
||||
9BDA3E7927FD43EF00517FE6 /* XPAnchorFansTeamEntranceView.m */,
|
||||
9BB89DC427FEB9E100586A83 /* XPAnchorFansTaskViewController.h */,
|
||||
9BB89DC527FEB9E100586A83 /* XPAnchorFansTaskViewController.m */,
|
||||
9BE9F10327FF04CF00667200 /* XPAnchorFansTaskTableViewCell.h */,
|
||||
9BE9F10427FF04CF00667200 /* XPAnchorFansTaskTableViewCell.m */,
|
||||
);
|
||||
path = View;
|
||||
sourceTree = "<group>";
|
||||
@@ -3046,6 +3063,14 @@
|
||||
children = (
|
||||
9BB89DC127FE7F3A00586A83 /* XPAnchorFansRelationModel.h */,
|
||||
9BB89DC227FE7F3A00586A83 /* XPAnchorFansRelationModel.m */,
|
||||
9BE9F0F727FED12D00667200 /* XPAnchorFansPrivilegeModel.h */,
|
||||
9BE9F0F827FED12D00667200 /* XPAnchorFansPrivilegeModel.m */,
|
||||
9BE9F0FA27FED2E100667200 /* XPAnchorFansJoinModel.h */,
|
||||
9BE9F0FB27FED2E100667200 /* XPAnchorFansJoinModel.m */,
|
||||
9BE9F0FD27FED76500667200 /* XPAnchorFansTaskModel.h */,
|
||||
9BE9F0FE27FED76500667200 /* XPAnchorFansTaskModel.m */,
|
||||
9BE9F10027FEE5C200667200 /* XPAnchorFansTaskDetailModel.h */,
|
||||
9BE9F10127FEE5C200667200 /* XPAnchorFansTaskDetailModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
@@ -5381,6 +5406,7 @@
|
||||
E8DACCFE27673F870052092C /* GiftValueInfoModel.m in Sources */,
|
||||
E8412F9927799249006E1101 /* InviteFansModel.m in Sources */,
|
||||
E84BF7CA277AF79D00EF8877 /* XPRoomSettingTagCell.m in Sources */,
|
||||
9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */,
|
||||
E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */,
|
||||
186A534926FC6ED900D67B2C /* TTAlertMessageAttributedConfig.m in Sources */,
|
||||
E81C27AE26EF39AB0031E639 /* AppDelegate+ThirdConfig.m in Sources */,
|
||||
@@ -5534,12 +5560,14 @@
|
||||
E83DB4842746661800D8CBD1 /* XPRoomGiftBroadcastView.m in Sources */,
|
||||
E84150C527747E0900A7F548 /* FirstRechargeRewardModel.m in Sources */,
|
||||
E8A1E4572762092700B294CA /* XPCandyTreePresenter.m in Sources */,
|
||||
9BE9F10227FEE5C200667200 /* XPAnchorFansTaskDetailModel.m in Sources */,
|
||||
E86596542701A55500846EBD /* StatisticsServiceHelper.m in Sources */,
|
||||
E8E70D8C26F2F5A500F03460 /* XPMineHeadItemCollectionViewCell.m in Sources */,
|
||||
9B17F71827BD150600440843 /* SVGAParserManager.m in Sources */,
|
||||
E80DE40D2775ABA500BE5BCB /* XPFirstRechargeFlowLayout.m in Sources */,
|
||||
E896EFA22771AE9400AD2CC1 /* XPMineFriendViewController.m in Sources */,
|
||||
E8E70D8C26F2F5A500F03460 /* XPMineHeadItemCollectionViewCell.m in Sources */,
|
||||
9BE9F0FC27FED2E100667200 /* XPAnchorFansJoinModel.m in Sources */,
|
||||
9B92A352279807F300AD168F /* XPSkillCardViewController.m in Sources */,
|
||||
186A534A26FC6ED900D67B2C /* TTActionSheetConfig.m in Sources */,
|
||||
9BBC028B2786E05A0007C24B /* XPNobleCenterEntranceView.m in Sources */,
|
||||
@@ -5551,6 +5579,7 @@
|
||||
9BA8A47D27C63E20000365A3 /* XPSkillCardUpdatePropDetailModel.m in Sources */,
|
||||
E8EEB90126FC31B6007C6EBA /* XPMineUserInfoPresenter.m in Sources */,
|
||||
18F404BB2760982000A6C548 /* ChatLimitModel.m in Sources */,
|
||||
9BE9F10527FF04CF00667200 /* XPAnchorFansTaskTableViewCell.m in Sources */,
|
||||
9B92A33C2797E38100AD168F /* XPMineHeadItemTableViewCell.m in Sources */,
|
||||
189DD56526DE465A00AB55B1 /* LoginViewController.m in Sources */,
|
||||
E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */,
|
||||
@@ -5600,6 +5629,7 @@
|
||||
9B7B605B27BB53060070BB72 /* XPAnchorAudienceUpMicView.m in Sources */,
|
||||
E8B825BF26E9E57D009E8E9F /* LoginTicketInfo.m in Sources */,
|
||||
E8E5E18E27C3331E00F457D8 /* XPHomeRecommendViewController.m in Sources */,
|
||||
9BE9F0FF27FED76500667200 /* XPAnchorFansTaskModel.m in Sources */,
|
||||
9B73CD05279A9A6A006AF255 /* XPSkillCardSaveModel.m in Sources */,
|
||||
E8E7DAE82744F5EF00C631CC /* XPGiftStorage.m in Sources */,
|
||||
E8AA6EEF27DF1E6B009B4C2B /* XPRoomTopicViewController.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_entrance_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_entrance_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_entrance_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 4.6 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_more.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_more@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_more@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_more.imageset/anchor_fansTeam_more@2x.png
vendored
Normal file
After Width: | Height: | Size: 437 B |
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_more.imageset/anchor_fansTeam_more@3x.png
vendored
Normal file
After Width: | Height: | Size: 613 B |
22
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_rank.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_rank@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_rank@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_rank.imageset/anchor_fansTeam_rank@2x.png
vendored
Normal file
After Width: | Height: | Size: 880 B |
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_rank.imageset/anchor_fansTeam_rank@3x.png
vendored
Normal file
After Width: | Height: | Size: 1.2 KiB |
22
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_task.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_task@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "anchor_fansTeam_task@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_task.imageset/anchor_fansTeam_task@2x.png
vendored
Normal file
After Width: | Height: | Size: 3.0 KiB |
BIN
xplan-ios/Assets.xcassets/Room/Anchor/anchor_fansTeam_task.imageset/anchor_fansTeam_task@3x.png
vendored
Normal file
After Width: | Height: | Size: 4.3 KiB |
@@ -54,6 +54,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
CustomMessageType_Noble_VIP = 85,
|
||||
///个播房观众点击空坑位,房主收到请求上麦提示
|
||||
CustomMessageType_AnchorRoom_AudienceUpMic = 86,
|
||||
///个播粉丝团
|
||||
CustomMessageType_Anchor_FansTeam = 90,
|
||||
};
|
||||
|
||||
|
||||
@@ -266,6 +268,16 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubNobleVIP) {
|
||||
|
||||
};
|
||||
|
||||
///first = CustomMessageType_Anchor_FansTeam
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageAnchorFansTeam) {
|
||||
///开通粉丝团成功
|
||||
Custom_Message_Sub_FansTeam_Open_Success = 901,
|
||||
///开通粉丝团失败
|
||||
Custom_Message_Sub_FansTeam_Open_Fail = 902,
|
||||
///用户加入粉丝团成功
|
||||
Custom_Message_Sub_FansTeam_Join_Success = 903,
|
||||
};
|
||||
|
||||
|
||||
@interface AttachmentModel : NSObject<NIMCustomAttachment>
|
||||
@property (nonatomic,assign) int first;
|
||||
|
@@ -143,6 +143,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param completion 完成
|
||||
/// @param teamUid 房间uid
|
||||
+ (void)requestInRoomFansTeam:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid;
|
||||
|
||||
/// 获取加入粉丝团的内容
|
||||
/// @param completion 完成
|
||||
/// @param teamUid 要加入粉丝团的房间uid
|
||||
+ (void)requestJoinFansTeam:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid;
|
||||
|
||||
/// 获取粉丝团任务列表
|
||||
/// @param completion 完成
|
||||
/// @param teamUid 房间uid
|
||||
+ (void)requestFansTeamTask:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -160,4 +160,18 @@
|
||||
[self makeRequest:@"anchorFansTeam/initInRoomFansTeam" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil];
|
||||
}
|
||||
|
||||
/// 获取加入粉丝团的内容
|
||||
/// @param completion 完成
|
||||
/// @param teamUid 要加入粉丝团的房间uid
|
||||
+ (void)requestJoinFansTeam:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid {
|
||||
[self makeRequest:@"anchorFansTeam/applyFansTeamPopInfoVo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil];
|
||||
}
|
||||
|
||||
/// 获取粉丝团任务列表
|
||||
/// @param completion 完成
|
||||
/// @param teamUid 房间uid
|
||||
+ (void)requestFansTeamTask:(HttpRequestHelperCompletion)completion teamUid:(NSString *)teamUid {
|
||||
[self makeRequest:@"anchorFansTeam/getFansTaskInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, teamUid, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -126,10 +126,6 @@ typedef NS_ENUM(NSInteger, RoomDatingStateChangeType) {
|
||||
@property (nonatomic, assign) int64_t mgId;
|
||||
///小游戏名称
|
||||
@property (nonatomic, copy) NSString *mgName;
|
||||
///是否开通了粉丝团(本地字段)
|
||||
@property (nonatomic, assign) BOOL hadOpenAnchorFans;
|
||||
///开通粉丝团红点(本地字段)
|
||||
@property (nonatomic, assign) BOOL anchorFansRedDot;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// XPAnchorFansJoinModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "XPAnchorFansPrivilegeModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorFansJoinModel : NSObject
|
||||
|
||||
///粉丝团id
|
||||
@property (nonatomic, assign) long long teamId;
|
||||
///主播uid
|
||||
@property (nonatomic, assign) long long teamUid;
|
||||
///主播头像
|
||||
@property (nonatomic, copy) NSString *anchorAvatar;
|
||||
///主播名称
|
||||
@property (nonatomic, copy) NSString *anchorNick;
|
||||
///粉丝团总人数
|
||||
@property (nonatomic, assign) NSInteger teamNum;
|
||||
///榜单前三用户头像
|
||||
@property (nonatomic, strong) NSArray *avatarList;
|
||||
///是否在退出粉丝团重新加入的24小时限制
|
||||
@property (nonatomic, assign) BOOL isJoinLimit;
|
||||
///粉丝特权
|
||||
@property (nonatomic, strong) NSArray<XPAnchorFansPrivilegeModel *> *privilegeConfigVos;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// XPAnchorFansJoinModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import "XPAnchorFansJoinModel.h"
|
||||
|
||||
@implementation XPAnchorFansJoinModel
|
||||
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"privilegeConfigVos":XPAnchorFansPrivilegeModel.class
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,37 @@
|
||||
//
|
||||
// XPAnchorFansJoinModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef NS_ENUM(NSUInteger, AnchorFansTeamPrivilegeType) {
|
||||
AnchorFansTeamPrivilegeTypeNameplate = 1, ///铭牌
|
||||
AnchorFansTeamPrivilegeTypeGift = 2,
|
||||
AnchorFansTeamPrivilegeTypeTeamGift,
|
||||
};
|
||||
|
||||
@interface XPAnchorFansPrivilegeModel : NSObject
|
||||
|
||||
///粉丝团id
|
||||
@property (nonatomic, assign) NSInteger privilegeId;
|
||||
///特权名称
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
///特权对应的铭牌/礼物id
|
||||
@property (nonatomic, assign) NSInteger normalId;
|
||||
///特权描述
|
||||
@property (nonatomic, copy) NSString *desc;
|
||||
//特权类型 1铭牌 2专属礼物 3入团礼物
|
||||
@property (nonatomic, assign) AnchorFansTeamPrivilegeType type;
|
||||
///图标
|
||||
@property (nonatomic, copy) NSString *icon;
|
||||
///状态 日效1有效
|
||||
@property (nonatomic, assign) NSInteger status;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// XPAnchorFansJoinModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import "XPAnchorFansPrivilegeModel.h"
|
||||
|
||||
@implementation XPAnchorFansPrivilegeModel
|
||||
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{@"desc": @"description"
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
@@ -19,6 +19,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, assign) BOOL isCurrentRoomAnchor;
|
||||
///菜单栏入口是否展示红点提示
|
||||
@property (nonatomic, assign) BOOL isRedPop;
|
||||
///粉丝团成员总数
|
||||
@property (nonatomic, assign) NSInteger anchorFansNum;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// XPAnchorFansTaskDetailModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorFansTaskDetailModel : NSObject
|
||||
|
||||
@property (nonatomic, assign) NSInteger taskId;
|
||||
@property (nonatomic, copy) NSString *taskCode;
|
||||
@property (nonatomic, copy) NSString *taskName;
|
||||
@property (nonatomic, copy) NSString *icon;
|
||||
@property (nonatomic, copy) NSString *taskDesc;
|
||||
@property (nonatomic, assign) NSInteger avardVal;
|
||||
@property (nonatomic, assign) NSInteger totalNum;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,12 @@
|
||||
//
|
||||
// XPAnchorFansTaskDetailModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import "XPAnchorFansTaskDetailModel.h"
|
||||
|
||||
@implementation XPAnchorFansTaskDetailModel
|
||||
|
||||
@end
|
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// XPAnchorFansTaskModel.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "XPAnchorFansTaskDetailModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorFansTaskModel : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *teamUid;
|
||||
@property (nonatomic, copy) NSString *anchorAvatar;
|
||||
@property (nonatomic, copy) NSString *anchorNick;
|
||||
@property (nonatomic, assign) NSInteger teamNum;
|
||||
@property (nonatomic, assign) NSInteger memberUid;
|
||||
@property (nonatomic, copy) NSString *memberAvatar;
|
||||
@property (nonatomic, strong) NSArray *avatarList;
|
||||
@property (nonatomic, strong) NSArray<XPAnchorFansTaskDetailModel *> *taskVos;
|
||||
@property (nonatomic, assign) NSInteger levelSeq;
|
||||
@property (nonatomic, assign) NSInteger levelExper;
|
||||
@property (nonatomic, assign) NSInteger nextLevelExper;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,18 @@
|
||||
//
|
||||
// XPAnchorFansTaskModel.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import "XPAnchorFansTaskModel.h"
|
||||
|
||||
@implementation XPAnchorFansTaskModel
|
||||
|
||||
+ (NSDictionary *)objectClassInArray {
|
||||
return @{
|
||||
@"taskVos":XPAnchorFansTaskDetailModel.class
|
||||
};
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// XPAnchorFansTaskTableViewCell.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "XPAnchorFansTaskDetailModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorFansTaskTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansTaskDetailModel *model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,152 @@
|
||||
//
|
||||
// XPAnchorFansTaskTableViewCell.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/4/7.
|
||||
//
|
||||
|
||||
#import "XPAnchorFansTaskTableViewCell.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <SDCycleScrollView/SDCycleScrollView.h>
|
||||
///Model
|
||||
#import "HomeBannerInfoModel.h"
|
||||
#import "NetImageView.h"
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
|
||||
@interface XPAnchorFansTaskTableViewCell ()
|
||||
|
||||
///专属铭牌背景
|
||||
@property (nonatomic, strong) UIView *nameplateBgView;
|
||||
///专属铭牌图片
|
||||
@property (nonatomic, strong) NetImageView *nameplateImageView;
|
||||
///专属铭牌名称
|
||||
@property (nonatomic, strong) UILabel *nameplateLabel;
|
||||
///专属铭牌描述
|
||||
@property (nonatomic, strong) UILabel *nameplateDescLabel;
|
||||
///进度按钮
|
||||
@property (nonatomic, strong) UIButton *doneButton;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPAnchorFansTaskTableViewCell
|
||||
|
||||
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
|
||||
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.nameplateBgView];
|
||||
[self.nameplateBgView addSubview:self.nameplateImageView];
|
||||
[self.nameplateBgView addSubview:self.nameplateLabel];
|
||||
[self.nameplateBgView addSubview:self.nameplateDescLabel];
|
||||
[self.nameplateBgView addSubview:self.doneButton];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.nameplateBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contentView);
|
||||
make.bottom.mas_equalTo(self.contentView).offset(-10);
|
||||
make.left.right.mas_equalTo(0);
|
||||
}];
|
||||
|
||||
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(10);
|
||||
make.centerY.mas_equalTo(self.nameplateBgView);
|
||||
make.width.height.mas_equalTo(38);
|
||||
}];
|
||||
|
||||
[self.nameplateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nameplateImageView.mas_right).mas_offset(8);
|
||||
make.top.mas_equalTo(self.nameplateImageView).mas_offset(1);
|
||||
make.height.mas_equalTo(21);
|
||||
}];
|
||||
[self.nameplateDescLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.nameplateLabel.mas_bottom);
|
||||
make.left.mas_equalTo(self.nameplateLabel);
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
[self.doneButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.nameplateBgView);
|
||||
make.height.mas_equalTo(20);
|
||||
make.right.mas_equalTo(-10);
|
||||
make.width.mas_equalTo(48);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(XPAnchorFansTaskDetailModel *)model {
|
||||
self.nameplateImageView.imageUrl = model.icon;
|
||||
self.nameplateLabel.text = model.taskName;
|
||||
self.nameplateDescLabel.text = model.taskDesc;
|
||||
if (model.avardVal >= model.totalNum) {
|
||||
[self.doneButton setTitle:@"已完成" forState:UIControlStateNormal];
|
||||
[self.doneButton setBackgroundColor:[ThemeColor appBackgroundColor]];
|
||||
[self.doneButton setTitleColor:[ThemeColor textThirdColor] forState:UIControlStateNormal];
|
||||
} else {
|
||||
[self.doneButton setTitle:[NSString stringWithFormat:@"%ld/%ld", model.avardVal, model.totalNum] forState:UIControlStateNormal];
|
||||
[self.doneButton setBackgroundColor:UIColorFromRGB(0xFF4E7F)];
|
||||
[self.doneButton setTitleColor:[ThemeColor appCellBackgroundColor] forState:UIControlStateNormal];
|
||||
}
|
||||
}
|
||||
|
||||
- (UIView *)nameplateBgView {
|
||||
if (!_nameplateBgView) {
|
||||
_nameplateBgView = [[UIView alloc] init];
|
||||
_nameplateBgView.backgroundColor = [UIColor whiteColor];
|
||||
_nameplateBgView.layer.cornerRadius = 8;
|
||||
_nameplateBgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _nameplateBgView;
|
||||
}
|
||||
|
||||
- (NetImageView *)nameplateImageView {
|
||||
if (!_nameplateImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_nameplateImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_nameplateImageView.layer.masksToBounds = YES;
|
||||
_nameplateImageView.layer.cornerRadius = 8;
|
||||
}
|
||||
return _nameplateImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nameplateLabel; {
|
||||
if (!_nameplateLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [ThemeColor mainTextColor];
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
|
||||
_nameplateLabel = label;
|
||||
}
|
||||
return _nameplateLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)nameplateDescLabel; {
|
||||
if (!_nameplateDescLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [ThemeColor textThirdColor];
|
||||
label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_nameplateDescLabel = label;
|
||||
}
|
||||
return _nameplateDescLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)doneButton {
|
||||
if (!_doneButton) {
|
||||
_doneButton = [[UIButton alloc] init];
|
||||
_doneButton.titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_doneButton.layer.cornerRadius = 4;
|
||||
_doneButton.layer.masksToBounds = YES;
|
||||
}
|
||||
return _doneButton;
|
||||
}
|
||||
|
||||
@end
|
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import "XPAnchorFansTaskModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -13,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid;
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansTaskModel *model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -6,7 +6,448 @@
|
||||
//
|
||||
|
||||
#import "XPAnchorFansTaskViewController.h"
|
||||
///P
|
||||
#import "XPAnchorFansTeamPresenter.h"
|
||||
#import "XPAnchorFansTeamProtocol.h"
|
||||
///Third
|
||||
#import "NetImageView.h"
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "XPMacro.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ThemeColor.h"
|
||||
///View
|
||||
#import "XPAnchorFansTaskTableViewCell.h"
|
||||
|
||||
@interface XPAnchorFansTaskViewController()<XPAnchorFansTeamProtocol, UITableViewDelegate, UITableViewDataSource>
|
||||
|
||||
///房间Uid
|
||||
@property (nonatomic, strong) NSString *roomUid;
|
||||
///顶部点击消失的view
|
||||
@property (nonatomic, strong) UIView *topView;
|
||||
///显示内容的view
|
||||
@property (nonatomic, strong) UIView *contentView;
|
||||
///背景图片
|
||||
@property (nonatomic, strong) UIImageView *bgImageView;
|
||||
///帮助按钮
|
||||
@property (nonatomic, strong) UIButton *helpButton;
|
||||
///头像
|
||||
@property (nonatomic, strong) NetImageView *avatarImageView;
|
||||
///粉丝团名称
|
||||
@property (nonatomic, strong) UILabel *nameLabel;
|
||||
///粉丝团人数
|
||||
@property (nonatomic, strong) UILabel *countLabel;
|
||||
|
||||
@property (nonatomic, strong) UIView *stackView;
|
||||
///排行榜
|
||||
@property (nonatomic, strong) UIImageView *rankImageView;
|
||||
///粉丝专属特权
|
||||
@property (nonatomic, strong) UIImageView *privilegeTitleImageView;
|
||||
|
||||
@property (nonatomic, strong) UITableView *tableView;
|
||||
|
||||
@property (nonatomic, strong) UIView *bottomView;
|
||||
@property (nonatomic, strong) NetImageView *myAvatarImageView;
|
||||
///亲密值
|
||||
@property (nonatomic, strong) UILabel *intimateLabel;
|
||||
///进度条背景
|
||||
@property (nonatomic, strong) UIView *progressBgView;
|
||||
///进度条
|
||||
@property (nonatomic, strong) UIView *progressView;
|
||||
///进度值
|
||||
@property (nonatomic, strong) UILabel *progressLabel;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPAnchorFansTaskViewController
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid {
|
||||
if (self = [super init]) {
|
||||
self.roomUid = roomUid;
|
||||
self.modalPresentationStyle = UIModalPresentationOverFullScreen;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (XPAnchorFansTeamPresenter *)createPresenter {
|
||||
return [[XPAnchorFansTeamPresenter alloc] init];;
|
||||
}
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
}
|
||||
|
||||
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
|
||||
[self.view endEditing:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
self.view.backgroundColor = [UIColor clearColor];
|
||||
[self.view addSubview:self.topView];
|
||||
[self.view addSubview:self.contentView];
|
||||
|
||||
[self.contentView addSubview:self.bgImageView];
|
||||
[self.contentView addSubview:self.helpButton];
|
||||
[self.contentView addSubview:self.avatarImageView];
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
[self.contentView addSubview:self.countLabel];
|
||||
[self.contentView addSubview:self.stackView];
|
||||
[self.stackView addSubview:self.rankImageView];
|
||||
[self.contentView addSubview:self.privilegeTitleImageView];
|
||||
[self.contentView addSubview:self.tableView];
|
||||
|
||||
[self.contentView addSubview:self.bottomView];
|
||||
[self.bottomView addSubview:self.myAvatarImageView];
|
||||
[self.bottomView addSubview:self.intimateLabel];
|
||||
[self.bottomView addSubview:self.progressBgView];
|
||||
[self.bottomView addSubview:self.progressView];
|
||||
[self.bottomView addSubview:self.progressLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.topView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.top.mas_equalTo(self.view);
|
||||
make.bottom.mas_equalTo(self.contentView.mas_top);
|
||||
}];
|
||||
|
||||
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(self.view);
|
||||
make.height.mas_equalTo(454);
|
||||
}];
|
||||
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make){
|
||||
make.top.right.left.mas_equalTo(0);
|
||||
make.height.mas_equalTo(416);
|
||||
}];
|
||||
|
||||
[self.helpButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(-15);
|
||||
make.top.mas_equalTo(15);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(15);
|
||||
make.width.height.mas_equalTo(64);
|
||||
make.top.mas_equalTo(36);
|
||||
}];
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(21);
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).mas_offset(8);
|
||||
make.top.mas_equalTo(self.avatarImageView).offset(6);
|
||||
make.right.mas_equalTo(self.countLabel.mas_left).mas_offset(-4);
|
||||
}];
|
||||
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.nameLabel);
|
||||
make.right.mas_equalTo(-26);
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).mas_offset(8);
|
||||
make.bottom.mas_equalTo(self.avatarImageView).mas_offset(-3);
|
||||
make.height.mas_equalTo(28);
|
||||
make.width.mas_equalTo(34);
|
||||
}];
|
||||
|
||||
[self.rankImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.stackView);
|
||||
make.left.mas_equalTo(9);
|
||||
make.width.mas_equalTo(16);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
|
||||
[self.privilegeTitleImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_bottom).mas_offset(15);
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.width.mas_equalTo(103);
|
||||
make.height.mas_equalTo(38);
|
||||
}];
|
||||
|
||||
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.contentView).inset(25);
|
||||
make.top.mas_equalTo(self.privilegeTitleImageView.mas_bottom).offset(7);
|
||||
make.height.mas_equalTo(200);
|
||||
}];
|
||||
|
||||
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.bottom.mas_equalTo(0);
|
||||
make.height.mas_equalTo(88);
|
||||
}];
|
||||
[self.myAvatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(24);
|
||||
make.top.mas_equalTo(10);
|
||||
make.width.height.mas_equalTo(40);
|
||||
}];
|
||||
|
||||
[self.intimateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.myAvatarImageView.mas_right).mas_offset(8);
|
||||
make.top.mas_equalTo(self.myAvatarImageView).mas_offset(4);
|
||||
make.height.mas_equalTo(15);
|
||||
}];
|
||||
|
||||
[self.progressBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.intimateLabel);
|
||||
make.right.mas_equalTo(-24);
|
||||
make.height.mas_equalTo(16);
|
||||
make.top.mas_equalTo(self.intimateLabel.mas_bottom).mas_offset(2);
|
||||
}];
|
||||
|
||||
[self.progressView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.progressView);
|
||||
make.top.bottom.mas_equalTo(self.progressBgView);
|
||||
}];
|
||||
[self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.progressView);
|
||||
make.right.mas_equalTo(self.progressView.mas_right).mas_offset(-8);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - tableviewDelegate
|
||||
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
||||
return self.model.taskVos.count;
|
||||
}
|
||||
|
||||
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
XPAnchorFansTaskTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPAnchorFansTaskTableViewCell class])];
|
||||
XPAnchorFansTaskDetailModel *model = self.model.taskVos[indexPath.row];
|
||||
cell.model = model;
|
||||
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
return 66;
|
||||
}
|
||||
|
||||
#pragma mark - private
|
||||
- (void)onDismiss:(UITapGestureRecognizer *)ges {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)moreButtonAction:(UIButton *)button {
|
||||
|
||||
}
|
||||
|
||||
- (void)setModel:(XPAnchorFansTaskModel *)model {
|
||||
_model = model;
|
||||
self.avatarImageView.imageUrl = model.anchorAvatar;
|
||||
self.nameLabel.text = model.anchorNick;
|
||||
NSString *countStr = [NSString stringWithFormat:@"·%ld人", model.teamNum];
|
||||
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
style.alignment = NSTextAlignmentJustified;
|
||||
// style.firstLineHeadIndent = 5;
|
||||
style.headIndent = 3.0f;
|
||||
style.tailIndent = -3.0f;
|
||||
|
||||
NSAttributedString *attrText = [[NSAttributedString alloc] initWithString:countStr attributes:@{ NSParagraphStyleAttributeName : style}];
|
||||
self.countLabel.numberOfLines = 1;
|
||||
self.countLabel.attributedText = attrText;
|
||||
|
||||
CGFloat margin = 8;
|
||||
for (int i = 0; i < model.avatarList.count; i++) {
|
||||
NSString *str = model.avatarList[i];
|
||||
NetImageConfig *config = [[NetImageConfig alloc] init];
|
||||
config.radius = 10;
|
||||
NetImageView *imageView = [[NetImageView alloc] initWithConfig:config];
|
||||
imageView.imageUrl = str;
|
||||
[self.stackView addSubview:imageView];
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.stackView);
|
||||
make.width.height.mas_equalTo(20);
|
||||
make.left.mas_equalTo(i * 27 + 25 + margin);
|
||||
}];
|
||||
}
|
||||
[self.stackView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(model.avatarList.count * (20 + margin) + 34);
|
||||
}];
|
||||
|
||||
self.myAvatarImageView.imageUrl = model.memberAvatar;
|
||||
self.intimateLabel.text = [NSString stringWithFormat:@"亲密值%ld", model.levelSeq];
|
||||
self.progressLabel.text = [NSString stringWithFormat:@"%ld/%ld", model.levelExper, model.nextLevelExper];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - getter
|
||||
- (UIView *)topView {
|
||||
if (!_topView) {
|
||||
_topView = [[UIView alloc] init];
|
||||
_topView.backgroundColor = UIColor.blackColor;
|
||||
_topView.alpha = 0.3;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onDismiss:)];
|
||||
[_topView addGestureRecognizer:tap];
|
||||
}
|
||||
return _topView;
|
||||
}
|
||||
|
||||
- (UIView *)contentView {
|
||||
if (!_contentView) {
|
||||
_contentView = [[UIView alloc] init];
|
||||
CAShapeLayer * layer = [CAShapeLayer layer];
|
||||
layer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, KScreenWidth,454) byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(12, 12)].CGPath;
|
||||
_contentView.layer.mask = layer;
|
||||
}
|
||||
return _contentView;
|
||||
}
|
||||
|
||||
- (UIImageView *)bgImageView {
|
||||
if (!_bgImageView) {
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage imageNamed:@"join_anchor_fansTeam_bg"];
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 64 / 2;
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [ThemeColor mainTextColor];
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
|
||||
_nameLabel = label;
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = UIColorFromRGB(0xFE3478);
|
||||
label.textAlignment = NSTextAlignmentRight;
|
||||
label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
label.layer.cornerRadius = 7.5;
|
||||
label.layer.masksToBounds = YES;
|
||||
label.backgroundColor = [UIColor whiteColor];
|
||||
_countLabel = label;
|
||||
}
|
||||
return _countLabel;
|
||||
}
|
||||
|
||||
- (UIView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.backgroundColor = [UIColor whiteColor];
|
||||
_stackView.layer.cornerRadius = 14;
|
||||
_stackView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UIImageView *)rankImageView {
|
||||
if (!_rankImageView) {
|
||||
_rankImageView = [[UIImageView alloc] init];
|
||||
_rankImageView.image = [UIImage imageNamed:@"anchor_fansTeam_rank"];
|
||||
}
|
||||
return _rankImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)privilegeTitleImageView {
|
||||
if (!_privilegeTitleImageView) {
|
||||
_privilegeTitleImageView = [[UIImageView alloc] init];
|
||||
_privilegeTitleImageView.image = [UIImage imageNamed:@"anchor_fansTeam_task"];
|
||||
_privilegeTitleImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _privilegeTitleImageView;
|
||||
}
|
||||
|
||||
- (UIButton *)helpButton {
|
||||
if (!_helpButton) {
|
||||
_helpButton = [[UIButton alloc] init];
|
||||
[_helpButton addTarget:self action:@selector(moreButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_helpButton setBackgroundImage:[UIImage imageNamed:@"anchor_fansTeam_more"] forState:UIControlStateNormal];
|
||||
}
|
||||
return _helpButton;
|
||||
}
|
||||
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
_tableView = [[UITableView alloc] init];
|
||||
_tableView.delegate = self;
|
||||
_tableView.dataSource = self;
|
||||
_tableView.backgroundColor = [UIColor clearColor];
|
||||
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
||||
[_tableView registerClass:[XPAnchorFansTaskTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPAnchorFansTaskTableViewCell class])];
|
||||
}
|
||||
return _tableView;
|
||||
}
|
||||
|
||||
- (UIView *)bottomView {
|
||||
if (!_bottomView) {
|
||||
_bottomView = [[UIStackView alloc] init];
|
||||
_bottomView.backgroundColor = [UIColor whiteColor];
|
||||
}
|
||||
return _bottomView;
|
||||
}
|
||||
|
||||
- (NetImageView *)myAvatarImageView {
|
||||
if (!_myAvatarImageView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc] init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_myAvatarImageView = [[NetImageView alloc] initWithConfig:config];
|
||||
_myAvatarImageView.layer.masksToBounds = YES;
|
||||
_myAvatarImageView.layer.cornerRadius = 40 / 2;
|
||||
}
|
||||
return _myAvatarImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)progressLabel {
|
||||
if (!_progressLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_progressLabel = label;
|
||||
}
|
||||
return _progressLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)intimateLabel {
|
||||
if (!_intimateLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [ThemeColor mainTextColor];
|
||||
label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_intimateLabel = label;
|
||||
}
|
||||
return _intimateLabel;
|
||||
}
|
||||
|
||||
- (UIView *)progressBgView {
|
||||
if (!_progressBgView) {
|
||||
_progressBgView = [[UIStackView alloc] init];
|
||||
_progressBgView.backgroundColor = [ThemeColor appBackgroundColor];
|
||||
_progressBgView.layer.cornerRadius = 8;
|
||||
_progressBgView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _progressBgView;
|
||||
}
|
||||
|
||||
- (UIView *)progressView {
|
||||
if (!_progressView) {
|
||||
_progressView = [[UIStackView alloc] init];
|
||||
_progressView.backgroundColor = [ThemeColor appBackgroundColor];
|
||||
_progressView.layer.cornerRadius = 8;
|
||||
_progressView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _progressView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -6,11 +6,16 @@
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "XPAnchorFansRelationModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPAnchorFansTeamEntranceView : UIView
|
||||
|
||||
@property (nonatomic, copy) NSString *title;
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansRelationModel *model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -18,7 +18,7 @@
|
||||
///心形图标
|
||||
@property (nonatomic, strong) UIImageView *iconImageView;
|
||||
///礼物值
|
||||
@property (nonatomic, strong) UILabel *valueLabel;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
|
||||
@end
|
||||
|
||||
@@ -35,41 +35,85 @@
|
||||
#pragma mark - Private Method
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.bgImageView];
|
||||
[self.bgImageView addSubview:self.iconImageView];
|
||||
[self.bgImageView addSubview:self.valueLabel];
|
||||
[self addSubview:self.iconImageView];
|
||||
[self addSubview:self.titleLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.bgImageView);
|
||||
make.right.mas_equalTo(self.iconImageView);
|
||||
}];
|
||||
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.mas_equalTo(self);
|
||||
make.left.mas_equalTo(self.valueLabel.mas_left).mas_offset(-8);
|
||||
make.right.mas_equalTo(self.iconImageView.mas_right).mas_offset(8);
|
||||
make.bottom.mas_equalTo(self);
|
||||
make.left.mas_equalTo(-11);
|
||||
make.right.mas_equalTo(self.iconImageView.mas_right).mas_offset(-8);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
[self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.bgImageView);
|
||||
make.width.height.mas_equalTo(13);
|
||||
make.bottom.mas_equalTo(self);
|
||||
make.width.height.mas_equalTo(37);
|
||||
}];
|
||||
[self.valueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.bgImageView);
|
||||
make.right.mas_equalTo(self.iconImageView.mas_left).mas_offset(-2);
|
||||
make.right.mas_equalTo(self.iconImageView.mas_left);
|
||||
make.left.mas_equalTo(8);
|
||||
}];
|
||||
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setGiftValue:(long long)giftValue {
|
||||
NSString *value;
|
||||
if (giftValue < 1000000) {
|
||||
value = @(giftValue).stringValue;
|
||||
} else if (giftValue >= 100000000) {
|
||||
value = @"9999万+";
|
||||
- (void)setTitle:(NSString *)title {
|
||||
self.titleLabel.text = title;
|
||||
}
|
||||
|
||||
- (void)setModel:(XPAnchorFansRelationModel *)model {
|
||||
_model = model;
|
||||
if (model.isCurrentRoomAnchor) {///是房主
|
||||
if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
self.titleLabel.text = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
[self.iconImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(20);
|
||||
make.height.mas_equalTo(13);
|
||||
make.centerY.mas_equalTo(self.bgImageView);
|
||||
}];
|
||||
[self.bgImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.iconImageView).mas_offset(8);
|
||||
}];
|
||||
} else {
|
||||
value = [NSString stringWithFormat:@"%lld万", giftValue/10000];
|
||||
self.titleLabel.text = @"开通粉丝团";
|
||||
[self.iconImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(0);
|
||||
}];
|
||||
[self.bgImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.titleLabel).mas_offset(8);
|
||||
}];
|
||||
}
|
||||
} else {
|
||||
if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
if (model.isAnchorFans) {
|
||||
self.titleLabel.text = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
[self.iconImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(20);
|
||||
make.height.mas_equalTo(14);
|
||||
make.centerY.mas_equalTo(self.titleLabel);
|
||||
}];
|
||||
[self.bgImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.iconImageView).mas_offset(8);
|
||||
make.height.mas_equalTo(22);
|
||||
}];
|
||||
} else {
|
||||
self.titleLabel.text = @"加入我的粉丝团吧~";
|
||||
}
|
||||
} else {
|
||||
self.titleLabel.text = @"该主播暂未开通粉丝团";
|
||||
[self.iconImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.height.mas_equalTo(0);
|
||||
}];
|
||||
[self.bgImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.mas_equalTo(self.titleLabel).mas_offset(8);
|
||||
}];
|
||||
}
|
||||
}
|
||||
self.valueLabel.text = value;
|
||||
}
|
||||
|
||||
- (UIImageView *)bgImageView {
|
||||
@@ -77,6 +121,8 @@
|
||||
_bgImageView = [[UIImageView alloc] init];
|
||||
_bgImageView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFF2D7C), UIColorFromRGB(0xFF8BB2)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(20, 50)];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
_bgImageView.layer.cornerRadius = 11;
|
||||
_bgImageView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
@@ -85,20 +131,20 @@
|
||||
if (_iconImageView == nil) {
|
||||
_iconImageView = [[UIImageView alloc] init];
|
||||
_iconImageView.userInteractionEnabled = YES;
|
||||
_iconImageView.image = [UIImage imageNamed:@"room_position_giftValue_heart"];
|
||||
_iconImageView.image = [UIImage imageNamed:@"anchor_fansTeam_entrance_icon"];
|
||||
_iconImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _iconImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)valueLabel {
|
||||
if (_valueLabel == nil) {
|
||||
_valueLabel = [[UILabel alloc] init];
|
||||
_valueLabel.textColor = UIColor.whiteColor;
|
||||
_valueLabel.font = [UIFont systemFontOfSize:14];
|
||||
_valueLabel.text = @"0";
|
||||
- (UILabel *)titleLabel {
|
||||
if (_titleLabel == nil) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.textColor = UIColor.whiteColor;
|
||||
_titleLabel.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
_titleLabel.text = @"0";
|
||||
}
|
||||
return _valueLabel;
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "MvpViewController.h"
|
||||
#import "XPAnchorFansJoinModel.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -13,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (instancetype)initWithRoomUid:(NSString *)roomUid;
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansJoinModel *model;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -16,6 +16,11 @@
|
||||
#import "XPMacro.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "ThemeColor.h"
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "TTPopup.h"
|
||||
#import "XPHtmlUrl.h"
|
||||
#import "Api+Gift.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
|
||||
@interface XPAnchorFansTeamViewController()<XPAnchorFansTeamProtocol>
|
||||
|
||||
@@ -36,7 +41,9 @@
|
||||
///粉丝团人数
|
||||
@property (nonatomic, strong) UILabel *countLabel;
|
||||
|
||||
@property (nonatomic, strong) UIStackView *stackView;
|
||||
@property (nonatomic, strong) UIView *stackView;
|
||||
///排行榜
|
||||
@property (nonatomic, strong) UIImageView *rankImageView;
|
||||
///粉丝专属特权
|
||||
@property (nonatomic, strong) UIImageView *privilegeTitleImageView;
|
||||
///专属铭牌背景
|
||||
@@ -59,6 +66,8 @@
|
||||
@property (nonatomic, strong) UIImageView *iconImageView;
|
||||
///加入按钮
|
||||
@property (nonatomic, strong) UIButton *joinButton;
|
||||
///加入按钮描述
|
||||
@property (nonatomic, strong) UILabel *joinLabel;
|
||||
|
||||
@end
|
||||
|
||||
@@ -99,6 +108,8 @@
|
||||
[self.contentView addSubview:self.nameLabel];
|
||||
[self.contentView addSubview:self.countLabel];
|
||||
[self.contentView addSubview:self.stackView];
|
||||
[self.stackView addSubview:self.rankImageView];
|
||||
|
||||
[self.contentView addSubview:self.privilegeTitleImageView];
|
||||
[self.contentView addSubview:self.nameplateBgView];
|
||||
|
||||
@@ -113,6 +124,7 @@
|
||||
|
||||
[self.contentView addSubview:self.joinButton];
|
||||
[self.contentView addSubview:self.iconImageView];
|
||||
[self.contentView addSubview:self.joinLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -144,7 +156,7 @@
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(21);
|
||||
make.left.mas_equalTo(self.avatarImageView).mas_offset(8);
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).mas_offset(8);
|
||||
make.top.mas_equalTo(self.avatarImageView).offset(6);
|
||||
make.right.mas_equalTo(self.countLabel.mas_left).mas_offset(-4);
|
||||
}];
|
||||
@@ -158,8 +170,16 @@
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).mas_offset(8);
|
||||
make.bottom.mas_equalTo(self.avatarImageView).mas_offset(-3);
|
||||
make.height.mas_equalTo(28);
|
||||
make.width.mas_equalTo(34);
|
||||
}];
|
||||
|
||||
[self.rankImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.stackView);
|
||||
make.left.mas_equalTo(9);
|
||||
make.width.mas_equalTo(16);
|
||||
make.height.mas_equalTo(18);
|
||||
}];
|
||||
[self.privilegeTitleImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarImageView.mas_bottom).mas_offset(15);
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
@@ -223,6 +243,56 @@
|
||||
make.height.mas_equalTo(48);
|
||||
make.bottom.mas_equalTo(-kSafeAreaBottomHeight - 14);
|
||||
}];
|
||||
[self.joinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.iconImageView.mas_right);
|
||||
make.centerY.mas_equalTo(self.joinButton);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(XPAnchorFansJoinModel *)model {
|
||||
_model = model;
|
||||
self.avatarImageView.imageUrl = model.anchorAvatar;
|
||||
self.nameLabel.text = model.anchorNick;
|
||||
NSString *countStr = [NSString stringWithFormat:@"·%ld人", model.teamNum];
|
||||
NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
|
||||
style.alignment = NSTextAlignmentJustified;
|
||||
// style.firstLineHeadIndent = 5;
|
||||
style.headIndent = 3.0f;
|
||||
style.tailIndent = -3.0f;
|
||||
|
||||
NSAttributedString *attrText = [[NSAttributedString alloc] initWithString:countStr attributes:@{ NSParagraphStyleAttributeName : style}];
|
||||
self.countLabel.numberOfLines = 1;
|
||||
self.countLabel.attributedText = attrText;
|
||||
|
||||
XPAnchorFansPrivilegeModel *nameplateModel = model.privilegeConfigVos[0];
|
||||
self.nameplateImageView.imageUrl = nameplateModel.icon;
|
||||
self.nameplateLabel.text = nameplateModel.name;
|
||||
self.nameplateDescLabel.text = nameplateModel.desc;
|
||||
XPAnchorFansPrivilegeModel *giftModel = model.privilegeConfigVos[1];
|
||||
self.giftImageView.imageUrl = giftModel.icon;
|
||||
self.giftLabel.text = giftModel.name;
|
||||
self.giftDescLabel.text = giftModel.desc;
|
||||
|
||||
XPAnchorFansPrivilegeModel *joinModel = model.privilegeConfigVos[2];
|
||||
self.joinLabel.text = joinModel.name;
|
||||
|
||||
CGFloat margin = 8;
|
||||
for (int i = 0; i < model.avatarList.count; i++) {
|
||||
NSString *str = model.avatarList[i];
|
||||
NetImageConfig *config = [[NetImageConfig alloc] init];
|
||||
config.radius = 10;
|
||||
NetImageView *imageView = [[NetImageView alloc] initWithConfig:config];
|
||||
imageView.imageUrl = str;
|
||||
[self.stackView addSubview:imageView];
|
||||
[imageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.stackView);
|
||||
make.width.height.mas_equalTo(20);
|
||||
make.left.mas_equalTo(i * 27 + 25 + margin);
|
||||
}];
|
||||
}
|
||||
[self.stackView mas_updateConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(model.avatarList.count * (20 + margin) + 34);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - private
|
||||
@@ -230,6 +300,19 @@
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)helpButtonAction:(UIButton *)button {
|
||||
XPRoomHalfWebView * webView = [[XPRoomHalfWebView alloc] init];
|
||||
webView.url = [NSString stringWithFormat:@"%@?roomUid=%@", URLWithType(kAnchorFansRuleURL), self.roomUid];
|
||||
[TTPopup popupView:webView style:TTPopupStyleActionSheet];
|
||||
}
|
||||
|
||||
- (void)joinButtonAction:(UIButton *)button {
|
||||
XPAnchorFansPrivilegeModel *joinModel = self.model.privilegeConfigVos[2];
|
||||
[Api requestSendGift:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[self dismissViewControllerAnimated:YES completion:nil];
|
||||
} targetUids:[NSString stringWithFormat:@"%lld", self.model.teamUid] giftNum:@"1" sendType:@"1" giftId:[NSString stringWithFormat:@"%ld", joinModel.normalId] giftSource:@"1" giftType:@"" roomUid:self.roomUid msg:@"" uid:[[AccountInfoStorage instance] getUid]];
|
||||
}
|
||||
|
||||
#pragma mark - getter
|
||||
- (UIView *)topView {
|
||||
if (!_topView) {
|
||||
@@ -276,9 +359,8 @@
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.textAlignment = NSTextAlignmentRight;
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
label.textColor = [ThemeColor mainTextColor];
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightBold];
|
||||
_nameLabel = label;
|
||||
}
|
||||
return _nameLabel;
|
||||
@@ -287,25 +369,35 @@
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.textColor = UIColorFromRGB(0xFE3478);
|
||||
label.textAlignment = NSTextAlignmentRight;
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
label.font = [UIFont systemFontOfSize:10 weight:UIFontWeightMedium];
|
||||
label.layer.cornerRadius = 7.5;
|
||||
label.layer.masksToBounds = YES;
|
||||
label.backgroundColor = [UIColor whiteColor];
|
||||
_countLabel = label;
|
||||
}
|
||||
return _countLabel;
|
||||
}
|
||||
|
||||
- (UIStackView *)stackView {
|
||||
- (UIView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
_stackView.spacing = 16;
|
||||
_stackView.backgroundColor = [UIColor whiteColor];
|
||||
_stackView.layer.cornerRadius = 14;
|
||||
_stackView.layer.masksToBounds = YES;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
|
||||
- (UIImageView *)rankImageView {
|
||||
if (!_rankImageView) {
|
||||
_rankImageView = [[UIImageView alloc] init];
|
||||
_rankImageView.image = [UIImage imageNamed:@"anchor_fansTeam_rank"];
|
||||
}
|
||||
return _rankImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)privilegeTitleImageView {
|
||||
if (!_privilegeTitleImageView) {
|
||||
_privilegeTitleImageView = [[UIImageView alloc] init];
|
||||
@@ -411,16 +503,23 @@
|
||||
if (!_joinButton) {
|
||||
_joinButton = [[UIButton alloc] init];
|
||||
[_joinButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xFF49A3), UIColorFromRGB(0xFF2B4C)] gradientType:GradientTypeTopToBottom imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
||||
[_joinButton setTitle:@"送入团礼物加入主播粉丝团(10钻)" forState:UIControlStateNormal];
|
||||
_joinButton.layer.masksToBounds = YES;
|
||||
_joinButton.layer.cornerRadius = 24;
|
||||
_joinButton.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
[_joinButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[_joinButton addTarget:self action:@selector(doneButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_joinButton addTarget:self action:@selector(joinButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _joinButton;
|
||||
}
|
||||
|
||||
- (UILabel *)joinLabel {
|
||||
if (!_joinLabel) {
|
||||
UILabel *label = [[UILabel alloc] init];
|
||||
label.textColor = [UIColor whiteColor];
|
||||
label.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
||||
_joinLabel = label;
|
||||
}
|
||||
return _joinLabel;
|
||||
}
|
||||
|
||||
- (UIButton *)helpButton {
|
||||
if (!_helpButton) {
|
||||
_helpButton = [[UIButton alloc] init];
|
||||
|
@@ -33,6 +33,8 @@
|
||||
#import "AcrossRoomPKPanelModel.h"
|
||||
#import "LittleGameInfoModel.h"
|
||||
#import "XPAnchorFansRelationModel.h"
|
||||
#import "XPAnchorFansJoinModel.h"
|
||||
#import "XPAnchorFansTaskModel.h"
|
||||
///View
|
||||
#import "XPRoomHalfWebView.h"
|
||||
#import "XPAnchorAudienceUpMicView.h"
|
||||
@@ -80,6 +82,8 @@
|
||||
@property (nonatomic,strong) XPLittleGameMiniStageView *littleGameMiniView;
|
||||
///显示游戏的切换
|
||||
@property (nonatomic,strong) XPLittleGameRoomListView *gameListView;
|
||||
|
||||
@property (nonatomic, strong) XPAnchorFansRelationModel *relationFansModel;
|
||||
@end
|
||||
|
||||
@implementation XPRoomFunctionContainerView
|
||||
@@ -140,9 +144,8 @@
|
||||
}];
|
||||
[self.fansTeamEntranceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.contributionButton.mas_bottom).mas_offset(5);
|
||||
make.left.mas_equalTo(-12);
|
||||
make.height.mas_equalTo(26);
|
||||
make.width.mas_equalTo(90);
|
||||
make.left.mas_equalTo(0);
|
||||
make.height.mas_equalTo(37);
|
||||
}];
|
||||
[self.topicStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
@@ -633,22 +636,49 @@
|
||||
NSString *roomUid = [NSString stringWithFormat:@"%zd", self.delegate.getRoomInfo.uid];
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
|
||||
if ([[[AccountInfoStorage instance] getUid] isEqualToString:roomUid]) {///是房主
|
||||
if (roomInfo.hadOpenAnchorFans) {
|
||||
|
||||
} else {
|
||||
// if (!self.relationFansModel) {
|
||||
// [Api requestInRoomFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
// XPAnchorFansRelationModel *model = [XPAnchorFansRelationModel modelWithJSON:data.data];
|
||||
// [self updateFansTeamEntranceView:model];
|
||||
// } teamUid:[NSString stringWithFormat:@"%ld", roomInfo.uid]];
|
||||
// return;
|
||||
// }
|
||||
if (self.relationFansModel.isCurrentRoomAnchor) {///是房主
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = URLWithType(kAnchorFansOpenURL);
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
}
|
||||
if (self.relationFansModel.hasFansTeamCurrentRoom) {
|
||||
webVC.url = URLWithType(kAnchorFansListURL);
|
||||
} else {
|
||||
// XPAnchorFansTeamViewController *fansTeamVc = [[XPAnchorFansTeamViewController alloc] initWithRoomUid:roomUid];
|
||||
// [self.delegate.getCurrentNav presentViewController:fansTeamVc animated:YES completion:nil];
|
||||
|
||||
XPAnchorFansTaskViewController *fansTaskVc = [[XPAnchorFansTaskViewController alloc] initWithRoomUid:roomUid];
|
||||
[self.delegate.getCurrentNav presentViewController:fansTaskVc animated:YES completion:nil];
|
||||
webVC.url = URLWithType(kAnchorFansOpenURL);
|
||||
}
|
||||
webVC.roomUid = roomUid;
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
} else {
|
||||
if (self.relationFansModel.hasFansTeamCurrentRoom) {//开通了粉丝团
|
||||
if (self.relationFansModel.isAnchorFans) {
|
||||
[Api requestFansTeamTask:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code != 200) {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
return;
|
||||
}
|
||||
XPAnchorFansTaskModel *model = [XPAnchorFansTaskModel modelWithJSON:data.data];
|
||||
XPAnchorFansTaskViewController *fansTaskVc = [[XPAnchorFansTaskViewController alloc] initWithRoomUid:roomUid];
|
||||
fansTaskVc.model = model;
|
||||
[self.delegate.getCurrentNav presentViewController:fansTaskVc animated:YES completion:nil];
|
||||
} teamUid:roomUid];
|
||||
} else {
|
||||
[Api requestJoinFansTeam:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code != 200) {
|
||||
[XCHUDTool showErrorWithMessage:msg];
|
||||
return;
|
||||
}
|
||||
XPAnchorFansJoinModel *model = [XPAnchorFansJoinModel modelWithJSON:data.data];
|
||||
XPAnchorFansTeamViewController *fansTeamVc = [[XPAnchorFansTeamViewController alloc] initWithRoomUid:roomUid];
|
||||
fansTeamVc.model = model;
|
||||
[self.delegate.getCurrentNav presentViewController:fansTeamVc animated:YES completion:nil];
|
||||
} teamUid:roomUid];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#pragma mark - 房间话题
|
||||
@@ -795,18 +825,27 @@
|
||||
|
||||
#pragma mark - 个播粉丝团
|
||||
- (void)updateFansTeamEntranceView:(XPAnchorFansRelationModel *)model {
|
||||
RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
if ([[[AccountInfoStorage instance] getUid] integerValue] == roomInfo.uid) {
|
||||
roomInfo.hadOpenAnchorFans = model.hasFansTeamCurrentRoom;
|
||||
roomInfo.anchorFansRedDot = model.isRedPop;
|
||||
if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
self.fansTeamEntranceView.hidden = NO;
|
||||
} else {
|
||||
// self.fansTeamEntranceView.hidden = YES;
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
// RoomInfoModel * roomInfo = self.delegate.getRoomInfo;
|
||||
// roomInfo.anchorFansRedDot = model.isRedPop;
|
||||
// if ([[[AccountInfoStorage instance] getUid] integerValue] == roomInfo.uid) {///是房主
|
||||
// if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
// self.fansTeamEntranceView.title = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"开通粉丝团";
|
||||
// }
|
||||
// } else {
|
||||
// if (model.hasFansTeamCurrentRoom) {//已开通粉丝团
|
||||
// if (model.isAnchorFans) {
|
||||
// self.fansTeamEntranceView.title = [NSString stringWithFormat:@"粉丝团(%ld)", model.anchorFansNum];
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"加入我的粉丝团吧~";
|
||||
// }
|
||||
// } else {
|
||||
// self.fansTeamEntranceView.title = @"该主播暂未开通粉丝团";
|
||||
// }
|
||||
// }
|
||||
self.fansTeamEntranceView.model = model;
|
||||
self.relationFansModel = model;
|
||||
}
|
||||
|
||||
#pragma mark - XPRoomLittleGameListViewDelegate
|
||||
@@ -904,7 +943,6 @@
|
||||
- (XPAnchorFansTeamEntranceView *)fansTeamEntranceView {
|
||||
if (!_fansTeamEntranceView) {
|
||||
_fansTeamEntranceView = [[XPAnchorFansTeamEntranceView alloc]init];
|
||||
// _fansTeamEntranceView.hidden = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFansTeamRecognizer)];
|
||||
[_fansTeamEntranceView addGestureRecognizer:tap];
|
||||
}
|
||||
|
@@ -38,8 +38,6 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) {
|
||||
RoomMoreMenuType_Room_Across_PK_Open = 13,
|
||||
///关闭跨房pk
|
||||
RoomMoreMenuType_Room_Across_PK_Close = 14,
|
||||
///开通粉丝团(个播房的)
|
||||
RoomMoreMenuType_Room_OpenFansClub = 15,
|
||||
};
|
||||
|
||||
@interface XPRoomMoreItemModel : NSObject
|
||||
@@ -51,8 +49,6 @@ typedef NS_ENUM(NSInteger, RoomMoreMenuType) {
|
||||
@property (nonatomic,strong) UIColor *titleColor;
|
||||
///类型
|
||||
@property (nonatomic,assign) RoomMoreMenuType type;
|
||||
///是否显示红点
|
||||
@property (nonatomic, assign) BOOL showRedDot;
|
||||
|
||||
+(XPRoomMoreItemModel *)initWithTitle:(NSString *)title imageName:(NSString *)imageName type:(RoomMoreMenuType)type titleColor:(UIColor *)titleColor;
|
||||
|
||||
|
@@ -77,13 +77,6 @@
|
||||
trumpet.type = RoomMoreMenuType_Room_trumpet;
|
||||
trumpet.titleColor = [ThemeColor roomMoreMenuTextColor];
|
||||
|
||||
XPRoomMoreItemModel * anchorFansClub = [[XPRoomMoreItemModel alloc] init];
|
||||
anchorFansClub.title = @"开通粉丝团";
|
||||
anchorFansClub.imageName = @"room_more_menu_fansTeam";
|
||||
anchorFansClub.type = RoomMoreMenuType_Room_OpenFansClub;
|
||||
anchorFansClub.titleColor = [ThemeColor roomMoreMenuTextColor];
|
||||
anchorFansClub.showRedDot = roomInfo.anchorFansRedDot;
|
||||
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
NSString * roomId = [NSString stringWithFormat:@"%ld", roomInfo.roomId];
|
||||
NIMChatroomMembersByIdsRequest *request = [[NIMChatroomMembersByIdsRequest alloc]init];
|
||||
@@ -113,9 +106,6 @@
|
||||
}
|
||||
}
|
||||
[array addObject:trumpet];
|
||||
if (isCreator && roomInfo.type == RoomType_Anchor && !roomInfo.hadOpenAnchorFans) {
|
||||
[array addObject:anchorFansClub];
|
||||
}
|
||||
}
|
||||
[[self getView] getMoreMenuDataSuccess:array];
|
||||
}];
|
||||
|
@@ -17,8 +17,6 @@
|
||||
@property (nonatomic,strong) UIImageView *logoImageView;
|
||||
///显示标题
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///小红点
|
||||
@property (nonatomic, strong) UIView *redDotView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -37,7 +35,6 @@
|
||||
- (void)initSubViews {
|
||||
[self.contentView addSubview:self.logoImageView];
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.contentView addSubview:self.redDotView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -50,10 +47,6 @@
|
||||
make.left.right.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.logoImageView.mas_bottom).offset(12);
|
||||
}];
|
||||
[self.redDotView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.right.top.mas_equalTo(self.logoImageView);
|
||||
make.width.height.mas_equalTo(6);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -63,7 +56,6 @@
|
||||
self.logoImageView.image = [UIImage imageNamed:_itemModel.imageName];
|
||||
self.titleLabel.text = _itemModel.title;
|
||||
self.titleLabel.textColor = _itemModel.titleColor ? _itemModel.titleColor : [ThemeColor mainTextColor];
|
||||
self.redDotView.hidden = !itemModel.showRedDot;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,15 +77,4 @@
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UIView *)redDotView {
|
||||
if (!_redDotView) {
|
||||
_redDotView = [[UIView alloc] init];
|
||||
_redDotView.backgroundColor = [UIColor redColor];
|
||||
_redDotView.layer.cornerRadius = 3;
|
||||
_redDotView.layer.masksToBounds = YES;
|
||||
_redDotView.hidden = YES;
|
||||
}
|
||||
return _redDotView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -288,11 +288,6 @@ UIKIT_EXTERN NSString * const kRoomGiftEffectUpdateNotificationKey;
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
break;
|
||||
case RoomMoreMenuType_Room_OpenFansClub:
|
||||
{
|
||||
[self dismissViewControllerAnimated:NO completion:nil];
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|