Commit 88b0cab6 authored by admin's avatar admin

在线抽查 商场完成

parent 8b81d883
...@@ -114,6 +114,8 @@ ...@@ -114,6 +114,8 @@
84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34EE1C09AEC0002F10E2 /* LookOnLineDetailViewController.m */; }; 84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34EE1C09AEC0002F10E2 /* LookOnLineDetailViewController.m */; };
84CEB1671C28E8970072ED0A /* SpotCheckModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1661C28E8970072ED0A /* SpotCheckModel.m */; }; 84CEB1671C28E8970072ED0A /* SpotCheckModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1661C28E8970072ED0A /* SpotCheckModel.m */; };
84CEB16B1C28F0E20072ED0A /* LookOnLineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB16A1C28F0E20072ED0A /* LookOnLineModel.m */; }; 84CEB16B1C28F0E20072ED0A /* LookOnLineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB16A1C28F0E20072ED0A /* LookOnLineModel.m */; };
84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB16E1C2946DB0072ED0A /* OnLineDetailModel.m */; };
84CEB1721C2946EC0072ED0A /* StoreDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1711C2946EC0072ED0A /* StoreDetailModel.m */; };
84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */; }; 84CF0F1E1BE9B40400C855CE /* InspectDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */; };
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */; }; 84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CF0FA11BE9EDA900C855CE /* TakePhotoView.m */; };
84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */; }; 84D3E5F01C04BC8C001FF1DD /* InspectUploadedViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84D3E5EF1C04BC8C001FF1DD /* InspectUploadedViewController.m */; };
...@@ -389,6 +391,10 @@ ...@@ -389,6 +391,10 @@
84CEB1661C28E8970072ED0A /* SpotCheckModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpotCheckModel.m; sourceTree = "<group>"; }; 84CEB1661C28E8970072ED0A /* SpotCheckModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpotCheckModel.m; sourceTree = "<group>"; };
84CEB1691C28F0E20072ED0A /* LookOnLineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookOnLineModel.h; sourceTree = "<group>"; }; 84CEB1691C28F0E20072ED0A /* LookOnLineModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookOnLineModel.h; sourceTree = "<group>"; };
84CEB16A1C28F0E20072ED0A /* LookOnLineModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookOnLineModel.m; sourceTree = "<group>"; }; 84CEB16A1C28F0E20072ED0A /* LookOnLineModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookOnLineModel.m; sourceTree = "<group>"; };
84CEB16D1C2946DB0072ED0A /* OnLineDetailModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OnLineDetailModel.h; sourceTree = "<group>"; };
84CEB16E1C2946DB0072ED0A /* OnLineDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OnLineDetailModel.m; sourceTree = "<group>"; };
84CEB1701C2946EC0072ED0A /* StoreDetailModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StoreDetailModel.h; sourceTree = "<group>"; };
84CEB1711C2946EC0072ED0A /* StoreDetailModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreDetailModel.m; sourceTree = "<group>"; };
84CF0F1C1BE9B40400C855CE /* InspectDetailFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailFooterView.h; sourceTree = "<group>"; }; 84CF0F1C1BE9B40400C855CE /* InspectDetailFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailFooterView.h; sourceTree = "<group>"; };
84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailFooterView.m; sourceTree = "<group>"; }; 84CF0F1D1BE9B40400C855CE /* InspectDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailFooterView.m; sourceTree = "<group>"; };
84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TakePhotoView.h; sourceTree = "<group>"; }; 84CF0FA01BE9EDA900C855CE /* TakePhotoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TakePhotoView.h; sourceTree = "<group>"; };
...@@ -1382,6 +1388,7 @@ ...@@ -1382,6 +1388,7 @@
84A673821C0B4D3B000F828E /* OnLineTaskComplete */ = { 84A673821C0B4D3B000F828E /* OnLineTaskComplete */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
84CEB16C1C2946590072ED0A /* Model */,
84A673831C0B4D3B000F828E /* Cell */, 84A673831C0B4D3B000F828E /* Cell */,
84A673841C0B4D3B000F828E /* View */, 84A673841C0B4D3B000F828E /* View */,
84A673851C0B4D3B000F828E /* ViewController */, 84A673851C0B4D3B000F828E /* ViewController */,
...@@ -1777,6 +1784,17 @@ ...@@ -1777,6 +1784,17 @@
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
84CEB16C1C2946590072ED0A /* Model */ = {
isa = PBXGroup;
children = (
84CEB16D1C2946DB0072ED0A /* OnLineDetailModel.h */,
84CEB16E1C2946DB0072ED0A /* OnLineDetailModel.m */,
84CEB1701C2946EC0072ED0A /* StoreDetailModel.h */,
84CEB1711C2946EC0072ED0A /* StoreDetailModel.m */,
);
path = Model;
sourceTree = "<group>";
};
84CF0ECA1BE9A7EF00C855CE /* InspectDetail */ = { 84CF0ECA1BE9A7EF00C855CE /* InspectDetail */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2218,6 +2236,7 @@ ...@@ -2218,6 +2236,7 @@
846206B51C06AF700015C456 /* RankListHeaderView.m in Sources */, 846206B51C06AF700015C456 /* RankListHeaderView.m in Sources */,
84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */, 84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */,
8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */, 8490C4D41BF9DEF0006B6569 /* PictureViewController.m in Sources */,
84CEB1721C2946EC0072ED0A /* StoreDetailModel.m in Sources */,
8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */, 8474C5951BE78AE1007DCF19 /* QuestionDetailViewController.m in Sources */,
84970DEF1BD8DD8A00C1728A /* main.m in Sources */, 84970DEF1BD8DD8A00C1728A /* main.m in Sources */,
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */, 8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */,
...@@ -2240,6 +2259,7 @@ ...@@ -2240,6 +2259,7 @@
849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */, 849B2F771C0CABE6005D809F /* AnnounceDetailModel.m in Sources */,
8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */, 8490C4C31BF9A394006B6569 /* CustomPageControl.m in Sources */,
848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */, 848A201D1C180C1900422FAB /* OnLineCompleteDetailCell.m in Sources */,
84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */,
84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */, 84F57C461BEC388A00DDEEB1 /* CommentView.m in Sources */,
84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */, 84ED5DD81BF2E64300A1BB6D /* ScreenView.m in Sources */,
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */, 8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */,
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
@interface OnLineResultFootView : UIView @interface OnLineResultFootView : UIView
@property (nonatomic, strong) UILabel *introLabel; @property (nonatomic, strong) UILabel *introLabel;
@property (nonatomic, strong) UIButton *returnButton; @property (nonatomic, strong) UIButton *returnButton;
@property (nonatomic, strong) UITextView *textView;
- (instancetype)initWithPicArray:(NSArray *)picArray; - (instancetype)initWithPicArray:(NSArray *)picArray;
@end @end
...@@ -52,10 +52,10 @@ ...@@ -52,10 +52,10 @@
// textView // textView
UITextView *textView = [[UITextView alloc] init]; UITextView *textView = [[UITextView alloc] init];
textView.text = [NSString stringWithFormat:@"%@", @"测试的处理说明,已经按照任务要求进行拍照处理"];
textView.backgroundColor = [UIColor clearColor]; textView.backgroundColor = [UIColor clearColor];
textView.translatesAutoresizingMaskIntoConstraints = NO; textView.translatesAutoresizingMaskIntoConstraints = NO;
[bgImageView addSubview:textView]; [bgImageView addSubview:textView];
_textView = textView;
NSLayoutConstraint *textViewTop = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1]; NSLayoutConstraint *textViewTop = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[bgImageView addConstraint:textViewTop]; [bgImageView addConstraint:textViewTop];
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@class StoreDetailModel;
@interface OnLineResultViewController : UIViewController @interface OnLineResultViewController : UIViewController
@property (nonatomic, strong) StoreDetailModel *storeDetail;
@property (nonatomic, strong) NSString *checkUuid;
@end @end
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#import "OnLineResultFootView.h" #import "OnLineResultFootView.h"
#import "CommentWithStarView.h" #import "CommentWithStarView.h"
#import "StoreDetailModel.h"
#import "HttpClient.h" #import "HttpClient.h"
#define kOnLineResultDetailCell @"lookOnLineResultDetailCell" #define kOnLineResultDetailCell @"lookOnLineResultDetailCell"
...@@ -183,9 +183,9 @@ ...@@ -183,9 +183,9 @@
cell = [[OnLineResultDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineResultDetailCell]; cell = [[OnLineResultDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineResultDetailCell];
} }
cell.contentView.backgroundColor = kResultTitleBackColor; cell.contentView.backgroundColor = kResultTitleBackColor;
cell.shopNameLabel.text = @"上海真北店"; cell.shopNameLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.store_name];
cell.whiteView.backgroundColor = [UIColor whiteColor]; cell.whiteView.backgroundColor = [UIColor whiteColor];
cell.addressLabel.text = @"静安区共和新路1111号"; cell.addressLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.storeAddress];
return cell; return cell;
} }
...@@ -219,15 +219,17 @@ ...@@ -219,15 +219,17 @@
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url]; HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{ NSDictionary *parameters = @{
@"checkUuid":@"sss", @"checkUuid":self.checkUuid,
@"storeUuid":@"sss", @"storeUuid":_storeDetail.store_uuid,
@"score":@(_commentView.starBar.starNumber), @"score":@(_commentView.starBar.starNumber),
@"comment":_commentView.contentTextView.text, @"comment":_commentView.contentTextView.text,
}; };
[httpClient gradeCheckResultWithParameters:parameters completion:^(id response, NSError *error) { [httpClient gradeCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"抽查评分的 response = %@", response); NSLog(@"抽查评分的 response = %@", response);
NSLog(@"抽查评分的 error = %@", error); NSLog(@"抽查评分的 error = %@", error);
if ([response[@"message"] isEqualToString:@"ok"]) {
[self.navigationController popViewControllerAnimated:YES];
}
}]; }];
} }
...@@ -265,10 +267,9 @@ ...@@ -265,10 +267,9 @@
- (OnLineResultFootView *)footView - (OnLineResultFootView *)footView
{ {
if (!_footView) { if (!_footView) {
NSArray *array = [NSArray arrayWithObjects:@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"}, @{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},@{@"fileUrl":@"ssdasd"},nil]; _footView = [[OnLineResultFootView alloc] initWithPicArray:_storeDetail.storePictures];
_footView = [[OnLineResultFootView alloc] initWithPicArray:array];
[_footView.returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside]; [_footView.returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside];
_footView.textView.text = _storeDetail.processNote;
} }
return _footView; return _footView;
} }
......
...@@ -7,11 +7,13 @@ ...@@ -7,11 +7,13 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "StoreDetailModel.h"
@interface OnLineCompleteCell : UITableViewCell @interface OnLineCompleteCell : UITableViewCell
@property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *shopName; @property (nonatomic, strong) UILabel *shopName;
@property (nonatomic, assign) int starNumber; @property (nonatomic, assign) int starNumber;
@property (nonatomic, strong) UILabel *reportTime; @property (nonatomic, strong) UILabel *reportTime;
@property (nonatomic, strong) StoreDetailModel *storeDetail;
@end @end
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) { if (self) {
[self setup]; //[self setup];
} }
return self; return self;
} }
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setupWithScore:(int)score
{ {
CGFloat imageW = 16.5; CGFloat imageW = 16.5;
CGFloat imageH = 16; CGFloat imageH = 16;
CGFloat spaceX = 7; CGFloat spaceX = 7;
for (int i = 0; i < 5; i++) { for (int i = 0; i < score; i++) {
UIImageView *imageView = [[UIImageView alloc] init]; UIImageView *imageView = [[UIImageView alloc] init];
imageView.image = [UIImage imageNamed:@"star_after"]; imageView.image = [UIImage imageNamed:@"star_after"];
imageView.translatesAutoresizingMaskIntoConstraints = NO; imageView.translatesAutoresizingMaskIntoConstraints = NO;
...@@ -45,6 +45,16 @@ ...@@ -45,6 +45,16 @@
[self.contentView addConstraint:Height]; [self.contentView addConstraint:Height];
} }
} }
- (void)setStoreDetail:(StoreDetailModel *)storeDetail
{
_storeDetail = storeDetail;
self.iconImageView.image = [UIImage imageNamed:@"default_pic"];
self.shopName.text = [NSString stringWithFormat:@"%@", storeDetail.store_name];
self.reportTime.text = [NSString stringWithFormat:@"上报时间:%@", storeDetail.reportTime];
[self setupWithScore:[storeDetail.score intValue]];
}
- (UIImageView *)iconImageView - (UIImageView *)iconImageView
{ {
if (!_iconImageView) { if (!_iconImageView) {
......
...@@ -17,5 +17,4 @@ ...@@ -17,5 +17,4 @@
@property (nonatomic, strong) UIImageView *arrowImageView; // 发起人 @property (nonatomic, strong) UIImageView *arrowImageView; // 发起人
@property (nonatomic, strong) UILabel *taskDetailLabel; @property (nonatomic, strong) UILabel *taskDetailLabel;
@end @end
//
// OnLineDetailModel.h
// redstar
//
// Created by admin on 15/12/22.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface OnLineDetailModel : NSObject
@property (nonatomic, copy) NSString *content;
@property (nonatomic, copy) NSString *create_id;
@property (nonatomic, copy) NSString *create_operName;
@property (nonatomic, copy) NSString *create_time;
@property (nonatomic, copy) NSString *endDate;
@property (nonatomic, copy) NSString *enterprise;
@property (nonatomic, assign) int finishCount;
@property (nonatomic, copy) NSString *lastModify_id;
@property (nonatomic, copy) NSString *lastModify_operName;
@property (nonatomic, copy) NSString *lastModify_time;
@property (nonatomic, assign) int reportCount;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, assign) int storeCount;
@property (nonatomic, strong) NSArray *stores;
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version;
@end
//
// OnLineDetailModel.m
// redstar
//
// Created by admin on 15/12/22.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineDetailModel.h"
@implementation OnLineDetailModel
@end
//
// StoreDetailModel.h
// redstar
//
// Created by admin on 15/12/22.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface StoreDetailModel : NSObject
@property (nonatomic, copy) NSString *attachmentId;
@property (nonatomic, strong) NSArray *attachments;
@property (nonatomic, copy) NSString *commentId;
@property (nonatomic, strong) NSArray *comments;
@property (nonatomic, copy) NSString *processNote;
@property (nonatomic, copy) NSString *reportTime;
@property (nonatomic, copy) NSString *score;
@property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *storeAddress;
@property (nonatomic, copy) NSString *storePath;
@property (nonatomic, strong) NSArray *storePictures;
@property (nonatomic, copy) NSString *store_code;
@property (nonatomic, copy) NSString *store_name;
@property (nonatomic, copy) NSString *store_uuid;
@end
//
// StoreDetailModel.m
// redstar
//
// Created by admin on 15/12/22.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "StoreDetailModel.h"
@implementation StoreDetailModel
@end
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface OnLineCompleteViewController : UIViewController @interface OnLineCompleteViewController : UIViewController
@property (nonatomic, copy) NSString *uuid;
@end @end
...@@ -10,14 +10,19 @@ ...@@ -10,14 +10,19 @@
#import "OnLineCompleteCell.h" #import "OnLineCompleteCell.h"
#import "OnLineCompleteDetailCell.h" #import "OnLineCompleteDetailCell.h"
#import "OnLineResultViewController.h" #import "OnLineResultViewController.h"
#import "HttpClient.h"
#import "OnLineDetailModel.h"
#import "StoreDetailModel.h"
#define kOnLineCompleteCell @"onLineCompleteCell" #define kOnLineCompleteCell @"onLineCompleteCell"
#define kOnLineCompleteDetailCell @"onLineCompleteDetailCell" #define kOnLineCompleteDetailCell @"onLineCompleteDetailCell"
@interface OnLineCompleteViewController ()<UITableViewDelegate, UITableViewDataSource> @interface OnLineCompleteViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) OnLineDetailModel *onLineDetail;
@property (nonatomic, assign) BOOL isOpen; @property (nonatomic, assign) BOOL isOpen;
@property (nonatomic,strong) NSMutableArray *allStoreArray;
@end @end
@implementation OnLineCompleteViewController @implementation OnLineCompleteViewController
...@@ -39,6 +44,9 @@ ...@@ -39,6 +44,9 @@
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.allStoreArray = [NSMutableArray array];
[self requestOnLineTaskComplete];
_isOpen = NO; _isOpen = NO;
} }
...@@ -63,6 +71,33 @@ ...@@ -63,6 +71,33 @@
self.navigationItem.leftBarButtonItem = backItem; self.navigationItem.leftBarButtonItem = backItem;
} }
- (void)requestOnLineTaskComplete
{
NSString *url = [NSString stringWithFormat:@"%@%@%@?fetch_parts=stores", kRedStarURL, kSportcheckDetailURL,self.uuid];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
[httpClient getSportCheckDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"5.4 抽查明细 response = %@, error = %@", response, error);
NSDictionary *dataDict = response[@"data"];
OnLineDetailModel *onlineDetail = [[OnLineDetailModel alloc] init];
[onlineDetail setValuesForKeysWithDictionary:dataDict];
_onLineDetail = onlineDetail;
for (NSDictionary *dict in _onLineDetail.stores) {
StoreDetailModel *storeModel = [[StoreDetailModel alloc] init];
[storeModel setValuesForKeysWithDictionary:dict];
[_allStoreArray addObject:storeModel];
}
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView reloadData];
}];
}
- (void)doBack:(id)sender - (void)doBack:(id)sender
{ {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
...@@ -87,7 +122,7 @@ ...@@ -87,7 +122,7 @@
if (section == 0) { if (section == 0) {
return 1; return 1;
} else { } else {
return 10; return _allStoreArray.count;
} }
} }
...@@ -99,20 +134,21 @@ ...@@ -99,20 +134,21 @@
if (!cell) { if (!cell) {
cell = [[OnLineCompleteDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteDetailCell]; cell = [[OnLineCompleteDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteDetailCell];
} }
cell.titleLabel.text = @"2015年十一促销临时抽查";
cell.startDate.text = @"发起时间:2015-09-30 12:20:12";
cell.overDate.text = @"截止时间:2015-10-03"; cell.titleLabel.text = [NSString stringWithFormat:@"%@", _onLineDetail.title];
cell.startDate.text = [NSString stringWithFormat:@"发起时间:%@", _onLineDetail.create_time];
cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _onLineDetail.endDate];
cell.taskContent.text = @"任务内容:"; cell.taskContent.text = @"任务内容:";
[cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside]; [cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside];
cell.arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"]; cell.arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
if (_isOpen) { if (_isOpen) {
cell.taskDetailLabel.text = [NSString stringWithFormat:@"%@", @"在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 在我想起来,李代沫/吉克携永 "]; cell.taskDetailLabel.text = [NSString stringWithFormat:@"%@", _onLineDetail.content];
} else { } else {
cell.taskDetailLabel.text = @""; cell.taskDetailLabel.text = @"";
} }
return cell; return cell;
} else { } else {
OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell]; OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell];
...@@ -121,9 +157,7 @@ ...@@ -121,9 +157,7 @@
} }
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.iconImageView.image = [UIImage imageNamed:@"default_pic"]; cell.storeDetail = _allStoreArray[indexPath.row];
cell.shopName.text = @"上海真北店";
cell.reportTime.text = @"上报时间:2015-10-02 12:10:16";
return cell; return cell;
} }
} }
...@@ -139,8 +173,14 @@ ...@@ -139,8 +173,14 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init]; if (indexPath.section == 0) {
[self.navigationController pushViewController:onLineResult animated:YES]; return;
} else {
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
onLineResult.storeDetail = _allStoreArray[indexPath.row];
onLineResult.checkUuid = self.uuid;
[self.navigationController pushViewController:onLineResult animated:YES];
}
} }
...@@ -159,7 +199,7 @@ ...@@ -159,7 +199,7 @@
sectionView.backgroundColor = kSectionBackGroundColor; sectionView.backgroundColor = kSectionBackGroundColor;
UILabel *shopList = [[UILabel alloc] init]; UILabel *shopList = [[UILabel alloc] init];
shopList.translatesAutoresizingMaskIntoConstraints = NO; shopList.translatesAutoresizingMaskIntoConstraints = NO;
shopList.text = [NSString stringWithFormat:@"商场列表(5/10)"]; shopList.text = [NSString stringWithFormat:@"商场列表(%d/%d)", _onLineDetail.finishCount, _onLineDetail.storeCount];
shopList.textColor = kNavigationBarColor; shopList.textColor = kNavigationBarColor;
shopList.font = [UIFont systemFontOfSize:16.0]; shopList.font = [UIFont systemFontOfSize:16.0];
sectionView.layer.borderWidth = 0.5; sectionView.layer.borderWidth = 0.5;
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
@property (nonatomic, copy) NSString *lastModify_id; @property (nonatomic, copy) NSString *lastModify_id;
@property (nonatomic, copy) NSString *lastModify_operName; @property (nonatomic, copy) NSString *lastModify_operName;
@property (nonatomic, copy) NSString *lastModify_time; @property (nonatomic, copy) NSString *lastModify_time;
@property (nonatomic, copy) NSString *reportCount; @property (nonatomic, assign) int reportCount;
@property (nonatomic, copy) NSString *state; @property (nonatomic, copy) NSString *state;
@property (nonatomic, copy) NSString *storeCount; @property (nonatomic, assign) int storeCount;
@property (nonatomic, strong) NSArray *stores; @property (nonatomic, strong) NSArray *stores;
@property (nonatomic, copy) NSString *title; @property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *uuid;
......
...@@ -518,7 +518,6 @@ ...@@ -518,7 +518,6 @@
NSLog(@"管理层的抽查列表 error= %@", error); NSLog(@"管理层的抽查列表 error= %@", error);
if (_allSpotCheckList.count == 0) { if (_allSpotCheckList.count == 0) {
if (_tableView) { if (_tableView) {
[_tableView removeFromSuperview]; [_tableView removeFromSuperview];
...@@ -558,7 +557,7 @@ ...@@ -558,7 +557,7 @@
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return 7; return _allSpotCheckList.count;
} }
// cell显示的内容 // cell显示的内容
...@@ -568,32 +567,7 @@ ...@@ -568,32 +567,7 @@
if (!cell) { if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectListTableViewcellIndeterfor]; cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectListTableViewcellIndeterfor];
} }
cell.titleLabel.text = @"9月中旬卫生临时抽查"; cell.spotCheck = _allSpotCheckList[indexPath.row];
cell.startDate.text = @"起始时间:2015-09-21 15:23:21"; // 起
cell.overDate.text = @"截止时间:2015-09-30"; // 截止
cell.address.text = @"巡检商场:上海真北店";
NSString *str = [NSString stringWithFormat:@"巡检进度:进行中"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[cell.progressLabel setAttributedText:strAttr];
CGFloat already = 5;
CGFloat all = 10;
cell.multiplier = already / all;
cell.alreadyLabel.text = [NSString stringWithFormat:@"%.0f",already];
cell.alreadyLabel.textColor = kProgressDealWithColor;
cell.allLabel.text = [NSString stringWithFormat:@"/%.0f",all];
cell.allLabel.textColor = kProgressDealWithColor;
cell.allView.backgroundColor = kProgressViewAllBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
cell.alreadyView.image = image;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell; return cell;
...@@ -602,7 +576,9 @@ ...@@ -602,7 +576,9 @@
// cell的点击事件 // cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
SpotCheckModel *spot = _allSpotCheckList[indexPath.row];
OnLineCompleteViewController *completeVC = [[OnLineCompleteViewController alloc] init]; OnLineCompleteViewController *completeVC = [[OnLineCompleteViewController alloc] init];
completeVC.uuid = spot.uuid;
[self.navigationController pushViewController:completeVC animated:YES]; [self.navigationController pushViewController:completeVC animated:YES];
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@class TaskListModel; @class TaskListModel;
@class SpotCheckModel;
@interface InspectListCell : UITableViewCell @interface InspectListCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题 @property (nonatomic, strong) UILabel *titleLabel; // 标题
...@@ -25,4 +26,6 @@ ...@@ -25,4 +26,6 @@
@property (nonatomic, strong) UIView *allView; @property (nonatomic, strong) UIView *allView;
@property (nonatomic, strong) TaskListModel *taskList; @property (nonatomic, strong) TaskListModel *taskList;
@property (nonatomic, strong) SpotCheckModel *spotCheck;
@end @end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "InspectListCell.h" #import "InspectListCell.h"
#import "TaskListModel.h" #import "TaskListModel.h"
#import "SpotCheckModel.h"
@interface InspectListCell () @interface InspectListCell ()
...@@ -38,6 +39,60 @@ ...@@ -38,6 +39,60 @@
} }
- (void)setSpotCheck:(SpotCheckModel *)spotCheck
{
_spotCheck = spotCheck;
self.titleLabel.text = [NSString stringWithFormat:@"%@", spotCheck.title];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", spotCheck.endDate];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate];
self.address.text = [NSString stringWithFormat:@"巡检商场:%@", spotCheck.content];
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", spotCheck.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", spotCheck.storeCount];
self.allView.backgroundColor = kProgressViewAllBackColor;
if (spotCheck.reportCount == 0) {
self.multiplier = 0;
} else {
self.multiplier = (CGFloat)spotCheck.reportCount / spotCheck.storeCount;
}
if (self.multiplier > 1) {
self.multiplier = 1.0;
}
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
if ([_spotCheck.state isEqualToString:@"initial"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:未处理"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressUnSettledColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressUnSettledColor;
self.allLabel.textColor = kProgressUnSettledColor;
} else if ([_spotCheck.state isEqualToString:@"reported"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:已上报"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressDealWithColor;
self.allLabel.textColor = kProgressDealWithColor;
} else if ([_spotCheck.state isEqualToString:@"finished"]) {
NSString *str = [NSString stringWithFormat:@"巡检进度:已评分"];
NSMutableAttributedString *strAttr = [[NSMutableAttributedString alloc] initWithString:str];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kCellDetailColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,5)];
[strAttr addAttributes:@{NSForegroundColorAttributeName:kProgressDealWithColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(5,str.length - 5)];
[self.progressLabel setAttributedText:strAttr];
self.alreadyLabel.textColor = kProgressDealWithColor;
self.allLabel.textColor = kProgressDealWithColor;
} else {
}
}
- (void)setTaskList:(TaskListModel *)taskList - (void)setTaskList:(TaskListModel *)taskList
{ {
_taskList = taskList; _taskList = taskList;
......
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