Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
X
xffruit
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
张杰
xffruit
Commits
56854198
Commit
56854198
authored
Jan 28, 2016
by
AvatarC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报表: modify 日周月的oneCliced 以日为标准
如果选了日,再选周、选月。则周、月对于的是日所在的。如果单独重选了周,则选月、选日,不变。。。。。
parent
d8597a3a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
16 deletions
+50
-16
Info.plist
XFFruit/Info.plist
+2
-2
IBTCommon.h
XFFruit/Utilities/IBTUIKit/IBTCommon.h
+3
-0
IBTCommon.m
XFFruit/Utilities/IBTUIKit/IBTCommon.m
+24
-1
ReportViewController.m
...ViewControllers/Report/Controllers/ReportViewController.m
+21
-13
No files found.
XFFruit/Info.plist
View file @
56854198
...
@@ -15,11 +15,11 @@
...
@@ -15,11 +15,11 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.2.
0
<
/string
>
<
string
>
1.2.
1
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
1.2.
0
<
/string
>
<
string
>
1.2.
1
<
/string
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
k
e
y
>
NSAppTransportSecurity
<
/k
e
y
>
<
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
<
k
e
y
>
NSAllowsArbitraryLoads
<
/k
e
y
>
...
...
XFFruit/Utilities/IBTUIKit/IBTCommon.h
View file @
56854198
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
+
(
NSDate
*
)
convertToDateFrom
:(
NSString
*
)
dateString
;
+
(
NSDate
*
)
convertToDateFrom
:(
NSString
*
)
dateString
;
+
(
NSString
*
)
stringFromDate
:(
NSDate
*
)
aDate
;
+
(
NSString
*
)
stringFromDate
:(
NSDate
*
)
aDate
;
+
(
NSString
*
)
stringFromDateWithFormat
:(
NSDate
*
)
aDate
format
:(
NSString
*
)
format
;
+
(
NSString
*
)
stringFromDateWithFormat
:(
NSDate
*
)
aDate
format
:(
NSString
*
)
format
;
+
(
NSDate
*
)
dateFromStringWithFormat
:(
NSString
*
)
aStr
format
:(
NSString
*
)
format
;
+
(
NSString
*
)
dictionaryToJson
:(
id
)
dic
;
+
(
NSString
*
)
dictionaryToJson
:(
id
)
dic
;
+
(
NSString
*
)
checkString
:(
NSString
*
)
str
;
+
(
NSString
*
)
checkString
:(
NSString
*
)
str
;
+
(
NSString
*
)
checkNull
:
(
id
)
data
;
+
(
NSString
*
)
checkNull
:
(
id
)
data
;
...
@@ -48,6 +50,7 @@
...
@@ -48,6 +50,7 @@
+
(
UIButton
*
)
buttonWithTitle
:(
NSString
*
)
title
Image
:(
UIImage
*
)
image
frame
:(
CGRect
)
frame
fontSize
:(
float
)
fontSize
fontColor
:(
UIColor
*
)
color
;
+
(
UIButton
*
)
buttonWithTitle
:(
NSString
*
)
title
Image
:(
UIImage
*
)
image
frame
:(
CGRect
)
frame
fontSize
:(
float
)
fontSize
fontColor
:(
UIColor
*
)
color
;
+
(
UIButton
*
)
buttonWithImage
:(
UIImage
*
)
image
frame
:(
CGRect
)
frame
;
+
(
UIButton
*
)
buttonWithImage
:(
UIImage
*
)
image
frame
:(
CGRect
)
frame
;
+
(
NSString
*
)
getWeekFromDate
;
+
(
NSString
*
)
getWeekFromDate
;
+
(
NSString
*
)
getWeekFromDateWithDate
:
(
NSDate
*
)
date
;
+
(
NSInteger
)
getWeeks
:(
NSInteger
)
year
;
+
(
NSInteger
)
getWeeks
:(
NSInteger
)
year
;
+
(
NSString
*
)
weekdayStringFromDate
:(
NSDate
*
)
inputDate
;
+
(
NSString
*
)
weekdayStringFromDate
:(
NSDate
*
)
inputDate
;
+
(
NSString
*
)
countNumAndChangeformat
:(
NSString
*
)
num
;
+
(
NSString
*
)
countNumAndChangeformat
:(
NSString
*
)
num
;
...
...
XFFruit/Utilities/IBTUIKit/IBTCommon.m
View file @
56854198
...
@@ -192,7 +192,12 @@
...
@@ -192,7 +192,12 @@
NSString
*
dateString
=
[
formatter
stringFromDate
:
aDate
];
NSString
*
dateString
=
[
formatter
stringFromDate
:
aDate
];
return
dateString
;
return
dateString
;
}
}
+
(
NSDate
*
)
dateFromStringWithFormat
:
(
NSString
*
)
aStr
format
:
(
NSString
*
)
format
{
NSDateFormatter
*
formatter
=
[[
NSDateFormatter
alloc
]
init
];
[
formatter
setDateFormat
:
format
];
NSDate
*
date
=
[
formatter
dateFromString
:
aStr
];
return
date
;
}
+
(
NSString
*
)
dictionaryToJson
:
(
id
)
dic
+
(
NSString
*
)
dictionaryToJson
:
(
id
)
dic
{
{
...
@@ -332,6 +337,24 @@
...
@@ -332,6 +337,24 @@
return
yearWeek
;
return
yearWeek
;
}
}
+
(
NSString
*
)
getWeekFromDateWithDate
:
(
NSDate
*
)
date
{
NSString
*
yearWeek
=
@""
;
NSCalendar
*
greCalendar
=
[[
NSCalendar
alloc
]
initWithCalendarIdentifier
:
NSGregorianCalendar
];
NSDateComponents
*
dateComponents
=
[
greCalendar
components
:
NSYearCalendarUnit
|
NSMonthCalendarUnit
|
NSDayCalendarUnit
|
NSHourCalendarUnit
|
NSMinuteCalendarUnit
|
NSSecondCalendarUnit
|
NSWeekCalendarUnit
|
NSWeekdayCalendarUnit
|
NSWeekOfMonthCalendarUnit
|
NSWeekOfYearCalendarUnit
fromDate
:
date
];
NSString
*
yearStr
=
[
IBTCommon
stringFromDateWithFormat
:
date
format
:
@"yyyy-MM-dd"
];
NSString
*
year
=
[
yearStr
substringToIndex
:
4
];
NSString
*
month
=
[
yearStr
substringWithRange
:
NSMakeRange
(
5
,
2
)];
if
(
dateComponents
.
weekOfYear
==
1
&&
[
month
isEqualToString
:
@"12"
])
{
yearWeek
=
[
NSString
stringWithFormat
:
@"%ld-%ld"
,
[
year
integerValue
]
+
1
,(
long
)
dateComponents
.
weekOfYear
];
}
else
{
yearWeek
=
[
NSString
stringWithFormat
:
@"%ld-%ld"
,
(
long
)[
year
integerValue
]
,(
long
)
dateComponents
.
weekOfYear
];
}
return
yearWeek
;
}
+
(
NSInteger
)
getWeeks
:
(
NSInteger
)
year
{
+
(
NSInteger
)
getWeeks
:
(
NSInteger
)
year
{
NSInteger
weeks
=
0
;
NSInteger
weeks
=
0
;
NSString
*
dateStr
=
[
NSString
stringWithFormat
:
@"%ld-12-31 00:00:00"
,(
long
)
year
];
NSString
*
dateStr
=
[
NSString
stringWithFormat
:
@"%ld-12-31 00:00:00"
,(
long
)
year
];
...
...
XFFruit/ViewControllers/Report/Controllers/ReportViewController.m
View file @
56854198
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
@property
(
nonatomic
,
assign
)
NSInteger
storeCount
;
@property
(
nonatomic
,
assign
)
NSInteger
storeCount
;
@property
(
nonatomic
,
strong
)
NSIndexPath
*
currentIndex
;
@property
(
nonatomic
,
strong
)
NSIndexPath
*
currentIndex
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
selectArr
;
//@property (nonatomic, assign) BOOL isSegOne;
@end
@end
...
@@ -67,7 +68,6 @@
...
@@ -67,7 +68,6 @@
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
// self.isSegOne = NO;
//布局
//布局
#if 1
#if 1
self
.
dataArr
=
[
NSMutableArray
array
];
self
.
dataArr
=
[
NSMutableArray
array
];
...
@@ -122,13 +122,13 @@
...
@@ -122,13 +122,13 @@
};
};
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
[
IBTLoadingView
showProgressLabel
:
@"正在加载..."
];
NSString
*
strDate
;
if
(
self
.
scopeType
)
{
NSDate
*
date
;
strDate
=
_scopeType
;
if
(
!
_selectDay
)
{
}
else
{
self
.
selectDay
=
[[
NSDate
date
]
localYMDString
];
strDate
=
[[
NSDate
date
]
localYMDString
];
}
}
[[
ICRHTTPController
sharedController
]
getWeekbydayWithStringDate
:
strDate
success
:
succ
failure
:
fail
];
date
=
[
IBTCommon
dateFromStringWithFormat
:
_selectDay
format
:
@"yyyy-MM-dd"
];
[[
ICRHTTPController
sharedController
]
getWeekbydayWithStringDate
:[
date
localYMDString
]
success
:
succ
failure
:
fail
];
}
}
#pragma mark - 获取上部数据
#pragma mark - 获取上部数据
...
@@ -352,6 +352,13 @@
...
@@ -352,6 +352,13 @@
#pragma mark - segViewDelegate
#pragma mark - segViewDelegate
-
(
void
)
customSegOneClick
:
(
NSString
*
)
title
{
-
(
void
)
customSegOneClick
:
(
NSString
*
)
title
{
NSDate
*
date
;
if
(
!
_selectDay
)
{
self
.
selectDay
=
[[
NSDate
date
]
localYMDString
];
//
}
date
=
[
IBTCommon
dateFromStringWithFormat
:
_selectDay
format
:
@"yyyy-MM-dd"
];
// NSString *strDate = [_selectDay substringToIndex:_selectDay.length - 3];
//日周年切换
//日周年切换
NSString
*
dayType
=
@""
;
NSString
*
dayType
=
@""
;
if
([
title
isEqualToString
:
SaleWeek
])
{
if
([
title
isEqualToString
:
SaleWeek
])
{
...
@@ -364,13 +371,14 @@
...
@@ -364,13 +371,14 @@
if
([
title
isEqualToString
:
SaleDay
])
{
if
([
title
isEqualToString
:
SaleDay
])
{
dayType
=
@"day"
;
dayType
=
@"day"
;
self
.
scopeType
=
[
IBTCommon
stringFromDateWithFormat
:[
NSDate
date
]
format
:
@"yyyy-MM-dd"
];
self
.
scopeType
=
_selectDay
;
//
[IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM-dd"];
//
}else if ([title isEqualToString:SaleWeek]) {
}
else
if
([
title
isEqualToString
:
SaleWeek
])
{
//
dayType = @"week";
dayType
=
@"week"
;
// self.scopeType = [IBTCommon getWeekFromD
ate];
self
.
scopeType
=
[
IBTCommon
getWeekFromDateWithDate
:
d
ate
];
}
else
if
([
title
isEqualToString
:
SaleMonth
])
{
}
else
if
([
title
isEqualToString
:
SaleMonth
])
{
dayType
=
@"month"
;
dayType
=
@"month"
;
self
.
scopeType
=
[
IBTCommon
stringFromDateWithFormat
:[
NSDate
date
]
format
:
@"yyyy-MM"
];
// date = [IBTCommon dateFromStringWithFormat:strDate format:@"yyyy-MM" ];
self
.
scopeType
=
[
IBTCommon
stringFromDateWithFormat
:
date
format
:
@"yyyy-MM"
];
}
else
{
}
else
{
return
;
return
;
}
}
...
...
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