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
2a743b25
Commit
2a743b25
authored
May 11, 2017
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
选择采购单checkbox逻辑
parent
525917d1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
10 deletions
+57
-10
project.pbxproj
XFFruit.xcodeproj/project.pbxproj
+4
-4
ICRCheckBox.h
XFFruit/General/Views/ICRCheckBox.h
+1
-1
ICRCheckBox.m
XFFruit/General/Views/ICRCheckBox.m
+3
-0
HeaderCell.h
XFFruit/ViewControllers/ChooseViewController/HeaderCell.h
+4
-2
HeaderCell.m
XFFruit/ViewControllers/ChooseViewController/HeaderCell.m
+30
-0
TransportPurchaseCell.m
...t/ViewControllers/Transport/Views/TransportPurchaseCell.m
+15
-3
No files found.
XFFruit.xcodeproj/project.pbxproj
View file @
2a743b25
...
@@ -4424,7 +4424,7 @@
...
@@ -4424,7 +4424,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
};
name
=
Debug
;
name
=
Debug
;
...
@@ -4434,8 +4434,8 @@
...
@@ -4434,8 +4434,8 @@
baseConfigurationReference
=
7DDFB1D460448C3B45118195
/* Pods.release.xcconfig */
;
baseConfigurationReference
=
7DDFB1D460448C3B45118195
/* Pods.release.xcconfig */
;
buildSettings
=
{
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
eveloper
"
;
COPYING_PRESERVES_HFS_DATA
=
NO
;
COPYING_PRESERVES_HFS_DATA
=
NO
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
GCC_PREFIX_HEADER
=
"XFFruit/XFFruit-Prefix.pch"
;
GCC_PREFIX_HEADER
=
"XFFruit/XFFruit-Prefix.pch"
;
...
@@ -4449,7 +4449,7 @@
...
@@ -4449,7 +4449,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.xffruit
;
PRODUCT_NAME
=
XFFruit
;
PRODUCT_NAME
=
XFFruit
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
"
e2cec26c-3666-4512-9b9a-cdb4cd9da56d
"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
USER_HEADER_SEARCH_PATHS
=
"${SRCROOT}/**"
;
};
};
name
=
Release
;
name
=
Release
;
...
...
XFFruit/General/Views/ICRCheckBox.h
View file @
2a743b25
...
@@ -19,7 +19,7 @@ typedef NS_ENUM(NSUInteger, CheckBoxBGType) {
...
@@ -19,7 +19,7 @@ typedef NS_ENUM(NSUInteger, CheckBoxBGType) {
@property
(
assign
,
nonatomic
)
BOOL
isSelected
;
@property
(
assign
,
nonatomic
)
BOOL
isSelected
;
@property
(
assign
,
nonatomic
)
CheckBoxBGType
m_eBGType
;
@property
(
assign
,
nonatomic
)
CheckBoxBGType
m_eBGType
;
@property
(
nonatomic
,
copy
)
void
(
^
blockCheckBox
)(
BOOL
isSelect
);
-
(
void
)
onCheckBoxAction
:(
id
)
sender
;
-
(
void
)
onCheckBoxAction
:(
id
)
sender
;
@end
@end
XFFruit/General/Views/ICRCheckBox.m
View file @
2a743b25
...
@@ -92,6 +92,9 @@
...
@@ -92,6 +92,9 @@
#pragma mark - Actions
#pragma mark - Actions
-
(
void
)
onCheckBoxAction
:
(
id
)
sender
{
-
(
void
)
onCheckBoxAction
:
(
id
)
sender
{
self
.
isSelected
=
!
_isSelected
;
self
.
isSelected
=
!
_isSelected
;
if
(
self
.
blockCheckBox
)
{
self
.
blockCheckBox
(
self
.
isSelected
);
}
}
}
@end
@end
XFFruit/ViewControllers/ChooseViewController/HeaderCell.h
View file @
2a743b25
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
//
//
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "ICRCheckBox.h"
@protocol
HeaderCellDelegate
<
NSObject
>
@protocol
HeaderCellDelegate
<
NSObject
>
@optional
@optional
...
@@ -17,8 +17,10 @@
...
@@ -17,8 +17,10 @@
@interface
HeaderCell
:
UIView
@interface
HeaderCell
:
UIView
@property
(
nonatomic
,
weak
)
id
<
HeaderCellDelegate
>
delegate
;
@property
(
nonatomic
,
weak
)
id
<
HeaderCellDelegate
>
delegate
;
@property
(
strong
,
nonatomic
)
ICRCheckBox
*
checkBox
;
@property
(
nonatomic
,
copy
)
void
(
^
blockCheckBox
)(
BOOL
isSelect
);
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withArr
:(
NSArray
*
)
arr
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withArr
:(
NSArray
*
)
arr
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withArr
:(
NSArray
*
)
arr
withHiddenEdit
:(
BOOL
)
isHiddenEdit
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
withArr
:(
NSArray
*
)
arr
withHiddenEdit
:(
BOOL
)
isHiddenEdit
;
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
WithCheckBoxArr
:(
NSArray
*
)
arr
checkBox
:(
void
(
^
)(
BOOL
isSelect
))
check
;
@end
@end
XFFruit/ViewControllers/ChooseViewController/HeaderCell.m
View file @
2a743b25
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#define LeftWidth 45
#define LeftWidth 45
#define RightWidth 30
#define RightWidth 30
#define SpaceMargin 1
#define SpaceMargin 1
#import "ICRCheckBox.h"
@interface
HeaderCell
()
@interface
HeaderCell
()
@property
(
nonatomic
,
strong
)
NSArray
*
arr
;
@property
(
nonatomic
,
strong
)
NSArray
*
arr
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
@property
(
nonatomic
,
strong
)
UILabel
*
lineLabel
;
...
@@ -38,6 +39,18 @@
...
@@ -38,6 +39,18 @@
return
self
;
return
self
;
}
}
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
WithCheckBoxArr
:(
NSArray
*
)
arr
checkBox
:(
void
(
^
)(
BOOL
isSelect
))
check
{
self
=
[
super
initWithFrame
:
frame
];
if
(
self
)
{
self
.
arr
=
arr
;
self
.
isHiddenAdd
=
YES
;
self
.
blockCheckBox
=
check
;
[
self
bulidLayout
];
[
self
uiAddCheckBox
];
}
return
self
;
}
-
(
void
)
bulidLayout
{
-
(
void
)
bulidLayout
{
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
-
LeftWidth
-
SpaceMargin
*
(
self
.
arr
.
count
-
1
))
/
self
.
arr
.
count
;
CGFloat
headWidth
=
(
ScreenSize
.
width
-
LeftWidth
-
LeftWidth
-
SpaceMargin
*
(
self
.
arr
.
count
-
1
))
/
self
.
arr
.
count
;
...
@@ -65,6 +78,23 @@
...
@@ -65,6 +78,23 @@
[
self
addSubview
:
addBtn
];
[
self
addSubview
:
addBtn
];
}
}
}
-
(
void
)
uiAddCheckBox
{
UILabel
*
label
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
ScreenSize
.
width
-
30
,
0
,
30
,
self
.
frame
.
size
.
height
)];
label
.
text
=
@"全选"
;
label
.
font
=
[
UIFont
systemFontOfSize
:
13
];
[
self
addSubview
:
label
];
ICRCheckBox
*
addBtn
=
[[
ICRCheckBox
alloc
]
initWithFrame
:
CGRectMake
(
ScreenSize
.
width
-
LeftWidth
-
SpaceMargin
-
15
,
0
,
LeftWidth
,
self
.
frame
.
size
.
height
)];
self
.
checkBox
=
addBtn
;
addBtn
.
m_eBGType
=
kCheckBoxBGGray
;
addBtn
.
blockCheckBox
=
self
.
blockCheckBox
;
[
self
addSubview
:
addBtn
];
}
}
-
(
void
)
addBtn
{
-
(
void
)
addBtn
{
...
...
XFFruit/ViewControllers/Transport/Views/TransportPurchaseCell.m
View file @
2a743b25
...
@@ -12,7 +12,9 @@
...
@@ -12,7 +12,9 @@
#define TableHeight 44
#define TableHeight 44
#define ShowHeight 110
#define ShowHeight 110
@interface
TransportPurchaseCell
()
@property
(
strong
,
nonatomic
)
HeaderCell
*
headCell
;
@end
@implementation
TransportPurchaseCell
@implementation
TransportPurchaseCell
...
@@ -58,8 +60,15 @@
...
@@ -58,8 +60,15 @@
[
self
.
bgView
addSubview
:
self
.
secondTable
];
[
self
.
bgView
addSubview
:
self
.
secondTable
];
NSArray
*
arr
=
@[
@"商品"
,
@"包装规格"
,
@"包装数量"
,
@"基础数量"
];
NSArray
*
arr
=
@[
@"商品"
,
@"包装规格"
,
@"包装数量"
,
@"基础数量"
];
HeaderCell
*
headCell
=
[[
HeaderCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
38
)
withArr
:
arr
withHiddenEdit
:
YES
];
__weak
TransportPurchaseCell
*
weakSelf
=
self
;
self
.
secondTable
.
tableHeaderView
=
headCell
;
self
.
headCell
=
[[
HeaderCell
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenSize
.
width
,
38
)
WithCheckBoxArr
:
arr
checkBox
:^
(
BOOL
isSelect
)
{
[
weakSelf
.
selectArr
removeAllObjects
];
if
(
isSelect
)
{
[
weakSelf
.
selectArr
addObjectsFromArray
:
self
.
secondArr
];
}
[
weakSelf
.
secondTable
reloadData
];
}];
self
.
secondTable
.
tableHeaderView
=
self
.
headCell
;
}
}
...
@@ -99,6 +108,8 @@
...
@@ -99,6 +108,8 @@
{
{
static
NSString
*
cellID
=
@"TransportPurductCell"
;
static
NSString
*
cellID
=
@"TransportPurductCell"
;
TransportPurductCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
TransportPurductCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
cellID
];
cell
.
editBtn
.
enabled
=
NO
;
self
.
headCell
.
checkBox
.
isSelected
=
self
.
selectArr
.
count
==
self
.
secondArr
.
count
;
if
(
cell
==
nil
)
{
if
(
cell
==
nil
)
{
cell
=
[[
TransportPurductCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
withImageName
:
@"selected"
];
cell
=
[[
TransportPurductCell
alloc
]
initWithStyle
:
UITableViewCellStyleDefault
reuseIdentifier
:
cellID
withImageName
:
@"selected"
];
cell
.
editBtn
.
hidden
=
YES
;
cell
.
editBtn
.
hidden
=
YES
;
...
@@ -156,6 +167,7 @@
...
@@ -156,6 +167,7 @@
// cell.backgroundColor = [UIColor whiteColor];
// cell.backgroundColor = [UIColor whiteColor];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"remove"}];
// [[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_getSelectPurchaseProduct object:nil userInfo:@{@"selectArr":billProduct,@"state":@"remove"}];
}
}
self
.
headCell
.
checkBox
.
isSelected
=
self
.
selectArr
.
count
==
self
.
secondArr
.
count
;
[
self
.
secondTable
reloadData
];
[
self
.
secondTable
reloadData
];
}
}
-
(
BOOL
)
isHaveIndexPath
:
(
TransportPdtDetail
*
)
billProduct
{
-
(
BOOL
)
isHaveIndexPath
:
(
TransportPdtDetail
*
)
billProduct
{
...
...
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