Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
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
张杰
万科
Commits
1387bc58
Commit
1387bc58
authored
Nov 18, 2015
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交列表界面
parent
4bcf1b6c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
395 additions
and
113 deletions
+395
-113
VankeSettlementListAPI.h
vanke/controller/VankeSettlementListAPI.h
+9
-6
VankeSettlementListAPI.m
vanke/controller/VankeSettlementListAPI.m
+89
-52
VankeStatementListModel.h
vanke/model/VankeStatementListModel.h
+6
-3
VankeStatementListModel.m
vanke/model/VankeStatementListModel.m
+12
-12
VankeAffairsBoard_iPhone.m
.../view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
+7
-7
FootLoader.m
vanke/view_iPhone/templates/common/FootLoader.m
+3
-3
FootLoader.xml
vanke/view_iPhone/templates/common/FootLoader.xml
+1
-1
VankeNoticeListBoard_iPhone.m
...iew_iPhone/templates/notice/VankeNoticeListBoard_iPhone.m
+7
-1
VankeStatementListBoard_iPhone.h
...hone/templates/statement/VankeStatementListBoard_iPhone.h
+2
-0
VankeStatementListBoard_iPhone.m
...hone/templates/statement/VankeStatementListBoard_iPhone.m
+46
-7
VankeStatementListBoard_iPhone.xml
...ne/templates/statement/VankeStatementListBoard_iPhone.xml
+11
-2
VankeStatementListItemCell_iPhone.m
...e/templates/statement/VankeStatementListItemCell_iPhone.m
+7
-2
VankeStatementListItemCell_iPhone.xml
...templates/statement/VankeStatementListItemCell_iPhone.xml
+19
-10
VankeStatementMonthCell_iPhone.h
...hone/templates/statement/VankeStatementMonthCell_iPhone.h
+12
-0
VankeStatementMonthCell_iPhone.m
...hone/templates/statement/VankeStatementMonthCell_iPhone.m
+27
-1
VankeStatementMonthCell_iPhone.xml
...ne/templates/statement/VankeStatementMonthCell_iPhone.xml
+137
-6
No files found.
vanke/controller/VankeSettlementListAPI.h
View file @
1387bc58
...
...
@@ -23,7 +23,7 @@
@interface
VankeSettlementListAPI
:
VankeBaseAPI
// 账期等于
@property
(
nonatomic
,
strong
)
NS
String
*
settleEquals
;
@property
(
nonatomic
,
strong
)
NS
Date
*
settleEquals
;
// 是否已确认
@property
(
nonatomic
,
assign
)
BOOL
confirmed
;
...
...
@@ -56,26 +56,29 @@
@property
(
nonatomic
,
strong
)
NSNumber
*
amount
;
@property
(
nonatomic
,
strong
)
NSString
*
remark
;
-
(
NSString
*
)
getPictureUrlOrDefault
;
-
(
NSString
*
)
codeName
;
@end
// 对账单合计
@interface
StatementS
ummary
:
BeeActiveObject
@interface
StatementS
hop
:
BeeActiveObject
@property
(
nonatomic
,
strong
)
NSString
*
contract
;
@property
(
nonatomic
,
strong
)
NSString
*
shopCode
;
@property
(
nonatomic
,
strong
)
NSString
*
shopName
;
@property
(
nonatomic
,
strong
)
NSString
*
picture
;
@property
(
nonatomic
,
strong
)
NSString
*
settle
;
@property
(
nonatomic
,
strong
)
NSNumber
*
amount
;
@property
(
nonatomic
,
strong
)
NSString
*
state
;
@property
(
nonatomic
,
strong
)
NSArray
*
items
;
// SubjectItem
-
(
BOOL
)
confirmed
;
-
(
NSString
*
)
getPictureUrlOrDefault
;
-
(
NSString
*
)
codeName
;
@end
// 对账单返回
@interface
StatementListResponse
:
VankeResponse
@property
(
nonatomic
,
strong
)
NSDate
*
settle
;
@property
(
nonatomic
,
strong
)
NSNumber
*
amount
;
@property
(
nonatomic
,
strong
)
Paging
*
paging
;
@property
(
nonatomic
,
strong
)
NSArray
*
records
;
// StatementSummary
...
...
vanke/controller/VankeSettlementListAPI.m
View file @
1387bc58
...
...
@@ -20,24 +20,27 @@
-
(
void
)
route
:(
BeeMessage
*
)
msg
{
if
(
self
.
sending
)
{
// if (![self checkToQuery]) {
// return;
// }
// if (![self checkToQuery]) {
// return;
// }
// [self http_get:@"/statement/query"].PARAM(@"settleEquals", self.settleEquals).PARAM(@"prjectsIn", [self.projectsIn componentsJoinedByString:@";"]).TIMEOUT(10);
// [self http_get:@"/statement/query"].PARAM(@"settleEquals", self.settleEquals).PARAM(@"prjectsIn", [self.projectsIn componentsJoinedByString:@";"]).TIMEOUT(10);
[
self
HTTP_GET
:
@"http://www.baidu.com"
].
TIMEOUT
(
10
);
}
else
if
(
self
.
succeed
)
{
NSLog
(
@"response: %@"
,
self
.
responseString
);
// self.serverResp = [StatementListResponse objectFromDictionary: self.responseJSONDictionary];
// if (nil == self.serverResp)
// {
// self.failed = YES;
// return;
// }
self
.
serverResp
=
[
StatementListResponse
fakeData
];
// self.serverResp = [StatementListResponse objectFromDictionary: self.responseJSONDictionary];
// if (nil == self.serverResp)
// {
// self.failed = YES;
// return;
// }
StatementListResponse
*
resp
=
[
StatementListResponse
fakeData
];
resp
.
settle
=
self
.
settleEquals
;
self
.
serverResp
=
resp
;
}
else
if
(
self
.
failed
)
{
NSLog
(
@"response: %@"
,
self
.
responseString
);
self
.
serverResp
=
[
StatementListResponse
objectFromDictionary
:
self
.
responseJSONDictionary
];
...
...
@@ -45,7 +48,9 @@
}
-
(
BOOL
)
checkToQuery
{
if
([
VankeUtil
isBlankString
:
self
.
settleEquals
])
{
NSDateFormatter
*
dateFormatter
=
[[
NSDateFormatter
alloc
]
init
];
[
dateFormatter
setDateFormat
:
@"yyyy-MM-dd"
];
if
([
VankeUtil
isBlankString
:[
dateFormatter
stringFromDate
:
self
.
settleEquals
]])
{
[
self
setClientError
:
@"账期不能为空"
];
return
NO
;
}
...
...
@@ -83,25 +88,16 @@
@synthesize
amount
=
_amount
;
@synthesize
remark
=
_remark
;
-
(
NSString
*
)
getPictureUrlOrDefault
{
// if ([VankeUtil isBlankString:self.picture]) {
return
@"bill.png"
;
// } else {
// return [NSString stringWithFormat:@"%@/%@", VANKE_SERVER_MEDIA_BASE_URL, self.picture];
// }
}
-
(
NSString
*
)
codeName
{
return
[
NSString
stringWithFormat
:
@"%@%@"
,
@""
,
_subject
];
}
@end
#pragma StatementS
ummary
#pragma StatementS
hop
@implementation
StatementS
ummary
@implementation
StatementS
hop
@synthesize
contract
=
_contract
;
@synthesize
shopCode
=
_shopCode
;
@synthesize
shopName
=
_shopName
;
@synthesize
picture
=
_picture
;
@synthesize
settle
=
_settle
;
@synthesize
amount
=
_amount
;
@synthesize
state
=
_state
;
...
...
@@ -109,8 +105,17 @@
CONVERT_PROPERTY_CLASS
(
items
,
SubjectItem
)
-
(
BOOL
)
confirmed
{
return
[
@"confirmed"
eq
:
_state
];
-
(
NSString
*
)
getPictureUrlOrDefault
{
return
@"bill.png"
;
// if ([VankeUtil isBlankString:self.picture]) {
// return @"bill.png";
// } else {
// return [NSString stringWithFormat:@"%@/%@", VANKE_SERVER_MEDIA_BASE_URL, self.picture];
// }
}
-
(
NSString
*
)
codeName
{
return
[
NSString
stringWithFormat
:
@"%@ %@"
,
_shopCode
,
_shopName
];
}
@end
...
...
@@ -119,50 +124,82 @@ CONVERT_PROPERTY_CLASS(items, SubjectItem)
@implementation
StatementListResponse
@synthesize
settle
=
_settle
;
@synthesize
amount
=
_amount
;
@synthesize
paging
=
_paging
;
@synthesize
records
=
_records
;
CONVERT_PROPERTY_CLASS
(
records
,
StatementS
ummary
)
CONVERT_PROPERTY_CLASS
(
records
,
StatementS
hop
)
-
(
BOOL
)
hasMore
{
return
_paging
&&
_paging
.
pageSize
<=
_paging
.
recordCount
;
}
#define ARC4RANDOM_MAX 0x100000000
+
(
NSNumber
*
)
randomDouble
{
double
val
=
floorf
(((
double
)
arc4random
()
/
ARC4RANDOM_MAX
)
*
10000
.
0
f
);
return
[
NSNumber
numberWithDouble
:
val
];
}
+
(
NSNumber
*
)
randomInt
{
double
val
=
floorf
(((
double
)
arc4random
()
/
ARC4RANDOM_MAX
)
*
10000
.
0
f
);
return
[
NSNumber
numberWithInt
:
val
];
}
+
(
instancetype
)
fakeData
{
StatementListResponse
*
resp
=
[[
StatementListResponse
alloc
]
init
];
resp
.
amount
=
[
NSNumber
numberWithInt
:
1000
];
resp
.
amount
=
[
self
randomDouble
];
Paging
*
paging
=
[[
Paging
alloc
]
init
];
paging
.
page
=
[
NSNumber
numberWithInt
:
1
];
paging
.
pageSize
=
[
NSNumber
numberWithInt
:
10
];
paging
.
pageCount
=
[
NSNumber
numberWithInt
:
10
];
paging
.
recordCount
=
[
NSNumber
numberWithInt
:
99
];
paging
.
recordCount
=
[
NSNumber
numberWithInt
:
11
];
resp
.
paging
=
paging
;
StatementSummary
*
summary
=
[[
StatementSummary
alloc
]
init
];
summary
.
contract
=
@"112233"
;
summary
.
settle
=
@"2015-12-20"
;
summary
.
amount
=
[
NSNumber
numberWithInt
:
1000
];
summary
.
state
=
@"confirmed"
;
NSMutableArray
*
ary
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
SubjectItem
*
item
=
[[
SubjectItem
alloc
]
init
];
item
.
subject
=
@"A01-01 星巴克"
;
item
.
beginDate
=
@"2015-12-01"
;
item
.
endDate
=
@"2015-12-30"
;
item
.
direction
=
[
NSNumber
numberWithInt
:
0
];
item
.
amount
=
[
NSNumber
numberWithInt
:
104001
];
item
.
remark
=
@"有意见,不同意"
;
[
ary
addObject
:
item
];
NSMutableArray
*
shops
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
for
(
int
i
=
0
;
i
<
[
paging
.
pageSize
intValue
];
++
i
)
{
StatementShop
*
summary
=
[[
StatementShop
alloc
]
init
];
summary
.
contract
=
@"112233"
;
summary
.
shopCode
=
[
NSString
stringWithFormat
:
@"%03d"
,
i
];
summary
.
shopName
=
@"肯得起"
;
summary
.
picture
=
@""
;
summary
.
settle
=
@"2015-12-20"
;
double
val
=
floorf
(((
double
)
arc4random
()
/
ARC4RANDOM_MAX
)
*
10000
.
0
f
);
summary
.
amount
=
[
NSNumber
numberWithDouble
:
val
];
val
=
arc4random
()
%
100
;
if
(
val
>
30
)
{
summary
.
state
=
@"confirmed"
;
}
else
if
(
val
>
60
)
{
summary
.
state
=
@"unconfirmed"
;
}
else
{
summary
.
state
=
@"rejected"
;
}
NSMutableArray
*
items
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
10
];
for
(
int
i
=
0
;
i
<
100
;
++
i
)
{
SubjectItem
*
item
=
[[
SubjectItem
alloc
]
init
];
item
.
subject
=
@"A01-01 星巴克"
;
item
.
beginDate
=
@"2015-12-01"
;
item
.
endDate
=
@"2015-12-30"
;
item
.
direction
=
[
NSNumber
numberWithInt
:
0
];
val
=
floorf
(((
double
)
arc4random
()
/
ARC4RANDOM_MAX
)
*
10000
.
0
f
);
if
(
arc4random
()
%
100
>
50
)
{
val
=
-
val
;
}
item
.
amount
=
[
NSNumber
numberWithDouble
:
val
];
item
.
remark
=
@"有意见,不同意"
;
[
items
addObject
:
item
];
}
summary
.
items
=
items
;
[
shops
addObject
:
summary
];
}
summary
.
items
=
ary
;
NSMutableArray
*
ary2
=
[[
NSMutableArray
alloc
]
initWithCapacity
:
1
];
[
ary2
addObject
:
summary
];
resp
.
records
=
ary2
;
resp
.
records
=
shops
;
return
resp
;
}
...
...
vanke/model/VankeStatementListModel.h
View file @
1387bc58
...
...
@@ -12,7 +12,7 @@
@interface
VankeStatementListModel
:
BeeStreamViewModel
// 账期等于
@property
(
nonatomic
,
strong
)
NS
String
*
settleEquals
;
@property
(
nonatomic
,
strong
)
NS
Date
*
settleEquals
;
// 是否已确认
@property
(
nonatomic
,
assign
)
BOOL
confirmed
;
...
...
@@ -23,8 +23,11 @@
// 商铺名称或代码类似于
@property
(
nonatomic
,
strong
)
NSString
*
shopNameOrCodeLike
;
// 对账单列表
@property
(
nonatomic
,
strong
)
NSMutableArray
*
items
;
// SubjectItem
// 商户列表
@property
(
nonatomic
,
strong
)
NSMutableArray
*
shops
;
// StatementShop
// 最后一次响应结果
@property
(
nonatomic
,
strong
)
StatementListResponse
*
lastResp
;
-
(
NSInteger
)
count
;
...
...
vanke/model/VankeStatementListModel.m
View file @
1387bc58
...
...
@@ -17,13 +17,14 @@
@synthesize
confirmed
=
_confirmed
;
@synthesize
projectsIn
=
_projectsIn
;
@synthesize
shopNameOrCodeLike
=
_shopNameOrCodeLike
;
@synthesize
items
=
_items
;
@synthesize
shops
=
_shops
;
@synthesize
lastResp
=
_lastResp
;
-
(
void
)
load
{
self
.
autoSave
=
YES
;
self
.
autoLoad
=
YES
;
self
.
item
s
=
[
NSMutableArray
array
];
self
.
shop
s
=
[
NSMutableArray
array
];
}
-
(
void
)
unload
...
...
@@ -32,7 +33,7 @@
self
.
confirmed
=
nil
;
self
.
projectsIn
=
nil
;
self
.
shopNameOrCodeLike
=
nil
;
self
.
item
s
=
nil
;
self
.
shop
s
=
nil
;
}
#pragma mark - paging query
...
...
@@ -44,9 +45,9 @@
-
(
void
)
nextPage
{
if
(
self
.
item
s
.
count
)
if
(
self
.
shop
s
.
count
)
{
[
self
gotoPage
:(
self
.
item
s
.
count
/
PER_PAGE
+
1
)];
[
self
gotoPage
:(
self
.
shop
s
.
count
/
PER_PAGE
+
1
)];
}
}
...
...
@@ -77,24 +78,23 @@
if
(
api
.
succeed
)
{
StatementListResponse
*
resp
=
(
StatementListResponse
*
)
api
.
serverResp
;
self
.
lastResp
=
resp
;
if
(
nil
==
resp
||
nil
==
resp
.
records
)
{
api
.
failed
=
YES
;
}
else
{
NSArray
*
records
=
resp
.
records
;
StatementSummary
*
firstRecord
=
(
StatementSummary
*
)
[
records
objectAtIndex
:
0
];
if
(
page
<=
1
)
{
[
self
.
item
s
removeAllObjects
];
[
self
.
items
addObjectsFromArray
:
firstRecord
.
item
s
];
[
self
.
shop
s
removeAllObjects
];
[
self
.
shops
addObjectsFromArray
:
resp
.
record
s
];
}
else
{
[
self
.
items
addObjectsFromArray
:
firstRecord
.
item
s
];
[
self
.
item
s
unique
:
^
NSComparisonResult
(
id
left
,
id
right
)
{
return
[((
S
ubjectItem
*
)
left
).
subject
compare
:((
SubjectItem
*
)
right
).
subject
];
[
self
.
shops
addObjectsFromArray
:
resp
.
record
s
];
[
self
.
shop
s
unique
:
^
NSComparisonResult
(
id
left
,
id
right
)
{
return
[((
S
tatementShop
*
)
left
).
shopCode
compare
:((
StatementShop
*
)
right
).
shopCode
];
}];
}
...
...
vanke/view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
View file @
1387bc58
...
...
@@ -16,6 +16,7 @@
//
#import "VankeAffairsBoard_iPhone.h"
#import "VankeUtil.h"
#import "VankeNoticeListBoard_iPhone.h"
#import "VankeStatementListBoard_iPhone.h"
...
...
@@ -51,13 +52,6 @@ ON_CREATE_VIEWS( signal )
{
self
.
navigationBarShown
=
YES
;
self
.
navigationBarTitle
=
@"事务"
;
UIColor
*
color
=
[
UIColor
colorWithRed
:
237
/
255
.
0
green
:
27
/
255
.
0
blue
:
35
/
255
.
0
alpha
:
1
.
0
];
if
(
IOS7_OR_LATER
)
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
color
;
}
else
{
self
.
navigationController
.
navigationBar
.
tintColor
=
color
;
}
}
ON_DELETE_VIEWS
(
signal
)
...
...
@@ -70,6 +64,12 @@ ON_LAYOUT_VIEWS( signal )
ON_WILL_APPEAR
(
signal
)
{
UIColor
*
color
=
[
VankeUtil
rgbStringToColor
:
@"237,27,35"
];
if
(
IOS7_OR_LATER
)
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
color
;
}
else
{
self
.
navigationController
.
navigationBar
.
tintColor
=
color
;
}
}
ON_DID_APPEAR
(
signal
)
...
...
vanke/view_iPhone/templates/common/FootLoader.m
View file @
1387bc58
...
...
@@ -39,7 +39,7 @@ ON_SIGNAL3( BeeUIFootLoader, STATE_CHANGED, signal )
{
self
.
alpha
=
1
.
0
f
;
self
.
indicator
.
animating
=
YES
;
self
.
state
.
data
=
@"
Loading
..."
;
self
.
state
.
data
=
@"
正在加载中
..."
;
}
else
{
...
...
@@ -48,12 +48,12 @@ ON_SIGNAL3( BeeUIFootLoader, STATE_CHANGED, signal )
if
(
self
.
more
)
{
self
.
alpha
=
1
.
0
f
;
self
.
state
.
data
=
@"
Click to load more
"
;
self
.
state
.
data
=
@"
点击加载更多
"
;
}
else
{
self
.
alpha
=
0
.
0
f
;
self
.
state
.
data
=
@"
No more
"
;
self
.
state
.
data
=
@"
没有数据了
"
;
}
}
...
...
vanke/view_iPhone/templates/common/FootLoader.xml
View file @
1387bc58
...
...
@@ -25,7 +25,7 @@
width: 100%;
height: 100%;
font: 13, lighter;
text-color: #fff
;
text-color: #ccc
;
text-align: center;
}
</style>
...
...
vanke/view_iPhone/templates/notice/VankeNoticeListBoard_iPhone.m
View file @
1387bc58
...
...
@@ -148,8 +148,14 @@ ON_WILL_APPEAR( signal )
[
self
.
model
firstPage
];
}
UIColor
*
color
=
[
VankeUtil
rgbStringToColor
:
@"102,160,255"
];
if
(
IOS7_OR_LATER
)
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
color
;
}
else
{
self
.
navigationController
.
navigationBar
.
tintColor
=
color
;
}
[
BeeUIRouter
sharedInstance
].
view
.
pannable
=
YES
;
}
ON_DID_APPEAR
(
signal
)
...
...
vanke/view_iPhone/templates/statement/VankeStatementListBoard_iPhone.h
View file @
1387bc58
...
...
@@ -18,6 +18,7 @@
#import "Bee.h"
#import "VankeBaseBoard.h"
#import "VankeStatementListModel.h"
#import "VankeStatementMonthCell_iPhone.h"
#pragma mark -
...
...
@@ -27,5 +28,6 @@ AS_MODEL( VankeStatementListModel, model )
AS_OUTLET
(
BeeUIScrollView
,
list
)
AS_OUTLET
(
BeeUISearchBar
,
searchBar
)
AS_OUTLET
(
VankeStatementMonthCell_iPhone
,
settlementBar
)
@end
vanke/view_iPhone/templates/statement/VankeStatementListBoard_iPhone.m
View file @
1387bc58
...
...
@@ -39,6 +39,7 @@ SUPPORT_RESOURCE_LOADING( YES )
DEF_MODEL
(
VankeStatementListModel
,
model
)
DEF_OUTLET
(
BeeUIScrollView
,
list
)
DEF_OUTLET
(
BeeUISearchBar
,
searchBar
)
DEF_OUTLET
(
VankeStatementMonthCell_iPhone
,
settlementBar
)
-
(
void
)
load
{
...
...
@@ -60,6 +61,13 @@ ON_CREATE_VIEWS( signal )
self
.
allowedSwipeToBack
=
YES
;
self
.
title
=
@"对账单"
;
UIColor
*
color
=
[
VankeUtil
rgbStringToColor
:
@"144,76,245"
];
if
(
IOS7_OR_LATER
)
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
color
;
}
else
{
self
.
navigationController
.
navigationBar
.
tintColor
=
color
;
}
self
.
list
.
headerClass
=
[
PullLoader
class
];
self
.
list
.
headerShown
=
YES
;
...
...
@@ -72,9 +80,9 @@ ON_CREATE_VIEWS( signal )
self
.
list
.
whenReloading
=
^
{
self
.
list
.
total
=
self
.
model
.
item
s
.
count
;
self
.
list
.
total
=
self
.
model
.
shop
s
.
count
;
INFO
(
@"total = %d"
,
self
.
model
.
item
s
.
count
);
INFO
(
@"total = %d"
,
self
.
model
.
shop
s
.
count
);
if
(
self
.
model
.
loaded
&&
self
.
list
.
total
<=
0
)
{
self
.
list
.
total
=
1
;
...
...
@@ -92,9 +100,8 @@ ON_CREATE_VIEWS( signal )
item
.
order
=
0
;
item
.
rule
=
BeeUIScrollLayoutRule_Fall
;
item
.
clazz
=
[
VankeStatementListItemCell_iPhone
class
];
SubjectItem
*
subItem
=
[
self
.
model
.
items
safeObjectAtIndex
:
item
.
index
];
item
.
data
=
subItem
;
StatementShop
*
shop
=
[
self
.
model
.
shops
safeObjectAtIndex
:
item
.
index
];
item
.
data
=
shop
;
}
}
};
...
...
@@ -125,6 +132,7 @@ ON_CREATE_VIEWS( signal )
// self.model.nameLike = _projectNameLike;
// self.model.salesDateEquals = _salesDate;
// _searchBar.text = _projectNameLike;
_model
.
settleEquals
=
[
NSDate
date
];
}
ON_DELETE_VIEWS
(
signal
)
...
...
@@ -145,6 +153,13 @@ ON_WILL_APPEAR( signal )
[
self
.
model
firstPage
];
}
UIColor
*
color
=
[
VankeUtil
rgbStringToColor
:
@"144,76,245"
];
if
(
IOS7_OR_LATER
)
{
self
.
navigationController
.
navigationBar
.
barTintColor
=
color
;
}
else
{
self
.
navigationController
.
navigationBar
.
tintColor
=
color
;
}
[
BeeUIRouter
sharedInstance
].
view
.
pannable
=
YES
;
}
...
...
@@ -165,8 +180,8 @@ ON_DID_DISAPPEAR( signal )
ON_SIGNAL3
(
VankeStatementListBoard_iPhone
,
searchBar
,
signal
)
{
//
NSString *nameLike = [VankeUtil trim:_searchBar.text];
// self.model.nam
eLike = nameLike;
NSString
*
nameLike
=
[
VankeUtil
trim
:
_searchBar
.
text
];
self
.
model
.
shopNameOrCod
eLike
=
nameLike
;
[
self
.
model
firstPage
];
}
...
...
@@ -186,6 +201,7 @@ ON_SIGNAL3( VankeStatementListModel, RELOADED, signal )
self
.
list
.
footerLoading
=
NO
;
self
.
list
.
footerMore
=
self
.
model
.
more
;
[
self
.
list
reloadData
];
$
(
self
.
settlementBar
).
DATA
(
_model
.
lastResp
);
}
#pragma UISearchBarDelegate
...
...
@@ -196,4 +212,27 @@ ON_SIGNAL3( VankeStatementListModel, RELOADED, signal )
[
self
.
model
firstPage
];
}
#pragma VankeStatementMonthCell_iPhone
ON_SIGNAL3
(
VankeStatementMonthCell_iPhone
,
pickerMask
,
signal
)
{
UIAlertController
*
alertController
=
[
UIAlertController
alertControllerWithTitle
:
@"
\n\n\n\n\n\n\n\n\n\n
"
message
:
nil
preferredStyle
:
UIAlertControllerStyleActionSheet
];
UIDatePicker
*
picker
=
[[
UIDatePicker
alloc
]
init
];
[
picker
setDatePickerMode
:
UIDatePickerModeDate
];
[
picker
setLocale
:[[
NSLocale
alloc
]
initWithLocaleIdentifier
:
@"zh_Hans_CN"
]];
[
alertController
.
view
addSubview
:
picker
];
[
alertController
addAction
:({
UIAlertAction
*
action
=
[
UIAlertAction
actionWithTitle
:
@"确定"
style
:
UIAlertActionStyleDefault
handler
:^
(
UIAlertAction
*
action
)
{
// 立即设置账期
self
.
model
.
settleEquals
=
picker
.
date
;
[
self
.
model
firstPage
];
}];
action
;
})];
UIPopoverPresentationController
*
popoverController
=
alertController
.
popoverPresentationController
;
popoverController
.
sourceView
=
self
.
view
;
popoverController
.
sourceRect
=
[
self
.
view
bounds
];
[
self
presentViewController
:
alertController
animated
:
YES
completion
:
nil
];
}
@end
vanke/view_iPhone/templates/statement/VankeStatementListBoard_iPhone.xml
View file @
1387bc58
...
...
@@ -4,6 +4,7 @@
<linear
class=
"wrapper"
>
<image
class=
"bg"
/>
<list
id=
"list"
/>
<VankeStatementMonthCell_iPhone
id=
"settlementBar"
/>
<searchbar
id=
"searchBar"
class=
"search-wrapper"
/>
</linear>
...
...
@@ -29,17 +30,25 @@
#list {
position: absolute;
left: 0px;
top:
45
px;
top:
120
px;
width: 100%;
height: 100%;
}
#settlementBar {
height: 75px;
width: 100%;
position: absolute;
left: 0px;
top: 64px;
}
.search-wrapper {
height: 45px;
width: 100%;
position: absolute;
left: 0px;
top:
64
px;
top:
139
px;
placeholder: "请输入商铺名称或代码搜索";
}
...
...
vanke/view_iPhone/templates/statement/VankeStatementListItemCell_iPhone.m
View file @
1387bc58
...
...
@@ -40,7 +40,7 @@ DEF_OUTLET(BeeUILabel, lblAmount)
-
(
void
)
dataDidChanged
{
S
ubjectItem
*
item
=
(
SubjectItem
*
)
self
.
data
;
S
tatementShop
*
item
=
(
StatementShop
*
)
self
.
data
;
if
(
!
item
)
{
return
;
}
...
...
@@ -48,7 +48,12 @@ DEF_OUTLET(BeeUILabel, lblAmount)
$
(
self
.
imgPhoto
).
DATA
([
item
getPictureUrlOrDefault
]);
$
(
self
.
lblName
).
DATA
([
item
codeName
]);
$
(
self
.
lblState
).
DATA
(
@"已确认"
);
$
(
self
.
lblAmount
).
DATA
([
NSString
stringWithFormat
:
@"%@%.2f元"
,
@""
,
[
item
.
amount
doubleValue
]]);
double
amount
=
[
item
.
amount
doubleValue
];
$
(
self
.
lblAmount
).
DATA
([
NSString
stringWithFormat
:
@"%@%.2f元"
,
@""
,
amount
]);
if
(
amount
<
0
)
{
$
(
self
.
lblAmount
).
ADD_CLASS
(
@"red"
);
}
}
-
(
void
)
layoutDidFinish
...
...
vanke/view_iPhone/templates/statement/VankeStatementListItemCell_iPhone.xml
View file @
1387bc58
...
...
@@ -16,10 +16,10 @@
<label
id=
"lblName"
class=
"name"
/>
</linear>
<linear
orientation=
"v"
class=
"col state-col"
>
<label
id=
"lblState"
class=
"state"
/
>
</linear
>
<!-- <linear orientation="v" class="col state-col">--
>
<!-- <label id="lblState" class="state" />--
>
<!-- </linear>--
>
<linear
orientation=
"v"
class=
"col amount-col"
>
<label
id=
"lblAmount"
class=
"amount"
/>
</linear>
...
...
@@ -71,7 +71,14 @@
.photo-col {
width: 80px;
margin-right: 5px;
}
.photo-col .photo {
width: 100%;
height: 100%;
image-mode: fit;
image-loading: white;
padding: 2px;
}
.name-col {
...
...
@@ -82,6 +89,8 @@
.name-col .name {
word-wrap: break-word;
text-overflow: ellipsis;
font-size: 15px;
font-style: bold;
}
.state-col {
...
...
@@ -96,13 +105,13 @@
.amount-col .amount {
word-wrap: break-word;
text-valign: right;
font-size: 15px;
}
.photo-col .photo {
width: 100%;
height: 100%;
image-mode: fit;
image-loading: white;
.amount-col .red {
color: red;
}
</style>
</ui>
\ No newline at end of file
vanke/view_iPhone/templates/statement/VankeStatementMonthCell_iPhone.h
View file @
1387bc58
...
...
@@ -19,5 +19,17 @@
#pragma mark -
@class
StatementMonth
;
@interface
VankeStatementMonthCell_iPhone
:
BeeUICell
AS_OUTLET
(
BeeUILabel
,
lblYear
)
AS_OUTLET
(
BeeUILabel
,
lblMonth
)
AS_OUTLET
(
BeeUILabel
,
lblCount
)
AS_OUTLET
(
BeeUILabel
,
lblAmount
)
AS_OUTLET
(
BeeUILabel
,
lblTotalPrefix
)
-
(
void
)
setSettleDate
:
(
NSDate
*
)
date
;
@end
vanke/view_iPhone/templates/statement/VankeStatementMonthCell_iPhone.m
View file @
1387bc58
...
...
@@ -16,6 +16,7 @@
//
#import "VankeStatementMonthCell_iPhone.h"
#import "VankeSettlementListAPI.h"
#pragma mark -
...
...
@@ -24,8 +25,15 @@
SUPPORT_AUTOMATIC_LAYOUT
(
YES
)
SUPPORT_RESOURCE_LOADING
(
YES
)
DEF_OUTLET
(
BeeUILabel
,
lblYear
)
DEF_OUTLET
(
BeeUILabel
,
lblMonth
)
DEF_OUTLET
(
BeeUILabel
,
lblCount
)
DEF_OUTLET
(
BeeUILabel
,
lblAmount
)
DEF_OUTLET
(
BeeUILabel
,
lblTotalPrefix
)
-
(
void
)
load
{
}
-
(
void
)
unload
...
...
@@ -34,7 +42,14 @@ SUPPORT_RESOURCE_LOADING( YES )
-
(
void
)
dataDidChanged
{
// TODO: fill data
StatementListResponse
*
resp
=
(
StatementListResponse
*
)
self
.
data
;
if
(
nil
==
resp
)
{
return
;
}
[
self
setSettleDate
:
resp
.
settle
];
$
(
self
.
lblCount
).
DATA
([
NSString
stringWithFormat
:
@"%d"
,
[
resp
.
paging
.
recordCount
intValue
]]);
$
(
self
.
lblAmount
).
DATA
(
resp
.
amount
.
description
);
}
-
(
void
)
layoutDidFinish
...
...
@@ -42,4 +57,15 @@ SUPPORT_RESOURCE_LOADING( YES )
// TODO: custom layout here
}
-
(
void
)
setSettleDate
:
(
NSDate
*
)
date
{
if
(
nil
==
date
)
{
$
(
self
.
lblYear
).
DATA
(
@""
);
$
(
self
.
lblMonth
).
DATA
(
@""
);
}
else
{
$
(
self
.
lblYear
).
DATA
([
NSString
stringWithFormat
:
@"%lu"
,
date
.
year
]);
$
(
self
.
lblMonth
).
DATA
([
NSString
stringWithFormat
:
@"%lu"
,
date
.
month
]);
}
}
@end
vanke/view_iPhone/templates/statement/VankeStatementMonthCell_iPhone.xml
View file @
1387bc58
<?xml version="1.0" encoding="UTF-8"?>
<ui
namespace=
"VankeStatementMonthCell_iPhone"
>
<!--
<row></row>
-->
<col
class=
"wrapper"
>
<!-- add your UI elements here -->
</col>
<linear
orientation=
"h"
class=
"wrapper"
>
<image
class=
"bg"
/>
<linear
orientation=
"v"
class=
"col-wrapper date-col"
>
<linear
orientation=
"h"
class=
"col-body"
>
<linear
orientation=
"h"
class=
"row"
>
<label
class=
"lbl"
>
账单日期
</label>
</linear>
<linear
orientation=
"h"
class=
"row"
>
<button
id=
"pickerMask"
/>
<linear
orientation=
"h"
class=
"row-wrapper"
>
<label
id=
"lblYear"
class=
"lbl year-val"
></label>
<label
class=
"lbl year"
>
年
</label>
<label
id=
"lblMonth"
class=
"lbl mon-val"
></label>
<label
class=
"lbl month"
>
月
</label>
<image
id=
"imgDatePicker"
class=
"date-picker"
/>
</linear>
</linear>
</linear>
</linear>
<linear
orientation=
"v"
class=
"col-wrapper summary-col"
>
<linear
orientation=
"h"
class=
"col-body"
>
<linear
orientation=
"h"
class=
"row"
>
<linear
orientation=
"h"
class=
"row1-wrapper"
>
<label
class=
"lbl"
>
共
</label>
<label
id=
"lblCount"
class=
"lbl"
></label>
<label
class=
"lbl"
>
家商铺:
</label>
<label
id=
"lblTotalPrefix"
class=
"lbl"
>
应收总额
</label>
</linear>
</linear>
<linear
orientation=
"h"
class=
"row"
>
<linear
orientation=
"h"
class=
"row2-wrapper"
>
<label
id=
"lblAmount"
class=
"lbl amount"
></label>
<label
class=
"lbl unit"
>
元
</label>
</linear>
</linear>
</linear>
</linear>
</linear>
<style
type=
"text/css"
>
.wrapper {
width: 100%;
height: 100%;
}
.bg {
width: 100%;
height: 100%;
position: absolute;
left: 0px;
top: 0px;
background-color: white;
}
.col-wrapper {
width: 50%;
height: 100%;
v-align: center;
}
.col-wrapper .col-body {
width: 100%;
height: auto;
}
.lbl {
width: auto;
color: #aaaaaa;
font-size: 14px;
}
.row {
width: 100%;
height: 20px;
margin-bottom: 5px;
}
.row-wrapper {
width: auto;
height: 100%;
}
/** 左边日期列 */
.date-col {
padding-left: 10px;
}
.date-col .row {
align: left;
}
.date-col .year-val,
.date-col .mon-val {
color: #904cf5;
font-size: 20px;
font-style: bold;
}
.date-col .month,
.date-col .year {
color: black;
font-size: 12px;
padding-top: 2px;
}
#pickerMask {
position: absolute;
left: 0px;
top: 0px;
height: 100%;
width: 100%;
}
/** 右边汇总列 */
.summary-col {
padding-right: 10px;
}
.summary-col .row {
align: right;
}
.summary-col .row1-wrapper,
.summary-col .row2-wrapper {
width: auto;
}
.summary-col .amount {
color: red;
font-size: 20px;
font-style: bold;
}
.summary-col .unit {
color: black;
font-size: 12px;
padding-top: 2px;
}
</style>
</ui>
\ No newline at end of file
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