Commit 4ab42698 authored by admin's avatar admin

url.h添加问题详情接口

parent 6b9855fb
......@@ -1694,6 +1694,7 @@
baseConfigurationReference = 6C6D8B0ECF8531E34D0DFF6B /* Pods.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PREFIX_HEADER = "$(SRCROOT)/redstar/redstar.pch";
INFOPLIST_FILE = redstar/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
......@@ -1708,6 +1709,7 @@
baseConfigurationReference = 13B0DDED3E0E584D79B395CF /* Pods.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
GCC_PREFIX_HEADER = "$(SRCROOT)/redstar/redstar.pch";
INFOPLIST_FILE = redstar/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
......
......@@ -18,6 +18,8 @@
// QuestionList
#define kQuestionListURL @"redstar-server/rest/question/query"
#define kQuestionDetailURL @"redstar-server/rest/question/get/"
// InspectList获取口碑列表
#define kInspectListURL @"redstar-server/rest/praise/query"
......
......@@ -273,7 +273,6 @@
// 设置圆角
_sureBtn.layer.cornerRadius = 4;
_sureBtn.layer.masksToBounds = YES;
_sureBtn.translatesAutoresizingMaskIntoConstraints = NO;
_sureBtn.backgroundColor = kLoginButtonBackGroundColor;
[_sureBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
......
......@@ -268,7 +268,6 @@
_saveButton = [[UIButton alloc] init];
_saveButton.backgroundColor = kNavigationBarColor;
_saveButton.layer.cornerRadius = 5;
_saveButton.layer.masksToBounds = YES;
_saveButton.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_saveButton];
......
......@@ -89,7 +89,6 @@
_hotLabel.textColor = [UIColor whiteColor];
_hotLabel.text = @"HOT";
_hotLabel.textAlignment = NSTextAlignmentCenter;
_hotLabel.layer.masksToBounds = YES;
_hotLabel.layer.cornerRadius = 3;
[self.contentView addSubview:_hotLabel];
......
......@@ -207,7 +207,6 @@
_feedbackBackView = [[UIView alloc] init];
_feedbackBackView.translatesAutoresizingMaskIntoConstraints = NO;
_feedbackBackView.layer.cornerRadius = 5;
_feedbackBackView.layer.masksToBounds = YES;
_feedbackBackView.layer.borderWidth = 1;
_feedbackBackView.layer.borderColor = kQuestionFeedBackTitleCGColor;
[self.contentView addSubview:_feedbackBackView];
......
......@@ -43,7 +43,6 @@
// 设置圆角
_addButon.layer.cornerRadius = 5;
_addButon.layer.masksToBounds = YES;
_addButon.translatesAutoresizingMaskIntoConstraints = NO;
_addButon.backgroundColor = kLoginButtonBackGroundColor;
[_addButon setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
......
......@@ -47,7 +47,8 @@
self.test3Array = [NSArray arrayWithObjects:@"2015-09-10 10:21:43", @"2015-10-27 11:21:43", nil];
// 问题详情
[self requestQestionDetail];
}
- (void)viewWillAppear:(BOOL)animated
......@@ -65,6 +66,20 @@
}
#pragma mark - Private Methods
- (void)requestQestionDetail
{
NSDictionary *dict = [[NSUserDefaults standardUserDefaults] objectForKey:@"loginData"];
NSString *user_uuid = dict[@"user_uuid"];
NSString *url = [NSString stringWithFormat:@"%@%@%@?userUuid=%@", kRedStarURL, kQuestionListURL, _question.uuid,user_uuid];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
[httpClient getQuestionDetailWithParameters:nil completion:^(id response, NSError *error) {
NSLog(@"response = %@", response);
}];
}
- (void)setupNav
{
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
......@@ -121,6 +136,7 @@
}
// 提交评论
- (void)submitComment:(UIButton *)sender
{
NSNumber *count = [NSNumber numberWithInteger:_commentView.starBar.starNumber];
......
......@@ -86,7 +86,6 @@
_hotLabel.textColor = [UIColor whiteColor];
_hotLabel.text = @"HOT";
_hotLabel.textAlignment = NSTextAlignmentCenter;
_hotLabel.layer.masksToBounds = YES;
_hotLabel.layer.cornerRadius = 3;
[self.contentView addSubview:_hotLabel];
......
......@@ -94,13 +94,20 @@
self.allQuestionArray = [NSMutableArray array];
// 请求地址
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL];
NSDictionary *dict = [[NSUserDefaults standardUserDefaults] objectForKey:@"loginData"];
NSString *user_uuid = dict[@"user_uuid"];
// 请求参数
NSDictionary *parameters = @{@"user":@"5a74170150b940ae0150b940f8450083",
NSDictionary *parameters = @{@"user":user_uuid,
@"scope":@"all",
@"group":@"",
@"category":@"",
@"type":@""
//,@"state":@"resolved"
@"contentLike":@"",
@"keyword":@"",
@"state":@"created",
@"submitTimeFrom":@"",
@"submitTimeTo":@"",
@"pageNumber":@(1),
@"pageSize":@(10)
};
// 发起请求
......@@ -114,6 +121,7 @@
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"问题与知识列表recods = %@", recordsDict);
NSLog(@"error = %@", error);
for (NSDictionary *questionDict in recordsDict) {
QuestionModel *question = [[QuestionModel alloc] init];
[question setValuesForKeysWithDictionary:questionDict];
......
......@@ -190,7 +190,6 @@
_reportBtn.titleLabel.font = [UIFont systemFontOfSize:20.0];
_reportBtn.backgroundColor = kNavigationBarColor;
_reportBtn.layer.cornerRadius = 5.0;
_reportBtn.layer.masksToBounds = YES;
[_reportBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self addSubview:_reportBtn];
}
......
......@@ -27,5 +27,6 @@
@property (nonatomic, strong) id <TakePhotoDelegate>delegate;
- (BOOL)deleClose:(UIButton *)btn;
- (UIButton *)createButtonWithImage:(id)imageNameOrImage andSeletor : (SEL)selector;
- (void)changeOld:(UIButton *)btn;
@end
......@@ -124,7 +124,7 @@
// 长按添加删除按钮
- (void)longPress : (UIGestureRecognizer *)gester
- (void)longPress:(UIGestureRecognizer *)gester
{
if (gester.state == UIGestureRecognizerStateBegan)
{
......@@ -196,13 +196,28 @@
}
}
- (void)saveImage:(UIImage *)currentImage {
// NSLog(@"newPath = %@", newPath);
// // NSMutableArray *arr = [[NSMutableArray alloc] init];
// //把图片转换为Base64的字符串
// NSData *data = UIImageJPEGRepresentation(currentImage, 0.4);
// NSString *base64Str = [data base64EncodedStringWithOptions:0];
//// [arr addObject:image64];
// //写入plist文件as
// [base64Str writeToFile:newPath atomically:NO];
}
#pragma mark - UIImagePickerController 代理方法
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
//UIImage *image = [info objectForKey:UIImagePickerControllerEditedImage];
if (editTag == -1) {
// 创建一个新的控件
UIButton *btn = [self createButtonWithImage:image andSeletor:@selector(changeOld:)];
......@@ -211,11 +226,16 @@
[self.images addObject:image];
if (self.subviews.count - 1 == MaxImageCount) {
[[self.subviews lastObject] setHidden:YES];
}
}
else
{
//获取沙盒路径,
NSString *path_sandox = NSHomeDirectory();
//创建一个存储plist文件的路径
NSString *newPath = [path_sandox stringByAppendingPathComponent:@"/Documents/pic.plist"];
} else {
// 根据tag修改需要编辑的控件
UIButton *btn = (UIButton *)[self viewWithTag:editTag];
int index = (int)[self.images indexOfObject:[btn imageForState:UIControlStateNormal]];
......
......@@ -13,7 +13,6 @@
#import "CheckPicViewController.h"
#import "HttpClient.h"
#define kInspectSettleCell @"InspectSettleCell"
@interface InspectSettleViewController () <UITableViewDelegate, UITableViewDataSource, TakePhotoDelegate>
......@@ -44,6 +43,7 @@
[self.tableView registerClass:[InspectSettleCell class] forCellReuseIdentifier:kInspectSettleCell];
self.tableView.tableFooterView = self.footerView;
self.footerView.takePhotoView.delegate = self;
......@@ -102,6 +102,7 @@
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
InspectSettleCell *cell=[tableView dequeueReusableCellWithIdentifier:kInspectSettleCell];
if (!cell) {
cell = [[InspectSettleCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectSettleCell];
......@@ -111,7 +112,6 @@
cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = @"字体以简体中文为主;内容贴近活动主题;悬挂牢固,以不影响顾客浏览体验为佳";
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
......@@ -119,11 +119,6 @@
}
//// cell的高度
//- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
//{
// return 200;
//}
// section高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
......@@ -148,7 +143,7 @@
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 150.0;
_tableView.estimatedRowHeight = 200.0;
[self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......
......@@ -58,6 +58,10 @@
self.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount;
}
if (self.multiplier > 1) {
self.multiplier = 1.0;
}
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
......@@ -260,8 +264,8 @@
_allView = [[UIView alloc] init];
_allView.translatesAutoresizingMaskIntoConstraints = NO;
_allView.layer.cornerRadius = 3;
_allView.layer.masksToBounds = YES;
_allView.layer.borderWidth = 1;
_allView.layer.masksToBounds = YES;
_allView.layer.borderColor = kUsernameBorderColor;
[self.contentView addSubview:_allView];
......@@ -300,7 +304,7 @@
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-1];
[self.allView addConstraint:overDateBottom];
NSLayoutConstraint *overDatewidth = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeWidth multiplier:_multiplier constant:0];
NSLayoutConstraint *overDatewidth = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeWidth multiplier:_multiplier constant:-1];
[self.allView addConstraint:overDatewidth];
}
......
......@@ -50,6 +50,8 @@
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"巡检列表"];
......
......@@ -19,6 +19,7 @@
#import "HttpClient.h"
#import "TaskDetailModel.h"
#import <MBProgressHUD.h>
#define kTaskSortCell @"InspectTaskSortCell"
......@@ -94,7 +95,7 @@
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
__block InspectTaskViewController *weakSelf = self;
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpClient getPraiseDetailWithParameters:nil completion:^(id response, NSError *error) {
NSLog(@"口碑巡检明细PraiseDetail = %@", response);
NSDictionary *dataDict = response[@"data"];
......@@ -114,6 +115,8 @@
self.tableView.delegate = self;
self.tableView.dataSource = self;
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
}
......
......@@ -156,7 +156,6 @@
_usernameView = [[UIView alloc] init];
}
_usernameView.layer.cornerRadius = 5;
_usernameView.layer.masksToBounds = YES;
_usernameView.layer.borderWidth = 1;
_usernameView.layer.borderColor = kUsernameBorderColor;
_usernameView.translatesAutoresizingMaskIntoConstraints = NO;
......@@ -187,7 +186,6 @@
_passwordView = [[UIView alloc] init];
}
_passwordView.layer.cornerRadius = 5;
_passwordView.layer.masksToBounds = YES;
_passwordView.layer.borderWidth = 1;
_passwordView.layer.borderColor = kPasswordBorderColor;
_passwordView.translatesAutoresizingMaskIntoConstraints = NO;
......@@ -385,7 +383,6 @@
}
// 设置圆角
_loginButton.layer.cornerRadius = 5;
_loginButton.layer.masksToBounds = YES;
_loginButton.translatesAutoresizingMaskIntoConstraints = NO;
_loginButton.backgroundColor = kLoginButtonBackGroundColor;
[_loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
......
......@@ -128,6 +128,7 @@
UIWindow *window = [[UIApplication sharedApplication].windows lastObject];
[MBProgressHUD showHUDAddedTo:window animated:YES];
[httpClient loginWithUsername:self.loginView.usernameTextFiled.text password:self.loginView.passwordTextFiled.text completion:^(id response, NSError *error) {
NSLog(@"response = %@, error = %@", response, error);
if ([response[@"message"] isEqualToString:@"ok"]) {
// 保存登陆信息
......
......@@ -34,7 +34,6 @@
}
_quitButton.titleLabel.font = [UIFont systemFontOfSize:19.0];
_quitButton.translatesAutoresizingMaskIntoConstraints = NO;
_quitButton.layer.masksToBounds = YES;
_quitButton.layer.cornerRadius = 5.0;
[_quitButton setTitle:@"退出登录" forState:UIControlStateNormal];
[self addSubview:_quitButton];
......
......@@ -25,6 +25,9 @@ typedef void (^completionBlock) (id response, NSError *error);
// 获取问题列表
- (void)getQuestionListWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取问题详情
- (void)getQuestionDetailWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取巡检列表
- (void)getInspectListWithParameters:(id)parameters completion:(completionBlock)completion;
......
......@@ -115,6 +115,15 @@
}];
}
- (void)getQuestionDetailWithParameters:(id)parameters completion:(completionBlock)completion
{
[self getParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 获取巡检列表
- (void)getInspectListWithParameters:(id)parameters completion:(completionBlock)completion
{
......
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