Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
ALand
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
张杰
ALand
Commits
38c92318
Commit
38c92318
authored
May 03, 2016
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
佣金排序bug fix
parent
ed13299c
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
133 additions
and
101 deletions
+133
-101
CommodityManagementTopView.h
ALand/CodeClass/Home/View/CommodityManagementTopView.h
+5
-3
CommodityManagementTopView.m
ALand/CodeClass/Home/View/CommodityManagementTopView.m
+5
-29
CommodityManagementTopView.xib
ALand/CodeClass/Home/View/CommodityManagementTopView.xib
+3
-9
CommodityTableViewCell.m
ALand/CodeClass/Home/View/CommodityTableViewCell.m
+1
-1
CommodityManagementViewController.m
...s/Home/ViewController/CommodityManagementViewController.m
+46
-13
ManagementViewController.h
.../CodeClass/Home/ViewController/ManagementViewController.h
+2
-0
ManagementViewController.m
.../CodeClass/Home/ViewController/ManagementViewController.m
+69
-45
MBProgressHUD+Javen.m
ALand/General/Categories/MBProgressHUD+Javen.m
+1
-1
JavenSortView.m
ALand/Global/JavenSortView.m
+1
-0
No files found.
ALand/CodeClass/Home/View/CommodityManagementTopView.h
View file @
38c92318
...
@@ -9,7 +9,9 @@
...
@@ -9,7 +9,9 @@
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
@interface
CommodityManagementTopView
:
UIView
@interface
CommodityManagementTopView
:
UIView
@property
(
nonatomic
,
strong
)
NSMutableArray
*
arrDatas
;
@property
(
nonatomic
,
assign
)
BOOL
isLeft
;
//判断排序判断选中了左边还是右边
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
buttonAddCommodity
;
@property
(
nonatomic
,
assign
)
NSInteger
row
;
//判断排序判断选中了哪一行 传到下一个页面
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
buttonManageCommodity
;
@end
@end
ALand/CodeClass/Home/View/CommodityManagementTopView.m
View file @
38c92318
...
@@ -21,37 +21,13 @@
...
@@ -21,37 +21,13 @@
-
(
void
)
awakeFromNib
{
-
(
void
)
awakeFromNib
{
self
.
buttonAdd
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
buttonAddCommodity
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
buttonManagement
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
self
.
buttonManageCommodity
.
imageView
.
contentMode
=
UIViewContentModeScaleAspectFit
;
}
-
(
IBAction
)
managementAct
:
(
id
)
sender
{
ManagementViewController
*
manageVC
=
[[
ManagementViewController
alloc
]
init
];
[
self
hideSortView
];
manageVC
.
isShowNavigationBar
=
YES
;
manageVC
.
arrCellData
=
[
self
.
arrDatas
mutableCopy
];
manageVC
.
isLeft
=
self
.
isLeft
;
manageVC
.
row
=
self
.
row
;
[[
self
viewController
]
PushViewController
:
manageVC
animated
:
YES
];
CLog
(
@"m"
);
}
-
(
IBAction
)
addAct
:
(
id
)
sender
{
[
self
hideSortView
];
AddCommodityViewController
*
addVC
=
[[
AddCommodityViewController
alloc
]
init
];
addVC
.
hidesBottomBarWhenPushed
=
YES
;
addVC
.
isShowNavigationBar
=
YES
;
[[
self
viewController
].
navigationController
pushViewController
:
addVC
animated
:
YES
];
CLog
(
@"a"
);
}
-
(
void
)
hideSortView
{
CommodityManagementViewController
*
commodityVC
=
(
CommodityManagementViewController
*
)[
self
viewController
];
[
commodityVC
.
sorView
hide
];
}
}
/*
/*
// Only override drawRect: if you perform custom drawing.
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
// An empty implementation adversely affects performance during animation.
...
...
ALand/CodeClass/Home/View/CommodityManagementTopView.xib
View file @
38c92318
...
@@ -17,19 +17,13 @@
...
@@ -17,19 +17,13 @@
<state
key=
"normal"
title=
"添加商品"
image=
"commodityManage_add"
>
<state
key=
"normal"
title=
"添加商品"
image=
"commodityManage_add"
>
<color
key=
"titleColor"
red=
"0.066666666669999999"
green=
"0.066666666669999999"
blue=
"0.066666666669999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<color
key=
"titleColor"
red=
"0.066666666669999999"
green=
"0.066666666669999999"
blue=
"0.066666666669999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
</state>
</state>
<connections>
<action
selector=
"addAct:"
destination=
"-1"
eventType=
"touchUpInside"
id=
"aJF-tW-db7"
/>
</connections>
</button>
</button>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"uY6-mf-dlQ"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
translatesAutoresizingMaskIntoConstraints=
"NO"
id=
"uY6-mf-dlQ"
>
<rect
key=
"frame"
x=
"160"
y=
"10"
width=
"160"
height=
"110"
/>
<rect
key=
"frame"
x=
"160"
y=
"10"
width=
"160"
height=
"110"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"19"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"19"
/>
<state
key=
"normal"
title=
"
商品
管理"
image=
"commodityManage_Manager"
>
<state
key=
"normal"
title=
"
批量
管理"
image=
"commodityManage_Manager"
>
<color
key=
"titleColor"
red=
"0.066666666669999999"
green=
"0.066666666669999999"
blue=
"0.066666666669999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<color
key=
"titleColor"
red=
"0.066666666669999999"
green=
"0.066666666669999999"
blue=
"0.066666666669999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
</state>
</state>
<connections>
<action
selector=
"managementAct:"
destination=
"iN0-l3-epB"
eventType=
"touchUpInside"
id=
"PVf-zg-LlH"
/>
</connections>
</button>
</button>
</subviews>
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"calibratedWhite"
/>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"calibratedWhite"
/>
...
@@ -46,8 +40,8 @@
...
@@ -46,8 +40,8 @@
</constraints>
</constraints>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<connections>
<connections>
<outlet
property=
"buttonAdd
"
destination=
"y9I-zx-duH"
id=
"l6u-3V-Nwc
"
/>
<outlet
property=
"buttonAdd
Commodity"
destination=
"y9I-zx-duH"
id=
"2j0-Vu-t3o
"
/>
<outlet
property=
"buttonManage
ment"
destination=
"uY6-mf-dlQ"
id=
"Msy-US-Iyp
"
/>
<outlet
property=
"buttonManage
Commodity"
destination=
"uY6-mf-dlQ"
id=
"s4Q-Bm-ivS
"
/>
</connections>
</connections>
<point
key=
"canvasLocation"
x=
"300"
y=
"-26"
/>
<point
key=
"canvasLocation"
x=
"300"
y=
"-26"
/>
</view>
</view>
...
...
ALand/CodeClass/Home/View/CommodityTableViewCell.m
View file @
38c92318
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
self
.
labelTitle
.
text
=
model
.
name
;
self
.
labelTitle
.
text
=
model
.
name
;
self
.
labelPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.0f"
,
model
.
price
];
self
.
labelPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%.0f"
,
model
.
price
];
self
.
labelBrokerageRate
.
text
=
[
NSString
stringWithFormat
:
@"%.2f"
,
model
.
commission
];
self
.
labelBrokerageRate
.
text
=
[
NSString
stringWithFormat
:
@"%.2f"
,
model
.
commission
];
self
.
labelSaleNumber
.
text
=
[
NSString
stringWithFormat
:
@"销量:%.0f"
,
model
.
salesVolume
];
}
}
...
...
ALand/CodeClass/Home/ViewController/CommodityManagementViewController.m
View file @
38c92318
...
@@ -16,6 +16,9 @@
...
@@ -16,6 +16,9 @@
#import "Conditions.h"
#import "Conditions.h"
#import "CommodityDetailViewController.h"
#import "CommodityDetailViewController.h"
#import "JavenSortView.h"
#import "JavenSortView.h"
#import "AddCommodityViewController.h"
#define kCellID @"commodityCell"
#define kCellID @"commodityCell"
#define kPageSize @999
#define kPageSize @999
#define kCellId @"CommodityTableViewCell.h"
#define kCellId @"CommodityTableViewCell.h"
...
@@ -34,6 +37,9 @@
...
@@ -34,6 +37,9 @@
@property
(
nonatomic
,
strong
)
UIView
*
titleView
;
@property
(
nonatomic
,
strong
)
UIView
*
titleView
;
@property
(
nonatomic
,
strong
)
UIView
*
searchTitleView
;
@property
(
nonatomic
,
strong
)
UIView
*
searchTitleView
;
@property
(
nonatomic
,
assign
)
BOOL
isLeft
;
//判断排序判断选中了左边还是右边
@property
(
nonatomic
,
assign
)
NSInteger
row
;
//判断排序判断选中了哪一行
...
@@ -51,7 +57,9 @@
...
@@ -51,7 +57,9 @@
[
self
setUpNavigationbar
];
[
self
setUpNavigationbar
];
[
self
setUpViews
];
[
self
setUpViews
];
[
self
setUpSearchBar
];
[
self
setUpSearchBar
];
[
self
setUpData
];
[
self
.
topView
.
buttonAddCommodity
addTarget
:
self
action
:
@selector
(
addCommodityAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
topView
.
buttonManageCommodity
addTarget
:
self
action
:
@selector
(
manageManentAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
}
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
@@ -77,10 +85,8 @@
...
@@ -77,10 +85,8 @@
-
(
void
)
cancelSearchAction
{
-
(
void
)
cancelSearchAction
{
self
.
searchText
=
@""
;
self
.
searchText
=
@""
;
self
.
condition
=
@"shop online only"
;
self
.
condition
=
@"shop online only"
;
self
.
searchBar
.
width
=
0
;
self
.
searchBar
.
width
=
0
;
self
.
searchBar
.
centerX
=
(
kWidth
-
100
)
/
2
;
self
.
searchBar
.
centerX
=
(
kWidth
-
100
)
/
2
;
self
.
navigationItem
.
titleView
=
self
.
titleView
;
self
.
navigationItem
.
titleView
=
self
.
titleView
;
self
.
navigationItem
.
rightBarButtonItem
=
self
.
rightItem
;
self
.
navigationItem
.
rightBarButtonItem
=
self
.
rightItem
;
}
}
...
@@ -89,7 +95,6 @@
...
@@ -89,7 +95,6 @@
-
(
void
)
setUpNavigationbar
{
-
(
void
)
setUpNavigationbar
{
self
.
navigationItem
.
title
=
@"商品管理"
;
self
.
navigationItem
.
title
=
@"商品管理"
;
self
.
titleView
=
self
.
navigationItem
.
titleView
;
self
.
titleView
=
self
.
navigationItem
.
titleView
;
self
.
rightItem
=
[[
UIBarButtonItem
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"searchIcon"
]
style
:
UIBarButtonItemStyleDone
target
:
self
action
:
@selector
(
searchAct
)];
self
.
rightItem
=
[[
UIBarButtonItem
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"searchIcon"
]
style
:
UIBarButtonItemStyleDone
target
:
self
action
:
@selector
(
searchAct
)];
self
.
rightItem
.
tintColor
=
kTextColorDarkGray
;
self
.
rightItem
.
tintColor
=
kTextColorDarkGray
;
self
.
navigationItem
.
rightBarButtonItem
=
self
.
rightItem
;
self
.
navigationItem
.
rightBarButtonItem
=
self
.
rightItem
;
...
@@ -102,8 +107,8 @@
...
@@ -102,8 +107,8 @@
//设置现在默认选中的排序方式
//设置现在默认选中的排序方式
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
self
.
topView
.
isLeft
=
YES
;
//
self.topView.isLeft = YES;
self
.
topView
.
row
=
0
;
//
self.topView.row = 0;
WS
(
weakSelf
)
WS
(
weakSelf
)
self
.
sorView
.
leftTableSelect
=
^
(
NSInteger
row
){
self
.
sorView
.
leftTableSelect
=
^
(
NSInteger
row
){
...
@@ -124,8 +129,8 @@
...
@@ -124,8 +129,8 @@
-
(
void
)
leftSelectCodtition
:
(
NSInteger
)
row
{
-
(
void
)
leftSelectCodtition
:
(
NSInteger
)
row
{
self
.
topView
.
isLeft
=
YES
;
self
.
isLeft
=
YES
;
self
.
topView
.
row
=
row
;
self
.
row
=
row
;
switch
(
row
)
{
switch
(
row
)
{
case
0
:
case
0
:
...
@@ -155,8 +160,8 @@
...
@@ -155,8 +160,8 @@
}
}
-
(
void
)
rightSelectCondition
:
(
NSInteger
)
row
{
-
(
void
)
rightSelectCondition
:
(
NSInteger
)
row
{
self
.
topView
.
isLeft
=
NO
;
self
.
isLeft
=
NO
;
self
.
topView
.
row
=
row
;
self
.
row
=
row
;
switch
(
row
)
{
switch
(
row
)
{
...
@@ -174,7 +179,7 @@
...
@@ -174,7 +179,7 @@
break
;
break
;
case
2
:
case
2
:
{
{
self
.
field
=
@"
brokerageRate
"
;
self
.
field
=
@"
commission
"
;
self
.
direction
=
@"desc"
;
self
.
direction
=
@"desc"
;
}
}
break
;
break
;
...
@@ -255,6 +260,33 @@
...
@@ -255,6 +260,33 @@
self
.
navigationItem
.
rightBarButtonItem
=
cancelSearch
;
self
.
navigationItem
.
rightBarButtonItem
=
cancelSearch
;
}
}
//添加商品
-
(
void
)
addCommodityAction
{
[
self
.
sorView
hide
];
AddCommodityViewController
*
addVC
=
[[
AddCommodityViewController
alloc
]
init
];
addVC
.
hidesBottomBarWhenPushed
=
YES
;
addVC
.
isShowNavigationBar
=
YES
;
[
self
.
navigationController
pushViewController
:
addVC
animated
:
YES
];
CLog
(
@"a"
);
}
//商品管理
-
(
void
)
manageManentAction
{
ManagementViewController
*
manageVC
=
[[
ManagementViewController
alloc
]
init
];
[
self
.
sorView
hide
];
manageVC
.
isShowNavigationBar
=
YES
;
manageVC
.
arrCellData
=
[
self
.
arrItemDatas
mutableCopy
];
manageVC
.
isLeft
=
self
.
isLeft
;
manageVC
.
row
=
self
.
row
;
[
self
.
navigationController
pushViewController
:
manageVC
animated
:
YES
];
CLog
(
@"m"
);
}
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
self
.
navigationController
.
navigationBar
endEditing
:
YES
];
[
self
.
navigationController
.
navigationBar
endEditing
:
YES
];
...
@@ -284,7 +316,7 @@
...
@@ -284,7 +316,7 @@
{
{
CommodityDetailViewController
*
detailVC
=
[[
CommodityDetailViewController
alloc
]
init
];
CommodityDetailViewController
*
detailVC
=
[[
CommodityDetailViewController
alloc
]
init
];
detailVC
.
model
=
self
.
arrItemDatas
[
indexPath
.
row
];
detailVC
.
model
=
self
.
arrItemDatas
[
indexPath
.
row
];
CommodityTableViewCell
*
cell
=
(
CommodityTableViewCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
CommodityTableViewCell
*
cell
=
(
CommodityTableViewCell
*
)[
tableView
cellForRowAtIndexPath
:
indexPath
];
detailVC
.
image
=
cell
.
imgView
.
image
;
detailVC
.
image
=
cell
.
imgView
.
image
;
[
self
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
detailVC
animated
:
YES
];
...
@@ -320,7 +352,8 @@
...
@@ -320,7 +352,8 @@
if
(
!
_topView
)
{
if
(
!
_topView
)
{
_topView
=
[
CommodityManagementTopView
viewWithNibName
:
@"CommodityManagementTopView"
];
_topView
=
[
CommodityManagementTopView
viewWithNibName
:
@"CommodityManagementTopView"
];
_topView
.
frame
=
CGRectMake
(
0
,
0
,
kWidth
,
64
+
64
);
_topView
.
frame
=
CGRectMake
(
0
,
0
,
kWidth
,
64
+
64
);
_topView
.
arrDatas
=
self
.
arrItemDatas
;
// _topView.arrDatas = self.arrItemDatas;
}
}
return
_topView
;
return
_topView
;
}
}
...
...
ALand/CodeClass/Home/ViewController/ManagementViewController.h
View file @
38c92318
...
@@ -15,5 +15,7 @@
...
@@ -15,5 +15,7 @@
@property
(
nonatomic
,
assign
)
BOOL
isLeft
;
//判断排序判断选中了左边还是右边
@property
(
nonatomic
,
assign
)
BOOL
isLeft
;
//判断排序判断选中了左边还是右边
@property
(
nonatomic
,
assign
)
NSInteger
row
;
//判断排序判断选中了哪一行
@property
(
nonatomic
,
assign
)
NSInteger
row
;
//判断排序判断选中了哪一行
@property
(
nonatomic
,
copy
)
NSString
*
condition
;
@property
(
nonatomic
,
copy
)
NSString
*
condition
;
@property
(
nonatomic
,
copy
)
NSString
*
field
;
//排序的字段
@property
(
nonatomic
,
copy
)
NSString
*
direction
;
//排序的顺序 升序或降序
@end
@end
ALand/CodeClass/Home/ViewController/ManagementViewController.m
View file @
38c92318
...
@@ -20,8 +20,7 @@
...
@@ -20,8 +20,7 @@
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
UITableView
*
tableView
;
@property
(
nonatomic
,
strong
)
CommodityMutipleSelectBottomView
*
bottomView
;
@property
(
nonatomic
,
strong
)
CommodityMutipleSelectBottomView
*
bottomView
;
@property
(
nonatomic
,
assign
)
NSInteger
page
;
@property
(
nonatomic
,
assign
)
NSInteger
page
;
@property
(
nonatomic
,
copy
)
NSString
*
field
;
//排序的字段
@property
(
nonatomic
,
copy
)
NSString
*
direction
;
//排序的顺序 升序或降序
@property
(
nonatomic
,
strong
)
NSMutableArray
*
deleteArr
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
deleteArr
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
dicSelectIds
;
@property
(
nonatomic
,
strong
)
NSMutableDictionary
*
dicSelectIds
;
@end
@end
...
@@ -119,7 +118,7 @@
...
@@ -119,7 +118,7 @@
break
;
break
;
case
2
:
case
2
:
{
{
self
.
field
=
@"
brokerageRate
"
;
self
.
field
=
@"
commission
"
;
self
.
direction
=
@"desc"
;
self
.
direction
=
@"desc"
;
}
}
break
;
break
;
...
@@ -141,7 +140,7 @@
...
@@ -141,7 +140,7 @@
//改变排序条件之后重新请求数据
//改变排序条件之后重新请求数据
-
(
void
)
resetReloadData
{
-
(
void
)
resetReloadData
{
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
//
[self.sorView defaultSelectISLeft:YES row:0];
[
self
.
arrCellData
removeAllObjects
];
[
self
.
arrCellData
removeAllObjects
];
[
self
setUpData
];
[
self
setUpData
];
...
@@ -183,30 +182,28 @@
...
@@ -183,30 +182,28 @@
#pragma mark =========== action ===========
#pragma mark =========== action ===========
-
(
void
)
selectAll
:
(
UIButton
*
)
btn
{
//tag 等于1表示全选
-
(
void
)
selectAll
:
(
UIButton
*
)
btn
{
if
(
btn
.
tag
==
0
)
{
[
self
.
bottomView
selectAll
];
if
(
self
.
dicSelectIds
.
allKeys
.
count
==
self
.
arrCellData
.
count
)
{
//全选
[
self
.
bottomView
deselectAll
];
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
[
self
.
tableView
selectRowAtIndexPath
:
indexPath
animated
:
YES
scrollPosition
:
UITableViewScrollPositionTop
];
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
setValue
:
@""
forKey
:
model
.
uuid
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
}
}
btn
.
tag
=
1
;
}
else
{
}
else
{
[
self
.
bottomView
de
selectAll
];
[
self
.
bottomView
selectAll
];
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
[
self
.
tableView
selectRowAtIndexPath
:
indexPath
animated
:
YES
scrollPosition
:
UITableViewScrollPositionTop
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
[
self
.
dicSelectIds
setValue
:
@""
forKey
:
model
.
uuid
];
}
}
btn
.
tag
=
0
;
}
}
}
}
...
@@ -242,6 +239,8 @@
...
@@ -242,6 +239,8 @@
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
setValue
:
@""
forKey
:
model
.
uuid
];
[
self
.
dicSelectIds
setValue
:
@""
forKey
:
model
.
uuid
];
[
self
checkIsAllSelect
];
CLog
(
@"%@"
,
self
.
dicSelectIds
.
allKeys
);
CLog
(
@"%@"
,
self
.
dicSelectIds
.
allKeys
);
}
}
...
@@ -249,6 +248,7 @@
...
@@ -249,6 +248,7 @@
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
CLog
(
@"%@"
,
self
.
dicSelectIds
.
allKeys
);
CLog
(
@"%@"
,
self
.
dicSelectIds
.
allKeys
);
[
self
checkIsAllSelect
];
}
}
...
@@ -281,41 +281,65 @@
...
@@ -281,41 +281,65 @@
}
}
NSArray
*
arrGoodsUuid
=
self
.
dicSelectIds
.
allKeys
;
NSArray
*
arrGoodsUuid
=
self
.
dicSelectIds
.
allKeys
;
NSDictionary
*
params
=
@{
@"operCtx"
:
@{
@"time"
:
[[
NSDate
date
]
timeStampNumber
],
@"domain"
:
[
UserInfo
shareInstance
].
domain
,
@"operator"
:
@{
@"id"
:
[
UserInfo
shareInstance
].
uuid
,
@"fullName"
:
[
UserInfo
shareInstance
].
name
}},
@"shopUuid"
:
[
UserInfo
shareInstance
].
shop
.
uuid
,
@"listGoodsUuid"
:
arrGoodsUuid
};
WS
(
weakSelf
)
if
(
arrGoodsUuid
.
count
==
0
)
{
[[
HTTPCilent
shareCilent
]
POST
:
questUrl
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
MBProgressHUD
*
hud
=
[[
MBProgressHUD
alloc
]
initWithView
:
weakSelf
.
view
];
[
MBProgressHUD
Javen_showError
:
@"请至少选择一件商品"
onView
:
self
.
view
delay
:
0
.
6
complete
:
nil
];
[
self
.
view
addSubview
:
hud
];
if
([
responseObject
[
@"code"
]
isEqualToNumber
:
@0
])
{
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Checkmark"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysTemplate
];
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
imageView
.
tintColor
=
kSysWhite
;
hud
.
customView
=
imageView
;
hud
.
mode
=
MBProgressHUDModeCustomView
;
hud
.
labelText
=
@"操作成功!"
;
[
weakSelf
.
dicSelectIds
removeAllObjects
];
[
weakSelf
resetReloadData
];
}
else
{
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
labelText
=
@"未知错误!"
;
}
[
hud
show
:
YES
];
[
hud
hide
:
YES
afterDelay
:
0
.
7
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
else
{
NSDictionary
*
params
=
@{
@"operCtx"
:
@{
@"time"
:
[[
NSDate
date
]
timeStampNumber
],
@"domain"
:
[
UserInfo
shareInstance
].
domain
,
@"operator"
:
@{
@"id"
:
[
UserInfo
shareInstance
].
uuid
,
@"fullName"
:
[
UserInfo
shareInstance
].
name
}},
@"shopUuid"
:
[
UserInfo
shareInstance
].
shop
.
uuid
,
@"listGoodsUuid"
:
arrGoodsUuid
};
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
questUrl
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
[
weakSelf
unparseData
:
responseObject
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
}
}
//解析数据
-
(
void
)
unparseData
:
(
NSDictionary
*
)
responseObject
{
MBProgressHUD
*
hud
=
[[
MBProgressHUD
alloc
]
initWithView
:
self
.
view
];
[
self
.
view
addSubview
:
hud
];
if
([
responseObject
[
@"code"
]
isEqualToNumber
:
@0
])
{
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Checkmark"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysTemplate
];
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
imageView
.
tintColor
=
kSysWhite
;
hud
.
customView
=
imageView
;
hud
.
mode
=
MBProgressHUDModeCustomView
;
hud
.
labelText
=
@"操作成功!"
;
[
self
.
dicSelectIds
removeAllObjects
];
[
self
resetReloadData
];
}
else
{
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
labelText
=
@"未知错误!"
;
}
[
hud
show
:
YES
];
[
hud
hide
:
YES
afterDelay
:
0
.
7
];
}
//检查是否全部选中了
-
(
void
)
checkIsAllSelect
{
CLog
(
@"%lu %lu"
,
(
unsigned
long
)
self
.
dicSelectIds
.
allKeys
.
count
,
(
unsigned
long
)
self
.
arrCellData
.
count
);
if
(
self
.
dicSelectIds
.
allKeys
.
count
==
self
.
arrCellData
.
count
)
{
[
self
.
bottomView
selectAll
];
}
else
{
[
self
.
bottomView
deselectAll
];
}
}
-
(
void
)
popAction
{
-
(
void
)
popAction
{
[
super
popAction
];
[
super
popAction
];
[
self
.
sorView
hide
];
[
self
.
sorView
hide
];
...
...
ALand/General/Categories/MBProgressHUD+Javen.m
View file @
38c92318
...
@@ -131,7 +131,7 @@
...
@@ -131,7 +131,7 @@
{
{
MBProgressHUD
*
hud
=
[[
MBProgressHUD
alloc
]
initWithView
:
view
];
MBProgressHUD
*
hud
=
[[
MBProgressHUD
alloc
]
initWithView
:
view
];
[
view
addSubview
:
hud
];
[
view
addSubview
:
hud
];
hud
.
labelText
=
@"修改中"
;
hud
.
labelText
=
message
;
[
hud
show
:
YES
];
[
hud
show
:
YES
];
return
hud
;
return
hud
;
}
}
...
...
ALand/Global/JavenSortView.m
View file @
38c92318
...
@@ -172,6 +172,7 @@
...
@@ -172,6 +172,7 @@
space
=
@"left"
;
space
=
@"left"
;
[
self
leftAction
:
nil
];
[
self
leftAction
:
nil
];
[
self
setLeftBtnTitle
:
self
.
arrTitles
[
indexPath
.
row
]];
[
self
setLeftBtnTitle
:
self
.
arrTitles
[
indexPath
.
row
]];
CLog
(
@"%@"
,
self
.
arrTitles
[
indexPath
.
row
]);
[
self
.
leftBtn
setTitleColor
:
kCustomGreenColor
forState
:
UIControlStateNormal
];
[
self
.
leftBtn
setTitleColor
:
kCustomGreenColor
forState
:
UIControlStateNormal
];
[
self
.
rightBtn
setTitleColor
:
kTextColorBlack
forState
:
UIControlStateNormal
];
[
self
.
rightBtn
setTitleColor
:
kTextColorBlack
forState
:
UIControlStateNormal
];
self
.
leftTableSelect
(
indexPath
.
row
);
self
.
leftTableSelect
(
indexPath
.
row
);
...
...
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