Commit 374fdda6 by ludi

修改完邀请有奖大部分bug

parent 0ea3bf5e
Showing with 277 additions and 127 deletions
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
//社会化分享 //社会化分享
#import <ShareSDK/ShareSDK.h> #import <ShareSDK/ShareSDK.h>
#import <mob_sharesdk/WXApi.h> #import <mob_sharesdk/WXApi.h>
#import <Social/Social.h>
@interface FUSSocialShareManager ()<TWTRComposerViewControllerDelegate, FBSDKSharingDelegate,UIDocumentInteractionControllerDelegate> @interface FUSSocialShareManager ()<TWTRComposerViewControllerDelegate, FBSDKSharingDelegate,UIDocumentInteractionControllerDelegate>
...@@ -174,7 +175,8 @@ ...@@ -174,7 +175,8 @@
self.shareSuccess = success; self.shareSuccess = success;
self.shareFailure = failure; self.shareFailure = failure;
if (![[Twitter sharedInstance].sessionStore hasLoggedInUsers] && ![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]]) {
if (viewController == nil || ![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]]) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"请先安装Twitter"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"请先安装Twitter"]];
if(self.shareFailure)_shareFailure(); if(self.shareFailure)_shareFailure();
self.shareSuccess = nil; self.shareSuccess = nil;
...@@ -182,46 +184,52 @@ ...@@ -182,46 +184,52 @@
return; return;
} }
//分享图片 // 检查 Twitter 是否可用
if(shareType == FUSShareTypeImage){ if (![SLComposeViewController isAvailableForServiceType:@"com.apple.share.Twitter.post"]) {
TWTRComposer *composer = [[TWTRComposer alloc] init]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"请先安装Twitter"]];
[composer setImage:image]; if(self.shareFailure)_shareFailure();
__weak typeof(self) weakSelf = self; self.shareSuccess = nil;
[composer showFromViewController:viewController completion:^(TWTRComposerResult result) { self.shareFailure = nil;
if (result == TWTRComposerResultCancelled) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"分享取消"]];
if(weakSelf.shareFailure)weakSelf.shareFailure();
FUSLogInfo(@"Tweet composition cancelled");
}
else{
//上报分享成功数据
NSString *version = [[FUSDeviceHelper getAppVersionNumber] description];
[FUSCommonHttpRequest fus_socialShareStatisticWithMode:_mode modeType:2 version:version from:from roomId:roomId];
[FUSDialogView fus_showDialog:[NSString fus_localString:@"分享成功"]];
if(weakSelf.shareSuccess)weakSelf.shareSuccess(); FUSLogInfo(@"Sending Tweet!");
}
weakSelf.shareSuccess = nil;
weakSelf.shareFailure = nil;
}];
return; return;
} }
//上报分享请求数据 SLComposeViewController *twitterComposeVC = [SLComposeViewController composeViewControllerForServiceType:@"com.apple.share.Twitter.post"];
[self shareDataReportToSeverWithPlatform:TwitterPlatform from:from roomId:roomId];
switch (shareType) {
case FUSShareTypeText:{
[twitterComposeVC setInitialText:content];
}
break;
case FUSShareTypeImage:{
if (image != nil) {
[twitterComposeVC addImage:image];
}
}
break;
case FUSShareTypeWebUrl:{
[twitterComposeVC addURL:[NSURL URLWithString:contentURL]];
[twitterComposeVC setInitialText:content];
}
break;
case FUSShareTypeDefault:
case FUSShareTypeImageWithText:{
if (image != nil) {
[twitterComposeVC addImage:image];
}
[twitterComposeVC setInitialText:content];
}
break;
default:
break;
}
// Called from a UIViewController(方式一)
TWTRComposer *composer = [[TWTRComposer alloc] init];
[composer setText:content];
[composer setImage:image];
[composer setURL:[NSURL URLWithString:contentURL]];
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
[composer showFromViewController:viewController completion:^(TWTRComposerResult result) { twitterComposeVC.completionHandler = ^(SLComposeViewControllerResult result) {
if (result == TWTRComposerResultCancelled) { if (result == SLComposeViewControllerResultCancelled) {
[FUSDialogView fus_showDialog:[NSString fus_localString:@"分享取消"]]; [FUSDialogView fus_showDialog:[NSString fus_localString:@"分享取消"]];
if(weakSelf.shareFailure)weakSelf.shareFailure(); if(weakSelf.shareFailure)weakSelf.shareFailure();
FUSLogInfo(@"Tweet composition cancelled"); FUSLogInfo(@"Tweet composition cancelled");
} }else {
else{
//上报分享成功数据 //上报分享成功数据
NSString *version = [[FUSDeviceHelper getAppVersionNumber] description]; NSString *version = [[FUSDeviceHelper getAppVersionNumber] description];
[FUSCommonHttpRequest fus_socialShareStatisticWithMode:_mode modeType:2 version:version from:from roomId:roomId]; [FUSCommonHttpRequest fus_socialShareStatisticWithMode:_mode modeType:2 version:version from:from roomId:roomId];
...@@ -231,8 +239,74 @@ ...@@ -231,8 +239,74 @@
} }
weakSelf.shareSuccess = nil; weakSelf.shareSuccess = nil;
weakSelf.shareFailure = nil; weakSelf.shareFailure = nil;
};
twitterComposeVC.modalPresentationStyle = UIModalPresentationOverFullScreen;
[[UIViewController fus_topViewController] presentViewController:twitterComposeVC animated:YES completion:^{
}]; }];
// 20250331 下面的不用了,用新的
// if (![[Twitter sharedInstance].sessionStore hasLoggedInUsers] && ![[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"twitter://"]]) {
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"请先安装Twitter"]];
// if(self.shareFailure)_shareFailure();
// self.shareSuccess = nil;
// self.shareFailure = nil;
// return;
// }
//
// //分享图片
// if(shareType == FUSShareTypeImage){
// TWTRComposer *composer = [[TWTRComposer alloc] init];
// [composer setImage:image];
// __weak typeof(self) weakSelf = self;
// [composer showFromViewController:viewController completion:^(TWTRComposerResult result) {
// if (result == TWTRComposerResultCancelled) {
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"分享取消"]];
// if(weakSelf.shareFailure)weakSelf.shareFailure();
// FUSLogInfo(@"Tweet composition cancelled");
// }
// else{
// //上报分享成功数据
// NSString *version = [[FUSDeviceHelper getAppVersionNumber] description];
// [FUSCommonHttpRequest fus_socialShareStatisticWithMode:_mode modeType:2 version:version from:from roomId:roomId];
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"分享成功"]];
// if(weakSelf.shareSuccess)weakSelf.shareSuccess(); FUSLogInfo(@"Sending Tweet!");
// }
// weakSelf.shareSuccess = nil;
// weakSelf.shareFailure = nil;
// }];
// return;
// }
//
// //上报分享请求数据
// [self shareDataReportToSeverWithPlatform:TwitterPlatform from:from roomId:roomId];
//
// // Called from a UIViewController(方式一)
// TWTRComposer *composer = [[TWTRComposer alloc] init];
// [composer setText:content];
// [composer setImage:image];
// [composer setURL:[NSURL URLWithString:contentURL]];
// __weak typeof(self) weakSelf = self;
// [composer showFromViewController:viewController completion:^(TWTRComposerResult result) {
// if (result == TWTRComposerResultCancelled) {
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"分享取消"]];
// if(weakSelf.shareFailure)weakSelf.shareFailure();
// FUSLogInfo(@"Tweet composition cancelled");
// }
// else{
// //上报分享成功数据
// NSString *version = [[FUSDeviceHelper getAppVersionNumber] description];
// [FUSCommonHttpRequest fus_socialShareStatisticWithMode:_mode modeType:2 version:version from:from roomId:roomId];
// [FUSDialogView fus_showDialog:[NSString fus_localString:@"分享成功"]];
// if(weakSelf.shareSuccess)weakSelf.shareSuccess();
// FUSLogInfo(@"Sending Tweet!");
// }
// weakSelf.shareSuccess = nil;
// weakSelf.shareFailure = nil;
// }];
//(方式二) //(方式二)
// if ([[Twitter sharedInstance].sessionStore hasLoggedInUsers]) { // if ([[Twitter sharedInstance].sessionStore hasLoggedInUsers]) {
// TWTRComposerViewController *composer = [[TWTRComposerViewController alloc] initWithInitialText:[NSString stringWithFormat:@"%@%@",content,contentURL] image:image videoURL:nil]; // TWTRComposerViewController *composer = [[TWTRComposerViewController alloc] initWithInitialText:[NSString stringWithFormat:@"%@%@",content,contentURL] image:image videoURL:nil];
......
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
#import "FUSOCBaseView.h" #import "FUSOCBaseView.h"
@interface FUSOCBaseView ()
@property (nonatomic, assign) BOOL fusocviewIsLoaded;
@end
@implementation FUSOCBaseView @implementation FUSOCBaseView
- (instancetype)init - (instancetype)init
...@@ -17,9 +23,12 @@ ...@@ -17,9 +23,12 @@
_transparency = false; _transparency = false;
_transparencyFrame = CGRectZero; _transparencyFrame = CGRectZero;
if (self.fusocviewIsLoaded == NO) {
[self makeUI]; [self makeUI];
[self bindViewModel]; [self bindViewModel];
} }
self.fusocviewIsLoaded = YES;
}
return self; return self;
} }
...@@ -31,9 +40,11 @@ ...@@ -31,9 +40,11 @@
_transparency = false; _transparency = false;
_transparencyFrame = CGRectZero; _transparencyFrame = CGRectZero;
if (self.fusocviewIsLoaded == NO) {
[self makeUI]; [self makeUI];
[self bindViewModel]; [self bindViewModel];
}
self.fusocviewIsLoaded = YES;
} }
return self; return self;
......
...@@ -86,22 +86,22 @@ ...@@ -86,22 +86,22 @@
/// 邀请有奖-下载帮助页地址 /// 邀请有奖-下载帮助页地址
+(NSString *)fus_inviteDownloadHelpUrl { +(NSString *)fus_inviteDownloadHelpUrl {
return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/Nesting/newShare/helpDownload.html"]; return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/vestApp/newShare/helpDownload.html"];
} }
/// 邀请有奖-绑定帮助页地址 /// 邀请有奖-绑定帮助页地址
+(NSString *)fus_inviteBindHelpUrl { +(NSString *)fus_inviteBindHelpUrl {
return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/Nesting/newShare/helpBind.html"]; return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/vestApp/newShare/helpBind.html"];
} }
/// 使者奖励地址 /// 使者奖励地址
+(NSString *)fus_inviteEmissaryRewardUrl { +(NSString *)fus_inviteEmissaryRewardUrl {
return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/Nesting/newShare/inviteReward.html"]; return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/vestApp/newShare/inviteReward.html"];
} }
/// 我的族人地址 /// 我的族人地址
+(NSString *)fus_inviteMyClansmanUrl { +(NSString *)fus_inviteMyClansmanUrl {
return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/Nesting/newShare/inviteNum.html"]; return [FUSConfig.sharedInstanced.pathConfigs webUrl:@"/vestApp/newShare/inviteNum.html"];
} }
@end @end
......
...@@ -69,7 +69,8 @@ ...@@ -69,7 +69,8 @@
if (colorString.length || rtlString.length) { if (colorString.length || rtlString.length) {
styleString = [NSString stringWithFormat:@" style=%@%@display:inline-blcok",rtlString,colorString]; styleString = [NSString stringWithFormat:@" style=%@%@display:inline-blcok",rtlString,colorString];
} }
finalHtmlString = [NSString stringWithFormat:@"%@<div%@>%@</div>",imgAutoFitHeight,styleString,htmlString]; // finalHtmlString = [NSString stringWithFormat:@"%@<div%@>%@</div>",imgAutoFitHeight,styleString,htmlString];
finalHtmlString = [NSString stringWithFormat:@"%@<span%@>%@</span>",imgAutoFitHeight,styleString,htmlString];
} }
// 获得HTML的Attribute // 获得HTML的Attribute
......
...@@ -87,8 +87,7 @@ ...@@ -87,8 +87,7 @@
[self setImageWithURL:url forState:state placeholder:placeholder]; [self setImageWithURL:url forState:state placeholder:placeholder];
} }
- (void)setWebImageWithSubURLString:(NSString *)urlString controlState:(UIControlState)state placeholder:(UIImage *)placeholder completion:(void (BOOL, UIImage * _Nullable))completion{ - (void)setWebImageWithSubURLString:(NSString *)urlString controlState:(UIControlState)state placeholder:(UIImage *)placeholder completion:(void (^)(BOOL, UIImage * _Nullable))completion{
if ([urlString containsString:@"boy"] || [urlString containsString:@"girl"]) { if ([urlString containsString:@"boy"] || [urlString containsString:@"girl"]) {
[self setImage:UIImage.fus_defaultIcon forState:UIControlStateNormal]; [self setImage:UIImage.fus_defaultIcon forState:UIControlStateNormal];
return; return;
...@@ -109,9 +108,9 @@ ...@@ -109,9 +108,9 @@
[self setImageWithURL:url forState:state placeholder:placeholder options:kNilOptions completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) { [self setImageWithURL:url forState:state placeholder:placeholder options:kNilOptions completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
if (error == nil && image != nil) { if (error == nil && image != nil) {
completion(YES, image); if (completion != nil) completion(YES, image);
}else { }else {
completion(NO, nil); if (completion != nil) completion(NO, nil);
} }
}]; }];
} }
......
...@@ -59,8 +59,7 @@ ...@@ -59,8 +59,7 @@
} }
} }
} }
NSMutableAttributedString *attr = [NSMutableAttributedString fus_attributeStringWithHTMLString:languageContentString baseColor:@"ffffff" font:font imgHeight:levelSize.height imgWidth:levelSize.width];
NSMutableAttributedString *attr = [NSMutableAttributedString fus_attributeStringWithHTMLString:model.languageContent baseColor:@"ffffff" font:font imgHeight:levelSize.height imgWidth:levelSize.width];
if (![FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:nil]) { if (![FUSDeviceHelper fus_checkOldIPhoneDeviceHandler:nil]) {
NSShadow *shadow = [[NSShadow alloc]init]; NSShadow *shadow = [[NSShadow alloc]init];
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key> <key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>72</integer> <integer>73</integer>
</dict> </dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key> <key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>78</integer> <integer>74</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key> <key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>74</integer> <integer>75</integer>
</dict> </dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key> <key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>75</integer> <integer>78</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
00B45E632D9401CE00FF138F /* FFInviteRewardMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E442D9401CE00FF138F /* FFInviteRewardMainView.swift */; }; 00B45E632D9401CE00FF138F /* FFInviteRewardMainView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E442D9401CE00FF138F /* FFInviteRewardMainView.swift */; };
00B45E642D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3E2D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift */; }; 00B45E642D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3E2D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift */; };
00B45E652D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */; }; 00B45E652D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */; };
00B45E662D9401CE00FF138F /* FFInviteRewardMyClansmanHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeader.swift */; }; 00B45E662D9401CE00FF138F /* FFInviteRewardMyClansmanHeaderCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeaderCell.swift */; };
00B45E672D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3B2D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift */; }; 00B45E672D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3B2D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift */; };
00B45E682D9401CE00FF138F /* FFInviteFunctionStepOneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3D2D9401CE00FF138F /* FFInviteFunctionStepOneView.swift */; }; 00B45E682D9401CE00FF138F /* FFInviteFunctionStepOneView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E3D2D9401CE00FF138F /* FFInviteFunctionStepOneView.swift */; };
00B45E692D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E492D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift */; }; 00B45E692D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00B45E492D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift */; };
...@@ -1009,7 +1009,7 @@ ...@@ -1009,7 +1009,7 @@
00B45E2B2D9401CE00FF138F /* FFInviteRewardInvitePlanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardInvitePlanCell.swift; sourceTree = "<group>"; }; 00B45E2B2D9401CE00FF138F /* FFInviteRewardInvitePlanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardInvitePlanCell.swift; sourceTree = "<group>"; };
00B45E2C2D9401CE00FF138F /* FFInviteRewardMyClansmanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanCell.swift; sourceTree = "<group>"; }; 00B45E2C2D9401CE00FF138F /* FFInviteRewardMyClansmanCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanCell.swift; sourceTree = "<group>"; };
00B45E2D2D9401CE00FF138F /* FFInviteRewardMyClansmanEmptyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanEmptyCell.swift; sourceTree = "<group>"; }; 00B45E2D2D9401CE00FF138F /* FFInviteRewardMyClansmanEmptyCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanEmptyCell.swift; sourceTree = "<group>"; };
00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanHeader.swift; sourceTree = "<group>"; }; 00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyClansmanHeaderCell.swift; sourceTree = "<group>"; };
00B45E2F2D9401CE00FF138F /* FFInviteRewardMyHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyHeaderCell.swift; sourceTree = "<group>"; }; 00B45E2F2D9401CE00FF138F /* FFInviteRewardMyHeaderCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardMyHeaderCell.swift; sourceTree = "<group>"; };
00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardTaskCommonCell.swift; sourceTree = "<group>"; }; 00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardTaskCommonCell.swift; sourceTree = "<group>"; };
00B45E312D9401CE00FF138F /* FFInviteRewardTaskMemberCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardTaskMemberCell.swift; sourceTree = "<group>"; }; 00B45E312D9401CE00FF138F /* FFInviteRewardTaskMemberCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FFInviteRewardTaskMemberCell.swift; sourceTree = "<group>"; };
...@@ -2073,7 +2073,7 @@ ...@@ -2073,7 +2073,7 @@
00B45E2B2D9401CE00FF138F /* FFInviteRewardInvitePlanCell.swift */, 00B45E2B2D9401CE00FF138F /* FFInviteRewardInvitePlanCell.swift */,
00B45E2C2D9401CE00FF138F /* FFInviteRewardMyClansmanCell.swift */, 00B45E2C2D9401CE00FF138F /* FFInviteRewardMyClansmanCell.swift */,
00B45E2D2D9401CE00FF138F /* FFInviteRewardMyClansmanEmptyCell.swift */, 00B45E2D2D9401CE00FF138F /* FFInviteRewardMyClansmanEmptyCell.swift */,
00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeader.swift */, 00B45E2E2D9401CE00FF138F /* FFInviteRewardMyClansmanHeaderCell.swift */,
00B45E2F2D9401CE00FF138F /* FFInviteRewardMyHeaderCell.swift */, 00B45E2F2D9401CE00FF138F /* FFInviteRewardMyHeaderCell.swift */,
00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */, 00B45E302D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift */,
00B45E312D9401CE00FF138F /* FFInviteRewardTaskMemberCell.swift */, 00B45E312D9401CE00FF138F /* FFInviteRewardTaskMemberCell.swift */,
...@@ -4804,7 +4804,7 @@ ...@@ -4804,7 +4804,7 @@
00B45E632D9401CE00FF138F /* FFInviteRewardMainView.swift in Sources */, 00B45E632D9401CE00FF138F /* FFInviteRewardMainView.swift in Sources */,
00B45E642D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift in Sources */, 00B45E642D9401CE00FF138F /* FFInviteFunctionStepThreeView.swift in Sources */,
00B45E652D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift in Sources */, 00B45E652D9401CE00FF138F /* FFInviteRewardTaskCommonCell.swift in Sources */,
00B45E662D9401CE00FF138F /* FFInviteRewardMyClansmanHeader.swift in Sources */, 00B45E662D9401CE00FF138F /* FFInviteRewardMyClansmanHeaderCell.swift in Sources */,
00B45E672D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift in Sources */, 00B45E672D9401CE00FF138F /* FFInviteEmissaryConditionContentAlertView.swift in Sources */,
00B45E682D9401CE00FF138F /* FFInviteFunctionStepOneView.swift in Sources */, 00B45E682D9401CE00FF138F /* FFInviteFunctionStepOneView.swift in Sources */,
00B45E692D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift in Sources */, 00B45E692D9401CE00FF138F /* FFInviteRewardInviteViewModel.swift in Sources */,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key> <key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>73</integer> <integer>72</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "InviteReward_task_common_background@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "inviteReward_invite_navi_rank_btn@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "inviteReward_invite_navi_rank_btn@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -99,7 +99,7 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView { ...@@ -99,7 +99,7 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView {
self.typeContentView.removeAllSubviews() self.typeContentView.removeAllSubviews()
if self.type == .media { if self.type == .media {
let shareTypeList: [SocialSharePlatform] = [.LineSharePlatform, .WhatsAppPlatform, .FacebookPlatform, .TwitterPlatform, .WechatFriendPlatform, .WechatCirclePaltform/*, .friendChat*/] let shareTypeList: [SocialSharePlatform] = [.LineSharePlatform, .WhatsAppPlatform, .FacebookPlatform, .TwitterPlatform]
let itemW:CGFloat = 45 let itemW:CGFloat = 45
let insentMargin: CGFloat = 15 let insentMargin: CGFloat = 15
var lineItemCount: Int = 6 var lineItemCount: Int = 6
...@@ -195,6 +195,10 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView { ...@@ -195,6 +195,10 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView {
loadingView.animationImages = UIImage.fus_animationImages("fusi_loading_animate_black_", mainBundle: false, needCache: true) loadingView.animationImages = UIImage.fus_animationImages("fusi_loading_animate_black_", mainBundle: false, needCache: true)
loadingView.animationDuration = 1.5 loadingView.animationDuration = 1.5
loadingView.startAnimating() loadingView.startAnimating()
qrCodeImageView.addSubview(loadingView)
loadingView.snp.makeConstraints { make in
make.center.equalToSuperview()
}
let copyBtnSize = String.fus_localString("保存QRCode").size(for: .fus_themeMediumFont(14)) let copyBtnSize = String.fus_localString("保存QRCode").size(for: .fus_themeMediumFont(14))
let copyBtn = FUSStyleButton(type: .custom) let copyBtn = FUSStyleButton(type: .custom)
...@@ -216,12 +220,14 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView { ...@@ -216,12 +220,14 @@ class FFInviteFunctionStepOneContentView: FFInviteFunctionStepContentBaseView {
imgUrl = model.qrurl imgUrl = model.qrurl
} }
qrCodeImageView.setWebImageWithSubURLString(imgUrl, controlState: .normal, placeholder: .init()) {[weak loadingView] suc, image in qrCodeImageView.setWebImageWithSubURLString(imgUrl, controlState: .normal, placeholder: .init()) {[weak loadingView] suc, image in
DispatchQueue.main.async(execute: {
if suc == true, if suc == true,
let image = image { let image = image {
qrImage = image qrImage = image
loadingView?.stopAnimating() loadingView?.stopAnimating()
loadingView?.isHidden = true loadingView?.isHidden = true
} }
})
} }
} failure: { msg, code in } failure: { msg, code in
FUSDialogView.fus_showDialog(msg) FUSDialogView.fus_showDialog(msg)
......
...@@ -173,14 +173,14 @@ class FFInviteFunctionStepThreeEmptyView: FUSBaseView { ...@@ -173,14 +173,14 @@ class FFInviteFunctionStepThreeEmptyView: FUSBaseView {
emptyImageView.snp.makeConstraints { make in emptyImageView.snp.makeConstraints { make in
make.top.equalToSuperview() make.top.equalToSuperview()
make.centerX.equalToSuperview() make.centerX.equalToSuperview()
make.size.equalTo(CGSizeMake(50, 50)) make.size.equalTo(CGSizeMake(100, 100))
} }
waitingLabel.numberOfLines = 0 waitingLabel.numberOfLines = 0
self.addSubview(waitingLabel) self.addSubview(waitingLabel)
waitingLabel.snp.makeConstraints { make in waitingLabel.snp.makeConstraints { make in
// make.centerX.equalToSuperview().offset(-6) // make.centerX.equalToSuperview().offset(-6)
make.top.equalTo(emptyImageView.snp.bottom) make.top.equalTo(emptyImageView.snp.bottom).offset(-12)
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
make.left.right.equalToSuperview().inset(18) make.left.right.equalToSuperview().inset(18)
} }
......
...@@ -314,16 +314,9 @@ class FFInviteFunctionStepTwoContentView: FFInviteFunctionStepContentBaseView { ...@@ -314,16 +314,9 @@ class FFInviteFunctionStepTwoContentView: FFInviteFunctionStepContentBaseView {
// 头像 // 头像
// self.saveBtn.isHidden = true // self.saveBtn.isHidden = true
avatarImageView.setWebImageWithSubURLString(FUSSwiftCacheDataShare.share.userInfo.value?.uid, placeholder: .fus_boyIcon()) {[weak self] image, url, from, stage, error in avatarImageView.setWebImageWithSubURLString(FUSSwiftCacheDataShare.share.userInfo.value?.face.fus_bigCdn, placeholder: .fus_boyIcon())
if error != nil, // qrcode
let image = image { self.qrCodeView.ff_setup(url: FFInviteRewardInviteViewModel.share.inviteDataModel.value?.shareData.shareContent.fus_getWebpage() ?? "", avatarURL: FUSSwiftCacheDataShare.share.userInfo.value?.face.fus_bigCdn ?? "")
self?.qrCodeView.ff_setup(url: FFInviteRewardInviteViewModel.share.inviteDataModel.value?.shareData.shareContent.fus_getWebpage() ?? "", avatar: image, completeHandler: { isSuccess in
if isSuccess{
// self?.saveBtn.isHidden = false
}
})
}
}
} }
} }
...@@ -265,6 +265,8 @@ class FFInviteRewardInviteRewardDescView: FUSBaseView { ...@@ -265,6 +265,8 @@ class FFInviteRewardInviteRewardDescView: FUSBaseView {
make.height.equalTo(25) make.height.equalTo(25)
} }
descLabel.setContentHuggingPriority(.required, for: .vertical)
descLabel.setContentCompressionResistancePriority(.required, for: .horizontal)
descLabel.numberOfLines = 0 descLabel.numberOfLines = 0
descLabel.textAlignment = .center descLabel.textAlignment = .center
self.addSubview(descLabel) self.addSubview(descLabel)
......
// //
// FFInviteRewardMyClansmanHeader.swift // FFInviteRewardMyClansmanHeaderCell.swift
// PersonalPage // PersonalPage
// //
// Created by aaa on 2025/3/5. // Created by aaa on 2025/3/5.
...@@ -7,14 +7,16 @@ ...@@ -7,14 +7,16 @@
import UIKit import UIKit
class FFInviteRewardMyClansmanHeader: UITableViewHeaderFooterView { class FFInviteRewardMyClansmanHeaderCell: UITableViewCell {
static public let cellID: String = "FFInviteRewardMyClansmanHeader" static public let cellID: String = "FFInviteRewardMyClansmanHeaderCell"
static public let cellHeight: CGFloat = 45 + 8 static public let cellHeight: CGFloat = 45 + 8
override init(reuseIdentifier: String?) { override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(reuseIdentifier: reuseIdentifier) super.init(style: style, reuseIdentifier: reuseIdentifier)
makeUI()
self.selectionStyle = UITableViewCell.SelectionStyle.none
self.makeUI()
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
...@@ -26,14 +28,14 @@ class FFInviteRewardMyClansmanHeader: UITableViewHeaderFooterView { ...@@ -26,14 +28,14 @@ class FFInviteRewardMyClansmanHeader: UITableViewHeaderFooterView {
func makeUI(){ func makeUI(){
self.backgroundColor = .fus_appBG() self.backgroundColor = .clear
self.contentView.backgroundColor = .fus_appBG() self.contentView.backgroundColor = .clear
bgView.frame = CGRectMake(0, 0, UIView.fus_screenW() - 18*2, 45) bgView.frame = CGRectMake(0, 0, UIView.fus_screenW() - 18*2, 45)
bgView.backgroundColor = .white.withAlphaComponent(0.1) bgView.backgroundColor = .white.withAlphaComponent(0.1)
// bgView.addRoundCorners(with: UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), radius: CGSizeMake(9, 9)) // bgView.addRoundCorners(with: UIRectCorner(rawValue: UIRectCorner(rawValue: UIRectCorner.topRight.rawValue | UIRectCorner.topLeft.rawValue).rawValue), radius: CGSizeMake(9, 9))
bgView.fus_addInviteCellShadow(currentRow: 0, maxRowCount: 3) bgView.fus_addInviteCellShadow(currentRow: 0, maxRowCount: 3)
self.addSubview(bgView) self.contentView.addSubview(bgView)
bgView.snp.makeConstraints { make in bgView.snp.makeConstraints { make in
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
make.left.right.equalToSuperview().inset(18) make.left.right.equalToSuperview().inset(18)
......
...@@ -26,7 +26,9 @@ class FFInviteRewardTaskCommonCell: UITableViewCell { ...@@ -26,7 +26,9 @@ class FFInviteRewardTaskCommonCell: UITableViewCell {
/// 空白卡片内容部分高度 /// 空白卡片内容部分高度
static public let emptyContentHeight: CGFloat = 158 static public let emptyContentHeight: CGFloat = 158
/// 背景左右两边的空隙 /// 背景左右两边的空隙
static public let bgHorizontalMargin: CGFloat = 15 static public let bgHorizontalMargin: CGFloat = 18
/// 背景下面空间
static public let bgBottomMargin: CGFloat = 10
/// 内容距离背景两边的空隙 /// 内容距离背景两边的空隙
static public let contentHorizontalMargin: CGFloat = 22 static public let contentHorizontalMargin: CGFloat = 22
...@@ -46,6 +48,7 @@ class FFInviteRewardTaskCommonCell: UITableViewCell { ...@@ -46,6 +48,7 @@ class FFInviteRewardTaskCommonCell: UITableViewCell {
/// 预留一个背景imageview /// 预留一个背景imageview
let bgImageView = UIImageView() let bgImageView = UIImageView()
let strokeBgImageView = UIImageView(image: FUSUserCenterBunble.imageNamed("InviteReward_task_common_background"))
let titleLabel = YYLabel() let titleLabel = YYLabel()
let descLabel = UILabel() let descLabel = UILabel()
let lineView = UIView() let lineView = UIView()
...@@ -60,12 +63,22 @@ class FFInviteRewardTaskCommonCell: UITableViewCell { ...@@ -60,12 +63,22 @@ class FFInviteRewardTaskCommonCell: UITableViewCell {
self.contentView.backgroundColor = .clear self.contentView.backgroundColor = .clear
self.backgroundColor = .clear self.backgroundColor = .clear
bgImageView.fus_addInviteShadow()
bgImageView.backgroundColor = .white bgImageView.backgroundColor = .white
bgImageView.layer.cornerRadius = 12
bgImageView.isUserInteractionEnabled = true bgImageView.isUserInteractionEnabled = true
self.contentView.addSubview(bgImageView) self.contentView.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in bgImageView.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(FFInviteRewardTaskCommonCell.bgHorizontalMargin) make.left.right.equalToSuperview().inset(FFInviteRewardTaskCommonCell.bgHorizontalMargin)
make.top.bottom.equalToSuperview() make.top.equalToSuperview()
make.bottom.equalTo(-FFInviteRewardTaskCommonCell.bgBottomMargin)
}
strokeBgImageView.contentMode = .scaleAspectFill
bgImageView.addSubview(strokeBgImageView)
strokeBgImageView.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(4)
make.bottom.equalTo(-12)
} }
bgImageView.addSubview(titleLabel) bgImageView.addSubview(titleLabel)
...@@ -152,7 +165,6 @@ class FFInviteRewardTaskCommonCell: UITableViewCell { ...@@ -152,7 +165,6 @@ class FFInviteRewardTaskCommonCell: UITableViewCell {
self.emptyView.isHidden = false self.emptyView.isHidden = false
} }
self.bgImageView.fus_addInviteShadow()
} }
} }
...@@ -214,6 +226,7 @@ extension FUSInviteDataAwardGetListDataModel { ...@@ -214,6 +226,7 @@ extension FUSInviteDataAwardGetListDataModel {
cellHeight += FFInviteRewardTaskCommonCell.emptyContentHeight cellHeight += FFInviteRewardTaskCommonCell.emptyContentHeight
} }
cellHeight += FFInviteRewardTaskCommonCell.bottomMargin cellHeight += FFInviteRewardTaskCommonCell.bottomMargin
cellHeight += FFInviteRewardTaskCommonCell.bgBottomMargin
return cellHeight return cellHeight
} }
......
...@@ -22,6 +22,7 @@ class FFInviteRewardTaskMemberCell: UITableViewCell { ...@@ -22,6 +22,7 @@ class FFInviteRewardTaskMemberCell: UITableViewCell {
self.selectionStyle = UITableViewCell.SelectionStyle.none self.selectionStyle = UITableViewCell.SelectionStyle.none
self.makeUI() self.makeUI()
self.bindViewModel()
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
......
...@@ -213,7 +213,7 @@ extension UIView { ...@@ -213,7 +213,7 @@ extension UIView {
self.layer.shadowColor = UIColor(red: 0.7, green: 0.7, blue: 0.7, alpha: 1).cgColor self.layer.shadowColor = UIColor(red: 0.7, green: 0.7, blue: 0.7, alpha: 1).cgColor
self.layer.shadowOffset = CGSize(width: 0, height: 0) self.layer.shadowOffset = CGSize(width: 0, height: 0)
self.layer.shadowOpacity = 1 self.layer.shadowOpacity = 1
self.layer.shadowRadius = 6.5 // self.layer.shadowRadius = 6.5
} }
/// 添加邀请卡片的圆角,注意,会去掉所有的 CAShapeLayer /// 添加邀请卡片的圆角,注意,会去掉所有的 CAShapeLayer
......
...@@ -126,12 +126,13 @@ public class FFInviteRewardController: FUSBaseViewController { ...@@ -126,12 +126,13 @@ public class FFInviteRewardController: FUSBaseViewController {
func makeNaviBtn(){ func makeNaviBtn(){
// 榜单 // 榜单
let boardBtn = UIButton(type: .custom) let boardBtn = UIButton(type: .custom)
let boardImageView = UIImageView(image: FUSUserCenterBunble.imageNamed("fus_home_navi_rank_icon")) boardBtn.setImage(FUSUserCenterBunble.imageNamed("inviteReward_invite_navi_rank_btn"), for: .normal)
boardBtn.addSubview(boardImageView) // let boardImageView = UIImageView(image: FUSUserCenterBunble.imageNamed("fus_home_navi_rank_icon"))
boardImageView.snp.makeConstraints { make in // boardBtn.addSubview(boardImageView)
make.center.equalToSuperview() // boardImageView.snp.makeConstraints { make in
make.size.equalTo(CGSizeMake(24, 24)) // make.center.equalToSuperview()
} // make.size.equalTo(CGSizeMake(24, 24))
// }
boardBtn.rx.tap.subscribe(onNext: { boardBtn.rx.tap.subscribe(onNext: {
var url = FUSCacheDataShare.shareStore().settingInitDataModel.fusiConfig.rankAddress + "?isSpecialUser=\((FUSSwiftCacheDataShare.share.settingConfigModel.value?.specialUserMark == true ? "1" : "0"))" var url = FUSCacheDataShare.shareStore().settingInitDataModel.fusiConfig.rankAddress + "?isSpecialUser=\((FUSSwiftCacheDataShare.share.settingConfigModel.value?.specialUserMark == true ? "1" : "0"))"
......
...@@ -49,7 +49,9 @@ ...@@ -49,7 +49,9 @@
+ (void)fus_inviteDataAwardReceiveWithSid:(NSString *)sid success:(void (^)(FUSInviteDataAwardReceiveItemModel * _Nonnull))success failure:(void (^)(NSString * _Nonnull, int))failure{ + (void)fus_inviteDataAwardReceiveWithSid:(NSString *)sid success:(void (^)(FUSInviteDataAwardReceiveItemModel * _Nonnull))success failure:(void (^)(NSString * _Nonnull, int))failure{
NSDictionary *parm = @{@"sid": sid}; NSDictionary *parm = @{@"sid": sid};
[FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_inviteDataAwardReceive params:parm success:^(NSDictionary * _Nullable dataDict, int code) { [FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_inviteDataAwardReceive params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
success([FUSInviteDataAwardReceiveItemModel modelWithDictionary:dataDict[@"getJson"]]); FUSInviteDataAwardReceiveItemModel *model = [FUSInviteDataAwardReceiveItemModel modelWithDictionary:dataDict[@"getJson"]];
[[FUSRouter userRouter] fus_showAwardAnimateWithCurrency:0 classify:model.classify tips:model.itemName icon:model.itemUrl amount:model.itemNum];
success(model);
} failure:^(NSDictionary * _Nullable dataDict, int code) { } failure:^(NSDictionary * _Nullable dataDict, int code) {
if (failure) { if (failure) {
failure(FAILURE_MESSAGE,code); failure(FAILURE_MESSAGE,code);
...@@ -61,7 +63,9 @@ ...@@ -61,7 +63,9 @@
+ (void)fus_inviteDataTaskReceiveWithSid:(NSString *)sid success:(void (^)(FUSInviteDataAwardReceiveItemModel * _Nonnull))success failure:(void (^)(NSString * _Nonnull, int))failure{ + (void)fus_inviteDataTaskReceiveWithSid:(NSString *)sid success:(void (^)(FUSInviteDataAwardReceiveItemModel * _Nonnull))success failure:(void (^)(NSString * _Nonnull, int))failure{
NSDictionary *parm = @{@"sid": sid}; NSDictionary *parm = @{@"sid": sid};
[FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_inviteDataTaskReceive params:parm success:^(NSDictionary * _Nullable dataDict, int code) { [FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_inviteDataTaskReceive params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
success([FUSInviteDataAwardReceiveItemModel modelWithDictionary:dataDict[@"dataJson"]]); FUSInviteDataAwardReceiveItemModel *model = [FUSInviteDataAwardReceiveItemModel modelWithDictionary:dataDict[@"dataJson"]];
[[FUSRouter userRouter] fus_showAwardAnimateWithCurrency:0 classify:model.classify tips:model.itemName icon:model.itemUrl amount:model.itemNum];
success(model);
} failure:^(NSDictionary * _Nullable dataDict, int code) { } failure:^(NSDictionary * _Nullable dataDict, int code) {
if (failure) { if (failure) {
failure(FAILURE_MESSAGE,code); failure(FAILURE_MESSAGE,code);
......
...@@ -40,6 +40,8 @@ class FFInviteEmissaryConditionAlertView: FUSBaseView { ...@@ -40,6 +40,8 @@ class FFInviteEmissaryConditionAlertView: FUSBaseView {
override func makeUI() { override func makeUI() {
super.makeUI() super.makeUI()
self.backgroundColor = .fus_alertViewBackground()
self.addSubview(bgBtn) self.addSubview(bgBtn)
bgBtn.snp.makeConstraints { make in bgBtn.snp.makeConstraints { make in
make.edges.equalToSuperview() make.edges.equalToSuperview()
...@@ -264,6 +266,7 @@ class FFInviteEmissaryConditionAlertViewCell: FUSBaseView { ...@@ -264,6 +266,7 @@ class FFInviteEmissaryConditionAlertViewCell: FUSBaseView {
} }
conditionContentLabel.numberOfLines = 0 conditionContentLabel.numberOfLines = 0
conditionContentLabel.textAlignment = .center
self.addSubview(conditionContentLabel) self.addSubview(conditionContentLabel)
conditionContentLabel.snp.makeConstraints { make in conditionContentLabel.snp.makeConstraints { make in
make.left.equalTo(dotView.snp.right).offset(5) make.left.equalTo(dotView.snp.right).offset(5)
......
...@@ -65,12 +65,14 @@ class FFInviteQRCodeView: FUSBaseView { ...@@ -65,12 +65,14 @@ class FFInviteQRCodeView: FUSBaseView {
} }
YYWebImageManager.shared().requestImage(with: avatarURL, options: .showNetworkActivity, progress: nil, transform: nil) {[weak self] image, iamgeUrl, from, stage, error in YYWebImageManager.shared().requestImage(with: avatarURL, options: .showNetworkActivity, progress: nil, transform: nil) {[weak self] image, iamgeUrl, from, stage, error in
DispatchQueue.main.async(execute: {
if error == nil, if error == nil,
let image = image{ let image = image{
self?.ff_setup(url: url, avatar: image, completeHandler: completeHandler) self?.ff_setup(url: url, avatar: image, completeHandler: completeHandler)
}else { }else {
completeHandler?(false) completeHandler?(false)
} }
})
} }
} }
......
...@@ -10,7 +10,7 @@ import SJAttributesStringMaker ...@@ -10,7 +10,7 @@ import SJAttributesStringMaker
class FFInviteRewardMyView: FFInviteRewardBaseView { class FFInviteRewardMyView: FFInviteRewardBaseView {
private let tableView = UITableView(frame: .zero) private let tableView = UITableView(frame: .zero, style: .plain)
var myselfInfoModel: FUSInviteDataMyselfGetInfoModel? var myselfInfoModel: FUSInviteDataMyselfGetInfoModel?
var dauModelList: [FUSInviteDataMyselfDauGetListDataModel] = .init() var dauModelList: [FUSInviteDataMyselfDauGetListDataModel] = .init()
...@@ -31,7 +31,7 @@ class FFInviteRewardMyView: FFInviteRewardBaseView { ...@@ -31,7 +31,7 @@ class FFInviteRewardMyView: FFInviteRewardBaseView {
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.register(FFInviteRewardMyHeaderCell.self, forCellReuseIdentifier: FFInviteRewardMyHeaderCell.cellID) tableView.register(FFInviteRewardMyHeaderCell.self, forCellReuseIdentifier: FFInviteRewardMyHeaderCell.cellID)
tableView.register(FFInviteRewardMyClansmanHeader.self, forHeaderFooterViewReuseIdentifier: FFInviteRewardMyClansmanHeader.cellID) tableView.register(FFInviteRewardMyClansmanHeaderCell.self, forCellReuseIdentifier: FFInviteRewardMyClansmanHeaderCell.cellID)
tableView.register(FFInviteRewardMyClansmanEmptyCell.self, forCellReuseIdentifier: FFInviteRewardMyClansmanEmptyCell.cellID) tableView.register(FFInviteRewardMyClansmanEmptyCell.self, forCellReuseIdentifier: FFInviteRewardMyClansmanEmptyCell.cellID)
tableView.register(FFInviteRewardMyClansmanCell.self, forCellReuseIdentifier: FFInviteRewardMyClansmanCell.cellID) tableView.register(FFInviteRewardMyClansmanCell.self, forCellReuseIdentifier: FFInviteRewardMyClansmanCell.cellID)
self.addSubview(tableView) self.addSubview(tableView)
...@@ -125,14 +125,14 @@ class FFInviteRewardMyView: FFInviteRewardBaseView { ...@@ -125,14 +125,14 @@ class FFInviteRewardMyView: FFInviteRewardBaseView {
extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return 2 return 3
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 { if section == 0 || section == 1 {
return 1 return 1
} }
else if section == 1 { else if section == 2 {
return self.dauModelList.count <= 0 ? 1 : self.dauModelList.count return self.dauModelList.count <= 0 ? 1 : self.dauModelList.count
} }
return 0 return 0
...@@ -143,6 +143,9 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{ ...@@ -143,6 +143,9 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{
return FFInviteRewardMyHeaderCell.cellHeight return FFInviteRewardMyHeaderCell.cellHeight
} }
else if indexPath.section == 1 { else if indexPath.section == 1 {
return FFInviteRewardMyClansmanHeaderCell.cellHeight
}
else if indexPath.section == 2 {
if self.dauModelList.count <= 0 { if self.dauModelList.count <= 0 {
return FFInviteRewardMyClansmanEmptyCell.cellHeight return FFInviteRewardMyClansmanEmptyCell.cellHeight
} }
...@@ -192,6 +195,25 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{ ...@@ -192,6 +195,25 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{
} }
} }
else if indexPath.section == 1 { else if indexPath.section == 1 {
if let cell = tableView.dequeueReusableCell(withIdentifier: FFInviteRewardMyClansmanHeaderCell.cellID, for: indexPath) as? FFInviteRewardMyClansmanHeaderCell{
let regexText = "regex_replaceText"
cell.titleLabel.attributedText = .sj.makeText({[weak self] make in
make.append(.init(format: .fus_localString("活跃族人%@"), regexText))
make.regex(regexText).replace { make in
if self?.dauModelList.count ?? 0 > 0 {
make.append(" (")
make.append("\(self?.dauModelList.count ?? 0)").textColor(.fus_diamondBlue())
make.append(") ")
}else {
make.append("")
}
}
make.textColor(.black).font(.fus_themeMediumFont(18))
})
return cell
}
}
else if indexPath.section == 2 {
if self.dauModelList.count <= 0 { if self.dauModelList.count <= 0 {
if let cell = tableView.dequeueReusableCell(withIdentifier: FFInviteRewardMyClansmanEmptyCell.cellID, for: indexPath) as? FFInviteRewardMyClansmanEmptyCell { if let cell = tableView.dequeueReusableCell(withIdentifier: FFInviteRewardMyClansmanEmptyCell.cellID, for: indexPath) as? FFInviteRewardMyClansmanEmptyCell {
...@@ -215,32 +237,14 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{ ...@@ -215,32 +237,14 @@ extension FFInviteRewardMyView: UITableViewDelegate, UITableViewDataSource{
} }
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat { func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
if section == 1 { if section == 0 {
return FFInviteRewardMyClansmanHeader.cellHeight
}
return 10 return 10
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { return 0
if section == 1{
if let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: FFInviteRewardMyClansmanHeader.cellID) as? FFInviteRewardMyClansmanHeader {
let regexText = "regex_replaceText"
header.titleLabel.attributedText = .sj.makeText({[weak self] make in
make.append(.init(format: .fus_localString("活跃族人%@"), regexText))
make.regex(regexText).replace { make in
if self?.dauModelList.count ?? 0 > 0 {
make.append(" (")
make.append("\(self?.dauModelList.count ?? 0)").textColor(.fus_diamondBlue())
make.append(") ")
}else {
make.append("")
}
}
make.textColor(.black).font(.fus_themeMediumFont(18))
})
return header
}
} }
return .init() func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let headerView = UIView()
headerView.backgroundColor = .clear
return headerView
} }
} }
...@@ -15,7 +15,7 @@ class FFInviteRewardTaskView: FFInviteRewardBaseView { ...@@ -15,7 +15,7 @@ class FFInviteRewardTaskView: FFInviteRewardBaseView {
} }
let viewType: FFInviteRewardTaskViewType let viewType: FFInviteRewardTaskViewType
private let tableView = UITableView(frame: .zero) private let tableView = UITableView(frame: .zero, style: .grouped)
var dataList: [FUSInviteDataAwardGetListDataModel] = .init() var dataList: [FUSInviteDataAwardGetListDataModel] = .init()
...@@ -183,14 +183,6 @@ extension FFInviteRewardTaskView: UITableViewDelegate, UITableViewDataSource{ ...@@ -183,14 +183,6 @@ extension FFInviteRewardTaskView: UITableViewDelegate, UITableViewDataSource{
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
if section == 0{ if section == 0{
// if let header = tableView.dequeueReusableHeaderFooterView(withIdentifier: FFInviteRewardInviteFunctionHeader.cellID) as? FFInviteRewardInviteFunctionHeader {
// if self.viewType == .reward{
// header.ff_setHeaderType(type: .emissaryReward)
// }else {
// header.ff_setHeaderType(type: .emisaaryTask)
// }
// return header
// }
let header = FFInviteRewardInviteFunctionHeader(frame: CGRectMake(0, 0, UIView.fus_screenW(), FFInviteRewardInviteFunctionHeader.cellHeight)) let header = FFInviteRewardInviteFunctionHeader(frame: CGRectMake(0, 0, UIView.fus_screenW(), FFInviteRewardInviteFunctionHeader.cellHeight))
if self.viewType == .reward{ if self.viewType == .reward{
header.ff_setHeaderType(type: .emissaryReward) header.ff_setHeaderType(type: .emissaryReward)
......
...@@ -94,7 +94,7 @@ class FFMyEmissaryQRCodeView: FUSBaseView { ...@@ -94,7 +94,7 @@ class FFMyEmissaryQRCodeView: FUSBaseView {
override func bindViewModel() { override func bindViewModel() {
super.bindViewModel() super.bindViewModel()
self.qrCodeView.ff_setup(url: FFInviteRewardInviteViewModel.share.inviteDataModel.value?.qrcodeFormLink ?? "", avatarURL: FUSSwiftCacheDataShare.share.userInfo.value?.uid.fus_bigCdn ?? "") {[weak self] isSuccess in self.qrCodeView.ff_setup(url: FFInviteRewardInviteViewModel.share.inviteDataModel.value?.qrcodeFormLink ?? "", avatarURL: FUSSwiftCacheDataShare.share.userInfo.value?.face.fus_bigCdn ?? "") {[weak self] isSuccess in
if isSuccess { if isSuccess {
self?.avatarImageIsReady.accept(true) self?.avatarImageIsReady.accept(true)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment