Commit 810ea6c9 authored by admin's avatar admin

首页接口完成

parent 1cc64c97
......@@ -56,7 +56,6 @@
84AD4F3A1BF4844600BFB37C /* RankDetailHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F391BF4844600BFB37C /* RankDetailHeaderView.m */; };
84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F3C1BF4894D00BFB37C /* RankDetailView.m */; };
84AD4F3F1BF498A900BFB37C /* ranking.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F3E1BF498A900BFB37C /* ranking.plist */; };
84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F421BF4A66F00BFB37C /* WorkModel.m */; };
84AD4F461BF4A9E800BFB37C /* RankHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F451BF4A9E800BFB37C /* RankHeadView.m */; };
84AD4F491BF4BC0600BFB37C /* RankDetailTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F481BF4BC0600BFB37C /* RankDetailTableCell.m */; };
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */ = {isa = PBXBuildFile; fileRef = 84C9574A1BDB344900083584 /* UIBarButtonItem+Create.m */; };
......@@ -211,8 +210,6 @@
84AD4F3B1BF4894D00BFB37C /* RankDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailView.h; sourceTree = "<group>"; };
84AD4F3C1BF4894D00BFB37C /* RankDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailView.m; sourceTree = "<group>"; };
84AD4F3E1BF498A900BFB37C /* ranking.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = ranking.plist; sourceTree = "<group>"; };
84AD4F411BF4A66F00BFB37C /* WorkModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkModel.h; sourceTree = "<group>"; };
84AD4F421BF4A66F00BFB37C /* WorkModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WorkModel.m; sourceTree = "<group>"; };
84AD4F441BF4A9E800BFB37C /* RankHeadView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankHeadView.h; sourceTree = "<group>"; };
84AD4F451BF4A9E800BFB37C /* RankHeadView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankHeadView.m; sourceTree = "<group>"; };
84AD4F471BF4BC0600BFB37C /* RankDetailTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankDetailTableCell.h; sourceTree = "<group>"; };
......@@ -1034,8 +1031,6 @@
84AD4F401BF49FC100BFB37C /* Model */ = {
isa = PBXGroup;
children = (
84AD4F411BF4A66F00BFB37C /* WorkModel.h */,
84AD4F421BF4A66F00BFB37C /* WorkModel.m */,
);
path = Model;
sourceTree = "<group>";
......@@ -1570,7 +1565,6 @@
84D80EB51BF714BE00A10EA4 /* GroupItems.m in Sources */,
84C9574D1BDB344900083584 /* UIBarButtonItem+Create.m in Sources */,
84AD4F3D1BF4894D00BFB37C /* RankDetailView.m in Sources */,
84AD4F431BF4A66F00BFB37C /* WorkModel.m in Sources */,
84ECCF1B1C0210F000EA4960 /* CommentModel.m in Sources */,
84E0ABCD1BFB082E001C8F45 /* TaskDetailModel.m in Sources */,
8490C4D31BF9DEF0006B6569 /* PictureTableCell.m in Sources */,
......
......@@ -20,16 +20,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor redColor];
self.takeImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
_takeImageView.image = _checkImage;
[self.view addSubview:_takeImageView];
// [self addGestureRecognizerToView:_takeImageView];
// [_takeImageView setUserInteractionEnabled:YES];
// [_takeImageView setMultipleTouchEnabled:YES];
// Do any additional setup after loading the view.
}
......
......@@ -125,7 +125,7 @@
@"endDateTo":@"",
@"nameLike":@"",
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(1),
@"pageNumber":@(0),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
......@@ -324,7 +324,7 @@
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"",@"userUuid",@"",@"beginDateFrom",@"",@"endDateTo",@"",@"nameLike",@[],@"queryOrders",@(1),@"pageNumber",@(10),@"pageSize", nil];
NSMutableDictionary *parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"",@"userUuid",@"",@"beginDateFrom",@"",@"endDateTo",@"",@"nameLike",@[],@"queryOrders",@(0),@"pageNumber",@(10),@"pageSize", nil];
if (_selectRow == 0) {
......@@ -441,7 +441,7 @@
@"endDateTo":@"",
@"nameLike":@"",
@"queryOrders":queryOrders,
@"pageNumber":@(1),
@"pageNumber":@(0),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
......@@ -514,7 +514,7 @@
InspectTaskViewController *inspectTaskVC = [[InspectTaskViewController alloc] init];
inspectTaskVC.uuid = taskList.uuid;
inspectTaskVC.store_uuid = taskList.store_uuid;
inspectTaskVC.multiplier = taskList.reportCount / taskList.questionCount;
inspectTaskVC.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount;
[self.navigationController pushViewController:inspectTaskVC animated:YES];
}
......
......@@ -28,6 +28,6 @@
@property (nonatomic, strong) UILabel *dayLabel; // 剩余天数
@property (nonatomic, strong) UIView *alreadyView;
@property (nonatomic, strong) UIImageView *alreadyView;
@property (nonatomic, strong) UIView *allView;
@end
......@@ -75,8 +75,9 @@
self.alreadyLabel.textColor = kProgressUnSettledColor;
self.allLabel.textColor = kProgressUnSettledColor;
self.allView.backgroundColor = kProgressViewAllBackColor;
self.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
} else if (_progressState == ProgressStateDealWith) {
self.progressLabel.text = [NSString stringWithFormat:@"进行中 %f", _multiplier];
......@@ -84,8 +85,9 @@
self.alreadyLabel.textColor = kProgressDealWithColor;
self.allLabel.textColor = kProgressDealWithColor;
self.allView.backgroundColor = kProgressViewAllBackColor;
self.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
} else {
self.progressLabel.text = [NSString stringWithFormat:@"已过期 %f", _multiplier];
......@@ -93,7 +95,9 @@
self.alreadyLabel.textColor = kProgressOverDueColor;
self.allLabel.textColor = kProgressOverDueColor;
self.allView.backgroundColor = kProgressViewAllBackColor;
self.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
}
}
......@@ -266,10 +270,10 @@
return _allView;
}
- (UIView *)alreadyView
- (UIImageView *)alreadyView
{
if (!_alreadyView) {
_alreadyView = [[UIView alloc] init];
_alreadyView = [[UIImageView alloc] init];
_alreadyView.layer.cornerRadius = 3;
_alreadyView.layer.masksToBounds = YES;
_alreadyView.translatesAutoresizingMaskIntoConstraints = NO;
......
......@@ -37,7 +37,7 @@
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.tabBarController.tabBar.hidden = YES;
self.navigationController.navigationBar.hidden = NO;
}
......@@ -79,6 +79,7 @@
}
#pragma mark - Private Methods
// 返回上一页面
......
......@@ -7,6 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "TaskModel.h"
@interface RankDetailTableCell : UITableViewCell
......@@ -19,4 +20,6 @@
@property (nonatomic, strong) UIScrollView *scrollView;
@property (nonatomic, strong) TaskModel *task;
@end
//
// WorkModel.h
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface WorkModel : NSObject
@property (nonatomic, strong) NSArray *Info;
@property (nonatomic, strong) NSString *name;
@property (nonatomic, strong) NSString *score;
@property (nonatomic, strong) NSString *grade;
@property (nonatomic, assign, getter = isOpened) BOOL opened;
+ (instancetype)workModelWithDict:(NSDictionary *)dict;
- (instancetype)initWithDict:(NSDictionary *)dict;
@end
//
// WorkModel.m
// redstar
//
// Created by admin on 15/11/12.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "WorkModel.h"
@implementation WorkModel
+ (instancetype)workModelWithDict:(NSDictionary *)dict
{
return [[self alloc] initWithDict:dict];
}
- (instancetype)initWithDict:(NSDictionary *)dict
{
if (self = [super init]) {
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
......@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h>
#import "RankDetailView.h"
#import "TaskDetailModel.h"
@interface RankDetailHeaderView : UIView
@property (nonatomic, strong) RankDetailView *rankDetailView;
......@@ -18,4 +19,6 @@
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *showAllBtn; // 展开全部
@property (nonatomic, strong) TaskDetailModel *taskDetail;
@end
......@@ -37,15 +37,31 @@
- (void)setup {
self.shopNameLabel.text = @"上海真北店";
[self.historyBtn setTitle:@"历史成绩" forState:UIControlStateNormal];
self.arrowImageView1.image = [UIImage imageNamed:@"arrow_right"];
self.rankDetailView.backgroundColor = [UIColor whiteColor];
self.titleLabel.text = @"口碑七大重点工作详情";
[self.showAllBtn setTitle:@"历史成绩" forState:UIControlStateNormal];
self.arrowImageView2.image = [UIImage imageNamed:@"arrow_right"];}
[self.showAllBtn setTitle:@"展开" forState:UIControlStateNormal];
self.arrowImageView2.image = [UIImage imageNamed:@"arrow_right"];
}
- (void)setTaskDetail:(TaskDetailModel *)taskDetail
{
_taskDetail = taskDetail;
self.shopNameLabel.text = [NSString stringWithFormat:@"%@", taskDetail.store_name];
self.rankDetailView.addressLabel.text = @"上海市真北路1108号";
self.rankDetailView.titleLabel.text = [NSString stringWithFormat:@"%@", taskDetail.name];
self.rankDetailView.reportTimeLabel.text = @"上报时间";
self.rankDetailView.totalScoreLabel.text = @"总评分";
self.rankDetailView.totalGradeLabel.text = @"总排名";
self.rankDetailView.timeLabel.text = [NSString stringWithFormat:@"%@", taskDetail.beginDate];
self.rankDetailView.scoreLabel.text = [NSString stringWithFormat:@"%@", taskDetail.score];
}
- (UILabel *)shopNameLabel
{
......
......@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@class WorkModel;
@class TaskGroup;
@protocol RankHeadViewDelegate <NSObject>
......@@ -18,7 +18,7 @@
@end
@interface RankHeadView : UITableViewHeaderFooterView
@property (nonatomic, strong) WorkModel *work;
@property (nonatomic, strong) TaskGroup *taskGroup;
@property (nonatomic, weak) id<RankHeadViewDelegate> delegate;
......
......@@ -7,7 +7,7 @@
//
#import "RankHeadView.h"
#import "WorkModel.h"
#import "TaskGroup.h"
@interface RankHeadView ()
{
......@@ -71,24 +71,25 @@
- (void)headBtnClick
{
_work.opened = !_work.isOpened;
_taskGroup.opened = !_taskGroup.isOpened;
if ([_delegate respondsToSelector:@selector(clickRankHeadView)]) {
[_delegate clickRankHeadView];
}
}
- (void)setWork:(WorkModel *)work
- (void)setTaskGroup:(TaskGroup *)taskGroup
{
_work = work;
[_bgButton setTitle:work.name forState:UIControlStateNormal];
_taskGroup = taskGroup;
NSString *scoreStr = [NSString stringWithFormat:@"%@ 分", work.score];
[_bgButton setTitle:taskGroup.category forState:UIControlStateNormal];
NSString *scoreStr = [NSString stringWithFormat:@"%@ 分", taskGroup.score];
NSMutableAttributedString *scoreAttr = [[NSMutableAttributedString alloc] initWithString:scoreStr];
[scoreAttr addAttributes:@{NSForegroundColorAttributeName:kNavigationBarColor,NSFontAttributeName:[UIFont systemFontOfSize:19.0f]} range:NSMakeRange(0,scoreAttr.length - 1)];
[scoreAttr addAttributes:@{NSForegroundColorAttributeName:kDetailSmallTitleColor, NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(scoreAttr.length - 1,1)];
[_scoreLabel setAttributedText:scoreAttr];
NSString *rankStr = [NSString stringWithFormat:@"第 %@ 名", work.grade];
NSString *rankStr = [NSString stringWithFormat:@"第 %@ 名", taskGroup.ranking];
NSMutableAttributedString *rankAttr = [[NSMutableAttributedString alloc] initWithString:rankStr];
[rankAttr addAttributes:@{NSForegroundColorAttributeName:kRankHeadTitleTextColor,NSFontAttributeName:[UIFont systemFontOfSize:14.0f]} range:NSMakeRange(0,1)];
[rankAttr addAttributes:@{NSForegroundColorAttributeName:kGradeNumberTextColor} range:NSMakeRange(1,rankStr.length - 2)];
......@@ -101,8 +102,8 @@
- (void)didMoveToSuperview
{
_arrowImageView.transform = _work.isOpened ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformMakeRotation(0);
_lineView.hidden = _work.isOpened ? YES : NO;
_arrowImageView.transform = _taskGroup.isOpened ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformMakeRotation(0);
_lineView.hidden = _taskGroup.isOpened ? YES : NO;
}
- (void)layoutSubviews
......
......@@ -10,5 +10,7 @@
@interface RankDetailViewController : UIViewController
@property (nonatomic, assign) NSInteger indexRow;
@property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *store_uuid;
@end
......@@ -7,6 +7,7 @@
//
#import "RankingListCell.h"
#import "RankListModel.h"
@implementation RankingListCell
......@@ -33,6 +34,9 @@
- (void)setRankList:(RankListModel *)rankList
{
_rankList = rankList;
[self.shopNameButton setTitle:[NSString stringWithFormat:@"%@", rankList.store_name] forState:UIControlStateNormal];
self.scoreLabel.text = [NSString stringWithFormat:@"%@", rankList.score];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
......@@ -88,7 +88,7 @@
NSDictionary *parameters = @{@"beginDateFrom":@"",
@"endDateTo":@"",
@"queryOrders":@[],
@"pageNumber":@(1),
@"pageNumber":@(0),
@"pageSize":@(10)
};
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
......@@ -312,8 +312,12 @@
// cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
RankListModel *rankList = _allRankListArray[indexPath.row];
RankDetailViewController *rankDetailVC = [[RankDetailViewController alloc] init];
rankDetailVC.indexRow = indexPath.row;
rankDetailVC.uuid = rankList.uuid;
rankDetailVC.store_uuid = rankList.store_uuid;
[self.navigationController pushViewController:rankDetailVC animated:YES];
}
......
......@@ -27,6 +27,7 @@
#import "RankingListCell.h"
#define kHomeRankingListCell @"homeRankingListsCell"
#import "RankDetailViewController.h"
#import "RankListModel.h"
#import "QuestionListTableCell.h"
#define kHomeQuestionListTableCell @"homeQuestionListTableCell"
......@@ -72,7 +73,8 @@
@property (nonatomic, strong) NSMutableDictionary *selectedIndexes;
@property (nonatomic, strong) NSMutableArray *allQuestionArray; // 问题与知识
@property (nonatomic, strong) NSMutableArray *taskListDataArray; // 问题与知识
@property (nonatomic, strong) NSMutableArray *allRankListArray;
@end
@implementation HomeViewController
......@@ -111,6 +113,20 @@
// 初始化容器
self.selectedIndexes = [[NSMutableDictionary alloc] init];
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
self.allRankListArray = [NSMutableArray array];
self.taskListDataArray = [NSMutableArray array];
self.allQuestionArray = [NSMutableArray array];
self.tableView.tableHeaderView = self.headView;
//
[self requestRankingList];
// 巡检列表
[self requestInspectList];
// 问题与知识
[self requestQuestionList];
......@@ -129,10 +145,70 @@
}
#pragma mark - 请求
- (void)requestRankingList
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kRankingListURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"beginDateFrom":@"",
@"endDateTo":@"",
@"queryOrders":@[],
@"pageNumber":@(0),
@"pageSize":@(3)
};
__block HomeViewController *weakSelf = self;
[httpCilent getRankingListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"口碑排名response = %@", response);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
for (NSDictionary *ListDict in dataArray) {
RankListModel *rankList = [RankListModel rankListModelWithDict:ListDict];
[weakSelf.allRankListArray addObject:rankList];
}
[self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
}
- (void)requestInspectList
{
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"userUuid":@"",
@"beginDateFrom":@"",
@"endDateTo":@"",
@"nameLike":@"",
@"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(0),
@"pageSize":@(2)
};
[httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"巡检列表%@", response);
NSDictionary *dataDict = response[@"data"];
NSArray *dataArray = dataDict[@"records"];
for (NSDictionary *dict in dataArray) {
TaskListModel *taskList = [[TaskListModel alloc] init];
[taskList setValuesForKeysWithDictionary:dict];
[_taskListDataArray addObject:taskList];
}
[self.tableView reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
}
- (void)requestQuestionList
{
// 初始化数组
self.allQuestionArray = [NSMutableArray array];
// 请求地址
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL];
NSString *user_uuid = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_uuid"];
......@@ -148,18 +224,18 @@
//
__block HomeViewController *weakSelf = self;
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
// 请求问题列表
[httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) {
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];
[weakSelf.allQuestionArray addObject:question];
}
[self.tableView reloadData];
self.tableView.tableHeaderView = self.headView;
[MBProgressHUD hideHUDForView:self.view animated:YES];
}];
......@@ -329,6 +405,7 @@
NSNumber *selectedIndex = [NSNumber numberWithBool:isSelected];
[_selectedIndexes setObject:selectedIndex forKey:path];
if (cell.isDrop) {
[UIView animateWithDuration:0.2 animations:^{
......@@ -438,10 +515,14 @@
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 1) {
return 4;
} else {
if (section == 0) {
return 2;
} else if (section == 1) {
return _allRankListArray.count + 1;
} else if (section == 2) {
return _allQuestionArray.count;
} else{
return _taskListDataArray.count;
}
}
......@@ -480,14 +561,13 @@
if (!cell) {
cell = [[RankingListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeRankingListCell];
}
RankListModel *rankList = _allRankListArray[indexPath.row - 1];
cell.rankList = rankList;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.scoreState = ScoreStateHigh;
NSString *imageName = [NSString stringWithFormat:@"medal_0%ld", (long)(indexPath.row)];
cell.gradeImageView.image = [UIImage imageNamed:imageName];
[cell.shopNameButton setTitle:@"上海真北店" forState:UIControlStateNormal];
cell.scoreLabel.text = @"98";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// 添加点击事件
cell.gradeImageView.image = [UIImage imageNamed:imageName]; // 添加点击事件
[cell.shopNameButton addTarget:self action:@selector(loadMoreInfo:) forControlEvents:UIControlEventTouchUpInside];
return cell;
}
......@@ -509,22 +589,13 @@
if (!cell) {
cell = [[InspectListCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kHomeInspectListCell];
}
TaskListModel *taskList = [[TaskListModel alloc] init];
taskList.reportCount = 10;
taskList.questionCount = 13;
TaskListModel *taskList = _taskListDataArray[indexPath.row];
cell.taskList = taskList;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _test7Array[indexPath.row]];
cell.startDate.text = [NSString stringWithFormat:@"起始时间:%@", _test8Array[indexPath.row]];
cell.overDate.text = [NSString stringWithFormat:@"截止时间:%@", _test9Array[indexPath.row]];
cell.alreadyLabel.text = [NSString stringWithFormat:@"%@", _test5Array[indexPath.row]];
cell.allLabel.text = [NSString stringWithFormat:@"/%@", _test6Array[indexPath.row]];
// CGFloat already = [_test5Array[indexPath.row] floatValue];
// CGFloat all = [_test6Array[indexPath.row] floatValue];
// cell.multiplier = already / all;
cell.allView.backgroundColor = kProgressViewAllBackColor;
cell.alreadyView.backgroundColor = kProgressViewAlreadyBackColor;
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
cell.alreadyView.image = image;
return cell;
}
}
......@@ -548,11 +619,12 @@
[self.navigationController pushViewController:questionDetailVC animated:YES];
} else {
InspectListCell *cell = (InspectListCell *)[self tableView:_tableView cellForRowAtIndexPath:indexPath];
InspectTaskViewController *inspectTaskVC = [[InspectTaskViewController alloc] init];
inspectTaskVC.multiplier = cell.multiplier;
inspectTaskVC.alreadyNumber = cell.alreadyLabel.text;
inspectTaskVC.allNumber = cell.allLabel.text;
TaskListModel *taskList = _taskListDataArray[indexPath.row];
inspectTaskVC.uuid = taskList.uuid;
inspectTaskVC.store_uuid = taskList.store_uuid;
inspectTaskVC.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount ;
[self.navigationController pushViewController:inspectTaskVC animated:YES];
}
......
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