Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
810ea6c9
Commit
810ea6c9
authored
Nov 23, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页接口完成
parent
1cc64c97
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
266 additions
and
162 deletions
+266
-162
project.pbxproj
redstar.xcodeproj/project.pbxproj
+0
-6
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
CheckPicViewController.m
redstar/Classes/Module/Check/CheckPicViewController.m
+1
-7
InspectListViewController.m
...ct/InspectList/ViewController/InspectListViewController.m
+4
-4
InspectDetailView.h
.../WordOfMouth/Inspect/InspectTask/View/InspectDetailView.h
+1
-1
InspectDetailView.m
.../WordOfMouth/Inspect/InspectTask/View/InspectDetailView.m
+11
-7
InspectTaskViewController.m
...ct/InspectTask/ViewController/InspectTaskViewController.m
+2
-1
RankDetailTableCell.h
...WordOfMouth/Ranking/RankDetail/Cell/RankDetailTableCell.h
+3
-0
WorkModel.h
...Function/WordOfMouth/Ranking/RankDetail/Model/WorkModel.h
+0
-23
WorkModel.m
...Function/WordOfMouth/Ranking/RankDetail/Model/WorkModel.m
+0
-26
RankDetailHeaderView.h
...ordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.h
+3
-0
RankDetailHeaderView.m
...ordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.m
+19
-3
RankHeadView.h
...nction/WordOfMouth/Ranking/RankDetail/View/RankHeadView.h
+2
-2
RankHeadView.m
...nction/WordOfMouth/Ranking/RankDetail/View/RankHeadView.m
+10
-9
RankDetailViewController.h
...king/RankDetail/ViewController/RankDetailViewController.h
+2
-0
RankDetailViewController.m
...king/RankDetail/ViewController/RankDetailViewController.m
+97
-42
RankingListCell.m
...on/WordOfMouth/Ranking/RankingList/Cell/RankingListCell.m
+4
-0
RankingListViewController.m
...ng/RankingList/ViewController/RankingListViewController.m
+5
-1
HomeViewController.m
...r/Classes/Module/Home/ViewController/HomeViewController.m
+102
-30
No files found.
redstar.xcodeproj/project.pbxproj
View file @
810ea6c9
...
...
@@ -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 */
,
...
...
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
810ea6c9
No preview for this file type
redstar/Classes/Module/Check/CheckPicViewController.m
View file @
810ea6c9
...
...
@@ -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.
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectList/ViewController/InspectListViewController.m
View file @
810ea6c9
...
...
@@ -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
];
}
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailView.h
View file @
810ea6c9
...
...
@@ -28,6 +28,6 @@
@property
(
nonatomic
,
strong
)
UILabel
*
dayLabel
;
// 剩余天数
@property
(
nonatomic
,
strong
)
UIView
*
alreadyView
;
@property
(
nonatomic
,
strong
)
UI
Image
View
*
alreadyView
;
@property
(
nonatomic
,
strong
)
UIView
*
allView
;
@end
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/View/InspectDetailView.m
View file @
810ea6c9
...
...
@@ -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
-
(
UI
Image
View
*
)
alreadyView
{
if
(
!
_alreadyView
)
{
_alreadyView
=
[[
UIView
alloc
]
init
];
_alreadyView
=
[[
UI
Image
View
alloc
]
init
];
_alreadyView
.
layer
.
cornerRadius
=
3
;
_alreadyView
.
layer
.
masksToBounds
=
YES
;
_alreadyView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectTask/ViewController/InspectTaskViewController.m
View file @
810ea6c9
...
...
@@ -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
// 返回上一页面
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/Cell/RankDetailTableCell.h
View file @
810ea6c9
...
...
@@ -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
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/Model/WorkModel.h
deleted
100644 → 0
View file @
1cc64c97
//
// 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
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/Model/WorkModel.m
deleted
100644 → 0
View file @
1cc64c97
//
// 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
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.h
View file @
810ea6c9
...
...
@@ -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
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/View/RankDetailHeaderView.m
View file @
810ea6c9
...
...
@@ -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
{
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/View/RankHeadView.h
View file @
810ea6c9
...
...
@@ -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
;
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/View/RankHeadView.m
View file @
810ea6c9
...
...
@@ -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
)
set
Work
:
(
WorkModel
*
)
work
-
(
void
)
set
TaskGroup
:
(
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
.
0
f
]}
range
:
NSMakeRange
(
0
,
scoreAttr
.
length
-
1
)];
[
scoreAttr
addAttributes
:@{
NSForegroundColorAttributeName
:
kDetailSmallTitleColor
,
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
14
.
0
f
]}
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
.
0
f
]}
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
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/ViewController/RankDetailViewController.h
View file @
810ea6c9
...
...
@@ -10,5 +10,7 @@
@interface
RankDetailViewController
:
UIViewController
@property
(
nonatomic
,
assign
)
NSInteger
indexRow
;
@property
(
nonatomic
,
copy
)
NSString
*
uuid
;
@property
(
nonatomic
,
copy
)
NSString
*
store_uuid
;
@end
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankDetail/ViewController/RankDetailViewController.m
View file @
810ea6c9
...
...
@@ -11,7 +11,15 @@
#import "RankDetailHeaderView.h"
#import "RankHeadView.h"
#import "WorkModel.h"
#import <MBProgressHUD.h>
#import "HttpClient.h"
#import "TaskGroup.h"
#import "TaskModel.h"
#import "TaskDetailModel.h"
#import "CheckPicViewController.h"
#import <UIButton+WebCache.h>
#define kRankDetailCell @"RankDetailTableCell"
...
...
@@ -20,11 +28,10 @@
@property
(
nonatomic
,
strong
)
RankDetailHeaderView
*
rankDetailHeaderView
;
@property
(
nonatomic
,
strong
)
NS
Array
*
wor
kData
;
@property
(
nonatomic
,
strong
)
NS
MutableArray
*
tas
kData
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
selectedIndexes
;
// 存放二次展开的cell
@end
@implementation
RankDetailViewController
...
...
@@ -42,6 +49,13 @@
self
.
view
.
backgroundColor
=
[
UIColor
lightGrayColor
];
if
([[[
UIDevice
currentDevice
]
systemVersion
]
floatValue
]
>=
7
.
0
)
{
self
.
edgesForExtendedLayout
=
UIRectEdgeNone
;
self
.
extendedLayoutIncludesOpaqueBars
=
NO
;
self
.
modalPresentationCapturesStatusBarAppearance
=
NO
;
self
.
navigationController
.
navigationBar
.
translucent
=
NO
;
}
UILabel
*
customLab
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
40
,
30
)];
[
customLab
setTextColor
:[
UIColor
whiteColor
]];
[
customLab
setText
:
@"口碑详情"
];
...
...
@@ -56,11 +70,10 @@
self
.
navigationItem
.
leftBarButtonItem
=
backItem
;
// 添加tableView
[
self
addTableView
];
// 初始化容器
self
.
selectedIndexes
=
[[
NSMutableDictionary
alloc
]
init
];
// 请求口碑排名详情
[
self
requestRankingDetail
];
}
...
...
@@ -70,25 +83,38 @@
}
#pragma mark - Private Methods
-
(
void
)
addTableView
{
NSURL
*
url
=
[[
NSBundle
mainBundle
]
URLForResource
:
@"ranking.plist"
withExtension
:
nil
];
NSArray
*
tempArray
=
[
NSArray
arrayWithContentsOfURL
:
url
];
NSMutableArray
*
workArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
tempArray
)
{
WorkModel
*
work
=
[
WorkModel
workModelWithDict
:
dict
];
[
workArray
addObject
:
work
];
}
_workData
=
workArray
;
-
(
void
)
requestRankingDetail
{
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@/%@"
,
kRedStarURL
,
kInspectDetailURL
,
self
.
uuid
,
self
.
store_uuid
];
NSLog
(
@"url = %@"
,
url
);
HttpClient
*
httpClient
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
self
.
tableView
.
tableHeaderView
=
self
.
rankDetailHeaderView
;
[
self
setupScrollView
];
// 注册cell
[
self
.
tableView
registerClass
:[
RankDetailTableCell
class
]
forCellReuseIdentifier
:
kRankDetailCell
];
[
httpClient
getPraiseDetailWithParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"口碑巡检明细PraiseDetail = %@"
,
response
);
NSDictionary
*
dataDict
=
response
[
@"data"
];
TaskDetailModel
*
taskDetail
=
[
TaskDetailModel
taskDetailModelWithDict
:
dataDict
];
self
.
rankDetailHeaderView
.
taskDetail
=
taskDetail
;
NSArray
*
dataArray
=
dataDict
[
@"categories"
];
NSMutableArray
*
tgArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
dataArray
)
{
TaskGroup
*
taskGroup
=
[
TaskGroup
taskGroupWithDict
:
dict
];
[
tgArray
addObject
:
taskGroup
];
}
_taskData
=
tgArray
;
self
.
tableView
.
tableHeaderView
=
self
.
rankDetailHeaderView
;
[
self
.
tableView
registerClass
:[
RankDetailTableCell
class
]
forCellReuseIdentifier
:
kRankDetailCell
];
[
self
setupScrollView
];
}];
}
// 返回上一页面
-
(
void
)
doBack
:
(
UIBarButtonItem
*
)
sender
{
...
...
@@ -106,14 +132,16 @@
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
[
button
setImage
:[
UIImage
imageNamed
:[
NSString
stringWithFormat
:
@"0%d"
,
i
]]
forState
:
UIControlStateNormal
];
button
.
frame
=
CGRectMake
(
i
*
imageViewW
+
2
,
2
,
imageViewW
-
2
*
marginW
,
imageViewH
);
[
button
addTarget
:
self
action
:
@selector
(
ccilck
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
button
addTarget
:
self
action
:
@selector
(
showBigPic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
rankDetailHeaderView
.
rankDetailView
.
showScrollView
addSubview
:
button
];
}
}
-
(
void
)
ccilck
-
(
void
)
showBigPic
:
(
UIButton
*
)
btn
{
NSLog
(
@"test"
);
CheckPicViewController
*
checkVC
=
[[
CheckPicViewController
alloc
]
init
];
checkVC
.
checkImage
=
btn
.
imageView
.
image
;
[
self
.
navigationController
pushViewController
:
checkVC
animated
:
YES
];
}
...
...
@@ -135,12 +163,45 @@
cell
.
arrowImageView
.
transform
=
CGAffineTransformIdentity
;
cell
.
arrowImageView
.
transform
=
CGAffineTransformMakeRotation
(
M_PI
/
2
);
}];
NSArray
*
imgaeUrlArray
=
cell
.
task
.
answerAttachments
;
NSMutableArray
*
urlArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
imageUrlDict
in
imgaeUrlArray
)
{
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@%@"
,
kRedStarURL
,
imageUrlDict
[
@"fileUrl"
]];
[
urlArray
addObject
:
urlStr
];
}
CGFloat
marginW
=
5
.
0
;
CGFloat
imageViewW
=
90
+
2
*
marginW
;
cell
.
scrollView
=
[[
UIScrollView
alloc
]
init
];
cell
.
scrollView
.
backgroundColor
=
[
UIColor
lightGrayColor
];
cell
.
scrollView
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
cell
.
scrollView
.
contentSize
=
CGSizeMake
((
urlArray
.
count
-
1
)
*
imageViewW
,
65
);
[
cell
.
contentView
addSubview
:
cell
.
scrollView
];
for
(
int
i
=
0
;
i
<
urlArray
.
count
;
i
++
)
{
UIButton
*
button
=
[[
UIButton
alloc
]
init
];
button
.
translatesAutoresizingMaskIntoConstraints
=
NO
;
NSString
*
urlStr
=
[
NSString
stringWithFormat
:
@"%@"
,
urlArray
[
i
]];
NSURL
*
url
=
[
NSURL
URLWithString
:
urlStr
];
[
button
sd_setImageWithURL
:
url
forState
:
UIControlStateNormal
placeholderImage
:
[
UIImage
imageNamed
:
@"default_pic"
]];
[
button
addTarget
:
self
action
:
@selector
(
showBigPic
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
cell
.
scrollView
addSubview
:
button
];
NSLayoutConstraint
*
urlTop
=
[
NSLayoutConstraint
constraintWithItem
:
button
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
scrollView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
0
];
[
cell
.
scrollView
addConstraint
:
urlTop
];
NSLayoutConstraint
*
urlLeft
=
[
NSLayoutConstraint
constraintWithItem
:
button
attribute
:
NSLayoutAttributeLeft
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
scrollView
attribute
:
NSLayoutAttributeLeft
multiplier
:
1
.
0
constant
:
i
*
imageViewW
];
[
cell
.
scrollView
addConstraint
:
urlLeft
];
NSLayoutConstraint
*
urlWidth
=
[
NSLayoutConstraint
constraintWithItem
:
button
attribute
:
NSLayoutAttributeWidth
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
imageViewW
];
[
cell
.
scrollView
addConstraint
:
urlWidth
];
NSLayoutConstraint
*
urlHeight
=
[
NSLayoutConstraint
constraintWithItem
:
button
attribute
:
NSLayoutAttributeHeight
relatedBy
:
NSLayoutRelationEqual
toItem
:
nil
attribute
:
NSLayoutAttributeNotAnAttribute
multiplier
:
1
.
0
constant
:
65
];
[
cell
.
scrollView
addConstraint
:
urlHeight
];
}
NSLayoutConstraint
*
someoneTop
=
[
NSLayoutConstraint
constraintWithItem
:
cell
.
scrollView
attribute
:
NSLayoutAttributeTop
relatedBy
:
NSLayoutRelationEqual
toItem
:
cell
.
contentView
attribute
:
NSLayoutAttributeTop
multiplier
:
1
.
0
constant
:
45
];
[
cell
.
contentView
addConstraint
:
someoneTop
];
...
...
@@ -179,13 +240,13 @@
#pragma mark - UITableView DataSource/Delegate
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
_
wor
kData
.
count
;
return
_
tas
kData
.
count
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
WorkModel
*
work
=
_wor
kData
[
section
];
NSInteger
count
=
work
.
isOpened
?
work
.
Info
.
count
:
0
;
TaskGroup
*
taskGroup
=
_tas
kData
[
section
];
NSInteger
count
=
taskGroup
.
isOpened
?
taskGroup
.
answers
.
count
:
0
;
return
count
;
}
...
...
@@ -197,13 +258,15 @@
cell
=
[[
RankDetailTableCell
alloc
]
initWithStyle
:
UITableViewCellStyleValue1
reuseIdentifier
:
kRankDetailCell
];
}
WorkModel
*
workModel
=
_workData
[
indexPath
.
section
];
NSDictionary
*
dict
=
workModel
.
Info
[
indexPath
.
row
];
TaskGroup
*
taskGroup
=
_taskData
[
indexPath
.
section
];
TaskModel
*
task
=
taskGroup
.
answers
[
indexPath
.
row
];
cell
.
task
=
task
;
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
[
cell
.
mainTitleBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d、%@"
,
(
int
)(
indexPath
.
row
+
1
)
,
dict
[
@"titles"
]
]
forState
:
UIControlStateNormal
];
cell
.
scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@分"
,
dict
[
@"scroes"
]
];
[
cell
.
mainTitleBtn
setTitle
:[
NSString
stringWithFormat
:
@"%d、%@"
,
(
int
)(
indexPath
.
row
+
1
)
,
task
.
title
]
forState
:
UIControlStateNormal
];
cell
.
scoreLabel
.
text
=
[
NSString
stringWithFormat
:
@"%@分"
,
task
.
score
];
// 按钮点击事件
[
cell
.
mainTitleBtn
addTarget
:
self
action
:
@selector
(
showScrollView
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
...
...
@@ -244,8 +307,7 @@
{
RankHeadView
*
headView
=
[
RankHeadView
headViewWithTableView
:
tableView
];
headView
.
delegate
=
self
;
headView
.
work
=
_workData
[
section
];
headView
.
taskGroup
=
_taskData
[
section
];
return
headView
;
}
...
...
@@ -287,13 +349,6 @@
{
if
(
!
_rankDetailHeaderView
)
{
_rankDetailHeaderView
=
[[
RankDetailHeaderView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
kScreenWidth
,
298
)];
_rankDetailHeaderView
.
rankDetailView
.
addressLabel
.
text
=
@"上海市真北路1108号"
;
_rankDetailHeaderView
.
rankDetailView
.
titleLabel
.
text
=
@"2015年8月口碑巡检"
;
_rankDetailHeaderView
.
rankDetailView
.
reportTimeLabel
.
text
=
@"上报时间"
;
_rankDetailHeaderView
.
rankDetailView
.
totalScoreLabel
.
text
=
@"总评分"
;
_rankDetailHeaderView
.
rankDetailView
.
totalGradeLabel
.
text
=
@"总排名"
;
_rankDetailHeaderView
.
rankDetailView
.
timeLabel
.
text
=
@"2015-08-15"
;
_rankDetailHeaderView
.
rankDetailView
.
scoreLabel
.
text
=
@"100"
;
if
(
self
.
indexRow
<
3
)
{
NSString
*
imageName
=
[
NSString
stringWithFormat
:
@"medal_0%ld"
,
(
long
)(
_indexRow
+
1
)];
_rankDetailHeaderView
.
rankDetailView
.
gradeImageView
.
image
=
[
UIImage
imageNamed
:
imageName
];
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/Cell/RankingListCell.m
View file @
810ea6c9
...
...
@@ -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
{
...
...
redstar/Classes/Module/Function/WordOfMouth/Ranking/RankingList/ViewController/RankingListViewController.m
View file @
810ea6c9
...
...
@@ -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
];
}
...
...
redstar/Classes/Module/Home/ViewController/HomeViewController.m
View file @
810ea6c9
...
...
@@ -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
];
}
...
...
@@ -568,7 +640,7 @@
return
40
;
}
else
{
if
([
self
cellIsSelected
:
indexPath
])
{
return
108
;
return
108
;
}
return
50
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment