修复了动态无法删除的问题
This commit is contained in:
@@ -155,6 +155,13 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @param pageSize 一页多少个
|
||||
/// @param worldTypeId 类型
|
||||
+ (void)moentsTopicList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid page:(NSString *)page pageSize:(NSString *)pageSize worldTypeId:(NSString *)worldTypeId;
|
||||
|
||||
/// 删除动态
|
||||
/// @param completion 完成
|
||||
/// @param uid uid
|
||||
/// @param dynamicId 动态的id
|
||||
/// @param worldId 话题的id
|
||||
+ (void)monentsDelete:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -235,4 +235,13 @@
|
||||
[self makeRequest:@"world/list" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, page, pageSize, worldTypeId, nil];
|
||||
}
|
||||
|
||||
/// 删除动态
|
||||
/// @param completion 完成
|
||||
/// @param uid uid
|
||||
/// @param dynamicId 动态的id
|
||||
/// @param worldId 话题的id
|
||||
+ (void)monentsDelete:(HttpRequestHelperCompletion)completion uid:(NSString *)uid dynamicId:(NSString *)dynamicId worldId:(NSString *)worldId {
|
||||
[self makeRequest:@"dynamic/delete" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, uid, dynamicId, worldId, nil];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -29,6 +29,10 @@ 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;
|
||||
/// 评论回复
|
||||
/// @param commonId 评论的id
|
||||
/// @param dynamicId 动态的id
|
||||
|
@@ -63,6 +63,16 @@
|
||||
} 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];
|
||||
}
|
||||
|
||||
|
||||
/// 评论动态
|
||||
/// @param dynamicId 动态的id
|
||||
|
@@ -21,6 +21,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
///点赞/取消动态成功
|
||||
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status;
|
||||
///删除话题成功
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo;
|
||||
|
||||
///评论动态成功
|
||||
- (void)commonMonentsSuccess;
|
||||
///回复某人评论成功
|
||||
|
@@ -11,9 +11,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsInfoModel, XPMonentsTableViewCell;
|
||||
|
||||
@protocol XPMonentsTableViewCellDelegate <NSObject>
|
||||
|
||||
///点击了点赞
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo;
|
||||
|
||||
///点击了删除
|
||||
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo;
|
||||
@end
|
||||
|
||||
@interface XPMonentsTableViewCell : UITableViewCell
|
||||
|
@@ -25,7 +25,9 @@
|
||||
#import "XPMonentsContentView.h"
|
||||
#import "XPMonentsLayoutConfig.h"
|
||||
#import "XPMonentTopicContainerViewController.h"
|
||||
@interface XPMonentsTableViewCell ()<XPMonentsTooBarViewDelegate, XPMonentsTooBarViewDelegate, XPMonentsPhotoViewDelegate, SDPhotoBrowserDelegate>
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
@interface XPMonentsTableViewCell ()<XPMonentsTooBarViewDelegate, XPMonentsTooBarViewDelegate, XPMonentsPhotoViewDelegate, SDPhotoBrowserDelegate, XPMonentsUserInfoViewDelegate>
|
||||
///显示颜色的 有的时候stackView 不能显示颜色
|
||||
@property (nonatomic,strong) UIView * backView;
|
||||
///容器
|
||||
@@ -93,6 +95,18 @@
|
||||
make.height.mas_equalTo(kMONENTS_TOOL_BAR_HEIGHT);
|
||||
}];
|
||||
}
|
||||
#pragma mark - XPMonentsUserInfoViewDelegate
|
||||
- (void)xPMonentsUserInfoView:(XPMonentsUserInfoView *)view didClickEnterRoom:(MonentsInfoModel *)monents {
|
||||
if (monents.inRoomUid.integerValue > 0) {
|
||||
[XPRoomViewController openRoom:monents.inRoomUid viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)xPMonentsUserInfoView:(XPMonentsUserInfoView *)view didClickAvatar:(MonentsInfoModel *)monents {
|
||||
XPMineUserInfoViewController * userInfoVC = [[XPMineUserInfoViewController alloc] init];
|
||||
userInfoVC.uid = monents.uid.integerValue;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:userInfoVC animated:YES];
|
||||
}
|
||||
|
||||
#pragma mark - XPMonentsTooBarViewDelegate
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickLike:(MonentsInfoModel *)monentsInfo {
|
||||
@@ -101,6 +115,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickDelete:(MonentsInfoModel *)monentsInfo {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTooBarView:didClickDelete:)]) {
|
||||
[self.delegate xPMonentsTableViewCell:self didClicDelete:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SDPhotoBrowserDelegate
|
||||
- (NSURL *)photoBrowser:(SDPhotoBrowser *)browser highQualityImageURLForIndex:(NSInteger)index {
|
||||
MonentsPicInfoModel *picinfo = [self.monentsInfo.dynamicResList objectAtIndex:index];
|
||||
@@ -127,7 +147,7 @@
|
||||
- (void)didTapTopicRecognizer {
|
||||
if (self.monentsInfo.worldId > 0) {
|
||||
XPMonentTopicContainerViewController * topicListVC = [[XPMonentTopicContainerViewController alloc] init];
|
||||
topicListVC.worldId = [NSString stringWithFormat:@"%lld", self.monentsInfo.worldId];
|
||||
topicListVC.worldId = [NSString stringWithFormat:@"%ld", self.monentsInfo.worldId];
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:topicListVC animated:YES];
|
||||
}
|
||||
}
|
||||
@@ -172,6 +192,7 @@
|
||||
- (XPMonentsUserInfoView *)userInfoView {
|
||||
if (!_userInfoView) {
|
||||
_userInfoView = [[XPMonentsUserInfoView alloc] init];
|
||||
_userInfoView.delegate = self;
|
||||
}
|
||||
return _userInfoView;
|
||||
}
|
||||
|
@@ -10,9 +10,10 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsInfoModel, XPMonentsTooBarView;
|
||||
@protocol XPMonentsTooBarViewDelegate <NSObject>
|
||||
|
||||
///点赞
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickLike:(MonentsInfoModel *)monentsInfo;
|
||||
|
||||
///删除
|
||||
- (void)xPMonentsTooBarView:(XPMonentsTooBarView *)view didClickDelete:(MonentsInfoModel *)monentsInfo;
|
||||
@end
|
||||
|
||||
@interface XPMonentsTooBarView : UIView
|
||||
|
@@ -136,14 +136,22 @@
|
||||
}
|
||||
|
||||
- (void)reportButtonAction:(UIButton *)sender {
|
||||
TTActionSheetConfig *report = [TTActionSheetConfig normalTitle:@"举报" clickAction:^{
|
||||
TTActionSheetConfig *action;
|
||||
if (self.monentsInfo.uid.integerValue == [AccountInfoStorage instance].getUid.integerValue) {
|
||||
action = [TTActionSheetConfig normalTitle:@"删除" clickAction:^{
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsTooBarView:didClickDelete:)]) {
|
||||
[self.delegate xPMonentsTooBarView:self didClickDelete:self.monentsInfo];
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
action = [TTActionSheetConfig normalTitle:@"举报" clickAction:^{
|
||||
NSString * url= [NSString stringWithFormat:@"%@?reportUid=%@&source=%@", URLWithType(kReportRoomURL),self.monentsInfo.uid, @"WORLDDYNAMIC"];
|
||||
XPWebViewController * webVC = [[XPWebViewController alloc] init];
|
||||
webVC.url = url;
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:webVC animated:YES];
|
||||
}];
|
||||
|
||||
[TTPopup actionSheetWithItems:@[report]];
|
||||
}
|
||||
[TTPopup actionSheetWithItems:@[action]];
|
||||
}
|
||||
|
||||
- (void)shareButtonAction:(UIButton *)sender {
|
||||
|
@@ -8,10 +8,22 @@
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class MonentsInfoModel;
|
||||
@class MonentsInfoModel, XPMonentsUserInfoView;
|
||||
@protocol XPMonentsUserInfoViewDelegate <NSObject>
|
||||
|
||||
///点击了头像
|
||||
- (void)xPMonentsUserInfoView:(XPMonentsUserInfoView *)view didClickAvatar:(MonentsInfoModel *)monents;
|
||||
|
||||
///点击了跟随进房
|
||||
- (void)xPMonentsUserInfoView:(XPMonentsUserInfoView *)view didClickEnterRoom:(MonentsInfoModel *)monents;
|
||||
|
||||
@end
|
||||
@interface XPMonentsUserInfoView : UIView
|
||||
///动态信息
|
||||
@property (nonatomic,strong) MonentsInfoModel *monentsInfo;
|
||||
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMonentsUserInfoViewDelegate> delegate;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -170,8 +170,16 @@
|
||||
}
|
||||
|
||||
#pragma mark - Event Response
|
||||
- (void)onlieButtonAction:(UIButton *)sender {
|
||||
//TODO: 进入直播中的房间
|
||||
- (void)onlineButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsUserInfoView:didClickEnterRoom:)]) {
|
||||
[self.delegate xPMonentsUserInfoView:self didClickEnterRoom:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)didTapAvatarGuest {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMonentsUserInfoView:didClickAvatar:)]) {
|
||||
[self.delegate xPMonentsUserInfoView:self didClickAvatar:self.monentsInfo];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -255,6 +263,8 @@
|
||||
_avatarImageView.layer.masksToBounds = YES;
|
||||
_avatarImageView.layer.cornerRadius = 20;
|
||||
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapAvatarGuest)];
|
||||
[_avatarImageView addGestureRecognizer:tap];
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
@@ -401,16 +411,16 @@
|
||||
- (UIButton *)onlineButton {
|
||||
if (!_onlineButton) {
|
||||
_onlineButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_onlineButton setTitle:@"邀请" forState:UIControlStateNormal];
|
||||
[_onlineButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
_onlineButton.titleLabel.font = [UIFont systemFontOfSize:12];
|
||||
_onlineButton.backgroundColor = [UIColor whiteColor];
|
||||
[_onlineButton setTitle:@"直播中" forState:UIControlStateNormal];
|
||||
[_onlineButton setImage:[UIImage imageNamed:@"home_search_user_online"] forState:UIControlStateNormal];
|
||||
[_onlineButton setTitleColor:[ThemeColor appEmphasizeColor] forState:UIControlStateNormal];
|
||||
_onlineButton.backgroundColor = [UIColor clearColor];
|
||||
_onlineButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
||||
_onlineButton.layer.masksToBounds = YES;
|
||||
_onlineButton.layer.cornerRadius = 9;
|
||||
_onlineButton.layer.cornerRadius = 18/2;
|
||||
_onlineButton.layer.borderColor = [ThemeColor appEmphasizeColor].CGColor;
|
||||
_onlineButton.layer.borderWidth = 1;
|
||||
_onlineButton.layer.borderColor = UIColorFromRGB(0xFFAA37).CGColor;
|
||||
[_onlineButton setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
|
||||
[_onlineButton addTarget:self action:@selector(onlieButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_onlineButton addTarget:self action:@selector(onlineButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _onlineButton;
|
||||
}
|
||||
|
@@ -21,6 +21,7 @@
|
||||
///View
|
||||
#import "XPMonentsTableViewCell.h"
|
||||
#import "XPMonentsEmptyTableViewCell.h"
|
||||
#import "XPMonentsDetailViewController.h"
|
||||
|
||||
@interface XPMonentsAttentionViewController ()<UITableViewDelegate, UITableViewDataSource,XPMonentsAttentionProtocol, XPMonentsTableViewCellDelegate>
|
||||
///列表
|
||||
@@ -121,6 +122,17 @@
|
||||
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 - 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]];
|
||||
|
@@ -235,6 +235,10 @@
|
||||
[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]];
|
||||
}
|
||||
|
||||
#pragma mark - InputBoardDataSource
|
||||
//@return 点加号按钮弹出的拓展面板View,且无需设置frame
|
||||
- (UIView *)keyboardManagerExtendBoardView:(QKeyboardManager *)keyboardManager {
|
||||
@@ -385,6 +389,11 @@
|
||||
[self.presenter getMonentsCommentList:self.monentsInfo.dynamicId timestamp:@"" status:0];
|
||||
}
|
||||
|
||||
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
|
||||
[self showSuccessToast:@"删除成功"];
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (UITableView *)tableView {
|
||||
|
Reference in New Issue
Block a user