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
e5d8c074
Commit
e5d8c074
authored
May 06, 2016
by
Sandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品管理 bug fix
parent
c8653d5d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
52 deletions
+60
-52
CommodityManagementViewController.m
...s/Home/ViewController/CommodityManagementViewController.m
+29
-25
ManagementViewController.m
.../CodeClass/Home/ViewController/ManagementViewController.m
+30
-27
JavenSortView.m
ALand/Global/JavenSortView.m
+1
-0
No files found.
ALand/CodeClass/Home/ViewController/CommodityManagementViewController.m
View file @
e5d8c074
...
...
@@ -58,8 +58,9 @@
[
self
setUpViews
];
[
self
setUpSearchBar
];
[
self
.
topView
.
buttonAddCommodity
addTarget
:
self
action
:
@selector
(
addCommodityAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
topView
.
buttonManageCommodity
addTarget
:
self
action
:
@selector
(
manageManentAction
)
forControlEvents
:
UIControlEventTouchUpInside
];
kButtonAddAction
(
self
.
topView
.
buttonAddCommodity
,
addCommodityAction
)
kButtonAddAction
(
self
.
topView
.
buttonManageCommodity
,
manageManentAction
)
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
...
...
@@ -107,8 +108,6 @@
//设置现在默认选中的排序方式
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
// self.topView.isLeft = YES;
// self.topView.row = 0;
WS
(
weakSelf
)
self
.
sorView
.
leftTableSelect
=
^
(
NSInteger
row
){
...
...
@@ -121,7 +120,6 @@
CLog
(
@"r"
);
};
//
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
[
self
.
view
addSubview
:
_tableView
];
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomEqualToView
(
self
.
view
);
...
...
@@ -208,6 +206,23 @@
}
-
(
void
)
setUpData
{
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:[
self
getParams
]
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrItemDatas
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
-
(
NSDictionary
*
)
getParams
{
UserInfo
*
info
=
[
UserInfo
shareInstance
];
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
...
...
@@ -225,22 +240,11 @@
@"pageSize"
:
kPageSize
,
@"page"
:
@0
},
@"fetchParts"
:
@[
@"string"
]};
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrItemDatas
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
return
params
;
}
#pragma mark =========== action ===========
-
(
void
)
searchAct
{
...
...
ALand/CodeClass/Home/ViewController/ManagementViewController.m
View file @
e5d8c074
...
...
@@ -54,6 +54,8 @@
[
weakSelf
rightSelectCondition
:
row
];
CLog
(
@"r"
);
};
_tableView
=
[
UITableView
plainTableViewWithTarget
:
self
cellNibName
:
@"CommodityTableViewCell"
cellId
:
kCellId
];
[
self
.
view
addSubview
:
_tableView
];
_tableView
.
sd_layout
.
topSpaceToView
(
self
.
sorView
,
0
).
leftEqualToView
(
self
.
view
).
rightEqualToView
(
self
.
view
).
bottomSpaceToView
(
self
.
view
,
70
);
...
...
@@ -150,6 +152,22 @@
-
(
void
)
setUpData
{
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:[
self
getParams
]
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrCellData
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
-
(
NSDictionary
*
)
getParams
{
NSDictionary
*
params
=
@{
@"defintion"
:
@{
@"probePages"
:
@0
,
@"orders"
:
@[@{
@"field"
:
self
.
field
,
@"direction"
:
self
.
direction
}],
...
...
@@ -165,20 +183,10 @@
@"pageSize"
:
kPageSize
,
@"page"
:
@0
},
@"fetchParts"
:
@[
@"string"
]};
return
params
;
}
WS
(
weakSelf
)
[[
HTTPCilent
shareCilent
]
POST
:
@"goods/query2"
parameters
:
params
success
:^
(
NSURLSessionDataTask
*
task
,
id
responseObject
)
{
for
(
NSDictionary
*
dic
in
responseObject
[
@"queryResult"
])
{
CommotityListModel
*
model
=
[
CommotityListModel
modelObjectWithDictionary
:
dic
];
[
weakSelf
.
arrCellData
addObject
:
model
];
}
[
weakSelf
.
tableView
reloadData
];
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
}];
}
#pragma mark =========== action ===========
...
...
@@ -187,9 +195,9 @@
if
(
self
.
dicSelectIds
.
allKeys
.
count
==
self
.
arrCellData
.
count
)
{
//全选
[
self
.
bottomView
deselectAll
];
for
(
int
i
=
0
;
i
<
self
.
arrCellData
.
count
;
i
++
)
{
NSIndexPath
*
indexPath
=
[
NSIndexPath
indexPathForItem
:
i
inSection
:
0
];
[
self
.
tableView
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
CommotityListModel
*
model
=
self
.
arrCellData
[
indexPath
.
row
];
[
self
.
dicSelectIds
removeObjectForKey
:
model
.
uuid
];
...
...
@@ -308,24 +316,19 @@
//解析数据
-
(
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
=
@"操作成功!"
;
[
MBProgressHUD
Javen_showSuccess
:
@"操作成功!"
onView
:
self
.
view
delay
:
0
.
7
complete
:
nil
];
[
self
.
dicSelectIds
removeAllObjects
];
[
self
.
sorView
defaultSelectISLeft
:
YES
row
:
0
];
[
self
resetReloadData
];
}
else
{
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
labelText
=
@"未知错误!"
;
[
MBProgressHUD
Javen_showError
:
@"未知错误!"
onView
:
self
.
view
delay
:
0
.
7
complete
:
nil
];
}
[
hud
show
:
YES
];
[
hud
hide
:
YES
afterDelay
:
0
.
7
];
[
self
.
bottomView
deselectAll
];
}
//检查是否全部选中了
...
...
ALand/Global/JavenSortView.m
View file @
e5d8c074
...
...
@@ -323,6 +323,7 @@
-
(
void
)
defaultSelectISLeft
:
(
BOOL
)
isLeft
row
:
(
NSInteger
)
row
{
self
.
selectedMark
=
row
;
if
(
isLeft
)
{
self
.
isLeft
=
YES
;
self
.
arrTitles
=
self
.
arrLeft
;
...
...
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