Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
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
张杰
Opple-iOS
Commits
065f1661
Commit
065f1661
authored
Aug 08, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
727ada4c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
323 additions
and
355 deletions
+323
-355
AllCustomerViewController.m
Lighting/Class/AllCustomerViewController.m
+16
-16
ChangePasswordViewController.m
Lighting/Class/ChangePasswordViewController.m
+9
-8
ClientViewController.m
Lighting/Class/ClientViewController.m
+9
-13
ClientdetailsViewController.m
Lighting/Class/ClientdetailsViewController.m
+35
-26
CustomerOrderViewController.m
Lighting/Class/CustomerOrderViewController.m
+14
-15
LoginViewController.m
Lighting/Class/Login/LoginViewController.m
+20
-19
OrderdetailsViewController.h
Lighting/Class/OrderdetailsViewController.h
+0
-5
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+0
-3
ProductDetailsViewController.m
Lighting/Class/ProductDetailsViewController.m
+9
-28
ProductLibraryViewController.m
Lighting/Class/ProductLibraryViewController.m
+25
-25
SceneLibraryViewController.m
Lighting/Class/SceneLibraryViewController.m
+17
-15
SettlementViewController.m
Lighting/Class/SettlementViewController.m
+7
-6
AddressViewController.m
Lighting/Class/Shoppingcart/AddressViewController.m
+38
-36
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+10
-9
ShoppingTableViewCell.h
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
+2
-2
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+14
-23
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+51
-67
UserViewController.m
Lighting/Class/UserViewController.m
+18
-17
project.pbxproj
Lighting/Lighting.xcodeproj/project.pbxproj
+6
-6
PrefixHeader.pch
Lighting/Tools/PrefixHeader.pch
+8
-2
SceneViewController.m
Lighting/Tools/SceneViewController.m
+3
-3
ShoppingBagViewController.m
Lighting/Tools/ShoppingBagViewController.m
+12
-11
No files found.
Lighting/Class/AllCustomerViewController.m
View file @
065f1661
...
@@ -108,8 +108,6 @@
...
@@ -108,8 +108,6 @@
self
.
enddateButton
.
layer
.
masksToBounds
=
YES
;
self
.
enddateButton
.
layer
.
masksToBounds
=
YES
;
self
.
enddateButton
.
layer
.
cornerRadius
=
10
;
self
.
enddateButton
.
layer
.
cornerRadius
=
10
;
//经销商代码
self
.
conditionModel
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
//下拉刷新
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
...
@@ -117,6 +115,8 @@
...
@@ -117,6 +115,8 @@
page
.
rows
=
KROWS
;
page
.
rows
=
KROWS
;
self
.
conditionModel
.
page
=
page
;
self
.
conditionModel
.
page
=
page
;
[
self
.
allCustomerTableview
.
mj_footer
resetNoMoreData
];
[
self
.
allCustomerTableview
.
mj_footer
resetNoMoreData
];
//经销商代码
self
.
conditionModel
.
resellerCodeEquals
=
[[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
orgCode
];
[
self
getShoppersAssociatedCustomer
:
self
.
conditionModel
isRemove
:
YES
];
[
self
getShoppersAssociatedCustomer
:
self
.
conditionModel
isRemove
:
YES
];
}];
}];
headerRefresh
.
stateLabel
.
hidden
=
YES
;
headerRefresh
.
stateLabel
.
hidden
=
YES
;
...
@@ -145,20 +145,20 @@
...
@@ -145,20 +145,20 @@
#pragma mark -获取导购关联客户
#pragma mark -获取导购关联客户
-
(
void
)
getShoppersAssociatedCustomer
:
(
ConsumerQueryCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
-
(
void
)
getShoppersAssociatedCustomer
:
(
ConsumerQueryCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
GETSHOPPERSCONSUMER
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
GETSHOPPERSCONSUMER
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
self
.
allCustomerTableview
.
emptyDataSetSource
=
s
elf
;
weakSelf
.
allCustomerTableview
.
emptyDataSetSource
=
weakS
elf
;
self
.
allCustomerTableview
.
emptyDataSetDelegate
=
s
elf
;
weakSelf
.
allCustomerTableview
.
emptyDataSetDelegate
=
weakS
elf
;
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
endRefreshingForTableView
:
self
.
allCustomerTableview
];
[
weakS
elf
endRefreshingForTableView
:
self
.
allCustomerTableview
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
if
(
remove
)
{
[
s
elf
.
CustomerresultArray
removeAllObjects
];
[
weakS
elf
.
CustomerresultArray
removeAllObjects
];
}
}
ConsumerPageResult
*
Customerresult
=
[[
ConsumerPageResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
ConsumerPageResult
*
Customerresult
=
[[
ConsumerPageResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
for
(
TOConsumerEntity
*
objc
in
Customerresult
.
results
)
{
for
(
TOConsumerEntity
*
objc
in
Customerresult
.
results
)
{
MyclientEntityModel
*
myclientModel
=
[[
MyclientEntityModel
alloc
]
init
];
MyclientEntityModel
*
myclientModel
=
[[
MyclientEntityModel
alloc
]
init
];
...
@@ -177,24 +177,24 @@
...
@@ -177,24 +177,24 @@
myclientModel
.
company
=
objc
.
company
;
myclientModel
.
company
=
objc
.
company
;
myclientModel
.
lastVisitedTime
=
objc
.
lastVisitedTime
;
myclientModel
.
lastVisitedTime
=
objc
.
lastVisitedTime
;
[
s
elf
.
CustomerresultArray
addObject
:
myclientModel
];
[
weakS
elf
.
CustomerresultArray
addObject
:
myclientModel
];
}
}
[
s
elf
.
allCustomerTableview
reloadData
];
[
weakS
elf
.
allCustomerTableview
reloadData
];
}
}
else
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
endRefreshingForTableView
:
s
elf
.
allCustomerTableview
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
allCustomerTableview
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
...
Lighting/Class/ChangePasswordViewController.m
View file @
065f1661
...
@@ -83,28 +83,29 @@
...
@@ -83,28 +83,29 @@
modify
.
employeeId
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
;
modify
.
employeeId
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
;
//修改密码
//修改密码
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODIFYPASSWORD
)
WithRequestType
:
0
WithParameter
:
modify
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODIFYPASSWORD
)
WithRequestType
:
0
WithParameter
:
modify
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//保存最新的账号信息
//保存最新的账号信息
[
Shoppersmanager
manager
].
passWordString
=
s
elf
.
NewPassWord
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
weakS
elf
.
NewPassWord
.
text
;
[
s
elf
SuccessMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
SuccessMBProgressView
:
returnValue
[
@"message"
]];
if
([
s
elf
.
delegate
respondsToSelector
:
@selector
(
cancelButtonClick
)])
{
if
([
weakS
elf
.
delegate
respondsToSelector
:
@selector
(
cancelButtonClick
)])
{
[
s
elf
.
delegate
cancelButtonClick
];
[
weakS
elf
.
delegate
cancelButtonClick
];
}
}
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
...
...
Lighting/Class/ClientViewController.m
View file @
065f1661
...
@@ -55,20 +55,20 @@
...
@@ -55,20 +55,20 @@
{
{
if
(
!
_condition
)
{
if
(
!
_condition
)
{
_condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
_condition
=
[[
ConsumerQueryCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
sort
=
@"createDate"
;
page
.
order
=
@"desc"
;
self
.
condition
.
page
=
page
;
}
}
return
_condition
;
return
_condition
;
}
}
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
[
self
uiConfigAction
];
}
}
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
{
[
super
viewDidAppear
:
animated
];
[
super
viewDidAppear
:
animated
];
...
@@ -117,15 +117,13 @@
...
@@ -117,15 +117,13 @@
//清空当前客户数据
//清空当前客户数据
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
ChangeCustomerName
:
)
name
:
@"EMPTYCUSTOMERNAME"
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
ChangeCustomerName
:
)
name
:
@"EMPTYCUSTOMERNAME"
object
:
nil
];
__weak
typeof
(
self
)
weakSelf
=
self
;
WS
(
weakSelf
)
;
//下拉刷新
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
weakSelf
.
condition
.
resellerCodeEquals
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
.
orgCode
;
weakSelf
.
condition
.
resellerCodeEquals
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
.
currentDepart
.
orgCode
;
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
weakSelf
.
condition
.
page
.
page
=
1
;
page
.
page
=
1
;
weakSelf
.
condition
.
page
.
rows
=
KROWS
;
weakSelf
.
condition
.
page
=
page
;
page
.
rows
=
KROWS
;
weakSelf
.
indexPage
=
1
;
weakSelf
.
indexPage
=
1
;
[
weakSelf
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
weakSelf
.
informationTableview
.
mj_footer
resetNoMoreData
];
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
YES
];
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
YES
];
...
@@ -142,10 +140,8 @@
...
@@ -142,10 +140,8 @@
[
weakSelf
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
[
weakSelf
.
informationTableview
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
}
else
{
{
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
weakSelf
.
condition
.
page
.
page
=
weakSelf
.
indexPage
;
page
.
page
=
weakSelf
.
indexPage
;
weakSelf
.
condition
.
page
.
rows
=
KROWS
;
page
.
rows
=
KROWS
;
weakSelf
.
condition
.
page
=
page
;
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
NO
];
[
weakSelf
getShoppersAssociatedCustomer
:
weakSelf
.
condition
isRemoveArray
:
NO
];
}
}
}];
}];
...
...
Lighting/Class/ClientdetailsViewController.m
View file @
065f1661
...
@@ -179,7 +179,7 @@
...
@@ -179,7 +179,7 @@
}
}
else
if
(
self
.
orderRecordButton
.
selected
)
//订单记录
else
if
(
self
.
orderRecordButton
.
selected
)
//订单记录
{
{
if
(
++
self
.
orderRecordPage
>
self
.
orderRecordTotalPage
)
{
if
(
++
self
.
orderRecordPage
>
self
.
orderRecordTotalPage
)
{
[
self
.
ClientdetailsTableview
.
mj_footer
endRefreshingWithNoMoreData
];
[
self
.
ClientdetailsTableview
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
}
else
{
{
...
@@ -273,6 +273,13 @@
...
@@ -273,6 +273,13 @@
orderdetails
.
isDelectedButton
=
YES
;
orderdetails
.
isDelectedButton
=
YES
;
orderdetails
.
isShowPrintButton
=
YES
;
orderdetails
.
isShowPrintButton
=
YES
;
}
}
//撤销、支付回调
[
orderdetails
setDelecteAndPayButtonBlock
:
^
(
NSInteger
cellindex
,
NSString
*
orderSate
)
{
OrderBill
*
model
=
[
self
.
orderRecordArray
objectAtIndex_opple
:
cellindex
];
model
.
order
.
orderState
=
orderSate
;
NSIndexPath
*
indexapath
=
[
NSIndexPath
indexPathForRow
:
cellindex
inSection
:
0
];
[
self
.
ClientdetailsTableview
reloadRowsAtIndexPaths
:@[
indexapath
]
withRowAnimation
:
UITableViewRowAnimationNone
];
}];
[
self
.
navigationController
pushViewController
:
orderdetails
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
orderdetails
animated
:
YES
];
}
}
}
}
...
@@ -283,19 +290,20 @@
...
@@ -283,19 +290,20 @@
-
(
void
)
getShoppingCardata
:
(
ShopCartFilter
*
)
shopCar
isRemove
:
(
BOOL
)
remove
-
(
void
)
getShoppingCardata
:
(
ShopCartFilter
*
)
shopCar
isRemove
:
(
BOOL
)
remove
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
endRefreshingForTableView
:
s
elf
.
ClientdetailsTableview
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
ClientdetailsTableview
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
if
(
remove
)
{
[
s
elf
.
shopResponseArray
removeAllObjects
];
[
weakS
elf
.
shopResponseArray
removeAllObjects
];
}
}
ShopCartResponse
*
shopcar
=
[[
ShopCartResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
ShopCartResponse
*
shopcar
=
[[
ShopCartResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
shoppingBagTotalPage
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
shoppingBagTotalPage
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
if
(
shopcar
.
shopcart
.
count
==
0
)
{
if
(
shopcar
.
shopcart
.
count
==
0
)
{
[
s
elf
PromptinformationViewWithimage
:
TCImage
(
@"ablum-副本"
)
withTitle
:
@"暂无购物袋信息~"
withpoint
:
CGPointMake
(
ScreenHeight
/
2
,
ScreenWidth
/
2
)];
[
weakS
elf
PromptinformationViewWithimage
:
TCImage
(
@"ablum-副本"
)
withTitle
:
@"暂无购物袋信息~"
withpoint
:
CGPointMake
(
ScreenHeight
/
2
,
ScreenWidth
/
2
)];
[
self
endRefreshingForTableView
:
s
elf
.
ClientdetailsTableview
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
ClientdetailsTableview
];
}
}
//自定义属性
//自定义属性
for
(
TOShopcartEntity
*
objc
in
shopcar
.
shopcart
)
{
for
(
TOShopcartEntity
*
objc
in
shopcar
.
shopcart
)
{
...
@@ -313,21 +321,21 @@
...
@@ -313,21 +321,21 @@
model
.
goodsNum
=
objc
.
goodsNum
;
model
.
goodsNum
=
objc
.
goodsNum
;
model
.
consumerId
=
objc
.
consumerId
;
model
.
consumerId
=
objc
.
consumerId
;
[
s
elf
.
shopResponseArray
addObject
:
model
];
[
weakS
elf
.
shopResponseArray
addObject
:
model
];
}
}
[
s
elf
.
ClientdetailsTableview
reloadData
];
[
weakS
elf
.
ClientdetailsTableview
reloadData
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -337,36 +345,37 @@
...
@@ -337,36 +345,37 @@
-
(
void
)
getGuideAllcustomerOrder
:
(
OrderFilter
*
)
allOrder
isRemove
:
(
BOOL
)
remove
-
(
void
)
getGuideAllcustomerOrder
:
(
OrderFilter
*
)
allOrder
isRemove
:
(
BOOL
)
remove
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
0
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
0
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
ClientdetailsTableview
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
ClientdetailsTableview
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
if
(
remove
)
{
[
s
elf
.
orderRecordArray
removeAllObjects
];
[
weakS
elf
.
orderRecordArray
removeAllObjects
];
}
}
OrderResponse
*
Allorder
=
[[
OrderResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
OrderResponse
*
Allorder
=
[[
OrderResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
orderRecordTotalPage
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
orderRecordTotalPage
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
if
(
Allorder
.
orderBillList
.
count
==
0
)
{
if
(
Allorder
.
orderBillList
.
count
==
0
)
{
[
s
elf
PromptinformationViewWithimage
:
TCImage
(
@"changjingtubiao"
)
withTitle
:
@"暂无订单信息~"
withpoint
:
CGPointMake
(
ScreenHeight
/
2
,
ScreenWidth
/
2
)];
[
weakS
elf
PromptinformationViewWithimage
:
TCImage
(
@"changjingtubiao"
)
withTitle
:
@"暂无订单信息~"
withpoint
:
CGPointMake
(
ScreenHeight
/
2
,
ScreenWidth
/
2
)];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
ClientdetailsTableview
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
ClientdetailsTableview
];
}
}
for
(
OrderBill
*
model
in
Allorder
.
orderBillList
)
{
for
(
OrderBill
*
model
in
Allorder
.
orderBillList
)
{
[
s
elf
.
orderRecordArray
addObject
:
model
];
[
weakS
elf
.
orderRecordArray
addObject
:
model
];
}
}
[
s
elf
.
ClientdetailsTableview
reloadData
];
[
weakS
elf
.
ClientdetailsTableview
reloadData
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
...
Lighting/Class/CustomerOrderViewController.m
View file @
065f1661
...
@@ -132,37 +132,37 @@
...
@@ -132,37 +132,37 @@
#pragma mark -获取导购下客户订单 ----isdelecte 表示是否清空数组
#pragma mark -获取导购下客户订单 ----isdelecte 表示是否清空数组
-
(
void
)
getGuideAllcustomerOrder
:
(
BOOL
)
isdelecte
WithorderBill
:
(
OrderFilter
*
)
allOrder
-
(
void
)
getGuideAllcustomerOrder
:
(
BOOL
)
isdelecte
WithorderBill
:
(
OrderFilter
*
)
allOrder
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
0
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
0
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
self
.
customerOrderTableView
.
emptyDataSetSource
=
s
elf
;
weakSelf
.
customerOrderTableView
.
emptyDataSetSource
=
weakS
elf
;
self
.
customerOrderTableView
.
emptyDataSetDelegate
=
s
elf
;
weakSelf
.
customerOrderTableView
.
emptyDataSetDelegate
=
weakS
elf
;
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
customerOrderTableView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
customerOrderTableView
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
isdelecte
)
{
if
(
isdelecte
)
{
[
s
elf
.
datasArray
removeAllObjects
];
[
weakS
elf
.
datasArray
removeAllObjects
];
}
}
OrderResponse
*
Allorder
=
[[
OrderResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
OrderResponse
*
Allorder
=
[[
OrderResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
for
(
OrderBill
*
model
in
Allorder
.
orderBillList
)
{
for
(
OrderBill
*
model
in
Allorder
.
orderBillList
)
{
[
s
elf
.
datasArray
addObject
:
model
];
[
weakS
elf
.
datasArray
addObject
:
model
];
}
}
[
s
elf
.
customerOrderTableView
reloadData
];
[
weakS
elf
.
customerOrderTableView
reloadData
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
endRefreshingForTableView
:
s
elf
.
customerOrderTableView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
customerOrderTableView
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -359,7 +359,6 @@
...
@@ -359,7 +359,6 @@
orderdetails
.
isDelectedButton
=
YES
;
orderdetails
.
isDelectedButton
=
YES
;
orderdetails
.
isShowPrintButton
=
YES
;
orderdetails
.
isShowPrintButton
=
YES
;
}
}
//撤销、支付回调
//撤销、支付回调
[
orderdetails
setDelecteAndPayButtonBlock
:
^
(
NSInteger
cellindex
,
NSString
*
orderSate
)
{
[
orderdetails
setDelecteAndPayButtonBlock
:
^
(
NSInteger
cellindex
,
NSString
*
orderSate
)
{
...
...
Lighting/Class/Login/LoginViewController.m
View file @
065f1661
...
@@ -164,36 +164,37 @@
...
@@ -164,36 +164,37 @@
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
login
.
username
=
self
.
userName
.
text
;
login
.
username
=
self
.
userName
.
text
;
login
.
password
=
self
.
passWord
.
text
;
login
.
password
=
self
.
passWord
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
0
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
0
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//保持导购信息
//保持导购信息
LoginResult
*
result
=
[[
LoginResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
LoginResult
*
result
=
[[
LoginResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
Shoppersmanager
manager
].
Shoppers
=
result
;
[
Shoppersmanager
manager
].
Shoppers
=
result
;
[
Shoppersmanager
manager
].
userNameString
=
s
elf
.
userName
.
text
;
[
Shoppersmanager
manager
].
userNameString
=
weakS
elf
.
userName
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
s
elf
.
passWord
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
weakS
elf
.
passWord
.
text
;
//保存用户名密码
//保存用户名密码
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
s
elf
.
userName
.
text
forKey
:
USERNAME
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
weakS
elf
.
userName
.
text
forKey
:
USERNAME
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
s
elf
.
passWord
.
text
forKey
:
PASSWORD
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
weakS
elf
.
passWord
.
text
forKey
:
PASSWORD
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[
s
elf
SetTheRootViewController
];
[
weakS
elf
SetTheRootViewController
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"网络中断"
];
[
weakS
elf
ErrorMBProgressView
:
@"网络中断"
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
s
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
weakS
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -428,26 +429,26 @@
...
@@ -428,26 +429,26 @@
passwrod
.
fnewPassword
=
self
.
resetPasswordView
.
newpass
.
text
;
passwrod
.
fnewPassword
=
self
.
resetPasswordView
.
newpass
.
text
;
passwrod
.
username
=
self
.
userName
.
text
;
passwrod
.
username
=
self
.
userName
.
text
;
passwrod
.
smsCode
=
self
.
identityView
.
verificationCode
.
text
;
passwrod
.
smsCode
=
self
.
identityView
.
verificationCode
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
RESETPASSWORD
)
WithRequestType
:
0
WithParameter
:
passwrod
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
RESETPASSWORD
)
WithRequestType
:
0
WithParameter
:
passwrod
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
s
elf
ErrorMBProgressView
:
@"重置密码成功"
];
[
weakS
elf
ErrorMBProgressView
:
@"重置密码成功"
];
self
.
passWord
.
text
=
s
elf
.
resetPasswordView
.
newpass
.
text
;
weakSelf
.
passWord
.
text
=
weakS
elf
.
resetPasswordView
.
newpass
.
text
;
[
s
elf
judgeUserNameAndPassword
];
[
weakS
elf
judgeUserNameAndPassword
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
s
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
weakS
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
...
Lighting/Class/OrderdetailsViewController.h
View file @
065f1661
...
@@ -51,16 +51,11 @@
...
@@ -51,16 +51,11 @@
*/
*/
@property
(
nonatomic
,
assign
)
BOOL
isDelectedButton
;
@property
(
nonatomic
,
assign
)
BOOL
isDelectedButton
;
/**
/**
* 撤销按钮、支付按钮完成回调
* 撤销按钮、支付按钮完成回调
*/
*/
@property
(
nonatomic
,
copy
)
void
(
^
DelecteAndPayButtonBlock
)(
NSInteger
cellindex
,
NSString
*
orderState
);
@property
(
nonatomic
,
copy
)
void
(
^
DelecteAndPayButtonBlock
)(
NSInteger
cellindex
,
NSString
*
orderState
);
/**
/**
* cell下标
* cell下标
*/
*/
...
...
Lighting/Class/OrderdetailsViewController.m
View file @
065f1661
...
@@ -449,17 +449,14 @@
...
@@ -449,17 +449,14 @@
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@/%@/%@"
,
SERVERREQUESTURL
(
RESETORDER
),
_orderCode
,
@"001"
,
@"005"
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@/%@/%@"
,
SERVERREQUESTURL
(
RESETORDER
),
_orderCode
,
@"001"
,
@"005"
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
self
SuccessMBProgressView
:
@"撤销成功"
];
[
self
SuccessMBProgressView
:
@"撤销成功"
];
UIView
*
view
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenWidth
,
0
)];
UIView
*
view
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenWidth
,
0
)];
self
.
orderDetailsTableview
.
tableHeaderView
=
view
;
self
.
orderDetailsTableview
.
tableHeaderView
=
view
;
self
.
orderDetailsTableview
.
tableFooterView
=
nil
;
self
.
orderDetailsTableview
.
tableFooterView
=
nil
;
self
.
orderDetails
.
order
.
orderState
=
@"005"
;
self
.
orderDetails
.
order
.
orderState
=
@"005"
;
[
self
.
orderDetailsTableview
reloadData
];
[
self
.
orderDetailsTableview
reloadData
];
if
(
self
.
DelecteAndPayButtonBlock
)
{
if
(
self
.
DelecteAndPayButtonBlock
)
{
self
.
DelecteAndPayButtonBlock
(
_cellindex
,
@"005"
);
self
.
DelecteAndPayButtonBlock
(
_cellindex
,
@"005"
);
}
}
...
...
Lighting/Class/ProductDetailsViewController.m
View file @
065f1661
...
@@ -384,11 +384,11 @@
...
@@ -384,11 +384,11 @@
#pragma mark -开发加入购物车动画
#pragma mark -开发加入购物车动画
-
(
void
)
StartAddShoppingCarAnimationWithimage
:
(
UIImage
*
)
image
withStartpoint
:
(
CGPoint
)
point
withSize
:
(
CGSize
)
size
-
(
void
)
StartAddShoppingCarAnimationWithimage
:
(
UIImage
*
)
image
withStartpoint
:
(
CGPoint
)
point
withSize
:
(
CGSize
)
size
{
{
//
//
起点
//起点
CGPoint
startPoint
=
point
;
CGPoint
startPoint
=
point
;
//
//
终点
//终点
CGPoint
endPoint
=
SHARED_APPDELEGATE
.
shoppingCarPoint
;
CGPoint
endPoint
=
SHARED_APPDELEGATE
.
shoppingCarPoint
;
//
//
控点
//控点
CGPoint
controlPoint
=
CGPointMake
(
endPoint
.
x
,
startPoint
.
x
);
CGPoint
controlPoint
=
CGPointMake
(
endPoint
.
x
,
startPoint
.
x
);
...
@@ -463,33 +463,30 @@
...
@@ -463,33 +463,30 @@
[
self
ErrorMBProgressView
:
@"超过库存"
];
[
self
ErrorMBProgressView
:
@"超过库存"
];
return
;
return
;
}
}
[
self
StartAddShoppingCarAnimationWithimage
:
self
.
headerView
.
goodsImageview
.
image
withStartpoint
:[
self
.
headerView
convertPoint
:[
self
.
headerView
.
goodsImageview
center
]
toView
:
self
.
view
.
window
]
withSize
:
self
.
headerView
.
goodsImageview
.
frame
.
size
];
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
goodsId
=
_goodsID
;
shopCar
.
goodsId
=
_goodsID
;
shopCar
.
count
=
self
.
headerView
.
goodsNumber
.
text
;
shopCar
.
count
=
self
.
headerView
.
goodsNumber
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
NSLog
(
@"添加购物车成功"
);
NSLog
(
@"添加购物车成功"
);
[
weakSelf
StartAddShoppingCarAnimationWithimage
:
weakSelf
.
headerView
.
goodsImageview
.
image
withStartpoint
:[
weakSelf
.
headerView
convertPoint
:[
weakSelf
.
headerView
.
goodsImageview
center
]
toView
:
weakSelf
.
view
.
window
]
withSize
:
weakSelf
.
headerView
.
goodsImageview
.
frame
.
size
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
self
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
@"无网络"
];
[
self
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
ErrorMBProgressView
:
@"添加购物车失败"
];
[
self
ErrorMBProgressView
:
@"添加购物车失败"
];
}];
}];
}
}
#pragma mark -判断是否为纯数字
#pragma mark -判断是否为纯数字
-
(
BOOL
)
isPureInt
:
(
NSString
*
)
string
{
-
(
BOOL
)
isPureInt
:
(
NSString
*
)
string
{
NSScanner
*
scan
=
[
NSScanner
scannerWithString
:
string
];
NSScanner
*
scan
=
[
NSScanner
scannerWithString
:
string
];
...
@@ -498,26 +495,10 @@
...
@@ -498,26 +495,10 @@
}
}
-
(
void
)
dealloc
-
(
void
)
dealloc
{
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
@end
Lighting/Class/ProductLibraryViewController.m
View file @
065f1661
...
@@ -172,33 +172,34 @@
...
@@ -172,33 +172,34 @@
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRODUCTLIST
)
WithRequestType
:
0
WithParameter
:
conditon
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRODUCTLIST
)
WithRequestType
:
0
WithParameter
:
conditon
WithReturnValueBlock
:^
(
id
returnValue
)
{
self
.
productCollectionView
.
emptyDataSetSource
=
s
elf
;
weakSelf
.
productCollectionView
.
emptyDataSetSource
=
weakS
elf
;
self
.
productCollectionView
.
emptyDataSetDelegate
=
s
elf
;
weakSelf
.
productCollectionView
.
emptyDataSetDelegate
=
weakS
elf
;
[
self
endRefreshingForTableView
:
s
elf
.
productCollectionView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
productCollectionView
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
GoodsResponse
*
sponse
=
[[
GoodsResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
GoodsResponse
*
sponse
=
[[
GoodsResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
//返回结果
//返回结果
finish
(
sponse
);
finish
(
sponse
);
}
}
else
else
{
{
[
s
elf
ErrorMBProgressView
:
@"暂无数据"
];
[
weakS
elf
ErrorMBProgressView
:
@"暂无数据"
];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
ErrorMBProgressView
:
@"网络连接中断"
];
[
weakS
elf
ErrorMBProgressView
:
@"网络连接中断"
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
self
endRefreshingForTableView
:
s
elf
.
productCollectionView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
productCollectionView
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
weakS
elf
ErrorMBProgressView
:
error
.
localizedDescription
];
}];
}];
}
}
...
@@ -422,28 +423,26 @@
...
@@ -422,28 +423,26 @@
TOGoodsEntity
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
];
TOGoodsEntity
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
item
];
cell
.
model
=
model
;
cell
.
model
=
model
;
cell
.
cellindex
=
indexPath
.
row
;
cell
.
cellindex
=
indexPath
.
row
;
//加入购物车
//加入购物车
__weak
typeof
(
self
)
weakSelf
=
self
;
WS
(
weakSelf
)
;
__weak
typeof
(
ProductCollectionViewCell
*
)
weakCell
=
cell
;
__weak
typeof
(
ProductCollectionViewCell
*
)
weakCell
=
cell
;
[
cell
setReturnCellCgpoint
:
^
void
(
CGPoint
centerPoint
,
NSInteger
cellindex
,
CGSize
size
)
{
[
cell
setReturnCellCgpoint
:
^
void
(
CGPoint
centerPoint
,
NSInteger
cellindex
,
CGSize
size
)
{
//判断是否有当前客户
//判断是否有当前客户
if
(
!
[
Shoppersmanager
manager
].
currentCustomer
)
{
if
(
!
[
Shoppersmanager
manager
].
currentCustomer
)
{
[
s
elf
ErrorMBProgressView
:
@"必须设置当前客户"
];
[
weakS
elf
ErrorMBProgressView
:
@"必须设置当前客户"
];
return
;
return
;
}
}
//库存为0时不能加入购物车
//库存为0时不能加入购物车
if
(
model
.
number
>
=
0
)
{
if
(
model
.
number
=
=
0
)
{
[
s
elf
ErrorMBProgressView
:
@"此商品库存不足"
];
[
weakS
elf
ErrorMBProgressView
:
@"此商品库存不足"
];
return
;
return
;
}
}
TOGoodsEntity
*
model
=
[
s
elf
.
datasArray
objectAtIndex_opple
:
cellindex
];
TOGoodsEntity
*
model
=
[
weakS
elf
.
datasArray
objectAtIndex_opple
:
cellindex
];
[
s
elf
addGoodsShoppingbags
:
model
complate
:
^
{
[
weakS
elf
addGoodsShoppingbags
:
model
complate
:
^
{
NSLog
(
@"加入购物车完成"
);
NSLog
(
@"加入购物车完成"
);
}];
[
weakSelf
StartAddShoppingCarAnimationWithimage
:
weakCell
.
productImageView
.
image
withStartpoint
:
centerPoint
withSize
:
size
];
[
weakSelf
StartAddShoppingCarAnimationWithimage
:
weakCell
.
productImageView
.
image
withStartpoint
:
centerPoint
withSize
:
size
];
}];
}];
}];
return
cell
;
return
cell
;
}
}
...
@@ -451,11 +450,11 @@
...
@@ -451,11 +450,11 @@
#pragma mark -开发加入购物车动画
#pragma mark -开发加入购物车动画
-
(
void
)
StartAddShoppingCarAnimationWithimage
:
(
UIImage
*
)
image
withStartpoint
:
(
CGPoint
)
point
withSize
:
(
CGSize
)
size
-
(
void
)
StartAddShoppingCarAnimationWithimage
:
(
UIImage
*
)
image
withStartpoint
:
(
CGPoint
)
point
withSize
:
(
CGSize
)
size
{
{
//起点
//起点
CGPoint
startPoint
=
point
;
CGPoint
startPoint
=
point
;
//终点
//终点
CGPoint
endPoint
=
SHARED_APPDELEGATE
.
shoppingCarPoint
;
CGPoint
endPoint
=
SHARED_APPDELEGATE
.
shoppingCarPoint
;
//控点
//控点
CGPoint
controlPoint
=
CGPointMake
(
endPoint
.
x
,
startPoint
.
x
);
CGPoint
controlPoint
=
CGPointMake
(
endPoint
.
x
,
startPoint
.
x
);
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
size
.
width
,
size
.
height
)];
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
size
.
width
,
size
.
height
)];
...
@@ -744,6 +743,7 @@
...
@@ -744,6 +743,7 @@
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
goodsId
=
model
.
fid
;
shopCar
.
goodsId
=
model
.
fid
;
shopCar
.
count
=
@"1"
;
shopCar
.
count
=
@"1"
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
@@ -752,13 +752,13 @@
...
@@ -752,13 +752,13 @@
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
ErrorMBProgressView
:
@"加入购物车失败"
];
[
weakS
elf
ErrorMBProgressView
:
@"加入购物车失败"
];
}];
}];
}
}
...
...
Lighting/Class/SceneLibraryViewController.m
View file @
065f1661
...
@@ -166,20 +166,21 @@
...
@@ -166,20 +166,21 @@
#pragma mark -获取场景筛选数据
#pragma mark -获取场景筛选数据
-
(
void
)
getdatasAction
-
(
void
)
getdatasAction
{
{
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENESCREENING
)
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENESCREENING
)
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
s
elf
.
filter
=
[[
SceneFilter
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
weakS
elf
.
filter
=
[[
SceneFilter
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
}
}
else
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}];
}];
...
@@ -190,35 +191,36 @@
...
@@ -190,35 +191,36 @@
-
(
void
)
getSceneLibrarydatas
:
(
SceneCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
-
(
void
)
getSceneLibrarydatas
:
(
SceneCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENELIST
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENELIST
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
self
.
seceneLibararyCollectionView
.
emptyDataSetSource
=
s
elf
;
weakSelf
.
seceneLibararyCollectionView
.
emptyDataSetSource
=
weakS
elf
;
self
.
seceneLibararyCollectionView
.
emptyDataSetDelegate
=
s
elf
;
weakSelf
.
seceneLibararyCollectionView
.
emptyDataSetDelegate
=
weakS
elf
;
[
self
endRefreshingForTableView
:
s
elf
.
seceneLibararyCollectionView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
seceneLibararyCollectionView
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
if
(
remove
)
{
[
s
elf
.
responseArray
removeAllObjects
];
[
weakS
elf
.
responseArray
removeAllObjects
];
}
}
SceneResponse
*
response
=
[[
SceneResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
SceneResponse
*
response
=
[[
SceneResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
s
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
weakS
elf
.
totalPages
=
[
returnValue
[
@"data"
][
@"totalpages"
]
intValue
];
for
(
TOSceneEntity
*
model
in
response
.
list
)
{
for
(
TOSceneEntity
*
model
in
response
.
list
)
{
[
s
elf
.
responseArray
addObject
:
model
];
[
weakS
elf
.
responseArray
addObject
:
model
];
}
}
[
s
elf
.
seceneLibararyCollectionView
reloadData
];
[
weakS
elf
.
seceneLibararyCollectionView
reloadData
];
}
}
else
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
self
endRefreshingForTableView
:
s
elf
.
seceneLibararyCollectionView
];
[
weakSelf
endRefreshingForTableView
:
weakS
elf
.
seceneLibararyCollectionView
];
}];
}];
}
}
...
...
Lighting/Class/SettlementViewController.m
View file @
065f1661
...
@@ -327,22 +327,23 @@
...
@@ -327,22 +327,23 @@
order
.
billType
=
@"001"
;
order
.
billType
=
@"001"
;
}
}
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CONFIRMPAY
)
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CONFIRMPAY
)
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
CreateMBProgressHUDLoding
];
[
weakS
elf
CreateMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
NSLog
(
@"支付成功"
);
NSLog
(
@"支付成功"
);
[
s
elf
ErrorMBProgressView
:
@"支付成功"
];
[
weakS
elf
ErrorMBProgressView
:
@"支付成功"
];
if
(
s
elf
.
PaySuccessReturnBlock
)
{
if
(
weakS
elf
.
PaySuccessReturnBlock
)
{
s
elf
.
PaySuccessReturnBlock
();
weakS
elf
.
PaySuccessReturnBlock
();
}
}
[
s
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakS
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"支付失败"
);
NSLog
(
@"支付失败"
);
[
s
elf
CreateMBProgressHUDLoding
];
[
weakS
elf
CreateMBProgressHUDLoding
];
}];
}];
}
}
...
...
Lighting/Class/Shoppingcart/AddressViewController.m
View file @
065f1661
...
@@ -186,44 +186,45 @@
...
@@ -186,44 +186,45 @@
}
}
address
.
address
=
self
.
detailsAddress
.
text
;
address
.
address
=
self
.
detailsAddress
.
text
;
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDADDRESS
)
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDADDRESS
)
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
model
.
name
=
s
elf
.
recipientPerson
.
text
;
model
.
name
=
weakS
elf
.
recipientPerson
.
text
;
model
.
miblephone
=
s
elf
.
PhoneNumber
.
text
;
model
.
miblephone
=
weakS
elf
.
PhoneNumber
.
text
;
if
([[
self
.
citySelected
currentTitle
]
isEqualToString
:
s
elf
.
provincesString
])
{
if
([[
weakSelf
.
citySelected
currentTitle
]
isEqualToString
:
weakS
elf
.
provincesString
])
{
model
.
city
=
s
elf
.
citySelected
.
currentTitle
;
model
.
city
=
weakS
elf
.
citySelected
.
currentTitle
;
model
.
province
=
nil
;
model
.
province
=
nil
;
}
else
}
else
{
{
model
.
city
=
s
elf
.
citySelected
.
currentTitle
;
model
.
city
=
weakS
elf
.
citySelected
.
currentTitle
;
model
.
province
=
s
elf
.
provincesString
;
model
.
province
=
weakS
elf
.
provincesString
;
}
}
model
.
address
=
s
elf
.
detailsAddress
.
text
;
model
.
address
=
weakS
elf
.
detailsAddress
.
text
;
model
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
model
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
model
.
fid
=
returnValue
[
@"data"
];
model
.
fid
=
returnValue
[
@"data"
];
model
.
isSelected
=
NO
;
model
.
isSelected
=
NO
;
//增加地址
//增加地址
if
([
s
elf
.
delegate
respondsToSelector
:
@selector
(
addAddressCell
:)])
{
if
([
weakS
elf
.
delegate
respondsToSelector
:
@selector
(
addAddressCell
:)])
{
[
s
elf
.
delegate
addAddressCell
:
model
];
[
weakS
elf
.
delegate
addAddressCell
:
model
];
}
}
}
}
else
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -242,32 +243,32 @@
...
@@ -242,32 +243,32 @@
address
.
province
=
self
.
provincesString
;
address
.
province
=
self
.
provincesString
;
}
}
address
.
fid
=
self
.
model
.
fid
;
address
.
fid
=
self
.
model
.
fid
;
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CHANGEADDRESS
)
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CHANGEADDRESS
)
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
model
.
name
=
s
elf
.
recipientPerson
.
text
;
model
.
name
=
weakS
elf
.
recipientPerson
.
text
;
model
.
miblephone
=
s
elf
.
PhoneNumber
.
text
;
model
.
miblephone
=
weakS
elf
.
PhoneNumber
.
text
;
model
.
city
=
s
elf
.
citySelected
.
currentTitle
;
model
.
city
=
weakS
elf
.
citySelected
.
currentTitle
;
model
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
model
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
model
.
province
=
self
.
provincesString
?
s
elf
.
provincesString
:
@""
;
model
.
province
=
weakSelf
.
provincesString
?
weakS
elf
.
provincesString
:
@""
;
model
.
fid
=
s
elf
.
model
.
fid
;
model
.
fid
=
weakS
elf
.
model
.
fid
;
model
.
isSelected
=
NO
;
model
.
isSelected
=
NO
;
//地址拼接
//地址拼接
if
(
!
[
self
.
provincesString
isEqualToString
:[
s
elf
.
citySelected
currentTitle
]])
{
if
(
!
[
weakSelf
.
provincesString
isEqualToString
:[
weakS
elf
.
citySelected
currentTitle
]])
{
model
.
address
=
[
NSString
stringWithFormat
:
@"%@"
,
s
elf
.
detailsAddress
.
text
];
model
.
address
=
[
NSString
stringWithFormat
:
@"%@"
,
weakS
elf
.
detailsAddress
.
text
];
}
else
}
else
{
{
model
.
address
=
[
NSString
stringWithFormat
:
@"%@"
,
s
elf
.
detailsAddress
.
text
];
model
.
address
=
[
NSString
stringWithFormat
:
@"%@"
,
weakS
elf
.
detailsAddress
.
text
];
}
}
//修改地址
//修改地址
if
([
s
elf
.
delegate
respondsToSelector
:
@selector
(
ChangeAddresscell
:
Withcellindex
:
)])
{
if
([
weakS
elf
.
delegate
respondsToSelector
:
@selector
(
ChangeAddresscell
:
Withcellindex
:
)])
{
[
s
elf
.
delegate
ChangeAddresscell
:
model
Withcellindex
:
_cellindex
];
[
weakS
elf
.
delegate
ChangeAddresscell
:
model
Withcellindex
:
_cellindex
];
}
}
}
}
else
else
...
@@ -276,13 +277,13 @@
...
@@ -276,13 +277,13 @@
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
NSLog
(
@"%@"
,
error
);
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -305,27 +306,28 @@
...
@@ -305,27 +306,28 @@
-
(
void
)
deleteAddressButtonClick
-
(
void
)
deleteAddressButtonClick
{
{
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
REMOVEADDRESS
),
_model
.
fid
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
REMOVEADDRESS
),
_model
.
fid
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
s
elf
SuccessMBProgressView
:
@"删除成功"
];
[
weakS
elf
SuccessMBProgressView
:
@"删除成功"
];
if
([
s
elf
.
delegate
respondsToSelector
:
@selector
(
delecteCell
:)])
{
if
([
weakS
elf
.
delegate
respondsToSelector
:
@selector
(
delecteCell
:)])
{
[
s
elf
.
delegate
delecteCell
:
_model
.
fid
];
[
weakS
elf
.
delegate
delecteCell
:
_model
.
fid
];
}
}
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
065f1661
...
@@ -409,8 +409,9 @@
...
@@ -409,8 +409,9 @@
orderReceiver
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
orderReceiver
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
order
.
orderdetailList
=
(
NSArray
<
TOOrderdetailEntity
>
*
)
goodidArr
;
order
.
orderdetailList
=
(
NSArray
<
TOOrderdetailEntity
>
*
)
goodidArr
;
[
self
CreateMBProgressHUDLoding
];
[
self
CreateMBProgressHUDLoding
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CREATEORDER
)
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CREATEORDER
)
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//商品购物车id
//商品购物车id
NSMutableArray
*
codeArrray
=
[
NSMutableArray
array
];
NSMutableArray
*
codeArrray
=
[
NSMutableArray
array
];
...
@@ -418,26 +419,26 @@
...
@@ -418,26 +419,26 @@
[
codeArrray
addObject
:
model
.
fid
?
model
.
fid
:
@" "
];
[
codeArrray
addObject
:
model
.
fid
?
model
.
fid
:
@" "
];
}
}
//调用删除购物车
//调用删除购物车
if
(
s
elf
.
DelecteSelectedGoods
)
{
if
(
weakS
elf
.
DelecteSelectedGoods
)
{
s
elf
.
DelecteSelectedGoods
(
codeArrray
);
weakS
elf
.
DelecteSelectedGoods
(
codeArrray
);
}
}
OrderdetailsViewController
*
orderDetails
=
[[
s
elf
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"orderdetails"
];
OrderdetailsViewController
*
orderDetails
=
[[
weakS
elf
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"orderdetails"
];
orderDetails
.
orderCode
=
returnValue
[
@"data"
];
orderDetails
.
orderCode
=
returnValue
[
@"data"
];
orderDetails
.
sectionTitle
=
@[
@"订单信息"
,
@"客户信息"
,
@"收货信息"
,
@"商品清单"
];
orderDetails
.
sectionTitle
=
@[
@"订单信息"
,
@"客户信息"
,
@"收货信息"
,
@"商品清单"
];
orderDetails
.
isShowattachment
=
NO
;
orderDetails
.
isShowattachment
=
NO
;
orderDetails
.
isShowPayButton
=
YES
;
orderDetails
.
isShowPayButton
=
YES
;
orderDetails
.
isSliding
=
YES
;
//取消滑动返回
orderDetails
.
isSliding
=
YES
;
//取消滑动返回
[
s
elf
.
navigationController
pushViewController
:
orderDetails
animated
:
YES
];
[
weakS
elf
.
navigationController
pushViewController
:
orderDetails
animated
:
YES
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
ErrorMBProgressView
:
@"无网络"
];
[
weakS
elf
ErrorMBProgressView
:
@"无网络"
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
return
;
return
;
}
}
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
View file @
065f1661
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
@optional
@optional
/**
/**
* 当前商品数量、成交价
* 当前商品数量、成交价
,通过返回参数判断是否能修改
*/
*/
-
(
void
)
ChangeGoodsNumber
:
(
int
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
;
-
(
void
)
ChangeGoodsNumber
:
(
NSInteger
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
returnValue
:
(
void
(
^
)(
id
value
))
result
;
@end
@end
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
View file @
065f1661
...
@@ -50,15 +50,11 @@
...
@@ -50,15 +50,11 @@
//sender.tag == 100 减少
//sender.tag == 100 减少
//sender.tag == 101 增加
//sender.tag == 101 增加
NSLog
(
@"%ld"
,
sender
.
tag
);
NSInteger
goodsNumber
=
[
self
.
goodsNumbersLabe
.
text
integerValue
];
NSInteger
goodsNumber
=
[
self
.
goodsNumbersLabe
.
text
integerValue
];
switch
(
sender
.
tag
)
{
switch
(
sender
.
tag
)
{
case
100
:
//减少
case
100
:
//减少
{
{
if
(
goodsNumber
<=
1
)
{
if
(
goodsNumber
<=
1
)
{
if
(
self
.
promptStringBlock
)
{
if
(
self
.
promptStringBlock
)
{
self
.
promptStringBlock
(
@"个数不能小于1"
);
self
.
promptStringBlock
(
@"个数不能小于1"
);
}
}
...
@@ -66,14 +62,12 @@
...
@@ -66,14 +62,12 @@
return
;
return
;
}
}
goodsNumber
--
;
goodsNumber
--
;
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
goodsNumber
];
// self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
}
}
break
;
break
;
case
101
:
//增加
case
101
:
//增加
{
{
if
(
goodsNumber
>=
[
_model
.
goods
.
number
integerValue
])
{
if
(
goodsNumber
>=
[
_model
.
goods
.
number
integerValue
])
{
//不能大于库存
//不能大于库存
if
(
self
.
promptStringBlock
)
{
if
(
self
.
promptStringBlock
)
{
self
.
promptStringBlock
(
@"个数不能大于库存"
);
self
.
promptStringBlock
(
@"个数不能大于库存"
);
...
@@ -81,18 +75,23 @@
...
@@ -81,18 +75,23 @@
return
;
return
;
}
}
goodsNumber
++
;
goodsNumber
++
;
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
goodsNumber
];
// self.goodsNumbersLabe.text = [NSString stringWithFormat:@"%ld",goodsNumber];
}
}
break
;
break
;
default
:
default
:
break
;
break
;
}
}
//改变价格
//改变价格
WS
(
weakSelf
);
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
self
.
clinchTextfield
.
text
floatValue
]];
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
self
.
clinchTextfield
.
text
floatValue
]];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
)])
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
returnValue
:
)])
{
[
self
.
delegate
ChangeGoodsNumber
:[
self
.
goodsNumbersLabe
.
text
intValue
]
WithcostPrice
:[
self
.
clinchTextfield
.
text
floatValue
]
Withcellindex
:
_cellindex
];
[
self
.
delegate
ChangeGoodsNumber
:
goodsNumber
WithcostPrice
:[
self
.
clinchTextfield
.
text
floatValue
]
Withcellindex
:
_cellindex
returnValue
:^
(
id
value
)
{
if
([
value
isKindOfClass
:[
NSDictionary
class
]])
{
if
([
value
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
goodsNumber
];
}
}
}];
}
}
}
}
...
@@ -127,8 +126,9 @@
...
@@ -127,8 +126,9 @@
//改变价格
//改变价格
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
textField
.
text
floatValue
]];
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
integerValue
]
*
[
textField
.
text
floatValue
]];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
)])
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ChangeGoodsNumber
:
WithcostPrice
:
Withcellindex
:
returnValue
:
)])
{
[
self
.
delegate
ChangeGoodsNumber
:[
self
.
goodsNumbersLabe
.
text
intValue
]
WithcostPrice
:[
self
.
clinchTextfield
.
text
floatValue
]
Withcellindex
:
_cellindex
];
[
self
.
delegate
ChangeGoodsNumber
:[
self
.
goodsNumbersLabe
.
text
integerValue
]
WithcostPrice
:[
self
.
clinchTextfield
.
text
floatValue
]
Withcellindex
:
_cellindex
returnValue
:^
(
id
value
)
{
}];
}
}
}
}
return
YES
;
return
YES
;
...
@@ -144,13 +144,4 @@
...
@@ -144,13 +144,4 @@
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
@end
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
065f1661
This diff is collapsed.
Click to expand it.
Lighting/Class/UserViewController.m
View file @
065f1661
...
@@ -178,21 +178,22 @@
...
@@ -178,21 +178,22 @@
RsEmployeeRequest
*
employ
=
[[
RsEmployeeRequest
alloc
]
init
];
RsEmployeeRequest
*
employ
=
[[
RsEmployeeRequest
alloc
]
init
];
employ
.
employee
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
;
employ
.
employee
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
;
employ
.
employee
.
picture
=
headerurl
;
employ
.
employee
.
picture
=
headerurl
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODITYSHOPPERSINFORMATION
)
WithRequestType
:
0
WithParameter
:
employ
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODITYSHOPPERSINFORMATION
)
WithRequestType
:
0
WithParameter
:
employ
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
block
();
block
();
[
s
elf
SuccessMBProgressView
:
@"修改成功"
];
[
weakS
elf
SuccessMBProgressView
:
@"修改成功"
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -282,31 +283,31 @@
...
@@ -282,31 +283,31 @@
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
login
.
username
=
self
.
userName
.
text
;
login
.
username
=
self
.
userName
.
text
;
login
.
password
=
self
.
passWord
.
text
;
login
.
password
=
self
.
passWord
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
0
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
0
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
s
elf
SuccessMBProgressView
:
@"登陆成功"
];
[
weakS
elf
SuccessMBProgressView
:
@"登陆成功"
];
LoginResult
*
result
=
[[
LoginResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
LoginResult
*
result
=
[[
LoginResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
Shoppersmanager
manager
].
userNameString
=
s
elf
.
userName
.
text
;
[
Shoppersmanager
manager
].
userNameString
=
weakS
elf
.
userName
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
s
elf
.
passWord
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
weakS
elf
.
passWord
.
text
;
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
[
Shoppersmanager
manager
].
Shoppers
=
result
;
[
Shoppersmanager
manager
].
Shoppers
=
result
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"CHANGESHOPPERSNAME"
object
:
result
.
employee
.
realName
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"CHANGESHOPPERSNAME"
object
:
result
.
employee
.
realName
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"CHANGECUSTOMERNAME"
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"CHANGECUSTOMERNAME"
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"EMPTYCUSTOMERNAME"
object
:
nil
];
//情况当前客户数据
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"EMPTYCUSTOMERNAME"
object
:
nil
];
//情况当前客户数据
//保存用户名密码
//保存用户名密码
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
s
elf
.
userName
.
text
forKey
:
USERNAME
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
weakS
elf
.
userName
.
text
forKey
:
USERNAME
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
s
elf
.
passWord
.
text
forKey
:
PASSWORD
];
[[
NSUserDefaults
standardUserDefaults
]
setObject
:
weakS
elf
.
passWord
.
text
forKey
:
PASSWORD
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[[
NSUserDefaults
standardUserDefaults
]
synchronize
];
[
s
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakS
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
s
elf
recoveryUsernamePasswrod
];
[
weakS
elf
recoveryUsernamePasswrod
];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
...
@@ -315,8 +316,8 @@
...
@@ -315,8 +316,8 @@
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
[
s
elf
recoveryUsernamePasswrod
];
[
weakS
elf
recoveryUsernamePasswrod
];
}];
}];
}
}
...
...
Lighting/Lighting.xcodeproj/project.pbxproj
View file @
065f1661
...
@@ -1709,8 +1709,8 @@
...
@@ -1709,8 +1709,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
=
"Brand Assets"
;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
=
"Brand Assets"
;
CLANG_ENABLE_OBJC_WEAK
=
YES
;
CLANG_ENABLE_OBJC_WEAK
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper: 云霄 曹 (WM8ZU7YY98)
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
eveloper: 云霄 曹 (WM8ZU7YY98)
"
;
COMPRESS_PNG_FILES
=
NO
;
COMPRESS_PNG_FILES
=
NO
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
"$(inherited)"
;
FRAMEWORK_SEARCH_PATHS
=
"$(inherited)"
;
...
@@ -1753,7 +1753,7 @@
...
@@ -1753,7 +1753,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
"
10361169-d429-4810-90f6-528335fe4062
"
;
PROVISIONING_PROFILE
=
"
e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8
"
;
STRIP_PNG_TEXT
=
NO
;
STRIP_PNG_TEXT
=
NO
;
TARGETED_DEVICE_FAMILY
=
2
;
TARGETED_DEVICE_FAMILY
=
2
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
...
@@ -1767,8 +1767,8 @@
...
@@ -1767,8 +1767,8 @@
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
=
"Brand Assets"
;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
=
"Brand Assets"
;
CLANG_ENABLE_OBJC_WEAK
=
YES
;
CLANG_ENABLE_OBJC_WEAK
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper: 云霄 曹 (WM8ZU7YY98)
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
istribution: Shanghai Gomore Information Technology Co.,Ltd
"
;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]"
=
"iPhone D
eveloper: 云霄 曹 (WM8ZU7YY98)
"
;
COMPRESS_PNG_FILES
=
NO
;
COMPRESS_PNG_FILES
=
NO
;
ENABLE_BITCODE
=
NO
;
ENABLE_BITCODE
=
NO
;
FRAMEWORK_SEARCH_PATHS
=
"$(inherited)"
;
FRAMEWORK_SEARCH_PATHS
=
"$(inherited)"
;
...
@@ -1811,7 +1811,7 @@
...
@@ -1811,7 +1811,7 @@
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.gomore.opple
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
"
10361169-d429-4810-90f6-528335fe4062
"
;
PROVISIONING_PROFILE
=
"
e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8
"
;
STRIP_PNG_TEXT
=
NO
;
STRIP_PNG_TEXT
=
NO
;
TARGETED_DEVICE_FAMILY
=
2
;
TARGETED_DEVICE_FAMILY
=
2
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
USER_HEADER_SEARCH_PATHS
=
"$(PODS_ROOT)/**"
;
...
...
Lighting/Tools/PrefixHeader.pch
View file @
065f1661
...
@@ -112,12 +112,12 @@
...
@@ -112,12 +112,12 @@
/**
/**
* 服务器开发地址
* 服务器开发地址
*/
*/
//
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
/**
/**
* 服务器测试地址
* 服务器测试地址
*/
*/
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
///**
///**
// * 服务器正式地址
// * 服务器正式地址
...
@@ -186,6 +186,12 @@
...
@@ -186,6 +186,12 @@
*/
*/
#define LOGINTIMEOUT @"logintimeout"
#define LOGINTIMEOUT @"logintimeout"
/**
* 弱引用
*/
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self
...
...
Lighting/Tools/SceneViewController.m
View file @
065f1661
...
@@ -232,7 +232,7 @@
...
@@ -232,7 +232,7 @@
#pragma mark -场景数据
#pragma mark -场景数据
-
(
void
)
getDatasAction
-
(
void
)
getDatasAction
{
{
__weak
typeof
(
self
)
weakSelf
=
self
;
WS
(
weakSelf
)
;
//场景筛选条件
//场景筛选条件
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENESCREENING
)
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENESCREENING
)
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
...
@@ -313,7 +313,7 @@
...
@@ -313,7 +313,7 @@
#pragma mark -获取场景列表数据
#pragma mark -获取场景列表数据
-
(
void
)
getSceneLibrarydatas
:
(
SceneCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
-
(
void
)
getSceneLibrarydatas
:
(
SceneCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
{
{
__weak
typeof
(
self
)
weakSelf
=
self
;
WS
(
weakSelf
)
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENELIST
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENELIST
)
WithRequestType
:
0
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
sceneOrProductClollectionView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
sceneOrProductClollectionView
.
emptyDataSetSource
=
weakSelf
;
...
@@ -543,7 +543,7 @@
...
@@ -543,7 +543,7 @@
#pragma mark -获取商品列表数据
#pragma mark -获取商品列表数据
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
{
{
__weak
typeof
(
self
)
weakSelf
=
self
;
WS
(
weakSelf
)
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRODUCTLIST
)
WithRequestType
:
0
WithParameter
:
conditon
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRODUCTLIST
)
WithRequestType
:
0
WithParameter
:
conditon
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
sceneOrProductClollectionView
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
sceneOrProductClollectionView
];
...
...
Lighting/Tools/ShoppingBagViewController.m
View file @
065f1661
...
@@ -255,26 +255,27 @@
...
@@ -255,26 +255,27 @@
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
goodsId
=
[
goodsIds
substringToIndex
:
goodsIds
.
length
-
1
];
shopCar
.
goodsId
=
[
goodsIds
substringToIndex
:
goodsIds
.
length
-
1
];
shopCar
.
count
=
[
goodsCounts
substringToIndex
:
goodsCounts
.
length
-
1
];
shopCar
.
count
=
[
goodsCounts
substringToIndex
:
goodsCounts
.
length
-
1
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
s
elf
.
dismissBlock
)
{
if
(
weakS
elf
.
dismissBlock
)
{
s
elf
.
dismissBlock
();
weakS
elf
.
dismissBlock
();
}
}
[
s
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakS
elf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
s
elf
QueryShoppingCarNumber
];
[
weakS
elf
QueryShoppingCarNumber
];
[
s
elf
SuccessMBProgressView
:
@"加入购物车成功"
];
[
weakS
elf
SuccessMBProgressView
:
@"加入购物车成功"
];
}
else
}
else
{
{
[
s
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
weakS
elf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}
WithFailureBlock
:^
(
id
error
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
s
elf
ErrorMBProgressView
:
@"加入购物车失败"
];
[
weakS
elf
ErrorMBProgressView
:
@"加入购物车失败"
];
[
s
elf
RemoveMBProgressHUDLoding
];
[
weakS
elf
RemoveMBProgressHUDLoding
];
}];
}];
}
}
...
@@ -292,7 +293,7 @@
...
@@ -292,7 +293,7 @@
#pragma mark -改变商品数量
#pragma mark -改变商品数量
-
(
void
)
ChangeGoodsNumber
:
(
int
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
-
(
void
)
ChangeGoodsNumber
:
(
NSInteger
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
returnValue
:
(
void
(
^
)(
id
))
result
{
{
ShopcarModel
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
cellindex
];
ShopcarModel
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
cellindex
];
//保存商品数量
//保存商品数量
...
...
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