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
4493cda7
Commit
4493cda7
authored
Dec 05, 2015
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加动画和手势事件处理
parent
22e46e23
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
112 deletions
+122
-112
VankeMainBoard_iPhone.m
vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m
+89
-104
VankeServiceDashBoard_iPhone.h
...view_iPhone/templates/main/VankeServiceDashBoard_iPhone.h
+2
-0
VankeServiceDashBoard_iPhone.m
...view_iPhone/templates/main/VankeServiceDashBoard_iPhone.m
+12
-0
VankeTopMenuBoardCell_iPhone.h
...view_iPhone/templates/main/VankeTopMenuBoardCell_iPhone.h
+5
-3
VankeTopMenuBoardCell_iPhone.m
...view_iPhone/templates/main/VankeTopMenuBoardCell_iPhone.m
+10
-0
VankeStatementListBoard_iPhone.m
...hone/templates/statement/VankeStatementListBoard_iPhone.m
+4
-5
No files found.
vanke/view_iPhone/templates/main/VankeMainBoard_iPhone.m
View file @
4493cda7
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
#import "GEToast.h"
#import "GEToast.h"
@interface
VankeMainBoard_iPhone
()
@interface
VankeMainBoard_iPhone
()
@property
(
strong
,
nonatomic
)
VankeServiceDashBoard_iPhone
*
communityDashBoard
;
//
@property (strong, nonatomic) VankeServiceDashBoard_iPhone *communityDashBoard;
@property
(
strong
,
nonatomic
)
VankeServiceDashBoard_iPhone
*
centerDashBoard
;
//
@property (strong, nonatomic) VankeServiceDashBoard_iPhone *centerDashBoard;
@property
(
strong
,
nonatomic
)
VankeServiceDashBoard_iPhone
*
squreDashBoard
;
//
@property (strong, nonatomic) VankeServiceDashBoard_iPhone *squreDashBoard;
@property
(
strong
,
nonatomic
)
VankeServiceDashBoard_iPhone
*
currDashBoard
;
@property
(
strong
,
nonatomic
)
VankeServiceDashBoard_iPhone
*
currDashBoard
;
@end
@end
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
@interface
VankeMainBoard_iPhone
()
@interface
VankeMainBoard_iPhone
()
{
{
NSInteger
_curTopMenuIndex
;
NSInteger
_curTopMenuIndex
;
NSMutableDictionary
*
tabCache
;
}
}
@end
@end
...
@@ -37,13 +38,15 @@ DEF_MODEL( VankeProjectSummaryModel, summaryModel );
...
@@ -37,13 +38,15 @@ DEF_MODEL( VankeProjectSummaryModel, summaryModel );
-
(
void
)
load
-
(
void
)
load
{
{
_curTopMenuIndex
=
0
;
_curTopMenuIndex
=
-
1
;
tabCache
=
[[
NSMutableDictionary
alloc
]
initWithCapacity
:
3
];
self
.
summaryModel
=
[
VankeProjectSummaryModel
modelWithObserver
:
self
];
self
.
summaryModel
=
[
VankeProjectSummaryModel
modelWithObserver
:
self
];
}
}
-
(
void
)
unload
-
(
void
)
unload
{
{
self
.
summaryModel
=
nil
;
self
.
summaryModel
=
nil
;
tabCache
=
nil
;
}
}
#pragma mark - Signal
#pragma mark - Signal
...
@@ -53,19 +56,9 @@ ON_CREATE_VIEWS( signal )
...
@@ -53,19 +56,9 @@ ON_CREATE_VIEWS( signal )
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
[
self
addLeftIconToTextField
:
_txtQuery
icon
:
@"search"
];
[
self
addLeftIconToTextField
:
_txtQuery
icon
:
@"search"
];
[
_weatherBoard
reloadLocationAndWeather
];
[
_weatherBoard
reloadLocationAndWeather
];
[
self
initSwipeGesture
];
UISwipeGestureRecognizer
*
swipeGestureRecognizer
=
[[
UISwipeGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
handleSwipes
:
)];
/*Swipes that are performed from right to left are to be detected*/
swipeGestureRecognizer
.
direction
=
UISwipeGestureRecognizerDirectionLeft
;
/*just one finger needed*/
swipeGestureRecognizer
.
numberOfTouchesRequired
=
1
;
/*add it to the view*/
[
self
.
view
addGestureRecognizer
:
swipeGestureRecognizer
];
}
}
-
(
void
)
handleSwipes
:
(
UISwipeGestureRecognizer
*
)
paramSender
{
NSLog
(
@"swipe to left"
);
}
ON_DELETE_VIEWS
(
signal
)
ON_DELETE_VIEWS
(
signal
)
{
{
...
@@ -73,10 +66,6 @@ ON_DELETE_VIEWS( signal )
...
@@ -73,10 +66,6 @@ ON_DELETE_VIEWS( signal )
ON_LAYOUT_VIEWS
(
signal
)
ON_LAYOUT_VIEWS
(
signal
)
{
{
// 如果没有设置当前tab,则默认为第一页
if
(
nil
==
_currDashBoard
)
{
[
self
showCommunityDashBoard
];
}
}
}
ON_WILL_APPEAR
(
signal
)
ON_WILL_APPEAR
(
signal
)
...
@@ -89,6 +78,10 @@ ON_WILL_APPEAR( signal )
...
@@ -89,6 +78,10 @@ ON_WILL_APPEAR( signal )
ON_DID_APPEAR
(
signal
)
ON_DID_APPEAR
(
signal
)
{
{
// 如果没有设置当前tab,则默认为第一页
if
(
nil
==
_currDashBoard
)
{
[
self
showTab
:
0
];
}
}
}
ON_WILL_DISAPPEAR
(
signal
)
ON_WILL_DISAPPEAR
(
signal
)
...
@@ -117,18 +110,15 @@ ON_SIGNAL3( VankeWeatherCell_iPhone, btnMask, signal )
...
@@ -117,18 +110,15 @@ ON_SIGNAL3( VankeWeatherCell_iPhone, btnMask, signal )
#pragma VankeTopMenuBoardCell_iPhone
#pragma VankeTopMenuBoardCell_iPhone
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuCommunity
,
signal
)
{
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuCommunity
,
signal
)
{
[
self
.
topMenu
selectCommunity
];
[
self
showTab
:
0
];
[
self
showCommunityDashBoard
];
}
}
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuCenter
,
signal
)
{
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuCenter
,
signal
)
{
[
self
.
topMenu
selectCenter
];
[
self
showTab
:
1
];
[
self
showCenterDashBoard
];
}
}
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuSqure
,
signal
)
{
ON_SIGNAL3
(
VankeTopMenuBoardCell_iPhone
,
menuSqure
,
signal
)
{
[
self
.
topMenu
selectSqure
];
[
self
showTab
:
2
];
[
self
showSqureDashBoard
];
}
}
#pragma mark - VankeServiceSaleCell_iPhone
#pragma mark - VankeServiceSaleCell_iPhone
...
@@ -151,10 +141,12 @@ ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) {
...
@@ -151,10 +141,12 @@ ON_SIGNAL3(VankeServiceBoardCell_iPhone, mask, signal) {
#pragma mark - VankeProjectSummaryModel
#pragma mark - VankeProjectSummaryModel
ON_SIGNAL3
(
VankeProjectSummaryModel
,
RELOADING
,
signal
)
{
ON_SIGNAL3
(
VankeProjectSummaryModel
,
RELOADING
,
signal
)
{
[
GEToast
showProgress
:
self
.
serviceDashBoardView
];
}
}
ON_SIGNAL3
(
VankeProjectSummaryModel
,
RELOADED
,
signal
)
{
ON_SIGNAL3
(
VankeProjectSummaryModel
,
RELOADED
,
signal
)
{
[
GEToast
hideProgress
];
if
(
!
[
_summaryModel
isOk
])
{
if
(
!
[
_summaryModel
isOk
])
{
[
GEToast
showWithText
:[
_summaryModel
getMessage
]
bottomOffset
:
20
duration
:
1
.
0
f
];
[
GEToast
showWithText
:[
_summaryModel
getMessage
]
bottomOffset
:
20
duration
:
1
.
0
f
];
return
;
return
;
...
@@ -176,10 +168,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
...
@@ -176,10 +168,8 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
textField
.
leftViewMode
=
UITextFieldViewModeAlways
;
textField
.
leftViewMode
=
UITextFieldViewModeAlways
;
}
}
-
(
void
)
showCommunityDashBoard
{
-
(
void
)
showTab
:
(
int
)
tabIndex
{
_curTopMenuIndex
=
0
;
if
(
tabIndex
==
_curTopMenuIndex
)
{
if
(
self
.
currDashBoard
!=
nil
&&
self
.
currDashBoard
==
self
.
communityDashBoard
)
{
return
;
return
;
}
}
...
@@ -188,89 +178,50 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
...
@@ -188,89 +178,50 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
return
;
return
;
}
}
if
(
self
.
communityDashBoard
==
nil
)
{
// 修改标签
self
.
communityDashBoard
=
[
VankeServiceDashBoard_iPhone
communityDashBarod
];
[
self
.
topMenu
selectTabByIndex
:
tabIndex
];
}
if
(
self
.
currDashBoard
!=
nil
)
{
self
.
currDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
0
,
0
);
[
self
.
currDashBoard
removeFromSuperview
];
}
[
self
.
serviceDashBoardView
addSubview
:
self
.
communityDashBoard
];
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
self
.
communityDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
frame
.
size
.
width
,
frame
.
size
.
height
);
self
.
currDashBoard
=
self
.
communityDashBoard
;
[
self
RELAYOUT
];
}];
// 刷新数据
[
_summaryModel
reload
];
}
-
(
void
)
showCenterDashBoard
{
_curTopMenuIndex
=
1
;
if
(
self
.
currDashBoard
!=
nil
&&
self
.
currDashBoard
==
self
.
centerDashBoard
)
{
return
;
}
CGRect
frame
=
self
.
serviceDashBoardView
.
frame
;
if
(
frame
.
size
.
width
<=
0
)
{
return
;
}
if
(
self
.
centerDashBoard
==
nil
)
{
// 查找或创建新的tab页
self
.
centerDashBoard
=
[
VankeServiceDashBoard_iPhone
centerDashBarod
];
NSString
*
key
=
[
NSString
stringWithFormat
:
@"%d"
,
tabIndex
];
VankeServiceDashBoard_iPhone
*
targetTab
=
(
VankeServiceDashBoard_iPhone
*
)
[
tabCache
objectForKey
:
key
];
if
(
nil
==
targetTab
)
{
targetTab
=
[
VankeServiceDashBoard_iPhone
dashBoardByIndex
:
tabIndex
];
[
tabCache
setObject
:
targetTab
forKey
:
key
];
}
}
// 隐藏当前页
if
(
self
.
currDashBoard
!=
nil
)
{
if
(
self
.
currDashBoard
!=
nil
)
{
self
.
currDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
0
,
0
);
[
self
.
currDashBoard
removeFromSuperview
];
[
self
.
currDashBoard
removeFromSuperview
];
self
.
currDashBoard
.
hidden
=
YES
;
}
}
[
self
.
serviceDashBoardView
addSubview
:
self
.
centerDashBoard
];
// 显示目标页
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
targetTab
.
frame
=
CGRectMake
(
0
,
0
,
frame
.
size
.
width
,
frame
.
size
.
height
);
self
.
centerDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
frame
.
size
.
width
,
frame
.
size
.
height
);
if
(
tabIndex
>
_curTopMenuIndex
)
{
self
.
currDashBoard
=
self
.
centerDashBoard
;
targetTab
.
right
=
0
.
0
f
;
[
self
RELAYOUT
];
}
else
{
}];
targetTab
.
left
=
frame
.
size
.
width
;
// 刷新数据
[
_summaryModel
reload
];
}
-
(
void
)
showSqureDashBoard
{
_curTopMenuIndex
=
2
;
if
(
self
.
currDashBoard
!=
nil
&&
self
.
currDashBoard
==
self
.
squreDashBoard
)
{
return
;
}
CGRect
frame
=
self
.
serviceDashBoardView
.
frame
;
if
(
frame
.
size
.
width
<=
0
)
{
return
;
}
}
if
(
self
.
squreDashBoard
==
nil
)
{
[
UIView
animateWithDuration
:
0
.
3
f
// 动画时长
self
.
squreDashBoard
=
[
VankeServiceDashBoard_iPhone
squreDashBarod
];
delay
:
0
.
0
// 动画延迟
options
:
UIViewAnimationOptionCurveLinear
// 动画过渡效果
animations
:^
{
if
(
tabIndex
>
_curTopMenuIndex
)
{
targetTab
.
right
+=
frame
.
size
.
width
;
}
else
{
targetTab
.
left
-=
frame
.
size
.
width
;
}
}
targetTab
.
hidden
=
NO
;
if
(
self
.
currDashBoard
!=
nil
)
{
[
self
.
serviceDashBoardView
addSubview
:
targetTab
];
self
.
currDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
0
,
0
);
[
self
.
currDashBoard
removeFromSuperview
];
}
}
completion
:^
(
BOOL
finished
)
{
[
self
.
serviceDashBoardView
addSubview
:
self
.
squreDashBoard
];
self
.
currDashBoard
=
targetTab
;
[
UIView
animateWithDuration
:
0
.
25
animations
:
^
{
_curTopMenuIndex
=
tabIndex
;
self
.
squreDashBoard
.
frame
=
CGRectMake
(
0
,
0
,
frame
.
size
.
width
,
frame
.
size
.
height
);
self
.
currDashBoard
=
self
.
squreDashBoard
;
[
self
RELAYOUT
];
}];
// 刷新数据
// 刷新数据
[
_summaryModel
reload
];
[
_summaryModel
reload
];
}];
}
}
-
(
void
)
showListView
:
(
CellType
)
type
{
-
(
void
)
showListView
:
(
CellType
)
type
{
...
@@ -297,4 +248,38 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
...
@@ -297,4 +248,38 @@ ON_SIGNAL3(VankeProjectSummaryModel, RELOADED, signal) {
return
[
df
stringFromDate
:[
NSDate
date
]];
return
[
df
stringFromDate
:[
NSDate
date
]];
}
}
#pragma SwipeGesture
-
(
void
)
initSwipeGesture
{
UISwipeGestureRecognizer
*
swipeGestureRecognizerToLeft
=
[[
UISwipeGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
handleSwipesToLeft
:
)];
/*Swipes that are performed from right to left are to be detected*/
swipeGestureRecognizerToLeft
.
direction
=
UISwipeGestureRecognizerDirectionLeft
;
/*just one finger needed*/
swipeGestureRecognizerToLeft
.
numberOfTouchesRequired
=
1
;
swipeGestureRecognizerToLeft
.
cancelsTouchesInView
=
NO
;
/*add it to the view*/
[
self
.
serviceDashBoardView
addGestureRecognizer
:
swipeGestureRecognizerToLeft
];
UISwipeGestureRecognizer
*
swipeGestureRecognizerToRight
=
[[
UISwipeGestureRecognizer
alloc
]
initWithTarget
:
self
action
:
@selector
(
handleSwipesToRight
:
)];
/*Swipes that are performed from right to left are to be detected*/
swipeGestureRecognizerToRight
.
direction
=
UISwipeGestureRecognizerDirectionRight
;
/*just one finger needed*/
swipeGestureRecognizerToRight
.
numberOfTouchesRequired
=
1
;
swipeGestureRecognizerToRight
.
cancelsTouchesInView
=
NO
;
/*add it to the view*/
[
self
.
serviceDashBoardView
addGestureRecognizer
:
swipeGestureRecognizerToRight
];
}
-
(
void
)
handleSwipesToLeft
:
(
UISwipeGestureRecognizer
*
)
paramSender
{
if
(
_curTopMenuIndex
>
0
)
{
[
self
showTab
:
_curTopMenuIndex
-
1
];
}
}
-
(
void
)
handleSwipesToRight
:
(
UISwipeGestureRecognizer
*
)
paramSender
{
if
(
_curTopMenuIndex
<
2
)
{
[
self
showTab
:
_curTopMenuIndex
+
1
];
}
}
@end
@end
vanke/view_iPhone/templates/main/VankeServiceDashBoard_iPhone.h
View file @
4493cda7
...
@@ -22,4 +22,6 @@ AS_OUTLET( VankeServiceBoardCell_iPhone, complaint );
...
@@ -22,4 +22,6 @@ AS_OUTLET( VankeServiceBoardCell_iPhone, complaint );
+
(
id
)
centerDashBarod
;
+
(
id
)
centerDashBarod
;
+
(
id
)
squreDashBarod
;
+
(
id
)
squreDashBarod
;
+
(
id
)
dashBoardByIndex
:
(
int
)
index
;
@end
@end
vanke/view_iPhone/templates/main/VankeServiceDashBoard_iPhone.m
View file @
4493cda7
...
@@ -23,6 +23,18 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint );
...
@@ -23,6 +23,18 @@ DEF_OUTLET( VankeServiceBoardCell_iPhone, complaint );
@synthesize
name
=
_name
;
@synthesize
name
=
_name
;
@synthesize
theme
=
_theme
;
@synthesize
theme
=
_theme
;
+
(
id
)
dashBoardByIndex
:
(
int
)
index
{
if
(
index
==
0
)
{
return
[
VankeServiceDashBoard_iPhone
communityDashBarod
];
}
else
if
(
index
==
1
)
{
return
[
VankeServiceDashBoard_iPhone
centerDashBarod
];
}
else
if
(
index
==
2
)
{
return
[
VankeServiceDashBoard_iPhone
squreDashBarod
];
}
else
{
return
nil
;
}
}
+
(
id
)
communityDashBarod
{
+
(
id
)
communityDashBarod
{
VankeServiceDashBoard_iPhone
*
board
=
[
super
cell
];
VankeServiceDashBoard_iPhone
*
board
=
[
super
cell
];
board
.
name
=
@"社区2049"
;
board
.
name
=
@"社区2049"
;
...
...
vanke/view_iPhone/templates/main/VankeTopMenuBoardCell_iPhone.h
View file @
4493cda7
...
@@ -11,8 +11,10 @@ AS_OUTLET( BeeUIButton, menuCenter );
...
@@ -11,8 +11,10 @@ AS_OUTLET( BeeUIButton, menuCenter );
AS_OUTLET
(
BeeUIButton
,
menuSqure
);
AS_OUTLET
(
BeeUIButton
,
menuSqure
);
AS_OUTLET
(
BeeUIImageView
,
indictor
);
AS_OUTLET
(
BeeUIImageView
,
indictor
);
-
(
void
)
selectCommunity
;
//-(void) selectCommunity;
-
(
void
)
selectCenter
;
//-(void) selectCenter;
-
(
void
)
selectSqure
;
//-(void) selectSqure;
-
(
void
)
selectTabByIndex
:
(
int
)
index
;
@end
@end
vanke/view_iPhone/templates/main/VankeTopMenuBoardCell_iPhone.m
View file @
4493cda7
...
@@ -20,6 +20,16 @@ DEF_OUTLET( BeeUIButton, menuCenter );
...
@@ -20,6 +20,16 @@ DEF_OUTLET( BeeUIButton, menuCenter );
DEF_OUTLET
(
BeeUIButton
,
menuSqure
);
DEF_OUTLET
(
BeeUIButton
,
menuSqure
);
DEF_OUTLET
(
BeeUIImageView
,
indictor
);
DEF_OUTLET
(
BeeUIImageView
,
indictor
);
-
(
void
)
selectTabByIndex
:
(
int
)
index
{
if
(
index
==
0
)
{
[
self
selectCommunity
];
}
else
if
(
index
==
1
)
{
[
self
selectCenter
];
}
else
if
(
index
==
2
)
{
[
self
selectSqure
];
}
}
-
(
void
)
selectCommunity
{
-
(
void
)
selectCommunity
{
[
self
removeActiveClass
];
[
self
removeActiveClass
];
$
(
self
.
menuCommunity
).
ADD_CLASS
(
@"active"
);
$
(
self
.
menuCommunity
).
ADD_CLASS
(
@"active"
);
...
...
vanke/view_iPhone/templates/statement/VankeStatementListBoard_iPhone.m
View file @
4493cda7
...
@@ -247,11 +247,10 @@ ON_SIGNAL3(VankeStatementListItemCell_iPhone, mask, signal) {
...
@@ -247,11 +247,10 @@ ON_SIGNAL3(VankeStatementListItemCell_iPhone, mask, signal) {
_model
.
shopLike
=
_shopLike
;
_model
.
shopLike
=
_shopLike
;
_model
.
projectsIn
=
[[
NSArray
alloc
]
initWithObjects
:
_authorizedOrgUuidEquals
,
nil
];
_model
.
projectsIn
=
[[
NSArray
alloc
]
initWithObjects
:
_authorizedOrgUuidEquals
,
nil
];
_model
.
settleEquals
=
[
NSDate
date
];
NSDateFormatter
*
df
=
[[
NSDateFormatter
alloc
]
init
];
// NSDateFormatter *df = [[NSDateFormatter alloc]init];
df
.
dateFormat
=
@"yyyy-MM-dd"
;
// df.dateFormat = @"yyyy-MM-dd";
// _model.settleEquals = [NSDate date];
// _model.settleEquals = [df dateFromString:@"2015-10-11"];
_model
.
settleEquals
=
[
df
dateFromString
:
@"2015-10-11"
];
}
}
@end
@end
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