Commit 3b03baed by ludi

提交一下代码

parent 416d4acd
Showing with 221 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 @@
case FUSDevlopLevelTest:
[FUSLog setLogLevel:FUSLogLevelAll];
self.enableTestCode = true;
self.enableSocketDebug = false;
self.enableSocketDebug = true;
self.enableHttpDebug = true;
self.enableDBDebug = false;
self.enableEaseMobChange = true;
......
......@@ -148,8 +148,9 @@ import RxSwift
func fus_setupSocket(){
//websocket监听背包最新的更新
FUSSwiftSocketHelper.listenTo(cid: FUSSwiftCacheDataSocketCID.backpackGetTimeNotice)
.subscribe(onNext: {[weak self] model in
let noticeModel = FUSBackpackGetTimeNoticeModel.fus_model(withDict: model.jsonDict)
.mapToDictionary()
.subscribe(onNext: {[weak self] dataDict in
let noticeModel = FUSBackpackGetTimeNoticeModel.fus_model(withDict: dataDict)
guard let oldModel = self?.backpackUnreadGetTime.value else { return }
oldModel.fus_setBackpackGetTime(noticeModel.getTime, index: noticeModel.type)
self?.backpackUnreadGetTime.accept(oldModel)
......@@ -163,12 +164,36 @@ import RxSwift
//websocket监听(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能
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)
})
.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
......@@ -227,11 +252,13 @@ import RxSwift
}
}
/// 通知cid
class FUSSwiftCacheDataSocketCID: NSObject {
@objcMembers public class FUSSwiftCacheDataSocketCID: NSObject {
///背包更新的通知
public static let backpackGetTimeNotice: Int = 2999
/// socket:2051(获得道具-座驾体验卡) 接收到此消息验证是否需要弹出座驾提醒功能
public static let backpackGetCarExperienceCardNotice: Int = 2051
/// 全局提示跳转弹出框
@objc public static let gobalJumpMessageAlert: Int = 2222
}
/// 本地存储的key
class FUSSwiftCacheDataStoreKey{
......
......@@ -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
action:(void(^)(void))actionBlock
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
NS_ASSUME_NONNULL_END
......@@ -303,6 +303,7 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
if (canOpen) {
mImagePicker.allowsEditing = NO;
mImagePicker.sourceType = type;
mImagePicker.modalPresentationStyle = UIModalPresentationFullScreen;
[mViewCtrl presentViewController:mImagePicker animated:YES completion:nil];
}
}
......@@ -370,7 +371,10 @@ typedef void(^Block)(BOOL isSuccess, UIImage *image);
FUSRotationCropperImageViewController *imageCropVC = [[FUSRotationCropperImageViewController alloc] initWithImage:originImage maxScaleRatio:3.0];
imageCropVC.delegate = self;
[mViewCtrl presentModalViewController:imageCropVC animated:YES];
imageCropVC.modalPresentationStyle = UIModalPresentationFullScreen;
[mViewCtrl presentViewController:imageCropVC animated:YES completion:^{
}];
return;
}
......
......@@ -7,12 +7,12 @@
<key>FUSChatCenterBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>73</integer>
<integer>74</integer>
</dict>
<key>FUSChatCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>77</integer>
<integer>72</integer>
</dict>
</dict>
</dict>
......
......@@ -7,12 +7,12 @@
<key>FUSShowRoomBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>76</integer>
<integer>77</integer>
</dict>
<key>FUSShowRoomModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>72</integer>
<integer>75</integer>
</dict>
</dict>
</dict>
......
......@@ -7,12 +7,12 @@
<key>FUSUserCenterModule.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>74</integer>
<integer>73</integer>
</dict>
<key>FUSUserCenterModuleBundle.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>75</integer>
<integer>76</integer>
</dict>
</dict>
</dict>
......
......@@ -40,7 +40,7 @@ class FUSCompleteUserInfoSignView: FUSBaseView {
}
let signBgView = UIView()
signBgView.backgroundColor = .white.withAlphaComponent(0.1)
signBgView.backgroundColor = .fus_textInputBackgroundGray()
signBgView.layer.cornerRadius = 8
self.addSubview(signBgView)
signBgView.snp.makeConstraints { make in
......
......@@ -25,6 +25,9 @@
@interface FUSNoticeSettingViewController ()
/// 通知的信息组
@property (nonatomic, strong) FUSCustomSettingGroup *msgGroup;
// 亲密私信消息通知
@property (nonatomic, strong) FUSCustomSettingItem *intimateItem;
// 其他私信消息通知
......@@ -204,7 +207,7 @@
{
__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.cellStyle = UITableViewCellStyleSubtitle;
......@@ -243,9 +246,9 @@
[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];
......@@ -374,6 +377,12 @@
if ([UIApplication sharedApplication].currentUserNotificationSettings.types == UIUserNotificationTypeNone) {
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];
titleLabel.text = [NSString fus_localString:@"通知权限已关闭,无法接收通知"];
titleLabel.font = [UIFont fus_themeFont:15];
......@@ -383,33 +392,41 @@
[headerView addSubview:titleLabel];
UIButton *settingBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[settingBtn setTitle:[NSString fus_localString:@"去开启"] forState:UIControlStateNormal];
settingBtn.titleLabel.font = [UIFont fus_themeFont:15];
[settingBtn setTitleColor:[UIColor fus_themeColor] forState:UIControlStateNormal];
[settingBtn setTitle:[NSString stringWithFormat:@" %@ ",[NSString fus_localString:@"去开启"]] forState:UIControlStateNormal];
settingBtn.titleLabel.font = [UIFont fus_themeFont:13];
[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 addTarget:self action:@selector(clickSettingNoticeBtnAction:) forControlEvents:UIControlEventTouchUpInside];
[headerView addSubview:settingBtn];
titleLabel.x = 16;
titleLabel.x = 10 + CGRectGetMaxX(bellView.frame);
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;
headerView.height = 70;
titleLabel.height = headerView.height;
}
settingBtn.centerY = titleLabel.centerY;
settingBtn.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)];
line.backgroundColor = [UIColor fus_lineColor];
[headerView addSubview:line];
// UIView *line = [[UIView alloc] initWithFrame:CGRectMake(16, headerView.height - 0.5, headerView.width - 32, 0.5)];
// line.backgroundColor = [UIColor fus_lineColor];
// [headerView addSubview:line];
self.tableView.tableHeaderView = headerView;
self.msgGroup.groupHeaderHeight = 0;
} else {
self.tableView.tableHeaderView = nil;
self.msgGroup.groupHeaderHeight = 12;
}
[self.tableView reloadData];
}
- (void)clickSettingNoticeBtnAction:(UIButton *)button {
......
......@@ -13,6 +13,9 @@ import FUSCommon
@objcMembers public class FUSZoneUserInfoEditViewController: FUSBaseViewController, UITextViewDelegate, UITextFieldDelegate {
/// 进来的时候点击什么,0=改头像,2=改名
@objc public var preClicked: Int = -1
/// 可滑动的内容view
@IBOutlet var scrollView: UIScrollView!
......@@ -149,6 +152,16 @@ import FUSCommon
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 {
NotificationCenter.default.removeObserver(self)
}
......
......@@ -28,7 +28,7 @@ class FUSBackpackPropsUseAlert: FUSBaseView {
override func makeUI() {
super.makeUI()
self.backgroundColor = .clear
self.backgroundColor = .fus_alertViewBackground()
self.contentView.backgroundColor = .white
self.contentView.layer.cornerRadius = 14
......
......@@ -340,11 +340,9 @@ import RxCocoa
FUSRouter.live().fus_enterLiveRoom(roomId)
}
case "yazhai://_version_update":
//TODO: 版本检测,应该是在settingview那块的,到时候看看有没有
// if let vc = Bifrost.handleURL(PersonalPageRoute.verifyVersionVC) as? UIViewController {
// vc.hidesBottomBarWhenPushed = true
// UIViewController.topViewController()?.navigationController?.pushViewController(vc, animated: true)
// }
let vc = FUSVerifyVersionController()
vc.hidesBottomBarWhenPushed = true
UIViewController.fus_top().navigationController?.pushViewController(vc, animated: true)
break
default:
break
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -63,6 +63,7 @@
#import "FUSCallTimeIncomeModel.h"
#import "FUSChatUserInfosModel.h"
#import "FUSExpressionDataModel.h"
#import "FUSGlobalJumpMessageAlertModel.h"
#import "FUSHotDataMD5Model.h"
#import "FUSLevelDataModel.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