Commit 4ca62a62 cgx

拍照页面问题梳理

1 个父辈 0fb14af2
...@@ -9,15 +9,17 @@ ...@@ -9,15 +9,17 @@
/** /**
导航控制器风格 导航控制器风格
- NaviStyleDefault: 默认 - NaviStyleDefault : 默认
- NaviStyleLight : Light - NaviStyleLight : Light
- NaviStyleDark : Dark - NaviStyleDark : Dark
- NaviStylePicker : 系统拍照
- NaviStyleUndef:未定义 - NaviStyleUndef:未定义
*/ */
typedef NS_ENUM(NSUInteger, NaviStyle) { typedef NS_ENUM(NSUInteger, NaviStyle) {
NaviStyleDefault, NaviStyleDefault,
NaviStyleLight, NaviStyleLight,
NaviStyleDark, NaviStyleDark,
NaviStylePicker,
NaviStyleUndef NaviStyleUndef
}; };
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "UIViewController+Swizzling.h" #import "UIViewController+Swizzling.h"
#import "BaseNaviController.h" #import "BaseNaviController.h"
#import <objc/runtime.h> #import <objc/runtime.h>
#import "JWMImagePickerController.h"
@implementation UIViewController (Swizzling) @implementation UIViewController (Swizzling)
...@@ -52,6 +53,13 @@ ...@@ -52,6 +53,13 @@
self.navigationController.navigationBarHidden = ([self respondsToSelector:@selector(isShowNavigationBar)] && [self isShowNavigationBar] == YES) ? YES : NO; self.navigationController.navigationBarHidden = ([self respondsToSelector:@selector(isShowNavigationBar)] && [self isShowNavigationBar] == YES) ? YES : NO;
#pragma mark - 根据不同页面设置不同的导航栏风格 #pragma mark - 根据不同页面设置不同的导航栏风格
NSString *className = NSStringFromClass([self class]);
NSArray *classArrary = @[@"JWMImagePickerController",
@"CAMImagePickerCameraViewController", @"CAMViewfinderViewController", @"CAMPreviewViewController",
@"UIInputWindowController", @"UIEditingOverlayViewController", @"PUPhotoPickerHostViewController",
@"PLPhotoTileViewController"];
// 排除系统相机和相册
if (![classArrary containsObject:className]) {
if ([self respondsToSelector:@selector(navigationBarStyle)]) { if ([self respondsToSelector:@selector(navigationBarStyle)]) {
[BaseNaviController setNavigationBarStyle:[self navigationBarStyle] vc:self]; [BaseNaviController setNavigationBarStyle:[self navigationBarStyle] vc:self];
} else { } else {
...@@ -60,6 +68,7 @@ ...@@ -60,6 +68,7 @@
[BaseNaviController setNavigationBarStyle:NaviStyleDefault vc:self]; [BaseNaviController setNavigationBarStyle:NaviStyleDefault vc:self];
} }
} }
}
#pragma mark - 处理用户打开自动切换主题按钮,根据设定好的时间段进行主题切换 #pragma mark - 处理用户打开自动切换主题按钮,根据设定好的时间段进行主题切换
if (kGetUserDefaultsBOOL(ThemeAutoSwitch)) { if (kGetUserDefaultsBOOL(ThemeAutoSwitch)) {
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
- (UserInfoView *)userInfoView { - (UserInfoView *)userInfoView {
if (!_userInfoView) { if (!_userInfoView) {
_userInfoView = [[UserInfoView alloc] initWithDelegate:self]; _userInfoView = [[UserInfoView alloc] initWithDelegate:self vc:self];
} }
return _userInfoView; return _userInfoView;
} }
......
...@@ -23,6 +23,6 @@ typedef NS_ENUM(NSUInteger,ImagePickerStyle) { ...@@ -23,6 +23,6 @@ typedef NS_ENUM(NSUInteger,ImagePickerStyle) {
@property (nonatomic, weak) id<JWMImagePickerDelegate> JWMdelegate; @property (nonatomic, weak) id<JWMImagePickerDelegate> JWMdelegate;
/* 初始化方法 */ /* 初始化方法 */
- (instancetype)initWithImagePickerStyle:(ImagePickerStyle)style; - (instancetype)initWithImagePickerStyle:(ImagePickerStyle)style delegate:(id<JWMImagePickerDelegate>)delegate;
@end @end
...@@ -13,9 +13,13 @@ ...@@ -13,9 +13,13 @@
@implementation JWMImagePickerController @implementation JWMImagePickerController
- (instancetype)initWithImagePickerStyle:(ImagePickerStyle)style { - (instancetype)initWithImagePickerStyle:(ImagePickerStyle)style delegate:(id<JWMImagePickerDelegate>)delegate {
self = [super init]; if (self = [super init]) {
if (self) { _JWMdelegate = delegate;
self.allowsEditing = NO;
self.delegate = self;
if (style == ImagePickerStyleCamera) { if (style == ImagePickerStyleCamera) {
self.sourceType = UIImagePickerControllerSourceTypeCamera; self.sourceType = UIImagePickerControllerSourceTypeCamera;
} else if (style == ImagePickerStylePhotoLibrary) { } else if (style == ImagePickerStylePhotoLibrary) {
...@@ -25,13 +29,6 @@ ...@@ -25,13 +29,6 @@
return self; return self;
} }
- (void)viewDidLoad {
[super viewDidLoad];
self.allowsEditing = NO;
self.delegate = self;
self.view.backgroundColor = [UIColor colorWithWhite:0.875 alpha:1.000];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info { - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary<NSString *,id> *)info {
UIImage *editedImage = [info objectForKey:UIImagePickerControllerOriginalImage]; UIImage *editedImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[picker dismissViewControllerAnimated:YES completion:nil]; [picker dismissViewControllerAnimated:YES completion:nil];
......
...@@ -96,9 +96,8 @@ ...@@ -96,9 +96,8 @@
} }
- (void)presentViewController:(ImagePickerStyle)style { - (void)presentViewController:(ImagePickerStyle)style {
// _tmpVc.navigationController.navigationBarHidden = YES; self.imgePicker = [[JWMImagePickerController alloc] initWithImagePickerStyle:style delegate:self];
self.imgePicker = [[JWMImagePickerController alloc] initWithImagePickerStyle:style]; self.imgePicker.navigationBar.barTintColor = style == ImagePickerStyleCamera ? DSBlack : DSWhite;
self.imgePicker.JWMdelegate = self;
[_tmpVc presentViewController:self.imgePicker animated:YES completion:nil]; [_tmpVc presentViewController:self.imgePicker animated:YES completion:nil];
} }
......
...@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN ...@@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) id<UserInfoViewDelegate> delegate; @property (nonatomic, weak) id<UserInfoViewDelegate> delegate;
- (instancetype)initWithDelegate:(id<UserInfoViewDelegate>)delegate; - (instancetype)initWithDelegate:(id<UserInfoViewDelegate>)delegate vc:(UIViewController *)vc;
@end @end
......
...@@ -16,10 +16,13 @@ ...@@ -16,10 +16,13 @@
@property (nonatomic, strong) UIButton *layoutBtn; @property (nonatomic, strong) UIButton *layoutBtn;
@end @end
@implementation UserInfoView @implementation UserInfoView {
UIViewController *_tmpVC;
}
- (instancetype)initWithDelegate:(id<UserInfoViewDelegate>)delegate { - (instancetype)initWithDelegate:(id<UserInfoViewDelegate>)delegate vc:(UIViewController *)vc {
if (self = [super initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight(0))]) { if (self = [super initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kTopHeight(0))]) {
_tmpVC = vc;
_delegate = delegate; _delegate = delegate;
[self.portraitBtn yy_setImageWithURL:[NSURL URLWithString:@"https://img2.ydniu.com/sleep_ssmain/face_img/1648892614555_QhXhJX.jpg"] forState:UIControlStateNormal placeholder:[UIImage imageNamed:@"portrait"]]; [self.portraitBtn yy_setImageWithURL:[NSURL URLWithString:@"https://img2.ydniu.com/sleep_ssmain/face_img/1648892614555_QhXhJX.jpg"] forState:UIControlStateNormal placeholder:[UIImage imageNamed:@"portrait"]];
...@@ -38,7 +41,7 @@ ...@@ -38,7 +41,7 @@
} }
- (void)updatePortraitAction { - (void)updatePortraitAction {
[[[PhotoAlertView alloc] initWithVC:self.ds_viewController] showPhotoAlertView]; [[[PhotoAlertView alloc] initWithVC:_tmpVC] showPhotoAlertView];
} }
- (void)layoutAction { - (void)layoutAction {
......
...@@ -29,7 +29,11 @@ NSString * const UserBasicInfo = @"UserBasicInfo"; ...@@ -29,7 +29,11 @@ NSString * const UserBasicInfo = @"UserBasicInfo";
NSString * const WeChatAppID = @"wx4cdd4760092cdfdf"; NSString * const WeChatAppID = @"wx4cdd4760092cdfdf";
NSString * const WeChatAppSecret = @"72c0a939b605b824d0c6d9dbde152ae0"; NSString * const WeChatAppSecret = @"72c0a939b605b824d0c6d9dbde152ae0";
// xinstall平台的
NSString * const UNIVERSAL_LINK = @"https://ocusmp.xinstall.com.cn/tolink/"; NSString * const UNIVERSAL_LINK = @"https://ocusmp.xinstall.com.cn/tolink/";
// 友盟平台的
// NSString * const UNIVERSAL_LINK = @"https://8e0bcfb.umindex.com/";
NSString * const QQAppID = @"1111310949"; NSString * const QQAppID = @"1111310949";
NSString * const QQAppKey = @"CiiSZ3E04SlKKmVN"; NSString * const QQAppKey = @"CiiSZ3E04SlKKmVN";
NSString * const UMengAppKey = @"62048053e0f9bb492bfcb0e8"; NSString * const UMengAppKey = @"62048053e0f9bb492bfcb0e8";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!