Commit 6433faf0 authored by admin's avatar admin

添加了管理层、商场的在线抽查部分页面 添加功能模块 修复巡检详情崩溃

parent 3a240f77
This diff is collapsed.
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "excellent_case@2x.png",
"filename" : "口碑巡检_功能一览@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "excellent_case@3x.png",
"filename" : "口碑巡检_功能一览@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "task_05@2x.png",
"filename" : "口碑巡检_首页@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_05@3x.png",
"filename" : "口碑巡检_首页@3x.png",
"scale" : "3x"
}
],
......
......@@ -6,12 +6,12 @@
},
{
"idiom" : "universal",
"filename" : "task_06@2x.png",
"filename" : "task_07@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_06@3x.png",
"filename" : "task_07@3x.png",
"scale" : "3x"
}
],
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_07@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_07@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -73,6 +73,7 @@
#define kDetailSmallTitleColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
// #444444
#define kDetailBigTitleColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
#define kOnLineCompleteHeaderTextColor [UIColor colorWithRed:80 / 255.0 green:80 / 255.0 blue:80 / 255.0 alpha:1.0]
// InspectList
......
......@@ -15,5 +15,6 @@
@property (nonatomic, strong) FuncItem *standardBtn; // 口碑标准按钮
@property (nonatomic, strong) FuncItem *pictureBtn; // 图说口碑按钮
@property (nonatomic, strong) FuncItem *questionBtn; // 问题与知识按钮
@property (nonatomic, strong) FuncItem *caseBtn; // 优秀案例按钮
@property (nonatomic, strong) FuncItem *rankBtn; // 口碑排名按钮
@end
......@@ -47,8 +47,9 @@
[self.standardBtn setTitle:@"口碑标准" forState:UIControlStateNormal];
[self.pictureBtn setTitle:@"图说口碑" forState:UIControlStateNormal];
[self.questionBtn setTitle:@"问题与知识" forState:UIControlStateNormal];
[self.caseBtn setTitle:@"优秀案例" forState:UIControlStateNormal];
self.lineView.backgroundColor = kSeparateLineViewColor;
[self.rankBtn setTitle:@"口碑排名" forState:UIControlStateNormal];
//self.lineView.backgroundColor = kSeparateLineViewColor;
}
......@@ -69,7 +70,7 @@
} else if ([item.titleLabel.text isEqualToString:@"问题与知识"]) {
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:questionVC];
} else if ([item.titleLabel.text isEqualToString:@"优秀案例"]) {
} else if ([item.titleLabel.text isEqualToString:@"口碑排名"]) {
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else {
......@@ -205,10 +206,10 @@
[self.view addSubview:_questionBtn];
NSLayoutConstraint *questionWidth = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
NSLayoutConstraint *questionWidth = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:self.rankBtn attribute:NSLayoutAttributeWidth multiplier:1.0 constant:0];
[self.view addConstraint:questionWidth];
NSLayoutConstraint *questionRight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
NSLayoutConstraint *questionRight = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.rankBtn attribute:NSLayoutAttributeLeft multiplier:1.0 constant:0];
[self.view addConstraint:questionRight];
NSLayoutConstraint *questionTop = [NSLayoutConstraint constraintWithItem:_questionBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_pictureBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
......@@ -220,27 +221,27 @@
return _questionBtn;
}
- (FuncItem *)caseBtn
- (FuncItem *)rankBtn
{
if (!_caseBtn) {
_caseBtn = [[FuncItem alloc] init];
[_caseBtn setImage:[UIImage imageNamed:@"task_005"] forState:UIControlStateNormal];
_caseBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_caseBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
if (!_rankBtn) {
_rankBtn = [[FuncItem alloc] init];
[_rankBtn setImage:[UIImage imageNamed:@"task_005"] forState:UIControlStateNormal];
_rankBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_rankBtn addTarget:self action:@selector(itemClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_caseBtn];
[self.view addSubview:_rankBtn];
NSLayoutConstraint *caseTop = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
NSLayoutConstraint *caseTop = [NSLayoutConstraint constraintWithItem:_rankBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.view addConstraint:caseTop];
NSLayoutConstraint *caseRight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
NSLayoutConstraint *caseRight = [NSLayoutConstraint constraintWithItem:_rankBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:caseRight];
NSLayoutConstraint *caseHeight = [NSLayoutConstraint constraintWithItem:_caseBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
NSLayoutConstraint *caseHeight = [NSLayoutConstraint constraintWithItem:_rankBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:_questionBtn attribute:NSLayoutAttributeHeight multiplier:1.0 constant:0];
[self.view addConstraint:caseHeight];
}
return _caseBtn;
return _rankBtn;
}
- (UIView *)lineView
......@@ -256,7 +257,7 @@
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.view addConstraint:lineViewRight];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.caseBtn attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.rankBtn attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[self.view addConstraint:lineViewTop];
NSLayoutConstraint *lineViewHeight = [NSLayoutConstraint constraintWithItem:_lineView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:1];
......
......@@ -9,6 +9,7 @@
#import "OnLineViewController.h"
#import "OnLineTableViewCell.h"
#import "OnLineFooterView.h"
#import "SpotCheckOnLineViewController.h"
#define kOnLineTableViewCell @"onlineTableViewCell"
......@@ -47,7 +48,10 @@
-(void)doBack:(id)sender
{
[self.navigationController dismissViewControllerAnimated:YES completion:nil];
if ([[self.navigationController.viewControllers objectAtIndex:0] isKindOfClass:[SpotCheckOnLineViewController class]]) {
SpotCheckOnLineViewController *spotCheckVC = (SpotCheckOnLineViewController *)[self.navigationController.viewControllers objectAtIndex:0];
[self.navigationController popToViewController:spotCheckVC animated:YES];
}
}
......
......@@ -12,6 +12,8 @@
#import "MenuView.h"
#import "LookOnLineTableViewCell.h"
#import "LookOnLineDetailViewController.h"
#define kLookOnLineCell @"LookOnLineTableViewCell"
@interface LookOnLineViewController ()<UITableViewDelegate, UITableViewDataSource,ScreenTableDelegate, TaxisViewDelegate, InspectTableViewDelegate>
......@@ -288,7 +290,8 @@
// cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
LookOnLineDetailViewController *lookDetailVC = [[LookOnLineDetailViewController alloc] init];
[self.navigationController pushViewController:lookDetailVC animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
......
//
// LookOnLineDetailView.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LookOnLineDetailView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UILabel *shopnameLabel; // 商店名称
@property (nonatomic, strong) UILabel *overDateLabel; // 截止时间
@property (nonatomic, strong) UILabel *peopleLabel; // 发起人
@property (nonatomic, strong) UILabel *startDateLabel; // 起始时间
@property (nonatomic, strong) UILabel *taskContentLabel; // 起始时间
@property (nonatomic, strong) UILabel *dayLabel; // 剩余天数
@end
//
// LookOnLineDetailViewController.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LookOnLineDetailViewController : UIViewController
@end
//
// LookOnLineDetailViewController.m
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "LookOnLineDetailViewController.h"
#import "LookOnLineDetailView.h"
#define kLookOnLineDetailCell @"LookOnLineDetailCell"
@interface LookOnLineDetailViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) LookOnLineDetailView *headerView;
@end
@implementation LookOnLineDetailViewController
- (void)viewDidLoad
{
[super viewDidLoad];
[self setNav];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
#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)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kLookOnLineDetailCell];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kLookOnLineDetailCell];
}
return cell;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableHeaderView = self.headerView;
[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;
}
- (LookOnLineDetailView *)headerView
{
if (!_headerView) {
_headerView = [[LookOnLineDetailView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 255)];
_headerView.titleLabel.text = @"2015年十一促销临时抽查";
}
return _headerView;
}
@end
//
// OnLineCompleteCell.h
// redstar
//
// Created by admin on 15/11/30.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineCompleteCell : UITableViewCell
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *shopName;
@property (nonatomic, assign) int starNumber;
@property (nonatomic, strong) UILabel *reportTime;
@end
//
// OnLineCompleteCell.m
// redstar
//
// Created by admin on 15/11/30.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineCompleteCell.h"
@implementation OnLineCompleteCell
#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
{
}
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:13];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:Left];
NSLayoutConstraint *width = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:90];
[self.contentView addConstraint:width];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:64];
[self.contentView addConstraint:Height];
NSLayoutConstraint *Bottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-13];
[self.contentView addConstraint:Bottom];
}
return _iconImageView;
}
- (UILabel *)shopName
{
if (!_shopName) {
_shopName = [[UILabel alloc] init];
_shopName.font = [UIFont systemFontOfSize:17.0];
_shopName.backgroundColor= [UIColor greenColor];
_shopName.textColor = kLightBlack;
_shopName.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_shopName];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:12];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
[self.contentView addConstraint:Left];
NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:Right];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_shopName attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:25];
[self.contentView addConstraint:Height];
}
return _shopName;
}
- (UILabel *)reportTime
{
if (!_reportTime) {
_reportTime = [[UILabel alloc] init];
_reportTime.font = [UIFont systemFontOfSize:13.0];
_reportTime.textColor = kLightGray;
_reportTime.textAlignment = NSTextAlignmentLeft;
_reportTime.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_reportTime];
NSLayoutConstraint *Top = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.shopName attribute:NSLayoutAttributeBottom multiplier:1.0 constant:25];
[self.contentView addConstraint:Top];
NSLayoutConstraint *Left = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.iconImageView attribute:NSLayoutAttributeRight multiplier:1.0 constant:10];
[self.contentView addConstraint:Left];
NSLayoutConstraint *Right = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:Right];
NSLayoutConstraint *Height = [NSLayoutConstraint constraintWithItem:_reportTime attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:Height];
}
return _reportTime;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// OnLineCompleteHeadView.h
// redstar
//
// Created by admin on 15/11/29.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineCompleteHeadView : UIView
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *startDateLabel; // 商店名称
@property (nonatomic, strong) UILabel *overDateLabel; // 截止时间
@property (nonatomic, strong) UILabel *taskContentLabel; // 发起人
@property (nonatomic, strong) UIButton *unfoldBtn; // 发起人
@property (nonatomic, strong) UIImageView *arrowImageView; // 发起人
@end
//
// OnLineCompleteViewController.h
// redstar
//
// Created by admin on 15/11/29.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OnLineCompleteViewController : UIViewController
@end
//
// OnLineCompleteViewController.m
// redstar
//
// Created by admin on 15/11/29.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "OnLineCompleteViewController.h"
#import "OnLineCompleteHeadView.h"
#import "OnLineCompleteCell.h"
#define kOnLineCompleteCell @"onLineCompleteCell"
@interface OnLineCompleteViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) OnLineCompleteHeadView *headerView;
@end
@implementation OnLineCompleteViewController
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self setupNav];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
#pragma mark - Private Mothods
- (void)setupNav
{
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;
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;
}
- (void)doBack:(id)sender
{
[self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
OnLineCompleteCell *cell = [tableView dequeueReusableCellWithIdentifier:kOnLineCompleteCell];
if (!cell) {
cell = [[OnLineCompleteCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kOnLineCompleteCell];
}
cell.iconImageView.image = [UIImage imageNamed:@"default_pic"];
cell.shopName.text = @"上海真北店";
cell.reportTime.text = @"上报时间:2015-10-02 12:10:16";
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 45;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *sectionView = [[UIView alloc] init];
sectionView.backgroundColor = kSectionBackGroundColor;
UILabel *shopList = [[UILabel alloc] init];
shopList.translatesAutoresizingMaskIntoConstraints = NO;
shopList.text = [NSString stringWithFormat:@"商场列表(5/10)"];
shopList.textColor = kNavigationBarColor;
shopList.font = [UIFont systemFontOfSize:16.0];
sectionView.layer.borderWidth = 0.5;
sectionView.layer.borderColor = kSeparateLineCGColor;
[sectionView addSubview:shopList];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:shopList attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[sectionView addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:shopList attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[sectionView addConstraint:titleLabelLeft];
NSLayoutConstraint *titleLabelRight = [NSLayoutConstraint constraintWithItem:shopList attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[sectionView addConstraint:titleLabelRight];
NSLayoutConstraint *titleLabelBottom = [NSLayoutConstraint constraintWithItem:shopList attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:sectionView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[sectionView addConstraint:titleLabelBottom];
return sectionView;
}
#pragma mark - lazy loading
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableHeaderView = self.headerView;
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 200.0;
[_tableView registerClass:[OnLineCompleteCell class] forCellReuseIdentifier:kOnLineCompleteCell];
[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;
}
- (OnLineCompleteHeadView *)headerView
{
if (!_headerView) {
_headerView = [[OnLineCompleteHeadView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 123)];
_tableView.backgroundColor = [UIColor whiteColor];
}
return _headerView;
}
@end
//
// SpotCheckOnLineViewController.h
// redstar
//
// Created by admin on 15/11/29.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SpotCheckOnLineViewController : UIViewController
@end
......@@ -13,6 +13,7 @@
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, strong) UILabel *progressLabel;
@property (nonatomic, strong) UILabel *alreadyLabel;
@property (nonatomic, strong) UILabel *allLabel;
......
......@@ -10,7 +10,6 @@
#import "TaskListModel.h"
@interface InspectListCell ()
@property (nonatomic, strong) UILabel *progressLabel;
@end
......
......@@ -119,12 +119,14 @@
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
NSLog(@"uuurl = %@", url);
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"userUuid":@"",
NSDictionary *parameters = @{
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(0),
@"pageSize":@(20)
};
NSLog(@"parameters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) {
......
......@@ -26,7 +26,7 @@
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *weight;
@property (nonatomic, copy) NSString *originScore;
+ (instancetype)taskModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
......
......@@ -96,13 +96,14 @@
- (void)requestRankingDetail
{
NSString *url = [NSString stringWithFormat:@"%@%@%@/%@",kRedStarURL, kInspectDetailURL, self.uuid, self.store_uuid];
NSLog(@"url = %@", url);
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);
NSLog(@"error = %@", error);
NSDictionary *dataDict = response[@"data"];
TaskDetailModel *taskDetail = [TaskDetailModel taskDetailModelWithDict:dataDict];
weakSelf.detailHeaderView.taskDetail = taskDetail;
......
......@@ -41,7 +41,7 @@
#import "InspectTaskViewController.h"
#import "TaskListModel.h"
#import "OnLineViewController.h"
#import "SpotCheckOnLineViewController.h"
#import "LookOnLineViewController.h"
......@@ -94,7 +94,7 @@
// 初始化容器
self.titleArray = [NSArray arrayWithObjects:@"图说口碑", @"8月口碑巡检",@"问题与知识",@"口碑任务", nil];
self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题与知识",@"优秀案例",@"口碑排名",@"查看抽查", nil];
self.btnTitleArray = [NSArray arrayWithObjects:@"在线抽查", @"口碑巡检",@"口碑标准",@"图说口碑",@"问题与知识",@"口碑排名",@"查看抽查", nil];
self.announeArray = [NSArray arrayWithObjects:@"关于展开10月口碑巡检的说明", @"迎2015十一大促活动启动", @"9月口碑巡检结果排名已公布", nil];
// 初始化
......@@ -153,6 +153,7 @@
};
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
NSLog(@"error = %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
......@@ -185,7 +186,7 @@
[httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"巡检列表%@", response);
NSLog(@"error = %@", error);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
for (NSDictionary *dict in dataArray) {
......@@ -225,6 +226,7 @@
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"问题与知识列表recods = %@", response);
NSLog(@"error = %@", error);
for (NSDictionary *questionDict in recordsDict) {
QuestionModel *question = [[QuestionModel alloc] init];
[question setValuesForKeysWithDictionary:questionDict];
......@@ -260,7 +262,7 @@
CGFloat itemW = kScreenWidth / 4;
CGFloat itemH = self.headView.scrollView.frame.size.height;
for (int i = 0; i < 8; i++) {
for (int i = 0; i < 7; i++) {
HomeCellItem *item = [[HomeCellItem alloc] init];
item.frame = CGRectMake(i * itemW, 0, itemW, itemH);
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_0%d", i]];
......@@ -303,8 +305,8 @@
HomeCellItem *item = (HomeCellItem *)sender;
UINavigationController *nav;
if ([item.titleLabel.text isEqualToString:@"在线抽查"]) {
OnLineViewController *online = [[OnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:online];
SpotCheckOnLineViewController *spotOnline = [[SpotCheckOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:spotOnline];
} else if ([item.titleLabel.text isEqualToString:@"口碑巡检"]) {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
......
......@@ -122,6 +122,7 @@
[MBProgressHUD showHUDAddedTo:window animated:YES];
[httpClient loginWithUsername:username password:password completion:^(id response, NSError *error) {
NSLog(@"登陆 respo = %@", response);
NSLog(@"error = %@", error);
if ([response[@"message"] isEqualToString:@"ok"]) {
// 保存登陆信息
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
......@@ -164,6 +165,9 @@
*/
- (void)loginButtonClick:(UIButton *)sender
{
self.rootTBC = [[RootTabBarController alloc] init];
[self presentViewController:_rootTBC animated:YES completion:nil];
if (self.loginView.usernameTextFiled.text.length == 0 || self.loginView.passwordTextFiled.text.length == 0) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:@"账号、密码不能为空" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alertView show];
......
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