Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2a9005b2
由
cgx
编写于
2022-07-02 10:21:50 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
开启我的每日任务和我的积分
1 个父辈
a2d34dfb
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
56 行增加
和
100 行删除
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
DreamSleep/DreamSleep/Class/ProfileModule/Me/ProfileHeaderView.m
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
查看文件 @
2a9005b
此文件类型无法预览
DreamSleep/DreamSleep/Class/ProfileModule/Me/ProfileHeaderView.m
查看文件 @
2a9005b
...
...
@@ -15,7 +15,7 @@
@property
(
nonatomic
,
strong
)
UIImageView
*
levelIV
;
@property
(
nonatomic
,
strong
)
UIButton
*
modifyBtn
;
@property
(
nonatomic
,
strong
)
UIView
*
scoreTaskEvaluateView
;
//
@property (nonatomic, strong) UILabel *scoreCountLab;
@property
(
nonatomic
,
strong
)
UILabel
*
scoreCountLab
;
@property
(
nonatomic
,
strong
)
UIButton
*
openAIBtn
;
@property
(
nonatomic
,
strong
)
UIView
*
reportReviewsView
;
@end
...
...
@@ -46,25 +46,16 @@
[
self
.
titleLab
mas_remakeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
portraitIV
.
mas_right
).
offset
(
20
);
make
.
right
.
equalTo
(
self
.
modifyBtn
.
mas_left
).
offset
(
-
20
);
make
.
centerY
.
equalTo
(
self
.
portraitIV
);
make
.
top
.
equalTo
(
self
.
portraitIV
).
offset
(
4
);
}];
[
self
.
levelIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
titleLab
).
offset
(
-
8
);
make
.
top
.
equalTo
(
self
.
titleLab
.
mas_bottom
).
offset
(
4
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
95
,
35
));
}];
// [self.titleLab mas_remakeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.portraitIV.mas_right).offset(20);
// make.top.equalTo(self.portraitIV).offset(4);
// }];
// [self.levelIV mas_makeConstraints:^(MASConstraintMaker *make) {
// make.left.equalTo(self.titleLab).offset(-8);
// make.top.equalTo(self.titleLab.mas_bottom).offset(4);
// make.size.mas_equalTo(CGSizeMake(95, 35));
// }];
// self.openAIBtn.hidden = model.is_access == 1;
// self.reportReviewsView.hidden = !self.openAIBtn.hidden;
// self.scoreCountLab.text = [NSString stringWithFormat:@"我的积分:%d", model.total_points];
self
.
openAIBtn
.
hidden
=
model
.
is_access
==
1
;
self
.
reportReviewsView
.
hidden
=
!
self
.
openAIBtn
.
hidden
;
self
.
scoreCountLab
.
text
=
[
NSString
stringWithFormat
:
@"我的积分:%d"
,
model
.
total_points
];
}
else
{
self
.
portraitIV
.
image
=
[
UIImage
imageNamed
:
@"basicPlaceholder"
];
self
.
titleLab
.
text
=
@"注册/登录"
;
...
...
@@ -76,12 +67,9 @@
make
.
centerY
.
equalTo
(
self
.
portraitIV
);
}];
// self.openAIBtn.hidden = NO;
// self.reportReviewsView.hidden = YES;
// self.scoreCountLab.text = @"我的积分";
self
.
openAIBtn
.
hidden
=
NO
;
self
.
reportReviewsView
.
hidden
=
!
self
.
openAIBtn
.
hidden
;
self
.
reportReviewsView
.
hidden
=
YES
;
self
.
scoreCountLab
.
text
=
@"我的积分"
;
}
}
...
...
@@ -96,12 +84,8 @@
if
(
self
=
[
super
initWithFrame
:
CGRectMake
(
0
,
0
,
0
,
0
)])
{
_delegate
=
delegate
;
// [self mas_makeConstraints:^(MASConstraintMaker *make) {
// make.height.greaterThanOrEqualTo(@338);
// make.width.equalTo(@(kScreenWidth));
// }];
[
self
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
height
.
greaterThanOrEqualTo
(
@
196
);
make
.
height
.
greaterThanOrEqualTo
(
@
338
);
make
.
width
.
equalTo
(
@
(
kScreenWidth
));
}];
...
...
@@ -170,19 +154,6 @@
[
self
addSubview
:
scoreTaskEvaluateView
];
self
.
scoreTaskEvaluateView
=
scoreTaskEvaluateView
;
[
self
.
scoreTaskEvaluateView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
width
.
equalTo
(
self
);
make
.
top
.
equalTo
(
self
.
userInfoView
.
mas_bottom
);
make
.
left
.
right
.
equalTo
(
self
);
make
.
bottom
.
equalTo
(
self
).
priorityHigh
();
}];
/*
UIView *scoreTaskEvaluateView = [UIView new];
[self addSubview:scoreTaskEvaluateView];
self.scoreTaskEvaluateView = scoreTaskEvaluateView;
[scoreTaskEvaluateView debugViewShowBorder];
UIButton
*
dailyTaskBtn
=
[
self
btnWithDKImagePicker
:
DKImagePickerWithNames
(
@"btn_person_meirirenwu"
,
@"dk_btn_person_meirirenwu"
,
@"btn_person_meirirenwu"
)
tag
:
1
];
UIButton
*
myScoreBtn
=
[
self
btnWithDKImagePicker
:
DKImagePickerWithNames
(
@"btn_person_wodejifen"
,
@"dk_btn_person_wodejifen"
,
@"btn_person_wodejifen"
)
tag
:
2
];
...
...
@@ -218,23 +189,8 @@
[
self
.
reportReviewsView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
openAIBtn
);
}];
*/
CGFloat
ai_btn_width
=
kScreenWidth
-
30
;
CGFloat
ai_btn_height
=
62
*
ai_btn_width
/
345
.
0
;
[
self
.
openAIBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
scoreTaskEvaluateView
).
offset
(
15
);
make
.
right
.
equalTo
(
self
.
scoreTaskEvaluateView
).
offset
(
-
15
);
make
.
top
.
equalTo
(
scoreTaskEvaluateView
).
offset
(
18
);
make
.
height
.
equalTo
(
@
(
ai_btn_height
));
make
.
bottom
.
equalTo
(
self
.
scoreTaskEvaluateView
).
offset
(
-
18
);
}];
[
self
.
reportReviewsView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
openAIBtn
);
}];
// 更新布局
// [self.scoreTaskEvaluateView layoutIfNeeded];
[
self
layoutIfNeeded
];
[
self
updateUserView
];
...
...
@@ -333,50 +289,50 @@
}
#pragma mark - builders
//
- (UIButton *)btnWithDKImagePicker:(DKImagePicker)imgPicker tag:(NSInteger)tag {
//
UIButton *btn = [UIButton new];
//
btn.tag = tag;
//
[btn dk_setImage:imgPicker forState:UIControlStateNormal];
//
[btn.imageView setContentMode:UIViewContentModeScaleAspectFill];
//
btn.contentHorizontalAlignment= UIControlContentHorizontalAlignmentFill;
//
btn.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;
//
[btn addTarget:self action:@selector(scoreTaskAction:) forControlEvents:UIControlEventTouchUpInside];
//
[self.scoreTaskEvaluateView addSubview:btn];
//
//
UILabel *titleLab = [UILabel labWithText:(tag == 1 ? @"每日任务" : @"我的积分") font:BoldFont(15.0) fit:YES];
//
titleLab.dk_textColorPicker = DKColorPickerWithColors(MainTextColor, DkTitleColor, DSWhite);
//
[btn addSubview:titleLab];
//
//
[titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.left.equalTo(btn).offset(12);
//
make.top.equalTo(btn).offset(10);
//
}];
//
//
if (tag == 1) {
//
UILabel *tipsLab = [UILabel labWithText:@"做任务攒积分 >" textColor:BrandColor font:SysFont(8.0)];
//
tipsLab.textAlignment = NSTextAlignmentCenter;
//
[tipsLab cornerRadius:8.0];
//
tipsLab.layer.borderWidth = .5;
//
tipsLab.layer.borderColor = BrandColor.CGColor;
//
[btn addSubview:tipsLab];
//
[tipsLab mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.left.equalTo(titleLab);
//
make.bottom.equalTo(btn).offset(-10);
//
make.size.mas_equalTo(CGSizeMake(65, 15));
//
}];
//
} else {
//
UILabel *scoreCountLab = [UILabel labWithFont:SysFont(12.0)];
//
scoreCountLab.dk_textColorPicker = DKColorPickerWithColors(SubTitleColor, DkTitleColor, DSWhite);
//
[btn addSubview:scoreCountLab];
//
self.scoreCountLab = scoreCountLab;
//
[scoreCountLab mas_makeConstraints:^(MASConstraintMaker *make) {
//
make.left.equalTo(titleLab);
//
make.bottom.equalTo(btn).offset(-10);
//
make.right.equalTo(btn).offset(-79);
//
}];
//
}
//
//
return btn;
//
}
-
(
UIButton
*
)
btnWithDKImagePicker
:
(
DKImagePicker
)
imgPicker
tag
:
(
NSInteger
)
tag
{
UIButton
*
btn
=
[
UIButton
new
];
btn
.
tag
=
tag
;
[
btn
dk_setImage
:
imgPicker
forState
:
UIControlStateNormal
];
[
btn
.
imageView
setContentMode
:
UIViewContentModeScaleAspectFill
];
btn
.
contentHorizontalAlignment
=
UIControlContentHorizontalAlignmentFill
;
btn
.
contentVerticalAlignment
=
UIControlContentVerticalAlignmentFill
;
[
btn
addTarget
:
self
action
:
@selector
(
scoreTaskAction
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
scoreTaskEvaluateView
addSubview
:
btn
];
UILabel
*
titleLab
=
[
UILabel
labWithText
:(
tag
==
1
?
@"每日任务"
:
@"我的积分"
)
font
:
BoldFont
(
15
.
0
)
fit
:
YES
];
titleLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
MainTextColor
,
DkTitleColor
,
DSWhite
);
[
btn
addSubview
:
titleLab
];
[
titleLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
btn
).
offset
(
12
);
make
.
top
.
equalTo
(
btn
).
offset
(
10
);
}];
if
(
tag
==
1
)
{
UILabel
*
tipsLab
=
[
UILabel
labWithText
:
@"做任务攒积分 >"
textColor
:
BrandColor
font
:
SysFont
(
8
.
0
)];
tipsLab
.
textAlignment
=
NSTextAlignmentCenter
;
[
tipsLab
cornerRadius
:
8
.
0
];
tipsLab
.
layer
.
borderWidth
=
.
5
;
tipsLab
.
layer
.
borderColor
=
BrandColor
.
CGColor
;
[
btn
addSubview
:
tipsLab
];
[
tipsLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
titleLab
);
make
.
bottom
.
equalTo
(
btn
).
offset
(
-
10
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
65
,
15
));
}];
}
else
{
UILabel
*
scoreCountLab
=
[
UILabel
labWithFont
:
SysFont
(
12
.
0
)];
scoreCountLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
DkTitleColor
,
DSWhite
);
[
btn
addSubview
:
scoreCountLab
];
self
.
scoreCountLab
=
scoreCountLab
;
[
scoreCountLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
titleLab
);
make
.
bottom
.
equalTo
(
btn
).
offset
(
-
10
);
make
.
right
.
equalTo
(
btn
).
offset
(
-
79
);
}];
}
return
btn
;
}
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论