Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 104186d4
由
cgx
编写于
2022-10-18 11:41:18 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
完成消息中心回复接口功能、点赞列表
1 个父辈
84d2d2b2
隐藏空白字符变更
内嵌
并排
正在显示
25 个修改的文件
包含
242 行增加
和
79 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Basement/H5/ExceptionDefaultView.h
DreamSleep/DreamSleep/Basement/H5/ExceptionDefaultView.m
DreamSleep/DreamSleep/Class/CommunityModule/Controller/MessageController.m
DreamSleep/DreamSleep/Class/CommunityModule/Controller/PraiseListController.m
DreamSleep/DreamSleep/Class/CommunityModule/Model/MessageComReplyModel.h
DreamSleep/DreamSleep/Class/CommunityModule/Model/MessageComReplyModel.m
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.m
DreamSleep/DreamSleep/Class/CommunityModule/View/MessageNotiView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/MessageNotiView.m
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.h
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.m
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/MessageCenterViewModel.h
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/MessageCenterViewModel.m
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/PraiseListViewModel.h
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/PraiseListViewModel.m
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/Contents.json
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun@2x.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun@3x.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/Contents.json
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun@2x.png
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun@3x.png
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
104186d
...
@@ -133,6 +133,7 @@
...
@@ -133,6 +133,7 @@
D07257F0286BE5510080F458 /* GoodSleepHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257EF286BE5510080F458 /* GoodSleepHeadView.m */; };
D07257F0286BE5510080F458 /* GoodSleepHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257EF286BE5510080F458 /* GoodSleepHeadView.m */; };
D07257F3286BF99F0080F458 /* DailyTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F2286BF99F0080F458 /* DailyTaskView.m */; };
D07257F3286BF99F0080F458 /* DailyTaskView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F2286BF99F0080F458 /* DailyTaskView.m */; };
D07257F6286C2F110080F458 /* SignCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F5286C2F110080F458 /* SignCollectionViewCell.m */; };
D07257F6286C2F110080F458 /* SignCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D07257F5286C2F110080F458 /* SignCollectionViewCell.m */; };
D07827FC28FE424700C8D612 /* PraiseListViewModel.m in Sources */ = {isa = PBXBuildFile; fileRef = D07827FB28FE424700C8D612 /* PraiseListViewModel.m */; };
D07A4B27280E9BAA00BA0EC0 /* AccountController.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B26280E9BAA00BA0EC0 /* AccountController.m */; };
D07A4B27280E9BAA00BA0EC0 /* AccountController.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B26280E9BAA00BA0EC0 /* AccountController.m */; };
D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B29280EA6B600BA0EC0 /* UserInfoTableView.m */; };
D07A4B2A280EA6B600BA0EC0 /* UserInfoTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B29280EA6B600BA0EC0 /* UserInfoTableView.m */; };
D07A4B2D280EA73B00BA0EC0 /* UserInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B2C280EA73B00BA0EC0 /* UserInfoView.m */; };
D07A4B2D280EA73B00BA0EC0 /* UserInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = D07A4B2C280EA73B00BA0EC0 /* UserInfoView.m */; };
...
@@ -557,6 +558,8 @@
...
@@ -557,6 +558,8 @@
D07257F2286BF99F0080F458 /* DailyTaskView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DailyTaskView.m; sourceTree = "<group>"; };
D07257F2286BF99F0080F458 /* DailyTaskView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DailyTaskView.m; sourceTree = "<group>"; };
D07257F4286C2F110080F458 /* SignCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SignCollectionViewCell.h; sourceTree = "<group>"; };
D07257F4286C2F110080F458 /* SignCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SignCollectionViewCell.h; sourceTree = "<group>"; };
D07257F5286C2F110080F458 /* SignCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignCollectionViewCell.m; sourceTree = "<group>"; };
D07257F5286C2F110080F458 /* SignCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SignCollectionViewCell.m; sourceTree = "<group>"; };
D07827FA28FE424700C8D612 /* PraiseListViewModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PraiseListViewModel.h; sourceTree = "<group>"; };
D07827FB28FE424700C8D612 /* PraiseListViewModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PraiseListViewModel.m; sourceTree = "<group>"; };
D07A4B25280E9BAA00BA0EC0 /* AccountController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountController.h; sourceTree = "<group>"; };
D07A4B25280E9BAA00BA0EC0 /* AccountController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountController.h; sourceTree = "<group>"; };
D07A4B26280E9BAA00BA0EC0 /* AccountController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AccountController.m; sourceTree = "<group>"; };
D07A4B26280E9BAA00BA0EC0 /* AccountController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AccountController.m; sourceTree = "<group>"; };
D07A4B28280EA6B600BA0EC0 /* UserInfoTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfoTableView.h; sourceTree = "<group>"; };
D07A4B28280EA6B600BA0EC0 /* UserInfoTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInfoTableView.h; sourceTree = "<group>"; };
...
@@ -1652,6 +1655,8 @@
...
@@ -1652,6 +1655,8 @@
D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */,
D053D0DB28F3C23200BB2B84 /* ReportViewModel.m */,
D003140428FD449E00E01A6A /* MessageCenterViewModel.h */,
D003140428FD449E00E01A6A /* MessageCenterViewModel.h */,
D003140528FD449E00E01A6A /* MessageCenterViewModel.m */,
D003140528FD449E00E01A6A /* MessageCenterViewModel.m */,
D07827FA28FE424700C8D612 /* PraiseListViewModel.h */,
D07827FB28FE424700C8D612 /* PraiseListViewModel.m */,
D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */,
D06F2C4F28F6AEC50023921E /* PersonDynViewModel.h */,
D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */,
D06F2C5028F6AEC50023921E /* PersonDynViewModel.m */,
);
);
...
@@ -2625,6 +2630,7 @@
...
@@ -2625,6 +2630,7 @@
D07DACA42810557D0067A1BF /* CGGeometry+RSKImageCropper.m in Sources */,
D07DACA42810557D0067A1BF /* CGGeometry+RSKImageCropper.m in Sources */,
D09D0E96280D3FE9008DEDAB /* NSDate+Extras.m in Sources */,
D09D0E96280D3FE9008DEDAB /* NSDate+Extras.m in Sources */,
D0878F4C280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m in Sources */,
D0878F4C280BEFF9005F1B7F /* UILabel+YBAttributeTextTapAction.m in Sources */,
D07827FC28FE424700C8D612 /* PraiseListViewModel.m in Sources */,
D0F80907280431100097899F /* UILabel+Extras.m in Sources */,
D0F80907280431100097899F /* UILabel+Extras.m in Sources */,
D003154C284DF46F00CFE94D /* RelaxTrainCell.m in Sources */,
D003154C284DF46F00CFE94D /* RelaxTrainCell.m in Sources */,
D04B3DAC27F6EEB50022F8DF /* DSTabBarController.m in Sources */,
D04B3DAC27F6EEB50022F8DF /* DSTabBarController.m in Sources */,
...
...
DreamSleep/DreamSleep/Basement/H5/ExceptionDefaultView.h
查看文件 @
104186d
...
@@ -26,6 +26,8 @@ typedef void (^DealBlock)(void);
...
@@ -26,6 +26,8 @@ typedef void (^DealBlock)(void);
-
(
void
)
updateExceptionViewWithType
:(
ExceptionType
)
type
;
-
(
void
)
updateExceptionViewWithType
:(
ExceptionType
)
type
;
-
(
void
)
showErrorInfo
:(
ExceptionType
)
type
;
-
(
void
)
showServerErrInfo
:(
NSString
*
)
errInfo
;
-
(
void
)
showServerErrInfo
:(
NSString
*
)
errInfo
;
@end
@end
...
...
DreamSleep/DreamSleep/Basement/H5/ExceptionDefaultView.m
查看文件 @
104186d
...
@@ -77,6 +77,12 @@
...
@@ -77,6 +77,12 @@
[
self
.
dealBtn
setTitle
:[
self
getDealBtnTitleWithType
:
self
.
type
]
forState
:
UIControlStateNormal
];
[
self
.
dealBtn
setTitle
:[
self
getDealBtnTitleWithType
:
self
.
type
]
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
showErrorInfo
:(
ExceptionType
)
type
{
self
.
exceptionIV
.
image
=
[
UIImage
imageNamed
:[
self
getExceptionImgWithType
:
type
]];
self
.
exceptLab
.
text
=
[
self
getExceptionInfoWithType
:
type
];
self
.
dealBtn
.
hidden
=
YES
;
}
-
(
void
)
showServerErrInfo
:(
NSString
*
)
errInfo
{
-
(
void
)
showServerErrInfo
:(
NSString
*
)
errInfo
{
self
.
exceptLab
.
text
=
(
errInfo
&&
[
errInfo
isKindOfClass
:[
NSString
class
]])
?
errInfo
:
@"服务器异常"
;
self
.
exceptLab
.
text
=
(
errInfo
&&
[
errInfo
isKindOfClass
:[
NSString
class
]])
?
errInfo
:
@"服务器异常"
;
}
}
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Controller/MessageController.m
查看文件 @
104186d
...
@@ -49,6 +49,18 @@
...
@@ -49,6 +49,18 @@
}
}
}
}
-
(
void
)
replyContent
:
(
NSString
*
)
content
userMessageModel
:
(
id
)
userMessageModel
{
[
DSProgressHUD
showProgressHUDWithInfo
:
@""
];
[
MessageCenterViewModel
userReplyCommentWithContent
:
content
userMessageModel
:
userMessageModel
completion
:^
(
MessageCenterViewModel
*
_Nonnull
requestModel
)
{
[
DSProgressHUD
dissmissProgressHUD
];
if
(
requestModel
.
resCode
==
DSResCodeSuccess
)
{
[
self
.
messageNotiView
dismissKeyBoard
];
}
else
{
[
DSProgressHUD
showToast
:
requestModel
.
errMessage
];
}
}];
}
#pragma mark - lazy
#pragma mark - lazy
-
(
MessageNotiView
*
)
messageNotiView
{
-
(
MessageNotiView
*
)
messageNotiView
{
if
(
!
_messageNotiView
)
{
if
(
!
_messageNotiView
)
{
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Controller/PraiseListController.m
查看文件 @
104186d
...
@@ -7,9 +7,13 @@
...
@@ -7,9 +7,13 @@
#import "PraiseListController.h"
#import "PraiseListController.h"
#import "PraiseCell.h"
#import "PraiseCell.h"
#import "PraiseListViewModel.h"
@interface
PraiseListController
()
@interface
PraiseListController
()
@property
(
nonatomic
,
strong
)
DSDataSource
*
dataSource
;
@property
(
nonatomic
,
strong
)
DSDataSource
*
dataSource
;
@property
(
nonatomic
,
assign
)
int
offset
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
praiseList
;
@property
(
nonatomic
,
strong
)
ExceptionDefaultView
*
exceptionView
;
@end
@end
@implementation
PraiseListController
@implementation
PraiseListController
...
@@ -17,24 +21,58 @@
...
@@ -17,24 +21,58 @@
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
[
self
initUI
];
[
self
.
tableView
.
mj_header
beginRefreshing
];
}
#pragma mark - init
-
(
void
)
initUI
{
self
.
navigationItem
.
title
=
@"收到的赞"
;
self
.
navigationItem
.
title
=
@"收到的赞"
;
self
.
offset
=
1
;
NSMutableArray
*
tmpArr
=
[
NSMutableArray
array
];
self
.
praiseList
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
[
self
.
dataSource
addDataArray
:
self
.
praiseList
];
PraiseModel
*
model
=
[
PraiseModel
new
];
model
.
user_profile
=
@"https://img2.ydniu.com/sleep_ssmain/face_img/1657350090882_1BORX6.jpg"
;
model
.
nick_name
=
@"叽叽歪歪"
;
model
.
publish_time
=
@"2022-09-11"
;
model
.
content
=
@"好高好高好高好高好高好高好"
;
[
tmpArr
addObject
:
model
];
}
[
self
.
dataSource
addDataArray
:
tmpArr
.
copy
];
self
.
tableView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
self
.
tableView
.
dk_backgroundColorPicker
=
DKColorPickerWithKey
(
VCViewBG
);
self
.
tableView
.
showsVerticalScrollIndicator
=
NO
;
self
.
tableView
.
showsVerticalScrollIndicator
=
NO
;
self
.
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
self
.
tableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
[
self
.
tableView
registerClass
:[
PraiseCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
PraiseCell
class
])];
[
self
.
tableView
registerClass
:[
PraiseCell
class
]
forCellReuseIdentifier
:
NSStringFromClass
([
PraiseCell
class
])];
self
.
tableView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
self
.
tableView
.
contentInsetAdjustmentBehavior
=
UIScrollViewContentInsetAdjustmentNever
;
WS
(
weakSelf
);
self
.
tableView
.
mj_header
=
[
DSGifHeader
headerWithRefreshingBlock
:
^
{
[
weakSelf
getPraiseList
:
NO
];
}];
self
.
tableView
.
mj_footer
=
[
MJRefreshBackNormalFooter
footerWithRefreshingBlock
:
^
{
[
weakSelf
getPraiseList
:
YES
];
}];
}
-
(
void
)
getPraiseList
:
(
BOOL
)
loadMore
{
if
(
loadMore
==
NO
)
{
self
.
offset
=
1
;
}
[
PraiseListViewModel
queryUserDynamicPraiseWithOffset
:
self
.
offset
completion
:
^
(
PraiseListViewModel
*
_Nonnull
viewModel
)
{
[
self
.
tableView
.
mj_footer
endRefreshing
];
[
self
.
tableView
.
mj_header
endRefreshing
];
if
(
viewModel
.
resCode
==
DSResCodeSuccess
)
{
if
(
self
.
praiseList
.
count
==
0
&&
viewModel
.
resultArr
.
count
==
0
)
{
[
self
dealErrorWithType
:
ExceptionTypeNoData
errInfo
:
@""
];
return
;
}
if
(
loadMore
)
{
[
self
.
praiseList
addObjectsFromArray
:
viewModel
.
resultArr
];
}
else
{
self
.
offset
++
;
self
.
praiseList
=
[
NSMutableArray
arrayWithArray
:
viewModel
.
resultArr
];
}
self
.
exceptionView
.
hidden
=
YES
;
[
self
.
dataSource
addDataArray
:
self
.
praiseList
];
[
self
.
tableView
reloadData
];
}
else
{
[
self
dealErrorWithType
:
ExceptionTypeNet
errInfo
:
viewModel
.
errMessage
];
}
}];
}
}
#pragma mark - UITableViewDelegate, UITableViewDataSource
#pragma mark - UITableViewDelegate, UITableViewDataSource
...
@@ -54,9 +92,25 @@
...
@@ -54,9 +92,25 @@
return
_dataSource
;
return
_dataSource
;
}
}
-
(
ExceptionDefaultView
*
)
exceptionView
{
if
(
!
_exceptionView
)
{
_exceptionView
=
[[
ExceptionDefaultView
alloc
]
initWithType
:
ExceptionTypeNet
block
:
^
{
}
superView
:
self
.
view
];
}
return
_exceptionView
;
}
#pragma mark - 品牌模式
#pragma mark - 品牌模式
-
(
NaviStyle
)
navigationBarStyle
{
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
return
NaviStyleDefault
;
}
}
-
(
void
)
dealErrorWithType
:
(
ExceptionType
)
type
errInfo
:
(
NSString
*
)
errInfo
{
self
.
exceptionView
.
hidden
=
NO
;
[
self
.
exceptionView
showErrorInfo
:
type
];
if
(
type
==
ExceptionTypeNet
)
{
[
self
.
exceptionView
showServerErrInfo
:
errInfo
];
}
}
@end
@end
DreamSleep/DreamSleep/Class/CommunityModule/Model/MessageComReplyModel.h
查看文件 @
104186d
...
@@ -11,8 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -11,8 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
/// 消息中心评论和回复数据model
/// 消息中心评论和回复数据model
@interface
MessageComReplyModel
:
NSObject
@interface
MessageComReplyModel
:
NSObject
/// 动态或评论 id
/// 动态id
@property
(
nonatomic
,
assign
)
NSInteger
identifier
;
@property
(
nonatomic
,
assign
)
NSInteger
talkID
;
/// 评论id
@property
(
nonatomic
,
assign
)
NSInteger
commentID
;
/// 0:动态评论 1 评论回复
/// 0:动态评论 1 评论回复
@property
(
nonatomic
,
assign
)
NSInteger
type
;
@property
(
nonatomic
,
assign
)
NSInteger
type
;
/// 发布评论或回复的用户 Id
/// 发布评论或回复的用户 Id
...
...
DreamSleep/DreamSleep/Class/CommunityModule/Model/MessageComReplyModel.m
查看文件 @
104186d
...
@@ -11,7 +11,8 @@
...
@@ -11,7 +11,8 @@
#pragma mark - YYModel
#pragma mark - YYModel
+
(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
modelCustomPropertyMapper
{
+
(
nullable
NSDictionary
<
NSString
*
,
id
>
*
)
modelCustomPropertyMapper
{
return
@{
@"identifier"
:
@"id"
,
return
@{
@"talkID"
:
@"talk_id"
,
@"commentID"
:
@"comment_id"
,
@"userID"
:
@"user_id"
,
@"userID"
:
@"user_id"
,
@"preUserID"
:
@"pre_user_id"
,
@"preUserID"
:
@"pre_user_id"
,
@"preContent"
:
@"pre_content"
,
@"preContent"
:
@"pre_content"
,
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.h
查看文件 @
104186d
...
@@ -28,10 +28,6 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -28,10 +28,6 @@ NS_ASSUME_NONNULL_BEGIN
-
(
void
)
updateLikeBtnState
:(
BOOL
)
isLike
likeCount
:(
int
)
likeCount
animate
:(
BOOL
)
animate
;
-
(
void
)
updateLikeBtnState
:(
BOOL
)
isLike
likeCount
:(
int
)
likeCount
animate
:(
BOOL
)
animate
;
-
(
void
)
updateRemarkCount
:(
int
)
remarkCount
;
-
(
void
)
updateRemarkCount
:(
int
)
remarkCount
;
/// 弹出回复输入框(第一版暂不考虑)
/// @param commentUser @评论者
-
(
void
)
popReplyInputBoxWithCommentUser
:(
NSString
*
)
commentUser
;
-
(
void
)
dismissKeyboard
;
-
(
void
)
dismissKeyboard
;
@end
@end
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/InteractView.m
查看文件 @
104186d
...
@@ -72,10 +72,6 @@
...
@@ -72,10 +72,6 @@
[
self
.
remarkCountBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
remarkCount
]
forState
:
UIControlStateNormal
];
[
self
.
remarkCountBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d"
,
remarkCount
]
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
popReplyInputBoxWithCommentUser
:
(
NSString
*
)
commentUser
{
[
self
.
textInputAlertView
showReplyTextAlertWithCommentUser
:
commentUser
];
}
-
(
void
)
dismissKeyboard
{
-
(
void
)
dismissKeyboard
{
[
self
.
textInputAlertView
dismiss
];
[
self
.
textInputAlertView
dismiss
];
}
}
...
...
DreamSleep/DreamSleep/Class/CommunityModule/View/MessageNotiView.h
查看文件 @
104186d
...
@@ -12,6 +12,11 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -12,6 +12,11 @@ NS_ASSUME_NONNULL_BEGIN
@protocol
MessageNotiViewDelegate
<
NSObject
>
@protocol
MessageNotiViewDelegate
<
NSObject
>
-
(
void
)
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
;
-
(
void
)
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
;
/// 消息中心回复评论
/// @param content 回复内容
/// @param userMessageModel 用户消息数据model
-
(
void
)
replyContent
:(
NSString
*
)
content
userMessageModel
:(
id
)
userMessageModel
;
@end
@end
/// 消息通知view
/// 消息通知view
...
@@ -21,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -21,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
-
(
instancetype
)
initWithDelegate
:(
id
<
MessageNotiViewDelegate
>
)
messageDelegate
viewModel
:(
MessageCenterViewModel
*
)
vm
;
-
(
instancetype
)
initWithDelegate
:(
id
<
MessageNotiViewDelegate
>
)
messageDelegate
viewModel
:(
MessageCenterViewModel
*
)
vm
;
-
(
void
)
dismissKeyBoard
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/View/MessageNotiView.m
查看文件 @
104186d
...
@@ -8,12 +8,14 @@
...
@@ -8,12 +8,14 @@
#import "MessageNotiView.h"
#import "MessageNotiView.h"
#import "MessageOfficialNotiCell.h"
#import "MessageOfficialNotiCell.h"
#import "MessageComReplyCell.h"
#import "MessageComReplyCell.h"
#import "TextInputAlertView.h"
static
int
secHeaderHeight
=
52
;
static
int
secHeaderHeight
=
52
;
static
int
secFooterHeight
=
8
;
static
int
secFooterHeight
=
8
;
@interface
MessageNotiView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@interface
MessageNotiView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
MessageCenterViewModel
*
messageCenterVM
;
@property
(
nonatomic
,
strong
)
MessageCenterViewModel
*
messageCenterVM
;
@property
(
nonatomic
,
strong
)
TextInputAlertView
*
textInputAlertView
;
@end
@end
@implementation
MessageNotiView
@implementation
MessageNotiView
...
@@ -38,6 +40,11 @@ static int secFooterHeight = 8;
...
@@ -38,6 +40,11 @@ static int secFooterHeight = 8;
return
self
;
return
self
;
}
}
#pragma mark - public
-
(
void
)
dismissKeyBoard
{
[
self
.
textInputAlertView
dismiss
];
}
#pragma mark - UITableViewDelegate, UITableViewDataSource
#pragma mark - UITableViewDelegate, UITableViewDataSource
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
self
.
messageCenterVM
.
messageListArr
.
count
;
return
self
.
messageCenterVM
.
messageListArr
.
count
;
...
@@ -100,12 +107,13 @@ static int secFooterHeight = 8;
...
@@ -100,12 +107,13 @@ static int secFooterHeight = 8;
cell
.
officialModel
=
officialNotiList
[
indexPath
.
row
];
cell
.
officialModel
=
officialNotiList
[
indexPath
.
row
];
return
cell
;
return
cell
;
}
else
{
}
else
{
WS
(
weakSelf
);
MessageComReplyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
NSStringFromClass
([
MessageComReplyCell
class
])
forIndexPath
:
indexPath
];
MessageComReplyCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
NSStringFromClass
([
MessageComReplyCell
class
])
forIndexPath
:
indexPath
];
NSArray
*
userNotiList
=
self
.
messageCenterVM
.
messageListArr
[
indexPath
.
section
];
NSArray
*
userNotiList
=
self
.
messageCenterVM
.
messageListArr
[
indexPath
.
section
];
cell
.
comReplyModel
=
userNotiList
[
indexPath
.
row
];
MessageComReplyModel
*
model
=
userNotiList
[
indexPath
.
row
];
cell
.
comReplyModel
=
model
;
cell
.
tapReplyBtnBlock
=
^
{
cell
.
tapReplyBtnBlock
=
^
{
#warning 回复功能逻辑未完成...
[
weakSelf
.
textInputAlertView
showReplyTextAlertWithCommentUser
:
model
.
nickName
model
:
model
];
};
};
return
cell
;
return
cell
;
}
}
...
@@ -117,4 +125,18 @@ static int secFooterHeight = 8;
...
@@ -117,4 +125,18 @@ static int secFooterHeight = 8;
}
}
}
}
#pragma mark - lazy
-
(
TextInputAlertView
*
)
textInputAlertView
{
if
(
!
_textInputAlertView
)
{
WS
(
weakSelf
);
_textInputAlertView
=
[[
TextInputAlertView
alloc
]
initWithFrame
:[
UIScreen
mainScreen
].
bounds
];
_textInputAlertView
.
tapReplyBlock
=
^
(
NSString
*
_Nonnull
content
,
id
_Nonnull
model
)
{
if
(
weakSelf
.
messageDelegate
&&
[
weakSelf
.
messageDelegate
respondsToSelector
:
@selector
(
replyContent
:
userMessageModel
:
)])
{
[
weakSelf
.
messageDelegate
replyContent
:
content
userMessageModel
:
model
];
}
};
}
return
_textInputAlertView
;
}
@end
@end
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.h
查看文件 @
104186d
...
@@ -9,19 +9,24 @@
...
@@ -9,19 +9,24 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
/// 发布
获取回复
block
/// 发布
评论回调
block
typedef
void
(
^
TapFinishBlock
)(
NSInteger
tag
,
NSString
*
content
);
typedef
void
(
^
TapFinishBlock
)(
NSInteger
tag
,
NSString
*
content
);
/// 回复评论回调block
typedef
void
(
^
TapReplyBlock
)(
NSString
*
content
,
id
model
);
/// 文本评论弹框
/// 文本评论弹框
@interface
TextInputAlertView
:
UIView
@interface
TextInputAlertView
:
UIView
@property
(
nonatomic
,
copy
)
TapFinishBlock
tapFinishBlock
;
@property
(
nonatomic
,
copy
)
TapFinishBlock
tapFinishBlock
;
@property
(
nonatomic
,
copy
)
TapReplyBlock
tapReplyBlock
;
-
(
void
)
showTextInputAlertView
;
-
(
void
)
showTextInputAlertView
;
-
(
void
)
showReplyTextAlertWithCommentUser
:(
NSString
*
)
commentUser
;
-
(
void
)
showReplyTextAlertWithCommentUser
:(
NSString
*
)
commentUser
model
:(
id
)
model
;
-
(
void
)
dismiss
;
-
(
void
)
dismiss
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/View/TextInputAlertView.m
查看文件 @
104186d
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
@property
(
nonatomic
,
strong
)
UIButton
*
replyBtn
;
@property
(
nonatomic
,
strong
)
UIButton
*
replyBtn
;
@property
(
nonatomic
,
assign
)
CGFloat
duration
;
@property
(
nonatomic
,
assign
)
CGFloat
duration
;
@property
(
nonatomic
,
copy
)
NSString
*
commentUserFlag
;
@property
(
nonatomic
,
copy
)
NSString
*
commentUserFlag
;
@property
(
nonatomic
,
strong
)
id
userMessageModel
;
@end
@end
@implementation
TextInputAlertView
@implementation
TextInputAlertView
...
@@ -90,11 +91,12 @@
...
@@ -90,11 +91,12 @@
[
self
.
replyBtn
setTitle
:
@"发布"
forState
:
UIControlStateNormal
];
[
self
.
replyBtn
setTitle
:
@"发布"
forState
:
UIControlStateNormal
];
}
}
-
(
void
)
showReplyTextAlertWithCommentUser
:
(
NSString
*
)
commentUser
{
-
(
void
)
showReplyTextAlertWithCommentUser
:
(
NSString
*
)
commentUser
model
:
(
id
)
model
{
[
self
showTextInputAlertView
];
[
self
showTextInputAlertView
];
self
.
replyBtn
.
tag
=
2
;
self
.
replyBtn
.
tag
=
2
;
self
.
userMessageModel
=
model
;
[
self
.
replyBtn
setTitle
:
@"回复"
forState
:
UIControlStateNormal
];
[
self
.
replyBtn
setTitle
:
@"回复"
forState
:
UIControlStateNormal
];
self
.
commentUserFlag
=
[
NSString
stringWithFormat
:
@"@%@,"
,
commentUser
]
;
self
.
commentUserFlag
=
commentUser
?
[
NSString
stringWithFormat
:
@"@%@,"
,
commentUser
]
:
@""
;
self
.
textView
.
text
=
self
.
commentUserFlag
;
self
.
textView
.
text
=
self
.
commentUserFlag
;
}
}
...
@@ -110,17 +112,28 @@
...
@@ -110,17 +112,28 @@
-
(
void
)
replyAction
:
(
UIButton
*
)
sender
{
-
(
void
)
replyAction
:
(
UIButton
*
)
sender
{
NSString
*
content
=
self
.
textView
.
text
;
NSString
*
content
=
self
.
textView
.
text
;
NSString
*
toast
=
@"请输入评论内容"
;
if
(
sender
.
tag
==
2
)
{
// 回复
if
(
sender
.
tag
==
2
)
{
// 回复
content
=
[
content
componentsSeparatedByString
:
self
.
commentUserFlag
].
lastObject
;
if
([
content
hasPrefix
:
self
.
commentUserFlag
])
{
content
=
[
content
componentsSeparatedByString
:
self
.
commentUserFlag
].
lastObject
;
}
toast
=
@"请输入回复内容"
;
}
}
NSString
*
triStr
=
[
NSString
trimString
:
content
];
NSString
*
triStr
=
[
NSString
trimString
:
content
];
if
(
triStr
.
length
==
0
)
{
if
(
triStr
.
length
==
0
)
{
[
DSProgressHUD
showToast
:
@"请输入评论内容"
];
[
DSProgressHUD
showToast
:
toast
];
return
;
return
;
}
}
content
=
[
NSString
transferSpecialCharacters
:
content
];
content
=
[
NSString
transferSpecialCharacters
:
content
];
if
(
self
.
tapFinishBlock
)
{
if
(
sender
.
tag
==
1
)
{
// 评论
self
.
tapFinishBlock
(
sender
.
tag
,
content
);
if
(
self
.
tapFinishBlock
)
{
self
.
tapFinishBlock
(
sender
.
tag
,
content
);
}
}
else
if
(
sender
.
tag
==
2
)
{
// 回复
if
(
self
.
tapReplyBlock
)
{
self
.
tapReplyBlock
(
content
,
self
.
userMessageModel
);
}
}
}
}
}
...
...
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/MessageCenterViewModel.h
查看文件 @
104186d
...
@@ -19,6 +19,11 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -19,6 +19,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param completion completion
/// @param completion completion
-
(
void
)
muiltiRequestWithCompletion
:(
void
(
^
)(
BOOL
isSuccess
))
completion
;
-
(
void
)
muiltiRequestWithCompletion
:(
void
(
^
)(
BOOL
isSuccess
))
completion
;
/// 消息中心用户回复评论接口
/// @param content 回复内容
/// @param userMessageModel 消息model
/// @param completion completion
+
(
NSURLSessionDataTask
*
)
userReplyCommentWithContent
:(
NSString
*
)
content
userMessageModel
:(
id
)
userMessageModel
completion
:(
void
(
^
)(
MessageCenterViewModel
*
requestModel
))
completion
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/MessageCenterViewModel.m
查看文件 @
104186d
...
@@ -77,6 +77,22 @@
...
@@ -77,6 +77,22 @@
});
});
}
}
+
(
NSURLSessionDataTask
*
)
userReplyCommentWithContent
:
(
NSString
*
)
content
userMessageModel
:
(
id
)
userMessageModel
completion
:
(
void
(
^
)(
MessageCenterViewModel
*
requestModel
))
completion
{
MessageComReplyModel
*
model
=
userMessageModel
;
MessageCenterViewModel
*
requestModel
=
[[
MessageCenterViewModel
alloc
]
init
];
NSString
*
api
=
@"user_reply_comment"
;
NSString
*
argStr
=
[
NSString
stringWithFormat
:
@"mutation{%@(user_id:%ld,talk_id:%ld,comment_id:%ld,content:
\"
%@
\"
)}"
,
api
,
model
.
userID
,
model
.
talkID
,
model
.
commentID
,
content
];
return
[
MessageCenterViewModel
httpPostBodyRequestWithAPI
:
api
params
:@{
@"query"
:
argStr
}
view
:
nil
hasNetActivity
:
YES
loadingInfo
:
nil
hasFailInfo
:
NO
success
:^
(
NSDictionary
*
_Nonnull
apiDic
)
{
DSLog
(
@"用户-回复评论接口apiDic:%@"
,
apiDic
);
requestModel
.
resCode
=
DSResCodeSuccess
;
completion
(
requestModel
);
}
failure
:^
(
id
_Nonnull
failureInfo
)
{
requestModel
.
resCode
=
[
failureInfo
[
@"errorCode"
]
integerValue
];
requestModel
.
errMessage
=
failureInfo
[
@"errMessage"
];
completion
(
requestModel
);
}];
}
#pragma mark - private
#pragma mark - private
-
(
NSURLSessionDataTask
*
)
queryUserMessageCountWithCompletion
:
(
void
(
^
)(
MessageCenterViewModel
*
requestModel
))
completion
{
-
(
NSURLSessionDataTask
*
)
queryUserMessageCountWithCompletion
:
(
void
(
^
)(
MessageCenterViewModel
*
requestModel
))
completion
{
MessageCenterViewModel
*
requestModel
=
[
MessageCenterViewModel
new
];
MessageCenterViewModel
*
requestModel
=
[
MessageCenterViewModel
new
];
...
...
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/PraiseListViewModel.h
0 → 100644
查看文件 @
104186d
//
// PraiseListViewModel.h
// DreamSleep
//
// Created by peter on 2022/10/18.
//
#import "DSNetworkTool.h"
NS_ASSUME_NONNULL_BEGIN
/// 用户点赞列表
@interface
PraiseListViewModel
:
DSNetworkTool
@property
(
nonatomic
,
strong
)
NSArray
*
resultArr
;
/// 查询用户点赞列表数据
/// @param offset 页码
/// @param completion completion
+
(
NSURLSessionDataTask
*
)
queryUserDynamicPraiseWithOffset
:(
int
)
offset
completion
:(
void
(
^
)(
PraiseListViewModel
*
viewModel
))
completion
;
@end
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Class/CommunityModule/ViewModel/PraiseListViewModel.m
0 → 100644
查看文件 @
104186d
//
// PraiseListViewModel.m
// DreamSleep
//
// Created by peter on 2022/10/18.
//
#import "PraiseListViewModel.h"
#import "PraiseModel.h"
@interface
ResultModel
:
NSObject
@property
(
nonatomic
,
assign
)
int
count
;
@property
(
nonatomic
,
assign
)
int
offset
;
@property
(
nonatomic
,
strong
)
NSArray
<
PraiseModel
*>
*
data_list
;
@end
@implementation
ResultModel
+
(
NSDictionary
*
)
modelContainerPropertyGenericClass
{
return
@{
@"data_list"
:
[
PraiseModel
class
]};
}
@end
@implementation
PraiseListViewModel
+
(
NSURLSessionDataTask
*
)
queryUserDynamicPraiseWithOffset
:(
int
)
offset
completion
:(
void
(
^
)(
PraiseListViewModel
*
viewModel
))
completion
{
PraiseListViewModel
*
viewModel
=
[
PraiseListViewModel
new
];
NSString
*
api
=
@"query_user_dynamic_praise"
;
NSString
*
argStr
=
[
NSString
stringWithFormat
:
@"query{%@(offset:%d)}"
,
api
,
offset
];
return
[
PraiseListViewModel
httpPostBodyRequestWithAPI
:
api
params
:@{
@"query"
:
argStr
}
view
:
nil
hasNetActivity
:
YES
loadingInfo
:
nil
hasFailInfo
:
NO
success
:^
(
NSDictionary
*
_Nonnull
apiDic
)
{
DSLog
(
@"社区动态消息中心接口apiDic:%@"
,
apiDic
);
ResultModel
*
resultModel
=
[
ResultModel
yy_modelWithDictionary
:
apiDic
[
@"result"
]];
viewModel
.
resCode
=
DSResCodeSuccess
;
viewModel
.
resultArr
=
resultModel
.
data_list
;
completion
(
viewModel
);
}
failure
:^
(
id
_Nonnull
failureInfo
)
{
viewModel
.
resCode
=
[
failureInfo
[
@"errorCode"
]
integerValue
];
viewModel
.
errMessage
=
failureInfo
[
@"errMessage"
];
completion
(
viewModel
);
}];
}
@end
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/Contents.json
deleted
100644 → 0
查看文件 @
84d2d2b
{
"images"
:
[
{
"filename"
:
"dk_ic_shequ_pinlun.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"dk_ic_shequ_pinlun@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"dk_ic_shequ_pinlun@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun.png
deleted
100644 → 0
查看文件 @
84d2d2b
957 字节
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun@2x.png
deleted
100644 → 0
查看文件 @
84d2d2b
1.9 KB
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/dk_ic_shequ_pinlun-1.imageset/dk_ic_shequ_pinlun@3x.png
deleted
100644 → 0
查看文件 @
84d2d2b
3.6 KB
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/Contents.json
deleted
100644 → 0
查看文件 @
84d2d2b
{
"images"
:
[
{
"filename"
:
"ic_shequ_pinlun.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"ic_shequ_pinlun@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"ic_shequ_pinlun@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun.png
deleted
100644 → 0
查看文件 @
84d2d2b
876 字节
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun@2x.png
deleted
100644 → 0
查看文件 @
84d2d2b
1.8 KB
DreamSleep/DreamSleep/Resource/Assets.xcassets/Community/ic_shequ_pinlun-1.imageset/ic_shequ_pinlun@3x.png
deleted
100644 → 0
查看文件 @
84d2d2b
3.4 KB
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论