|
//
// myAnswerController.m
// ThePaperBase
//
// Created by YoungLee on 15/8/19.
// Copyright (c) 2015年 scar1900. All rights reserved.
//
#import "myAnswerController.h"
#import "myAnswerTableController.h"
#import "messageViewModel.h"
#import "writeCommentAndAskController.h"
#import "loginHomeController.h"
#import "topicContentController.h"
#import "imageShareContent.h"
@interface myAnswerController ()<messageViewModelDelegate,myAnswerTableDelegate,writeContentDelegate>
@property(nonatomic, strong)myAnswerTableController *answerTableVC;
@property(nonatomic, strong)writeCommentAndAskController *writeCommentContentVC;
@end
@implementation myAnswerController
- (void)viewDidLoad {
[super viewDidLoad];
self.titleStr = @"回复我的";
self.answerTableVC = [myAnswerTableController new];
self.answerTableVC.answerTableDelegate = self;
[self addChildViewController:self.answerTableVC];
[self.view addSubview:self.answerTableVC.view];
[self.answerTableVC.view makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.view.left);
make.right.equalTo(self.view.right);
make.top.equalTo(self.barHeight);
make.bottom.equalTo(self.view.bottom);
}];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(needrefreshNightMode:) name:REFRESHAFTERNIGHTMODE object:nil];
// Do any additional setup after loading the view.
}
- (void)needrefreshNightMode:(id)sender{
self.answerTableVC.view.backgroundColor = [UIColor colorWithHexString:CELLBACKCOLOR];
self.answerTableVC.tableView.backgroundColor = [UIColor colorWithHexString:CELLBACKCOLOR];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)gotoWriteComment:(commentObjectVO *)comment{
self.writeCommentContentVC = [[writeCommentAndAskController alloc]init];
// self.writeCommentContentVC.type = askForUserType;
if ([comment.type intValue] == 1) {
self.writeCommentContentVC.type = commentForUserType;
}else {
self.writeCommentContentVC.type = askForUserType;
}
self.writeCommentContentVC.nodeId = comment.contId;
self.writeCommentContentVC.delegate = self;
self.writeCommentContentVC.commentBO = comment;
if([comment.objectType isEqualToString:@"3"]){//0004269: 个人主页: 通过头像进入个人主页,对列表中的评论、话题的提问进行回复时提示不存在或下线的提示信息(bug:4269)
self.writeCommentContentVC.commentOT = @"3";
}
[self presentController:self.writeCommentContentVC animated:YES completion:^{
}];
}
-(void)gotoLogin{
loginHomeController *vc = [loginHomeController new];
[self.navigationController pushViewController:vc animated:YES];
}
- (void)dismissWriteContent:(commentAndAskType)type{
__weak typeof(self) Self = self;
[self dismissViewController:self.writeCommentContentVC animated:YES completion:^{
Self.writeCommentContentVC = nil;
}];
}
- (void)commentSuccess:(commentAndAskType)type {
__weak typeof(self) Self = self;
[self dismissViewController:self.writeCommentContentVC animated:YES completion:^{
[self.answerTableVC manualRefresh];
Self.writeCommentContentVC = nil;
}];
}
-(void)gotoTopicInfo:(TopicInfoBO *)topic creatUse:(userBO *)user{
topicContentController *contentVC = [topicContentController new];
contentVC.preTopicInfo = topic;
contentVC.creatUser = nil;
[self.navigationController pushViewController:contentVC animated:YES];
}
- (void)tapNaviBar:(id)sender {
[self.answerTableVC scrollTableViewToTop];
}
-(void)answerToShare:(UIImage *)img contenBO:(contentObjectBO *)contentBO{
imageShareContent *shareContentView = [[imageShareContent alloc]initWithFrame:CGRectMake(0,
0,
CGRectGetWidth(self.view.bounds),
CGRectGetHeight(self.view.bounds))];
shareContentView.contentBO = contentBO;
shareContentView.shareImg = img;
shareContentView.baseController = self;
shareContentView.sharestyle = shareNewsStyle;
[shareContentView presentShareContentInView:self.view sender:nil];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
|