diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 8b4f5b86..4970f402 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -521,6 +521,10 @@ 54AE7E172C9AE589006D2BE2 /* CPListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54AE7E162C9AE589006D2BE2 /* CPListViewController.m */; }; 54B9C6E72C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */; }; 54B9C6EA2C9C2DDC003F1CC5 /* GuildInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 54B9C6E92C9C2DDC003F1CC5 /* GuildInfo.m */; }; + 54B9C6F32C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 54B9C6F22C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m */; }; + 54B9C6F72C9D8D05003F1CC5 /* 4.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 54B9C6F52C9D8D05003F1CC5 /* 4.mp4 */; }; + 54B9C6F82C9D8D05003F1CC5 /* 5.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 54B9C6F62C9D8D05003F1CC5 /* 5.mp4 */; }; + 54B9C6F92C9D8D05003F1CC5 /* 3.mp4 in Resources */ = {isa = PBXBuildFile; fileRef = 54B9C6F42C9D8D05003F1CC5 /* 3.mp4 */; }; 54C3895C2C215F5100FD47B1 /* XPHomeMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */; }; 54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */; }; 54C389622C23BD1600FD47B1 /* HomeRankAvatarModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389612C23BD1600FD47B1 /* HomeRankAvatarModel.m */; }; @@ -2586,6 +2590,11 @@ 54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGuildTableViewCell.m; sourceTree = ""; }; 54B9C6E82C9C2DDC003F1CC5 /* GuildInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GuildInfo.h; sourceTree = ""; }; 54B9C6E92C9C2DDC003F1CC5 /* GuildInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GuildInfo.m; sourceTree = ""; }; + 54B9C6F12C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineMultipleContentTableViewCell.h; sourceTree = ""; }; + 54B9C6F22C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMultipleContentTableViewCell.m; sourceTree = ""; }; + 54B9C6F42C9D8D05003F1CC5 /* 3.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 3.mp4; sourceTree = ""; }; + 54B9C6F52C9D8D05003F1CC5 /* 4.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 4.mp4; sourceTree = ""; }; + 54B9C6F62C9D8D05003F1CC5 /* 5.mp4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = 5.mp4; sourceTree = ""; }; 54C3895A2C215F5100FD47B1 /* XPHomeMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMineViewController.h; sourceTree = ""; }; 54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeMineViewController.m; sourceTree = ""; }; 54C3895D2C2189DD00FD47B1 /* XPHomeMinePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMinePresenter.h; sourceTree = ""; }; @@ -6476,6 +6485,9 @@ 54FFD3802C9BD12600DE61E5 /* cp */ = { isa = PBXGroup; children = ( + 54B9C6F42C9D8D05003F1CC5 /* 3.mp4 */, + 54B9C6F52C9D8D05003F1CC5 /* 4.mp4 */, + 54B9C6F62C9D8D05003F1CC5 /* 5.mp4 */, 54FFD37B2C9BD12600DE61E5 /* 1.svga */, 54FFD37C2C9BD12600DE61E5 /* 2.svga */, 54FFD37D2C9BD12600DE61E5 /* 3.svga */, @@ -11034,6 +11046,8 @@ E8D34D4C28080351009C4835 /* XPMineDataClanTableViewCell.m */, 54F469362C29C3B400A83655 /* XPMineAlbumTableViewCell.h */, 54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */, + 54B9C6F12C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.h */, + 54B9C6F22C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m */, 54B9C6E52C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.h */, 54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */, 54F4693C2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.h */, @@ -11290,6 +11304,9 @@ E80EC86828ACD84000D133C5 /* emoji_39@2x.png in Resources */, E80EC8B228ACD84100D133C5 /* emoji_140@2x.png in Resources */, 9B0997A127F19D8A00EB8F14 /* README.md in Resources */, + 54B9C6F72C9D8D05003F1CC5 /* 4.mp4 in Resources */, + 54B9C6F82C9D8D05003F1CC5 /* 5.mp4 in Resources */, + 54B9C6F92C9D8D05003F1CC5 /* 3.mp4 in Resources */, E80EC89828ACD84000D133C5 /* emoji_117@2x.png in Resources */, E80EC8A228ACD84100D133C5 /* emoji_09@2x.png in Resources */, E80EC89228ACD84000D133C5 /* emoji_87@2x.png in Resources */, @@ -11591,6 +11608,7 @@ 238B37A62AC55A2C00BFC9D5 /* TreasureFairySendRecordModel.m in Sources */, E8AB632F28AE19DE0023B0D2 /* XPMomentMinePresenter.m in Sources */, E85E7B042A4EB0D200B6D00A /* XPGuildIncomeDetailPresenter.m in Sources */, + 54B9C6F32C9D27F3003F1CC5 /* XPMineMultipleContentTableViewCell.m in Sources */, 54F4693E2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m in Sources */, 9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */, 2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */, diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/Contents.json new file mode 100644 index 00000000..7aea04b5 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "切图 45@3x-3.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/切图 45@3x-3.png b/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/切图 45@3x-3.png new file mode 100644 index 00000000..2e148fd8 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.16/user_detail_followed.imageset/切图 45@3x-3.png differ diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/Contents.json new file mode 100644 index 00000000..590383b3 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "切图 45@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/切图 45@3x.png b/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/切图 45@3x.png new file mode 100644 index 00000000..32d19165 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.16/user_detail_message.imageset/切图 45@3x.png differ diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/Contents.json new file mode 100644 index 00000000..bb6fdb94 --- /dev/null +++ b/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "切图 45@3x-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/切图 45@3x-2.png b/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/切图 45@3x-2.png new file mode 100644 index 00000000..0b1af5ce Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.16/user_detail_unfollow.imageset/切图 45@3x-2.png differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/Contents.json b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/Contents.json index 59a2a960..2fa55844 100644 --- a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "monents_info_comment_count@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "monents_info_comment_count@3x.png", + "filename" : "切图 12@3x (2).png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@2x.png b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@2x.png deleted file mode 100644 index 4df3f588..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@3x.png b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@3x.png deleted file mode 100644 index 2d0d4a67..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/monents_info_comment_count@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/切图 12@3x (2).png b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/切图 12@3x (2).png new file mode 100644 index 00000000..b259cac5 Binary files /dev/null and b/YuMi/Assets.xcassets/Monents/monents_info_comment_count.imageset/切图 12@3x (2).png differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/Contents.json b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/Contents.json index b7effae3..7aea04b5 100644 --- a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "monents_info_like_count_normal@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "monents_info_like_count_normal@3x.png", + "filename" : "切图 45@3x-3.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@2x.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@2x.png deleted file mode 100644 index a527c057..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@3x.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@3x.png deleted file mode 100644 index 0123f196..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/monents_info_like_count_normal@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/切图 45@3x-3.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/切图 45@3x-3.png new file mode 100644 index 00000000..2e148fd8 Binary files /dev/null and b/YuMi/Assets.xcassets/Monents/monents_info_like_count_normal.imageset/切图 45@3x-3.png differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/Contents.json b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/Contents.json index 1c0d2a64..d100c9f0 100644 --- a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/Contents.json +++ b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/Contents.json @@ -5,12 +5,11 @@ "scale" : "1x" }, { - "filename" : "monents_info_like_count_select@2x.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "monents_info_like_count_select@3x.png", + "filename" : "切图 12@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@2x.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@2x.png deleted file mode 100644 index 42c0e9bb..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@3x.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@3x.png deleted file mode 100644 index 346ee035..00000000 Binary files a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/monents_info_like_count_select@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/切图 12@3x.png b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/切图 12@3x.png new file mode 100644 index 00000000..6955616f Binary files /dev/null and b/YuMi/Assets.xcassets/Monents/monents_info_like_count_select.imageset/切图 12@3x.png differ diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.h b/YuMi/Modules/YMMine/Api/Api+Mine.h index 30966042..577d504a 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.h +++ b/YuMi/Modules/YMMine/Api/Api+Mine.h @@ -351,6 +351,14 @@ NS_ASSUME_NONNULL_BEGIN //取消 cp 关系 +(void)cancelCPList:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid loverUid:(NSNumber *)loverUid goldNum:(NSNumber *)goldNum; + +/// 用户设置 CP 内容展示开关 +/// - Parameters: +/// - completion: completion description +/// - type: 1-cp头像是否展示,2-cp动画 +/// - isShow: 是否开启 ++(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/Api/Api+Mine.m b/YuMi/Modules/YMMine/Api/Api+Mine.m index 8c58cc64..bf91439d 100644 --- a/YuMi/Modules/YMMine/Api/Api+Mine.m +++ b/YuMi/Modules/YMMine/Api/Api+Mine.m @@ -458,4 +458,8 @@ +(void)cancelCPList:(HttpRequestHelperCompletion)completion uid:(NSNumber *)uid loverUid:(NSNumber *)loverUid goldNum:(NSNumber *)goldNum { [self makeRequest:@"user/cp/cancel" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, loverUid, goldNum, nil]; } + ++(void)updateCPSetting:(HttpRequestHelperCompletion)completion type:(NSNumber *)type isShow:(NSNumber *)isShow { + [self makeRequest:@"user/setting/update" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, type, isShow, nil]; +} @end diff --git a/YuMi/Modules/YMMine/Model/XPMineUserInfoEditModel.h b/YuMi/Modules/YMMine/Model/XPMineUserInfoEditModel.h index 3be6f196..2d1ae304 100644 --- a/YuMi/Modules/YMMine/Model/XPMineUserInfoEditModel.h +++ b/YuMi/Modules/YMMine/Model/XPMineUserInfoEditModel.h @@ -17,6 +17,8 @@ typedef NS_ENUM(NSInteger, XPMineUserInfoEditType) { XPMineUserInfoEditType_Sound,///声音 XPMineUserInfoEditType_Tag,///标签 XPMineUserInfoEditType_Area,///地区 + XPMineUserInfoEditType_CP_Animation,///cp 个人主页动画 + XPMineUserInfoEditType_CP_Avatar,///cp 个人主页头像 }; @interface XPMineUserInfoEditModel : PIBaseModel @@ -33,6 +35,9 @@ typedef NS_ENUM(NSInteger, XPMineUserInfoEditType) { ///相册 @property (nonatomic,copy) NSArray *photoArray; +@property (nonatomic, assign) BOOL isCPAnimation; +@property (nonatomic, assign) BOOL isCPAvatar; + @end diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m index 2776d24e..fefae375 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m @@ -55,6 +55,7 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + self.backgroundColor = [UIColor clearColor]; self.contentView.backgroundColor = [UIColor clearColor]; [self.contentView addSubview:self.albumCollectionView]; [self.albumCollectionView mas_makeConstraints:^(MASConstraintMaker *make) { @@ -148,6 +149,7 @@ didSelectItemAtIndexPath:(NSIndexPath *)indexPath { _noDataLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserInfoGiftWallViewController3") font:kFontRegular(14) textColor:[UIColor colorWithWhite:1 alpha:0.6]]; + _noDataLabel.backgroundColor = [UIColor clearColor]; _noDataLabel.textAlignment = NSTextAlignmentCenter; _noDataLabel.alpha = 0.5; _noDataLabel.hidden = YES; diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineGuildTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineGuildTableViewCell.m index e9444e41..3d20521b 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineGuildTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineGuildTableViewCell.m @@ -23,6 +23,9 @@ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { self.selectionStyle = UITableViewCellSelectionStyleNone; + self.backgroundColor = [UIColor clearColor]; + self.contentView.backgroundColor = [UIColor clearColor]; + [self setupUI]; } return self; } @@ -35,12 +38,13 @@ UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:kImage(@"user_guild_bg")]; [self.contentView addSubview:backgroundImageView]; [backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.contentView); + make.top.leading.trailing.mas_equalTo(self.contentView); + make.height.mas_equalTo(kGetScaleWidth(85)); }]; [self.contentView addSubview:self.avatarImageView]; [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerY.mas_equalTo(self.contentView); + make.centerY.mas_equalTo(backgroundImageView); make.leading.mas_equalTo(self.contentView).offset(12); make.width.height.mas_equalTo(kGetScaleWidth(62)); }]; @@ -76,8 +80,9 @@ - (void)setInfo:(GuildInfo *)info { _info = info; self.avatarImageView.imageUrl = info.avatar; - self.guildIDLabel.text = [NSString stringWithFormat:@"Guild ID: $ld", (long)info.guildId]; - self.agentIDLabel.text = [NSString stringWithFormat:@"Agent ID: $ld", (long)info.erbanNo]; + self.nameLabel.text = info.guildName; + self.guildIDLabel.text = [NSString stringWithFormat:@"Guild ID: %ld", (long)info.guildId]; + self.agentIDLabel.text = [NSString stringWithFormat:@"Agent ID: %ld", (long)info.erbanNo]; } #pragma mark - diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.h b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.h new file mode 100644 index 00000000..2bdd658e --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.h @@ -0,0 +1,29 @@ +// +// XPMineMultipleContentTableViewCell.h +// YuMi +// +// Created by P on 2024/9/20. +// + +#import + +@class MedalModel, UserGiftWallInfoModel; + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMineMultipleContentTableViewCell : UITableViewCell + +@property (nonatomic, strong) MedalModel *medalModel; +@property (nonatomic, strong) NSArray *giftWall; +@property (nonatomic, strong) NSArray *luckyGiftWall; + +@property (nonatomic, copy) void(^didChangeCatalog)(BOOL isMedal); + ++ (CGFloat)cellHeightFro:(MedalModel *)medalModel; ++ (CGFloat)cellHeightFro:(NSArray *)giftWall with:(NSArray *)luckyGiftWall; + +- (void)updateCell; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m new file mode 100644 index 00000000..19d341d2 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMultipleContentTableViewCell.m @@ -0,0 +1,414 @@ +// +// XPMineMultipleContentTableViewCell.m +// YuMi +// +// Created by P on 2024/9/20. +// + +#import "XPMineMultipleContentTableViewCell.h" + +#import + +#import "MedalModel.h" +#import "UserGiftWallInfoModel.h" +#import "XPRoomGiftAnimationParser.h" + + +@interface RoundCornerBorderBackground : UIView + +@end + +@implementation RoundCornerBorderBackground + +- (instancetype)init { + if (self = [super init]) { + [self setupBGColor]; + self.layer.borderColor = UIColorFromRGB(0x1A4655).CGColor; + self.layer.borderWidth = 1; + self.layer.cornerRadius = 8; + self.layer.masksToBounds = YES; + } + return self; +} + +- (void)setupBGColor { + // 创建 CAGradientLayer + CAGradientLayer *gradientLayer = [CAGradientLayer layer]; + + // 设置渐变颜色数组(从上到下) + gradientLayer.colors = @[ + (id)UIColorFromRGB(0x041921).CGColor, + (id)UIColorFromRGB(0x072834).CGColor + ]; + + // 设置渐变的起止位置(0.0 是顶部,1.0 是底部) + gradientLayer.startPoint = CGPointMake(0.5, 0.0); // 顶部中央 + gradientLayer.endPoint = CGPointMake(0.5, 1.0); // 底部中央 + + // 设置渐变图层的大小为视图的大小 + gradientLayer.frame = self.bounds; + + // 将渐变图层添加到 view 的图层中 + [self.layer insertSublayer:gradientLayer atIndex:0]; +} + +@end + +@interface XPMultipleContentCollectionCell : UICollectionViewCell + +@property (nonatomic, copy) NSString *videoUrl; +@property (nonatomic, strong) VAPView *vapView; +@property (nonatomic, strong) XPRoomGiftAnimationParser *vapParser; +@property (nonatomic, strong) NetImageView *icon; +@property (nonatomic, strong) UILabel *nameLabel; +@property (nonatomic, strong) UILabel *countLabel; + +@property (nonatomic, strong) UserMedalModel *userMedalModel; +@property (nonatomic, strong) UserGiftWallInfoModel *giftModel; + +@end + +@implementation XPMultipleContentCollectionCell + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + RoundCornerBorderBackground *view = [[RoundCornerBorderBackground alloc] init]; + [self.contentView addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; + + [self.contentView addSubview:self.icon]; + [self.icon mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.contentView); + make.top.mas_equalTo(self.contentView).offset(8); + make.width.height.mas_equalTo(kGetScaleWidth(63)); + }]; + + [self.contentView addSubview:self.nameLabel]; + [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.contentView); + make.top.mas_equalTo(self.icon.mas_bottom).offset(2); + make.height.mas_equalTo(18); + }]; + + [self.contentView addSubview:self.countLabel]; + [self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.contentView); + make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(2); + make.height.mas_equalTo(20); + }]; + + [self.contentView addSubview:self.vapView]; + [self.vapView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.icon); + }]; + } + return self; +} + +- (void)setGiftModel:(UserGiftWallInfoModel *)giftModel { + _giftModel = giftModel; + + self.vapView.hidden = YES; + [self.vapView stopHWDMP4]; + + self.icon.hidden = NO; + self.countLabel.hidden = NO; + + self.icon.imageUrl = giftModel.picUrl; + self.nameLabel.text = giftModel.giftName; + self.countLabel.text = [NSString stringWithFormat:@"x%ld", (long)giftModel.reciveCount]; +} + +- (void)setUserMedalModel:(UserMedalModel *)userMedalModel { + + self.icon.hidden = YES; + self.vapView.hidden = NO; + self.countLabel.hidden = YES; + + self.nameLabel.text = userMedalModel.medalName; + if (self.videoUrl.length > 0) { + [self.vapView playHWDMP4:self.videoUrl repeatCount:-1 delegate:nil]; + } else { + NSString *resourcePath = [userMedalModel.picUrl stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; + if (resourcePath.length > 0) { + NSString *encodingUrl = [resourcePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet characterSetWithCharactersInString:@"`#%^{}\"[]|\\<> "].invertedSet]; + @kWeakify(self); + [self.vapParser parseWithURL:encodingUrl completionBlock:^(NSString * _Nullable videoUrl) { + @kStrongify(self); + if (videoUrl.length) { + [self.vapView playHWDMP4:videoUrl repeatCount:-1 delegate:nil]; + } + } failureBlock:^(NSError * _Nullable error) { + }]; + } + } +} + +- (NetImageView *)icon { + if (!_icon) { + _icon = [[NetImageView alloc] init]; + } + return _icon; +} + +- (UILabel *)nameLabel { + if (!_nameLabel) { + _nameLabel = [UILabel labelInitWithText:@"" font:kFontMedium(12) textColor:[UIColor whiteColor]]; + } + return _nameLabel; +} + +- (UILabel *)countLabel { + if (!_countLabel) { + _countLabel = [UILabel labelInitWithText:@"" font:kFontMedium(14) textColor:[UIColor whiteColor]]; + } + return _countLabel; +} + +- (VAPView *)vapView { + if (!_vapView) { + _vapView = [[VAPView alloc] init]; + [_vapView setMute:YES]; + _vapView.contentMode = UIViewContentModeScaleAspectFill; + } + return _vapView; +} + +- (XPRoomGiftAnimationParser *)vapParser { + if (!_vapParser) { + _vapParser = [[XPRoomGiftAnimationParser alloc] init]; + } + return _vapParser; +} + +@end + +@interface XPMineMultipleContentTableViewCell () + +@property (nonatomic, assign) BOOL isMedal; + +@property (nonatomic, strong) UIButton *giftButton; +@property (nonatomic, strong) UIButton *medalButton; +@property (nonatomic, strong) UIImageView *indicatorImageView; +@property (nonatomic, strong) UICollectionView *contentCollectionView; +@property (nonatomic, strong) UICollectionViewFlowLayout *contentLayout; + +@property (nonatomic, strong) NSMutableArray *allGifts; + +@property (nonatomic, strong) UILabel *emptyLabel; + +@end + +@implementation XPMineMultipleContentTableViewCell + ++ (CGFloat)cellHeightFro:(MedalModel *)medalModel +{ + if (!medalModel || medalModel.userMedals.count == 0) { + return kGetScaleWidth(116); + } + NSInteger lines = ceil(medalModel.userMedals.count/4.0); + return 42 + lines * (kGetScaleWidth(94) + 16); +} + + ++ (CGFloat)cellHeightFro:(NSArray *)giftWall with:(NSArray *)luckyGiftWall +{ + if (giftWall.count == 0 && luckyGiftWall.count == 0) { + return kGetScaleWidth(116); + } + NSInteger lines = ceil((giftWall.count + luckyGiftWall.count)/4.0); + return 42 + lines * (kGetScaleWidth(116) + 16); +} + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + self.selectionStyle = UITableViewCellSelectionStyleNone; + self.backgroundColor = [UIColor clearColor]; + self.contentView.backgroundColor = [UIColor clearColor]; + self.isMedal = YES; + [self setupUI]; + } + return self; +} + +- (void)setupUI { + RoundCornerBorderBackground *view = [[RoundCornerBorderBackground alloc] init]; + [self.contentView addSubview:view]; + [view mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.trailing.mas_equalTo(self.contentView); + make.bottom.mas_equalTo(self.contentView);//.offset(-8); + }]; + + [self.contentView addSubview:self.medalButton]; + [self.medalButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(8); + make.leading.mas_equalTo(8); + make.size.mas_equalTo(CGSizeMake(60, 22)); + }]; + + [self.contentView addSubview:self.giftButton]; + [self.giftButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.medalButton); + make.leading.mas_equalTo(8 + 60 + 8); + make.size.mas_equalTo(CGSizeMake(50, 22)); + }]; + + [self.contentView addSubview:self.indicatorImageView]; + [self.indicatorImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.medalButton); + make.top.mas_equalTo(self.medalButton.mas_bottom); + make.size.mas_equalTo(CGSizeMake(21, 6)); + }]; + + [self.contentView addSubview:self.contentCollectionView]; + [self.contentCollectionView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.indicatorImageView.mas_bottom).offset(8); + make.bottom.mas_equalTo(view).offset(-8); + make.leading.mas_equalTo(view).offset(8); + make.trailing.mas_equalTo(view).offset(-8); + }]; + + [self.contentView addSubview:self.emptyLabel]; + [self.emptyLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.indicatorImageView.mas_bottom).offset(8); + make.bottom.mas_equalTo(view).offset(-8); + make.leading.mas_equalTo(view).offset(8); + make.trailing.mas_equalTo(view).offset(-8); + }]; +} + +- (void)didTapButton:(UIButton *)sender { + + self.isMedal = sender.tag == 1; + + self.medalButton.selected = self.isMedal ? YES : NO; + self.giftButton.selected = self.isMedal ? NO : YES; + self.medalButton.titleLabel.font = self.isMedal ? kFontSemibold(16) : kFontRegular(14); + self.giftButton.titleLabel.font = self.isMedal ? kFontRegular(14) : kFontSemibold(16); + + [self.indicatorImageView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.centerX.mas_equalTo(self.isMedal ? self.medalButton : self.giftButton); + make.top.mas_equalTo(self.medalButton.mas_bottom); + make.size.mas_equalTo(CGSizeMake(21, 6)); + }]; + + if (self.didChangeCatalog) { + self.didChangeCatalog(self.isMedal); + } +} + +- (void)setGiftWall:(NSArray *)giftWall { + self.allGifts = @[].mutableCopy; + [self.allGifts addObjectsFromArray:giftWall]; +} + +- (void)setLuckyGiftWall:(NSArray *)luckyGiftWall { + [self.allGifts addObjectsFromArray:luckyGiftWall]; +} + +- (void)updateCell { + [self.contentCollectionView reloadData]; +} + +#pragma mark - +- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { + if (self.isMedal) { + return self.medalModel.userMedals.count; + } else { + return self.allGifts.count; + } +} + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { + XPMultipleContentCollectionCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPMultipleContentCollectionCell class]) forIndexPath:indexPath]; + if (self.isMedal) { + cell.userMedalModel = [self.medalModel.userMedals xpSafeObjectAtIndex:indexPath.row]; + } else { + cell.giftModel = [self.allGifts xpSafeObjectAtIndex:indexPath.row]; + } + + return cell; +} + +- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { + return self.isMedal ? CGSizeMake(kGetScaleWidth(77), kGetScaleWidth(94)) : CGSizeMake(kGetScaleWidth(77), kGetScaleWidth(116)); +} + + +#pragma mark - +- (UIButton *)medalButton { + if (!_medalButton) { + _medalButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _medalButton.tag = 1; + _medalButton.selected = YES; + [_medalButton setTitle:@"Medal" forState:UIControlStateNormal]; + [_medalButton.titleLabel setFont:kFontSemibold(16)]; + [_medalButton setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; + [_medalButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.6] forState:UIControlStateNormal]; + + [_medalButton addTarget:self + action:@selector(didTapButton:) + forControlEvents:UIControlEventTouchUpInside]; + } + return _medalButton; +} + +- (UIButton *)giftButton { + if (!_giftButton) { + _giftButton = [UIButton buttonWithType:UIButtonTypeCustom]; + _giftButton.tag = 2; + [_giftButton setTitle:@"Gift" forState:UIControlStateNormal]; + [_giftButton.titleLabel setFont:kFontRegular(14)]; + [_giftButton setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; + [_giftButton setTitleColor:[UIColor colorWithWhite:1 alpha:0.6] forState:UIControlStateNormal]; + + [_giftButton addTarget:self + action:@selector(didTapButton:) + forControlEvents:UIControlEventTouchUpInside]; + } + return _giftButton; +} + +- (UIImageView *)indicatorImageView { + if (!_indicatorImageView) { + _indicatorImageView = [[UIImageView alloc] initWithImage:kImage(@"user_page_Indicator")]; + } + return _indicatorImageView; +} + +- (UICollectionViewFlowLayout *)contentLayout { + if (!_contentLayout) { + _contentLayout = [[UICollectionViewFlowLayout alloc] init]; + _contentLayout.scrollDirection = UICollectionViewScrollDirectionVertical; + _contentLayout.minimumInteritemSpacing = 7; + _contentLayout.minimumLineSpacing = 7; + } + return _contentLayout; +} + +- (UICollectionView *)contentCollectionView { + if (!_contentCollectionView) { + _contentCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero + collectionViewLayout:self.contentLayout]; + _contentCollectionView.delegate = self; + _contentCollectionView.dataSource = self; + _contentCollectionView.backgroundColor = [UIColor clearColor]; + _contentCollectionView.scrollEnabled = NO; + [_contentCollectionView registerClass:[XPMultipleContentCollectionCell class] + forCellWithReuseIdentifier:NSStringFromClass([XPMultipleContentCollectionCell class])]; + } + return _contentCollectionView; +} + +- (UILabel *)emptyLabel { + if (!_emptyLabel) { + _emptyLabel = [UILabel labelInitWithText:@"No data" font:kFontRegular(14) textColor:[UIColor colorWithWhite:1 alpha:0.6]]; + _emptyLabel.textAlignment = NSTextAlignmentCenter; + _emptyLabel.hidden = YES; + } + return _emptyLabel; +} + +@end diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.h b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.h index 389565f5..dc7b55ba 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.h +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.h @@ -16,6 +16,12 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong) XPSoundCardModel *soundModel; @property (nonatomic,strong) NSMutableArray *itemList; @property (nonatomic,assign) CGFloat maxWidth; + +@property (nonatomic, assign) BOOL isCPAvatarDisplay; +@property (nonatomic, assign) BOOL isCPAnimationDisplay; + +@property (nonatomic, copy) void(^changeCPSwitch)(BOOL isOn, NSInteger type); + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.m index f1a25f0f..718cb6cf 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEditTableViewCell.m @@ -50,6 +50,8 @@ //审核View @property (nonatomic,strong) UIImageView *reviewView; +@property (nonatomic, strong) UISwitch *switchButton; + /// @property (nonatomic,strong) XPMineUserInfoEditMainTagView *editTagView; @@ -87,22 +89,18 @@ [self.stackView addArrangedSubview:self.phototStackView]; [self.stackView addArrangedSubview:self.soundView]; [self.stackView addArrangedSubview:self.arrowImageView]; - + [self.stackView addArrangedSubview:self.switchButton]; + [self.phototStackView addArrangedSubview:self.thirdPhotoImageView]; [self.phototStackView addArrangedSubview:self.secondPhotoImageView]; [self.phototStackView addArrangedSubview:self.firstPhotoImageView]; - - - - - + [self.photoViewArray addObject:self.firstPhotoImageView]; [self.photoViewArray addObject:self.secondPhotoImageView]; [self.photoViewArray addObject:self.thirdPhotoImageView]; [self.avatarImageView addSubview:self.reviewView]; [self.contentView addSubview:self.editTagView]; - } - (void)initSubViewConstraints { @@ -132,6 +130,10 @@ [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) { make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(20), kGetScaleWidth(20))); }]; + [self.switchButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(kGetScaleWidth(34), kGetScaleWidth(20))); + }]; + [self.soundView mas_makeConstraints:^(MASConstraintMaker *make) { make.width.mas_equalTo(kGetScaleWidth(85)); make.height.mas_equalTo(kGetScaleWidth(28)); @@ -183,13 +185,16 @@ } - (void)configCellWithModel:(XPMineUserInfoEditModel *)model{ - _soundView.hidden = YES; - _editTagView.hidden = YES; + self.soundView.hidden = YES; + self.editTagView.hidden = YES; + self.switchButton.hidden = YES; + self.phototStackView.hidden = YES; + self.avatarImageView.hidden = YES; + switch (model.type) { case XPMineUserInfoEditType_Avatar: { self.subTitleLabel.hidden = YES; - self.phototStackView.hidden = YES; self.avatarImageView.hidden = NO; if (model.isReview) { self.reviewView.hidden = NO; @@ -202,56 +207,59 @@ case XPMineUserInfoEditType_Birth: { self.subTitleLabel.hidden = NO; - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; } break; case XPMineUserInfoEditType_Nick: { self.subTitleLabel.hidden = NO; - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; } break; case XPMineUserInfoEditType_UseDes: { self.subTitleLabel.hidden = NO; - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; } break; case XPMineUserInfoEditType_Photo: { self.subTitleLabel.hidden = YES; self.phototStackView.hidden = NO; - self.avatarImageView.hidden = YES; [self loadPhotoViewWithPhotoArray:model.photoArray]; } break; case XPMineUserInfoEditType_Sound: { - self.subTitleLabel.hidden = NO; - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; break; } case XPMineUserInfoEditType_Tag: { - - - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; self.subTitleLabel.hidden = self.itemList.count > 0; self.editTagView.hidden = !self.subTitleLabel.hidden; break; } case XPMineUserInfoEditType_Area: { - self.subTitleLabel.hidden = NO; - self.phototStackView.hidden = YES; - self.avatarImageView.hidden = YES; + break; + } + case XPMineUserInfoEditType_CP_Avatar: + { + self.arrowImageView.hidden = YES; + self.switchButton.hidden = NO; + [self.switchButton setOn:self.isCPAvatarDisplay]; + [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(300)); + }]; + break; + } + case XPMineUserInfoEditType_CP_Animation: + { + self.arrowImageView.hidden = YES; + self.switchButton.hidden = NO; + [self.switchButton setOn:self.isCPAnimationDisplay]; + [self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(300)); + }]; break; } default: @@ -259,6 +267,12 @@ } } +- (void)switchValueChanged:(UISwitch *)sender { + if (_changeCPSwitch) { + self.changeCPSwitch(sender.isOn, self.itmeModel.type == XPMineUserInfoEditType_CP_Animation ? 2 : 1); + } +} + #pragma mark - Getters And Setters -(void)setMaxWidth:(CGFloat)maxWidth{ _maxWidth = maxWidth; @@ -286,6 +300,8 @@ if (_itmeModel) { self.titleLabel.text = _itmeModel.title; self.subTitleLabel.text = _itmeModel.subTitle; + self.isCPAvatarDisplay = itmeModel.isCPAvatar; + self.isCPAnimationDisplay = itmeModel.isCPAnimation; [self configCellWithModel:itmeModel]; } } @@ -452,4 +468,22 @@ return _editTagView; } +- (UISwitch *)switchButton { + if (!_switchButton) { + _switchButton = [[UISwitch alloc] init]; + // 设置开关为打开状态时的背景颜色 + _switchButton.onTintColor = UIColorFromRGB(0x04D5C6); // 蓝色 + + // 设置滑块的颜色 + _switchButton.thumbTintColor = [UIColor whiteColor]; // 白色 + + // 设置开关为关闭状态时的背景颜色 + _switchButton.tintColor = UIColorFromRGB(0xDCDCDC); // 灰色 + + [_switchButton addTarget:self action:@selector(switchValueChanged:) forControlEvents:UIControlEventValueChanged]; + + } + return _switchButton; +} + @end diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h index f5785f24..05144a5e 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h @@ -9,7 +9,7 @@ #import #import "MomentsInfoModel.h" #import "XPMineGamePartnerInfoModel.h" -@class MedalModel, UserGiftWallInfoModel; +@class MedalModel, UserGiftWallInfoModel, GuildInfo; NS_ASSUME_NONNULL_BEGIN @class UserInfoModel, MineSkillCardListInfoModel, XPMineUserDataViewController; @@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, strong) UserInfoModel *userInfo; @property (nonatomic, strong) NSArray*dynamicInfo; @property (nonatomic, strong) MedalModel *medalInfo; +@property (nonatomic, strong) GuildInfo *guildInfo; @property (nonatomic, strong) NSArray *giftWall; @property (nonatomic, strong) NSArray *luckyGiftWall; ///代理 diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m index fc1646ff..b7b37e6c 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m @@ -33,7 +33,9 @@ #import "XPMineAlbumTableViewCell.h" #import "XPMineMedalsTableViewCell.h" #import "XPMineGiftsTableViewCell.h" +#import "XPMineGuildTableViewCell.h" #import "XPMineDataGameMateTableViewCell.h" +#import "XPMineMultipleContentTableViewCell.h" #import "XPMineGameMateOrderView.h" @@ -43,10 +45,12 @@ typedef enum : NSUInteger { GameMate = 0, Album = 1, - Medal = 2, - Gifts = 3, - LuckyGifts = 4, - SectionTypeCount = 5 + Guild = 2, + Medal = 3, + Gifts = 4, + LuckyGifts = 5, + MultipleContent = 6, + SectionTypeCount = 7 } MineUserInfoPageSectionType; @interface XPMineUserSectionHeader : UIView @@ -75,7 +79,7 @@ typedef enum : NSUInteger { [self addSubview:greenLine]; [greenLine mas_makeConstraints:^(MASConstraintMaker *make) { - make.leading.mas_equalTo(kGetScaleWidth(15)); + make.leading.mas_equalTo(self); make.centerY.mas_equalTo(self); make.size.mas_equalTo(CGSizeMake(3, 15)); }]; @@ -148,22 +152,19 @@ typedef enum : NSUInteger { ///列表 @property (nonatomic,strong) UITableView *tableView; -///是否折叠 -@property (nonatomic,assign) BOOL isFold; @property (nonatomic,assign) BOOL isGiftsSectionExpand; @property (nonatomic,assign) BOOL isLuckyGiftsSectionExpand; @property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); ///数据源 @property (nonatomic,strong) NSMutableArray *datasource; -//@property (nonatomic,strong) UIView *headView; @property (nonatomic, strong) UIButton *giftsExpandButton; @property (nonatomic, strong) UIButton *luckyGiftsExpandButton; -/// -@property (nonatomic,assign) BOOL isOpen; +@property (nonatomic,assign) BOOL isDisplayMedalContent; @property (nonatomic, strong) XPMineUserSectionHeader *gameMateHeader; @property (nonatomic, strong) XPMineUserSectionHeader *albumHeader; +@property (nonatomic, strong) XPMineUserSectionHeader *guildHeader; @property (nonatomic, strong) XPMineUserSectionHeader *medalHeader; @property (nonatomic, strong) XPMineUserSectionHeader *giftsHeader; @property (nonatomic, strong) XPMineUserSectionHeader *luckyGiftsHeader; @@ -185,6 +186,7 @@ typedef enum : NSUInteger { - (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = UIColorFromRGB(0x08151A); + self.isDisplayMedalContent = YES; [self initSubViews]; [self initSubViewConstraints]; @@ -247,13 +249,19 @@ typedef enum : NSUInteger { case Album: return 1; break; - case Medal: - return self.medalInfo.medalCount == 0 ? 0 : 1; - break; - case Gifts: + case Guild: return 1; break; + case Medal: + return 0; //self.medalInfo.medalCount == 0 ? 0 : 1; + break; + case Gifts: + return 0; + break; case LuckyGifts: + return 0; + break; + case MultipleContent: return 1; break; default: @@ -269,26 +277,32 @@ typedef enum : NSUInteger { break; case Album: // return 90; - return [XPMineAlbumTableViewCell cellHeight:self.userInfo.privatePhoto.count]; + return self.userInfo.privatePhoto.count == 0 ? 90 : [XPMineAlbumTableViewCell cellHeight:self.userInfo.privatePhoto.count]; + break; + case Guild: + return self.guildInfo ? kGetScaleWidth(85 + 14) : 0; break; case Medal: - return 140; + return 0;//140; break; case Gifts: - return [XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand - source:self.giftWall]; + return 0;//[XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand + //source:self.giftWall]; break; case LuckyGifts: - return [XPMineGiftsTableViewCell cellHeight:self.isLuckyGiftsSectionExpand - source:self.luckyGiftWall]; + return 0;//[XPMineGiftsTableViewCell cellHeight:self.isLuckyGiftsSectionExpand + //source:self.luckyGiftWall]; + break; + case MultipleContent: + return self.isDisplayMedalContent ? [XPMineMultipleContentTableViewCell cellHeightFro:self.medalInfo] : [XPMineMultipleContentTableViewCell cellHeightFro:self.giftWall + with:self.luckyGiftWall]; break; default: return 0; break; } - - return KScreenHeight - kNavigationHeight - 49 - kSafeAreaBottomHeight; } + - (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{ switch (section) { case GameMate: @@ -297,17 +311,23 @@ typedef enum : NSUInteger { case Album: return nil; break; + case Guild: + return nil; + break; case Medal: return nil; break; case Gifts: - return self.giftWall.count > 4 ? self.giftsExpandButton : nil; + return nil;//self.giftWall.count > 4 ? self.giftsExpandButton : nil; break; case LuckyGifts: - return self.luckyGiftWall.count > 4 ? self.luckyGiftsExpandButton : nil; + return nil;//self.luckyGiftWall.count > 4 ? self.luckyGiftsExpandButton : nil; + break; + case MultipleContent: + return nil; break; default: - return 0; + return nil; break; } } @@ -319,14 +339,20 @@ typedef enum : NSUInteger { case Album: return 0; break; + case Guild: + return 0; + break; case Medal: return 0; break; case Gifts: - return self.giftWall.count > 4 ? 20 : 0; + return 0;//self.giftWall.count > 4 ? 20 : 0; break; case LuckyGifts: - return self.luckyGiftWall.count > 4 ? 20 : 0; + return 0;//self.luckyGiftWall.count > 4 ? 20 : 0; + break; + case MultipleContent: + return 0; break; default: return 0; @@ -341,14 +367,20 @@ typedef enum : NSUInteger { case Album: return 40; break; + case Guild: + return 40; + break; case Medal: - return self.medalInfo.medalCount == 0 ? 0 : 30; + return 0;// self.medalInfo.medalCount == 0 ? 0 : 30; break; case Gifts: - return 50; + return 0;//50; break; case LuckyGifts: - return 50; + return 0;//50; + break; + case MultipleContent: + return 0; break; default: return 40; @@ -362,17 +394,23 @@ typedef enum : NSUInteger { case Album: return self.albumHeader; break; + case Guild: + return self.guildHeader; + break; case Medal: - return self.medalInfo.medalCount == 0 ? [UIView new] : self.medalHeader; + return nil;//self.medalInfo.medalCount == 0 ? [UIView new] : self.medalHeader; break; case Gifts: - return self.giftsHeader; + return nil;//self.giftsHeader; break; case LuckyGifts: - return self.luckyGiftsHeader; + return nil;//self.luckyGiftsHeader; + break; + case MultipleContent: + return nil; break; default: - return [UIView new]; + return nil; break; } } @@ -400,6 +438,13 @@ typedef enum : NSUInteger { return cell; } break; + case Guild:{ + XPMineGuildTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGuildTableViewCell class]) + forIndexPath:indexPath]; + cell.info = self.guildInfo; + return cell; + } + break; case Medal: { XPMineMedalsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMedalsTableViewCell class]) forIndexPath:indexPath]; @@ -418,6 +463,23 @@ typedef enum : NSUInteger { XPMineGiftsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class]) forIndexPath:indexPath]; cell.giftsDataSource = self.luckyGiftWall; cell.isLucky = YES; + return cell; + } + break; + case MultipleContent: { + XPMineMultipleContentTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMultipleContentTableViewCell class]) forIndexPath:indexPath];; + cell.medalModel = self.medalInfo; + cell.giftWall = self.giftWall; + cell.luckyGiftWall = self.luckyGiftWall; + [cell updateCell]; + + @kWeakify(self); + [cell setDidChangeCatalog:^(BOOL isMedal) { + @kStrongify(self); + self.isDisplayMedalContent = isMedal; + [self.tableView reloadData]; + }]; + return cell; } break; @@ -602,6 +664,11 @@ typedef enum : NSUInteger { [self.tableView reloadData]; } +- (void)setGuildInfo:(GuildInfo *)guildInfo { + _guildInfo = guildInfo; + [self.tableView reloadData]; +} + - (UITableView *)tableView { if (!_tableView) { _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; @@ -622,6 +689,13 @@ typedef enum : NSUInteger { forCellReuseIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class])]; [_tableView registerClass:[XPMomentsEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMomentsEmptyTableViewCell class])]; [_tableView registerClass:[XPMineDataGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; + [_tableView registerClass:[XPMineGuildTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineGuildTableViewCell class])]; + [_tableView registerClass:[XPMineMultipleContentTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineMultipleContentTableViewCell class])]; + + UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, kSafeAreaBottomHeight)]; + footer.backgroundColor = [UIColor purpleColor]; + _tableView.tableFooterView = footer; + if (isMSRTL()) { _tableView.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; } @@ -660,6 +734,15 @@ typedef enum : NSUInteger { return _albumHeader; } +- (XPMineUserSectionHeader *)guildHeader { + if (!_guildHeader) { + _guildHeader = [[XPMineUserSectionHeader alloc] init]; + _guildHeader.title = @"Guild"; + _guildHeader.hasMore = NO; + } + return _guildHeader; +} + - (XPMineUserSectionHeader *)medalHeader { if (!_medalHeader) { _medalHeader = [[XPMineUserSectionHeader alloc] init]; diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.h b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.h index e20dea37..a5a4fce7 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.h +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.h @@ -7,6 +7,7 @@ #import "MvpViewController.h" +@class RelationUserVO; NS_ASSUME_NONNULL_BEGIN @class XPMineUserInfoEditViewController; @@ -22,6 +23,9 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,copy) NSString *area; /// @property (nonatomic,weak) id delegate; + +@property (nonatomic, strong) RelationUserVO *relationUser; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m index 3ca95989..1a89c3df 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoEditViewController.m @@ -14,6 +14,8 @@ #import "TTPopup.h" #import "YYUtility.h" +#import "Api+Mine.h" + ///Model #import "XPMineUserInfoEditModel.h" #import "UserInfoModel.h" @@ -62,8 +64,7 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo; [self initSubViewConstraints]; [self getAreaList]; } --(void)getAreaList{ - +-(void)getAreaList { [self.presenter getAreaList]; } @@ -153,16 +154,42 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo; }]; } +- (void)updateCPSetting:(BOOL)isOn type:(NSInteger)type { + [self showLoading]; + @kWeakify(self); + [Api updateCPSetting:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) { + @kStrongify(self); + [self hideHUD]; + if (code == 200) { + if (type == 1) { + self.relationUser.showCpAvatar = isOn; + } else { + self.relationUser.showCpAnim = isOn; + } + [self showSuccessToast:msg]; + } else { + [self showErrorToast:msg]; + } + } type:@(type) isShow:@(isOn)]; +} + #pragma mark - UITableViewDelegate And UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { - return 1; + return 2; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + if (section == 1) { + return 2; + } return self.datasouce.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + if (indexPath.section == 1) { + return kGetScaleWidth(60); + } + XPMineUserInfoEditModel * model = [self.datasouce xpSafeObjectAtIndex:indexPath.row]; if (model.type == XPMineUserInfoEditType_Avatar) { return kGetScaleWidth(80); @@ -171,11 +198,49 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo; } } +- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { + if (section == 1) { + return 60; + } + return 0; +} + +- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { + if (section == 1) { + return @"CP"; + } + return @""; +} + - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + XPMineUserInfoEditTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineUserInfoEditTableViewCell class])]; if (cell == nil) { cell = [[XPMineUserInfoEditTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineUserInfoEditTableViewCell class])]; } + + if (indexPath.section == 1) { + XPMineUserInfoEditModel *model = [[XPMineUserInfoEditModel alloc] init]; + if (indexPath.row == 0) { + model.isCPAnimation = self.relationUser.showCpAnim; + model.title = @"Homepage animation display-CP"; + model.type = XPMineUserInfoEditType_CP_Animation; + } else { + model.isCPAvatar = self.relationUser.showCpAvatar; + model.title = @"Homepage avatars display-CP"; + model.type = XPMineUserInfoEditType_CP_Avatar; + } + cell.itmeModel = model; + + @kWeakify(self); + [cell setChangeCPSwitch:^(BOOL isOn, NSInteger type) { + @kStrongify(self); + [self updateCPSetting:isOn type:type]; + }]; + + return cell; + } + XPMineUserInfoEditModel * model = [self.datasouce xpSafeObjectAtIndex:indexPath.row]; if(model.type == XPMineUserInfoEditType_Tag){ diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index bbbd0bc0..e0b4c318 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -15,6 +15,9 @@ #import #import #import +#import "UIView+VAP.h" +#import "QGVAPConfigModel.h" +#import "XPRoomGiftAnimationParser.h" ///Tool #import "AccountInfoStorage.h" #import "TTPopup.h" @@ -52,7 +55,15 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo; @interface XPMineUserInfoViewController ()< -XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDelegate, JXCategoryViewDelegate, JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate, XPMineUserInfoEditViewControllerDelegate, XPMineUserDataViewControllerDelegate> +XPMineCustomNavViewDelegate, +XPMineUserInfoProtocol, +XPMineUserInfoHeaderViewDelegate, +JXCategoryViewDelegate, +JXPagerViewDelegate, +JXPagerMainTableViewGestureDelegate, +XPMineUserInfoEditViewControllerDelegate, +XPMineUserDataViewControllerDelegate, +HWDMP4PlayDelegate> @property (nonatomic, strong) JXCategoryTitleView *titleView; @property (nonatomic, strong) JXCategoryIndicatorImageView *lineView; @property (nonatomic, strong) JXPagerView *pagingView; @@ -82,6 +93,10 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel @property (nonatomic, assign) CGFloat headerHeight; +@property (nonatomic, strong) VAPView *vapView; +@property (nonatomic, strong) NetImageView *avatarLoader; +@property (nonatomic, strong) NetImageView *cpAvatarLoader; + @end @implementation XPMineUserInfoViewController @@ -120,7 +135,7 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor whiteColor]; + self.view.backgroundColor = UIColorFromRGB(0x08151A); [self initSubViews]; [self initSubViewConstraints]; } @@ -292,6 +307,7 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel - (void)xPMineCustomNavView:(XPMineUserInfoCustomNavView *)view didClickEditButton:(UIButton *)sender { if (sender.isSelected) {///自己看自己的 去修改资料 self.editVC.area = self.userInfo.region; + self.editVC.relationUser = self.userInfo.relationUserVO; [self.navigationController pushViewController:self.editVC animated:YES]; } else { [self showRightNavHandle]; @@ -345,16 +361,20 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel self.userDataVC.luckyGiftWall = userInfo.userLuckyBagGiftWall; self.userDataVC.dynamicInfo = userInfo.dynamicInfo; self.userDataVC.medalInfo = userInfo.medals; + self.userDataVC.guildInfo = userInfo.guildInfo; self.userMomentVC.dynamicInfo = userInfo.dynamicInfo; self.headView.roomUid = userInfo.roomUid; self.headView.relationUser = userInfo.relationUserVO; self.giftVC.userInfo = userInfo; + self.userInfo.relationUserVO = userInfo.relationUserVO; if(isMSRTL()){ dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self.titleView selectItemAtIndex:0]; }); } + + [self playCPAnimation]; } - (void)getAttentionStateSuccess:(BOOL)status { @@ -365,6 +385,70 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel self.attentionButton.selected = status; } +- (void)playCPAnimation { + if (self.userInfo.relationUserVO.showCpAnim && self.userInfo.relationUserVO.cpLevel >= 3) { + [self.view addSubview:self.vapView]; + NSString *filePath = [[NSBundle mainBundle] pathForResource:@(self.userInfo.relationUserVO.cpLevel).stringValue ofType:@"mp4"]; + [self.vapView playHWDMP4:filePath delegate:self];//在view上播放该特效,按该view的大小进行渲染 + } +} + +- (void)removeCPAnimation { + @kWeakify(self); + dispatch_async(dispatch_get_main_queue(), ^{ + @kStrongify(self); + [UIView animateWithDuration:0.25 animations:^{ + self.vapView.alpha = 0; + } completion:^(BOOL finished) { + [self.vapView removeFromSuperview]; + }]; + + }); +} + +#pragma mark - MP4 delegate +- (BOOL)shouldStartPlayMP4:(VAPView *)container config:(QGVAPConfigModel *)config { + return YES; +} + +- (void)viewDidFailPlayMP4:(NSError *)error { + [self removeCPAnimation]; +} + +- (void)viewDidFinishPlayMP4:(NSInteger)totalFrameCount view:(VAPView *)container { + [self removeCPAnimation]; +} + +//provide the content for tags, maybe text or url string ... +//- (NSString *)contentForVapTag:(NSString *)tag resource:(QGVAPSourceInfo *)info { +// +// if ([tag isEqualToString:@"avatar1"]) { +// +// } +// +// NSDictionary *extraInfo = @{@"[avatar1]" : self.userInfo.avatar, +// @"[avatar2]" : @"https://www.popo8.com/gift/gift_231.png"}; +// return extraInfo[tag]; +//} + +//provide image for url from tag content +- (void)loadVapImageWithURL:(NSString *)urlStr context:(NSDictionary *)context completion:(VAPImageCompletionBlock)completionBlock { + dispatch_async(dispatch_get_main_queue(), ^{ + QGVAPSourceInfo *info = (QGVAPSourceInfo *)context[@"resource"]; + if ([info.contentTag isEqualToString:@"avatar1"] ) { + self.avatarLoader = [[NetImageView alloc] init]; + [self.avatarLoader loadImageWithUrl:self.userInfo.avatar completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { + completionBlock(image, nil, urlStr); + }]; + } else { + self.cpAvatarLoader = [[NetImageView alloc] init]; + [self.cpAvatarLoader loadImageWithUrl:self.userInfo.avatar completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) { + completionBlock(image, nil, urlStr); + }]; + } + }); +} + #pragma mark -XPMineUserInfoEditViewController - (void)xPMineUserInfoEditViewControllerC:(XPMineUserInfoEditViewController *)vc didClickComplete:(NSString *)meLabels{ // self.headView.tagModel = self.tagModel; @@ -424,6 +508,7 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel - (UIStackView *)bottomStackView { if (!_bottomStackView) { _bottomStackView = [[UIStackView alloc] init]; + _bottomStackView.backgroundColor = [UIColor clearColor]; _bottomStackView.axis = UILayoutConstraintAxisHorizontal; _bottomStackView.distribution = UIStackViewDistributionFillEqually; _bottomStackView.alignment = UIStackViewAlignmentFill; @@ -436,16 +521,12 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel if (!_chatButton) { _chatButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_chatButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController8") forState:UIControlStateNormal]; - [_chatButton setTitleColor:UIColorFromRGB(0x9168FA) forState:UIControlStateNormal]; - - _chatButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - [_chatButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xCCF8F9),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - UIImage *lineImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake((KScreenWidth - 30 - 25) / 2, 45)]; - UIColor *lineColor = [UIColor colorWithPatternImage:lineImage]; - _chatButton.layer.borderWidth = 1; - _chatButton.layer.borderColor = lineColor.CGColor; + [_chatButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _chatButton.titleLabel.font = kFontMedium(14); + [_chatButton setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0x04D5C6)] forState:UIControlStateNormal]; + [_chatButton setImage:kImage(@"user_detail_message") forState:UIControlStateNormal]; _chatButton.layer.masksToBounds = YES; - _chatButton.layer.cornerRadius = 45/2; + _chatButton.layer.cornerRadius = 39/2; [_chatButton addTarget:self action:@selector(chatButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _chatButton; @@ -457,12 +538,14 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel [_attentionButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController9") forState:UIControlStateNormal]; [_attentionButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController10") forState:UIControlStateSelected]; [_attentionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; - [_attentionButton setTitleColor:UIColorFromRGB(0xB3B3C3) forState:UIControlStateSelected]; - _attentionButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium]; - [_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal]; - [_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE6E6F0),UIColorFromRGB(0xE6E6F0),UIColorFromRGB(0xE6E6F0)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateSelected]; + [_attentionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; + _attentionButton.titleLabel.font = kFontMedium(14); + [_attentionButton setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0xFFA018)] forState:UIControlStateNormal]; + [_attentionButton setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0x00444A)] forState:UIControlStateSelected]; + [_attentionButton setImage:kImage(@"user_detail_unfollow") forState:UIControlStateNormal]; + [_attentionButton setImage:kImage(@"user_detail_followed") forState:UIControlStateSelected]; _attentionButton.layer.masksToBounds = YES; - _attentionButton.layer.cornerRadius = 45/2; + _attentionButton.layer.cornerRadius = 39/2; [_attentionButton addTarget:self action:@selector(attentionButtonAction:) forControlEvents:UIControlEventTouchUpInside]; } return _attentionButton; @@ -547,4 +630,18 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel return _editVC; } +- (VAPView *)vapView { + if (!_vapView) { + _vapView = [[VAPView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)]; + _vapView.contentMode = UIViewContentModeScaleAspectFit; + _vapView.hwd_Delegate = self; + @kWeakify(self); + [_vapView addVapTapGesture:^(UIGestureRecognizer *gestureRecognizer, BOOL insideSource, QGVAPSourceDisplayItem *source) { + @kStrongify(self); + [self removeCPAnimation]; + }]; + } + return _vapView; +} + @end diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index e28c411c..7cf207d3 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -670,8 +670,15 @@ return view;\ - (void)setRelationUser:(RelationUserVO *)relationUser { _relationUser = relationUser; - self.cpAvatarHeart.hidden = !relationUser; - self.cpAvatarFlag.hidden = !relationUser; + if (relationUser.showCpAvatar) { + self.avatarView_cp.hidden = [relationUser isEmptyRelation]; + self.cpAvatarHeart.hidden = [relationUser isEmptyRelation]; + self.cpAvatarFlag.hidden = [relationUser isEmptyRelation]; + } else { + self.avatarView_cp.hidden = YES; + self.cpAvatarHeart.hidden = YES; + self.cpAvatarFlag.hidden = YES; + } self.cpCard.isListItem = NO; self.cpCard.usersAvatar = self.userInfo.avatar; @@ -1099,6 +1106,7 @@ return view;\ config.placeHolder = [UIImageConstant defaultAvatarPlaceholder]; config.imageType = ImageTypeUserIcon; _avatarView_cp = [[NetImageView alloc]initWithConfig:config]; + _avatarView_cp.hidden = YES; _avatarView_cp.layer.cornerRadius = kGetScaleWidth(41); _avatarView_cp.layer.masksToBounds = YES; _avatarView_cp.layer.borderWidth = 1; @@ -1198,6 +1206,7 @@ return view;\ - (SVGAImageView *)headWearSvgaImageView_cp { if (!_headWearSvgaImageView_cp) { _headWearSvgaImageView_cp = [[SVGAImageView alloc]init]; + _headWearSvgaImageView_cp.hidden = YES; _headWearSvgaImageView_cp.backgroundColor = [UIColor clearColor]; _headWearSvgaImageView_cp.frame = self.bounds; _headWearSvgaImageView_cp.userInteractionEnabled = YES; @@ -1216,6 +1225,7 @@ return view;\ - (UIImageView *)cpAvatarHeart { if (!_cpAvatarHeart) { _cpAvatarHeart = [[UIImageView alloc] initWithImage:kImage(@"cp_avatar_heart")]; + _cpAvatarHeart.hidden = YES; } return _cpAvatarHeart; } @@ -1223,6 +1233,7 @@ return view;\ - (UIImageView *)cpAvatarFlag { if (!_cpAvatarFlag) { _cpAvatarFlag = [[UIImageView alloc] init]; + _cpAvatarFlag.hidden = YES; } return _cpAvatarFlag; } diff --git a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m index 27876818..28336952 100644 --- a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m @@ -29,6 +29,7 @@ - (void)viewDidLoad { [super viewDidLoad]; + self.view.backgroundColor = [UIColor clearColor]; [self.view addSubview:self.tableView]; [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { make.edges.mas_equalTo(self.view); @@ -104,6 +105,7 @@ XPMomentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"XPMomentsDynamicTableViewCell" forIndexPath:indexPath]; MomentsInfoModel * monentsInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row]; cell.delegate = self; + cell.isInUserDetail = YES; cell.mineMomentsInfo = monentsInfo; cell.isFillet = indexPath.row == self.datasource.count - 1; return cell; @@ -241,7 +243,7 @@ _tableView.delegate = self; _tableView.dataSource = self; _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; - _tableView.backgroundColor = [UIColor whiteColor]; + _tableView.backgroundColor = [UIColor clearColor]; if (@available(iOS 11.0, *)) { _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } @@ -261,7 +263,7 @@ -(UIView *)headView{ if (!_headView){ _headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 30)]; - _headView.backgroundColor = [UIColor whiteColor]; + _headView.backgroundColor = [UIColor clearColor]; UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(15, 0, KScreenWidth-30, 30)]; [_headView addSubview:bgView]; bgView.backgroundColor = [UIColor whiteColor]; diff --git a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.h b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.h index 9a394c78..dbe4f4ce 100644 --- a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.h +++ b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.h @@ -31,6 +31,7 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic,strong) MomentsInfoModel *momentsInfo; @property (nonatomic,assign) BOOL isFillet; @property (nonatomic,assign) BOOL isTopic;///是否是话题页 +@property (nonatomic, assign) BOOL isInUserDetail; ///代理 @property (nonatomic,weak) id delegate; diff --git a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m index e913e80f..7d1a018a 100644 --- a/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m +++ b/YuMi/Modules/YMMonents/View/Cell/XPMomentsTableViewCell.m @@ -60,6 +60,12 @@ return self; } +- (void)setIsInUserDetail:(BOOL)isInUserDetail { + _isInUserDetail = isInUserDetail; + self.textView.isInUserDetail = isInUserDetail; + self.toolBarView.isInUserDetail = isInUserDetail; +} + #pragma mark - Private Method - (void)initDynamicSubViews { diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.h b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.h index e50f3ff1..8e3985cc 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.h +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.h @@ -20,6 +20,7 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMomentsContentView : UIView /// @property (nonatomic,assign) BOOL isTopic; +@property (nonatomic,assign) BOOL isInUserDetail; @property (nonatomic,strong) MomentsInfoModel *monentsInfo; ///代理 @property (nonatomic,weak) id delegate; diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.m b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.m index a0ed097d..2d171ab2 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.m +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsContentView.m @@ -38,6 +38,14 @@ return self; } +- (void)setIsInUserDetail:(BOOL)isInUserDetail { + _isInUserDetail = isInUserDetail; + if (isInUserDetail) { + self.timeLabel.textColor = [UIColor whiteColor]; + self.contentLabel.textColor = [UIColor whiteColor]; + } +} + #pragma mark - Private Method - (void)initSubViews { diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.h b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.h index fbeecbef..bc028ec3 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.h +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.h @@ -22,6 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @end @interface XPMomentsTooBarView : UIView +@property (nonatomic,assign) BOOL isInUserDetail; @property (nonatomic,strong) MomentsInfoModel *momentsInfo; ///代理 @property (nonatomic,weak) id delegate; diff --git a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.m b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.m index 4ddb3628..f9bcc734 100644 --- a/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.m +++ b/YuMi/Modules/YMMonents/View/SubViews/XPMomentsTooBarView.m @@ -56,6 +56,14 @@ } +- (void)setIsInUserDetail:(BOOL)isInUserDetail { + _isInUserDetail = isInUserDetail; + if (isInUserDetail) { + self.likeLabel.textColor = [UIColor whiteColor]; + self.commentLabel.textColor = [UIColor whiteColor]; + } +} + - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { diff --git a/YuMi/Resources/cp/3.mp4 b/YuMi/Resources/cp/3.mp4 new file mode 100644 index 00000000..68a1a35b Binary files /dev/null and b/YuMi/Resources/cp/3.mp4 differ diff --git a/YuMi/Resources/cp/4.mp4 b/YuMi/Resources/cp/4.mp4 new file mode 100644 index 00000000..ad68e5c1 Binary files /dev/null and b/YuMi/Resources/cp/4.mp4 differ diff --git a/YuMi/Resources/cp/5.mp4 b/YuMi/Resources/cp/5.mp4 new file mode 100644 index 00000000..dd7b4ab2 Binary files /dev/null and b/YuMi/Resources/cp/5.mp4 differ diff --git a/YuMi/Structure/MVP/Model/GuildInfo.h b/YuMi/Structure/MVP/Model/GuildInfo.h index 9cca971e..8b607b85 100644 --- a/YuMi/Structure/MVP/Model/GuildInfo.h +++ b/YuMi/Structure/MVP/Model/GuildInfo.h @@ -15,7 +15,8 @@ NS_ASSUME_NONNULL_BEGIN @property (nonatomic, copy) NSString *guildName; @property (nonatomic, assign) NSInteger erbanNo; @property (nonatomic, assign) NSInteger guildId; - +@property (nonatomic, assign) NSInteger showCpAnim; +@property (nonatomic, assign) NSInteger showCpAvatar; @end