修改了动态的很多个bug
This commit is contained in:
@@ -701,6 +701,7 @@
|
||||
E855516728059692005F293F /* GuildIncomeDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E855516628059692005F293F /* GuildIncomeDetailModel.m */; };
|
||||
E855516A280599A7005F293F /* XPGuildEmptyCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8555169280599A7005F293F /* XPGuildEmptyCollectionViewCell.m */; };
|
||||
E855516D28059A01005F293F /* XPGuildIncomeDetailPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E855516C28059A01005F293F /* XPGuildIncomeDetailPresenter.m */; };
|
||||
E85E3FA728B7A6F000268DC8 /* MessageContentMonentsView.m in Sources */ = {isa = PBXBuildFile; fileRef = E85E3FA628B7A6F000268DC8 /* MessageContentMonentsView.m */; };
|
||||
E86507E5281A7D4D006951B0 /* MessageContentTweetView.m in Sources */ = {isa = PBXBuildFile; fileRef = E86507E4281A7D4D006951B0 /* MessageContentTweetView.m */; };
|
||||
E86507E8281A8212006951B0 /* ContentTweetModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E86507E7281A8212006951B0 /* ContentTweetModel.m */; };
|
||||
E86507EB281A88A9006951B0 /* MessageContentSkillCardView.m in Sources */ = {isa = PBXBuildFile; fileRef = E86507EA281A88A9006951B0 /* MessageContentSkillCardView.m */; };
|
||||
@@ -991,12 +992,12 @@
|
||||
E8B846D626FDE01B00A777FE /* XPMineRechargePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D526FDE01B00A777FE /* XPMineRechargePresenter.m */; };
|
||||
E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */ = {isa = PBXBuildFile; fileRef = E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */; };
|
||||
E8B846DC26FDE24300A777FE /* RechargeListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B846DB26FDE24300A777FE /* RechargeListModel.m */; };
|
||||
E8BD0F8828A9E9E400DE050D /* RoomSailingPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8BD0F8728A9E9E400DE050D /* RoomSailingPrizeModel.m */; };
|
||||
E8BD0F8B28A9EB0A00DE050D /* RoomSailingPrizeListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8BD0F8A28A9EB0A00DE050D /* RoomSailingPrizeListModel.m */; };
|
||||
E8B9842D28AB77F10022D026 /* XPMonentsPublishTopicView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B9842C28AB77F10022D026 /* XPMonentsPublishTopicView.m */; };
|
||||
E8B9843028AB90200022D026 /* XPMoentsTopicListView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B9842F28AB90200022D026 /* XPMoentsTopicListView.m */; };
|
||||
E8B9843328ABA2FF0022D026 /* MonentsPicResInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B9843228ABA2FF0022D026 /* MonentsPicResInfo.m */; };
|
||||
E8B9843628ABA8B40022D026 /* XPMonentPublishSuccessView.m in Sources */ = {isa = PBXBuildFile; fileRef = E8B9843528ABA8B40022D026 /* XPMonentPublishSuccessView.m */; };
|
||||
E8BD0F8828A9E9E400DE050D /* RoomSailingPrizeModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8BD0F8728A9E9E400DE050D /* RoomSailingPrizeModel.m */; };
|
||||
E8BD0F8B28A9EB0A00DE050D /* RoomSailingPrizeListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8BD0F8A28A9EB0A00DE050D /* RoomSailingPrizeListModel.m */; };
|
||||
E8C1670928067DAA00ECB15C /* XPMineGuildSuperAdminSetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1670828067DAA00ECB15C /* XPMineGuildSuperAdminSetViewController.m */; };
|
||||
E8C1670C28067DED00ECB15C /* XPMineGuildChooseManagerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1670B28067DED00ECB15C /* XPMineGuildChooseManagerViewController.m */; };
|
||||
E8C1671228067F6C00ECB15C /* XPGuildChooseManagerRoomTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8C1671128067F6C00ECB15C /* XPGuildChooseManagerRoomTableViewCell.m */; };
|
||||
@@ -2400,6 +2401,8 @@
|
||||
E855516B28059A01005F293F /* XPGuildIncomeDetailPresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGuildIncomeDetailPresenter.h; sourceTree = "<group>"; };
|
||||
E855516C28059A01005F293F /* XPGuildIncomeDetailPresenter.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGuildIncomeDetailPresenter.m; sourceTree = "<group>"; };
|
||||
E855516E28059A14005F293F /* XPGuildIncomeDetailProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGuildIncomeDetailProtocol.h; sourceTree = "<group>"; };
|
||||
E85E3FA528B7A6F000268DC8 /* MessageContentMonentsView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentMonentsView.h; sourceTree = "<group>"; };
|
||||
E85E3FA628B7A6F000268DC8 /* MessageContentMonentsView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentMonentsView.m; sourceTree = "<group>"; };
|
||||
E86507E3281A7D4D006951B0 /* MessageContentTweetView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MessageContentTweetView.h; sourceTree = "<group>"; };
|
||||
E86507E4281A7D4D006951B0 /* MessageContentTweetView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MessageContentTweetView.m; sourceTree = "<group>"; };
|
||||
E86507E6281A8212006951B0 /* ContentTweetModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ContentTweetModel.h; sourceTree = "<group>"; };
|
||||
@@ -2979,10 +2982,6 @@
|
||||
E8B846D726FDE16300A777FE /* XPMineRechargeProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineRechargeProtocol.h; sourceTree = "<group>"; };
|
||||
E8B846DA26FDE24300A777FE /* RechargeListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RechargeListModel.h; sourceTree = "<group>"; };
|
||||
E8B846DB26FDE24300A777FE /* RechargeListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RechargeListModel.m; sourceTree = "<group>"; };
|
||||
E8BD0F8628A9E9E400DE050D /* RoomSailingPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomSailingPrizeModel.h; sourceTree = "<group>"; };
|
||||
E8BD0F8728A9E9E400DE050D /* RoomSailingPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomSailingPrizeModel.m; sourceTree = "<group>"; };
|
||||
E8BD0F8928A9EB0A00DE050D /* RoomSailingPrizeListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomSailingPrizeListModel.h; sourceTree = "<group>"; };
|
||||
E8BD0F8A28A9EB0A00DE050D /* RoomSailingPrizeListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomSailingPrizeListModel.m; sourceTree = "<group>"; };
|
||||
E8B9842B28AB77F10022D026 /* XPMonentsPublishTopicView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentsPublishTopicView.h; sourceTree = "<group>"; };
|
||||
E8B9842C28AB77F10022D026 /* XPMonentsPublishTopicView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentsPublishTopicView.m; sourceTree = "<group>"; };
|
||||
E8B9842E28AB90200022D026 /* XPMoentsTopicListView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMoentsTopicListView.h; sourceTree = "<group>"; };
|
||||
@@ -2991,6 +2990,10 @@
|
||||
E8B9843228ABA2FF0022D026 /* MonentsPicResInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MonentsPicResInfo.m; sourceTree = "<group>"; };
|
||||
E8B9843428ABA8B40022D026 /* XPMonentPublishSuccessView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMonentPublishSuccessView.h; sourceTree = "<group>"; };
|
||||
E8B9843528ABA8B40022D026 /* XPMonentPublishSuccessView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMonentPublishSuccessView.m; sourceTree = "<group>"; };
|
||||
E8BD0F8628A9E9E400DE050D /* RoomSailingPrizeModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomSailingPrizeModel.h; sourceTree = "<group>"; };
|
||||
E8BD0F8728A9E9E400DE050D /* RoomSailingPrizeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomSailingPrizeModel.m; sourceTree = "<group>"; };
|
||||
E8BD0F8928A9EB0A00DE050D /* RoomSailingPrizeListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RoomSailingPrizeListModel.h; sourceTree = "<group>"; };
|
||||
E8BD0F8A28A9EB0A00DE050D /* RoomSailingPrizeListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RoomSailingPrizeListModel.m; sourceTree = "<group>"; };
|
||||
E8C1670728067DAA00ECB15C /* XPMineGuildSuperAdminSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGuildSuperAdminSetViewController.h; sourceTree = "<group>"; };
|
||||
E8C1670828067DAA00ECB15C /* XPMineGuildSuperAdminSetViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGuildSuperAdminSetViewController.m; sourceTree = "<group>"; };
|
||||
E8C1670A28067DED00ECB15C /* XPMineGuildChooseManagerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGuildChooseManagerViewController.h; sourceTree = "<group>"; };
|
||||
@@ -3970,6 +3973,8 @@
|
||||
E8E0DADF285C20E500566A2F /* MessageContentFindNewGreetView.m */,
|
||||
E86E79CB28A4E045006DAF48 /* MessageContentRiskAlertView.h */,
|
||||
E86E79CC28A4E045006DAF48 /* MessageContentRiskAlertView.m */,
|
||||
E85E3FA528B7A6F000268DC8 /* MessageContentMonentsView.h */,
|
||||
E85E3FA628B7A6F000268DC8 /* MessageContentMonentsView.m */,
|
||||
);
|
||||
path = Content;
|
||||
sourceTree = "<group>";
|
||||
@@ -9321,6 +9326,7 @@
|
||||
E824545126F5CE6E00BE8163 /* XPMineModifPayPwdPresenter.m in Sources */,
|
||||
E8A86DF727BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m in Sources */,
|
||||
E8098CB1282E86EF0090B9F0 /* XPMonentsContentView.m in Sources */,
|
||||
E85E3FA728B7A6F000268DC8 /* MessageContentMonentsView.m in Sources */,
|
||||
E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */,
|
||||
E8B9842D28AB77F10022D026 /* XPMonentsPublishTopicView.m in Sources */,
|
||||
E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */,
|
||||
|
22
xplan-ios/Assets.xcassets/Monents/monents_common_landLordFlag.imageset/Contents.json
vendored
Normal file
22
xplan-ios/Assets.xcassets/Monents/monents_common_landLordFlag.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "monents_common_landLordFlag@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "monents_common_landLordFlag@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
@@ -58,7 +58,9 @@
|
||||
} else if(attachment.first == CustomMessageType_FindNew && attachment.second == Custom_Message_Find_New_Greet_New_User) {
|
||||
NSString * text = attachment.data[@"message"];
|
||||
return text.length > 0 ? text : @"[消息]";
|
||||
} else{
|
||||
} else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
|
||||
return @"[分享了一条动态]";
|
||||
} else{
|
||||
text = @"[消息]";
|
||||
}
|
||||
if (!text) {
|
||||
|
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// MessageContentMonentsView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/25.
|
||||
//
|
||||
|
||||
#import "MessageContentCustomView.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MessageContentMonentsView : MessageContentCustomView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// MessageContentMonentsView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by 冯硕 on 2022/8/25.
|
||||
//
|
||||
|
||||
#import "MessageContentMonentsView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "NetImageView.h"
|
||||
#import "ThemeColor.h"
|
||||
#import "XPGiftStorage.h"
|
||||
#import "NSObject+MJExtension.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
///Model
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
///View
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
#import "MonentsInfoModel.h"
|
||||
@interface MessageContentMonentsView ()
|
||||
///礼物的
|
||||
@property (nonatomic,strong) NetImageView *monentsView;
|
||||
///显示名字
|
||||
@property (nonatomic,strong) UILabel *titleLabel;
|
||||
///描述
|
||||
@property (nonatomic,strong) UILabel *contentLabel;
|
||||
///动态
|
||||
@property (nonatomic,strong) MonentsInfoModel *monents;
|
||||
@end
|
||||
|
||||
@implementation MessageContentMonentsView
|
||||
|
||||
+ (CGFloat)measureHeight:(NIMMessage *)message {
|
||||
return (CONTENT_PADDING_V_TOTAL + 80);
|
||||
}
|
||||
|
||||
- (void)initSubViews {
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapBackView)];
|
||||
[self.backView addGestureRecognizer:tap];
|
||||
[super initSubViews];
|
||||
[self addSubview:self.backView];
|
||||
|
||||
[self.backView addSubview:self.monentsView];
|
||||
[self.backView addSubview:self.titleLabel];
|
||||
[self.backView addSubview:self.contentLabel];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[super initSubViewConstraints];
|
||||
[self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(250, 80));
|
||||
}];
|
||||
|
||||
[self.monentsView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(50, 50));
|
||||
make.left.mas_equalTo(self.backView);
|
||||
make.centerY.mas_equalTo(self.backView);
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.monentsView.mas_right).offset(10);
|
||||
make.bottom.mas_equalTo(self.monentsView.mas_centerY).offset(-3);
|
||||
make.right.mas_lessThanOrEqualTo(self.backView).offset(-10);
|
||||
}];
|
||||
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.titleLabel);
|
||||
make.top.mas_equalTo(self.monentsView.mas_centerY).offset(3);
|
||||
make.right.mas_lessThanOrEqualTo(self.backView).offset(-10);
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)tapBackView {
|
||||
XPMonentsDetailViewController * detailView = [[XPMonentsDetailViewController alloc] init];
|
||||
detailView.monentsInfo = self.monents;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:detailView animated:YES];
|
||||
}
|
||||
|
||||
- (void)render:(NIMMessage *)message {
|
||||
NIMCustomObject *obj = (NIMCustomObject *)message.messageObject;
|
||||
AttachmentModel * attach = obj.attachment;
|
||||
NSDictionary * dic = attach.data;
|
||||
self.monents = [MonentsInfoModel modelWithDictionary:dic];
|
||||
self.monentsView.imageUrl = dic[@"imageUrl"];
|
||||
NSString * nick = self.monents.nick;
|
||||
if (nick.length > 6) {
|
||||
nick = [nick substringToIndex:6];
|
||||
}
|
||||
NSString * title = [NSString stringWithFormat:@"%@%@",nick, @"发布了一条动态"];
|
||||
self.titleLabel.text = dic[@"title"] ? dic[@"title"] : title;
|
||||
self.contentLabel.text = self.monents.content;
|
||||
}
|
||||
|
||||
- (NetImageView *)monentsView {
|
||||
if (!_monentsView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.imageType = ImageTypeUserIcon;
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
_monentsView = [[NetImageView alloc] initWithConfig:config];
|
||||
_monentsView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_monentsView.layer.masksToBounds = YES;
|
||||
_monentsView.layer.cornerRadius = 10;
|
||||
}
|
||||
return _monentsView;
|
||||
}
|
||||
|
||||
- (UILabel *)titleLabel {
|
||||
if (!_titleLabel) {
|
||||
_titleLabel = [[UILabel alloc] init];
|
||||
_titleLabel.font = [UIFont systemFontOfSize:15];
|
||||
_titleLabel.textColor = [ThemeColor mainTextColor];
|
||||
}
|
||||
return _titleLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)contentLabel {
|
||||
if (!_contentLabel) {
|
||||
_contentLabel = [[UILabel alloc] init];
|
||||
_contentLabel.font = [UIFont systemFontOfSize:12];
|
||||
_contentLabel.textColor = [ThemeColor secondTextColor];
|
||||
}
|
||||
return _contentLabel;
|
||||
}@end
|
@@ -22,6 +22,7 @@
|
||||
#import "MessageContentSkillCardView.h"
|
||||
#import "MessageContentFindNewGreetView.h"
|
||||
#import "MessageContentRiskAlertView.h"
|
||||
#import "MessageContentMonentsView.h"
|
||||
|
||||
#import "AttachmentModel.h"
|
||||
#import "NetImageView.h"
|
||||
@@ -256,6 +257,8 @@
|
||||
return @"MessageContentFindNewGreetView";
|
||||
} else if(attachment.first == CustomMessageType_Chat_Risk_Alert) {
|
||||
return @"MessageContentRiskAlertView";
|
||||
}else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
|
||||
return @"MessageContentMonentsView";
|
||||
} else {
|
||||
return @"MessageContentOpenLiveView";
|
||||
}
|
||||
@@ -297,7 +300,9 @@
|
||||
return [MessageContentFindNewGreetView measureHeight:message];
|
||||
} else if(attachment.first == CustomMessageType_Chat_Risk_Alert) {
|
||||
return [MessageContentRiskAlertView measureHeight:message];
|
||||
} else {
|
||||
} else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
|
||||
return [MessageContentMonentsView measureHeight:message];
|
||||
} else {
|
||||
return [MessageContentUnSupportView measureHeight:message];
|
||||
}
|
||||
}
|
||||
@@ -357,6 +362,11 @@
|
||||
return self.messageContent;
|
||||
}
|
||||
return [[MessageContentRiskAlertView alloc] init];
|
||||
}else if(attachment.first == CustomMessageType_Monents && attachment.second == Custom_Message_Sub_Monents_Share) {
|
||||
if ([self.messageContent isKindOfClass:[MessageContentMonentsView class]]) {
|
||||
return self.messageContent;
|
||||
}
|
||||
return [[MessageContentMonentsView alloc] init];
|
||||
}else {
|
||||
if ([self.messageContent isKindOfClass:[MessageContentUnSupportView class]]) {
|
||||
return self.messageContent;
|
||||
|
@@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic, copy) NSString *commentId;
|
||||
///回复的内容
|
||||
@property (nonatomic,strong) MonentsCommentReplyModel *replyInfo;
|
||||
/// 是否是楼主
|
||||
@property (nonatomic, assign) BOOL landLordFlag;
|
||||
@end
|
||||
|
||||
|
||||
|
@@ -69,7 +69,7 @@
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId]
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
|
@@ -16,6 +16,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 点赞人的uid
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -25,4 +25,14 @@
|
||||
[[self getView] likeMonentsSuccess:dynamicId status:status];
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
@end
|
||||
|
@@ -27,6 +27,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 点赞人的uid
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -56,4 +56,14 @@
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 点赞人的uid
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
- (void)getMonentsTopicLatestList:(NSString *)dynamicId worldId:(NSString *)worldId state:(int)state {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsTopicRecommendList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api monentsTopicLatestList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
MonentsListInfoModel * model = [MonentsListInfoModel modelWithDictionary:data.data];
|
||||
[[self getView] getMonentsTopicLatestListSuccess:model state:state];
|
||||
}fail:^(NSInteger code, NSString * _Nullable msg) {
|
||||
@@ -34,4 +34,15 @@
|
||||
[[self getView] likeMonentsSuccess:dynamicId status:status];
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -11,6 +11,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMonentsTopicListPresenter : BaseMvpPresenter
|
||||
- (void)getMoentsTopicList:(int)page pageSize:(int)pageSize state:(int)state;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -25,4 +25,15 @@
|
||||
}] uid:uid page:pageStr pageSize:pageSizeStr worldTypeId:@"0"];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 点赞人的uid
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -34,4 +34,14 @@
|
||||
[[self getView] likeMonentsSuccess:dynamicId status:status];
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
@end
|
||||
|
@@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@protocol XPMonentsMineProtocol <NSObject>
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -15,7 +15,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getMonentsTopicLatestListFail:(NSString *)msg state:(int)state;
|
||||
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;;
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getMonentsTopicListSuccess:(NSArray *)list state:(int)state;
|
||||
|
||||
- (void)getMoentsTopicFail:(NSString *)message state:(int)state;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -16,7 +16,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getMonentsTopicRecommendListFail:(NSString *)msg state:(int)state;
|
||||
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;;
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -8,12 +8,13 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsCommentModel, XPMonentsCommentTableViewCell;
|
||||
@class MonentsCommentModel, XPMonentsCommentTableViewCell, MonentsReplyModel;
|
||||
|
||||
@protocol XPMonentsCommentTableViewCellDelegate <NSObject>
|
||||
///点击了查看更多
|
||||
- (void)xPMonentsCommentTableViewCell:(XPMonentsCommentTableViewCell *)view didClickMoreReply:(MonentsCommentModel *)commentInfo;
|
||||
|
||||
///点击了某个评论
|
||||
- (void)xPMonentsCommentTableViewCell:(XPMonentsCommentTableViewCell *)view didClickCommon:(MonentsReplyModel *)commentInfo;
|
||||
@end
|
||||
|
||||
@interface XPMonentsCommentTableViewCell : UITableViewCell
|
||||
|
@@ -15,6 +15,7 @@
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "NSString+Utils.h"
|
||||
#import "QEmotionHelper.h"
|
||||
#import "AccountInfoStorage.h"
|
||||
///Model
|
||||
#import "MonentsCommentModel.h"
|
||||
///View
|
||||
@@ -30,6 +31,8 @@
|
||||
@property (nonatomic,strong) NetImageView *commentAvatarView;
|
||||
///评论者的昵称
|
||||
@property (nonatomic,strong) UILabel *commentNickLabel;
|
||||
///楼主
|
||||
@property (nonatomic,strong) UIImageView *ownerImageView;
|
||||
///评论的内容
|
||||
@property (nonatomic,strong) YYLabel *commentLabel;
|
||||
///时间
|
||||
@@ -68,6 +71,7 @@
|
||||
|
||||
[self.commentUserView addSubview:self.commentAvatarView];
|
||||
[self.commentUserView addSubview:self.commentNickLabel];
|
||||
[self.commentUserView addSubview:self.ownerImageView];
|
||||
[self.commentUserView addSubview:self.commentLabel];
|
||||
[self.commentUserView addSubview:self.commentDateLabel];
|
||||
}
|
||||
@@ -98,7 +102,12 @@
|
||||
make.left.mas_equalTo(self.commentAvatarView.mas_right).offset(10);
|
||||
make.top.mas_equalTo(self.commentUserView).offset(10);
|
||||
make.height.mas_equalTo(15);
|
||||
make.right.mas_lessThanOrEqualTo(self.commentDateLabel.mas_left).offset(-10);
|
||||
}];
|
||||
|
||||
[self.ownerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(32, 15));
|
||||
make.centerY.mas_equalTo(self.commentNickLabel);
|
||||
make.left.mas_equalTo(self.commentNickLabel.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.commentDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -139,12 +148,20 @@
|
||||
cell.replyInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
return cell;
|
||||
}
|
||||
|
||||
XPMonentsReplyMoreTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsReplyMoreTableViewCell class])];
|
||||
cell.leftCount = self.commentInfo.replyInfo.leftCount;
|
||||
cell.delegate = self;
|
||||
return cell;
|
||||
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (indexPath.section == 0 && self.datasource.count > 0) {
|
||||
MonentsReplyModel * replyInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
if (replyInfo.uid.integerValue != [AccountInfoStorage instance].getUid.integerValue && self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsCommentTableViewCell:didClickCommon:)]) {
|
||||
[self.delegate xPMonentsCommentTableViewCell:self didClickCommon:replyInfo];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsReplyMoreTableViewCellDelegate
|
||||
@@ -158,6 +175,7 @@
|
||||
- (void)setCommentInfo:(MonentsCommentModel *)commentInfo {
|
||||
_commentInfo = commentInfo;
|
||||
if (_commentInfo) {
|
||||
self.ownerImageView.hidden = !_commentInfo.landLordFlag;
|
||||
self.commentAvatarView.imageUrl = _commentInfo.avatar;
|
||||
NSString * nick = _commentInfo.nick;
|
||||
if (nick.length > 8) {
|
||||
@@ -279,4 +297,14 @@
|
||||
return _lineContainerView;
|
||||
}
|
||||
|
||||
- (UIImageView *)ownerImageView {
|
||||
if (!_ownerImageView) {
|
||||
_ownerImageView = [[UIImageView alloc] init];
|
||||
_ownerImageView.userInteractionEnabled = YES;
|
||||
_ownerImageView.image = [UIImage imageNamed:@"monents_common_landLordFlag"];
|
||||
_ownerImageView.hidden = YES;
|
||||
}
|
||||
return _ownerImageView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -24,6 +24,8 @@
|
||||
@property (nonatomic,strong) NetImageView *avatarImageView;
|
||||
///自己的名字
|
||||
@property (nonatomic,strong) UILabel *nickLabel;
|
||||
///房主
|
||||
@property (nonatomic,strong) UIImageView *ownerImageView;
|
||||
///内容
|
||||
@property (nonatomic,strong) YYLabel *contentLabel;
|
||||
///时间
|
||||
@@ -50,6 +52,7 @@
|
||||
self.selectionStyle = UITableViewCellSelectionStyleNone;
|
||||
[self.contentView addSubview:self.avatarImageView];
|
||||
[self.contentView addSubview:self.nickLabel];
|
||||
[self.contentView addSubview:self.ownerImageView];
|
||||
[self.contentView addSubview:self.contentLabel];
|
||||
[self.contentView addSubview:self.dateLabel];
|
||||
[self.contentView addSubview:self.lineView];
|
||||
@@ -66,9 +69,14 @@
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(kMONENTS_COMMENT_AVATAR_NICK_PADDING);
|
||||
make.top.mas_equalTo(self.contentView).offset(10);
|
||||
make.height.mas_equalTo(15);
|
||||
make.right.mas_lessThanOrEqualTo(self.dateLabel).offset(-5);
|
||||
}];
|
||||
|
||||
|
||||
[self.ownerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(30, 15));
|
||||
make.centerY.mas_equalTo(self.nickLabel);
|
||||
make.left.mas_equalTo(self.nickLabel.mas_right).offset(5);
|
||||
}];
|
||||
|
||||
[self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.nickLabel);
|
||||
make.top.mas_equalTo(self.nickLabel.mas_bottom).offset(10);
|
||||
@@ -97,6 +105,7 @@
|
||||
if (nick.length > 8) {
|
||||
nick = [nick substringToIndex:8];
|
||||
}
|
||||
self.ownerImageView.hidden = !_replyInfo.landLordFlag;
|
||||
self.nickLabel.text = nick;
|
||||
self.dateLabel.text = [NSString stringWithTimeStamp:_replyInfo.publishTime];
|
||||
self.contentLabel.attributedText = _replyInfo.contentAttribute;
|
||||
@@ -151,5 +160,15 @@
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
- (UIImageView *)ownerImageView {
|
||||
if (!_ownerImageView) {
|
||||
_ownerImageView = [[UIImageView alloc] init];
|
||||
_ownerImageView.userInteractionEnabled = YES;
|
||||
_ownerImageView.image = [UIImage imageNamed:@"monents_common_landLordFlag"];
|
||||
_ownerImageView.hidden = YES;
|
||||
}
|
||||
return _ownerImageView;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -15,12 +15,17 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo;
|
||||
///点击了删除
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo;
|
||||
@optional
|
||||
///点击了评论
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicCommon:(MonentsInfoModel *)monentsInfo;
|
||||
@end
|
||||
|
||||
@interface XPMonentsTableViewCell : UITableViewCell
|
||||
@property (nonatomic,strong) MonentsInfoModel *monentsInfo;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMonentsTableViewCellDelegate> delegate;
|
||||
///列表
|
||||
@property (nonatomic,weak) UITableView * tableView;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -27,7 +27,7 @@
|
||||
#import "XPMonentTopicContainerViewController.h"
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
@interface XPMonentsTableViewCell ()<XPMonentsTooBarViewDelegate, XPMonentsTooBarViewDelegate, XPMonentsPhotoViewDelegate, SDPhotoBrowserDelegate, XPMonentsUserInfoViewDelegate>
|
||||
@interface XPMonentsTableViewCell ()<XPMonentsTooBarViewDelegate, XPMonentsTooBarViewDelegate, XPMonentsPhotoViewDelegate, SDPhotoBrowserDelegate, XPMonentsUserInfoViewDelegate, XPMonentsContentViewDelegate>
|
||||
///显示颜色的 有的时候stackView 不能显示颜色
|
||||
@property (nonatomic,strong) UIView * backView;
|
||||
///容器
|
||||
@@ -116,11 +116,22 @@
|
||||
}
|
||||
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickDelete:(MonentsInfoModel *)monentsInfo {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTooBarView:didClickDelete:)]) {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTableViewCell:didClicDelete:)]) {
|
||||
[self.delegate xPMonentsTableViewCell:self didClicDelete:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickCommon:(MonentsInfoModel *)monentsInfo {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTableViewCell:didClicCommon:)]) {
|
||||
[self.delegate xPMonentsTableViewCell:self didClicCommon:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsContentViewDelegate
|
||||
- (void)xPMonentsContentView:(XPMonentsContentView *)view didClickFold:(MonentsInfoModel *)monentsInfo {
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
#pragma mark - SDPhotoBrowserDelegate
|
||||
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {
|
||||
MonentsPicInfoModel *picinfo = [self.monentsInfo.dynamicResList objectAtIndex:index];
|
||||
@@ -219,6 +230,7 @@
|
||||
- (XPMonentsContentView *)textView {
|
||||
if (!_textView) {
|
||||
_textView = [[XPMonentsContentView alloc] init];
|
||||
_textView.delegate = self;
|
||||
}
|
||||
return _textView;
|
||||
}
|
||||
|
@@ -8,9 +8,19 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsInfoModel;
|
||||
@class MonentsInfoModel, XPMonentsContentView;
|
||||
|
||||
@protocol XPMonentsContentViewDelegate <NSObject>
|
||||
|
||||
///点击这折叠
|
||||
- (void)xPMonentsContentView:(XPMonentsContentView *)view didClickFold:(MonentsInfoModel *)monentsInfo;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPMonentsContentView : UIView
|
||||
@property (nonatomic,strong) MonentsInfoModel *monentsInfo;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMonentsContentViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -93,7 +93,11 @@
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)didClickFoldButton:(UIButton *)sender {
|
||||
//TODO: 展开收起
|
||||
sender.selected = !sender.selected;
|
||||
self.monentsInfo.isFold = !sender.selected;
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsContentView:didClickFold:)]) {
|
||||
[self.delegate xPMonentsContentView:self didClickFold:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
|
@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickLike:(MonentsInfoModel *)monentsInfo;
|
||||
///删除
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickDelete:(MonentsInfoModel *)monentsInfo;
|
||||
///评论
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickCommon:(MonentsInfoModel *)monentsInfo;
|
||||
@end
|
||||
|
||||
@interface XPMonentsTooBarView : UIView
|
||||
|
@@ -129,6 +129,15 @@
|
||||
}];
|
||||
}
|
||||
#pragma mark - Event Response
|
||||
- (void)commonButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTooBarView:didClickCommon:)]) {
|
||||
self.commentButton.userInteractionEnabled = YES;
|
||||
[self.delegate xPMonentsTooBarView:self didClickCommon:self.monentsInfo];
|
||||
} else {
|
||||
self.commentButton.userInteractionEnabled = NO;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)likeButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTooBarView:didClickLike:)]) {
|
||||
[self.delegate xPMonentsTooBarView:self didClickLike:self.monentsInfo];
|
||||
@@ -250,8 +259,7 @@
|
||||
_commentButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_commentButton setImage:[UIImage imageNamed:@"monents_info_comment_count"] forState:UIControlStateNormal];
|
||||
[_commentButton setImage:[UIImage imageNamed:@"monents_info_comment_count"] forState:UIControlStateSelected];
|
||||
[_commentButton addTarget:self action:@selector(likeButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
_commentButton.userInteractionEnabled = NO;
|
||||
[_commentButton addTarget:self action:@selector(commonButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _commentButton;
|
||||
}
|
||||
|
@@ -151,13 +151,19 @@
|
||||
}];
|
||||
|
||||
[self.tagStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self).offset(-15);
|
||||
make.right.mas_equalTo(self).offset(-15);
|
||||
make.centerY.mas_equalTo(self.nickLabel);
|
||||
make.height.mas_equalTo(14);
|
||||
}];
|
||||
|
||||
[self.onlineButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(55, 18));
|
||||
make.right.mas_equalTo(self.tagStackView);
|
||||
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(4);
|
||||
}];
|
||||
|
||||
[self.firstTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(35);
|
||||
make.width.mas_equalTo(28);
|
||||
}];
|
||||
|
||||
[self.secondTagImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -225,11 +231,14 @@
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
}];
|
||||
}
|
||||
|
||||
self.firstTagImageView.hidden = YES;
|
||||
self.secondTagImageView.hidden = YES;
|
||||
self.thirdTagImageView.hidden = YES;
|
||||
for (int i = 0; i< _monentsInfo.labelList.count; i++) {
|
||||
NSString * imageUrl = [_monentsInfo.labelList objectAtIndex:i];
|
||||
if (i < self.tagStackView.subviews.count) {
|
||||
NetImageView * image = [self.tagStackView.subviews objectAtIndex:i];
|
||||
image.hidden = NO;
|
||||
image.imageUrl = imageUrl;
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
@interface XPMonentTopicContainerViewController ()<JXPagerViewDelegate,JXCategoryViewDelegate>
|
||||
@property (nonatomic,strong) JXCategoryTitleView *categoryView;
|
||||
@property (nonatomic,strong) JXCategoryIndicatorLineView *lineView;
|
||||
@property (nonatomic,strong) JXPagerView *pagerView;
|
||||
@property (nonatomic,strong) JXPagerListRefreshView *pagerView;
|
||||
@property (nonatomic,strong) NSArray<NSString *> *titles;
|
||||
@property (nonatomic,strong) XPMonentsTopicRecommondViewController *recommendVC;
|
||||
@property (nonatomic,strong) XPMonentsTopicLatestViewController *latestVC;
|
||||
@@ -150,7 +150,7 @@
|
||||
_categoryView.titleColorGradientEnabled = YES;
|
||||
_categoryView.titleLabelZoomEnabled = NO;
|
||||
_categoryView.indicators = @[self.lineView];
|
||||
_categoryView.contentScrollView = self.pagerView.listContainerView.scrollView;
|
||||
_categoryView.listContainer = (id<JXCategoryViewListContainer>)self.pagerView.listContainerView;
|
||||
_categoryView.averageCellSpacingEnabled = NO;
|
||||
_categoryView.contentEdgeInsetLeft = 20;
|
||||
_categoryView.contentEdgeInsetRight = 20;
|
||||
@@ -171,7 +171,7 @@
|
||||
return _lineView;
|
||||
}
|
||||
|
||||
- (JXPagerView *)pagerView {
|
||||
- (JXPagerListRefreshView *)pagerView {
|
||||
if (!_pagerView) {
|
||||
_pagerView = [[JXPagerListRefreshView alloc] initWithDelegate:self];
|
||||
_pagerView.listContainerView.scrollView.backgroundColor = UIColor.clearColor;
|
||||
|
@@ -24,6 +24,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -42,4 +42,15 @@
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -17,6 +17,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsListInfoModel.h"
|
||||
///P
|
||||
@@ -23,7 +24,7 @@
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsAttentionViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsAttentionProtocol, XPMonentsTableViewCellDelegate>
|
||||
@interface XPMonentsAttentionViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsAttentionProtocol, XPMonentsTableViewCellDelegate, XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -129,15 +130,39 @@
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -JXCategoryListContainerViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
@@ -189,6 +214,21 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
@@ -8,9 +8,18 @@
|
||||
#import "MvpViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsInfoModel;
|
||||
@class MonentsInfoModel, XPMonentsDetailViewController;
|
||||
@protocol XPMonentsDetailViewControllerDelegate <NSObject>
|
||||
|
||||
///删除了动态
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPMonentsDetailViewController : MvpViewController
|
||||
@property (nonatomic,strong) MonentsInfoModel *monentsInfo;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMonentsDetailViewControllerDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -14,9 +14,11 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "QEmotionHelper.h"
|
||||
#import "QKeyboardManager.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsInfoModel.h"
|
||||
#import "MonentsCommentModel.h"
|
||||
#import "MonentsCommentReplyModel.h"
|
||||
///View
|
||||
#import "XPMonentsTableViewCell.h"
|
||||
#import "XPMonentsCommentTableViewCell.h"
|
||||
@@ -40,7 +42,7 @@
|
||||
@property(nonatomic,strong)QInputBarView *inputBarView;
|
||||
@property(nonatomic,strong)QKeyboardManager *keyboardManager;
|
||||
///当前选中的评论信息
|
||||
@property (nonatomic,strong) MonentsCommentModel *selectCommonInfo;
|
||||
@property (nonatomic,strong) NSString *commentId;
|
||||
@end
|
||||
|
||||
@implementation XPMonentsDetailViewController
|
||||
@@ -113,8 +115,8 @@
|
||||
- (void)sendTextMessage:(NSString *)inputText {
|
||||
if (inputText.length > 0) {
|
||||
[_keyboardManager hideAllBoardView];
|
||||
if (self.selectCommonInfo && self.selectCommonInfo.commentId.length > 0) {
|
||||
[self.presenter replayCommon:self.selectCommonInfo.commentId dynamicId:self.monentsInfo.dynamicId content:inputText];
|
||||
if (self.commentId && self.commentId.length > 0) {
|
||||
[self.presenter replayCommon:self.commentId dynamicId:self.monentsInfo.dynamicId content:inputText];
|
||||
} else {
|
||||
[self.presenter commontMonents:self.monentsInfo.dynamicId content:inputText];
|
||||
}
|
||||
@@ -214,7 +216,7 @@
|
||||
if (indexPath.section == 1) {
|
||||
if (self.datasource.count > 0) {
|
||||
MonentsCommentModel* monent = [self.datasource objectAtIndex:indexPath.row];
|
||||
self.selectCommonInfo = monent;
|
||||
self.commentId = monent.commentId;
|
||||
self.inputBarView.inputTextView.placeholder = [NSString stringWithFormat:@"回复: %@", monent.nick];
|
||||
[self.inputBarView textViewBecomeFirstResponder];
|
||||
}
|
||||
@@ -230,13 +232,33 @@
|
||||
[self.presenter getMonentsCommentReplyList:self.monentsInfo.dynamicId commentId:commentInfo.commentId timestamp:commentInfo.replyInfo.nextTimestamp];
|
||||
}
|
||||
|
||||
- (void)xPMonentsCommentTableViewCell:(XPMonentsCommentTableViewCell *)view didClickCommon:(MonentsReplyModel *)commentInfo {
|
||||
if (commentInfo) {
|
||||
self.commentId = commentInfo.replyId;
|
||||
self.inputBarView.inputTextView.placeholder = [NSString stringWithFormat:@"回复: %@", commentInfo.nick];
|
||||
[self.inputBarView textViewBecomeFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicCommon:(MonentsInfoModel *)monentsInfo {
|
||||
if (monentsInfo) {
|
||||
self.commentId = nil;
|
||||
self.inputBarView.inputTextView.placeholder = @"发表评论";
|
||||
[self.inputBarView textViewBecomeFirstResponder];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - InputBoardDataSource
|
||||
@@ -285,7 +307,7 @@
|
||||
if (emotionSwitchButton.isSelected) {
|
||||
[_keyboardManager switchToEmotionBoardKeyboard];
|
||||
} else {
|
||||
self.selectCommonInfo = nil;
|
||||
self.commentId = nil;
|
||||
_inputBarView.inputTextView.placeholder = @"发表评论";
|
||||
[_inputBarView textViewBecomeFirstResponder];
|
||||
}
|
||||
@@ -392,6 +414,9 @@
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsDetailViewController:deleteMonents:)]) {
|
||||
[self.delegate xPMonentsDetailViewController:self deleteMonents:self.monentsInfo.dynamicId];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -21,6 +21,7 @@
|
||||
///View
|
||||
#import "XPMonentsInteractiveTableViewCell.h"
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsInteractiveViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsInteractiveProtocol>
|
||||
///列表
|
||||
@@ -120,6 +121,16 @@
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark -JXCategoryListContainerViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
|
@@ -23,6 +23,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param likedUid 点赞人的uid
|
||||
/// @param worldId 话题的id
|
||||
- (void)likeMonent:(NSString *)dynamicId status:(BOOL)status likedUid:(NSString *)likedUid worldId:(NSString *)worldId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -42,4 +42,14 @@
|
||||
} showLoading:YES] dynamicId:dynamicId uid:uid status:statusStr likedUid:likedUid worldId:worldId];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param dynamicId 动态id
|
||||
/// @param worldId 话题id
|
||||
- (void)deleteMonents:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
NSString * uid = [AccountInfoStorage instance].getUid;
|
||||
[Api monentsDelete:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[[self getView] deleteMonentsSuccess:dynamicId];
|
||||
} uid:uid dynamicId:dynamicId worldId:worldId];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -16,7 +16,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)getMonentsLatestListFail:(NSString *)msg state:(int)state;
|
||||
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;;
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsListInfoModel.h"
|
||||
///P
|
||||
@@ -23,7 +24,7 @@
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsLatestViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsLatestProtocol, XPMonentsTableViewCellDelegate>
|
||||
@interface XPMonentsLatestViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsLatestProtocol, XPMonentsTableViewCellDelegate,XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -38,6 +39,10 @@
|
||||
|
||||
@implementation XPMonentsLatestViewController
|
||||
|
||||
- (void)dealloc {
|
||||
NSLog(@"你阿宁");
|
||||
}
|
||||
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
@@ -117,6 +122,7 @@
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
cell.monentsInfo = monentsInfo;
|
||||
cell.delegate = self;
|
||||
cell.tableView = tableView;
|
||||
return cell;
|
||||
}
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
@@ -129,14 +135,38 @@
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -JXCategoryListContainerViewDelegate
|
||||
- (UIView *)listView {
|
||||
return self.view;
|
||||
@@ -191,6 +221,21 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsListInfoModel.h"
|
||||
///P
|
||||
@@ -21,8 +22,9 @@
|
||||
///View
|
||||
#import "XPMonentsTableViewCell.h"
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMonentsTableViewCellDelegate, XPMonentsMineProtocol>
|
||||
@interface XPMonentsMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMonentsTableViewCellDelegate, XPMonentsMineProtocol, XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -85,11 +87,45 @@
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsMineProtocol
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status {
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
@@ -105,6 +141,21 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
- (UIScrollView *)listScrollView {
|
||||
|
@@ -380,10 +380,6 @@
|
||||
|
||||
- (void)publicButtonAction:(UIButton *)sender {
|
||||
[self.view endEditing:YES];
|
||||
if (self.topicInfo.worldId.length <= 0) {
|
||||
[self showErrorToast:@"请选择一个话题"];
|
||||
return;
|
||||
}
|
||||
if (self.textView.text.length > 0) {
|
||||
if (self.uploadImageList.count > 0) {
|
||||
[self showLoading];
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsInfoModel.h"
|
||||
#import "MonentsTopicModel.h"
|
||||
@@ -27,7 +28,7 @@
|
||||
#import "XPMonentTopicContainerViewController.h"
|
||||
#import "XPMoentsTopicListViewController.h"
|
||||
|
||||
@interface XPMonentsRecommendViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsRecommendProtocol, XPMonentsTableViewCellDelegate,XPMonentsRecommendHeaderViewDelegate>
|
||||
@interface XPMonentsRecommendViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsRecommendProtocol, XPMonentsTableViewCellDelegate,XPMonentsRecommendHeaderViewDelegate, XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -90,7 +91,7 @@
|
||||
- (void)headerRefresh {
|
||||
self.page = 1;
|
||||
[self.presenter getMonentsRecommendList:self.page pageSize:20 state:0];
|
||||
[self.presenter getMonentsTopicList:self.page pageSize:30];
|
||||
[self.presenter getMonentsTopicList:self.page pageSize:8];
|
||||
}
|
||||
|
||||
- (void)footerRefresh {
|
||||
@@ -123,6 +124,7 @@
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
cell.monentsInfo = monentsInfo;
|
||||
cell.delegate = self;
|
||||
cell.tableView = tableView;
|
||||
return cell;
|
||||
}
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
@@ -135,14 +137,38 @@
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsRecommendHeaderViewDelegate
|
||||
- (void)xPMonentsRecommendHeaderView:(XPMonentsRecommendHeaderView *)view didSelectItem:(MonentsTopicModel *)info {
|
||||
XPMonentTopicContainerViewController * topicVC = [[XPMonentTopicContainerViewController alloc] init];
|
||||
@@ -209,6 +235,20 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsListInfoModel.h"
|
||||
///P
|
||||
@@ -21,8 +22,9 @@
|
||||
///View
|
||||
#import "XPMonentsTableViewCell.h"
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsTopicLatestViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsTopicLatestProtocol, XPMonentsTableViewCellDelegate>
|
||||
@interface XPMonentsTopicLatestViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsTopicLatestProtocol, XPMonentsTableViewCellDelegate, XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -117,11 +119,30 @@
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
- (UIScrollView *)listScrollView {
|
||||
return self.tableView;
|
||||
@@ -139,6 +160,21 @@
|
||||
self.scrollCallback(scrollView);
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTopicLatestProtocol
|
||||
- (void)getMonentsTopicLatestListSuccess:(MonentsListInfoModel *)listInfo state:(int)state{
|
||||
self.listInfo = listInfo;
|
||||
@@ -185,6 +221,21 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
@@ -13,6 +13,7 @@
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "TTPopup.h"
|
||||
///Model
|
||||
#import "MonentsListInfoModel.h"
|
||||
///P
|
||||
@@ -21,8 +22,9 @@
|
||||
///View
|
||||
#import "XPMonentsTableViewCell.h"
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsTopicRecommondViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsTopicRecommendProtocol, XPMonentsTableViewCellDelegate>
|
||||
@interface XPMonentsTopicRecommondViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsTopicRecommendProtocol, XPMonentsTableViewCellDelegate, XPMonentsDetailViewControllerDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UITableView *tableView;
|
||||
///数据源
|
||||
@@ -117,11 +119,46 @@
|
||||
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
||||
if (self.datasource.count > 0) {
|
||||
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
|
||||
MonentsInfoModel * monentsInfo = [self.datasource objectAtIndex:indexPath.row];
|
||||
detailVC.monentsInfo = monentsInfo;
|
||||
detailVC.delegate = self;
|
||||
[self.navigationController pushViewController:detailVC animated:YES];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsDetailViewControllerDelegate
|
||||
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTableViewCellDelegate
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
}
|
||||
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
|
||||
[TTPopup alertWithMessage:@"删除后不可恢复\n确定删除该动态吗?" confirmHandler:^{
|
||||
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - JXPagingViewListViewDelegate
|
||||
- (UIScrollView *)listScrollView {
|
||||
return self.tableView;
|
||||
@@ -185,6 +222,21 @@
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
__block MonentsInfoModel * deleteInfo;
|
||||
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
||||
deleteInfo = obj;
|
||||
}
|
||||
}];
|
||||
|
||||
if (deleteInfo) {
|
||||
[self.datasource removeObject:deleteInfo];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
if (!_tableView) {
|
||||
|
Reference in New Issue
Block a user