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
......@@ -13,14 +13,29 @@
#import "HttpClient.h"
#import <MBProgressHUD.h>
#import "SelectCategaryViewController.h"
#define kSolvedTypeTableViewCell @"solveTypeTableCell"
#define kFeedContentTableCell @"feedContentTableCell"
@interface QuestionDealWithView ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UIButton *selectButton;
@property (nonatomic, assign) BOOL isComplete;
@property (nonatomic, assign) BOOL isLoad;
@property (nonatomic, strong) NSMutableDictionary *groupUuidDict;
@property (nonatomic, strong) NSMutableArray *categoryArray;
@property (nonatomic, strong) NSMutableArray *questionArray;
@property (nonatomic, assign) NSInteger groupNum;
@property (nonatomic, assign) NSInteger categoryNum;
@end
@implementation QuestionDealWithView
- (instancetype)init
{
self = [super init];
......@@ -49,60 +64,85 @@
_selectButton = [[UIButton alloc] init];
_selectButton.tag = 323118;
// [self requestGroupTitle];
_isComplete = NO;
_isLoad = NO;
_groupNum = 0;
_categoryNum = 0;
self.groupUuidDict = [NSMutableDictionary dictionary];
self.categoryArray = [NSMutableArray array];
self.questionArray = [NSMutableArray array];
[self requestGroupTitle];
}
- (void)selectCategaryWithIndexPath:(NSIndexPath *)indexPath rowNum:(NSInteger)rowNum{
if (rowNum == 0) {
_groupNum = indexPath.row;
_categoryNum = 0;
if (_categoryArray.count != 0) {
NSString *nameStr = [NSString stringWithFormat:@"%@", _categoryArray[_groupNum]];
[self requestCategoryWithGroupUuid:[_groupUuidDict objectForKey:nameStr]];
}
} else {
_categoryNum = indexPath.row;
[self.tableView reloadData];
}
}
// 请求问题专业组
//- (void)requestGroupTitle
//{
// HttpClient *httpClient = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionGroupURL]];
// [MBProgressHUD showHUDAddedTo:self animated:YES];
// [httpClient getQuestionGroupWithCompletion:^(id response, NSError *error) {
// NSDictionary *dataDict = response[@"data"];
// NSArray *dataArray = dataDict[@"records"];
// NSMutableDictionary *dict = [NSMutableDictionary dictionary];
// NSMutableArray *nameArray = [NSMutableArray array];
// for (NSDictionary *groupDict in dataArray) {
// NSString *name = [NSString stringWithFormat:@"%@", groupDict[@"name"]];
// NSString *groupUuid = [NSString stringWithFormat:@"%@", groupDict[@"uuid"]];
// [dict setObject:groupUuid forKey:name];
// [nameArray addObject:name];
// }
// _groupUuidDict = dict;
// _categoryArray = nameArray;
// _isComplete = YES;
//
// if (nameArray.count != 0) {
// NSString *nameStr = [NSString stringWithFormat:@"%@", nameArray[0]];
// [self requestCategoryWithGroupUuid:[dict objectForKey:nameStr]];
// }
// [MBProgressHUD hideAllHUDsForView:self animated:YES];
//
// [self.tableView reloadData];
// }];
//}
//
//- (void)requestCategoryWithGroupUuid:(NSString *)groupUuid
//{
// NSString *url = [NSString stringWithFormat:@"%@%@%@",kRedStarURL, kQuestionCategoryURL, groupUuid];
// url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
// HttpClient *http = [[HttpClient alloc] initWithUrl:url];
// [MBProgressHUD showHUDAddedTo:self animated:YES];
// [http getQuestionCategoryWithCompletion:^(id response, NSError *error) {
// NSDictionary *dictData = response[@"data"];
// NSArray *array = dictData[@"records"];
// NSMutableArray *categoryArray = [NSMutableArray array];
// for (NSDictionary *dict in array) {
// NSString *category = [NSString stringWithFormat:@"%@", dict[@"name"]];
// [categoryArray addObject:category];
// }
// _questionArray = categoryArray;
// _isLoad = YES;
// [MBProgressHUD hideAllHUDsForView:self animated:YES];
// [self.tableView reloadData];
// }];
//}
- (void)requestGroupTitle
{
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:[NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionGroupURL]];
[httpClient getQuestionGroupWithCompletion:^(id response, NSError *error) {
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
NSMutableArray *nameArray = [NSMutableArray array];
for (NSDictionary *groupDict in dataArray) {
NSString *name = [NSString stringWithFormat:@"%@", groupDict[@"name"]];
NSString *groupUuid = [NSString stringWithFormat:@"%@", groupDict[@"uuid"]];
[dict setObject:groupUuid forKey:name];
[nameArray addObject:name];
}
_groupUuidDict = dict;
_categoryArray = nameArray;
_isComplete = YES;
if (nameArray.count != 0) {
NSString *nameStr = [NSString stringWithFormat:@"%@", nameArray[0]];
[self requestCategoryWithGroupUuid:[dict objectForKey:nameStr]];
}
[self.tableView reloadData];
}];
}
- (void)requestCategoryWithGroupUuid:(NSString *)groupUuid
{
NSString *url = [NSString stringWithFormat:@"%@%@%@",kRedStarURL, kQuestionCategoryURL, groupUuid];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *http = [[HttpClient alloc] initWithUrl:url];
[http getQuestionCategoryWithCompletion:^(id response, NSError *error) {
NSDictionary *dictData = response[@"data"];
NSArray *array = dictData[@"records"];
NSMutableArray *categoryArray = [NSMutableArray array];
for (NSDictionary *dict in array) {
NSString *category = [NSString stringWithFormat:@"%@", dict[@"name"]];
[categoryArray addObject:category];
}
_questionArray = categoryArray;
_isLoad = YES;
[self.tableView reloadData];
}];
}
#pragma mark - lazy loading
......@@ -216,8 +256,73 @@
cell.textLabel.textColor = kdetailCellTitleColor;
if (indexPath.row == 0) {
cell.textLabel.text = @"专业组";
if (!self.groupTitle) {
self.groupTitle = [[UILabel alloc] init];
}
_groupTitle.translatesAutoresizingMaskIntoConstraints = NO;
_groupTitle.font = [UIFont systemFontOfSize:17.0];
_groupTitle.textColor = [UIColor colorWithRed:136 /255.0 green:137 /255.0 blue:138 /255.0 alpha:1.0];;
if (_categoryArray.count == 0) {
_groupTitle.text = @"";
} else {
if (_isComplete) {
_groupTitle.text =_categoryArray[_groupNum];
} else {
_groupTitle.text = @"";
}
}
[cell.contentView addSubview:_groupTitle];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_groupTitle attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[cell.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_groupTitle attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:110];
[cell.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_groupTitle attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[cell.contentView addConstraint:titleWidth];
// 高度
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_groupTitle attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[cell.contentView addConstraint:titleHeight];
} else {
cell.textLabel.text = @"问题分类";
if (!self.categoryTitle) {
self.categoryTitle = [[UILabel alloc] init];
}
_categoryTitle.translatesAutoresizingMaskIntoConstraints = NO;
_categoryTitle.font = [UIFont systemFontOfSize:17.0];
_categoryTitle.textColor = [UIColor colorWithRed:136 /255.0 green:137 /255.0 blue:138 /255.0 alpha:1.0];
if (_questionArray.count == 0) {
_categoryTitle.text = @"";
} else {
if (_isLoad) {
_categoryTitle.text = _questionArray[_categoryNum];
} else {
_categoryTitle.text = @"";
}
}
[cell.contentView addSubview:_categoryTitle];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_categoryTitle attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
[cell.contentView addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_categoryTitle attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:110];
[cell.contentView addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_categoryTitle attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[cell.contentView addConstraint:titleWidth];
// 高度
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_categoryTitle attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[cell.contentView addConstraint:titleHeight];
}
return cell;
......@@ -242,8 +347,53 @@
UIImage *image = [UIImage imageNamed:@"textbox"];
UIImage *resizingName = [image resizableImageWithCapInsets:UIEdgeInsetsMake(1, 1, 24, 24) resizingMode:UIImageResizingModeStretch];
cell.backImageView1.image = resizingName;
cell.titleTextView.backgroundColor = [UIColor clearColor];
cell.placeholderLabel1.text = @"请输入反馈内容...";
self.titleTextView.tag = 1001;
_titleTextView.font = [UIFont systemFontOfSize:15.0];
_titleTextView.translatesAutoresizingMaskIntoConstraints = NO;
_titleTextView.backgroundColor = [UIColor clearColor];
[cell.backImageView1 addSubview:_titleTextView];
NSLayoutConstraint *contentTop = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.backImageView1 attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[cell.backImageView1 addConstraint:contentTop];
NSLayoutConstraint *contentLeft = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:cell.backImageView1 attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[cell.backImageView1 addConstraint:contentLeft];
NSLayoutConstraint *contentRight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.backImageView1 attribute:NSLayoutAttributeRight multiplier:1.0 constant:-1];
[cell.backImageView1 addConstraint:contentRight];
NSLayoutConstraint *contentHeight = [NSLayoutConstraint constraintWithItem:_titleTextView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:cell.backImageView1 attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[cell.backImageView1 addConstraint:contentHeight];
if (!_placeholderLabel1) {
_placeholderLabel1 = [[UILabel alloc] init];
}
_placeholderLabel1.translatesAutoresizingMaskIntoConstraints = NO;
_placeholderLabel1.font = [UIFont systemFontOfSize:15.0];
_placeholderLabel1.textColor = kOnLineCellDetailColor;
_placeholderLabel1.text = @"请输入反馈内容...";
[self.titleTextView addSubview:_placeholderLabel1];
NSLayoutConstraint *placeholderTop = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeTop multiplier:1.0 constant:2];
[self.titleTextView addConstraint:placeholderTop];
NSLayoutConstraint *placeholderLeft = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:5];
[self.titleTextView addConstraint:placeholderLeft];
NSLayoutConstraint *placeholderRight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.titleTextView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.titleTextView addConstraint:placeholderRight];
NSLayoutConstraint *placeholderHeight = [NSLayoutConstraint constraintWithItem:_placeholderLabel1 attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.titleTextView addConstraint:placeholderHeight];
[cell.changeBtn addTarget:self action:@selector(changeClick:) forControlEvents:UIControlEventTouchUpInside];
[cell.solveBtn addTarget:self action:@selector(solveClick:) forControlEvents:UIControlEventTouchUpInside];
......@@ -255,26 +405,69 @@
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if ([_delegate respondsToSelector:@selector(tableDidSelectAtIndexPath:)]) {
[_delegate tableDidSelectAtIndexPath:indexPath];
NSArray *tempArray = [NSArray array];
if (indexPath.row == 0) {
tempArray = _categoryArray;
if ([_delegate respondsToSelector:@selector(tableDidSelectAtIndexPath:nameArray:)]) {
[_delegate tableDidSelectAtIndexPath:indexPath nameArray:tempArray];
}
} else if (indexPath.row == 1 ){
tempArray = _questionArray;
if ([_delegate respondsToSelector:@selector(tableDidSelectAtIndexPath:nameArray:)]) {
[_delegate tableDidSelectAtIndexPath:indexPath nameArray:tempArray];
}
} else {
}
}
- (void)solveQues:(UIButton *)sender {
_selectButton.selected = NO;
sender.selected = YES;
_selectButton = (UIButton *)sender;
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:2 inSection:0];
SolvedTypeTableViewCell *cell = (SolvedTypeTableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath];
if (sender.tag - 323118 == 0) {
sender.selected = YES;
cell.FAQBtn.selected = NO;
cell.SOPBtn.selected = NO;
} else if (sender.tag - 323118 == 1) {
sender.selected = YES;
cell.quesBtn.selected = NO;
cell.SOPBtn.selected = NO;
} else {
sender.selected = YES;
cell.quesBtn.selected = NO;
cell.FAQBtn.selected = NO;
}
_selectButton = sender;
[self.tableView reloadData];
}
- (void)changeClick:(UIButton *)sender {
NSString *solutionType = nil;
if (_selectButton.tag - 323118 == 0) {
solutionType = @"question";
} else if (_selectButton.tag - 323118 == 1){
solutionType = @"faq";
} else {
solutionType = @"sop";
}
if (_delegate && [_delegate respondsToSelector:@selector(requestProlemDealWithResultWithGroupText:categoryText:solutionType:optionType:)]) {
[_delegate requestProlemDealWithResultWithGroupText:_groupTitle.text categoryText:_categoryTitle.text solutionType:solutionType optionType:@"update"];
}
}
- (void)solveClick:(UIButton *)sender {
if (_delegate && [_delegate respondsToSelector:@selector(requestProlemDealWithResultWithGroupText:categoryText:solutionType:optionType:)]) {
[_delegate requestProlemDealWithResultWithGroupText:_groupTitle.text categoryText:_categoryTitle.text solutionType:@"question" optionType:@"resolve"];
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
......@@ -298,6 +491,11 @@
return CGFLOAT_MIN;
}
- (UITextView *)titleTextView {
if (!_titleTextView) {
_titleTextView = [[UITextView alloc] init];
}
return _titleTextView;
}
@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"]) {
......
......@@ -89,7 +89,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
@property (nonatomic, strong) NSMutableArray *taskListDataArray; // 问题与知识
@property (nonatomic, strong) NSMutableArray *allRankListArray;
@property (nonatomic, strong) NSMutableArray *allPraiseListArray;
@property (nonatomic, strong) NSMutableArray *allExcellentCaseArray; // 优秀案例
@property (nonatomic, strong) NSMutableArray *allExcellentCaseArray; // 口碑报道
@property (nonatomic, strong) NSMutableArray *allPatrolReportArray; // 巡店报告
@property (nonatomic, strong) NSMutableArray *allLookOnLineList; //
@property (nonatomic, strong) NSMutableArray *allSpotCheckList; //
......@@ -111,8 +111,9 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
self.navigationItem.titleView = customLab;
self.titleArray = [NSMutableArray array];
// self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"商场风采",@"优秀案例",@"巡店报告", @"问题知识",@"口碑巡检",@"在线抽查",nil];
self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"商场风采",@"优秀案例",@"巡店报告", @"问题知识",@"口碑巡检",nil];
// self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"口碑随手拍",@"口碑报道",@"口碑巡店", @"问题知识",@"口碑巡检",nil];
self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"口碑报道",@"口碑巡店", @"问题知识",@"口碑巡检",nil];
self.allRankListArray = [NSMutableArray array];
self.taskListDataArray = [NSMutableArray array];
......@@ -126,7 +127,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
// 口碑报告 商场风采 图说口碑 口碑标准 问题知识 口碑巡检
// 口碑报告 口碑随手拍 口碑现场 口碑标准 问题知识 口碑巡检
if ([permissions containsObject:@"500201"]) {
[self.titleArray addObject:@"口碑报告"];
......@@ -135,22 +136,22 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
[_sectionArray removeObject:@"口碑报告"];
}
[self.titleArray addObject:@"商场风采"];
// [self.titleArray addObject:@"口碑随手拍"];
NSArray *typeArray = [NSArray arrayWithObjects:@"store", @"casus",@"report",nil];
// 商场风采
// 口碑随手拍
[self requestPicturePraiseWithType:typeArray[0]];
// 优秀案例
// 口碑报道
[self requestPicturePraiseWithType:typeArray[1]];
// 巡店报告
[self requestPicturePraiseWithType:typeArray[2]];
if ([permissions containsObject:@"500301"] || [permissions containsObject:@"500302"]) {
[self.titleArray addObject:@"图说口碑"];
[self.titleArray addObject:@"口碑现场"];
} else {
[_sectionArray removeObject:@"图说口碑"];
[_sectionArray removeObject:@"口碑现场"];
}
if ([permissions containsObject:@"500401"] || [permissions containsObject:@"500402"]) {
......@@ -586,17 +587,17 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
if ([type isEqualToString:@"store"]) {
_allPraiseListArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPraiseListArray.count == 0) {
[_sectionArray removeObject:@"商场风采"];
[_sectionArray removeObject:@"口碑随手拍"];
}
} else if ([type isEqualToString:@"casus"]) {
_allExcellentCaseArray = [NSMutableArray arrayWithArray:tempArray];
if (_allExcellentCaseArray.count == 0) {
[_sectionArray removeObject:@"优秀案例"];
[_sectionArray removeObject:@"口碑报道"];
}
} else {
_allPatrolReportArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPatrolReportArray.count == 0) {
[_sectionArray removeObject:@"巡店报告"];
[_sectionArray removeObject:@"口碑巡店"];
}
}
......@@ -749,7 +750,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} else if ([_sectionArray[section] isEqualToString:@"口碑标准"]) {
StandardViewController *standardVC = [[StandardViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([_sectionArray[section] isEqualToString:@"图说口碑"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑现场"]) {
PicCategoryViewController *pictureVC = [[PicCategoryViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
} else if ([_sectionArray[section] isEqualToString:@"问题知识"]) {
......@@ -758,22 +759,22 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} else if ([_sectionArray[section] isEqualToString:@"口碑报告"]){
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else if ([_sectionArray[section] isEqualToString:@"商场风采"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑随手拍"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.titleStr = @"商场风采";
pic.titleStr = @"口碑随手拍";
pic.category = @"store";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
} else if ([_sectionArray[section] isEqualToString:@"优秀案例"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑报道"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.titleStr = @"优秀案例";
pic.titleStr = @"口碑报道";
pic.category = @"casus";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
} else if ([_sectionArray[section] isEqualToString:@"巡店报告"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑巡店"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.titleStr = @"巡店报告";
pic.titleStr = @"口碑巡店";
pic.category = @"report";
nav = [[UINavigationController alloc] initWithRootViewController:pic];
}
......@@ -808,7 +809,7 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} 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];
} else if ([item.titleLabel.text isEqualToString:@"问题知识"]) {
......@@ -817,11 +818,11 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
} 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];
}
......@@ -846,11 +847,11 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
//NSUInteger s8 = [_sectionArray indexOfObject:@"在线抽查"];
......@@ -860,11 +861,11 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
return _allRankListArray.count + 1;
} else if ([_sectionArray[section] isEqualToString:@"问题知识"] && section == s3) {
return _allQuestionArray.count;
} else if ([_sectionArray[section] isEqualToString:@"商场风采"] && section == s4) {
} else if ([_sectionArray[section] isEqualToString:@"口碑随手拍"] && section == s4) {
return _allPraiseListArray.count;
} else if ([_sectionArray[section] isEqualToString:@"优秀案例"] && section == s5) {
} else if ([_sectionArray[section] isEqualToString:@"口碑报道"] && section == s5) {
return _allExcellentCaseArray.count;
} else if ([_sectionArray[section] isEqualToString:@"巡店报告"] && section == s6) {
} else if ([_sectionArray[section] isEqualToString:@"口碑巡店"] && section == s6) {
return _allPatrolReportArray.count;
} else if ([_sectionArray[section] isEqualToString:@"在线抽查"] && section == s7) {
if ([permissions containsObject:@"500701"]) {
......@@ -888,11 +889,11 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
//NSUInteger s8 = [_sectionArray indexOfObject:@"在线抽查"];
......@@ -947,21 +948,21 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
QuestionModel *question = _allQuestionArray[indexPath.row];
cell.question = question;
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"商场风采"] && indexPath.section == s4) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑随手拍"] && indexPath.section == s4) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:KHomePicTableCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:KHomePicTableCell];
}
cell.pictureList = _allPraiseListArray[indexPath.row];
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑报道"] && indexPath.section == s5) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:KHomePicTableCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:KHomePicTableCell];
}
cell.pictureList = _allExcellentCaseArray[indexPath.row];
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡店"] && indexPath.section == s6) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:KHomePicTableCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:KHomePicTableCell];
......@@ -1000,11 +1001,11 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
//NSUInteger s8 = [_sectionArray indexOfObject:@"在线抽查"];
if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) {
......@@ -1035,25 +1036,25 @@ typedef NSComparisonResult (^NSComparator)(id obj1, id obj2);
questionDetailVC.questionUuid = question.uuid;
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:questionDetailVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"商场风采"] && indexPath.section == s4) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑随手拍"] && indexPath.section == s4) {
PictureListModel *picList = _allPraiseListArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"商场风采";
storyVC.titleStr = @"口碑随手拍";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑报道"] && indexPath.section == s5) {
PictureListModel *picList = _allExcellentCaseArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"优秀案例";
storyVC.titleStr = @"口碑报道";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡店"] && indexPath.section == s6) {
PictureListModel *picList = _allPatrolReportArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"巡店报告";
storyVC.titleStr = @"口碑巡店";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"在线抽查"] && indexPath.section == s7) {
......
......@@ -73,7 +73,7 @@
@property (nonatomic, strong) NSMutableArray *allRankListArray;
@property (nonatomic, strong) NSMutableArray *allPraiseListArray;
@property (nonatomic, strong) NSMutableArray *allExcellentCaseArray; // 优秀案例
@property (nonatomic, strong) NSMutableArray *allExcellentCaseArray; // 口碑报道
@property (nonatomic, strong) NSMutableArray *allPatrolReportArray; // 巡店报告
@property (nonatomic, strong) NSMutableArray *allLookOnLineList; //
@property (nonatomic, strong) NSMutableArray *allSpotCheckList; //
......@@ -88,7 +88,7 @@
self.view.backgroundColor = [UIColor whiteColor];
self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"商场风采",@"优秀案例",@"巡店报告", @"问题知识",@"口碑巡检",@"在线抽查", @"查看抽查",nil];
self.sectionArray = [NSMutableArray arrayWithObjects:@"口碑报告",@"口碑随手拍",@"口碑报道",@"口碑巡店", @"问题知识",@"口碑巡检",@"在线抽查", @"查看抽查",nil];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
[customLab setTextColor:[UIColor whiteColor]];
......@@ -117,7 +117,7 @@
NSArray *permissions = [[NSUserDefaults standardUserDefaults] objectForKey:@"permissions"];
// 口碑报告 商场风采 图说口碑 口碑标准 问题知识 口碑巡检
// 口碑报告 口碑随手拍 口碑现场 口碑标准 问题知识 口碑巡检
if ([permissions containsObject:@"500201"]) {
[self requestRankingList];
......@@ -127,7 +127,7 @@
NSArray *typeArray = [NSArray arrayWithObjects:@"store", @"casus",@"report",nil];
// 商场风采
// 口碑随手拍
[self requestPicturePraiseWithType:typeArray[0]];
// 优秀案例
[self requestPicturePraiseWithType:typeArray[1]];
......@@ -163,10 +163,10 @@
self.taskListDataArray = [NSMutableArray array];
self.allQuestionArray = [NSMutableArray array];
self.allPraiseListArray = [NSMutableArray array];
self.allExcellentCaseArray = [NSMutableArray array]; // 优秀案例
self.allPatrolReportArray = [NSMutableArray array]; // 优秀案例
self.allLookOnLineList = [NSMutableArray array]; // 优秀案例
self.allSpotCheckList = [NSMutableArray array]; // 优秀案例
self.allExcellentCaseArray = [NSMutableArray array];
self.allPatrolReportArray = [NSMutableArray array];
self.allLookOnLineList = [NSMutableArray array];
self.allSpotCheckList = [NSMutableArray array];
}
- (void)didReceiveMemoryWarning {
......@@ -198,7 +198,7 @@
} else if ([_sectionArray[section] isEqualToString:@"口碑标准"]) {
StandardViewController *standardVC = [[StandardViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([_sectionArray[section] isEqualToString:@"图说口碑"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑现场"]) {
PicCategoryViewController *pictureVC = [[PicCategoryViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
} else if ([_sectionArray[section] isEqualToString:@"问题知识"]) {
......@@ -210,7 +210,7 @@
} else if ([_sectionArray[section] isEqualToString:@"查看抽查"]){
LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
} else if ([_sectionArray[section] isEqualToString:@"商场风采"]) {
} else if ([_sectionArray[section] isEqualToString:@"口碑随手拍"]) {
PictureViewController *pic = [[PictureViewController alloc] init];
pic.come = @"首页";
pic.category = @"store";
......@@ -379,7 +379,7 @@
//
// // 请求问题列表
// [httpClient queryPicturePraiseWithParameters:parameters completion:^(id response, NSError *error) {
// NSLog(@"图说口碑 response = %@ error = %@" , response, error);
// NSLog(@"口碑现场 response = %@ error = %@" , response, error);
// NSDictionary *dataDict = response[@"data"];
// NSArray *dataArray = dataDict[@"records"];
// NSMutableArray *tempArray = [NSMutableArray array];
......@@ -390,7 +390,7 @@
// }
// _allPraiseListArray = tempArray;
// if (_allPraiseListArray.count != 0) {
// [_sectionArray addObject:@"商场风采"];
// [_sectionArray addObject:@"口碑随手拍"];
// }
// [self.tableView reloadData];
// [MBProgressHUD hideHUDForView:self.view animated:YES];
......@@ -605,17 +605,17 @@
if ([type isEqualToString:@"store"]) {
_allPraiseListArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPraiseListArray.count == 0) {
[_sectionArray removeObject:@"商场风采"];
[_sectionArray removeObject:@"口碑随手拍"];
}
} else if ([type isEqualToString:@"casus"]) {
_allExcellentCaseArray = [NSMutableArray arrayWithArray:tempArray];
if (_allExcellentCaseArray.count == 0) {
[_sectionArray removeObject:@"优秀案例"];
[_sectionArray removeObject:@"口碑报道"];
}
} else {
_allPatrolReportArray = [NSMutableArray arrayWithArray:tempArray];
if (_allPatrolReportArray.count == 0) {
[_sectionArray removeObject:@"巡店报告"];
[_sectionArray removeObject:@"口碑巡店"];
}
}
......@@ -756,7 +756,7 @@
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//{
// NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
// NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
// NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
// NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
// NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
//
......@@ -766,7 +766,7 @@
// return _allRankListArray.count + 1;
// } else if ([_sectionArray[section] isEqualToString:@"问题知识"] && section == s3) {
// return _allQuestionArray.count;
// } else if ([_sectionArray[section] isEqualToString:@"商场风采"] && section == s4) {
// } else if ([_sectionArray[section] isEqualToString:@"口碑随手拍"] && section == s4) {
// return _allPraiseListArray.count;
// } else {
// return 0;
......@@ -888,11 +888,11 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
NSUInteger s8 = [_sectionArray indexOfObject:@"查看抽查"];
......@@ -902,11 +902,11 @@
return _allRankListArray.count + 1;
} else if ([_sectionArray[section] isEqualToString:@"问题知识"] && section == s3) {
return _allQuestionArray.count;
} else if ([_sectionArray[section] isEqualToString:@"商场风采"] && section == s4) {
} else if ([_sectionArray[section] isEqualToString:@"口碑随手拍"] && section == s4) {
return _allPraiseListArray.count;
} else if ([_sectionArray[section] isEqualToString:@"优秀案例"] && section == s5) {
} else if ([_sectionArray[section] isEqualToString:@"口碑报道"] && section == s5) {
return _allExcellentCaseArray.count;
} else if ([_sectionArray[section] isEqualToString:@"巡店报告"] && section == s6) {
} else if ([_sectionArray[section] isEqualToString:@"口碑巡店"] && section == s6) {
return _allPatrolReportArray.count;
} else if ([_sectionArray[section] isEqualToString:@"在线抽查"] && section == s7) {
return _allSpotCheckList.count;
......@@ -922,11 +922,11 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
NSUInteger s8 = [_sectionArray indexOfObject:@"查看抽查"];
......@@ -981,21 +981,21 @@
QuestionModel *question = _allQuestionArray[indexPath.row];
cell.question = question;
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"商场风采"] && indexPath.section == s4) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑随手拍"] && indexPath.section == s4) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomePictureListCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomePictureListCell];
}
cell.pictureList = _allPraiseListArray[indexPath.row];
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑报道"] && indexPath.section == s5) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomePictureListCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomePictureListCell];
}
cell.pictureList = _allExcellentCaseArray[indexPath.row];
return cell;
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡店"] && indexPath.section == s6) {
PictureTableCell *cell=[tableView dequeueReusableCellWithIdentifier:kHomePictureListCell];
if (!cell) {
cell = [[PictureTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomePictureListCell];
......@@ -1033,11 +1033,11 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSUInteger s2 = [_sectionArray indexOfObject:@"口碑报告"];
NSUInteger s4 = [_sectionArray indexOfObject:@"商场风采"];
NSUInteger s4 = [_sectionArray indexOfObject:@"口碑随手拍"];
NSUInteger s3 = [_sectionArray indexOfObject:@"问题知识"];
NSUInteger s1 = [_sectionArray indexOfObject:@"口碑巡检"];
NSUInteger s5 = [_sectionArray indexOfObject:@"优秀案例"];
NSUInteger s6 = [_sectionArray indexOfObject:@"巡店报告"];
NSUInteger s5 = [_sectionArray indexOfObject:@"口碑报道"];
NSUInteger s6 = [_sectionArray indexOfObject:@"口碑巡店"];
NSUInteger s7 = [_sectionArray indexOfObject:@"在线抽查"];
NSUInteger s8 = [_sectionArray indexOfObject:@"查看抽查"];
if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡检"] && indexPath.section == s1) {
......@@ -1068,25 +1068,25 @@
questionDetailVC.questionUuid = question.uuid;
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:questionDetailVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"商场风采"] && indexPath.section == s4) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑随手拍"] && indexPath.section == s4) {
PictureListModel *picList = _allPraiseListArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"商场风采";
storyVC.titleStr = @"口碑随手拍";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"优秀案例"] && indexPath.section == s5) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑报道"] && indexPath.section == s5) {
PictureListModel *picList = _allExcellentCaseArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"优秀案例";
storyVC.titleStr = @"口碑报道";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"巡店报告"] && indexPath.section == s6) {
} else if ([_sectionArray[indexPath.section] isEqualToString:@"口碑巡店"] && indexPath.section == s6) {
PictureListModel *picList = _allPatrolReportArray[indexPath.row];
PictureStoryViewController *storyVC = [[PictureStoryViewController alloc] init];
storyVC.uuid = picList.uuid;
storyVC.titleStr = @"巡店报告";
storyVC.titleStr = @"口碑巡店";
self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:storyVC animated:YES];
} else if ([_sectionArray[indexPath.section] isEqualToString:@"在线抽查"] && indexPath.section == s7) {
......
......@@ -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