Commit 41746f20 by ludi

修复一些bug

parent c37dd5eb
Showing with 88 additions and 44 deletions
......@@ -184,7 +184,7 @@
//粉丝
NSInteger unreadCount = self.fansUnreadCount;
//如果粉丝新增是0,那么看看其他的需不需要显示红点
if (unreadCount == 0) {
if (unreadCount <= 0) {
BOOL otherShouldShow = NO;
......@@ -231,6 +231,8 @@
if (!otherShouldShow) {
unreadCount = -1;
}else {
unreadCount = 0;
}
}
[self.myBtn fus_setBadgeValue:unreadCount];
......
......@@ -309,6 +309,7 @@ NS_ASSUME_NONNULL_BEGIN
/// @param needShowSkipBtn 是否显示跳过按钮
/// @param success 1
-(void)fus_showBindAgentPageWithNeedShowSkipBtn:(BOOL)needShowSkipBtn
showEnterInviteCodeBtn:(BOOL)showEnterInviteCodeBtn
success:(void(^)(void))success;
/// 注册的时候,绑定使者页面
......
......@@ -3172,3 +3172,6 @@
"请联系您的邀请人获得邀请QRCode" = "請聯繫您的邀請人獲得邀請QRCode";
"已关闭窗帘,玩家输入密码打开" = "已關閉窗簾,玩家輸入密碼打開";
"#$1#天以上未登入#$2#的玩家,将会自动断开使者关系" = "#$1#天以上未登入#$2#的玩家,將會自動斷開使者關係";
......@@ -66,6 +66,7 @@
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.font = [UIFont fus_themeMediumFont:18];
titleLabel.textColor = [UIColor fus_textColorRich];
titleLabel.numberOfLines = 0;
titleLabel.text = [NSString fus_localString:@"未发现追踪的主播直播"];
[self.contentView addSubview:titleLabel];
......
......@@ -127,7 +127,7 @@ import RxSwift
let attributedTitle = NSAttributedString(
string: .fus_localString("私信问密码"),
attributes: [
.foregroundColor: UIColor.fus_theme() ?? .black,
.foregroundColor: UIColor.fus_diamondBlue() ?? .black,
.underlineStyle: NSUnderlineStyle.single.rawValue,
.font: UIFont.fus_themeFont(13) ?? .systemFont(ofSize: 13)
]
......
......@@ -102,8 +102,8 @@ import FUSCommon
//这里特殊用户有不一样的逻辑
let iconImagesList = ["live_start_openScope_cell","live_start_passwordScope_cell"/*,"live_start_intimacyScope_cell"*/]
let titlesList = [String.fus_versionLocalString("公开屋"), .fus_versionLocalString("私享屋")/*, .fus_localString("亲密圈")*/]
let subTitlesList = [String.fus_localString("所有人可进入房间"), .fus_versionLocalString("已关闭窗帘,玩家输入密码打开")/*, .fus_localString("仅亲密好友可进入房间")*/]
let titlesList = [String.fus_localString("公开屋"), .fus_localString("私享屋")/*, .fus_localString("亲密圈")*/]
let subTitlesList = [String.fus_localString("所有人可进入房间"), .fus_localString("已关闭窗帘,玩家输入密码打开")/*, .fus_localString("仅亲密好友可进入房间")*/]
let itemHeight = 56.0
privacyContentView.snp.makeConstraints { make in
......
......@@ -20,6 +20,7 @@ class FUSBindAgentInputCodeViewController: FUSBaseViewController {
super.viewDidLoad()
self.showBackBtn = true
self.fus_enableNavigationBack(withPop: .popViewController, withAnimated: true)
self.fus_setupNav()
self.fus_setupBottomViews()
......
......@@ -27,7 +27,7 @@ import FUSCommon
@objc public var type: FUSBindAgentViewControllerType = .bindAgent
public var needShowSkipBtn: Bool = true
/// 需要显示手动输入邀请码
var needShowEnterAgentCodeBtn = true
public var needShowEnterAgentCodeBtn = true
/// 是否开始扫描
private let beginScan: BehaviorRelay<Bool> = .init(value: false)
......@@ -188,6 +188,7 @@ import FUSCommon
describeLabel.textColor = .fus_textColorDeep()
describeLabel.text = .fus_localString("扫描使者码QRCode图片完成绑定")
describeLabel.textAlignment = .center
describeLabel.numberOfLines = 0
scanView.addSubview(describeLabel)
borderView.layer.cornerRadius = 12
......@@ -267,7 +268,7 @@ import FUSCommon
func fus_setupCountDownLabel() {
self.inviteCodeCountDownDisposeBag = .init()
self.subdescribeLabel.text = ""
self.subdescribeLabel.text = " "
let startLeftTime = Int(FUSSwiftCacheDataShare.share.fus_calculateAgentLeftTime())
......@@ -285,7 +286,7 @@ import FUSCommon
if leftTime < 0 {
if beginScan == true {
self?.qrcodeTipDescribeLabel.isHidden = false
return .init(string: "")
return .init(string: " ")
}else {
return .init(string: .fus_localString("请联系您的邀请人获得邀请QRCode"))
}
......@@ -319,7 +320,7 @@ import FUSCommon
titleLabel.font = .fus_themeFont(14)
titleLabel.textColor = .fus_textColorDeep()
titleLabel.textAlignment = .center
titleLabel.numberOfLines = 2
titleLabel.numberOfLines = 0
superView.addSubview(titleLabel)
let btn = UIButton(type: .custom)
......@@ -335,7 +336,7 @@ import FUSCommon
}
titleLabel.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.left.right.equalToSuperview()
make.top.equalTo(imageView.snp.bottom).offset(8)
}
......
......@@ -45,6 +45,7 @@
self = [super initWithFrame:frame];
if (self) {
[self fus_createUI];
[self fus_setupNotification];
}
return self;
}
......@@ -262,6 +263,10 @@
[vipTouchBtn addTarget:self action:@selector(fus_vipBtnDidClicked:) forControlEvents:UIControlEventTouchUpInside];
}
-(void)fus_setupNotification{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(fus_refreshFansUnreadCount:) name:FUSUserNotificationKeys.fus_Tabbar_Unread_Count_Fans object:nil];
}
#pragma mark --- button did clicked
-(void)fus_vipBtnDidClicked:(UIButton *)btn{
if (self.buttonDidClickedHander) {
......@@ -301,19 +306,7 @@
NSString *fansNumberString = [NSString isNull:model.followme] ? @"0" : model.followme;
self.fansNumLabel.text = fansNumberString;
// 粉丝未读数
NSString *loginUid = [FUSCacheDataShare shareStore].userDetailInfo.uid;
NSDictionary *dict = [[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_ZONE_FANS_UNREADER_COUNT];
if ([[dict allKeys] containsObject:loginUid]) {
NSInteger unreaderCount = [dict[loginUid][@"unreaderCount"] integerValue];
if (unreaderCount > 0) {
self.fansNumAddedLabel.hidden = NO;
self.fansNumAddedLabel.text = [NSString stringWithFormat:@" +%ld ",unreaderCount];
}else if (unreaderCount <= 0) {
self.fansNumAddedLabel.hidden = YES;
}
} else {
self.fansNumAddedLabel.hidden = YES;
}
[self fus_reloadFansNumAdded];
// 等级
NSString *levelString = [NSString isNull:model.lev] ? @"0" : model.lev;
self.levelLabel.text = [NSString stringWithFormat:@"%@",levelString];
......@@ -345,6 +338,27 @@
self.vipMarkImgView.image = [UIImage fus_imageWithLevel:level];
}
/// 重新加载粉丝新增数量
-(void)fus_reloadFansNumAdded{
NSString *loginUid = [FUSCacheDataShare shareStore].userDetailInfo.uid;
NSDictionary *dict = [[NSUserDefaults standardUserDefaults] objectForKey:FUSUserUDKeys.fus_ZONE_FANS_UNREADER_COUNT];
if ([[dict allKeys] containsObject:loginUid]) {
NSInteger unreaderCount = [dict[loginUid][@"unreaderCount"] integerValue];
if (unreaderCount > 0) {
self.fansNumAddedLabel.hidden = NO;
self.fansNumAddedLabel.text = [NSString stringWithFormat:@" +%ld ",unreaderCount];
}else if (unreaderCount <= 0) {
self.fansNumAddedLabel.hidden = YES;
}
} else {
self.fansNumAddedLabel.hidden = YES;
}
}
#pragma mark --- notification
-(void)fus_refreshFansUnreadCount:(NSNotification *)notification{
[self fus_reloadFansNumAdded];
}
#pragma mark --- getter and setter
+ (CGFloat)fus_viewHeight{
......@@ -384,4 +398,9 @@
return _jewNumLabel;
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
@end
......@@ -518,7 +518,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
dict[loginUid] = @{@"uid":saveDic[@"uid"],@"unreaderCount":@(-1)};
}
[[NSUserDefaults standardUserDefaults] setObject:dict forKey:FUSUserUDKeys.fus_ZONE_FANS_UNREADER_COUNT];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSUserNotificationKeys.fus_Tabbar_Unread_Count_Fans object:nil];
[[NSNotificationCenter defaultCenter] postNotificationName:FUSUserNotificationKeys.fus_Tabbar_Unread_Count_Fans object:dict];
}
break;
......@@ -560,7 +560,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
// FUSBoundAgentInfoView *agentView = [[FUSBoundAgentInfoView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenH)];
// agentView.leftTime = self.leftTime;
// [agentView showWithView:[UIApplication sharedApplication].keyWindow];
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:NO success:^{
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:NO showEnterInviteCodeBtn:YES success:^{
[FUSRouter.userRouter fus_showBindAgentSuccessPopViewWithSuccess:^{
}];
......@@ -671,7 +671,7 @@ typedef NS_ENUM(NSInteger, FUSMySettingItemType){
}
-(void)scanBtnDidClicked:(UIButton *)btn{
[[FUSRouter userRouter] fus_showBindAgentPageWithNeedShowSkipBtn:NO success:^{
[[FUSRouter userRouter] fus_showBindAgentPageWithNeedShowSkipBtn:NO showEnterInviteCodeBtn:NO success:^{
[[FUSRouter userRouter] fus_showBindAgentSuccessPopViewWithSuccess:^{
}];
......
......@@ -51,7 +51,7 @@ class FUSInviteEmissaryRewardDrawHeader: UITableViewHeaderFooterView {
dotView.layer.cornerRadius = 3
bgView.addSubview(dotView)
dotView.snp.makeConstraints { make in
make.left.equalTo(22)
make.left.equalTo(18)
make.centerY.equalToSuperview().offset(6)
make.size.equalTo(CGSizeMake(6, 6))
}
......
......@@ -49,7 +49,7 @@ class FUSInviteRewardInviteFunctionHeader: FUSBaseView {
dotView.layer.cornerRadius = 3
self.addSubview(dotView)
dotView.snp.makeConstraints { make in
make.left.equalTo(22)
make.left.equalTo(18)
make.centerY.equalToSuperview()
make.size.equalTo(CGSizeMake(6, 6))
}
......
......@@ -22,7 +22,10 @@ class FUSInviteRewardInviteRecallClansmanHeader: FUSBaseView {
func fus_getDesc() -> String {
switch self {
case .recallClansman:
return .init(format: .fus_localString("%@天以上未登入%@的玩家,将会自动断开使者关系"), "\(FUSSwiftCacheDataShare.share.settingConfigModel.value?.inviteDataRecallShowDay ?? 90)", "FusiYa")
let content: String = .fus_localString("#$1#天以上未登入#$2#的玩家,将会自动断开使者关系")
.replacingOccurrences(of: "#$1#", with: "\(FUSSwiftCacheDataShare.share.settingConfigModel.value?.inviteDataRecallShowDay ?? 90)")
.replacingOccurrences(of: "#$2#", with: "FusiYa")
return content
}
}
}
......@@ -41,14 +44,14 @@ class FUSInviteRewardInviteRecallClansmanHeader: FUSBaseView {
self.addSubview(descLabel)
descLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(18)
make.bottom.equalToSuperview().offset(-4)
make.bottom.equalToSuperview().offset(-8)
}
let titleBgView = UIView()
self.addSubview(titleBgView)
titleBgView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(descLabel.snp.top).offset(0)
make.bottom.equalTo(descLabel.snp.top).offset(4)
make.height.equalTo(38)
}
......@@ -57,7 +60,7 @@ class FUSInviteRewardInviteRecallClansmanHeader: FUSBaseView {
dotView.layer.cornerRadius = 3
titleBgView.addSubview(dotView)
dotView.snp.makeConstraints { make in
make.left.equalTo(22)
make.left.equalTo(18)
make.centerY.equalToSuperview()
make.size.equalTo(CGSizeMake(6, 6))
}
......@@ -78,7 +81,7 @@ class FUSInviteRewardInviteRecallClansmanHeader: FUSBaseView {
static public func fus_getCellHeight(type: FUSInviteRewardInviteRecallClansmanHeaderType) -> CGFloat{
var cellHeight: CGFloat = 0
cellHeight += 38
cellHeight += 30
cellHeight += ceil(type.fus_getDesc().size(for: .fus_themeFont(13), maxWidth: UIView.fus_screenW() - 18*2, maxHeight: Double(MAXFLOAT)).height) + 2
cellHeight += 4
return cellHeight
......
......@@ -188,7 +188,7 @@ class FUSInviteFunctionController: FUSBaseViewController {
func fus_clickedMoreMenu(menuType: FUSInviteRewardController.FUSInviteRewardMoreMenuType){
switch menuType {
case .bindEmissary:
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false, showEnterInviteCodeBtn: false) {
FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
}
......
......@@ -205,7 +205,7 @@ public class FUSInviteRewardController: FUSBaseViewController {
let scanBtn = UIButton(type: .custom)
scanBtn.setImage(FUSUserCenterBunble.imageNamed("inviteReward_navi_scan_icon"), for: .normal)
scanBtn.rx.tap.subscribe(onNext: {
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false, showEnterInviteCodeBtn: false) {
FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
}
......@@ -231,7 +231,7 @@ public class FUSInviteRewardController: FUSBaseViewController {
func fus_clickedMoreMenu(menuType: FUSInviteRewardMoreMenuType){
switch menuType {
case .bindEmissary:
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false) {
FUSRouter.userRouter().fus_showBindAgentPage(withNeedShowSkipBtn: false, showEnterInviteCodeBtn: false) {
FUSRouter.userRouter().fus_showBindAgentSuccessPopView {
}
......
......@@ -163,7 +163,14 @@
/// 使者邀请-领取每日奖励萤火
+ (void)fus_requestInviteDataObtainBondsGetWithSidList:(NSArray<NSString *> *)sidList success:(void (^)(void))success failure:(void (^)(NSString * _Nonnull, int))failure{
NSDictionary *parm = @{@"sidList": sidList};
// 2. 转换为 JSON Data
NSError *jsonError;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:sidList
options:NSJSONWritingPrettyPrinted
error:&jsonError];
NSString *sidListJsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
NSDictionary *parm = @{@"sidList": sidListJsonString};
[FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_inviteDataObtainBondsGet params:parm success:^(NSDictionary * _Nullable dataDict, int code) {
NSArray *dataList = dataDict[@"dataList"];
......
......@@ -68,6 +68,7 @@ import SwiftyJSON
}
let halfView = FUSInviteConfigHalfWebAlertView(frame: rootView.bounds)
halfView.backgroundColor = .fus_alertViewBackground()
halfView.halfViewFrame = halfViewFrame
halfView.fus_loadRequest(url: url)
rootView.addSubview(halfView)
......
......@@ -381,7 +381,10 @@ extension FUSInviteRewardMyView.FUSInviteRewardMySectionType {
case .dauClansman:
return .fus_localString("最近30天内活跃的族人")
case .recallClansman:
return .init(format: .fus_localString("%@天以上未登入%@的玩家,将会自动断开使者关系"), "\(FUSSwiftCacheDataShare.share.settingConfigModel.value?.inviteDataRecallShowDay ?? 90)", "FusiYa")
let content: String = .fus_localString("#$1#天以上未登入#$2#的玩家,将会自动断开使者关系")
.replacingOccurrences(of: "#$1#", with: "\(FUSSwiftCacheDataShare.share.settingConfigModel.value?.inviteDataRecallShowDay ?? 90)")
.replacingOccurrences(of: "#$2#", with: "FusiYa")
return content
default:
return ""
}
......
......@@ -27,7 +27,7 @@ class FUSMyEmissaryQRCodeView: FUSBaseView {
let titleLabel = UILabel()
titleLabel.font = .fus_themeMediumFont(22)
titleLabel.textColor = .fus_textColorRich()
titleLabel.textColor = .init(hex: "#111111")
// titleLabel.text = .fus_localString("我的使者码")
titleLabel.text = .fus_localString("我的邀请码")
self.addSubview(titleLabel)
......@@ -44,7 +44,7 @@ class FUSMyEmissaryQRCodeView: FUSBaseView {
descLabel.text = .fus_localString("保存QRCode到您的相册,将此图片发送给您要邀请的好友扫描即可完成绑定您为使者和成功注册在部分国家和地区,只有完成使者绑定对方才能注册成功")
self.addSubview(descLabel)
descLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview().inset(35)
make.left.right.equalToSuperview().inset(26)
make.top.equalTo(titleLabel.snp.bottom).offset(14)
}
......
......@@ -95,7 +95,7 @@ class FUSMyInviteQRCodeDownloadView: FUSBaseView {
qrCodeLabel.font = .fus_themeFont(15)
qrCodeLabel.textColor = .fus_textColorLight2()
qrCodeLabel.text = .init(format: .fus_localString("官网:%@"), "fusiclub.com")
qrCodeLabel.text = .init(format: .fus_localString("官网:%@"), "ifusiya.com")
self.addSubview(qrCodeLabel)
qrCodeLabel.snp.makeConstraints { make in
make.top.equalTo(qrCodeView.snp.bottom).offset(10)
......
......@@ -638,7 +638,7 @@
//跳过
setInfoVC.onClickSkipBtnBlock = ^{
if (showBind) {
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:YES success:^{
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:YES showEnterInviteCodeBtn:NO success:^{
[weakSelf fus_doLoginReadyWithSender:sender];
}];
}else {
......@@ -649,7 +649,7 @@
setInfoVC.finishUpdateUserInfoBlock = ^{
// [self fus_doLoginReadyWithSender:sender];
if (showBind) {
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:YES success:^{
[FUSRouter.userRouter fus_showBindAgentPageWithNeedShowSkipBtn:YES showEnterInviteCodeBtn:NO success:^{
[weakSelf fus_doLoginReadyWithSender:sender];
}];
}else {
......
......@@ -844,7 +844,7 @@
BOOL inBindAgent = [dataDict[@"inBindAgent"] boolValue];
BOOL showBind = FUSConfig.sharedInstanced.devConfigs.appStatus == NO && inBindAgent;
if (showBind) {
[[FUSRouter userRouter] fus_showBindAgentPageWithNeedShowSkipBtn:YES success:^{
[[FUSRouter userRouter] fus_showBindAgentPageWithNeedShowSkipBtn:YES showEnterInviteCodeBtn:NO success:^{
[weakSelf fus_doLoginReady];
}];
}
......
......@@ -63,6 +63,7 @@
_searchTextField.delegate = self;
_searchTextField.textAlignment = NSTextAlignmentLeft;
_searchTextField.textColor = [UIColor fus_textColorRich];
UIFont *strFont = [UIFont fus_themeFont:16];
CGRect strRect = [[NSString fus_localString:@"取消"] boundingRectWithSize:CGSizeMake(0, 0) options:NSStringDrawingUsesFontLeading attributes:[NSDictionary dictionaryWithObjectsAndKeys:strFont, NSFontAttributeName, nil] context:nil];
CGFloat btnWidth = strRect.size.width + 20;
......
......@@ -976,9 +976,10 @@
[self fus_showAwardAnimateWithCurrency:listModel.currency classify:listModel.classify tips:listModel.getTips icon:listModel.icon amount:listModel.award];
}
- (void)fus_showBindAgentPageWithNeedShowSkipBtn:(BOOL)needShowSkipBtn success:(void (^)(void))success{
- (void)fus_showBindAgentPageWithNeedShowSkipBtn:(BOOL)needShowSkipBtn showEnterInviteCodeBtn:(BOOL)showEnterInviteCodeBtn success:(void (^)(void))success{
FUSBindAgentViewController *vc = [[FUSBindAgentViewController alloc] init];
vc.needShowSkipBtn = needShowSkipBtn;
vc.needShowEnterAgentCodeBtn = showEnterInviteCodeBtn;
vc.onClickBackHandle = success;
[UINavigationController.fus_topViewController.navigationController pushViewController:vc animated:YES];
}
......
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