|
@@ -33,6 +33,7 @@ class CommunityFollowViewController: UIViewController {
|
|
func setupViews() {
|
|
func setupViews() {
|
|
view.backgroundColor = kf7f8faColor
|
|
view.backgroundColor = kf7f8faColor
|
|
view.addSubview(tableView)
|
|
view.addSubview(tableView)
|
|
|
|
+ view.addSubview(commentInputView)
|
|
}
|
|
}
|
|
|
|
|
|
func setupLayouts() {
|
|
func setupLayouts() {
|
|
@@ -140,8 +141,9 @@ extension CommunityFollowViewController {
|
|
|
|
|
|
/// 评论
|
|
/// 评论
|
|
func communityPostCommentApi(text:String) {
|
|
func communityPostCommentApi(text:String) {
|
|
|
|
+
|
|
let communityCustomCommnetModel = CommunityCustomCommnetModel()
|
|
let communityCustomCommnetModel = CommunityCustomCommnetModel()
|
|
- communityCustomCommnetModel.postId = communityFollowDataModel?.relateData?.id ?? 0
|
|
|
|
|
|
+ communityCustomCommnetModel.postId = self.communityFollowDataModel?.relateId ?? 0
|
|
communityCustomCommnetModel.content = text
|
|
communityCustomCommnetModel.content = text
|
|
|
|
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
|
|
SwiftMoyaNetWorkServiceCommunity.shared().communityPostCommentApi(communityCustomCommnetModel: communityCustomCommnetModel) {
|
|
@@ -316,8 +318,7 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
|
|
let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
let cell = CardContentCommnetTableViewCell.cellWith(tableView: tableView, indexPath: indexPath)
|
|
cell.addCommnetClosureName = {
|
|
cell.addCommnetClosureName = {
|
|
[weak self] in
|
|
[weak self] in
|
|
- self?.communityFollowDataModel = self?.communityFollowDataModels[indexPath.section]
|
|
|
|
- self?.commentInputView.inputTextView.becomeFirstResponder()
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
return cell
|
|
return cell
|
|
default:
|
|
default:
|
|
@@ -327,7 +328,73 @@ extension CommunityFollowViewController : UITableViewDelegate,UITableViewDataSou
|
|
|
|
|
|
|
|
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
|
-
|
|
|
|
|
|
+ if communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty {
|
|
|
|
+ }else if communityFollowDataModels.isEmpty && !cmsMemberModels.isEmpty { //推荐关注
|
|
|
|
+ }else if !communityFollowDataModels.isEmpty && cmsMemberModels.isEmpty { //关注列表
|
|
|
|
+ let communityFollowDataModel = communityFollowDataModels[indexPath.section]
|
|
|
|
+ if CommunityFollowType(rawValue:communityFollowDataModel.type ?? "1") == .post { //帖子
|
|
|
|
+ switch indexPath.row {
|
|
|
|
+ //贴子用户
|
|
|
|
+ case 0:
|
|
|
|
+ break
|
|
|
|
+ //图片视频/内容标题/评论列表
|
|
|
|
+ case 1,2,4:
|
|
|
|
+ if PostType(rawValue: communityFollowDataModel.relateData?.type ?? "video") == .video {
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CommunityContentVideoClosure"), object: communityFollowDataModel.relateData?.id)
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CommunityContentDetailClosure"), object: communityFollowDataModel.relateData?.id)
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ //点赞,收藏,分享
|
|
|
|
+ case 3:
|
|
|
|
+ break
|
|
|
|
+ //评论
|
|
|
|
+ case 5:
|
|
|
|
+ self.commentInputView.inputTextView.becomeFirstResponder()
|
|
|
|
+ self.communityFollowDataModel = self.communityFollowDataModels[indexPath.section]
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ }else { //关注
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if indexPath.section == 0 { //推荐关注
|
|
|
|
+
|
|
|
|
+ }else {//关注列表
|
|
|
|
+ let communityFollowDataModel = communityFollowDataModels[indexPath.section - 1]
|
|
|
|
+ if CommunityFollowType(rawValue: communityFollowDataModel.type ?? "1") == .post { //帖子
|
|
|
|
+ switch indexPath.row {
|
|
|
|
+ //贴子用户
|
|
|
|
+ case 0:
|
|
|
|
+ break
|
|
|
|
+ //图片视频/内容标题/评论列表
|
|
|
|
+ case 1,2,4:
|
|
|
|
+ if PostType(rawValue: communityFollowDataModel.relateData?.type ?? "video") == .video {
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CommunityContentVideoClosure"), object: communityFollowDataModel.relateData?.id)
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ NotificationCenter.default.post(name: NSNotification.Name("CommunityContentDetailClosure"), object: communityFollowDataModel.relateData?.id)
|
|
|
|
+ }
|
|
|
|
+ break
|
|
|
|
+ //点赞,收藏,分享
|
|
|
|
+ case 3:
|
|
|
|
+ break
|
|
|
|
+ //评论
|
|
|
|
+ case 5:
|
|
|
|
+ self.commentInputView.inputTextView.becomeFirstResponder()
|
|
|
|
+ self.communityFollowDataModel = self.communityFollowDataModels[indexPath.section]
|
|
|
|
+
|
|
|
|
+ break
|
|
|
|
+ default:
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else {//关注
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|