Commit e0627ecd authored by admin's avatar admin

修复部分bug

parent 4edc6972
......@@ -128,6 +128,8 @@
84CC34E21C09583D002F10E2 /* LookOnLineTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34E11C09583D002F10E2 /* LookOnLineTableViewCell.m */; };
84CC34EC1C09AD98002F10E2 /* LookOnLineDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34EB1C09AD98002F10E2 /* LookOnLineDetailView.m */; };
84CC34EF1C09AEC0002F10E2 /* LookOnLineDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CC34EE1C09AEC0002F10E2 /* LookOnLineDetailViewController.m */; };
84CDB2771C5616D5009D3866 /* LookReportDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CDB2761C5616D5009D3866 /* LookReportDetailViewController.m */; };
84CDB27A1C56272F009D3866 /* LookReportPicCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CDB2791C56272F009D3866 /* LookReportPicCell.m */; };
84CEB1671C28E8970072ED0A /* SpotCheckModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB1661C28E8970072ED0A /* SpotCheckModel.m */; };
84CEB16B1C28F0E20072ED0A /* LookOnLineModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB16A1C28F0E20072ED0A /* LookOnLineModel.m */; };
84CEB16F1C2946DB0072ED0A /* OnLineDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84CEB16E1C2946DB0072ED0A /* OnLineDetailModel.m */; };
......@@ -433,6 +435,10 @@
84CC34EB1C09AD98002F10E2 /* LookOnLineDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookOnLineDetailView.m; sourceTree = "<group>"; };
84CC34ED1C09AEC0002F10E2 /* LookOnLineDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookOnLineDetailViewController.h; sourceTree = "<group>"; };
84CC34EE1C09AEC0002F10E2 /* LookOnLineDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookOnLineDetailViewController.m; sourceTree = "<group>"; };
84CDB2751C5616D5009D3866 /* LookReportDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookReportDetailViewController.h; sourceTree = "<group>"; };
84CDB2761C5616D5009D3866 /* LookReportDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookReportDetailViewController.m; sourceTree = "<group>"; };
84CDB2781C56272F009D3866 /* LookReportPicCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LookReportPicCell.h; sourceTree = "<group>"; };
84CDB2791C56272F009D3866 /* LookReportPicCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LookReportPicCell.m; sourceTree = "<group>"; };
84CEB1651C28E8970072ED0A /* SpotCheckModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpotCheckModel.h; 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>"; };
......@@ -1907,6 +1913,8 @@
children = (
84014A071C46384700E7963B /* LookOnLineDetailCell.h */,
84014A081C46384700E7963B /* LookOnLineDetailCell.m */,
84CDB2781C56272F009D3866 /* LookReportPicCell.h */,
84CDB2791C56272F009D3866 /* LookReportPicCell.m */,
);
path = Cell;
sourceTree = "<group>";
......@@ -1927,6 +1935,8 @@
children = (
84CC34ED1C09AEC0002F10E2 /* LookOnLineDetailViewController.h */,
84CC34EE1C09AEC0002F10E2 /* LookOnLineDetailViewController.m */,
84CDB2751C5616D5009D3866 /* LookReportDetailViewController.h */,
84CDB2761C5616D5009D3866 /* LookReportDetailViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
......@@ -2461,6 +2471,7 @@
846206B81C06AFCA0015C456 /* RankCommentModel.m in Sources */,
84A6738E1C0BE2D0000F828E /* OnLineCompleteCell.m in Sources */,
84CEB1671C28E8970072ED0A /* SpotCheckModel.m in Sources */,
84CDB2771C5616D5009D3866 /* LookReportDetailViewController.m in Sources */,
84CC34D41C094476002F10E2 /* StandardViewController.m in Sources */,
842E21DD1C3286D400455F3F /* PictureTextTableViewCell.m in Sources */,
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */,
......@@ -2529,6 +2540,7 @@
84CC34CD1C093C2F002F10E2 /* OnLineFooterView.m in Sources */,
84AD4F291BF4360E00BFB37C /* TaskGroup.m in Sources */,
84FAC7611BFF2C6E00FD094D /* NoDataView.m in Sources */,
84CDB27A1C56272F009D3866 /* LookReportPicCell.m in Sources */,
84A673C41C0C7B0A000F828E /* AnnoDetailViewController.m in Sources */,
84AD4F2F1BF4370E00BFB37C /* InspectHeaderView.m in Sources */,
8480BEAC1C143A1600E2F18F /* CategoryTableView.m in Sources */,
......
......@@ -2,4 +2,16 @@
<Bucket
type = "0"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
scope = "0"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -10,10 +10,10 @@
#define Url_h
// url 测试环境
//#define kRedStarURL @"http://218.244.151.129:7580/"
#define kRedStarURL @"http://218.244.151.129:7580/"
// 正式环境
#define kRedStarURL @"http://219.235.234.225:7580/"
// #define kRedStarURL @"http://219.235.234.225:7580/"
// 最新正式环境
// #define kRedStarURL @"http://219.235.234.212:7580/"
......
......@@ -34,6 +34,8 @@
- (void)viewDidLoad
{
[super viewDidLoad];
_uuidArray = [NSMutableArray array];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
......@@ -122,9 +124,19 @@
NSDate *select = [_datePicker date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
_dateStr = [dateFormatter stringFromDate:select];
[self closeBackGroundView];
[self.tableView reloadData];
NSDate *now = [NSDate date];
NSDate *anDayAgo = [now dateByAddingTimeInterval:-60*60*24];
NSDate *result2 = [now earlierDate:anDayAgo];
NSComparisonResult result3 = [select compare:result2];
if (result3 == -1) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"截止时间不能小于当前时间!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
_dateStr = [dateFormatter stringFromDate:select];
[self closeBackGroundView];
[self.tableView reloadData];
}
}
#pragma mark - SelectStoreDelegate
......@@ -167,7 +179,7 @@
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
NSLog(@"_uuid == %@", _uuidArray);
NSDictionary *parameters = @{@"title":self.footView.titleTextView.text,
@"content":self.footView.contentTextView.text,
@"endDate":_dateStr,
......
......@@ -16,8 +16,20 @@
self.titleLabel.text = [NSString stringWithFormat:@"%@", lookOnLine.title];
//self.peopleLabel.text = [NSString stringWithFormat:@"发起人:%@", lookOnLine.]
self.peopleLabel.text = @"发起人:王XX 集团XX总";
self.startDate.text = [NSString stringWithFormat:@"发起时间:%@", lookOnLine.reportTime];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", lookOnLine.endDate];
if (lookOnLine.reportTime == nil || lookOnLine.reportTime == NULL || [lookOnLine.reportTime isEqual:[NSNull null]] || lookOnLine.reportTime == Nil || [lookOnLine.reportTime isEqualToString:@"(null)"]) {
self.startDate.text = [NSString stringWithFormat:@"发起时间:"];
} else {
self.startDate.text = [[NSString stringWithFormat:@"发起时间:%@", lookOnLine.reportTime] substringToIndex:15];
}
if (lookOnLine.endDate == nil || lookOnLine.endDate == NULL || [lookOnLine.endDate isEqual:[NSNull null]] || lookOnLine.endDate == Nil || [lookOnLine.endDate isEqualToString:@"(null)"]) {
self.overDate.text = [NSString stringWithFormat:@"截止时间:"];
} else {
self.overDate.text = [[NSString stringWithFormat:@"截止时间:%@", lookOnLine.endDate] substringToIndex:15];
}
self.progressLabel.text = @"临检进度:进行中";
if ([lookOnLine.state isEqualToString:@"initial"]) {
......
......@@ -13,6 +13,7 @@
#import "LookOnLineTableViewCell.h"
#import "LookOnLineDetailViewController.h"
#import "LookReportDetailViewController.h"
#import "HttpClient.h"
#import <MBProgressHUD.h>
......@@ -23,7 +24,7 @@
#define kLookOnLineCell @"LookOnLineTableViewCell"
@interface LookOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate>
@interface LookOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate, LookOnLineDetailVCDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) MenuView *menuView;
......@@ -113,7 +114,6 @@
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[http getStoreSportCheckListWithParameters:parameters completion:^(id response, NSError *error) {
NSDictionary *dataDict = response[@"data"];
NSArray *recordsArray = dataDict[@"records"];
NSMutableArray *tempArray = [NSMutableArray array];
......@@ -123,7 +123,8 @@
[lookOnline setValuesForKeysWithDictionary:dict];
[tempArray addObject:lookOnline];
}
[_allLookOnLineList addObjectsFromArray:tempArray];
_allLookOnLineList = tempArray;
// [_allLookOnLineList addObjectsFromArray:tempArray];
if (_allLookOnLineList.count == 0) {
if (_tableView) {
[_tableView removeFromSuperview];
......@@ -477,6 +478,11 @@
return mDate;
}
- (void)reloadCurrentList
{
_page = 0;
[self requestLookOnLineList];
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
......@@ -500,9 +506,17 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
LookOnLineModel *lookOnLine = _allLookOnLineList[indexPath.row];
LookOnLineDetailViewController *lookDetailVC = [[LookOnLineDetailViewController alloc] init];
lookDetailVC.lookOnLine = lookOnLine;
[self.navigationController pushViewController:lookDetailVC animated:YES];
if ([lookOnLine.state isEqualToString:@"initial"]) {
LookOnLineDetailViewController *lookDetailVC = [[LookOnLineDetailViewController alloc] init];
lookDetailVC.delegate = self;
lookDetailVC.lookOnLine = lookOnLine;
[self.navigationController pushViewController:lookDetailVC animated:YES];
} else {
LookReportDetailViewController *lookReportVC = [[LookReportDetailViewController alloc] init];
lookReportVC.lookOnLine = lookOnLine;
[self.navigationController pushViewController:lookReportVC animated:YES];
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
......@@ -515,7 +529,6 @@
return CGFLOAT_MIN;
}
#pragma mark - InspectTableViewDelegate
- (void)inspectTableViewDidSelectWithRow:(NSInteger)row
{
......
//
// LookReportPicCell.h
// redstar
//
// Created by admin on 16/1/25.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LookReportPicCell : UITableViewCell
@property (nonatomic, strong) UIButton *photoButton1;
@property (nonatomic, strong) UIButton *photoButton2;
@end
//
// LookReportPicCell.m
// redstar
//
// Created by admin on 16/1/25.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import "LookReportPicCell.h"
@implementation LookReportPicCell
#pragma mark - System Methods
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self setup];
}
return self;
}
#pragma mark - Private Methods
- (void)setup
{
self.contentView.backgroundColor = kFootViewBackGroundColor;
}
- (UIButton *)photoButton1
{
if (!_photoButton1) {
_photoButton1 = [[UIButton alloc] init];
_photoButton1.contentMode = UIViewContentModeScaleAspectFill;
_photoButton1.clipsToBounds = YES;
_photoButton1.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_photoButton1];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint
constraintWithItem:_photoButton1
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:5];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
constraintWithItem:_photoButton1
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint
constraintWithItem:_photoButton1
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeRight
multiplier:1.0
constant:-(kScreenWidth / 2 + 10)];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
constraintWithItem:_photoButton1
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:90];
[self.contentView addConstraint:overDateHeight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint
constraintWithItem:_photoButton1
attribute:NSLayoutAttributeBottom
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeBottom
multiplier:1.0
constant:-10];
[self.contentView addConstraint:overDateBottom];
}
return _photoButton1;
}
- (UIButton *)photoButton2
{
if (!_photoButton2) {
_photoButton2 = [[UIButton alloc] init];
_photoButton2.translatesAutoresizingMaskIntoConstraints = NO;
_photoButton1.contentMode = UIViewContentModeScaleAspectFill;
_photoButton1.clipsToBounds = YES;
[self.contentView addSubview:_photoButton2];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint
constraintWithItem:_photoButton2
attribute:NSLayoutAttributeTop
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeTop
multiplier:1.0
constant:5];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint
constraintWithItem:_photoButton2
attribute:NSLayoutAttributeLeft
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeLeft
multiplier:1.0
constant:kScreenWidth / 2 + 10];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint
constraintWithItem:_photoButton2
attribute:NSLayoutAttributeRight
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeRight
multiplier:1.0
constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint
constraintWithItem:_photoButton2
attribute:NSLayoutAttributeHeight
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1.0
constant:90];
[self.contentView addConstraint:overDateHeight];
}
return _photoButton2;
}
@end
......@@ -32,7 +32,6 @@
self.contentTextView.backgroundColor = [UIColor clearColor];
self.placeholderLabel2.text = @"请输入文字,不超过500字";
[self.resultButton setTitle:@"上报结果" forState:UIControlStateNormal];
}
- (UILabel *)introLabel
......
......@@ -9,7 +9,16 @@
#import <UIKit/UIKit.h>
#import "LookOnLineModel.h"
@protocol LookOnLineDetailVCDelegate <NSObject>
- (void)reloadCurrentList;
@end
@interface LookOnLineDetailViewController : UIViewController
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@property (nonatomic, assign) id <LookOnLineDetailVCDelegate> delegate;
@end
......@@ -24,14 +24,15 @@
#import "LookOnLineDetailCell.h"
#define kLookOnLineDetailCell @"LookOnLineDetailCell"
@interface LookOnLineDetailViewController () <UIAlertViewDelegate,UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate>
@interface LookOnLineDetailViewController () <UIAlertViewDelegate,UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, UITextViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) LookOnLineFootView *footView;
@property (nonatomic, strong) UIActionSheet *selectActionSheet;
@property (nonatomic, strong) NSMutableArray *imageNameArray;
@property (nonatomic, assign) int rowNumber;
@property (nonatomic, strong) NSLayoutConstraint *tableBottom;
@property (nonatomic, strong) NSLayoutConstraint *tableTop;
@end
@implementation LookOnLineDetailViewController
......@@ -86,11 +87,17 @@
- (void)reportRestult:(UIButton *)sender
{
// 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要上报当前任务处理结果吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 314331;
alert.delegate = self;
[alert show];
if (self.footView.contentTextView.text.length == 0) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"处理说明不能为空!" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
[alert show];
} else {
// 提示框
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"您确定要上报当前任务处理结果吗?" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
alert.tag = 314331;
alert.delegate = self;
[alert show];
}
}
- (void)doBack:(id)sender
......@@ -229,11 +236,19 @@
[httpClient reportCheckResultWithParameters:parameters completion:^(id response, NSError *error) {
if ([response[@"message"] isEqualToString:@"ok"]) {
if ([response[@"success"] boolValue]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"上报成功!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.tag = 314332;
alert.delegate = self;
[alert show];
if (_delegate && [_delegate respondsToSelector:@selector(reloadCurrentList)]) {
[_delegate reloadCurrentList];
}
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"上报失败!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
}
}];
}
......@@ -366,7 +381,6 @@
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = self.footView;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100.0;
......@@ -377,8 +391,10 @@
[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 *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];
......@@ -386,8 +402,11 @@
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];
// 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;
}
......@@ -396,9 +415,65 @@
{
if (!_footView) {
_footView = [[LookOnLineFootView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 180)];
_footView.backgroundColor = [UIColor clearColor];
_footView.contentTextView.delegate = self;
_footView.backgroundColor = [UIColor whiteColor];
[_footView.resultButton setTitle:@"上报结果" forState:UIControlStateNormal];
[_footView.resultButton addTarget:self action:@selector(reportRestult:) forControlEvents:UIControlEventTouchUpInside];
}
return _footView;
}
- (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:@""]) {
self.footView.placeholderLabel2.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
self.footView.placeholderLabel2.hidden = NO;
}
if ([text isEqualToString:@"\n"]) {
[self.footView.contentTextView resignFirstResponder];
if (![text isEqualToString:@""]) {
self.footView.placeholderLabel2.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
self.footView.placeholderLabel2.hidden = NO;
}
return NO;
}
if (range.location>=500) {
return NO;
}
else {
return YES;
}
return YES;
}
@end
//
// LookReportDetailViewController.h
// redstar
//
// Created by admin on 16/1/25.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "LookOnLineModel.h"
@interface LookReportDetailViewController : UIViewController
@property (nonatomic, strong) LookOnLineModel *lookOnLine;
@end
//
// LookReportDetailViewController.m
// redstar
//
// Created by admin on 16/1/25.
// Copyright © 2016年 ZWF. All rights reserved.
//
#import "LookReportDetailViewController.h"
#import "LookOnLineFootView.h"
#import "HttpClient.h"
#import "CommonFunc.h"
#import "OnLineDetailModel.h"
#import "UIImage+Fit.h"
#import "LargePictureViewController.h"
#import "LookOnLineDetailCell.h"
#define kLookOnLineDetailCell @"LookOnLineDetailCell"
#import "LookReportPicCell.h"
#define kLookReportPicCell @"lookReportPicCell"
#import <UIButton+WebCache.h>
@interface LookReportDetailViewController ()<UITableViewDelegate, UITableViewDataSource, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate, UITextViewDelegate>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) LookOnLineFootView *footView;
@property (nonatomic, strong) UIActionSheet *selectActionSheet;
@property (nonatomic, strong) NSMutableArray *imageNameArray;
@property (nonatomic, assign) NSInteger rowNumber;
@end
@implementation LookReportDetailViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self setNav];
self.tableView.delegate = self;
self.tableView.dataSource = self;
if (_lookOnLine.attachments.count == 0) {
self.imageNameArray = [NSMutableArray array];
} else {
self.imageNameArray = [NSMutableArray array];
for (NSDictionary *dict in _lookOnLine.attachments) {
NSString *imageName = [NSString stringWithFormat:@"%@%@", kRedStarURL, dict[@"fileUrl"]];
NSURL *url = [NSURL URLWithString:imageName];
[_imageNameArray addObject:url];
}
}
if (_imageNameArray.count %2 == 0) {
_rowNumber = _imageNameArray.count / 2;
} else {
_rowNumber = (_imageNameArray.count + 1) / 2;
}
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.navigationBar.hidden = NO;
self.tabBarController.tabBar.hidden = YES;
}
#pragma mark - Private Mothods
- (void)setNav
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
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;
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)];
[customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"任务处理"];
customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab;
}
- (void)reportRestult:(UIButton *)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)showLookOnLinePic:(UIButton *)sender
{
LargePictureViewController *lager = [[LargePictureViewController alloc] init];
lager.index = sender.tag - 1118;
lager.pictureSaveMode = PictureNetWorkMode;
lager.allImageArray = _imageNameArray;
[self.navigationController pushViewController:lager animated:YES];
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (actionSheet.tag == 999283) {
if (buttonIndex == 0) {
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"找不到相机" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.modalTransitionStyle=UIModalTransitionStyleFlipHorizontal;
picker.videoQuality = UIImagePickerControllerQualityTypeLow;
[self presentViewController:picker animated:YES completion:nil];
}
} else if (buttonIndex == 1){
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
//设置选择后的图片可被编辑
picker.allowsEditing = YES;
[self presentViewController:picker animated:YES completion:nil];
}
}
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
return 1;
} else {
return _rowNumber;
}
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0) {
LookOnLineDetailCell *cell=[tableView dequeueReusableCellWithIdentifier:kLookOnLineDetailCell];
if (!cell) {
cell = [[LookOnLineDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kLookOnLineDetailCell];
}
cell.lookOnLine = _lookOnLine;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
} else {
LookReportPicCell *cell = [tableView dequeueReusableCellWithIdentifier:kLookReportPicCell];
if (!cell) {
cell = [[LookReportPicCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kLookReportPicCell];
}
if (_imageNameArray.count % 2 == 1) {
if (indexPath.row == _rowNumber - 1) {
NSURL *imageURL = _imageNameArray[_imageNameArray.count - 1];
[cell.photoButton1 sd_setImageWithURL:imageURL forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.photoButton1 addTarget:self action:@selector(showLookOnLinePic:) forControlEvents:UIControlEventTouchUpInside];
cell.photoButton1.tag = 1118 + _imageNameArray.count - 1;
cell.photoButton2.hidden = YES;
} else {
NSURL *imageURL1 = _imageNameArray[indexPath.row * 2];
[cell.photoButton1 sd_setImageWithURL:imageURL1 forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.photoButton1 addTarget:self action:@selector(showLookOnLinePic:) forControlEvents:UIControlEventTouchUpInside];
cell.photoButton1.tag = 1118 + indexPath.row * 2;
NSURL *imageURL2 = _imageNameArray[indexPath.row * 2 + 1];
[cell.photoButton2 sd_setImageWithURL:imageURL2 forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.photoButton2 addTarget:self action:@selector(showLookOnLinePic:) forControlEvents:UIControlEventTouchUpInside];
cell.photoButton2.tag = 1118 + indexPath.row * 2 + 1;
}
} else {
NSURL *imageURL1 = _imageNameArray[indexPath.row * 2];
[cell.photoButton1 sd_setImageWithURL:imageURL1 forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.photoButton1 addTarget:self action:@selector(showLookOnLinePic:) forControlEvents:UIControlEventTouchUpInside];
cell.photoButton1.tag = 1118 + indexPath.row * 2;
NSURL *imageURL2 = _imageNameArray[indexPath.row * 2 + 1];
[cell.photoButton2 sd_setImageWithURL:imageURL2 forState:UIControlStateNormal placeholderImage:[UIImage imageNamed:@"default_pic"]];
[cell.photoButton2 addTarget:self action:@selector(showLookOnLinePic:) forControlEvents:UIControlEventTouchUpInside];
cell.photoButton2.tag = 1118 + indexPath.row * 2 + 1;
}
return cell;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = self.footView;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 100.0;
[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;
}
- (LookOnLineFootView *)footView
{
if (!_footView) {
_footView = [[LookOnLineFootView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 180)];
_footView.contentTextView.userInteractionEnabled = NO;
_footView.contentTextView.text = _lookOnLine.processNote;
_footView.placeholderLabel2.hidden = YES;
_footView.backgroundColor = [UIColor whiteColor];
[_footView.resultButton setTitle:@"返回上一页" forState:UIControlStateNormal];
[_footView.resultButton addTarget:self action:@selector(reportRestult:) forControlEvents:UIControlEventTouchUpInside];
}
return _footView;
}
@end
......@@ -15,7 +15,7 @@
@end
@interface OnLineResultFootView : UIView
@interface OnLineResultFootView : UIView <UITextViewDelegate>
@property (nonatomic, strong) UILabel *introLabel;
@property (nonatomic, strong) UIButton *returnButton;
@property (nonatomic, strong) UITextView *textView;
......
......@@ -56,6 +56,7 @@
textView.backgroundColor = [UIColor clearColor];
textView.translatesAutoresizingMaskIntoConstraints = NO;
[bgImageView addSubview:textView];
textView.delegate = self;
_textView = textView;
NSLayoutConstraint *textViewTop = [NSLayoutConstraint constraintWithItem:textView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:bgImageView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
......@@ -149,4 +150,16 @@
[_delegate showOnLinePicture:sender];
}
}
#pragma mark - UItextView
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
if ([text isEqualToString:@"\n"]) {
[self.textView resignFirstResponder];
return NO;
}
return YES;
}
@end
......@@ -81,7 +81,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;
......@@ -103,33 +103,38 @@
- (void)returnClick:(UIButton *)sender
{
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_commentView) {
_commentView = [[CommentWithStarView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
if ([_storeDetail.state isEqualToString:@"initial"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"未上报的商场不能打分评论!" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
} else {
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_commentView) {
_commentView = [[CommentWithStarView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_commentView.contentTextView.text = @"";
_commentView.contentTextView.delegate = self;
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentWithStarViewHeight, kScreenWidth, kCommentWithStarViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentWithStarViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
}
_commentView.contentTextView.text = @"";
_commentView.contentTextView.delegate = self;
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentWithStarViewHeight, kScreenWidth, kCommentWithStarViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentWithStarViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
}
// 提交评论
......@@ -233,7 +238,12 @@
cell.delegate = self;
cell.shopNameLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.store_name];
cell.whiteView.backgroundColor = [UIColor whiteColor];
cell.addressLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.storeAddress];
if (_storeDetail.storeAddress == nil || _storeDetail.storeAddress == NULL || [_storeDetail.storeAddress isEqual:[NSNull null]] || _storeDetail.storeAddress == Nil || [_storeDetail.storeAddress isEqualToString:@"(null)"]) {
cell.addressLabel.text = @"";
} else {
cell.addressLabel.text = [NSString stringWithFormat:@"%@", _storeDetail.storeAddress];
}
return cell;
}
......@@ -314,19 +324,17 @@
{
if (!_footView) {
_footView = [[OnLineResultFootView alloc] initWithPicArray:_storeDetail.attachments];
if ([_storeDetail.state isEqualToString:@"initial"]) {
[_footView.returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside];
[_footView.returnButton setTitle:@"打分评论" forState:UIControlStateNormal];
_footView.textView.userInteractionEnabled = YES;
} else {
_footView.textView.text = _storeDetail.processNote;
_footView.delegate = self;
if ([_storeDetail.state isEqualToString:@"finished"]) {
[_footView.returnButton addTarget:self action:@selector(doBack:) forControlEvents:UIControlEventTouchUpInside];
[_footView.returnButton setTitle:@"返回上一页" forState:UIControlStateNormal];
_footView.textView.userInteractionEnabled = NO;
} else {
[_footView.returnButton addTarget:self action:@selector(returnClick:) forControlEvents:UIControlEventTouchUpInside];
[_footView.returnButton setTitle:@"打分评论" forState:UIControlStateNormal];
_footView.textView.userInteractionEnabled = YES;
}
_footView.textView.text = _storeDetail.processNote;
_footView.delegate = self;
}
return _footView;
}
......
......@@ -51,7 +51,13 @@
_storeDetail = storeDetail;
self.iconImageView.image = [UIImage imageNamed:@"default_pic"];
self.shopName.text = [NSString stringWithFormat:@"%@", storeDetail.store_name];
self.reportTime.text = [NSString stringWithFormat:@"上报时间:%@", storeDetail.reportTime];
if (storeDetail.reportTime == nil || storeDetail.reportTime == NULL || [storeDetail.reportTime isEqual:[NSNull null]] || storeDetail.reportTime == Nil || [storeDetail.reportTime isEqualToString:@"(null)"]) {
self.reportTime.text = [NSString stringWithFormat:@"上报时间:"];
} else {
self.reportTime.text = [[NSString stringWithFormat:@"上报时间:%@", storeDetail.reportTime] substringToIndex:15];
}
[self setupWithScore:[storeDetail.score intValue]];
}
......
......@@ -54,7 +54,6 @@
if (!_startDate) {
_startDate = [[UILabel alloc] init];
_startDate.font = [UIFont systemFontOfSize:15.0];
_startDate.textColor = kOnLineCompleteHeaderTextColor;
_startDate.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_startDate];
......@@ -79,7 +78,7 @@
if (!_overDate) {
_overDate = [[UILabel alloc] init];
_overDate.font = [UIFont systemFontOfSize:15.0];
_overDate.textColor = kOnLineCompleteHeaderTextColor;
// _overDate.textColor = kLightGray;
_overDate.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_overDate];
......@@ -104,7 +103,7 @@
if (!_taskContent) {
_taskContent = [[UILabel alloc] init];
_taskContent.font = [UIFont systemFontOfSize:15.0];
_taskContent.textColor = kOnLineCompleteHeaderTextColor;
_taskContent.textColor = kLightGray;
_taskContent.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_taskContent];
......
......@@ -85,6 +85,7 @@
HttpClient *httpClient= [[HttpClient alloc] initWithUrl:url];
[httpClient getSportCheckDetailWithCompletion:^(id response, NSError *error) {
NSLog(@"任务完成一览 reponse === %@", response);
NSDictionary *dataDict = response[@"data"];
OnLineDetailModel *onlineDetail = [[OnLineDetailModel alloc] init];
[onlineDetail setValuesForKeysWithDictionary:dataDict];
......@@ -146,18 +147,44 @@
}
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _onLineDetail.title];
cell.startDate.text = [NSString stringWithFormat:@"发起时间:%@", _onLineDetail.create_time];
cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _onLineDetail.endDate];
if (_onLineDetail.create_time == nil || _onLineDetail.create_time == NULL || [_onLineDetail.create_time isEqual:[NSNull null]] || _onLineDetail.create_time == Nil || [_onLineDetail.create_time isEqualToString:@"(null)"]) {
cell.startDate.textColor = kLightGray;
cell.startDate.text = [NSString stringWithFormat:@"发起时间:"];
} else {
NSString *startStr = [[NSString stringWithFormat:@"发起时间:%@", _onLineDetail.create_time] substringToIndex:15];
NSMutableAttributedString *startAttr = [[NSMutableAttributedString alloc] initWithString:startStr];
[startAttr addAttributes:@{NSForegroundColorAttributeName:kLightGray} range:NSMakeRange(0,5)];
[startAttr addAttributes:@{NSForegroundColorAttributeName:kLightBlack} range:NSMakeRange(5,startStr.length - 5)];
cell.startDate.attributedText = startAttr;
}
if (_onLineDetail.endDate == nil || _onLineDetail.endDate == NULL || [_onLineDetail.endDate isEqual:[NSNull null]] || _onLineDetail.endDate == Nil || [_onLineDetail.endDate isEqualToString:@"(null)"]) {
cell.overDate.textColor = kLightGray;
cell.overDate.text = [NSString stringWithFormat:@"截止时间:"];
} else {
NSString *startStr = [NSString stringWithFormat:@"截止时间:%@", _onLineDetail.endDate];
NSMutableAttributedString *startAttr = [[NSMutableAttributedString alloc] initWithString:startStr];
[startAttr addAttributes:@{NSForegroundColorAttributeName:kLightGray} range:NSMakeRange(0,5)];
[startAttr addAttributes:@{NSForegroundColorAttributeName:kLightBlack} range:NSMakeRange(5,startStr.length - 5)];
cell.overDate.attributedText = startAttr;
// cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _onLineDetail.endDate];
}
cell.taskContent.text = @"任务内容:";
[cell.unfoldBtn addTarget:self action:@selector(unfoldCilck:) forControlEvents:UIControlEventTouchUpInside];
cell.arrowImageView.image = [UIImage imageNamed:@"grey-trilateral_down"];
if (_isOpen) {
cell.taskDetailLabel.text = [NSString stringWithFormat:@"%@", _onLineDetail.content];
cell.taskDetailLabel.text = [NSString stringWithFormat:@" %@", _onLineDetail.content];
cell.arrowImageView.transform = CGAffineTransformMakeRotation(-M_PI);
} else {
cell.taskDetailLabel.text = @"";
cell.arrowImageView.transform = CGAffineTransformMakeRotation(0);
}
return cell;
} else {
// OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell];
......@@ -189,8 +216,21 @@
if (indexPath.section == 0) {
return;
} else {
StoreDetailModel *storeDetail = _allStoreArray[indexPath.row];
if ([storeDetail.state isEqualToString:@"finished"]) {
} else if ([storeDetail.state isEqualToString:@"reported"]) {
} else {
}
OnLineResultViewController *onLineResult = [[OnLineResultViewController alloc] init];
onLineResult.storeDetail = _allStoreArray[indexPath.row];
onLineResult.storeDetail = storeDetail;
onLineResult.checkUuid = self.uuid;
[self.navigationController pushViewController:onLineResult animated:YES];
}
......
......@@ -37,8 +37,20 @@
{
_spotCheck = spotCheck;
self.titleLabel.text = [NSString stringWithFormat:@"%@", spotCheck.title];
self.startDate.text = [NSString stringWithFormat:@"起始时间:%@", spotCheck.create_time];
self.overDate.text = [NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate];
if (spotCheck.create_time == nil || spotCheck.create_time == NULL || [spotCheck.create_time isEqual:[NSNull null]] || spotCheck.create_time == Nil || [spotCheck.create_time isEqualToString:@"(null)"]) {
self.startDate.text = [NSString stringWithFormat:@"起始时间:"];
} else {
self.startDate.text = [[NSString stringWithFormat:@"起始时间:%@", spotCheck.create_time] substringToIndex:15];
}
if (spotCheck.endDate == nil || spotCheck.endDate == NULL || [spotCheck.endDate isEqual:[NSNull null]] || spotCheck.endDate == Nil || [spotCheck.endDate isEqualToString:@"(null)"]) {
self.overDate.text = [NSString stringWithFormat:@"截止时间:"];
} else {
self.overDate.text = [[NSString stringWithFormat:@"截止时间:%@", spotCheck.endDate] substringToIndex:15];
}
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", spotCheck.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", spotCheck.storeCount];
......@@ -53,7 +65,7 @@
if (self.multiplier > 1) {
self.multiplier = 1.0;
}
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
......@@ -261,27 +273,31 @@
- (UIImageView *)alreadyView
{
if (!_alreadyView) {
_alreadyView = [[UIImageView alloc] init];
_alreadyView.layer.cornerRadius = 3;
_alreadyView.layer.masksToBounds = YES;
//_alreadyView.layer.masksToBounds = YES;
_alreadyView.translatesAutoresizingMaskIntoConstraints = NO;
_alreadyView.tag = 9760001;
[self.allView addSubview:_alreadyView];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[self.allView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[self.allView addConstraint:overDateLeft];
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:-1];
[self.allView addConstraint:overDatewidth];
} else {
[_allView removeConstraints:_allView.constraints];
}
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
[self.allView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:1];
[self.allView addConstraint:overDateLeft];
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:-1];
[self.allView addConstraint:overDatewidth];
return _alreadyView;
}
......
......@@ -514,11 +514,11 @@
} else if (sender.tag - kTAxisBtnTag == 2) {
queryOrders = @[@{@"field":@"endDate",
@"direction":@"desc"}];
@"direction":@"asc"}];
} else {
queryOrders = @[@{@"field":@"endDate",
@"direction":@"asc"}];
@"direction":@"desc"}];
}
NSNumber *pageSize = [[NSUserDefaults standardUserDefaults] objectForKey:@"requestNumber"];
......@@ -593,7 +593,6 @@
}
cell.spotCheck = _allSpotCheckList[indexPath.row];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
......
......@@ -173,7 +173,6 @@
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[http1 upLoadPraisePictureWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"上传单组文字图片 ===== response ------ %@", response);
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
if ([response[@"success"] boolValue]) {
......
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