Commit 3b03baed by ludi

提交一下代码

parent 416d4acd
Showing with 395 additions and 32 deletions
//
// FUSGlobalJumpMessageAlertModel.h
// FUSCommon
//
// Created by aaa on 2025/1/3.
//
#import <FUSFoundation/FUSFoundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface FUSJumpContentLanguageModel : FUSBaseModel
/// 语言
@property (nonatomic, copy) NSString *lang;
/// 文案
@property (nonatomic, copy) NSString *content;
@end
@interface FUSGlobalJumpMessageAlertModel : FUSBaseModel
/// 是否有確認按鈕(0:否、1:是)
@property (nonatomic, assign) NSInteger showConfirm;
/// 跳转指令
@property (nonatomic, copy) NSString *jumpurl;
/// 跳转指令所需参数
@property (nonatomic, copy) NSString *jumpparam;
/// 标题
@property (nonatomic, copy) NSArray<FUSJumpContentLanguageModel *> *title;
/// 内容
@property (nonatomic, copy) NSArray<FUSJumpContentLanguageModel *> *content;
/// 确认按钮显示文字
@property (nonatomic, copy) NSArray<FUSJumpContentLanguageModel *> *confirmTxt;
@property (nonatomic, assign) NSInteger cid;
@property (nonatomic, copy) NSString *roomid;
@end
NS_ASSUME_NONNULL_END
//
// FUSGlobalJumpMessageAlertModel.m
// FUSCommon
//
// Created by aaa on 2025/1/3.
//
#import "FUSGlobalJumpMessageAlertModel.h"
#import <FUSCommon/FUSCommon-Swift.h>
@implementation FUSJumpContentLanguageModel
@end
@implementation FUSGlobalJumpMessageAlertModel
- (NSInteger)cid{
return FUSSwiftCacheDataSocketCID.gobalJumpMessageAlert;
}
//嵌套的 model
+ (NSDictionary *)modelContainerPropertyGenericClass {
// return @{@“children”:[CustomModel class]};
return @{@"title": [FUSJumpContentLanguageModel class],
@"content": [FUSJumpContentLanguageModel class],
@"confirmTxt": [FUSJumpContentLanguageModel class]};
}
@end
...@@ -205,7 +205,7 @@ ...@@ -205,7 +205,7 @@
case FUSDevlopLevelTest: case FUSDevlopLevelTest:
[FUSLog setLogLevel:FUSLogLevelAll]; [FUSLog setLogLevel:FUSLogLevelAll];
self.enableTestCode = true; self.enableTestCode = true;
self.enableSocketDebug = false; self.enableSocketDebug = true;
self.enableHttpDebug = true; self.enableHttpDebug = true;
self.enableDBDebug = false; self.enableDBDebug = false;
self.enableEaseMobChange = true; self.enableEaseMobChange = true;
......
...@@ -148,8 +148,9 @@ import RxSwift ...@@ -148,8 +148,9 @@ import RxSwift
func fus_setupSocket(){ func fus_setupSocket(){
//websocket监听背包最新的更新 //websocket监听背包最新的更新
FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.backpackGetTimeNotice) FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.backpackGetTimeNotice)
.subscribe(onNext: {[weak self] model in .mapToDictionary()
let noticeModel = FUSBackpackGetTimeNoticeModel.fus_model(withDict: model.jsonDict) .subscribe(onNext: {[weak self] dataDict in
let noticeModel = FUSBackpackGetTimeNoticeModel.fus_model(withDict: dataDict)
guard let oldModel = self?.backpackUnreadGetTime.value else { return } guard let oldModel = self?.backpackUnreadGetTime.value else { return }
oldModel.fus_setBackpackGetTime(noticeModel.getTime, index: noticeModel.type) oldModel.fus_setBackpackGetTime(noticeModel.getTime, index: noticeModel.type)
self?.backpackUnreadGetTime.accept(oldModel) self?.backpackUnreadGetTime.accept(oldModel)
...@@ -163,12 +164,36 @@ import RxSwift ...@@ -163,12 +164,36 @@ import RxSwift
//websocket监听(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能 //websocket监听(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能
FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.backpackGetCarExperienceCardNotice) FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.backpackGetCarExperienceCardNotice)
.subscribe(onNext: {[weak self] model in .mapToDictionary()
.subscribe(onNext: {[weak self] dataDict in
let gidStr = model.jsonDict.fus_stringValue(key: "gid") let gidStr = dataDict.fus_stringValue(key: "gid")
self?.useCarTipsShouldShowGet.accept(gidStr) self?.useCarTipsShouldShowGet.accept(gidStr)
}) })
.disposed(by: disposeBag) .disposed(by: disposeBag)
/// 全局弹窗
FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.gobalJumpMessageAlert)
.mapToModel(FUSGlobalJumpMessageAlertModel.self)
.subscribe(onNext: { model in
var cancelText: String = .fus_versionLocalString("确定")
var otherTexts: [String]? = nil
if let otherText = model.confirmTxt.fus_getLanguageContent(),
model.showConfirm == 1{
otherTexts = [otherText]
cancelText = .fus_versionLocalString("取消")
}
FUSAlertView.showAlert(withTitle: model.title.fus_getLanguageContent() ?? "", message: model.content.fus_getLanguageContent() ?? "", cancelButtonTitle: cancelText, otherButtonTitles: otherTexts) { clickIndex in
if clickIndex == 1 {
FUSRouter.userRouter().fus_handleTaskJumpAction(withJumpType: model.jumpurl, tid: 0, url: model.jumpparam) {
}
}
}
})
.disposed(by: disposeBag)
} }
// - function // - function
...@@ -227,11 +252,13 @@ import RxSwift ...@@ -227,11 +252,13 @@ import RxSwift
} }
} }
/// 通知cid /// 通知cid
class FUSSwiftCacheDataSocketCID: NSObject { @objcMembers public class FUSSwiftCacheDataSocketCID: NSObject {
///背包更新的通知 ///背包更新的通知
public static let backpackGetTimeNotice: Int = 2999 public static let backpackGetTimeNotice: Int = 2999
/// socket:2051(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能 /// socket:2051(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能
public static let backpackGetCarExperienceCardNotice: Int = 2051 public static let backpackGetCarExperienceCardNotice: Int = 2051
/// 全局提示跳转弹出框
@objc public static let gobalJumpMessageAlert: Int = 2222
} }
/// 本地存储的key /// 本地存储的key
class FUSSwiftCacheDataStoreKey{ class FUSSwiftCacheDataStoreKey{
......
...@@ -25,3 +25,47 @@ public class FUSSwiftSocketHelper: NSObject { ...@@ -25,3 +25,47 @@ public class FUSSwiftSocketHelper: NSObject {
}) })
} }
} }
extension Observable where Element == FUSSocketMessageModel {
/// 转化成字典
/// - Returns: 字典的observer
public func mapToDictionary() -> Observable<[AnyHashable: Any]> {
return map({ model in
return model.jsonDict
})
}
/// 转化为对应模型
/// - Parameter type: 类型
/// - Returns: 返回
public func mapToModel<T: FUSBaseModel>(_ type: T.Type) -> Observable<T>{
return map({ model in
return T.fus_model(withDict: model.jsonDict)
})
}
}
extension Array where Element: FUSJumpContentLanguageModel {
/// 寻找当前选择语言对应的文案
func fus_getLanguageContent() -> String? {
if self.count <= 0 {
return nil
}
let userLang = FUSLocalizationHelper.fus_currentLanguage().languageID ?? "1"
var englishContent: String? = nil
for model in self {
if model.lang == "1" {
englishContent = model.content
}
if model.lang == userLang {
return model.content
}
}
return englishContent
}
}
...@@ -252,6 +252,18 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -252,6 +252,18 @@ NS_ASSUME_NONNULL_BEGIN
action:(void(^)(void))actionBlock action:(void(^)(void))actionBlock
close:(void(^)(void))closeBlock; close:(void(^)(void))closeBlock;
/// 全局跳转
/// @param jumpType 跳转类型
/// @param tid tid
/// @param url 跳转url
/// @param success 成功
-(void)fus_handleTaskJumpActionWithJumpType:(NSString *)jumpType
tid:(NSInteger)tid
url:(NSString *)url
success:(void(^)(void))success;
/// 获取当前正在直播的热力值排名第一的直播间
-(void)fus_getCurrentLiveroomFirstHotWithTid:(NSInteger)tid;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END
...@@ -303,6 +303,7 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image); ...@@ -303,6 +303,7 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
if (canOpen) { if (canOpen) {
mImagePicker.allowsEditing = NO; mImagePicker.allowsEditing = NO;
mImagePicker.sourceType = type; mImagePicker.sourceType = type;
mImagePicker.modalPresentationStyle = UIModalPresentationFullScreen;
[mViewCtrl presentViewController:mImagePicker animated:YES completion:nil]; [mViewCtrl presentViewController:mImagePicker animated:YES completion:nil];
} }
} }
...@@ -370,7 +371,10 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image); ...@@ -370,7 +371,10 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
FUSRotationCropperImageViewController *imageCropVC = [[FUSRotationCropperImageViewController alloc] initWithImage:originImage maxScaleRatio:3.0]; FUSRotationCropperImageViewController *imageCropVC = [[FUSRotationCropperImageViewController alloc] initWithImage:originImage maxScaleRatio:3.0];
imageCropVC.delegate = self; imageCropVC.delegate = self;
[mViewCtrl presentModalViewController:imageCropVC animated:YES]; imageCropVC.modalPresentationStyle = UIModalPresentationFullScreen;
[mViewCtrl presentViewController:imageCropVC animated:YES completion:^{
}];
return; return;
} }
......
...@@ -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>73</integer> <integer>74</integer>
</dict> </dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key> <key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>77</integer> <integer>72</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>76</integer> <integer>77</integer>
</dict> </dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key> <key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>72</integer> <integer>75</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -7,12 +7,12 @@ ...@@ -7,12 +7,12 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key> <key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>74</integer> <integer>73</integer>
</dict> </dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key> <key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict> <dict>
<key>orderHint</key> <key>orderHint</key>
<integer>75</integer> <integer>76</integer>
</dict> </dict>
</dict> </dict>
</dict> </dict>
......
...@@ -40,7 +40,7 @@ class FUSCompleteUserInfoSignView: FUSBaseView { ...@@ -40,7 +40,7 @@ class FUSCompleteUserInfoSignView: FUSBaseView {
} }
let signBgView = UIView() let signBgView = UIView()
signBgView.backgroundColor = .white.withAlphaComponent(0.1) signBgView.backgroundColor = .fus_textInputBackgroundGray()
signBgView.layer.cornerRadius = 8 signBgView.layer.cornerRadius = 8
self.addSubview(signBgView) self.addSubview(signBgView)
signBgView.snp.makeConstraints { make in signBgView.snp.makeConstraints { make in
......
...@@ -25,6 +25,9 @@ ...@@ -25,6 +25,9 @@
@interface FUSNoticeSettingViewController () @interface FUSNoticeSettingViewController ()
/// 通知的信息组
@property (nonatomic, strong) FUSCustomSettingGroup *msgGroup;
// 亲密私信消息通知 // 亲密私信消息通知
@property (nonatomic, strong) FUSCustomSettingItem *intimateItem; @property (nonatomic, strong) FUSCustomSettingItem *intimateItem;
// 其他私信消息通知 // 其他私信消息通知
...@@ -204,7 +207,7 @@ ...@@ -204,7 +207,7 @@
{ {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
FUSCustomSettingGroup *msgGroup = [self fus_createGroups]; self.msgGroup = [self fus_createGroups];
self.intimateItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_versionLocalString:@"亲密私信"] type:CustomSettingItemTypeSwitch]; self.intimateItem = [FUSCustomSettingItem fus_itemWithTitle:[NSString fus_versionLocalString:@"亲密私信"] type:CustomSettingItemTypeSwitch];
self.intimateItem.cellStyle = UITableViewCellStyleSubtitle; self.intimateItem.cellStyle = UITableViewCellStyleSubtitle;
...@@ -243,9 +246,9 @@ ...@@ -243,9 +246,9 @@
[weakSelf.tableView reloadData]; [weakSelf.tableView reloadData];
}]; }];
}; };
msgGroup.items = @[self.intimateItem,self.messageNoticeItem]; self.msgGroup.items = @[self.intimateItem,self.messageNoticeItem];
[self.allGroups addObject:msgGroup]; [self.allGroups addObject:self.msgGroup];
FUSCustomSettingGroup *otherGroup = [self fus_createGroups]; FUSCustomSettingGroup *otherGroup = [self fus_createGroups];
...@@ -374,6 +377,12 @@ ...@@ -374,6 +377,12 @@
if ([UIApplication sharedApplication].currentUserNotificationSettings.types == UIUserNotificationTypeNone) { if ([UIApplication sharedApplication].currentUserNotificationSettings.types == UIUserNotificationTypeNone) {
UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, 46)]; UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, 46)];
headerView.backgroundColor = [UIColor fus_textInputBackgroundGrayColor];
UIImageView *bellView = [[UIImageView alloc] initWithImage:[[FUSUserCenterBunble imageNamed:@"setting_bell"] fus_tintImageWithColor:[UIColor fus_textColorMedium]]];
bellView.frame = CGRectMake(16, 0, 18, 18);
[headerView addSubview:bellView];
UILabel *titleLabel = [[UILabel alloc] init]; UILabel *titleLabel = [[UILabel alloc] init];
titleLabel.text = [NSString fus_localString:@"通知权限已关闭,无法接收通知"]; titleLabel.text = [NSString fus_localString:@"通知权限已关闭,无法接收通知"];
titleLabel.font = [UIFont fus_themeFont:15]; titleLabel.font = [UIFont fus_themeFont:15];
...@@ -383,33 +392,41 @@ ...@@ -383,33 +392,41 @@
[headerView addSubview:titleLabel]; [headerView addSubview:titleLabel];
UIButton *settingBtn = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton *settingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[settingBtn setTitle:[NSString fus_localString:@"去开启"] forState:UIControlStateNormal]; [settingBtn setTitle:[NSString stringWithFormat:@" %@ ",[NSString fus_localString:@"去开启"]] forState:UIControlStateNormal];
settingBtn.titleLabel.font = [UIFont fus_themeFont:15]; settingBtn.titleLabel.font = [UIFont fus_themeFont:13];
[settingBtn setTitleColor:[UIColor fus_themeColor] forState:UIControlStateNormal]; [settingBtn setTitleColor:[UIColor fus_textColorRich] forState:UIControlStateNormal];
settingBtn.backgroundColor = [UIColor fus_themeColor];
settingBtn.layer.cornerRadius = 34 / 2.0f;
settingBtn.layer.masksToBounds = YES;
[settingBtn sizeToFit]; [settingBtn sizeToFit];
[settingBtn addTarget:self action:@selector(clickSettingNoticeBtnAction:) forControlEvents:UIControlEventTouchUpInside]; [settingBtn addTarget:self action:@selector(clickSettingNoticeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[headerView addSubview:settingBtn]; [headerView addSubview:settingBtn];
titleLabel.x = 16; titleLabel.x = 10 + CGRectGetMaxX(bellView.frame);
settingBtn.x = headerView.width - settingBtn.width - 16; settingBtn.x = headerView.width - settingBtn.width - 16;
settingBtn.height = 32;
if (titleLabel.right > UIView.fus_screenW - settingBtn.x - 8) { if (titleLabel.right > settingBtn.x - 8) {
titleLabel.width = settingBtn.x - 8 - titleLabel.x; titleLabel.width = settingBtn.x - 8 - titleLabel.x;
headerView.height = 70; headerView.height = 70;
titleLabel.height = headerView.height; titleLabel.height = headerView.height;
} }
settingBtn.centerY = titleLabel.centerY; settingBtn.centerY = headerView.height / 2.0f;
titleLabel.centerY = headerView.height / 2.0f; titleLabel.centerY = headerView.height / 2.0f;
bellView.centerY = headerView.height / 2.0f;
UIView *line = [[UIView alloc] initWithFrame:CGRectMake(16, headerView.height - 0.5, headerView.width - 32, 0.5)]; // UIView *line = [[UIView alloc] initWithFrame:CGRectMake(16, headerView.height - 0.5, headerView.width - 32, 0.5)];
line.backgroundColor = [UIColor fus_lineColor]; // line.backgroundColor = [UIColor fus_lineColor];
[headerView addSubview:line]; // [headerView addSubview:line];
self.tableView.tableHeaderView = headerView; self.tableView.tableHeaderView = headerView;
self.msgGroup.groupHeaderHeight = 0;
} else { } else {
self.tableView.tableHeaderView = nil; self.tableView.tableHeaderView = nil;
self.msgGroup.groupHeaderHeight = 12;
} }
[self.tableView reloadData];
} }
- (void)clickSettingNoticeBtnAction:(UIButton *)button { - (void)clickSettingNoticeBtnAction:(UIButton *)button {
......
...@@ -13,6 +13,9 @@ import FUSCommon ...@@ -13,6 +13,9 @@ import FUSCommon
@objcMembers public class FUSZoneUserInfoEditViewController: FUSBaseViewController, UITextViewDelegate, UITextFieldDelegate { @objcMembers public class FUSZoneUserInfoEditViewController: FUSBaseViewController, UITextViewDelegate, UITextFieldDelegate {
/// 进来的时候点击什么,0=改头像,2=改名
@objc public var preClicked: Int = -1
/// 可滑动的内容view /// 可滑动的内容view
@IBOutlet var scrollView: UIScrollView! @IBOutlet var scrollView: UIScrollView!
...@@ -149,6 +152,16 @@ import FUSCommon ...@@ -149,6 +152,16 @@ import FUSCommon
self.fus_requestUserAuthState() self.fus_requestUserAuthState()
} }
public override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if self.preClicked == 0 {
self.fus_onclickFaceImageBtnAction(.init())
}
else if self.preClicked == 2 {
self.fus_beginEditUserNickname()
}
}
deinit { deinit {
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
} }
......
...@@ -28,7 +28,7 @@ class FUSBackpackPropsUseAlert: FUSBaseView { ...@@ -28,7 +28,7 @@ class FUSBackpackPropsUseAlert: FUSBaseView {
override func makeUI() { override func makeUI() {
super.makeUI() super.makeUI()
self.backgroundColor = .clear self.backgroundColor = .fus_alertViewBackground()
self.contentView.backgroundColor = .white self.contentView.backgroundColor = .white
self.contentView.layer.cornerRadius = 14 self.contentView.layer.cornerRadius = 14
......
...@@ -340,11 +340,9 @@ import RxCocoa ...@@ -340,11 +340,9 @@ import RxCocoa
FUSRouter.live().fus_enterLiveRoom(roomId) FUSRouter.live().fus_enterLiveRoom(roomId)
} }
case "yazhai://_version_update": case "yazhai://_version_update":
//TODO: 版本检测,应该是在settingview那块的,到时候看看有没有 let vc = FUSVerifyVersionController()
// if let vc = Bifrost.handleURL(PersonalPageRoute.verifyVersionVC) as? UIViewController { vc.hidesBottomBarWhenPushed = true
// vc.hidesBottomBarWhenPushed = true UIViewController.fus_top().navigationController?.pushViewController(vc, animated: true)
// UIViewController.topViewController()?.navigationController?.pushViewController(vc, animated: true)
// }
break break
default: default:
break break
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#import "FUSThirdPartyLoginHelper.h" #import "FUSThirdPartyLoginHelper.h"
#import "FUSRecieveNotificationHelper.h" #import "FUSRecieveNotificationHelper.h"
#import "FUSGotBackpackItemAnimView.h" #import "FUSGotBackpackItemAnimView.h"
#import <FirebaseAnalytics/FirebaseAnalytics.h>
#import "FUSUserCenterModule/FUSUserCenterModule-Swift.h" #import "FUSUserCenterModule/FUSUserCenterModule-Swift.h"
...@@ -696,4 +697,177 @@ ...@@ -696,4 +697,177 @@
- (UIView *)fus_getNotificationSettingViewWithNID:(NSString *)nID title:(NSAttributedString *)title subTitle:(NSString *)subTitle action:(void (^)(void))actionBlock close:(void (^)(void))closeBlock{ - (UIView *)fus_getNotificationSettingViewWithNID:(NSString *)nID title:(NSAttributedString *)title subTitle:(NSString *)subTitle action:(void (^)(void))actionBlock close:(void (^)(void))closeBlock{
return [FUSNotificationBannerTipsView fus_createWithNID:nID title:title subTitle:subTitle actionHandler:actionBlock closeHandler:closeBlock]; return [FUSNotificationBannerTipsView fus_createWithNID:nID title:title subTitle:subTitle actionHandler:actionBlock closeHandler:closeBlock];
} }
- (void)fus_handleTaskJumpActionWithJumpType:(NSString *)jumpType tid:(NSInteger)tid url:(NSString *)url success:(void (^)(void))success{
if ([jumpType isEqualToString:@"yazhai://_bind_phone"]) {
FUSPhoneAuthViewController *phoneBindingVc = [[FUSPhoneAuthViewController alloc]init];
phoneBindingVc.phoneBindingSuccessBlock = ^{
};
[[UIViewController fus_topViewController].navigationController pushViewController:phoneBindingVc animated:YES];
} else if ([jumpType isEqualToString:@"yazhai://_account_set"]) {
FUSSettingViewController *settingVC = [[FUSSettingViewController alloc] init];
[[UIViewController fus_topViewController].navigationController pushViewController:settingVC animated:YES];
} else if ([jumpType isEqualToString:@"yazhai://_live_started"]) {
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_ME_TASKCENTER_TOCOMPLETE label:@"" parameters:@{@"taskid":@(tid)}];
[FUSRouter.liveRouter fus_pushLive];
} else if ([jumpType isEqualToString:@"yazhai://_room_share_panel"]
|| [jumpType isEqualToString:@"yazhai://_room_share"]
|| [jumpType isEqualToString:@"yazhai://_send_specify_gift"]
|| [jumpType isEqualToString:@"yazhai://_room_chat"]
|| [jumpType isEqualToString:@"yazhai://_room_chip"]
|| [jumpType isEqualToString:@"yazhai://_room_gift_panel"]
|| [jumpType isEqualToString:@"yazhai://_jump_room"]
|| [jumpType isEqualToString:@"yazhai://_room_chat_panel"]) {
[FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_ME_TASKCENTER_TOCOMPLETE label:@"" parameters:@{@"taskid":@(tid)}];
[self fus_getCurrentLiveroomFirstHotWithTid:tid];
} else if ([jumpType isEqualToString:@"yazhai://_invite_h5_share"]) {
// [FUSTalkingData fus_trackEvent:FUSUserEventTrackParams.fus_EVENT_ME_TASKCENTER_TOCOMPLETE label:@"" parameters:@{@"taskid":@(tid)}];
FUSWKWebViewController *wkwVC = [[FUSWKWebViewController alloc] init];
wkwVC.shouldShowShareBtn = NO;
wkwVC.shouldIncludeIdentifyInfo = YES;
wkwVC.webUrlString = FUSCommonWebURLs.fus_agentInviteShare;
[[UIViewController fus_topViewController].navigationController pushViewController:wkwVC animated:YES];
} else if ([jumpType isEqualToString:@"yazhai://_bind_invitecode"]) {
// Mediator.Statistic?.track(eventId: "me_taskcenter_tocomplete", value: 0, params: ["taskid":String(tid)])
FUSBoundAgentInfoView *agentView = [[FUSBoundAgentInfoView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenH)];
agentView.bindingInvitationCodeSuccessBlock = ^{
success();
};
agentView.leftTime = [self fus_calculateBoundAgentInfoLeftTime];
[agentView showWithView:[UIWindow fus_keyWindow]];
} else if ([jumpType isEqualToString:@"yazhai://_check_in"]) {
[self fus_getDailyCheckInData];
} else if ([jumpType isEqualToString:@"yazhai://_jump_url"]) {
FUSWKWebViewController *wkwVC = [[FUSWKWebViewController alloc] init];
wkwVC.webUrlString = url;
wkwVC.shouldIncludeIdentifyInfo = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:wkwVC animated:YES];
} else if ([jumpType isEqualToString:@"yazhai://_app_share"]) {
[self fus_requestShareContent:[NSString stringWithFormat:@"%ld",tid]];
} else if ([jumpType isEqualToString:@"yazhai://_room_recharge"]) {
[FUSRechargeViewController fus_showRechargeViewControllerForRootVC:[UIViewController fus_topViewController]];
} else if ([jumpType isEqualToString:@"yazhai://_app_store_review"]) {
// 请求接口
[FUSHttpHelper postRequestBinaryWithUrl:FUSUserCenterURLs.fus_URL_UPDATE_REVIEW params:nil success:nil failure:nil];
NSURL *itunesStoreUrl = nil;
if (@available(iOS 11.0, *)) {
itunesStoreUrl = [NSURL URLWithString:[NSString stringWithFormat:@"itms-apps://itunes.apple.com/cn/app/id%@?mt=8&action=write-review",FUSConfig.sharedInstanced.appConfigs.appId]];
}else{
itunesStoreUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=%@&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8",FUSConfig.sharedInstanced.appConfigs.appId]];
}
if ([[UIApplication sharedApplication] canOpenURL:itunesStoreUrl]) {
[[UIApplication sharedApplication] openURL:itunesStoreUrl];
success();
}
} else if ([jumpType isEqualToString:@"yazhai://_jump_group"]) {
// fans group 好像还没有
} else if([jumpType isEqualToString:@"yazhai://_user_face_rename"]) {
FUSZoneUserInfoEditViewController *vc = [[FUSZoneUserInfoEditViewController alloc] init];
vc.preClicked = 0;
vc.hidesBottomBarWhenPushed = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:vc animated:YES];
}else if ([jumpType isEqualToString:@"yazhai://_user_info_edit"]) {
FUSZoneUserInfoEditViewController *vc = [[FUSZoneUserInfoEditViewController alloc] init];
vc.hidesBottomBarWhenPushed = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:vc animated:YES];
}else if ([jumpType isEqualToString:@"yazhai://_user_rename"]) {
FUSZoneUserInfoEditViewController *vc = [[FUSZoneUserInfoEditViewController alloc] init];
vc.preClicked = 2;
vc.hidesBottomBarWhenPushed = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:vc animated:YES];
}else if ([jumpType isEqualToString:@"yazhai://_customer_service"]) {
UIViewController *vc = [FUSRouter.chatRouter fus_controllerPushToServiceControllerWithUID:nil face:nil nikename:nil welcome:nil animate:YES];
}else if ([jumpType isEqualToString:@"yazhai://_into_club_list"]) {
// club 没有
} else if ([jumpType isEqualToString:@"yazhai://_version_update"]) {
FUSVerifyVersionController *vc = [[FUSVerifyVersionController alloc] init];
vc.hidesBottomBarWhenPushed = YES;
[[UIViewController fus_topViewController].navigationController pushViewController:vc animated:YES];
}
}
// 获取执行任务相关数据
- (void)fus_requestShareContent:(NSString *)tid {
[FUSZoneHttpRequest fus_taskGetDataTid:tid Success:^(NSDictionary *dataDic) {
FUSWebShareView *shareView = [[FUSWebShareView alloc] initWithFrame:CGRectMake(0, 0, UIView.fus_screenW, UIView.fus_screenH - UIView.fus_StatusBarAndNavgationBarHeight) from:FUSFromMission];
UIViewController *showViewController = [UIViewController fus_topViewController];
[showViewController.view addSubview:shareView];
NSString *imgStr = [FUSConfig.sharedInstanced.pathConfigs webImagePath:dataDic[@"shareConfig"][@"img"]];
[shareView fus_showShareViewWithViewController:showViewController title:dataDic[@"shareConfig"][@"title"] content:dataDic[@"shareConfig"][@"content"] imageOrUrl:[imgStr stringByReplacingOccurrencesOfString:@"/com" withString:@""] shareUrl: [FUSConfig.sharedInstanced.pathConfigs webUrl:dataDic[@"shareConfig"][@"href"]] from:FUSFromMission shareType:FUSShareTypeWebUrl success:^{
} failure:nil];
shareView.dismissWhenClick = NO;
[shareView setDismissHandler:^{
}];
} failure:^(NSString *msg, int code) {
}];
}
- (CGFloat)fus_calculateBoundAgentInfoLeftTime {
NSDictionary *infoDic = [[NSUserDefaults standardUserDefaults] objectForKey:BOUND_AGENT_INFO];
NSString *lastTimeString= infoDic[@"getResultDate"];
NSDateFormatter *lastFormat = [[NSDateFormatter alloc] init];
lastFormat.dateFormat = @"YYYY-MM-dd HH:mm";
NSDate *lastDate = [lastFormat dateFromString:lastTimeString];
NSDate *nowDate = [NSDate date];
NSTimeZone *timeZone = [NSTimeZone systemTimeZone];
//上次时间
lastDate = [lastDate dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:lastDate]];
//当前时间
nowDate = [nowDate dateByAddingTimeInterval:[timeZone secondsFromGMTForDate:nowDate]];
//时间间隔
NSInteger intevalTime = [nowDate timeIntervalSinceReferenceDate] - [lastDate timeIntervalSinceReferenceDate];
// 计算剩余时间
CGFloat leftTime = [infoDic[@"bindagenttime"] floatValue] * 60 - intevalTime / 10;
return leftTime;
}
- (void)fus_getCurrentLiveroomFirstHotWithTid:(NSInteger)tid{
[FUSZoneHttpRequest fus_completeTaskEnterRoomTaskTid:[NSString stringWithFormat:@"%ld",(long)tid] Success:^(NSDictionary *dataDic, int code) {
FUSRoomInfoModel *roomModel = [[FUSRoomInfoModel alloc]init];
roomModel.roomId = [NSString stringWithFormat:@"%@",dataDic[@"roomid"]];
if (roomModel.roomId.intValue == 0) {
return;
}
[FUSRouter.liveRouter fus_enterLiveRoomWithModel:roomModel];
// Firebase 统计
[FIRAnalytics logEventWithName:@"enterroom" parameters:@{@"source":@"other",
@"useruid":[FUSCacheDataShare shareStore].userDetailInfo.uid,
@"broadcasteruid":roomModel.roomId}];
} failure:^(NSString *msg, int code) {
[FUSDialogView fus_showDialog:msg];
}];
}
@end @end
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
#import "FUSCallTimeIncomeModel.h" #import "FUSCallTimeIncomeModel.h"
#import "FUSChatUserInfosModel.h" #import "FUSChatUserInfosModel.h"
#import "FUSExpressionDataModel.h" #import "FUSExpressionDataModel.h"
#import "FUSGlobalJumpMessageAlertModel.h"
#import "FUSHotDataMD5Model.h" #import "FUSHotDataMD5Model.h"
#import "FUSLevelDataModel.h" #import "FUSLevelDataModel.h"
#import "FUSLiveStartConfigModel.h" #import "FUSLiveStartConfigModel.h"
......
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