Commit 0b955368 authored by admin's avatar admin

完成添加权限 处理问题详情

parent b6070a71
......@@ -83,22 +83,22 @@
#define kQuestionCategoryURL @"redstar-server/rest/question/queryCategory?groupUuid="
/**
* 图说口碑相关URL
* 口碑现场相关URL
*/
// 保存图说口碑
// 保存口碑现场
#define kSavePicturePraiseURL @"redstar-server/rest/legendpraise/save?time="
// 上传口碑图片
#define kUpLoadPictureURL @"redstar-server/rest/legendpraise/"
// 提交图说口碑
// 提交口碑现场
#define kSubmitPicturePraiseURL @"redstar-server/rest/legendpraise/"
// 查询图说口碑
// 查询口碑现场
#define kQueryPicturePraiseURL @"redstar-server/rest/legendpraise/query"
// 图说口碑明细
// 口碑现场明细
#define kPicturePraiseDetailURL @"redstar-server/rest/legendpraise/get/"
// 口碑点赞
......@@ -123,6 +123,6 @@
// 提交问题处理结果
// redstar-server/rest/question/resolve?time={time}&operId={operId}&operName={operName}
#define kSubmitQuestionResultURL @"redstar-server/rest/question/resolve?time="
#define kSubmitQuestionResultURL @"redstar-server/rest/question/resolve_update?time="
#endif /* Url_h */
......@@ -13,7 +13,7 @@
@property (nonatomic, strong) FuncItem *onLineSamplingBtn; // 在线抽查按钮
@property (nonatomic, strong) FuncItem *wordOfMouthBtn; // 口碑按钮
@property (nonatomic, strong) FuncItem *standardBtn; // 口碑标准按钮
@property (nonatomic, strong) FuncItem *pictureBtn; // 图说口碑按钮
@property (nonatomic, strong) FuncItem *pictureBtn; //
@property (nonatomic, strong) FuncItem *questionBtn; // 问题与知识按钮
@property (nonatomic, strong) FuncItem *rankBtn; // 口碑排名按钮
@property (nonatomic, strong) FuncItem *spotBtn; // 口碑排名按钮
......
......@@ -55,8 +55,8 @@
- (void)setup
{
[self.onLineSamplingBtn setTitle:@"口碑报告" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"商场风采" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.wordOfMouthBtn setTitle:@"口碑随手拍" forState:UIControlStateNormal];
[self.standardBtn setTitle:@"口碑现场" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"问题知识" forState:UIControlStateNormal];
[self.rankBtn setTitle:@"口碑巡检" forState:UIControlStateNormal];
......@@ -85,7 +85,7 @@
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
StandardViewController *standardVC = [[StandardViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
} else if ([item.titleLabel.text isEqualToString:@"口碑现场"]) {
PicCategoryViewController *pictureVC = [[PicCategoryViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
......@@ -95,11 +95,11 @@
} else if ([item.titleLabel.text isEqualToString:@"口碑报告"]) {
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else if ([item.titleLabel.text isEqualToString:@"商场风采"]) {
} else if ([item.titleLabel.text isEqualToString:@"口碑随手拍"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.category = @"store";
pic.titleStr = @"商场风采";
pic.titleStr = @"口碑随手拍";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
} else {
return;
......
......@@ -13,6 +13,7 @@
@property (nonatomic, strong) UITextView *titleTextView;
@property (nonatomic, strong) UITextView *contentTextView;
@property (nonatomic, strong) UIButton *saveButton;
@property (nonatomic, strong) UILabel *placeholderLabel1;
@property (nonatomic, strong) UILabel *placeholderLabel2;
@end
......@@ -8,12 +8,11 @@
#import "OnLineFooterView.h"
@interface OnLineFooterView () <UITextViewDelegate>
@interface OnLineFooterView ()
@property (nonatomic, strong) UIImageView *backImageView1;
@property (nonatomic, strong) UIImageView *backImageView2;
@property (nonatomic, strong) UILabel *placeholderLabel1;
@property (nonatomic, strong) UILabel *placeholderLabel2;
@end
......@@ -94,35 +93,6 @@
}
#pragma mark - UITextView Delegate
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if (![text isEqualToString:@""]) {
if (textView.tag == 1001) {
_placeholderLabel1.hidden = YES;
} else {
_placeholderLabel2.hidden = YES;
}
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
if (textView.tag == 1001) {
_placeholderLabel1.hidden = NO;
} else {
_placeholderLabel2.hidden = NO;
}
}
if ([text isEqualToString:@"\n"]) {
[self.titleTextView resignFirstResponder];
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
#pragma mark - lazy loading
- (UIImageView *)backImageView1
......@@ -176,7 +146,6 @@
if (!_titleTextView) {
_titleTextView = [[UITextView alloc] init];
_titleTextView.tag = 1001;
_titleTextView.delegate = self;
_titleTextView.font = [UIFont systemFontOfSize:15.0];
_titleTextView.translatesAutoresizingMaskIntoConstraints = NO;
[self.backImageView1 addSubview:_titleTextView];
......@@ -202,7 +171,6 @@
_contentTextView = [[UITextView alloc] init];
_contentTextView.tag = 1002;
_contentTextView.font = [UIFont systemFontOfSize:15.0];
_contentTextView.delegate = self;
_contentTextView.translatesAutoresizingMaskIntoConstraints = NO;
[self.backImageView2 addSubview:_contentTextView];
......
......@@ -16,7 +16,7 @@
#define kOnLineTableViewCell @"onlineTableViewCell"
@interface OnLineViewController () <UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate, SelectStoreDelegate>
@interface OnLineViewController () <UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate, SelectStoreDelegate, UITextViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSMutableArray *uuidArray;
......@@ -27,6 +27,9 @@
@property (nonatomic, strong) UIView *backGroundView;
@property (nonatomic, strong) UIView *pickBackView;
@property (nonatomic, strong) UIDatePicker *datePicker;
@property (nonatomic, strong) NSLayoutConstraint *tableBottom;
@property (nonatomic, strong) NSLayoutConstraint *tableTop;
@end
@implementation OnLineViewController
......@@ -313,8 +316,8 @@
_tableView.showsHorizontalScrollIndicator = NO;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
self.tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:_tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
......@@ -322,8 +325,8 @@
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
self.tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:_tableBottom];
}
return _tableView;
}
......@@ -336,11 +339,60 @@
} else {
_footView = [[OnLineFooterView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, (kScreenHeight - 100 - 64))];
}
_footView.titleTextView.delegate = self;
_footView.contentTextView.delegate = self;
[_footView.saveButton addTarget:self action:@selector(saveClick:) forControlEvents:UIControlEventTouchUpInside];
}
return _footView;
}
#pragma mark - UITextView Delegate
- (void)textViewDidBeginEditing:(UITextView *)textView
{
self.tableTop.constant = -216;
self.tableBottom.constant = -216;
[UIView animateWithDuration:0.3 animations:^{
[self.tableView layoutIfNeeded];
}];
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
self.tableTop.constant = 0;
self.tableBottom.constant = 0;
[UIView animateWithDuration:0.3 animations:^{
[self.tableView layoutIfNeeded];
}];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if (![text isEqualToString:@""]) {
if (textView.tag == 1001) {
self.footView.placeholderLabel1.hidden = YES;
} else {
self.footView.placeholderLabel2.hidden = YES;
}
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
if (textView.tag == 1001) {
self.footView.placeholderLabel1.hidden = NO;
} else {
self.footView.placeholderLabel2.hidden = NO;
}
}
if ([text isEqualToString:@"\n"]) {
[self.footView.titleTextView resignFirstResponder];
[self.footView.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
/*
#pragma mark - Navigation
......
......@@ -35,6 +35,8 @@
@property (nonatomic, strong) UIActionSheet *selectActionSheet;
@property (nonatomic, copy) NSString *praiseUuid;
@property (nonatomic, strong) NSLayoutConstraint *tableTop;
@property (nonatomic, strong) NSLayoutConstraint *tableBottom;
@end
......@@ -90,7 +92,7 @@
- (void)doBack:(id)sender
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要放弃编辑当前图说口碑吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要放弃编辑当前口碑现场吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 9211232;
[alert show];
......@@ -224,6 +226,24 @@
}
#pragma mark - UItextView
- (void)textViewDidBeginEditing:(UITextView *)textView
{
self.tableTop.constant = -100;
self.tableBottom.constant = -100;
[UIView animateWithDuration:0.3 animations:^{
[self.tableView layoutIfNeeded];
}];
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
self.tableTop.constant = 0;
self.tableBottom.constant = 0;
[UIView animateWithDuration:0.3 animations:^{
[self.tableView layoutIfNeeded];
}];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
AddPictureTableCell *cell = [_tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
......@@ -484,8 +504,8 @@
[_tableView registerClass:[AddButtonTableViewCell class] forCellReuseIdentifier:kAddButtonCell];
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
self.tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:_tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
......@@ -493,8 +513,8 @@
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
self.tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:_tableBottom];
}
return _tableView;
}
......
......@@ -23,11 +23,11 @@
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear: animated];
[MobClick beginLogPageView:@"图说口碑"];
[MobClick beginLogPageView:@"口碑现场"];
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[MobClick endLogPageView:@"图说口碑"];
[MobClick endLogPageView:@"口碑现场"];
}
- (void)viewDidLoad {
[super viewDidLoad];
......@@ -40,7 +40,7 @@
[self setupNav];
self.titleArray = [NSArray arrayWithObjects:@"商场风采",@"优秀案例",@"巡店报告", nil];
self.titleArray = [NSArray arrayWithObjects:@"口碑随手拍",@"口碑报道",@"口碑巡店", nil];
//self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.tableView.delegate = self;
self.tableView.dataSource = self;
......@@ -50,7 +50,7 @@
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"图说口碑"];
[customLab setText:@"口碑现场"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
......
......@@ -32,6 +32,8 @@
#import "AttachmentModel.h"
#import "ReaderViewController.h"
#define CategrayTitle @"口碑报道"
#define kPictureDetailTableCell @"PictureDetailTableViewCell"
#define kPictureTextTableCell @"PictureTextTableViewCell"
#define kPictureCommentTableCell @"pictureCommentTableViewCell"
......@@ -102,7 +104,6 @@
NSDictionary *dataDict = response[@"data"];
NSLog(@"巡店报告 = %@",dataDict);
PictureDetailModel *picDetail = [[PictureDetailModel alloc] init];
[picDetail setValuesForKeysWithDictionary:dataDict];
_pictureDetail = picDetail;
......@@ -360,7 +361,7 @@
#pragma mark - UITableView DataSource/Delegate
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
if ([self.titleStr isEqualToString:@"巡店报告"]) {
if ([self.titleStr isEqualToString:CategrayTitle]) {
return 4;
} else {
return 3;
......@@ -374,7 +375,7 @@
} else if (section == 1) {
return _picTextArray.count;
} else {
if ([self.titleStr isEqualToString:@"巡店报告"]) {
if ([self.titleStr isEqualToString:CategrayTitle]) {
if (section == 2) {
return _attachmentArray.count;
} else {
......@@ -462,9 +463,9 @@
return cell;
}
} else {
// 判断当前页面是否为 巡店报告
if ([self.titleStr isEqualToString:@"巡店报告"]) {
// 是 巡店报告
// 判断当前页面是否为 口碑巡店
if ([self.titleStr isEqualToString:CategrayTitle]) {
// 是 口碑巡店
if (indexPath.section == 2) {
// 显示 附件cell
......@@ -641,7 +642,13 @@
// 自定义section
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if (section == 2) {
NSInteger num = 0;
if ([self.titleStr isEqualToString:CategrayTitle]) {
num = 3;
} else {
num = 2;
}
if (section == num) {
// 创建sectionView
UIView *sectionView = [[UIView alloc] init];
sectionView.userInteractionEnabled = YES;
......@@ -703,12 +710,21 @@
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
if (section == 2) {
return 50;
if ([self.titleStr isEqualToString:CategrayTitle]) {
if (section == 3) {
return 50;
} else {
return CGFLOAT_MIN;
}
} else {
return CGFLOAT_MIN;
if (section == 2) {
return 50;
} else {
return CGFLOAT_MIN;
}
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
......
......@@ -55,7 +55,7 @@
@implementation PictureViewController
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[MobClick beginLogPageView:@"商场风采"];
[MobClick beginLogPageView:@"口碑随手拍"];
}
- (void)viewWillDisappear:(BOOL)animated {
......@@ -133,7 +133,7 @@
[self.navigationController pushViewController:addPic animated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有新增图说口碑的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有新增口碑现场的权限!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
}
......
......@@ -646,7 +646,6 @@
@"direction":@"asc"}];
[parameters setObject:array forKey:@"queryOrders"];
}
NSLog(@"问题与知识parameters = %@", parameters);
// 请求问题列表
[httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) {
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
......@@ -822,17 +821,19 @@
// cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// QuestionDetailViewController *questionDetailVC = [[QuestionDetailViewController alloc] init];
// QuestionModel *question = (QuestionModel *)_allQuestionArray[indexPath.row];
// questionDetailVC.questionUuid = question.uuid;
// questionDetailVC.row = indexPath.row;
// [self.navigationController pushViewController:questionDetailVC animated:YES];
QuestionUnsolvedViewController *questionDetailVC = [[QuestionUnsolvedViewController alloc] init];
QuestionModel *question = (QuestionModel *)_allQuestionArray[indexPath.row];
questionDetailVC.questionUuid = question.uuid;
questionDetailVC.row = indexPath.row;
[self.navigationController pushViewController:questionDetailVC animated:YES];
if ([question.state isEqualToString:@"created"]) {
QuestionUnsolvedViewController *questionDetailVC = [[QuestionUnsolvedViewController alloc] init];
questionDetailVC.questionUuid = question.uuid;
questionDetailVC.row = indexPath.row;
[self.navigationController pushViewController:questionDetailVC animated:YES];
} else {
QuestionDetailViewController *questionDetailVC = [[QuestionDetailViewController alloc] init];
questionDetailVC.questionUuid = question.uuid;
questionDetailVC.row = indexPath.row;
[self.navigationController pushViewController:questionDetailVC animated:YES];
}
}
// cell的高度
......
......@@ -11,8 +11,8 @@
@interface FeedContentTableCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIImageView *backImageView1;
@property (nonatomic, strong) UITextView *titleTextView;
@property (nonatomic, strong) UILabel *placeholderLabel1;
//@property (nonatomic, strong) UITextView *titleTextView;
//@property (nonatomic, strong) UILabel *placeholderLabel1;
@property (nonatomic, strong) UIButton *changeBtn; // 修改问题分类
@property (nonatomic, strong) UIButton *solveBtn; // 解决问题
......
......@@ -61,55 +61,55 @@
return _backImageView1;
}
- (UITextView *)titleTextView
{
if (!_titleTextView) {
_titleTextView = [[UITextView alloc] init];
_titleTextView.tag = 1001;
_titleTextView.font = [UIFont systemFontOfSize:15.0];
_titleTextView.translatesAutoresizingMaskIntoConstraints = NO;
[self.backImageView1 addSubview:_titleTextView];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[self.backImageView1 addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[self.backImageView1 addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1];
[self.backImageView1 addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[self.backImageView1 addConstraint:contentHeight];
}
return _titleTextView;
}
- (UILabel *)placeholderLabel1
{
if (!_placeholderLabel1) {
_placeholderLabel1 = [[UILabel alloc] init];
_placeholderLabel1.translatesAutoresizingMaskIntoConstraints = NO;
_placeholderLabel1.font = [UIFont systemFontOfSize:15.0];
_placeholderLabel1.textColor = kOnLineCellDetailColor;
[self.titleTextView addSubview:_placeholderLabel1];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeTop multiplier:1.0 constant:2];
[self.titleTextView addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
[self.titleTextView addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.titleTextView addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.titleTextView addConstraint:contentHeight];
}
return _placeholderLabel1;
}
//- (UITextView *)titleTextView
//{
// if (!_titleTextView) {
// _titleTextView = [[UITextView alloc] init];
// _titleTextView.tag = 1001;
// _titleTextView.font = [UIFont systemFontOfSize:15.0];
// _titleTextView.translatesAutoresizingMaskIntoConstraints = NO;
// [self.backImageView1 addSubview:_titleTextView];
//
// NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
// [self.backImageView1 addConstraint:contentTop];
//
// NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
// [self.backImageView1 addConstraint:contentLeft];
//
// NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1];
// [self.backImageView1 addConstraint:contentRight];
//
// NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backImageView1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
// [self.backImageView1 addConstraint:contentHeight];
// }
// return _titleTextView;
//}
//
//
//
//- (UILabel *)placeholderLabel1
//{
// if (!_placeholderLabel1) {
// _placeholderLabel1 = [[UILabel alloc] init];
// _placeholderLabel1.translatesAutoresizingMaskIntoConstraints = NO;
// _placeholderLabel1.font = [UIFont systemFontOfSize:15.0];
// _placeholderLabel1.textColor = kOnLineCellDetailColor;
// [self.titleTextView addSubview:_placeholderLabel1];
//
// NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeTop multiplier:1.0 constant:2];
// [self.titleTextView addConstraint:contentTop];
//
// NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
// [self.titleTextView addConstraint:contentLeft];
//
// NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
// [self.titleTextView addConstraint:contentRight];
//
// NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
// [self.titleTextView addConstraint:contentHeight];
// }
// return _placeholderLabel1;
//}
- (UIButton *)changeBtn {
if (!_changeBtn) {
......
......@@ -8,17 +8,24 @@
#import <UIKit/UIKit.h>
#import "SelectCategaryViewController.h"
@protocol QuestionDealWithDelegate <NSObject>
- (void)tableDidSelectAtIndexPath:(NSIndexPath *)indexPath;
- (void)tableDidSelectAtIndexPath:(NSIndexPath *)indexPath nameArray:(NSArray *)nameArray;
// 按钮点击事件
- (void)requestProlemDealWithResultWithGroupText:(NSString *)groupText categoryText:(NSString *)categoryText solutionType:(NSString *)solutionType optionType:(NSString *)optionType;
@end
@interface QuestionDealWithView : UIView
@interface QuestionDealWithView : UIView <SelectCategaryDelegate>
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *quitBtn;
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UILabel *groupTitle;
@property (nonatomic, strong) UILabel *categoryTitle;
@property (nonatomic, assign) id<QuestionDealWithDelegate> delegate;
@property (nonatomic, strong) UITextView *titleTextView;
@property (nonatomic, strong) UILabel *placeholderLabel1;
@end
......@@ -20,7 +20,10 @@
#import "QuestionDetailModel.h"
#import "QuestionDealWithView.h"
#import "AddQuestionViewController.h"
#import "SolvedTypeTableViewCell.h"
#import "SelectCategaryViewController.h"
#import "HttpClient.h"
#define kQuestionDetailCell @"QuestionDetailCell" // 问题详情
#define kQuestionDescribeCell @"QuestionDescribeCell" // 问题描述
......@@ -70,6 +73,11 @@
_clickNumber = 0;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:2];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -136,11 +144,16 @@
- (void)doBack:(UIBarButtonItem *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)dealWithProblem:(UIButton *)sender {
[self showRedView];
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
if ([permissions containsObject:@"500506"]) {
[self showRedView];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您没有处理问题的权限!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}
- (void)showRedView
......@@ -150,11 +163,7 @@
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeRedView)];
[_bgView addGestureRecognizer:tapGR];
}
if (!_dealWithView) {
_dealWithView = [[QuestionDealWithView alloc] init];
_dealWithView.backgroundColor = [UIColor whiteColor];
_dealWithView.delegate = self;
}
self.dealWithView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:_bgView];
[self.view insertSubview:_dealWithView aboveSubview:_bgView];
......@@ -164,8 +173,8 @@
[_dealWithView.quitBtn addTarget:self action:@selector(closeRedView) forControlEvents:UIControlEventTouchUpInside];
CGRect toFrame = CGRectMake(0, 150, kScreenWidth, 905);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, 905);
CGRect toFrame = CGRectMake(0, kScreenHeight - 515, kScreenWidth, 515);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, 515);
_dealWithView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
......@@ -175,15 +184,70 @@
}
- (void)tableDidSelectAtIndexPath:(NSIndexPath *)indexPath {
- (void)tableDidSelectAtIndexPath:(NSIndexPath *)indexPath nameArray:(NSArray *)nameArray{
SelectCategaryViewController *selectCVC = [[SelectCategaryViewController alloc] init];
selectCVC.delegate = self.dealWithView;
selectCVC.rowNum = indexPath.row;
if (indexPath.row == 0) {
selectCVC.titleStr = @"专业组";
selectCVC.titleArray = nameArray;
} else {
selectCVC.titleStr = @"问题分类";
selectCVC.titleArray = nameArray;
}
[self.navigationController pushViewController:selectCVC animated:YES];
}
- (void)requestProlemDealWithResultWithGroupText:(NSString *)groupText categoryText:(NSString *)categoryText solutionType:(NSString *)solutionType optionType:(NSString *)optionType {
[self closeRedView];
NSDate *date = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:date];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@%@&operId=%@&operName=%@", kRedStarURL,kSubmitQuestionResultURL,dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{
@"questionUuid":self.questionUuid,
@"group":groupText,
@"category":categoryText,
@"solutionType":solutionType,
@"optionType":optionType,
@"feedback":self.dealWithView.titleTextView.text
};
[httpClient submitQuestionResultWithParameters:parameters completion:^(id response, NSError *error) {
if ([response[@"success"] boolValue]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"问题处理成功!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
alert.tag = 122837;
[alert show];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"问题处理失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
}
#pragma mark - UIAlertViewDelegte
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (alertView.tag == 122837) {
[self.navigationController popViewControllerAnimated:YES];
}
}
- (void)closeRedView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, 905);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, 515);
[UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f;
_dealWithView.frame = fromFrame;
......@@ -370,6 +434,54 @@
return _footerView;
}
- (void)textViewDidBeginEditing:(UITextView *)textView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight - 750, kScreenWidth, 515);
[UIView animateWithDuration:0.3 animations:^{
self.dealWithView.frame = fromFrame;
} completion:nil];
}
- (void)textViewDidEndEditing:(UITextView *)textView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight - 515, kScreenWidth, 515);
[UIView animateWithDuration:0.3 animations:^{
self.dealWithView.frame = fromFrame;
} completion:nil];
}
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text{
if (![text isEqualToString:@""]) {
self.dealWithView.placeholderLabel1.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
self.dealWithView.placeholderLabel1.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[self.dealWithView.titleTextView resignFirstResponder];
return NO;
}
if (range.location>=200) {
return NO;
}
else {
return YES;
}
return YES;
}
- (QuestionDealWithView *)dealWithView {
if (!_dealWithView) {
_dealWithView = [[QuestionDealWithView alloc] init];
_dealWithView.delegate = self;
_dealWithView.titleTextView.delegate = self;
}
return _dealWithView;
}
@end
......@@ -8,6 +8,17 @@
#import <UIKit/UIKit.h>
@protocol SelectCategaryDelegate <NSObject>
- (void)selectCategaryWithIndexPath:(NSIndexPath *)indexPath rowNum:(NSInteger)rowNum;
@end
@interface SelectCategaryViewController : UIViewController
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSString *titleStr;
@property (nonatomic, assign) NSInteger rowNum;
@property (nonatomic, assign) id <SelectCategaryDelegate> delegate;
@end
......@@ -8,7 +8,7 @@
#import "SelectCategaryViewController.h"
@interface SelectCategaryViewController ()
@interface SelectCategaryViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end
......@@ -17,28 +17,87 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self setupNav];
self.tableView.backgroundColor = [UIColor whiteColor];
self.view.backgroundColor = [UIColor whiteColor];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:[NSString stringWithFormat:@"选择%@", self.titleStr]];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
backBtn.frame = CGRectMake(0, 0, 30, 44);
[backBtn setImage:[UIImage imageNamed:@"back_btn"] forState:UIControlStateNormal];
[backBtn addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
self.navigationItem.leftBarButtonItem = backItem;
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] init];
- (void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _titleArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"selectCategoryCell"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"selectCategoryCell"];
}
return _tableView;
cell.textLabel.text = _titleArray[indexPath.row];
return cell;
}
// cell点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([_delegate respondsToSelector:@selector(selectCategaryWithIndexPath:rowNum:)]) {
[_delegate selectCategaryWithIndexPath:indexPath rowNum:self.rowNum];
}
[self.navigationController popViewControllerAnimated:YES];
}
/*
#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.
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init];
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:tableTop];
NSLayoutConstraint *tableLeft = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:tableLeft];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:tableRight];
NSLayoutConstraint *tableBottom = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:tableBottom];
}
return _tableView;
}
*/
@end
......@@ -42,41 +42,43 @@
{
if (!_quesBtn) {
_quesBtn = [[UIButton alloc] init];
_quesBtn.tag = 323118;
[_quesBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_quesBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_quesBtn setTitle:@"纯问题" forState:UIControlStateNormal];
[_quesBtn setImage:[UIImage imageNamed:@"select_box"] forState:UIControlStateNormal];
[_quesBtn setImage:[UIImage imageNamed:@"no_select_box"] forState:UIControlStateSelected];
_quesBtn.titleLabel.font = [UIFont systemFontOfSize:17.0f];
_quesBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_quesBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -8, 0, 0);
_quesBtn.imageView.contentMode = UIViewContentModeRight;
_quesBtn.titleLabel.contentMode = UIViewContentModeLeft;
[_quesBtn setTitleColor:[UIColor colorWithRed:151 / 255.0 green:151 / 255.0 blue:151 / 255.0 alpha:1.0f] forState:UIControlStateNormal];
[self.contentView addSubview:_quesBtn];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectLeft = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:selectLeft];
// 右边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.FAQBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:selectRight];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self.contentView addConstraint:selectBottom];
// 高度
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:_FAQBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:selectWidth];
_quesBtn.selected = YES;
}
_quesBtn.tag = 323118;
[_quesBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_quesBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_quesBtn setTitle:@"纯问题" forState:UIControlStateNormal];
[_quesBtn setImage:[UIImage imageNamed:@"select_box"] forState:UIControlStateNormal];
[_quesBtn setImage:[UIImage imageNamed:@"no_select_box"] forState:UIControlStateSelected];
_quesBtn.titleLabel.font = [UIFont systemFontOfSize:17.0f];
_quesBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
_quesBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -8, 0, 0);
_quesBtn.imageView.contentMode = UIViewContentModeRight;
_quesBtn.titleLabel.contentMode = UIViewContentModeLeft;
[_quesBtn setTitleColor:[UIColor colorWithRed:151 / 255.0 green:151 / 255.0 blue:151 / 255.0 alpha:1.0f] forState:UIControlStateNormal];
[self.contentView addSubview:_quesBtn];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[self.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectLeft = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.contentView addConstraint:selectLeft];
// 右边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.FAQBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.contentView addConstraint:selectRight];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self.contentView addConstraint:selectBottom];
// 高度
NSLayoutConstraint *selectWidth = [NSLayoutConstraint constraintWithItem:_quesBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:_FAQBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.contentView addConstraint:selectWidth];
return _quesBtn;
}
......@@ -84,7 +86,7 @@
{
if (!_FAQBtn) {
_FAQBtn = [[UIButton alloc] init];
//_quesBtn.tag = 323228;
_FAQBtn.tag = 323119;
[_FAQBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_FAQBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_FAQBtn setTitle:@"形成FAQ" forState:UIControlStateNormal];
......@@ -120,7 +122,7 @@
{
if (!_SOPBtn) {
_SOPBtn = [[UIButton alloc] init];
//_quesBtn.tag = 323228;
_SOPBtn.tag = 323120;
[_SOPBtn setTitleColor:kOnLineCellTitleColor forState:UIControlStateNormal];
_SOPBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_SOPBtn setTitle:@"优化SOP" forState:UIControlStateNormal];
......
......@@ -188,7 +188,7 @@
{
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
// 口碑报告 商场风采 图说口碑 口碑标准 问题知识 口碑巡检
// 口碑报告 口碑随手拍 口碑现场 口碑标准 问题知识 口碑巡检
if ([permissions containsObject:@"500202"]) {
......
......@@ -90,22 +90,22 @@ typedef void (^completionBlock) (id response, NSError *error);
- (void)getQuestionCategoryWithCompletion:(completionBlock)completion;
/**
* 图说口碑相关URL
* 口碑现场相关URL
*/
// 保存图说口碑
// 保存口碑现场
- (void)savePicturePraiseWithParameters:(id)parameters completion:(completionBlock)completion;
// 上传口碑图片
- (void)upLoadPraisePictureWithParameters:(id)parameters completion:(completionBlock)completion;
// 提交图说口碑
// 提交口碑现场
- (void)submitPicturePraiseWithCompletion:(completionBlock)completion;
// 查询图说口碑
// 查询口碑现场
- (void)queryPicturePraiseWithParameters:(id)parameters completion:(completionBlock)completion;
// 图说口碑明细
// 口碑现场明细
- (void)getPicturePraiseDetailWithCompletion:(completionBlock)completion;
// 口碑点赞
......@@ -125,4 +125,7 @@ typedef void (^completionBlock) (id response, NSError *error);
// 获取口碑标准的附件列表
- (void)getAttachmentsWithParameters:(id)parameters completion:(completionBlock)completion;
// 提交问题处理结果
- (void)submitQuestionResultWithParameters:(id)parameters completion:(completionBlock)completion;
@end
......@@ -327,10 +327,10 @@
}
/**
* 图说口碑相关URL
* 口碑现场相关URL
*/
// 保存图说口碑
// 保存口碑现场
- (void)savePicturePraiseWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
......@@ -350,7 +350,7 @@
}];
}
// 提交图说口碑
// 提交口碑现场
- (void)submitPicturePraiseWithCompletion:(completionBlock)completion
{
[self postParameters:nil completion:^(id response, NSError *error) {
......@@ -360,7 +360,7 @@
}];
}
// 查询图说口碑
// 查询口碑现场
- (void)queryPicturePraiseWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
......@@ -370,7 +370,7 @@
}];
}
// 图说口碑明细
// 口碑现场明细
- (void)getPicturePraiseDetailWithCompletion:(completionBlock)completion
{
[self getParameters:nil completion:^(id response, NSError *error) {
......@@ -431,4 +431,13 @@
}];
}
- (void)submitQuestionResultWithParameters:(id)parameters completion:(completionBlock)completion {
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment