admin
2023-04-21 0b3a4aaf99ea251bc8e27b96115288f0988fcffe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
//
//  Mymessage.m
//  BuWanVideo2.0
//
//  Created by weikou2016 on 16/8/11.
//  Copyright © 2016年 com.yeshi.buwansheque.ios. All rights reserved.
//
 
#import "MymessageContrlloer.h"
#import "HMSegmentedControl.h"
#import "UIImage+YTH.h"
#import "SystemMessageCell.h"
#import "ComentCell.h"
#import "LoggingViewController.h"
 
#define Systemcell @"SystemMessageCell"
#define ComentCel @"ComentCell"
 
@interface MymessageContrlloer ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate,UIGestureRecognizerDelegate>{
    BOOL WhetherChooseSystemMessage;       // NO我的消息   YES系统消息
    
    HMSegmentedControl *segmentedControl;
    UITableView*tableview;
    
    UIImageView *tipPic;              //消息为空的图片
    UILabel *tipMessage;              //消息为空的字
    
    //数据源
    NSMutableArray * Comment;         //评论
    NSMutableArray * SystemMessage;   //系统消息
    NSMutableArray * nowChoose;       //当前数据源
    
    //回复框
    UIView *replyMessageView;
    UITextField *textField;
 
    int page;
    int nowclick;                   //当前回复哪一个评论
}
 
@end
 
@implementation MymessageContrlloer
 
- (void)viewDidLoad {
    [super viewDidLoad];
    
    page=1;
    WhetherChooseSystemMessage = YES;
    [self initScene];
}
 
-(void)initScene{
    //设置背景色
    self.view.backgroundColor = kGlobalBackgroundColor;
    
    //设置导航栏
    [self createNavgationBar];
    
    //创建选项
    [self createSegmentedControl];
    
    //创建列表
    [self createTableView];
    
    //没有数据时的提示视图
    [self promptView];
    
    //输入框视图
    [self createReplyMessageView];
    
    //获取系统消息
    [self systemMessage];
}
 
-(void)createNavgationBar{
    self.navigationItem.title = @"我的消息";
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor whiteColor]};
    
    //取消侧边栏消息提醒
    [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"HaveMessage"];
    //通知视图刷新
    [[NSNotificationCenter defaultCenter] postNotificationName:@"RELOAD_Message" object:nil];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[[UIImage imageNamed:@"详情页面返回"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(back:)
     forControlEvents:UIControlEventTouchUpInside];
    button.frame = CGRectMake(0, 0, 32, 32);
    UIBarButtonItem *iconBarItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationItem.leftBarButtonItem = iconBarItem;
}
 
-(void)createSegmentedControl{
    CGFloat height = 64;
    if (KIsiPhoneX) {
        height = 84;
    }
    segmentedControl = [[HMSegmentedControl alloc] initWithSectionTitles:@[@"评论消息", @"系统消息"]];
    [segmentedControl setFrame:CGRectMake(0, height, KScreenW, 48)];
    segmentedControl.selectionIndicatorHeight = 4.0f;
    segmentedControl.backgroundColor = KGlobalLightGreyColor_255;
    segmentedControl.titleTextAttributes = @{NSForegroundColorAttributeName : kGlobalDeepGreyColor};
    segmentedControl.selectionIndicatorColor = kGlobalYellowColor;
    segmentedControl.selectionStyle = HMSegmentedControlSelectionStyleTextWidthStripe;
    segmentedControl.selectedSegmentIndex = 0;
    segmentedControl.selectionIndicatorLocation = HMSegmentedControlSelectionIndicatorLocationDown;
    segmentedControl.shouldAnimateUserSelection = YES;
    segmentedControl.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:15]};
    [segmentedControl addTarget:self action:@selector(segmentedControlChangedValue:) forControlEvents:UIControlEventValueChanged];
    
    //选项下面的横线
    UILabel *Line = [[UILabel alloc]initWithFrame:CGRectMake(0, 48, KScreenW, 1)];
    Line.backgroundColor = kGlobaLineColor;
    [segmentedControl addSubview:Line];
    
    //选项中间的分割线
    UILabel *Line1 = [[UILabel alloc]initWithFrame:CGRectMake(KScreenW / 2 - 0.5 , 10 ,1, 28)];
    Line.backgroundColor = kGlobaLineColor;
    [segmentedControl addSubview:Line1];
    
//    [self.view addSubview:segmentedControl];
}
 
-(void)createTableView{
    CGFloat height = 117;
    if (KIsiPhoneX) {
        height = 137;
    }
    tableview = [[UITableView alloc]initWithFrame:CGRectMake(10, 0  + 1, KScreenW - 20, KScreenH - height +  segmentedControl.frame.size.height) style:UITableViewStyleGrouped];
    tableview.showsVerticalScrollIndicator = NO;
    tableview.backgroundColor = [UIColor clearColor];
    tableview.delegate = self;
    tableview.dataSource = self;
    tableview.backgroundColor = kGlobalBackgroundColor;
    tableview.contentInset = UIEdgeInsetsMake(5, 0, 0, 0);
    
    [tableview registerNib:[UINib nibWithNibName:Systemcell bundle:nil] forCellReuseIdentifier:Systemcell];
    [tableview registerNib:[UINib nibWithNibName:ComentCel bundle:nil] forCellReuseIdentifier:ComentCel];
    
    tableview.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(headUpData)];
    tableview.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(footUpData)];
    [tableview.mj_header beginRefreshing];
    [self.view addSubview:tableview];
}
 
-(void)promptView{
    //提示
    tipPic = [UIImageView new];  // 176*225
    tipPic.image = [UIImage imageNamed:@"评论为空"];
    tipPic.frame = CGRectMake(KScreenW/2-44, KScreenH/2 - 80, 88, 112.5);
    [self.view addSubview:tipPic];
    
    tipMessage = [[UILabel alloc]initWithFrame:CGRectMake(0, 52, KScreenW, 1)];
    tipMessage.frame = CGRectMake(KScreenW / 2 - 100, tipPic.frame.size.height + tipPic.frame.origin.y + 20, 200, 30);
    tipMessage.textAlignment = NSTextAlignmentCenter;
    tipMessage.font = [UIFont systemFontOfSize:18];
    tipMessage.textColor  = kGlobalLightGreyColor_210;
    [self.view addSubview:tipMessage];
}
 
-(void)createReplyMessageView{
    //  回复框
    UIImageView *backimage = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, KScreenW-80 , 30)];
    backimage.image=[[UIImage imageNamed:@"输入框"] resizableImageWithCapInsets:UIEdgeInsetsMake(10, 40, 20, backimage.frame.size.width-40)];
    
    replyMessageView=[[UIView alloc] initWithFrame:CGRectMake(0, KScreenH, KScreenW, 50)];
    replyMessageView.backgroundColor=[UIColor whiteColor];
    //回复的输入框
    textField=[[UITextField alloc] initWithFrame:CGRectMake(20, 10, KScreenW-90 , 30)];
    textField.delegate=self;
    textField.clearButtonMode = UITextFieldViewModeWhileEditing;
    textField.placeholder=@"  我也来说两句...";
    [[NSNotificationCenter defaultCenter] addObserver:self
                                             selector:@selector(keyboardWillShown:)
                                                 name:UIKeyboardWillShowNotification object:nil];
    //回复发送按钮
    UIButton *sendButton=[[UIButton alloc] initWithFrame:CGRectMake(KScreenW-60, 10, 50, 30)]; // 50 * 30
    [sendButton setBackgroundImage:[[UIImage imageNamed:@"发表"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]forState:UIControlStateNormal];
    [sendButton setTintColor:[UIColor whiteColor]];
    [sendButton setTitle:@"发送" forState:UIControlStateNormal];
    [sendButton addTarget:self action:@selector(ClickSendComment) forControlEvents:UIControlEventTouchUpInside ];
    [sendButton setTitleColor:kGlobalMainColor forState:UIControlStateNormal];
    [replyMessageView addSubview:backimage];
    [replyMessageView addSubview:textField];
    [replyMessageView addSubview:sendButton];
    [self.view addSubview:replyMessageView];
    replyMessageView.hidden = YES;
    
    UITapGestureRecognizer *TapGesture = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(touchview)];
    TapGesture.delegate = self;
    [self.view addGestureRecognizer:TapGesture];
 
}
 
-(void)systemMessage{
    SystemMessage = [[NSMutableArray alloc]initWithContentsOfFile:MESSAGE];
    NSMutableArray *temp = [NSMutableArray new];
    for (int i = 0 ; i < SystemMessage.count ; ++i){
        NSMutableDictionary *dic = SystemMessage[i];
        NSString * cha = [self autoHeiWithString:[dic objectForKey:@"Content"] WithFont:15 WithWidth:KScreenW-40];
        
        [dic setObject:cha forKey:@"cha"];
        [temp addObject:dic];
    }
    SystemMessage = temp;
}
 
/**
 *  底部刷新
 */
-(void)footUpData{
    if(WhetherChooseSystemMessage){
        [[YTHNetInterface startInterface]getMyCommentReplyWithUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] WithPage:[NSString stringWithFormat:@"%d",page] WithSystem:@"1" WithBlock:^(BOOL isSuccessful, id result, NSString *error) {
            if(isSuccessful){
                NSArray* newComment = [[result objectForKey:@"Data"]objectForKey:@"data"];
                
                [Comment addObjectsFromArray:newComment];
                if(!WhetherChooseSystemMessage){
                    nowChoose = Comment;
                }
                [self setheight];
                [self reloadData];
                page++;
            }else{
                NSLog(@"%@",error);
            }
            [tableview.mj_footer endRefreshing];
        }];
    }else{
        [tableview.mj_footer endRefreshing];
    }
 
}
 
/**
 *  上部刷新
 */
-(void)headUpData{
    if (WhetherChooseSystemMessage) {
        page =1;
        [[YTHNetInterface startInterface]getMyCommentReplyWithUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] WithPage:[NSString stringWithFormat:@"%d",page] WithSystem:@"1" WithBlock:^(BOOL isSuccessful, id result, NSString *error) {
            
            if(isSuccessful){
                
                Comment = [[result objectForKey:@"Data"]objectForKey:@"data"];
                
                if(Comment.count > 0){
                    [self setheight];
                    if(!WhetherChooseSystemMessage){
                        nowChoose = Comment;
                    }
                    page++;
                }
                if (Comment.count < 20) {
                    tableview.mj_footer.hidden = YES;
                }else{
                    tableview.mj_footer.hidden = NO;
                }
                [self reloadData];
        }else{
            NSLog(@"%@",error);
            if ([error compare:@"似乎已断开与互联网的连接。"] == 0) {
                [self autoDisappearAlertTime:1 msg:@"网络不可用,请检查网络"];
            }
        }
         [tableview.mj_header endRefreshing];
         }];
    }else{
        [tableview.mj_header endRefreshing];
    }
}
 
/**
 *  计算字符串的高度并传入到字典中
 */
-(void)setheight{
    for(int i = 0 ; i < Comment.count ; ++i){
        NSString *str1 = [Comment[i] objectForKey:@"Content"];
        NSString *str2 = [[Comment[i] objectForKey:@"Comment"]objectForKey:@"Content"];
        NSString * cha1 = [self autoHeiWithString:str1 WithFont:15 WithWidth:KScreenW-40];
        NSString * cha2 = [self autoHeiWithString:str2 WithFont:15 WithWidth:KScreenW-40];
        [Comment[i] setObject:cha1 forKey:@"mycomment"];
        [Comment[i] setObject:cha2 forKey:@"othercomment"];
    }
}
 
/**
 *  对view的监听 点击会让键盘输入框消失
 */
-(void)touchview{
    [self ReturnKeybiard];
}
 
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
    if([NSStringFromClass(touch.view.class) isEqualToString:@"HMScrollView"]){
        return NO;
    }
    return YES;
}
 
/**
 *  刷新数据 并且判断显示是否有  没有消息的背景图
 */
-(void)reloadData{
    [self doImage];
//    if(nowChoose.count){
    [tableview reloadData];
//    }else{
//        [self performSelector:@selector(reloadData) withObject:nil afterDelay:1];
//    }
}
 
/*
 *   YES  显示
 */
-(void)doImage{
    if(nowChoose.count == 0){
        tipPic.hidden = NO;
        tipMessage.hidden = NO;
        if(WhetherChooseSystemMessage){
            tipMessage.text = @"还没有系统消息";
        }else{
            tipMessage.text = @"还没有评论消息";
        }
    }else{
        tipPic.hidden = YES;
        tipMessage.hidden = YES;
    }
    [tableview reloadData];
}
 
#pragma mark - UITableViewDataSource - UITableViewDelegate
 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 1;
}
 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return nowChoose.count;
}
 
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 5;
}
 
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 5;
}
 
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (WhetherChooseSystemMessage) { //右
        NSDictionary  *dic = [nowChoose objectAtIndex:indexPath.section];
        float cha = ((NSString*)[dic objectForKey:@"cha"]).floatValue;
        return 55+cha;
    }else{                            //左
        NSDictionary *dic = Comment[indexPath.section];
        
        NSString *commentStr1 = [dic objectForKey:@"Content"];//我的评论
        CGSize commentSize1 = [commentStr1 boundingRectWithSize:CGSizeMake(KScreenW-23, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil].size;
        
        NSString *commentStr2 = [[dic objectForKey:@"Comment"]objectForKey:@"Content"];//别人的回复
        CGSize commentSize2 = [commentStr2 boundingRectWithSize:CGSizeMake(KScreenW-43, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12]} context:nil].size;
        
        return 145 + commentSize1.height + commentSize2.height;
    }
}
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if(WhetherChooseSystemMessage){  //系统的
        SystemMessageCell *cell = [tableView dequeueReusableCellWithIdentifier:Systemcell forIndexPath:indexPath];
        NSDictionary  *dic = [nowChoose objectAtIndex:indexPath.section];
        //自适应数据接收处理
        if(!cell.isauto){
            cell.Message.text = (NSString*)[dic objectForKey:@"Content"];
            float cha = ((NSString*)[dic objectForKey:@"cha"]).floatValue;
            cell.frame = CGRectMake(0, 0, cell.frame.size.width, cell.frame.size.height + cha);
            cell.Message.frame = CGRectMake(cell.Message.frame.origin.x, cell.Message.frame.origin.y, cell.Message.frame.size.width, cell.Message.frame.size.height+cha);
            cell.isauto = YES;
        }
        //非自适应数据
        NSString *time = [dic objectForKey:@"date"];
        NSString *day = [time substringToIndex:10];   //年月日
        NSString *hour = [time substringFromIndex:11];//小时分钟
        cell.Time1.text = day;
        cell.Time2.text = hour;
        return cell;
    }else{
        ComentCell *cell = [tableView dequeueReusableCellWithIdentifier:ComentCel forIndexPath:indexPath];
        
        NSDictionary *dic = Comment[indexPath.section];
        
        NSString *commentStr1 = [dic objectForKey:@"Content"];//我的评论
        CGSize commentSize1 = [commentStr1 boundingRectWithSize:CGSizeMake(KScreenW-16, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14]} context:nil].size;
        
        NSString *commentStr2 = [[dic objectForKey:@"Comment"]objectForKey:@"Content"];//别人的回复
        CGSize commentSize2 = [commentStr2 boundingRectWithSize:CGSizeMake(KScreenW-43, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12]} context:nil].size;
        
        cell.contentH1.constant=commentSize1.height;
        cell.contentH2.constant=commentSize2.height;
      
        cell.NowComment.text = commentStr1;
        cell.CommentMessage.text = commentStr2;
        
        cell.HeadImage.layer.cornerRadius = cell.HeadImage.frame.size.width/2;
        cell.HeadImage.layer.masksToBounds = YES;
        [cell.HeadImage setYthImageWithURL:[[dic objectForKey:@"User"] objectForKey:@"Portrait"] placeholderImage:[UIImage imageNamed:@"用户默认"]];
        cell.Name.text = [[dic objectForKey:@"User"] objectForKey:@"Nickname"];
        
        cell.WhoComment.text = [NSString stringWithFormat:@"%@:",[[NSUserDefaults standardUserDefaults] objectForKey:@"QQUserName"]];
        cell.ComeFrom.text = [NSString stringWithFormat:@"来源:%@",[[[dic objectForKey:@"Comment"] objectForKey:@"Video"]objectForKey:@"Name"]];
        
        cell.Time.text = [[YTHNetInterface startInterface]getDate:[dic objectForKey:@"Createtime"]];
        
        cell.Replacemessage.tag =indexPath.section;
        [cell.Replacemessage addTarget:self action:@selector(ClickReplace:) forControlEvents:UIControlEventTouchUpInside];
        
        return cell;
    }
    return nil;
}
 
#pragma mark 选择器切换时触发的函数
- (void)segmentedControlChangedValue:(HMSegmentedControl *)segmentedControls {
    NSLog(@"Selected index %ld", (long)segmentedControls.selectedSegmentIndex);
//    if(segmentedControls.selectedSegmentIndex==0){
//        WhetherChooseSystemMessage=NO;
//        nowChoose = Comment;
//    }else{
//        WhetherChooseSystemMessage=YES;
//        nowChoose = SystemMessage;
//    }
//    //图片文字是否显示
//    [self doImage];
//
//    //重新获取数据源
//    [tableview.mj_header beginRefreshing];
//    //重新加载数据
//    [tableview reloadData];
}
 
 
 
/**
 *  计算字符串的高度
 */
-(NSString*)autoHeiWithString:(NSString*)str WithFont:(int)font_i WithWidth:(float)width{
    UILabel *tempLabel = [UILabel new];
    tempLabel.text = str;
    tempLabel.font = [UIFont systemFontOfSize:font_i];
    tempLabel.numberOfLines = 0;
    CGSize size = [tempLabel sizeThatFits:CGSizeMake(width, MAXFLOAT)];
    
    if(font_i == 12){
        return [NSString stringWithFormat:@"%f",size.height - 14.33];  //减去当前字号的大小 由于XIB写了一排
    }else if(font_i == 15){
        return [NSString stringWithFormat:@"%f",size.height - 18];
    }
    return nil;
}
 
 
-(void)back:(id)sender{
    [self.navigationController popViewControllerAnimated:YES];
}
 
/**
 *  点击出现键盘
 *
 *  @return
 */
-(void)ClickReplace:(UIButton*)sender{
    nowclick = (int)sender.tag;
    replyMessageView.hidden = NO;
    [textField becomeFirstResponder];
}
 
#pragma mark 键盘出现
-(void)keyboardWillShown:(NSNotification *)notification{
    NSDictionary* info = [notification userInfo];
    CGSize kbSize = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;//得到键盘的高度
    replyMessageView.frame=CGRectMake(0, KScreenH-50-kbSize.height, KScreenW, 50);
    textField.clearButtonMode = UITextFieldViewModeAlways;
}
 
//返回按钮
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [self ReturnKeybiard];
    return YES;
}
 
//收回键盘
-(void)ReturnKeybiard{
    [textField resignFirstResponder];
    replyMessageView.frame=CGRectMake(0, KScreenH-50, KScreenW, 50);
    replyMessageView.hidden = YES;
}
 
#pragma mark 点击发送评论
-(void)ClickSendComment{
    [self ReturnKeybiard];
    NSDictionary *dic = Comment[nowclick];   //Id
    
    [[YTHNetInterface startInterface]getreplayCommentWithUid:[[NSUserDefaults standardUserDefaults] objectForKey:@"LoginUid"] WithcommentReplayId:[dic objectForKey:@"Id"] WithCommentId:[[dic objectForKey:@"Comment"]objectForKey:@"Id"] WithContent:textField.text WithSystem:@"1" WithBlock:^(BOOL isSuccessful, id result, NSString *error) {
        if(isSuccessful){
            NSLog(@"回复成功");
        }else{
            NSLog(@"%@",error);
        }
    }];
}
@end