Commit 1a9e7d2b authored by admin's avatar admin

完成在线 口碑标准列表

parent cc721218
This diff is collapsed.
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sop@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sop@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "培训讲义@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "培训讲义@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "培训视频@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "培训视频@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "task_06@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "task_06@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"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
......@@ -115,10 +115,12 @@
}
if ([text isEqualToString:@"\n"]) {
[self.titleTextView resignFirstResponder];
[self.contentTextView resignFirstResponder];
return NO;
}
return YES;
}
......
......@@ -34,8 +34,25 @@
self.titleArray = [NSArray arrayWithObjects:@"商场名称", @"截止时间", nil];
[self addTableView];
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 dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
//
// LookOnLineTableViewCell.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LookOnLineTableViewCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *peopleLabel; // 起始日期
@property (nonatomic, strong) UILabel *startDate; // 起始日期
@property (nonatomic, strong) UILabel *overDate; // 截止日期
@property (nonatomic, strong) UILabel *progressLabel; // 进度
@end
//
// LookOnLineTableViewCell.m
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "LookOnLineTableViewCell.h"
@implementation LookOnLineTableViewCell
#pragma mark - lazy Loading
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.textColor = kCellTitleColor;
_titleLabel.font = [UIFont systemFontOfSize:19.0];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_titleLabel];
NSLayoutConstraint *titleLabelTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:8];
[self.contentView addConstraint:titleLabelTop];
NSLayoutConstraint *titleLabelLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:titleLabelLeft];
NSLayoutConstraint *startDateRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:startDateRight];
NSLayoutConstraint *titleLabelHeight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self.contentView addConstraint:titleLabelHeight];
}
return _titleLabel;
}
- (UILabel *)peopleLabel
{
if (!_peopleLabel) {
_peopleLabel = [[UILabel alloc] init];
_peopleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_peopleLabel.font = [UIFont systemFontOfSize:14.0];
_peopleLabel.textColor = kCellDetailColor;
[self.contentView addSubview:_peopleLabel];
NSLayoutConstraint *startDateTop = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:startDateTop];
NSLayoutConstraint *startDateLeft = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:startDateLeft];
NSLayoutConstraint *startDateRight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:startDateRight];
NSLayoutConstraint *startDateHeight = [NSLayoutConstraint constraintWithItem:_peopleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:startDateHeight];
}
return _peopleLabel;
}
- (UILabel *)startDate
{
if (!_startDate) {
_startDate = [[UILabel alloc] init];
_startDate.translatesAutoresizingMaskIntoConstraints = NO;
_startDate.font = [UIFont systemFontOfSize:14.0];
_startDate.textColor = kCellDetailColor;
[self.contentView addSubview:_startDate];
NSLayoutConstraint *startDateTop = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.peopleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:startDateTop];
NSLayoutConstraint *startDateLeft = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:startDateLeft];
NSLayoutConstraint *startDateRight = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:startDateRight];
NSLayoutConstraint *startDateHeight = [NSLayoutConstraint constraintWithItem:_startDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:startDateHeight];
}
return _startDate;
}
- (UILabel *)overDate
{
if (!_overDate) {
_overDate = [[UILabel alloc] init];
_overDate.font = [UIFont systemFontOfSize:14.0];
_overDate.textColor = kCellDetailColor;
_overDate.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_overDate];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.startDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_overDate attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateHeight];
}
return _overDate;
}
- (UILabel *)progressLabel
{
if (!_progressLabel) {
_progressLabel = [[UILabel alloc] init];
_progressLabel.translatesAutoresizingMaskIntoConstraints = NO;
_progressLabel.font = [UIFont systemFontOfSize:14.0];
_progressLabel.textColor = kCellDetailColor;
[self.contentView addSubview:_progressLabel];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.overDate attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2];
[self.contentView addConstraint:overDateTop];
NSLayoutConstraint *overDateLeft = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateLeft];
NSLayoutConstraint *overDateRight = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:overDateRight];
NSLayoutConstraint *overDateHeight = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:overDateHeight];
NSLayoutConstraint *overDateBottom = [NSLayoutConstraint constraintWithItem:_progressLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-8];
[self.contentView addConstraint:overDateBottom];
}
return _progressLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
@end
//
// LookOnLineViewController.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface LookOnLineViewController : UIViewController
@end
......@@ -21,7 +21,6 @@
#import "NoDataView.h"
#import <MBProgressHUD.h>
#import "RedStarTools.h"
#define kQuestionListCell @"questionListTableViewCell"
#define kThumbTag 745645
......@@ -118,7 +117,6 @@
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];
......
//
// StandardTableViewCell.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StandardTableViewCell : UITableViewCell
@property (nonatomic, strong) UIImageView *iconImageView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *detailTitleLabel;
@end
//
// StandardTableViewCell.m
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "StandardTableViewCell.h"
@implementation StandardTableViewCell
- (UIImageView *)iconImageView
{
if (!_iconImageView) {
_iconImageView = [[UIImageView alloc] init];
_iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
[self.contentView addSubview:_iconImageView];
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:27];
[self.contentView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:25];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:titleWidth];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:60];
[self.contentView addConstraint:titleHeight];
NSLayoutConstraint *titleBottom = [NSLayoutConstraint constraintWithItem:_iconImageView attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-27];
[self.contentView addConstraint:titleBottom];
}
return _iconImageView;
}
- (UILabel *)titleLabel
{
if (!_titleLabel) {
_titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont systemFontOfSize:20.0];
_titleLabel.textColor = kOnLineCellTitleColor;
[self.contentView addSubview:_titleLabel];
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:22];
[self.contentView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:105];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_titleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self.contentView addConstraint:titleHeight];
}
return _titleLabel;
}
- (UILabel *)detailTitleLabel
{
if (!_detailTitleLabel) {
_detailTitleLabel = [[UILabel alloc] init];
_detailTitleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_detailTitleLabel.font = [UIFont systemFontOfSize:15.0];
_detailTitleLabel.textColor = kLightGray;
[self.contentView addSubview:_detailTitleLabel];
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_detailTitleLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:3];
[self.contentView addConstraint:titleTop];
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_detailTitleLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:105];
[self.contentView addConstraint:titleLeft];
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_detailTitleLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.contentView addConstraint:titleRight];
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_detailTitleLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:20];
[self.contentView addConstraint:titleHeight];
}
return _detailTitleLabel;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// HandOutViewController.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HandOutViewController : UIViewController
@end
//
// StandardViewController.h
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface StandardViewController : UIViewController
@end
//
// StandardViewController.m
// redstar
//
// Created by admin on 15/11/28.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "StandardViewController.h"
#import "StandardTableViewCell.h"
#import "HandOutViewController.h"
#define kStandardTableViewCell @"standardTableViewCell"
@interface StandardViewController ()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSArray *detailTitleArray;
@end
@implementation StandardViewController
- (void)viewDidLoad {
[super viewDidLoad];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self setupNav];
self.titleArray = [NSArray arrayWithObjects:@"SOP",@"培训讲义",@"培训视频", nil];
self.detailTitleArray = [NSArray arrayWithObjects:@"SOP:标准作业程序",@"内部精品培训课程讲义资料...",@"专家讲师精品课程视频分享...", nil];
self.tableView.delegate = self;
self.tableView.dataSource = self;
}
- (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 dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return _titleArray.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
StandardTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kStandardTableViewCell];
if (!cell) {
cell = [[StandardTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kStandardTableViewCell];
}
cell.iconImageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"sop_0%ld",(long)indexPath.section]];
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.section]];
cell.detailTitleLabel.text = [NSString stringWithFormat:@"%@", _detailTitleArray[indexPath.section]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return CGFLOAT_MIN;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 1) {
HandOutViewController *hoandOutVC = [[HandOutViewController alloc] init];
[self.navigationController pushViewController:hoandOutVC animated:YES];
}
}
#pragma mark - lazy laoding
- (UITableView *)tableView
{
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.translatesAutoresizingMaskIntoConstraints = NO;
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = [[UIView alloc] init];
_tableView.rowHeight = UITableViewAutomaticDimension;
_tableView.estimatedRowHeight = 300.0;
[self.view addSubview:_tableView];
[self.view insertSubview:_tableView atIndex:0];
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;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -9,12 +9,6 @@
#import <UIKit/UIKit.h>
@class TaskListModel;
typedef enum ProgressState : NSUInteger {
ProgressStateUnSettled = 0,// 未处理
ProgressStateDealWith, // 处理中
ProgressStateOverDue // 已过期
} ProgressState;
@interface InspectListCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题
@property (nonatomic, strong) UILabel *startDate; // 起始日期
......
......@@ -41,6 +41,12 @@
#import "InspectTaskViewController.h"
#import "TaskListModel.h"
#import "OnLineViewController.h"
#import "LookOnLineViewController.h"
#import "StandardViewController.h"
#import "HttpClient.h"
#import <MBProgressHUD.h>
......@@ -88,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];
// 初始化
......@@ -254,7 +260,7 @@
CGFloat itemW = kScreenWidth / 4;
CGFloat itemH = self.headView.scrollView.frame.size.height;
for (int i = 0; i < 6; i++) {
for (int i = 0; i < 8; i++) {
HomeCellItem *item = [[HomeCellItem alloc] init];
item.frame = CGRectMake(i * itemW, 0, itemW, itemH);
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"task_0%d", i]];
......@@ -297,12 +303,14 @@
HomeCellItem *item = (HomeCellItem *)sender;
UINavigationController *nav;
if ([item.titleLabel.text isEqualToString:@"在线抽查"]) {
return;
OnLineViewController *online = [[OnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:online];
} else if ([item.titleLabel.text isEqualToString:@"口碑巡检"]) {
InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:inspectListVC];
} else if ([item.titleLabel.text isEqualToString:@"口碑标准"]) {
return;
StandardViewController *standardVC = [[StandardViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:standardVC];
} else if ([item.titleLabel.text isEqualToString:@"图说口碑"]) {
PictureViewController *pictureVC = [[PictureViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:pictureVC];
......@@ -310,10 +318,13 @@
QuestionViewController *questionVC = [[QuestionViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:questionVC];
} else if ([item.titleLabel.text isEqualToString:@"优秀案例"]) {
return;
} else if ([item.titleLabel.text isEqualToString:@"口碑排名"]){
RankingListViewController *rankingListVC = [[RankingListViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:rankingListVC];
} else {
return;
} else if ([item.titleLabel.text isEqualToString:@"查看抽查"]){
LookOnLineViewController *lookOnLine = [[LookOnLineViewController alloc] init];
nav = [[UINavigationController alloc] initWithRootViewController:lookOnLine];
}
[nav.navigationBar setBarTintColor:kNavigationBarColor];
......
//
// RedStarTools.h
// redstar
//
// Created by admin on 15/11/23.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface RedStarTools : NSObject
@property (nonatomic, strong) NSMutableArray *localDatas;
+ (RedStarTools *)sharedInstance;
- (void)saveLocalData;
- (void)loadLocalData;
@end
//
// RedStarTools.m
// redstar
//
// Created by admin on 15/11/23.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "RedStarTools.h"
@implementation RedStarTools
static RedStarTools *redStarToolsData = nil;
+ (RedStarTools *)sharedInstance
{
@synchronized(self) {
if (!redStarToolsData)
redStarToolsData = [[self alloc] init];
return redStarToolsData;
}
}
- (void)loadLocalData
{
NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path = [paths objectAtIndex:0];
NSString *filename=[path stringByAppendingPathComponent:@"local.plist"];
self.localDatas = [[NSMutableArray alloc] initWithContentsOfFile:filename];
if (!self.localDatas) {
self.localDatas = [NSMutableArray array];
}
}
- (void)saveLocalData
{
NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path = [paths objectAtIndex:0];
NSString *filename=[path stringByAppendingPathComponent:@"local.plist"];
[_localDatas writeToFile:filename atomically:YES];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment