Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6aefde39
由
cgx
编写于
2022-04-28 23:39:36 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
意见反馈详情完成UI自动布局
1 个父辈
10d1c276
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
167 行增加
和
26 行删除
DreamSleep/DreamSleep/Profile/Feedback/FeedbackDetailController.m
DreamSleep/DreamSleep/Profile/Feedback/FeedbackDetailController.m
查看文件 @
6aefde3
...
@@ -10,13 +10,16 @@
...
@@ -10,13 +10,16 @@
@interface
FeedbackDetailController
()
@interface
FeedbackDetailController
()
@property
(
nonatomic
,
strong
)
UIScrollView
*
detailSV
;
@property
(
nonatomic
,
strong
)
UIScrollView
*
detailSV
;
@property
(
nonatomic
,
strong
)
UIView
*
containerView
;
@property
(
nonatomic
,
strong
)
UIView
*
feedView
;
@property
(
nonatomic
,
strong
)
UIView
*
feedView
;
@property
(
nonatomic
,
strong
)
UILabel
*
contentLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
contentLab
;
@property
(
nonatomic
,
strong
)
UIView
*
imgContainerView
;
@property
(
nonatomic
,
strong
)
UILabel
*
createdTimeLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
createdTimeLab
;
@property
(
nonatomic
,
strong
)
UIView
*
replyView
;
@property
(
nonatomic
,
strong
)
UIView
*
replyView
;
@property
(
nonatomic
,
strong
)
UILabel
*
replyTitleLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
replyTitleLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
replierContent
;
@property
(
nonatomic
,
strong
)
UILabel
*
replierContentLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
replierNameLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
replierTimeLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
replierTimeLab
;
@end
@end
...
@@ -30,36 +33,119 @@
...
@@ -30,36 +33,119 @@
[
FeedbackRequestModel
queryAdviceDetailWithAdviceID
:
self
.
advice_id
completion
:
^
(
FeedbackRequestModel
*
_Nonnull
requestModel
)
{
[
FeedbackRequestModel
queryAdviceDetailWithAdviceID
:
self
.
advice_id
completion
:
^
(
FeedbackRequestModel
*
_Nonnull
requestModel
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
[
self
buildUI
];
[
self
buildUI
:
requestModel
.
feedDetailModel
];
}
}
}];
}];
}
}
-
(
void
)
buildUI
{
-
(
void
)
buildUI
:
(
MyFeedDetailModel
*
)
detailModel
{
[
self
.
view
addSubview
:
self
.
detailSV
];
[
self
.
view
addSubview
:
self
.
detailSV
];
[
self
.
detailSV
addSubview
:
self
.
containerView
];
[
self
.
detailSV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
view
);
}];
[
self
.
containerView
addSubview
:
self
.
feedView
];
[
self
.
detailSV
addSubview
:
self
.
feedView
];
[
self
.
containerView
addSubview
:
self
.
replyView
];
[
self
.
feedView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
detailSV
.
mas_top
).
offset
(
15
);
make
.
left
.
equalTo
(
self
.
view
).
offset
(
15
);
make
.
right
.
equalTo
(
self
.
view
).
offset
(
-
15
);
}];
[
self
.
detailSV
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
feedView
addSubview
:
self
.
contentLab
];
make
.
edges
.
equalTo
(
self
.
view
).
insets
(
UIEdgeInsetsMake
(
0
,
0
,
0
,
0
));
self
.
contentLab
.
text
=
detailModel
.
content
;
[
self
.
contentLab
sizeToFit
];
[
self
.
contentLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
feedView
).
offset
(
8
);
make
.
top
.
equalTo
(
self
.
feedView
).
offset
(
8
);
make
.
right
.
equalTo
(
self
.
feedView
).
offset
(
-
8
);
}];
}];
[
self
.
containerView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
edges
.
equalTo
(
self
.
detailSV
);
BOOL
hasImg
=
NO
;
make
.
width
.
height
.
equalTo
(
self
.
detailSV
);
if
(
detailModel
.
content_img
&&
detailModel
.
content_img
.
length
>
0
)
{
hasImg
=
YES
;
[
self
.
feedView
addSubview
:
self
.
imgContainerView
];
[
self
.
imgContainerView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
feedView
).
offset
(
8
);
make
.
top
.
equalTo
(
self
.
contentLab
.
mas_bottom
).
offset
(
20
);
make
.
right
.
equalTo
(
self
.
feedView
).
offset
(
-
8
);
make
.
height
.
equalTo
(
@105
);
}];
}];
[
self
.
feedView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
top
.
equalTo
(
self
.
containerView
).
offset
(
15
);
// 截取图片字符串链接
make
.
right
.
equalTo
(
self
.
containerView
).
offset
(
-
15
);
NSArray
*
imgUrls
=
[
detailModel
.
content_img
componentsSeparatedByString
:
@","
];
make
.
height
.
equalTo
(
@200
);
for
(
int
i
=
0
;
i
<
imgUrls
.
count
;
i
++
)
{
UIImageView
*
showIV
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
i
*
(
105
+
8
),
0
,
105
,
105
)];
showIV
.
dk_alphaPicker
=
DKAlphaPickerWithAlphas
(
1
.
0
,
.
5
,
.
5
);
[
showIV
yy_setImageWithURL
:[
NSURL
URLWithString
:
imgUrls
[
i
]]
placeholder
:[
UIImage
imageNamed
:
@"basicPlaceholder"
]];
[
showIV
cornerRadius
:
12
.
0
];
[
self
.
imgContainerView
addSubview
:
showIV
];
UITapGestureRecognizer
*
tapGR
=
[[
UITapGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
tapGRAction
:
)];
[
showIV
addGestureRecognizer
:
tapGR
];
showIV
.
userInteractionEnabled
=
YES
;
}
}
[
self
.
feedView
addSubview
:
self
.
createdTimeLab
];
self
.
createdTimeLab
.
text
=
detailModel
.
created_at
;
[
self
.
createdTimeLab
sizeToFit
];
[
self
.
createdTimeLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
right
.
equalTo
(
self
.
feedView
).
offset
(
-
8
);
make
.
bottom
.
equalTo
(
self
.
feedView
).
offset
(
-
8
);
make
.
top
.
equalTo
(
hasImg
?
self
.
imgContainerView
.
mas_bottom
:
self
.
contentLab
.
mas_bottom
).
offset
(
39
);
}];
}];
UIView
*
lastView
=
self
.
feedView
;
// 判断是否有回复信息
if
(
detailModel
.
replier_content
&&
detailModel
.
replier_content
.
length
>
0
)
{
[
self
.
detailSV
addSubview
:
self
.
replyView
];
lastView
=
self
.
replyView
;
[
self
.
replyView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
[
self
.
replyView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
containerV
iew
).
offset
(
15
);
make
.
left
.
equalTo
(
self
.
v
iew
).
offset
(
15
);
make
.
right
.
equalTo
(
self
.
containerV
iew
).
offset
(
-
15
);
make
.
right
.
equalTo
(
self
.
v
iew
).
offset
(
-
15
);
make
.
top
.
equalTo
(
self
.
feedView
.
mas_bottom
).
offset
(
15
);
make
.
top
.
equalTo
(
self
.
feedView
.
mas_bottom
).
offset
(
15
);
make
.
height
.
equalTo
(
@200
);
}];
}];
[
self
.
replyView
addSubview
:
self
.
replyTitleLab
];
[
self
.
replyTitleLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
left
.
equalTo
(
self
.
replyView
).
offset
(
8
);
make
.
top
.
equalTo
(
self
.
replyView
).
offset
(
15
);
}];
[
self
.
replyView
addSubview
:
self
.
replierContentLab
];
self
.
replierContentLab
.
text
=
detailModel
.
replier_content
;
[
self
.
replierContentLab
sizeToFit
];
[
self
.
replierContentLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
replyTitleLab
.
mas_bottom
).
offset
(
12
);
make
.
left
.
equalTo
(
self
.
replyView
).
offset
(
8
);
make
.
right
.
equalTo
(
self
.
replyView
).
offset
(
-
8
);
}];
[
self
.
replyView
addSubview
:
self
.
replierNameLab
];
self
.
replierNameLab
.
text
=
[
NSString
stringWithFormat
:
@"回复人:%@"
,
detailModel
.
replier_name
];
[
self
.
replyTitleLab
sizeToFit
];
[
self
.
replierNameLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
replierContentLab
.
mas_bottom
).
offset
(
46
);
make
.
right
.
equalTo
(
self
.
replyView
).
offset
(
-
8
);
}];
[
self
.
replyView
addSubview
:
self
.
replierTimeLab
];
self
.
replierTimeLab
.
text
=
[
NSString
stringWithFormat
:
@"回复时间:%@"
,
detailModel
.
replier_time
];
[
self
.
replierTimeLab
sizeToFit
];
[
self
.
replierTimeLab
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
top
.
equalTo
(
self
.
replierNameLab
.
mas_bottom
).
offset
(
8
);
make
.
right
.
equalTo
(
self
.
replyView
).
offset
(
-
8
);
make
.
bottom
.
equalTo
(
self
.
replyView
).
offset
(
-
15
);
}];
}
[
lastView
mas_makeConstraints
:
^
(
MASConstraintMaker
*
make
)
{
make
.
bottom
.
equalTo
(
self
.
detailSV
.
mas_bottom
).
offset
(
-
15
);
}];
}
-
(
void
)
tapGRAction
:
(
UITapGestureRecognizer
*
)
gr
{
UIImageView
*
showIV
=
(
UIImageView
*
)
gr
.
view
;
showIV
.
image
;
DSLog
(
@"========="
);
}
}
#pragma mark - 品牌模式
#pragma mark - 品牌模式
...
@@ -71,17 +157,12 @@
...
@@ -71,17 +157,12 @@
-
(
UIScrollView
*
)
detailSV
{
-
(
UIScrollView
*
)
detailSV
{
if
(
!
_detailSV
)
{
if
(
!
_detailSV
)
{
_detailSV
=
[
UIScrollView
new
];
_detailSV
=
[
UIScrollView
new
];
_detailSV
.
showsVerticalScrollIndicator
=
NO
;
_detailSV
.
contentSize
=
CGSizeMake
(
kScreenWidth
,
1000
);
}
}
return
_detailSV
;
return
_detailSV
;
}
}
-
(
UIView
*
)
containerView
{
if
(
!
_containerView
)
{
_containerView
=
[
UIView
new
];
}
return
_containerView
;
}
-
(
UIView
*
)
feedView
{
-
(
UIView
*
)
feedView
{
if
(
!
_feedView
)
{
if
(
!
_feedView
)
{
_feedView
=
[
UIView
new
];
_feedView
=
[
UIView
new
];
...
@@ -91,6 +172,31 @@
...
@@ -91,6 +172,31 @@
return
_feedView
;
return
_feedView
;
}
}
-
(
UILabel
*
)
contentLab
{
if
(
!
_contentLab
)
{
_contentLab
=
[
UILabel
labWithFont
:
SysFont
(
14
)];
_contentLab
.
numberOfLines
=
0
;
_contentLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
DarkTextColor
,
DSWhite
);
}
return
_contentLab
;
}
-
(
UILabel
*
)
createdTimeLab
{
if
(
!
_createdTimeLab
)
{
_createdTimeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
)];
_createdTimeLab
.
textAlignment
=
NSTextAlignmentRight
;
_createdTimeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHex
(
0x5C6274
),
DSWhite
);
}
return
_createdTimeLab
;
}
-
(
UIView
*
)
imgContainerView
{
if
(
!
_imgContainerView
)
{
_imgContainerView
=
[
UIView
new
];
}
return
_imgContainerView
;
}
-
(
UIView
*
)
replyView
{
-
(
UIView
*
)
replyView
{
if
(
!
_replyView
)
{
if
(
!
_replyView
)
{
_replyView
=
[
UIView
new
];
_replyView
=
[
UIView
new
];
...
@@ -100,4 +206,39 @@
...
@@ -100,4 +206,39 @@
return
_replyView
;
return
_replyView
;
}
}
-
(
UILabel
*
)
replyTitleLab
{
if
(
!
_replyTitleLab
)
{
_replyTitleLab
=
[
UILabel
labWithText
:
@"回复内容"
textColor
:
ColorFromHex
(
0xF04B77
)
font
:
BoldFont
(
16
.
0
)];
[
_replyTitleLab
sizeToFit
];
}
return
_replyTitleLab
;
}
-
(
UILabel
*
)
replierContentLab
{
if
(
!
_replierContentLab
)
{
_replierContentLab
=
[
UILabel
labWithFont
:
SysFont
(
14
)];
_replierContentLab
.
numberOfLines
=
0
;
_replierContentLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SubTitleColor
,
DarkTextColor
,
DSWhite
);
}
return
_replierContentLab
;
}
-
(
UILabel
*
)
replierNameLab
{
if
(
!
_replierNameLab
)
{
_replierNameLab
=
[
UILabel
labWithFont
:
SysFont
(
12
)];
_replierNameLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHex
(
0x5C6274
),
DSWhite
);
_replierNameLab
.
textAlignment
=
NSTextAlignmentRight
;
}
return
_replierNameLab
;
}
-
(
UILabel
*
)
replierTimeLab
{
if
(
!
_replierTimeLab
)
{
_replierTimeLab
=
[
UILabel
labWithFont
:
SysFont
(
12
)];
_replierTimeLab
.
dk_textColorPicker
=
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHex
(
0x5C6274
),
DSWhite
);
_replierTimeLab
.
textAlignment
=
NSTextAlignmentRight
;
}
return
_replierTimeLab
;
}
@end
@end
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论