Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit db7ca586
由
cgx
编写于
2022-10-29 17:25:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
睡眠文章新增阅读数
1 个父辈
23bb143b
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
25 行增加
和
4 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Class/CommunityModule/Article/ArticleCell.m
DreamSleep/DreamSleep/Class/CommunityModule/Article/ArticleModel.h
DreamSleep/DreamSleep/Class/CommunityModule/MessageCenter/View/PraiseCell.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
db7ca58
...
...
@@ -3233,7 +3233,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepDebug.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION =
3
;
CURRENT_PROJECT_VERSION =
5
;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
...
...
@@ -3316,7 +3316,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/DreamSleep.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION =
3
;
CURRENT_PROJECT_VERSION =
5
;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
ENABLE_BITCODE = NO;
...
...
@@ -3459,7 +3459,7 @@
CODE_SIGN_ENTITLEMENTS = DreamSleep/Basement/DSConfig/DreamSleepBeta.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION =
3
;
CURRENT_PROJECT_VERSION =
5
;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 4NDZ6UX8PW;
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Article/ArticleCell.m
查看文件 @
db7ca58
...
...
@@ -12,6 +12,7 @@
@property
(
nonatomic
,
strong
)
UILabel
*
contentLab
;
@property
(
nonatomic
,
strong
)
UIImageView
*
coverIV
;
@property
(
nonatomic
,
strong
)
UIView
*
tagsView
;
@property
(
nonatomic
,
strong
)
UILabel
*
readCountLab
;
@end
@implementation
ArticleCell
...
...
@@ -25,7 +26,8 @@
[
self
.
contentView
addSubview
:
self
.
contentLab
];
[
self
.
contentView
addSubview
:
self
.
coverIV
];
[
self
.
contentView
addSubview
:
self
.
tagsView
];
[
self
.
contentView
addSubview
:
self
.
readCountLab
];
[
self
.
coverIV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
self
.
contentView
).
offset
(
-
8
);
make
.
centerY
.
equalTo
(
self
.
contentView
);
...
...
@@ -45,6 +47,12 @@
make
.
height
.
equalTo
(
@21
);
make
.
bottom
.
equalTo
(
self
.
contentView
).
offset
(
-
12
);
}];
[
self
.
readCountLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
right
.
bottom
.
equalTo
(
self
.
coverIV
);
make
.
height
.
equalTo
(
@25
);
}];
[
self
layoutIfNeeded
];
[
self
.
readCountLab
setCornerRadiusRect
:(
UIRectCornerBottomLeft
|
UIRectCornerBottomRight
)
cornerRadius
:
12
];
}
return
self
;
}
...
...
@@ -54,6 +62,7 @@
self
.
titleLab
.
text
=
model
.
title
;
self
.
contentLab
.
text
=
model
.
content
;
[
self
.
coverIV
yy_setImageWithURL
:[
NSURL
URLWithString
:
model
.
cover
]
placeholder
:[
UIImage
defaultPlaceholderWithSize
:
CGSizeMake
(
86
,
86
)]];
self
.
readCountLab
.
text
=
[
NSString
stringWithFormat
:
@"%ld人阅读过"
,
model
.
read_count
];
// tag标签最多只有3个
NSArray
*
tagsTitleArr
=
model
.
tags
?
[
model
.
tags
componentsSeparatedByString
:
@"|"
]
:
@[];
...
...
@@ -119,4 +128,14 @@
return
_tagsView
;
}
-
(
UILabel
*
)
readCountLab
{
if
(
!
_readCountLab
)
{
_readCountLab
=
[
UILabel
labWithFont
:
SysFont
(
11
)];
_readCountLab
.
textAlignment
=
NSTextAlignmentCenter
;
_readCountLab
.
textColor
=
ColorFromHexA
(
0xFFFFFF
,
.
7
);
_readCountLab
.
backgroundColor
=
ColorFromHexA
(
0x161E38
,
.
35
);
}
return
_readCountLab
;
}
@end
DreamSleep/DreamSleep/Class/CommunityModule/Article/ArticleModel.h
查看文件 @
db7ca58
...
...
@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
copy
)
NSString
*
content
;
@property
(
nonatomic
,
copy
)
NSString
*
url
;
@property
(
nonatomic
,
copy
)
NSString
*
cover
;
@property
(
nonatomic
,
assign
)
NSInteger
read_count
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/MessageCenter/View/PraiseCell.m
查看文件 @
db7ca58
...
...
@@ -41,6 +41,7 @@
[
self
.
contentLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
userIcon
.
mas_bottom
).
offset
(
7
);
make
.
left
.
equalTo
(
self
.
contentView
).
offset
(
73
);
make
.
right
.
equalTo
(
self
.
contentView
).
offset
(
-
50
);
}];
}
return
self
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论