Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5de813e8
由
cgx
编写于
2022-07-02 18:19:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
积分等级UI
1 个父辈
6cf3b825
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
132 行增加
和
3 行删除
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointController.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.m
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.h
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.m
DreamSleep/DreamSleep/Resource/Assets.xcassets/.DS_Store
DreamSleep/DreamSleep/Resource/Assets.xcassets/ScoreTask/.DS_Store
DreamSleep/DreamSleep.xcworkspace/xcuserdata/peter.xcuserdatad/UserInterfaceState.xcuserstate
查看文件 @
5de813e
此文件类型无法预览
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointController.m
查看文件 @
5de813e
...
...
@@ -41,7 +41,7 @@
[
ScoreTaskRequestModel
queryUserIntegralRankWithCompletion
:
^
(
ScoreTaskRequestModel
*
_Nonnull
requestModel
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
[
self
.
myPointView
updateScoreLevelView
:
requestModel
.
scoreModel
];
}
}];
...
...
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.h
查看文件 @
5de813e
...
...
@@ -6,6 +6,7 @@
//
#import <UIKit/UIKit.h>
#import "MyScoreModel.h"
NS_ASSUME_NONNULL_BEGIN
...
...
@@ -22,6 +23,10 @@ NS_ASSUME_NONNULL_BEGIN
-
(
instancetype
)
initWithDelegate
:(
id
<
MyPointViewDelegate
>
)
delegate
;
/// 更新用户等级视图
/// @param scoreModel scoreModel
-
(
void
)
updateScoreLevelView
:(
MyScoreModel
*
)
scoreModel
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/MyPointView.m
查看文件 @
5de813e
...
...
@@ -30,7 +30,8 @@
_delegate
=
delegate
;
self
.
vccanScroll
=
YES
;
self
.
bgHeight
=
277
;
self
.
bgHeight
=
kTopHeight
(
0
)
+
48
-
9
+
150
*
(
kScreenWidth
-
30
)
/
345
;
self
.
rankListArr
=
@[
@1
,
@2
,
@3
,
@4
,
@5
,
@6
,
@7
,
@8
,
@9
];
...
...
@@ -43,6 +44,10 @@
return
self
;
}
-
(
void
)
updateScoreLevelView
:(
MyScoreModel
*
)
scoreModel
{
[
self
.
scoreLevelView
updateData
:
scoreModel
];
}
#pragma mark - UITableViewDelegate && UITableViewDataSource
-
(
NSInteger
)
tableView
:(
UITableView
*
)
tableView
numberOfRowsInSection
:(
NSInteger
)
section
{
return
self
.
rankListArr
.
count
;
...
...
@@ -96,7 +101,6 @@
-
(
ScoreLevelView
*
)
scoreLevelView
{
if
(
!
_scoreLevelView
)
{
_scoreLevelView
=
[[
ScoreLevelView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
self
.
bgHeight
)];
[
_scoreLevelView
debugViewShowBorder
];
}
return
_scoreLevelView
;
}
...
...
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.h
查看文件 @
5de813e
...
...
@@ -6,12 +6,15 @@
//
#import <UIKit/UIKit.h>
#import "MyScoreModel.h"
NS_ASSUME_NONNULL_BEGIN
/// 当前用户积分级别视图
@interface
ScoreLevelView
:
UIView
-
(
void
)
updateData
:(
MyScoreModel
*
)
scoreModel
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/ProfileModule/ScoreTaskAI/ScoreLevelView.m
查看文件 @
5de813e
...
...
@@ -7,13 +7,130 @@
#import "ScoreLevelView.h"
@interface
ScoreLevelView
()
@property
(
nonatomic
,
strong
)
UIImageView
*
cardIV
;
@property
(
nonatomic
,
strong
)
UILabel
*
curRankNameLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
totalPointsLab
;
@property
(
nonatomic
,
strong
)
UIImageView
*
rewardIV
;
@property
(
nonatomic
,
strong
)
UIButton
*
rulesBtn
;
@property
(
nonatomic
,
strong
)
UILabel
*
curRankLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
nextRankLab
;
@end
@implementation
ScoreLevelView
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
[
self
debugViewShowBorder
];
[
self
addSubview
:
self
.
cardIV
];
[
self
addSubview
:
self
.
curRankNameLab
];
[
self
addSubview
:
self
.
totalPointsLab
];
[
self
addSubview
:
self
.
rewardIV
];
[
self
addSubview
:
self
.
rulesBtn
];
[
self
addSubview
:
self
.
curRankLab
];
[
self
addSubview
:
self
.
nextRankLab
];
CGFloat
h
=
150
*
(
kScreenWidth
-
30
)
/
345
;
[
self
.
cardIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
).
offset
(
15
);
make
.
right
.
equalTo
(
self
).
offset
(
-
15
);
make
.
bottom
.
equalTo
(
self
).
offset
(
-
24
);
make
.
height
.
equalTo
(
@
(
h
));
}];
[
self
.
rewardIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
cardIV
);
make
.
left
.
equalTo
(
self
.
curRankNameLab
.
mas_right
).
offset
(
23
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
79
,
78
));
}];
[
self
.
rulesBtn
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
cardIV
).
offset
(
14
);
make
.
right
.
equalTo
(
self
.
cardIV
).
offset
(
-
9
);
make
.
size
.
mas_equalTo
(
CGSizeMake
(
64
,
21
));
}];
}
return
self
;
}
-
(
void
)
updateData
:(
MyScoreModel
*
)
scoreModel
{
self
.
curRankNameLab
.
text
=
scoreModel
.
rank_name
;
self
.
totalPointsLab
.
text
=
[
NSString
stringWithFormat
:
@"总积分:%ld"
,
scoreModel
.
total_points
];
[
self
.
rewardIV
yy_setImageWithURL
:[
NSURL
URLWithString
:
scoreModel
.
reward_img
]
placeholder
:[
UIImage
imageNamed
:
@"basicPlaceholder"
]];
self
.
curRankLab
.
text
=
scoreModel
.
cur_rank
;
self
.
nextRankLab
.
text
=
scoreModel
.
next_rank
;
[
self
.
curRankNameLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
cardIV
).
offset
(
20
);
make
.
top
.
equalTo
(
self
.
cardIV
).
offset
(
15
);
}];
[
self
.
totalPointsLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
curRankNameLab
);
make
.
top
.
equalTo
(
self
.
curRankNameLab
.
mas_bottom
).
offset
(
16
);
}];
[
self
.
curRankLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
cardIV
).
offset
(
15
);
make
.
bottom
.
equalTo
(
self
.
cardIV
).
offset
(
-
12
);
}];
[
self
.
nextRankLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
self
.
cardIV
).
offset
(
-
17
);
make
.
bottom
.
equalTo
(
self
.
cardIV
).
offset
(
-
41
);
}];
}
#pragma mark - lazy
-
(
UIImageView
*
)
cardIV
{
if
(
!
_cardIV
)
{
_cardIV
=
[[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"bg_card_jifen"
]];
}
return
_cardIV
;
}
-
(
UILabel
*
)
curRankNameLab
{
if
(
!
_curRankNameLab
)
{
_curRankNameLab
=
[
UILabel
labWithTextColor
:
DSWhite
font
:
BoldFont
(
24
)];
}
return
_curRankNameLab
;
}
-
(
UILabel
*
)
totalPointsLab
{
if
(
!
_totalPointsLab
)
{
_totalPointsLab
=
[
UILabel
labWithTextColor
:
ColorFromHex
(
0x28525A
)
font
:
SysFont
(
14
)];
}
return
_totalPointsLab
;
}
-
(
UIImageView
*
)
rewardIV
{
if
(
!
_rewardIV
)
{
_rewardIV
=
[
UIImageView
new
];
}
return
_rewardIV
;
}
-
(
UIButton
*
)
rulesBtn
{
if
(
!
_rulesBtn
)
{
_rulesBtn
=
[
UIButton
btnWithTitle
:
@"积分规则"
titleColor
:
DSWhite
font
:
SysFont
(
12
.
0
)];
_rulesBtn
.
backgroundColor
=
ColorFromHex
(
0x89CAD3
);
[
_rulesBtn
addTouchUpInsideHandler
:
^
(
NSInteger
tag
)
{
}];
[
_rulesBtn
cornerRadius
:
10
.
0
];
}
return
_rulesBtn
;
}
-
(
UILabel
*
)
curRankLab
{
if
(
!
_curRankLab
)
{
_curRankLab
=
[
UILabel
labWithTextColor
:
ColorFromHex
(
0x4599A8
)
font
:
BoldFont
(
12
)];
}
return
_curRankLab
;
}
-
(
UILabel
*
)
nextRankLab
{
if
(
!
_nextRankLab
)
{
_nextRankLab
=
[
UILabel
labWithTextColor
:
ColorFromHex
(
0x4599A8
)
font
:
BoldFont
(
12
)];
_nextRankLab
.
textAlignment
=
NSTextAlignmentRight
;
}
return
_nextRankLab
;
}
@end
DreamSleep/DreamSleep/Resource/Assets.xcassets/.DS_Store
查看文件 @
5de813e
此文件类型无法预览
DreamSleep/DreamSleep/Resource/Assets.xcassets/ScoreTask/.DS_Store
查看文件 @
5de813e
此文件类型无法预览
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论