Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5c41ae80
由
cgx
编写于
2022-04-23 15:40:38 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
细节优化
1 个父辈
52d1f56b
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
39 行增加
和
23 行删除
DreamSleep/DreamSleep/Profile/Account/AccountController.m
DreamSleep/DreamSleep/Profile/Account/JWMImagePickerController.m
DreamSleep/DreamSleep/Profile/Account/PhotoAlertView.m
DreamSleep/DreamSleep/Profile/Account/UserInfoView.h
DreamSleep/DreamSleep/Profile/Account/UserInfoView.m
DreamSleep/DreamSleep/Profile/InviteFriend/InviteController.m
DreamSleep/DreamSleep/Profile/Account/AccountController.m
查看文件 @
5c41ae8
...
...
@@ -32,11 +32,19 @@
self
.
navigationItem
.
rightBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
closeBtn
];
}
#pragma mark - Actions
-
(
void
)
closeUserAction
{
self
.
closeAlertView
=
[[
CloseAlertView
alloc
]
initWithDelegate
:
self
];
[
self
.
closeAlertView
showCloseUserAlertView
];
}
-
(
void
)
clearUserData
:
(
NSString
*
)
alerStr
{
// 清除用户信息
[
LoginUtils
clearUserLoginData
];
[
DSProgressHUD
showToast
:
alerStr
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
#pragma mark - UserInfoViewDelegate
-
(
void
)
didTriggerUserAction
:
(
int
)
index
{
if
(
index
==
1
)
{
// 退出登录
...
...
@@ -67,18 +75,12 @@
}];
}
-
(
void
)
clearUserData
:
(
NSString
*
)
alerStr
{
// 清除用户信息
[
LoginUtils
clearUserLoginData
];
[
DSProgressHUD
showToast
:
alerStr
];
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
#pragma mark - lazy
-
(
UserInfoView
*
)
userInfoView
{
if
(
!
_userInfoView
)
{
_userInfoView
=
[[
UserInfoView
alloc
]
initWithDelegate
:
self
vc
:
self
];
...
...
DreamSleep/DreamSleep/Profile/Account/JWMImagePickerController.m
查看文件 @
5c41ae8
...
...
@@ -29,11 +29,10 @@
return
self
;
}
#pragma mark - 解决UIImagePickerController导航透明问题
#pragma mark -
UINavigationControllerDelegate &&
解决UIImagePickerController导航透明问题
-
(
void
)
navigationController
:(
UINavigationController
*
)
navigationController
willShowViewController
:(
UIViewController
*
)
viewController
animated
:(
BOOL
)
animated
{
animated
:(
BOOL
)
animated
{
if
([
navigationController
isKindOfClass
:[
UIImagePickerController
class
]])
{
self
.
navigationBarHidden
=
YES
;
if
(
@available
(
iOS
13
.
0
,
*
))
{
...
...
@@ -50,6 +49,7 @@
}
}
#pragma mark - UIImagePickerControllerDelegate
-
(
void
)
imagePickerController
:(
UIImagePickerController
*
)
picker
didFinishPickingMediaWithInfo
:(
NSDictionary
<
NSString
*
,
id
>
*
)
info
{
UIImage
*
editedImage
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
picker
dismissViewControllerAnimated
:
YES
completion
:
nil
];
...
...
DreamSleep/DreamSleep/Profile/Account/PhotoAlertView.m
查看文件 @
5c41ae8
...
...
@@ -65,15 +65,7 @@
return
self
;
}
-
(
UIButton
*
)
btnWithTitle
:
(
NSString
*
)
title
index
:
(
int
)
index
superView
:
(
UIView
*
)
sv
{
UIButton
*
btn
=
[
UIButton
dkBtnTitle
:
title
font
:
BoldFont
(
15
)];
btn
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
TabBarBG
);
btn
.
tag
=
index
;
[
btn
addTarget
:
self
action
:
@selector
(
clickAction
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
sv
addSubview
:
btn
];
return
btn
;
}
#pragma mark - Actions
-
(
void
)
clickAction
:
(
UIButton
*
)
sender
{
[
self
dismissPhotoAlertView
];
...
...
@@ -97,6 +89,7 @@
-
(
void
)
presentViewController
:
(
ImagePickerStyle
)
style
{
self
.
imgePicker
=
[[
JWMImagePickerController
alloc
]
initWithImagePickerStyle
:
style
delegate
:
self
];
self
.
imgePicker
.
JWMdelegate
=
self
;
self
.
imgePicker
.
navigationBar
.
barTintColor
=
style
==
ImagePickerStyleCamera
?
DSBlack
:
DSWhite
;
[
_tmpVc
presentViewController
:
self
.
imgePicker
animated
:
YES
completion
:
nil
];
}
...
...
@@ -145,4 +138,14 @@
return
_photoView
;
}
#pragma mark - others
-
(
UIButton
*
)
btnWithTitle
:
(
NSString
*
)
title
index
:
(
int
)
index
superView
:
(
UIView
*
)
sv
{
UIButton
*
btn
=
[
UIButton
dkBtnTitle
:
title
font
:
BoldFont
(
15
)];
btn
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
TabBarBG
);
btn
.
tag
=
index
;
[
btn
addTarget
:
self
action
:
@selector
(
clickAction
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
sv
addSubview
:
btn
];
return
btn
;
}
@end
DreamSleep/DreamSleep/Profile/Account/UserInfoView.h
查看文件 @
5c41ae8
...
...
@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
didTriggerUserAction
:
(
int
)
index
;
@end
/// 账户与资料view
@interface
UserInfoView
:
UIView
@property
(
nonatomic
,
weak
)
id
<
UserInfoViewDelegate
>
delegate
;
...
...
DreamSleep/DreamSleep/Profile/Account/UserInfoView.m
查看文件 @
5c41ae8
...
...
@@ -30,16 +30,17 @@
[
self
addSubview
:
self
.
userInfoTV
];
[
self
addSubview
:
self
.
layoutBtn
];
CGFloat
top
=
iPhone5
?
50
:
100
;
[
self
.
layoutBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
centerX
.
equalTo
(
self
);
make
.
width
.
equalTo
(
@
(
kScreenWidth
-
30
));
make
.
height
.
equalTo
(
@40
);
make
.
top
.
equalTo
(
self
.
userInfoTV
.
mas_bottom
).
offset
(
100
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
kScreenWidth
-
30
,
40
));
make
.
top
.
equalTo
(
self
.
userInfoTV
.
mas_bottom
).
offset
(
top
);
}];
}
return
self
;
}
#pragma mark - Actions
-
(
void
)
updatePortraitAction
{
[[[
PhotoAlertView
alloc
]
initWithVC
:
_tmpVC
]
showPhotoAlertView
];
}
...
...
@@ -55,9 +56,11 @@
}
#pragma mark - lazy
-
(
UIButton
*
)
portraitBtn
{
if
(
!
_portraitBtn
)
{
_portraitBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
0
,
83
,
145
,
145
)];
CGFloat
top
=
iPhone5
?
40
:
83
;
_portraitBtn
=
[[
UIButton
alloc
]
initWithFrame
:
CGRectMake
(
0
,
top
,
145
,
145
)];
_portraitBtn
.
centerX
=
self
.
centerX
;
[
_portraitBtn
addTarget
:
self
action
:
@selector
(
updatePortraitAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
_portraitBtn
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
...
...
DreamSleep/DreamSleep/Profile/InviteFriend/InviteController.m
查看文件 @
5c41ae8
...
...
@@ -29,6 +29,7 @@
self
.
navigationItem
.
rightBarButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
shareBtn
];
}
#pragma mark - Actions
-
(
void
)
shareAction
{
// 判断是否登录成功
if
(
!
[
LoginUtils
getUserLoginData
])
{
...
...
@@ -90,6 +91,7 @@
}];
}
#pragma mark - lazy
-
(
UIScrollView
*
)
scrollView
{
if
(
!
_scrollView
)
{
_scrollView
=
[[
UIScrollView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
kScreenHeight
-
kTopHeight
(
0
))];
...
...
@@ -113,4 +115,9 @@
return
_animatedView
;
}
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论