Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ec1615bb
由
cgx
编写于
2022-10-10 10:08:55 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
完善评论模块中点赞和评论数逻辑
1 个父辈
267a0e14
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
140 行增加
和
21 行删除
DreamSleep/DreamSleep/Class/CommunityModule/Controller/CommunityController.m
DreamSleep/DreamSleep/Class/CommunityModule/Controller/DynamicDetailController.h
DreamSleep/DreamSleep/Class/CommunityModule/Controller/DynamicDetailController.m
DreamSleep/DreamSleep/Class/CommunityModule/View/CommunityView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/CommunityView.m
DreamSleep/DreamSleep/Class/CommunityModule/View/DynamicDetailView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/DynamicDetailView.m
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.m
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.m
DreamSleep/DreamSleep/Class/CommunityModule/Controller/CommunityController.m
查看文件 @
ec1615b
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
#import "TestFlutterController.h"
#import "TestFlutterController.h"
#import "DynamicDetailController.h"
#import "DynamicDetailController.h"
@interface
CommunityController
()
<
CommunityViewDelegate
,
DynamicControllerDelegate
>
@interface
CommunityController
()
<
CommunityViewDelegate
,
DynamicControllerDelegate
,
DynamicDetailControllerDelegate
>
@property
(
nonatomic
,
strong
)
CommunityView
*
communityView
;
@property
(
nonatomic
,
strong
)
CommunityView
*
communityView
;
@property
(
nonatomic
,
strong
)
TestFlutterController
*
flutterEngine
;
@property
(
nonatomic
,
strong
)
TestFlutterController
*
flutterEngine
;
@property
(
nonatomic
,
assign
)
int
offset
;
@property
(
nonatomic
,
assign
)
int
offset
;
...
@@ -125,6 +125,7 @@
...
@@ -125,6 +125,7 @@
}
}
DynamicDetailController
*
detailVC
=
[
DynamicDetailController
new
];
DynamicDetailController
*
detailVC
=
[
DynamicDetailController
new
];
detailVC
.
comDynModel
=
comDynModel
;
detailVC
.
comDynModel
=
comDynModel
;
detailVC
.
delegate
=
self
;
[
self
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
}
}
...
@@ -168,6 +169,11 @@
...
@@ -168,6 +169,11 @@
[
self
.
communityView
insertUserDyModel
:
model
];
[
self
.
communityView
insertUserDyModel
:
model
];
}
}
#pragma mark - DynamicDetailControllerDelegate
-
(
void
)
updateLikeOrRemark
{
[
self
.
communityView
updateLikeOrRemarkView
];
}
#pragma mark - lazy
#pragma mark - lazy
-
(
CommunityView
*
)
communityView
{
-
(
CommunityView
*
)
communityView
{
if
(
!
_communityView
)
{
if
(
!
_communityView
)
{
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Controller/DynamicDetailController.h
查看文件 @
ec1615b
...
@@ -8,11 +8,18 @@
...
@@ -8,11 +8,18 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "ComDynModel.h"
#import "ComDynModel.h"
@protocol
DynamicDetailControllerDelegate
<
NSObject
>
/// 更新点赞或者评论
-
(
void
)
updateLikeOrRemark
;
@end
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
/// 动态详情页
/// 动态详情页
@interface
DynamicDetailController
:
UIViewController
@interface
DynamicDetailController
:
UIViewController
@property
(
nonatomic
,
weak
)
id
<
DynamicDetailControllerDelegate
>
delegate
;
@property
(
nonatomic
,
strong
)
ComDynModel
*
comDynModel
;
@property
(
nonatomic
,
strong
)
ComDynModel
*
comDynModel
;
@end
@end
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Controller/DynamicDetailController.m
查看文件 @
ec1615b
...
@@ -7,12 +7,14 @@
...
@@ -7,12 +7,14 @@
#import "DynamicDetailController.h"
#import "DynamicDetailController.h"
#import "DynamicDetailView.h"
#import "DynamicDetailView.h"
#import "ComListViewModel.h"
#import "ComDetailViewModel.h"
#import "ComDetailViewModel.h"
#import "ReplyListController.h"
#import "ReplyListController.h"
@interface
DynamicDetailController
()
<
DynamicDetailViewDelegate
>
@interface
DynamicDetailController
()
<
DynamicDetailViewDelegate
>
@property
(
nonatomic
,
strong
)
DynamicDetailView
*
detailView
;
@property
(
nonatomic
,
strong
)
DynamicDetailView
*
detailView
;
@property
(
nonatomic
,
strong
)
ComDetailViewModel
*
comDetailViewModel
;
@property
(
nonatomic
,
strong
)
ComDetailViewModel
*
comDetailViewModel
;
@property
(
nonatomic
,
strong
)
NSURLSessionDataTask
*
likeDataTask
;
@end
@end
@implementation
DynamicDetailController
@implementation
DynamicDetailController
...
@@ -28,10 +30,10 @@
...
@@ -28,10 +30,10 @@
self
.
comDetailViewModel
=
[
ComDetailViewModel
new
];
self
.
comDetailViewModel
=
[
ComDetailViewModel
new
];
[
self
.
detailView
updateBottomView
:
self
.
comDynModel
];
// 查询动态评论列表请求
[
self
.
comDetailViewModel
queryDynamicCommentListWithTalkID
:
self
.
comDynModel
.
dynamicID
completion
:
^
(
ComDetailViewModel
*
_Nonnull
requestModel
)
{
[
self
.
comDetailViewModel
queryDynamicCommentListWithTalkID
:
self
.
comDynModel
.
dynamicID
completion
:
^
(
ComDetailViewModel
*
_Nonnull
requestModel
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
[
self
.
detailView
updateBottomView
:
self
.
comDynModel
];
[
self
.
detailView
updateDetailView
:
requestModel
.
groupDatas
];
[
self
.
detailView
updateDetailView
:
requestModel
.
groupDatas
];
}
else
{
}
else
{
...
@@ -46,13 +48,18 @@
...
@@ -46,13 +48,18 @@
[
self
.
comDetailViewModel
userCommentDynamicWithTalkID
:
self
.
comDynModel
.
dynamicID
content
:
content
completion
:^
(
ComDetailViewModel
*
_Nonnull
requestModel
)
{
[
self
.
comDetailViewModel
userCommentDynamicWithTalkID
:
self
.
comDynModel
.
dynamicID
content
:
content
completion
:^
(
ComDetailViewModel
*
_Nonnull
requestModel
)
{
[
DSProgressHUD
dissmissProgressHUD
];
[
DSProgressHUD
dissmissProgressHUD
];
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
// 更新评论数
self
.
comDynModel
.
remarkCount
+=
1
;
[
self
.
detailView
updateRemarkCount
:
self
.
comDynModel
.
remarkCount
];
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
updateLikeOrRemark
)])
{
[
self
.
delegate
updateLikeOrRemark
];
}
[
self
.
detailView
updateCommentSection
:
requestModel
.
groupDatas
];
[
self
.
detailView
updateCommentSection
:
requestModel
.
groupDatas
];
}
else
{
}
else
{
}
}
}];
}];
}
else
if
(
tag
==
2
)
{
// 回复评论
}
}
}
}
...
@@ -62,9 +69,39 @@
...
@@ -62,9 +69,39 @@
[
self
.
navigationController
pushViewController
:
replyList
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
replyList
animated
:
YES
];
}
}
#pragma mark - 品牌模式
-
(
void
)
fireTapDetailLikeBtn
{
-
(
NaviStyle
)
navigationBarStyle
{
// 1、用户点赞或取消点赞直接响应UI变化
return
NaviStyleDefault
;
if
(
self
.
comDynModel
.
isLike
)
{
self
.
comDynModel
.
likeCount
--
;
}
else
{
self
.
comDynModel
.
likeCount
++
;
}
self
.
comDynModel
.
isLike
=
!
self
.
comDynModel
.
isLike
;
[
self
.
detailView
updateLikeStateAndLikeCount
:
self
.
comDynModel
];
// 2、更新点赞或取消点赞请求
if
(
self
.
likeDataTask
)
{
[
self
.
likeDataTask
cancel
];
}
self
.
likeDataTask
=
[
ComListViewModel
userDynamicPraiseWithTalkID
:
self
.
comDynModel
.
dynamicID
completion
:
^
(
ComListViewModel
*
_Nonnull
requestModel
)
{
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
// 3、更新成功回调刷新社区列表点赞数据
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
updateLikeOrRemark
)])
{
[
self
.
delegate
updateLikeOrRemark
];
}
}
else
{
// 4、如果请求失败,延迟执行回退
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
3
.
0
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
// 修改数据model
if
(
self
.
comDynModel
.
isLike
)
{
self
.
comDynModel
.
likeCount
--
;
}
else
{
self
.
comDynModel
.
likeCount
++
;
}
self
.
comDynModel
.
isLike
=
!
self
.
comDynModel
.
isLike
;
[
self
.
detailView
updateLikeStateAndLikeCount
:
self
.
comDynModel
];
[
DSProgressHUD
showToast
:
requestModel
.
errMessage
];
});
}
}];
}
}
#pragma mark - lazy
#pragma mark - lazy
...
@@ -75,4 +112,9 @@
...
@@ -75,4 +112,9 @@
return
_detailView
;
return
_detailView
;
}
}
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
@end
@end
DreamSleep/DreamSleep/Class/CommunityModule/View/CommunityView.h
查看文件 @
ec1615b
...
@@ -58,6 +58,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -58,6 +58,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 显示举报、取消弹框
/// 显示举报、取消弹框
-
(
void
)
showInformCancelView
;
-
(
void
)
showInformCancelView
;
/// 更新社区动态列表点赞或者评论view
-
(
void
)
updateLikeOrRemarkView
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/View/CommunityView.m
查看文件 @
ec1615b
...
@@ -69,6 +69,10 @@
...
@@ -69,6 +69,10 @@
[
self
.
informCancelView
display
];
[
self
.
informCancelView
display
];
}
}
-
(
void
)
updateLikeOrRemarkView
{
[
self
.
listView
reloadData
];
}
#pragma mark - Action
#pragma mark - Action
-
(
void
)
tapAction
:
(
UITapGestureRecognizer
*
)
tapGR
{
-
(
void
)
tapAction
:
(
UITapGestureRecognizer
*
)
tapGR
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
tapCommunityHeaderModule
:)])
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
tapCommunityHeaderModule
:)])
{
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/DynamicDetailView.h
查看文件 @
ec1615b
...
@@ -11,10 +11,17 @@
...
@@ -11,10 +11,17 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@protocol
DynamicDetailViewDelegate
<
NSObject
>
@protocol
DynamicDetailViewDelegate
<
NSObject
>
/// 评论或者回复回调
/// @param tag tag
/// @param content 内容
-
(
void
)
fireCommentOrReply
:
(
NSInteger
)
tag
content
:
(
NSString
*
)
content
;
-
(
void
)
fireCommentOrReply
:
(
NSInteger
)
tag
content
:
(
NSString
*
)
content
;
/// 进入回复列表页
/// 进入回复列表页
/// @param commentID 评论id
/// @param commentID 评论id
-
(
void
)
jumpReplyListView
:(
int
)
commentID
;
-
(
void
)
jumpReplyListView
:(
int
)
commentID
;
/// 评论详情点赞回调
-
(
void
)
fireTapDetailLikeBtn
;
@end
@end
/// 动态详情自定义view
/// 动态详情自定义view
...
@@ -26,6 +33,14 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -26,6 +33,14 @@ NS_ASSUME_NONNULL_BEGIN
/// @param model 社区动态列表传递过来的model
/// @param model 社区动态列表传递过来的model
-
(
void
)
updateBottomView
:(
ComDynModel
*
)
model
;
-
(
void
)
updateBottomView
:(
ComDynModel
*
)
model
;
/// 更新点赞状态和点赞数
/// @param model model
-
(
void
)
updateLikeStateAndLikeCount
:(
ComDynModel
*
)
model
;
/// 更新评论数
/// @param remarkCount remarkCount
-
(
void
)
updateRemarkCount
:(
int
)
remarkCount
;
/// 更新动态详情页面
/// 更新动态详情页面
/// @param groupData 分组数据
/// @param groupData 分组数据
-
(
void
)
updateDetailView
:(
NSArray
*
)
groupData
;
-
(
void
)
updateDetailView
:(
NSArray
*
)
groupData
;
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/DynamicDetailView.m
查看文件 @
ec1615b
...
@@ -46,7 +46,15 @@
...
@@ -46,7 +46,15 @@
#pragma mark - public
#pragma mark - public
-
(
void
)
updateBottomView
:(
ComDynModel
*
)
model
{
-
(
void
)
updateBottomView
:(
ComDynModel
*
)
model
{
[
self
.
interactView
updateLikeCount
:
model
.
likeCount
remarkCount
:
model
.
remarkCount
];
[
self
.
interactView
updateLikeBtnState
:
model
.
isLike
likeCount
:
model
.
likeCount
remarkCount
:
model
.
remarkCount
];
}
-
(
void
)
updateLikeStateAndLikeCount
:(
ComDynModel
*
)
model
{
[
self
.
interactView
updateLikeBtnState
:
model
.
isLike
likeCount
:
model
.
likeCount
];
}
-
(
void
)
updateRemarkCount
:(
int
)
remarkCount
{
[
self
.
interactView
updateRemarkCount
:
remarkCount
];
}
}
-
(
void
)
updateDetailView
:(
NSArray
*
)
groupData
{
-
(
void
)
updateDetailView
:(
NSArray
*
)
groupData
{
...
@@ -71,6 +79,12 @@
...
@@ -71,6 +79,12 @@
}
}
}
}
-
(
void
)
didTapDetailLikeBtn
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
fireTapDetailLikeBtn
)])
{
[
self
.
delegate
fireTapDetailLikeBtn
];
}
}
#pragma mark - UITableViewDelegate, UITableViewDataSource
#pragma mark - UITableViewDelegate, UITableViewDataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
self
.
detailListArr
.
count
;
return
self
.
detailListArr
.
count
;
...
@@ -166,8 +180,8 @@
...
@@ -166,8 +180,8 @@
[
weakSelf
.
dynamicDetailView
reloadSections
:[
NSIndexSet
indexSetWithIndex
:
1
]
withRowAnimation
:
UITableViewRowAnimationNone
];
[
weakSelf
.
dynamicDetailView
reloadSections
:[
NSIndexSet
indexSetWithIndex
:
1
]
withRowAnimation
:
UITableViewRowAnimationNone
];
};
};
cell
.
lookAllRelpyListBlock
=
^
{
cell
.
lookAllRelpyListBlock
=
^
{
if
(
self
.
delegate
&&
[
s
elf
.
delegate
respondsToSelector
:
@selector
(
jumpReplyListView
:)])
{
if
(
weakSelf
.
delegate
&&
[
weakS
elf
.
delegate
respondsToSelector
:
@selector
(
jumpReplyListView
:)])
{
[
s
elf
.
delegate
jumpReplyListView
:
comReplyModel
.
commentModel
.
comment_id
];
[
weakS
elf
.
delegate
jumpReplyListView
:
comReplyModel
.
commentModel
.
comment_id
];
}
}
};
};
return
cell
;
return
cell
;
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.h
查看文件 @
ec1615b
...
@@ -10,7 +10,13 @@
...
@@ -10,7 +10,13 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
@protocol
InteractViewDelegate
<
NSObject
>
@protocol
InteractViewDelegate
<
NSObject
>
/// 评论或者回复(回复目前放在动态通知处理,后期可能会放在正文评论详情处理)
/// @param tag 1:评论,2:回复
/// @param content 内容
-
(
void
)
commentOrReply
:
(
NSInteger
)
tag
content
:
(
NSString
*
)
content
;
-
(
void
)
commentOrReply
:
(
NSInteger
)
tag
content
:
(
NSString
*
)
content
;
/// 点击详情点赞按钮
-
(
void
)
didTapDetailLikeBtn
;
@end
@end
/// 互动区域(点赞、评论)
/// 互动区域(点赞、评论)
...
@@ -18,7 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -18,7 +24,9 @@ NS_ASSUME_NONNULL_BEGIN
@property
(
nonatomic
,
weak
)
id
<
InteractViewDelegate
>
delegate
;
@property
(
nonatomic
,
weak
)
id
<
InteractViewDelegate
>
delegate
;
-
(
void
)
updateLikeCount
:(
int
)
likeCount
remarkCount
:(
int
)
remarkCount
;
-
(
void
)
updateLikeBtnState
:(
BOOL
)
isLike
likeCount
:(
int
)
likeCount
remarkCount
:(
int
)
remarkCount
;
-
(
void
)
updateLikeBtnState
:(
BOOL
)
isLike
likeCount
:(
int
)
likeCount
;
-
(
void
)
updateRemarkCount
:(
int
)
remarkCount
;
/// 弹出回复输入框
/// 弹出回复输入框
/// @param commentUser @评论者
/// @param commentUser @评论者
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.m
查看文件 @
ec1615b
...
@@ -6,11 +6,12 @@
...
@@ -6,11 +6,12 @@
//
//
#import "InteractView.h"
#import "InteractView.h"
#import "LikeButton.h"
#import "TextInputAlertView.h"
#import "TextInputAlertView.h"
@interface
InteractView
()
@interface
InteractView
()
@property
(
nonatomic
,
strong
)
UILabel
*
tapLab
;
@property
(
nonatomic
,
strong
)
UILabel
*
tapLab
;
@property
(
nonatomic
,
strong
)
UI
Button
*
likeBtn
;
@property
(
nonatomic
,
strong
)
Like
Button
*
likeBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
remarkCountBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
remarkCountBtn
;
@property
(
nonatomic
,
strong
)
TextInputAlertView
*
textInputAlertView
;
@property
(
nonatomic
,
strong
)
TextInputAlertView
*
textInputAlertView
;
@end
@end
...
@@ -45,13 +46,29 @@
...
@@ -45,13 +46,29 @@
return
self
;
return
self
;
}
}
#pragma mark - private
-
(
void
)
popTextInputView
{
-
(
void
)
popTextInputView
{
[
self
.
textInputAlertView
showTextInputAlertView
];
[
self
.
textInputAlertView
showTextInputAlertView
];
}
}
-
(
void
)
detailTapLikeBtn
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
didTapDetailLikeBtn
)])
{
[
self
.
delegate
didTapDetailLikeBtn
];
}
}
#pragma mark - public
#pragma mark - public
-
(
void
)
updateLikeCount
:
(
int
)
likeCount
remarkCount
:
(
int
)
remarkCount
{
-
(
void
)
updateLikeBtnState
:
(
BOOL
)
isLike
likeCount
:
(
int
)
likeCount
remarkCount
:
(
int
)
remarkCount
{
[
self
.
likeBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
likeCount
]
forState
:
UIControlStateNormal
];
[
self
.
likeBtn
updateLikeBtnState
:
isLike
likeCount
:
likeCount
];
[
self
.
remarkCountBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
remarkCount
]
forState
:
UIControlStateNormal
];
}
-
(
void
)
updateLikeBtnState
:
(
BOOL
)
isLike
likeCount
:
(
int
)
likeCount
{
[
self
.
likeBtn
executeAnimation
];
[
self
.
likeBtn
updateLikeBtnState
:
isLike
likeCount
:
likeCount
];
}
-
(
void
)
updateRemarkCount
:
(
int
)
remarkCount
{
[
self
.
remarkCountBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
remarkCount
]
forState
:
UIControlStateNormal
];
[
self
.
remarkCountBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
remarkCount
]
forState
:
UIControlStateNormal
];
}
}
...
@@ -77,12 +94,10 @@
...
@@ -77,12 +94,10 @@
return
_tapLab
;
return
_tapLab
;
}
}
-
(
UI
Button
*
)
likeBtn
{
-
(
Like
Button
*
)
likeBtn
{
if
(
!
_likeBtn
)
{
if
(
!
_likeBtn
)
{
_likeBtn
=
[
UIButton
btnWithTitle
:
@""
font
:
SysFont
(
12
)];
_likeBtn
=
[[
LikeButton
alloc
]
initWithNormalImg
:
nil
nightNormalImg
:
nil
selectedImg
:
nil
nightSelectedImg
:
nil
];
[
_likeBtn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
),
DSWhite
)
forState
:
UIControlStateNormal
];
[
_likeBtn
addTarget
:
self
action
:
@selector
(
detailTapLikeBtn
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
_likeBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_shequ_dianza"
,
@"dk_ic_shequ_dianza"
,
@"ic_shequ_dianza"
)
forState
:
UIControlStateNormal
];
_likeBtn
.
titleEdgeInsets
=
UIEdgeInsetsMake
(
0
,
9
,
0
,
0
);
}
}
return
_likeBtn
;
return
_likeBtn
;
}
}
...
@@ -90,6 +105,7 @@
...
@@ -90,6 +105,7 @@
-
(
UIButton
*
)
remarkCountBtn
{
-
(
UIButton
*
)
remarkCountBtn
{
if
(
!
_remarkCountBtn
)
{
if
(
!
_remarkCountBtn
)
{
_remarkCountBtn
=
[
UIButton
btnWithTitle
:
@""
font
:
SysFont
(
12
)];
_remarkCountBtn
=
[
UIButton
btnWithTitle
:
@""
font
:
SysFont
(
12
)];
_remarkCountBtn
.
userInteractionEnabled
=
NO
;
[
_remarkCountBtn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
),
DSWhite
)
forState
:
UIControlStateNormal
];
[
_remarkCountBtn
dk_setTitleColorPicker
:
DKColorPickerWithColors
(
SmallTextColor
,
ColorFromHexA
(
0xFFFFFF
,
.
3
),
DSWhite
)
forState
:
UIControlStateNormal
];
[
_remarkCountBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_shequ_pinlun"
,
@"dk_ic_shequ_pinlun"
,
@"ic_shequ_pinlun"
)
forState
:
UIControlStateNormal
];
[
_remarkCountBtn
dk_setImage
:
DKImagePickerWithNames
(
@"ic_shequ_pinlun"
,
@"dk_ic_shequ_pinlun"
,
@"ic_shequ_pinlun"
)
forState
:
UIControlStateNormal
];
_remarkCountBtn
.
titleEdgeInsets
=
UIEdgeInsetsMake
(
0
,
9
,
0
,
0
);
_remarkCountBtn
.
titleEdgeInsets
=
UIEdgeInsetsMake
(
0
,
9
,
0
,
0
);
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.m
查看文件 @
ec1615b
...
@@ -110,9 +110,14 @@
...
@@ -110,9 +110,14 @@
-
(
void
)
replyAction
:
(
UIButton
*
)
sender
{
-
(
void
)
replyAction
:
(
UIButton
*
)
sender
{
NSString
*
content
=
self
.
textView
.
text
;
NSString
*
content
=
self
.
textView
.
text
;
if
(
sender
.
tag
==
2
)
{
if
(
sender
.
tag
==
2
)
{
// 回复
content
=
[
content
componentsSeparatedByString
:
self
.
commentUserFlag
].
lastObject
;
content
=
[
content
componentsSeparatedByString
:
self
.
commentUserFlag
].
lastObject
;
}
}
NSString
*
triStr
=
[
NSString
trimString
:
content
];
if
(
triStr
.
length
==
0
)
{
[
DSProgressHUD
showToast
:
@"请输入评论内容"
];
return
;
}
if
(
self
.
tapFinishBlock
)
{
if
(
self
.
tapFinishBlock
)
{
self
.
tapFinishBlock
(
sender
.
tag
,
content
);
self
.
tapFinishBlock
(
sender
.
tag
,
content
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论