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
6f6d36f1
Commit
6f6d36f1
authored
Dec 01, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:
parent
81beb6dc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
384 additions
and
639 deletions
+384
-639
AllCustomerViewController.m
Class/AllCustomerViewController.m
+4
-4
CardBeenUseViewController.m
Class/CardBeenUseViewController.m
+8
-10
CardDontUseViewController.m
Class/CardDontUseViewController.m
+21
-17
CardViewController.m
Class/CardViewController.m
+7
-8
ChangePasswordViewController.m
Class/ChangePasswordViewController.m
+7
-7
ClientShoppingCarViewController.m
Class/ClientShoppingCarViewController.m
+4
-5
ClientViewController.m
Class/ClientViewController.m
+38
-56
CustomerOrderViewController.m
Class/CustomerOrderViewController.m
+10
-10
LoginViewController.m
Class/Login/LoginViewController.m
+25
-27
LuckyDrawDetailsViewController.m
Class/LuckyDrawDetailsViewController.m
+6
-8
OrderRecordViewController.m
Class/OrderRecordViewController.m
+4
-5
OrderdetailsViewController.m
Class/OrderdetailsViewController.m
+30
-35
PaymentsViewController.m
Class/PaymentsViewController.m
+5
-5
ProductDetailsViewController.m
Class/ProductDetailsViewController.m
+15
-16
ProductLibraryViewController.m
Class/ProductLibraryViewController.m
+26
-39
RebateDetailsViewController.m
Class/RebateDetailsViewController.m
+13
-14
RebateViewController.m
Class/RebateViewController.m
+4
-5
SceneLibraryViewController.m
Class/SceneLibraryViewController.m
+13
-24
SearchViewController.m
Class/SearchViewController.m
+4
-5
SettlementViewController.m
Class/SettlementViewController.m
+13
-14
AddressViewController.m
Class/Shoppingcart/AddressViewController.m
+17
-18
GenerateOrdersViewController.m
Class/Shoppingcart/GenerateOrdersViewController.m
+11
-12
ShoppingViewController.m
Class/Shoppingcart/ShoppingViewController.m
+29
-34
UserViewController.m
Class/UserViewController.m
+24
-27
WithdrawalViewController.m
Class/WithdrawalViewController.m
+4
-5
BaseViewController.h
Tools/BaseViewController.h
+0
-54
BaseViewController.m
Tools/BaseViewController.m
+1
-122
CustomWKWebViewController.m
Tools/CustomWKWebViewController.m
+3
-3
ExperienceCentreViewController.m
Tools/ExperienceCentreViewController.m
+4
-4
XBLoadingView.h
Tools/LoadingView/XBLoadingView.h
+1
-1
XBLoadingView.m
Tools/LoadingView/XBLoadingView.m
+3
-2
SceneViewController.m
Tools/SceneViewController.m
+6
-6
ShareGoodsViewController.m
Tools/ShareGoodsViewController.m
+13
-24
ShoppingBagViewController.m
Tools/ShoppingBagViewController.m
+11
-13
No files found.
Class/AllCustomerViewController.m
View file @
6f6d36f1
...
...
@@ -145,13 +145,13 @@
#pragma mark -获取导购关联客户
-
(
void
)
getShoppersAssociatedCustomer
:
(
ConsumerQueryCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
GETSHOPPERSCONSUMER
)
WithRequestType
:
ZERO
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
allCustomerTableview
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
allCustomerTableview
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
self
.
allCustomerTableview
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
...
...
@@ -184,13 +184,13 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
allCustomerTableview
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
Class/CardBeenUseViewController.m
View file @
6f6d36f1
...
...
@@ -97,10 +97,10 @@
-
(
void
)
getCardDatasAction
:
(
BOOL
)
isRemove
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CARDINFORMATION
)
WithRequestType
:
ZERO
WithParameter
:
self
.
requestModel
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
weakSelf
.
beenUseCardCollectionView
.
emptyDataSetSource
=
self
;
weakSelf
.
beenUseCardCollectionView
.
emptyDataSetDelegate
=
self
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
beenUseCardCollectionView
];
...
...
@@ -113,12 +113,11 @@
[
weakSelf
.
datasArray
addObjectsFromArray
:
cardInformation
.
list
];
[
weakSelf
.
beenUseCardCollectionView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
beenUseCardCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -126,18 +125,17 @@
-
(
void
)
useJDECard
:
(
NSString
*
)
JDECardNumber
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
USEJDECARD
),
JDECardNumber
]
WithRequestType
:
ZERO
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
deleteUsedJDECard
:
JDECardNumber
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/CardDontUseViewController.m
View file @
6f6d36f1
...
...
@@ -114,11 +114,11 @@
-
(
void
)
getCardDatasAction
:
(
BOOL
)
isRemove
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
NSLog
(
@"%@"
,[
self
.
requestModel
toDictionary
]);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CARDINFORMATION
)
WithRequestType
:
ZERO
WithParameter
:
self
.
requestModel
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
weakSelf
.
dontUseCardCollectionView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
dontUseCardCollectionView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
dontUseCardCollectionView
];
...
...
@@ -131,12 +131,11 @@
[
weakSelf
.
datasArray
addObjectsFromArray
:[
NSMutableArray
arrayWithArray
:
cardInformation
.
list
]];
[
weakSelf
.
dontUseCardCollectionView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
dontUseCardCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -177,7 +176,7 @@
{
GroupByOrderNumber
*
model
=
self
.
datasArray
[
indexPath
.
section
];
if
([[
self
class
]
isBlankString
:
model
.
orderReceiptUrl
])
{
[
self
SHOWPromptt
ext
:
@"不能查看未激活卡劵,请先上传小票激活卡劵"
];
[
XBLoadingView
showHUDViewWithT
ext
:
@"不能查看未激活卡劵,请先上传小票激活卡劵"
];
}
}
...
...
@@ -201,7 +200,7 @@
else
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
weakSelf
ErrorMBProgressView
:
@"相机无法使用"
];
[
XBLoadingView
showHUDViewWithText
:
@"相机无法使用"
];
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
...
...
@@ -214,7 +213,7 @@
else
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
weakSelf
ErrorMBProgressView
:
@"相册无法打开"
];
[
XBLoadingView
showHUDViewWithText
:
@"相册无法打开"
];
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
...
...
@@ -240,18 +239,24 @@
{
WS
(
weakSelf
);
NSData
*
data
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
XBLoadingView
*
progressView
=
[
XBLoadingView
showHUDViewProgressLabel
:
@"上传小票中"
];
[[
NetworkRequestClassManager
Manager
]
UploadImageWithURL
:
SERVERREQUESTURL
(
UPLOADHEADER
)
WithRequestType
:
ONE
WithImageDatas
:
data
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
activationJDECard
:
returnValue
[
@"data"
]];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithprogressBlock
:^
(
double
progress
)
{
[
weakSelf
ShowProgressView
:
progress
];
if
(
progress
>=
1
)
{
progressView
.
labelText
=
@"上传小票成功"
;
[
progressView
hide
:
YES
afterDelay
:
1
];
}
else
{
progressView
.
progress
=
progress
;
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -259,22 +264,21 @@
-
(
void
)
activationJDECard
:
(
NSString
*
)
imagePath
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
ACTIVIATIONJDECARD
),
self
.
orderNumber
,
imagePath
]
WithRequestType
:
ZERO
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
isRefreshValue
=
NO
;
[
weakSelf
.
dontUseCardCollectionView
.
mj_header
beginRefreshing
];
[
weakSelf
SuccessMBProgressView
:
@"激活成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"激活成功"
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/CardViewController.m
View file @
6f6d36f1
...
...
@@ -75,11 +75,11 @@
}
[
weakSelf
.
cardCollectionView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -87,18 +87,17 @@
-
(
void
)
useJDECard
:
(
NSString
*
)
JDECardNumber
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
USEJDECARD
),
JDECardNumber
]
WithRequestType
:
ZERO
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
deleteUsedJDECard
:
JDECardNumber
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -139,7 +138,7 @@
[
weakSelf
.
navigationController
pushViewController
:
cardDetails
animated
:
YES
];
}];
}
else
if
([
model
.
state
isEqualToString
:
CHECK
]){
[
self
ErrorMBProgressView
:
@"审核中"
];
[
XBLoadingView
showHUDViewWithText
:
@"审核中"
];
}
else
{
CardAmplificationViewController
*
cardVC
=
[[
CardAmplificationViewController
alloc
]
init
];
self
.
settingsPopoverController
=
[[
WYPopoverController
alloc
]
initWithContentViewController
:
cardVC
];
...
...
Class/ChangePasswordViewController.m
View file @
6f6d36f1
...
...
@@ -61,18 +61,18 @@
[
self
.
view
endEditing
:
YES
];
if
([
BaseViewController
isBlankString
:
self
.
userName
.
text
])
{
[
self
ErrorMBProgressView
:
@"账户名不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"账户名不能为空"
];
}
else
if
([
BaseViewController
isBlankString
:
self
.
oldPassWord
.
text
])
{
[
self
ErrorMBProgressView
:
@"旧密码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"旧密码不能为空"
];
}
else
if
([
BaseViewController
isBlankString
:
self
.
NewPassWord
.
text
])
{
[
self
ErrorMBProgressView
:
@"新密码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"新密码不能为空"
];
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
ModifyPasswordRequest
*
modify
=
[[
ModifyPasswordRequest
alloc
]
init
];
modify
.
oldPassword
=
self
.
oldPassWord
.
text
;
modify
.
fnewPassword
=
self
.
NewPassWord
.
text
;
...
...
@@ -82,12 +82,12 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODIFYPASSWORD
)
WithRequestType
:
ZERO
WithParameter
:
modify
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//保存最新的账号信息
[
Shoppersmanager
manager
].
passWordString
=
weakSelf
.
NewPassWord
.
text
;
[
weakSelf
SuccessMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithSuccessText
:
returnValue
[
@"message"
]];
if
([
weakSelf
.
delegate
respondsToSelector
:
@selector
(
cancelButtonClick
)])
{
[
weakSelf
.
delegate
cancelButtonClick
];
...
...
@@ -95,7 +95,7 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
...
...
Class/ClientShoppingCarViewController.m
View file @
6f6d36f1
...
...
@@ -73,14 +73,14 @@
#pragma mark -获取购物车商品
-
(
void
)
getShoppingCardata
:
(
ShopCartFilter
*
)
shopCar
isRemove
:
(
BOOL
)
remove
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
clientShoppingCarTableView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
clientShoppingCarTableView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
clientShoppingCarTableView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
[
weakSelf
.
shopResponseArray
removeAllObjects
];
...
...
@@ -107,12 +107,11 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/ClientViewController.m
View file @
6f6d36f1
This diff is collapsed.
Click to expand it.
Class/CustomerOrderViewController.m
View file @
6f6d36f1
...
...
@@ -150,13 +150,13 @@
#pragma mark -获取导购下客户订单 ----isdelecte 表示是否清空数组
-
(
void
)
getGuideAllcustomerOrder
:
(
BOOL
)
isdelecte
WithorderBill
:
(
OrderFilter
*
)
allOrder
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
ZERO
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
customerOrderTableView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
customerOrderTableView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
customerOrderTableView
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -171,12 +171,12 @@
[
weakSelf
.
customerOrderTableView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
customerOrderTableView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
@@ -332,25 +332,25 @@
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
nil
]];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"确认"
style
:
UIAlertActionStyleDestructive
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
OrderBill
*
model
=
[
weakSelf
.
datasArray
objectAtIndex_opple
:
cellindex
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@/%@/%@"
,
SERVERREQUESTURL
(
RESETORDER
),
model
.
order
.
orderNumber
,
model
.
order
.
orderState
,
@"005"
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
SuccessMBProgressView
:
@"撤销成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"撤销成功"
];
model
.
order
.
orderState
=
@"005"
;
NSIndexPath
*
indexapath
=
[
NSIndexPath
indexPathForRow
:
cellindex
inSection
:
0
];
[
weakSelf
.
customerOrderTableView
reloadRowsAtIndexPaths
:@[
indexapath
]
withRowAnimation
:
UITableViewRowAnimationLeft
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
...
...
Class/Login/LoginViewController.m
View file @
6f6d36f1
...
...
@@ -138,11 +138,11 @@
if
([[
self
class
]
isBlankString
:
self
.
userName
.
text
])
{
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"用户名不能为空"
];
return
;
}
else
if
([[
self
class
]
isBlankString
:
self
.
passWord
.
text
])
{
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"密码不能为空"
];
return
;
}
[
self
judgeUserNameAndPassword
];
...
...
@@ -190,14 +190,14 @@
#pragma mark -判断用户名密码是否正确
-
(
void
)
judgeUserNameAndPassword
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
login
.
username
=
self
.
userName
.
text
;
login
.
password
=
self
.
passWord
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
ZERO
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//设置检测用户标示
...
...
@@ -216,11 +216,10 @@
[
weakSelf
SetTheRootViewController
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -297,7 +296,7 @@
self
.
identityView
.
userName
.
text
=
self
.
userName
.
text
;
}
else
{
[
self
ErrorMBProgressView
:
@"请填写您的用户名"
];
[
XBLoadingView
showHUDViewWithText
:
@"请填写您的用户名"
];
self
.
passWord
.
text
=
@""
;
return
;
}
...
...
@@ -320,30 +319,29 @@
WS
(
weakSelf
);
NSString
*
inputPhoneNumber
=
self
.
identityView
.
bindingPhoneNumber
.
text
;
if
([[
self
class
]
isBlankString
:
inputPhoneNumber
])
{
[
self
ErrorMBProgressView
:
@"手机号不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"手机号不能为空"
];
return
;
}
if
(
!
[
HENLENSONG
isValidateMobile
:
inputPhoneNumber
])
{
[
self
ErrorMBProgressView
:
@"手机号码格式不正确"
];
[
XBLoadingView
showHUDViewWithText
:
@"手机号码格式不正确"
];
return
;
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
//发送验证码
NSString
*
urlString
=
[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
SENDSMS
),
inputPhoneNumber
,
self
.
identityView
.
userName
.
text
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
urlString
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
ErrorMBProgressView
:
@"发送验证码成功"
];
[
XBLoadingView
showHUDViewWithText
:
@"发送验证码成功"
];
[
weakSelf
.
identityView
.
SendButton
setTitle
:
@"60"
forState
:
UIControlStateNormal
];
weakSelf
.
identityView
.
SendButton
.
enabled
=
NO
;
weakSelf
.
sendTimer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
SendbuttonChangetitle
)
userInfo
:
nil
repeats
:
YES
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -379,7 +377,7 @@
{
// 验证码必须填写
if
([[
self
class
]
isBlankString
:
self
.
identityView
.
verificationCode
.
text
])
{
[
self
ErrorMBProgressView
:
@"验证码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"验证码不能为空"
];
return
;
}
else
{
...
...
@@ -404,15 +402,15 @@
-
(
void
)
ChangPassWordRequest
{
if
([[
self
class
]
isBlankString
:
self
.
resetPasswordView
.
newpass
.
text
])
{
[
self
ErrorMBProgressView
:
@"新密码为空"
];
return
;
[
XBLoadingView
showHUDViewWithText
:
@"新密码为空"
];
return
;
}
if
([[
self
class
]
isBlankString
:
self
.
resetPasswordView
.
confirmNewpass
.
text
]){
[
self
ErrorMBProgressView
:
@"确认密码为空"
];
return
;
[
XBLoadingView
showHUDViewWithText
:
@"确认密码为空"
];
return
;
}
if
(
!
[
self
.
resetPasswordView
.
newpass
.
text
isEqualToString
:
self
.
resetPasswordView
.
confirmNewpass
.
text
])
{
[
self
ErrorMBProgressView
:
@"两次密码不相同"
];
return
;
[
XBLoadingView
showHUDViewWithText
:
@"两次密码不相同"
];
return
;
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
//重置密码接口
ResetPasswordRequest
*
passwrod
=
[[
ResetPasswordRequest
alloc
]
init
];
passwrod
.
fnewPassword
=
self
.
resetPasswordView
.
newpass
.
text
;
...
...
@@ -421,20 +419,20 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
RESETPASSWORD
)
WithRequestType
:
ZERO
WithParameter
:
passwrod
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
ErrorMBProgressView
:
@"重置密码成功"
];
[
XBLoadingView
showHUDViewWithText
:
@"重置密码成功"
];
weakSelf
.
passWord
.
text
=
weakSelf
.
resetPasswordView
.
newpass
.
text
;
[
weakSelf
judgeUserNameAndPassword
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
@@ -483,7 +481,7 @@
[
weakSelf
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/LuckyDrawDetailsViewController.m
View file @
6f6d36f1
...
...
@@ -127,10 +127,10 @@
-
(
void
)
getDrawDatas
:
(
BOOL
)
isRemove
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOTTERYED
)
WithRequestType
:
ZERO
WithParameter
:
self
.
drawModel
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
drawDetailsTableView
];
weakSelf
.
drawDetailsTableView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
drawDetailsTableView
.
emptyDataSetDelegate
=
weakSelf
;
...
...
@@ -143,11 +143,10 @@
weakSelf
.
totalPage
=
[
returnValue
[
@"data"
][
@"totalpages"
]
integerValue
];
[
weakSelf
.
drawDetailsTableView
reloadData
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -203,15 +202,14 @@
#pragma mark - 去抽奖
-
(
void
)
drawButtonClickAction
:
(
UIButton
*
)
sender
{
WS
(
weakSelf
);
RsAwardDraw
*
drawEntity
=
self
.
datasArray
[
sender
.
tag
];
[
self
showLuckyDrawControl
:
drawEntity
.
draw
.
lotteryId
andOrderNumber
:
drawEntity
.
draw
.
orderNumber
andDrawid
:
drawEntity
.
draw
.
fid
luckyDrawFinish
:^
(
NSDictionary
*
dict
)
{
if
([
dict
isKindOfClass
:[
NSDictionary
class
]])
{
if
([
BaseViewController
isBlankString
:
dict
[
@"awardId"
]])
{
[
weakSelf
SHOWPromptt
ext
:
@"未中奖"
];
[
XBLoadingView
showHUDViewWithT
ext
:
@"未中奖"
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:[
NSString
stringWithFormat
:
@"恭喜你获得了 %@"
,
dict
[
@"description"
]]];
[
XBLoadingView
showHUDViewWithT
ext
:[
NSString
stringWithFormat
:
@"恭喜你获得了 %@"
,
dict
[
@"description"
]]];
}
}
}];
...
...
Class/OrderRecordViewController.m
View file @
6f6d36f1
...
...
@@ -73,13 +73,13 @@
#pragma mark -获取客户订单数据
-
(
void
)
getGuideAllcustomerOrder
:
(
OrderFilter
*
)
allOrder
isRemove
:
(
BOOL
)
remove
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
QUERYORDER
)
WithRequestType
:
ZERO
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
orderRecordTableView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
orderRecordTableView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
orderRecordTableView
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
...
...
@@ -93,12 +93,11 @@
[
weakSelf
.
orderRecordTableView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/OrderdetailsViewController.m
View file @
6f6d36f1
This diff is collapsed.
Click to expand it.
Class/PaymentsViewController.m
View file @
6f6d36f1
...
...
@@ -98,13 +98,13 @@
-
(
void
)
getDatasAction
:
(
BOOL
)
isRemoveAll
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PAYMENTS
)
WithRequestType
:
ZERO
WithParameter
:
self
.
model
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
paymentsTableView
.
emptyDataSetSource
=
self
;
weakSelf
.
paymentsTableView
.
emptyDataSetDelegate
=
self
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
paymentsTableView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
isRemoveAll
)
{
[
weakSelf
.
resultArray
removeAllObjects
];
...
...
@@ -117,13 +117,13 @@
[
weakSelf
.
paymentsTableView
reloadData
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
paymentsTableView
];
[
weakSelf
SHOWPromptt
ext
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithT
ext
:
error
.
localizedDescription
];
}];
}
...
...
Class/ProductDetailsViewController.m
View file @
6f6d36f1
...
...
@@ -89,11 +89,11 @@
-
(
void
)
getGoodsListDetails
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
GOODSDETAILS
),
_goodsID
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
url
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
entity
=
[[
TOGoodsEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
weakSelf
.
productDetilsTableview
reloadData
];
...
...
@@ -101,11 +101,10 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -249,7 +248,7 @@
if
(
goodsNumber
<=
1
)
{
//不能小于1
[
self
ErrorMBProgressView
:
@"不能小于1"
];
[
XBLoadingView
showHUDViewWithText
:
@"不能小于1"
];
return
;
}
goodsNumber
--
;
...
...
@@ -261,7 +260,7 @@
if
(
goodsNumber
>=
self
.
entity
.
inv
)
{
//不能大于库存
[
self
ErrorMBProgressView
:
@"超过库存"
];
[
XBLoadingView
showHUDViewWithText
:
@"超过库存"
];
return
;
}
goodsNumber
++
;
...
...
@@ -281,13 +280,13 @@
NSString
*
inputString
=
textField
.
text
;
if
(
!
[
self
isPureInt
:
inputString
])
{
[
self
ErrorMBProgressView
:
@"输入格式错误"
];
[
XBLoadingView
showHUDViewWithText
:
@"输入格式错误"
];
textField
.
text
=
@"1"
;
return
;
}
if
([
inputString
integerValue
]
>
self
.
entity
.
inv
)
{
[
self
ErrorMBProgressView
:
@"超过库存数量"
];
[
XBLoadingView
showHUDViewWithText
:
@"超过库存数量"
];
textField
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,(
long
)
self
.
entity
.
inv
];
return
;
}
...
...
@@ -368,11 +367,11 @@
//判断是否有当前客户
if
(
!
[
Shoppersmanager
manager
].
currentCustomer
)
{
[
self
ErrorMBProgressView
:
@"必须设置当前客户"
];
[
XBLoadingView
showHUDViewWithText
:
@"必须设置当前客户"
];
return
;
}
if
([
self
.
headerView
.
goodsNumber
.
text
integerValue
]
>
self
.
entity
.
inv
)
{
[
self
ErrorMBProgressView
:
@"超过库存"
];
[
XBLoadingView
showHUDViewWithText
:
@"超过库存"
];
return
;
}
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
...
...
@@ -380,20 +379,20 @@
shopCar
.
goodsId
=
_goodsID
;
shopCar
.
count
=
self
.
headerView
.
goodsNumber
.
text
;
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
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
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
@"添加购物车失败"
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
@"添加购物车失败"
];
}];
}
...
...
Class/ProductLibraryViewController.m
View file @
6f6d36f1
...
...
@@ -53,10 +53,6 @@
*/
@property
(
nonatomic
,
strong
)
GoodsResponse
*
temporaryArray
;
/**
* 当前页数
*/
@property
(
nonatomic
,
assign
)
int
indexPage
;
/**
* 搜索结果个数
...
...
@@ -106,6 +102,10 @@
{
if
(
!
_condtionModel
)
{
_condtionModel
=
[[
GoodsCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
ONE
;
page
.
rows
=
KROWS
;
_condtionModel
.
page
=
page
;
}
return
_condtionModel
;
}
...
...
@@ -153,11 +153,11 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -166,14 +166,14 @@
#pragma mark -获取商品列表数据
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRODUCTLIST
)
WithRequestType
:
ZERO
WithParameter
:
conditon
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
productCollectionView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
productCollectionView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
productCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
GoodsResponse
*
sponse
=
[[
GoodsResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -183,19 +183,17 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
#pragma mark -布局
-
(
void
)
uiConfigAction
{
self
.
indexPage
=
ONE
;
self
.
selectedIndex
=
9999
;
//无任何意义
self
.
productCollectionLayout
.
itemSize
=
CGSizeMake
((
ScreenWidth
-
100
)
/
3
,
(
ScreenWidth
-
100
)
/
3
);
self
.
productCollectionLayout
.
sectionInset
=
UIEdgeInsetsMake
(
20
,
30
,
20
,
30
);
...
...
@@ -218,12 +216,7 @@
[
weakSelf
barCodeSearchRequest
];
}
else
{
//分页数据
DataPage
*
Newpage
=
[[
DataPage
alloc
]
init
];
Newpage
.
page
=
ONE
;
Newpage
.
rows
=
KROWS
;
weakSelf
.
condtionModel
.
page
=
Newpage
;
weakSelf
.
indexPage
=
ONE
;
weakSelf
.
condtionModel
.
page
.
page
=
ONE
;
//搜索
if
(
_selectedCode
)
{
switch
(
weakSelf
.
selectedIndex
)
{
...
...
@@ -276,15 +269,10 @@
[
weakSelf
barCodeSearchRequest
];
}
else
{
if
(
++
weakSelf
.
indexP
age
>
weakSelf
.
totalPages
)
{
if
(
++
weakSelf
.
condtionModel
.
page
.
p
age
>
weakSelf
.
totalPages
)
{
[
weakSelf
.
productCollectionView
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
//分页数据
DataPage
*
Newpage
=
[[
DataPage
alloc
]
init
];
Newpage
.
page
=
weakSelf
.
indexPage
;
Newpage
.
rows
=
KROWS
;
weakSelf
.
condtionModel
.
page
=
Newpage
;
//搜索
if
(
_selectedCode
)
{
switch
(
weakSelf
.
selectedIndex
)
{
...
...
@@ -333,15 +321,15 @@
-
(
void
)
barCodeSearchRequest
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
BARCODESEARCH
),
_barcode
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
endRefreshingForTableView
:
self
.
productCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"data"
]
isKindOfClass
:[
NSNull
class
]])
{
[
weakSelf
ErrorMBProgressView
:
@"暂无商品信息"
];
[
XBLoadingView
showHUDViewWithText
:
@"暂无商品信息"
];
return
;
}
TOGoodsEntity
*
goods
=
[[
TOGoodsEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -350,14 +338,14 @@
[
weakSelf
.
productCollectionView
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
@"查询失败"
];
[
XBLoadingView
showHUDViewWithText
:
@"查询失败"
];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
endRefreshingForTableView
:
self
.
productCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
@"查询失败"
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
@"查询失败"
];
}];
}
...
...
@@ -403,19 +391,19 @@
[
cell
setReturnCellCgpoint
:
^
void
(
CGPoint
centerPoint
,
NSInteger
cellindex
,
CGSize
size
)
{
//判断是否有当前客户
if
(
!
[
Shoppersmanager
manager
].
currentCustomer
)
{
[
weakSelf
ErrorMBProgressView
:
@"必须设置当前客户"
];
[
XBLoadingView
showHUDViewWithText
:
@"必须设置当前客户"
];
return
;
}
//库存为0时不能加入购物车
if
(
model
.
number
==
0
)
{
[
weakSelf
ErrorMBProgressView
:
@"此商品库存不足"
];
[
XBLoadingView
showHUDViewWithText
:
@"此商品库存不足"
];
return
;
}
TOGoodsEntity
*
model
=
[
weakSelf
.
datasArray
objectAtIndex_opple
:
cellindex
];
[
weakSelf
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[
weakSelf
addGoodsShoppingbags
:
model
complate
:
^
{
NSLog
(
@"加入购物车完成"
);
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
StartAddShoppingCarAnimationWithimage
:
weakCell
.
productImageView
.
image
withStartpoint
:
centerPoint
withSize
:
size
];
}];
}];
...
...
@@ -669,7 +657,7 @@
{
if
(
self
.
temporaryArray
.
goodsEntity
.
count
==
0
)
{
[
self
ErrorMBProgressView
:
@"暂无数据"
];
[
XBLoadingView
showHUDViewWithText
:
@"暂无数据"
];
}
else
{
self
.
datasArray
=
[
NSMutableArray
arrayWithArray
:
self
.
temporaryArray
.
goodsEntity
];
...
...
@@ -704,7 +692,6 @@
#pragma mark -添加至购物车
-
(
void
)
addGoodsShoppingbags
:
(
TOGoodsEntity
*
)
model
complate
:
(
void
(
^
)())
response
{
WS
(
weakSelf
);
SaveShoppingCartRequest
*
shopCar
=
[[
SaveShoppingCartRequest
alloc
]
init
];
shopCar
.
consumerId
=
[
Customermanager
manager
].
model
.
fid
;
shopCar
.
goodsId
=
model
.
fid
;
...
...
@@ -714,11 +701,11 @@
response
();
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
@"加入购物车失败"
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
@"加入购物车失败"
];
}];
}
...
...
Class/RebateDetailsViewController.m
View file @
6f6d36f1
...
...
@@ -36,33 +36,33 @@
WS
(
weakSelf
);
if
([[
self
class
]
isBlankString
:
self
.
inputRebateTextField
.
text
])
{
[
self
SHOWPromptt
ext
:
@"请输入提现金额"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"请输入提现金额"
];
return
;
}
if
([
self
.
inputRebateTextField
.
text
floatValue
]
>
self
.
rebateAmount
)
{
[
self
SHOWPromptt
ext
:
@"当前账户余额不足"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"当前账户余额不足"
];
return
;
}
if
([
self
.
inputRebateTextField
.
text
floatValue
]
<=
0
)
{
[
self
SHOWPromptt
ext
:
@"格式不正确"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"格式不正确"
];
return
;
}
if
([
self
includeChinese
:
self
.
inputRebateTextField
.
text
])
{
[
self
SHOWPromptt
ext
:
@"格式不正确"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"格式不正确"
];
return
;
}
UIAlertController
*
alertVC
=
[
UIAlertController
alertControllerWithTitle
:
nil
message
:[
NSString
stringWithFormat
:
@"请确认提现金额:%@元"
,
self
.
inputRebateTextField
.
text
]
preferredStyle
:
UIAlertControllerStyleAlert
];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"确认"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
WITHDRAWAL
)
WithRequestType
:
ZERO
WithParameter
:
@{
@"amount"
:
self
.
inputRebateTextField
.
text
}
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
applyUUID
=
returnValue
[
@"data"
];
[
weakSelf
rebateApplySuccess
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
SHOWPromptt
ext
:
error
.
localizedDescription
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithT
ext
:
error
.
localizedDescription
];
}];
}]];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
...
...
@@ -95,11 +95,11 @@
#pragma mark - 查询详情
-
(
void
)
queryDetails
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
NSString
*
urlString
=
[
NSString
stringWithFormat
:
@"%@/%@"
,
WITHDRAWALPROGRESSDETAILS
,
self
.
applyUUID
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
urlString
)
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
TOApplyBillEntity
*
result
=
[[
TOApplyBillEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
weakSelf
.
navigationController
popViewControllerAnimated
:
NO
];
...
...
@@ -108,11 +108,10 @@
}
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
SHOWPrompttext
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/RebateViewController.m
View file @
6f6d36f1
...
...
@@ -204,11 +204,11 @@
-
(
void
)
getRebateDatasFromUser
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
NSString
*
URL
=
[
NSString
stringWithFormat
:
@"%@/%@"
,
REBATE
,[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
URL
)
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
model
=
[[
EarningsResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
weakSelf
.
currentAmountLabel
.
text
=
[
NSString
stringWithFormat
:
@"%.2f"
,[
returnValue
[
@"data"
][
@"accountTotal"
]
floatValue
]];
...
...
@@ -217,12 +217,11 @@
weakSelf
.
freezeAmountLabel
.
text
=
[
NSString
stringWithFormat
:
@"%.2f"
,[
returnValue
[
@"data"
][
@"applytotal"
]
floatValue
]];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
SHOWPrompttext
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/SceneLibraryViewController.m
View file @
6f6d36f1
...
...
@@ -29,11 +29,6 @@
*/
@property
(
nonatomic
,
strong
)
NSArray
*
imageArray
;
/**
* 当前页数
*/
@property
(
nonatomic
,
assign
)
int
indexPage
;
/**
* 总页数
*/
...
...
@@ -77,8 +72,11 @@
-
(
SceneCondition
*
)
conditionModel
{
if
(
!
_conditionModel
)
{
_conditionModel
=
[[
SceneCondition
alloc
]
init
];
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
ONE
;
page
.
rows
=
KROWS
;
_conditionModel
.
page
=
page
;
}
return
_conditionModel
;
}
...
...
@@ -123,12 +121,8 @@
//下拉刷新
WS
(
weakSelf
);
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
//默认数据
weakSelf
.
indexPage
=
ONE
;
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
weakSelf
.
indexPage
;
page
.
rows
=
KROWS
;
weakSelf
.
conditionModel
.
page
=
page
;
weakSelf
.
conditionModel
.
page
.
page
=
ONE
;
[
weakSelf
.
seceneLibararyCollectionView
.
mj_footer
resetNoMoreData
];
[
weakSelf
getSceneLibrarydatas
:
weakSelf
.
conditionModel
isRemove
:
YES
];
}];
...
...
@@ -139,15 +133,10 @@
//上拉加载
self
.
seceneLibararyCollectionView
.
mj_footer
=
[
MJRefreshAutoNormalFooter
footerWithRefreshingBlock
:
^
{
if
(
++
weakSelf
.
indexP
age
>
weakSelf
.
totalPages
)
{
if
(
++
weakSelf
.
conditionModel
.
page
.
p
age
>
weakSelf
.
totalPages
)
{
[
weakSelf
.
seceneLibararyCollectionView
.
mj_footer
endRefreshingWithNoMoreData
];
}
else
{
//默认数据
DataPage
*
Newpage
=
[[
DataPage
alloc
]
init
];
Newpage
.
page
=
weakSelf
.
indexPage
;
Newpage
.
rows
=
KROWS
;
weakSelf
.
conditionModel
.
page
=
Newpage
;
[
weakSelf
getSceneLibrarydatas
:
weakSelf
.
conditionModel
isRemove
:
NO
];
}
}];
...
...
@@ -167,7 +156,7 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
...
...
@@ -179,14 +168,14 @@
#pragma mark -获取场景列表数据
-
(
void
)
getSceneLibrarydatas
:
(
SceneCondition
*
)
condition
isRemove
:
(
BOOL
)
remove
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SCENELIST
)
WithRequestType
:
ZERO
WithParameter
:
condition
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
seceneLibararyCollectionView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
seceneLibararyCollectionView
.
emptyDataSetDelegate
=
weakSelf
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
seceneLibararyCollectionView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
[
weakSelf
.
responseArray
removeAllObjects
];
...
...
@@ -200,13 +189,13 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
seceneLibararyCollectionView
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/SearchViewController.m
View file @
6f6d36f1
...
...
@@ -152,10 +152,10 @@
-
(
void
)
getHotSearchdatas
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
HOTSEARCH
)
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
response
=
[[
HotFilter
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -163,12 +163,11 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/SettlementViewController.m
View file @
6f6d36f1
...
...
@@ -198,11 +198,11 @@
}
else
{
NSLog
(
@"获取二维码失败"
);
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -225,11 +225,11 @@
-
(
IBAction
)
SureButtonClick
:
(
UIButton
*
)
sender
{
if
([
self
.
payTypeButton
.
currentTitle
isEqualToString
:
@"现金、支票、转账、刷卡"
]
&&
!
self
.
payTreasureButton
.
selected
&&
!
self
.
WeixiPayButton
.
selected
)
{
[
self
ErrorMBProgressView
:
@"请选择一种支付方式"
];
[
XBLoadingView
showHUDViewWithText
:
@"请选择一种支付方式"
];
}
else
if
([
self
.
invoiceType
.
currentTitle
isEqualToString
:
@"公司发票"
]
&&
[[
self
class
]
isBlankString
:
self
.
invoiceHeader
.
text
])
{
[
self
ErrorMBProgressView
:
@"请输入发票抬头"
];
[
XBLoadingView
showHUDViewWithText
:
@"请输入发票抬头"
];
}
else
{
[
self
SurePayRequest
];
...
...
@@ -248,7 +248,7 @@
[
self
.
payController
dismissViewControllerAnimated
:
NO
completion
:
nil
];
if
([
self
.
weiXinLabe
isKindOfClass
:[
NSNull
class
]])
{
[
self
SHOWPromptt
ext
:
@"微信支付二维码为空,暂停使用!"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"微信支付二维码为空,暂停使用!"
];
return
;
}
self
.
showPayQrCodeImageView
.
hidden
=
NO
;
sender
.
selected
=
NO
;
...
...
@@ -264,7 +264,7 @@
[
self
.
payController
dismissViewControllerAnimated
:
NO
completion
:
nil
];
if
([
self
.
zhiFubaoLabe
isKindOfClass
:[
NSNull
class
]])
{
[
self
SHOWPromptt
ext
:
@"支付宝支付二维码为空,暂停使用!"
];
return
;
[
XBLoadingView
showHUDViewWithT
ext
:
@"支付宝支付二维码为空,暂停使用!"
];
return
;
}
self
.
showPayQrCodeImageView
.
hidden
=
NO
;
sender
.
selected
=
NO
;
...
...
@@ -306,7 +306,7 @@
-
(
IBAction
)
invoiceTypeButtonClick
:
(
UIButton
*
)
sender
{
if
([
self
.
ISinvoiceButton
.
currentTitle
isEqualToString
:
@"否"
])
{
[
self
ErrorMBProgressView
:
@"请选择开票"
];
[
XBLoadingView
showHUDViewWithText
:
@"请选择开票"
];
return
;
}
NSArray
*
arr
=
@[
@"个人发票"
,
@"公司发票"
];
...
...
@@ -462,7 +462,7 @@
if
([
self
.
invoiceType
.
currentTitle
isEqualToString
:
@"公司发票"
]
&&
[
order
.
isbill
isEqualToString
:
@"Y"
])
{
order
.
billType
=
@"002"
;
if
(
self
.
invoiceHeader
.
text
.
length
==
0
||
!
self
.
invoiceHeader
.
text
)
{
[
self
ErrorMBProgressView
:
@"发票抬头不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"发票抬头不能为空"
];
return
;
}
order
.
billTitle
=
self
.
invoiceHeader
.
text
;
...
...
@@ -470,12 +470,12 @@
{
order
.
billType
=
@"001"
;
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
NSSLog
(
@"%@"
,[
order
toDictionary
]);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CONFIRMPAY
)
WithRequestType
:
ZERO
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
^
{
if
(
weakSelf
.
PaySuccessReturnBlock
)
{
...
...
@@ -483,11 +483,10 @@
}
}];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -521,7 +520,7 @@
-
(
BOOL
)
textFieldShouldBeginEditing
:
(
UITextField
*
)
textField
{
if
([
self
.
ISinvoiceButton
.
currentTitle
isEqualToString
:
@"否"
])
{
[
self
ErrorMBProgressView
:
@"请选择开票"
];
[
XBLoadingView
showHUDViewWithText
:
@"请选择开票"
];
return
NO
;
}
return
YES
;
...
...
Class/Shoppingcart/AddressViewController.m
View file @
6f6d36f1
...
...
@@ -147,20 +147,20 @@
NSString
*
phoneNumber
=
self
.
PhoneNumber
.
text
;
if
([
BaseViewController
isBlankString
:
self
.
recipientPerson
.
text
])
{
[
self
ErrorMBProgressView
:
@"请输入收货人姓名"
];
[
XBLoadingView
showHUDViewWithText
:
@"请输入收货人姓名"
];
return
;
}
if
([
BaseViewController
isBlankString
:
phoneNumber
])
{
[
self
ErrorMBProgressView
:
@"手机号码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"手机号码不能为空"
];
return
;
}
if
(
!
[
HENLENSONG
isValidateMobile
:
phoneNumber
])
{
[
self
ErrorMBProgressView
:
@"手机号码格式不正确"
];
[
XBLoadingView
showHUDViewWithText
:
@"手机号码格式不正确"
];
return
;
}
if
([
BaseViewController
isBlankString
:
self
.
detailsAddress
.
text
])
{
[
self
ErrorMBProgressView
:
@"请输入详细地址"
];
[
XBLoadingView
showHUDViewWithText
:
@"请输入详细地址"
];
return
;
}
if
([
sender
.
currentTitle
isEqualToString
:
@"新增"
])
{
...
...
@@ -186,11 +186,11 @@
address
.
province
=
self
.
provincesString
;
}
address
.
address
=
self
.
detailsAddress
.
text
;
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDADDRESS
)
WithRequestType
:
ZERO
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
...
...
@@ -216,11 +216,11 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
@@ -239,11 +239,11 @@
address
.
province
=
self
.
provincesString
;
}
address
.
fid
=
self
.
model
.
fid
;
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CHANGEADDRESS
)
WithRequestType
:
ZERO
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
...
...
@@ -269,12 +269,11 @@
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
@@ -296,25 +295,25 @@
#pragma mark -删除收货地址
-
(
void
)
deleteAddressButtonClick
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
REMOVEADDRESS
),
_model
.
fid
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
SuccessMBProgressView
:
@"删除成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"删除成功"
];
if
([
weakSelf
.
delegate
respondsToSelector
:
@selector
(
delecteCell
:)])
{
[
weakSelf
.
delegate
delecteCell
:
_model
.
fid
];
}
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
Class/Shoppingcart/GenerateOrdersViewController.m
View file @
6f6d36f1
...
...
@@ -110,11 +110,11 @@
#pragma mark -获得地址信息
-
(
void
)
getAddressDatasRequest
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
SHIPPINGADDRESS
),[
Customermanager
manager
].
model
.
fid
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
RsShippingAddrEntity
*
address
=
[[
RsShippingAddrEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -150,11 +150,10 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -400,10 +399,10 @@
//总数量
orderReceiver
.
goodsNum
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
order
.
orderdetailList
=
(
NSArray
<
TOOrderdetailEntity
>
*
)
goodidArr
;
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
CREATEORDER
)
WithRequestType
:
ZERO
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//商品购物车id
NSMutableArray
*
codeArrray
=
[
NSMutableArray
array
];
...
...
@@ -424,17 +423,17 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
return
;
}
else
if
(
i
==
Adressarr
.
count
-
1
)
{
[
self
ErrorMBProgressView
:
@"未选中地址"
];
[
XBLoadingView
showHUDViewWithText
:
@"未选中地址"
];
}
}
}
...
...
@@ -505,7 +504,7 @@
}
else
{
if
(
i
==
arr
.
count
-
1
)
{
[
self
ErrorMBProgressView
:
@"请先勾选一个地址"
];
[
XBLoadingView
showHUDViewWithText
:
@"请先勾选一个地址"
];
}
}
}
...
...
Class/Shoppingcart/ShoppingViewController.m
View file @
6f6d36f1
...
...
@@ -105,7 +105,7 @@
return
YES
;
}
if
(
self
.
shopResponseArray
.
count
==
0
)
{
[
self
ErrorMBProgressView
:
@"请先添加商品到购物车"
];
return
NO
;
[
XBLoadingView
showHUDViewWithText
:
@"请先添加商品到购物车"
];
return
NO
;
}
NSMutableArray
*
array
=
[
NSMutableArray
array
];
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
...
...
@@ -114,7 +114,7 @@
}
}
if
(
array
.
count
==
0
)
{
[
self
ErrorMBProgressView
:
@"没有选中任何商品"
];
return
NO
;
[
XBLoadingView
showHUDViewWithText
:
@"没有选中任何商品"
];
return
NO
;
}
[
self
inputDiscountNumber
];
return
NO
;
...
...
@@ -151,7 +151,7 @@
Shoppersmanager
*
user
=
[
Shoppersmanager
manager
];
if
([
self
.
textField
.
text
integerValue
]
<
[
user
.
Shoppers
.
lowestDiscount
integerValue
]
&&
!
[[
self
class
]
isBlankString
:
self
.
textField
.
text
])
{
[
self
SHOWPromptt
ext
:
@"当前价格低于你的价格权限!"
];
[
XBLoadingView
showHUDViewWithT
ext
:
@"当前价格低于你的价格权限!"
];
self
.
textField
.
text
=
nil
;
}
else
{
self
.
discountTextField
.
text
=
self
.
textField
.
text
;
...
...
@@ -235,13 +235,13 @@
Newpage
.
page
=
1
;
Newpage
.
rows
=
99999
;
shopcarNumber
.
dp
=
Newpage
;
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
SHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
shopcarNumber
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
shoppingTableview
.
emptyDataSetSource
=
weakSelf
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
shoppingTableview
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
ShopCartResponse
*
shopcar
=
[[
ShopCartResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -266,12 +266,11 @@
[
weakSelf
.
shoppingTableview
reloadData
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
shoppingTableview
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -291,9 +290,8 @@
}];
//提示框回调
[
cell
setPromptStringBlock
:
^
(
NSString
*
string
)
{
[
weakSelf
SHOWPrompttext
:
string
ComcpleteBlock
:
^
{
[
weakCell
.
clinchTextfield
becomeFirstResponder
];
}];
[
XBLoadingView
showHUDViewWithText
:
string
];
[
weakCell
.
clinchTextfield
becomeFirstResponder
];
}];
return
cell
;
}
...
...
@@ -355,7 +353,7 @@
}
if
(
array
.
count
==
0
)
{
[
self
ErrorMBProgressView
:
@"没有选中任何商品"
];
[
XBLoadingView
showHUDViewWithText
:
@"没有选中任何商品"
];
return
;
}
//商品总信息占位
...
...
@@ -371,7 +369,7 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
REMOVESHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
delecteGoods
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
QueryShoppingCarNumber
];
//商品cell
...
...
@@ -388,12 +386,12 @@
[
weakSelf
.
shoppingTableview
deleteRowsAtIndexPaths
:
cellArray
withRowAnimation
:
UITableViewRowAnimationTop
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}];
[
self
.
navigationController
pushViewController
:
generateOrder
animated
:
YES
];
...
...
@@ -442,7 +440,7 @@
#pragma mark -删除选中商品
-
(
IBAction
)
delecteSelectedGoods
:
(
UIButton
*
)
sender
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
DeleteCartRequest
*
delecteGoods
=
[[
DeleteCartRequest
alloc
]
init
];
//code数组
NSMutableArray
*
codeArr
=
[
NSMutableArray
array
];
...
...
@@ -461,15 +459,15 @@
}
//没有选中任何商品
if
(
codeArr
.
count
==
0
)
{
[
self
RemoveMBProgressHUDLoding
];
[
self
SHOWPromptt
ext
:
@"未选中商品"
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
showHUDViewWithT
ext
:
@"未选中商品"
];
return
;
}
delecteGoods
.
cartIds
=
codeArr
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
REMOVESHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
delecteGoods
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
QueryShoppingCarNumber
];
...
...
@@ -481,18 +479,17 @@
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
[
weakSelf
.
shoppingTableview
reloadData
];
});
[
weakSelf
SuccessMBProgressView
:
@"删除成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"删除成功"
];
[
weakSelf
CalculateSelectedGoodsAllprice
];
weakSelf
.
allSelectedButton
.
selected
=
NO
;
[
weakSelf
.
settlementButton
setTitle
:
@"去结算(0)"
forState
:
UIControlStateNormal
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -502,7 +499,7 @@
WS
(
weakSelf
);
dispatch_group_t
group
=
dispatch_group_create
();
static
NSInteger
number
=
ZERO
;
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[
goodsArray
enumerateObjectsUsingBlock
:
^
(
ShopcarModel
*
_Nonnull
model
,
NSUInteger
idx
,
BOOL
*
_Nonnull
stop
)
{
dispatch_group_enter
(
group
);
...
...
@@ -520,15 +517,14 @@
dispatch_group_notify
(
group
,
dispatch_get_main_queue
(),
^
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
(
number
==
goodsArray
.
count
)
{
[
weakSelf
CalculateSelectedGoodsAllprice
];
[
weakSelf
QueryShoppingCarNumber
];
finish
(
YES
);
}
else
{
[
self
SHOWPrompttext
:
@"修改失败"
ComcpleteBlock
:
^
{
finish
(
NO
);
}];
[
XBLoadingView
showHUDViewWithText
:
@"修改失败"
];
finish
(
NO
);
}
number
=
ZERO
;
});
...
...
@@ -537,7 +533,7 @@
#pragma mark -修改单个商品数量、价格
-
(
void
)
changeGoodsNumber
:
(
NSInteger
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
returnValue
:
(
void
(
^
)(
id
))
result
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
//保存商品数量
ShopcarModel
*
model
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
cellindex
];
model
.
goodsNum
=
goodsNumber
;
...
...
@@ -555,19 +551,18 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@/%@/%@/%@"
,
SERVERREQUESTURL
(
CHANGESHOPPINGBAGNUMBERPRICE
),
carid
,
goodsis
,
costpriceString
,
goodsNumberString
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
result
(
returnValue
);
//提供是否支持修改的参数
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
CalculateSelectedGoodsAllprice
];
[
weakSelf
QueryShoppingCarNumber
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Class/UserViewController.m
View file @
6f6d36f1
...
...
@@ -56,7 +56,6 @@
#pragma mark -查询返利金额
-
(
void
)
queryShoppersCommission
{
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
SHOPPERSCOMMISSION
),[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -97,7 +96,7 @@
else
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
[
XBLoadingView
showHUDViewWithText
:
@"相机无法使用"
];
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"从相册选择"
style
:
UIAlertActionStyleDefault
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
...
...
@@ -110,7 +109,7 @@
else
{
[
DeviceDirectionManager
instance
].
isHorizontal
=
NO
;
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
[
XBLoadingView
showHUDViewWithText
:
@"相册无法打开"
];
}
}]];
[
alertView
addAction
:[
UIAlertAction
actionWithTitle
:
@"取消"
style
:
UIAlertActionStyleCancel
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
...
...
@@ -141,6 +140,7 @@
{
WS
(
weakSelf
);
NSData
*
data
=
UIImageJPEGRepresentation
(
image
,
0
.
5
);
XBLoadingView
*
progressView
=
[
XBLoadingView
showHUDViewProgressLabel
:
@"上传头像中"
];
[[
NetworkRequestClassManager
Manager
]
UploadImageWithURL
:
SERVERREQUESTURL
(
UPLOADHEADER
)
WithRequestType
:
ONE
WithImageDatas
:
data
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -149,20 +149,18 @@
}];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithprogressBlock
:^
(
double
progress
)
{
if
(
progress
>=
1
)
{
weakSelf
.
TCHud
.
labelText
=
@"上传完成"
;
[
weakSelf
RemoveMBProgressHUDLoding
];
}
else
{
[
weakSelf
ShowProgressView
:
progress
];
progressView
.
labelText
=
@"上传完成"
;
[
progressView
hide
:
YES
afterDelay
:
1
];
}
else
{
progressView
.
progress
=
progress
;
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
weakSelf
.
TCHud
.
labelText
=
@"上传失败"
;
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -170,23 +168,22 @@
#pragma mark -上传完成修改导购个人信息
-
(
void
)
modifyshoppersInformation
:
(
NSString
*
)
headerurl
complete
:
(
void
(
^
)())
block
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
RsEmployeeRequest
*
employ
=
[[
RsEmployeeRequest
alloc
]
init
];
employ
.
employee
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
;
employ
.
employee
.
picture
=
headerurl
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
MODITYSHOPPERSINFORMATION
)
WithRequestType
:
ZERO
WithParameter
:
employ
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
block
();
[
weakSelf
SuccessMBProgressView
:
@"修改成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"修改成功"
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}
...
...
@@ -208,10 +205,10 @@
}]];
[
alertVC
addAction
:[
UIAlertAction
actionWithTitle
:
@"确认"
style
:
UIAlertActionStyleDestructive
handler
:
^
(
UIAlertAction
*
_Nonnull
action
)
{
[
weakSelf
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
CANCELLOGIN
)
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
...
...
@@ -226,7 +223,7 @@
[
weakSelf
promptCustomerWithString
:
@"切换用户失败"
];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}];
}]];
[
self
presentViewController
:
alertVC
animated
:
YES
completion
:
nil
];
...
...
@@ -260,26 +257,26 @@
if
([[
self
class
]
isBlankString
:
self
.
userName
.
text
])
{
[
self
ErrorMBProgressView
:
@"用户名不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"用户名不能为空"
];
return
;
}
if
([[
self
class
]
isBlankString
:
self
.
passWord
.
text
])
{
[
self
ErrorMBProgressView
:
@"密码不能为空"
];
[
XBLoadingView
showHUDViewWithText
:
@"密码不能为空"
];
return
;
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
LoginInfo
*
login
=
[[
LoginInfo
alloc
]
init
];
login
.
username
=
self
.
userName
.
text
;
login
.
password
=
self
.
passWord
.
text
;
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
LOGIN
)
WithRequestType
:
ZERO
WithParameter
:
login
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
SuccessMBProgressView
:
@"登陆成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"登陆成功"
];
LoginResult
*
result
=
[[
LoginResult
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
Shoppersmanager
manager
].
userNameString
=
weakSelf
.
userName
.
text
;
[
Shoppersmanager
manager
].
passWordString
=
weakSelf
.
passWord
.
text
;
...
...
@@ -296,12 +293,12 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
[
weakSelf
recoveryUsernamePasswrod
];
}
}
WithFailureBlock
:^
(
id
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
[
weakSelf
recoveryUsernamePasswrod
];
}];
...
...
Class/WithdrawalViewController.m
View file @
6f6d36f1
...
...
@@ -97,13 +97,13 @@
-
(
void
)
getDatasAction
:
(
BOOL
)
isRemoveAll
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
WITHDRAWALPROGRESS
)
WithRequestType
:
ZERO
WithParameter
:
self
.
model
WithReturnValueBlock
:^
(
id
returnValue
)
{
weakSelf
.
withdrawalTableView
.
emptyDataSetSource
=
self
;
weakSelf
.
withdrawalTableView
.
emptyDataSetDelegate
=
self
;
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
withdrawalTableView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
isRemoveAll
)
{
[
weakSelf
.
resultArray
removeAllObjects
];
...
...
@@ -116,12 +116,11 @@
[
weakSelf
.
withdrawalTableView
reloadData
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
withdrawalTableView
];
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
SHOWPrompttext
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Tools/BaseViewController.h
View file @
6f6d36f1
...
...
@@ -20,22 +20,6 @@
*/
-
(
void
)
endRefreshingForTableView
:(
UIScrollView
*
)
TableView
;
/**
* MBProgressHUD等待视图
*/
-
(
void
)
CreateMBProgressHUDLoding
;
/**
* 移除MBProgressHUD等待视图
*/
-
(
void
)
RemoveMBProgressHUDLoding
;
/**
* 渐隐提示框待回调Block
*/
-
(
void
)
SHOWPrompttext
:(
NSString
*
)
Text
ComcpleteBlock
:(
void
(
^
)())
completed
;
/**
* 获得我的storyboard对象
*/
...
...
@@ -51,32 +35,6 @@
*/
+
(
BOOL
)
determineCameraPermissions
;
/**
* 成功等待视图
*/
-
(
void
)
SuccessMBProgressView
:(
NSString
*
)
successString
;
/**
* 提示信息等待视图
*/
-
(
void
)
ErrorMBProgressView
:(
NSString
*
)
errorString
;
/**
* 纯文本提示框
*/
-
(
void
)
SHOWPrompttext
:(
NSString
*
)
Text
;
/**
* 显示提示图片、文本
*/
-
(
void
)
PromptinformationViewWithimage
:(
UIImage
*
)
image
withTitle
:(
NSString
*
)
title
withpoint
:(
CGPoint
)
point
;
/**
* 删除提示图片、文本
*/
-
(
void
)
RemovePromptinformationView
;
/**
* 提示框
*
...
...
@@ -111,18 +69,6 @@
*/
-
(
void
)
promptCustomerWithString
:(
NSString
*
)
message
;
/**
* 进度条
*/
-
(
void
)
ShowProgressView
:(
double
)
progress
;
/**
* 提示框
*/
@property
(
nonatomic
,
strong
)
MBProgressHUD
*
TCHud
;
/**
* 友好化时间
*/
...
...
Tools/BaseViewController.m
View file @
6f6d36f1
...
...
@@ -29,20 +29,6 @@
@implementation
BaseViewController
/**
* 创建MBProgressHUD对象
*
* @return MBProgressHUD
*/
-
(
MBProgressHUD
*
)
TCHud
{
if
(
_TCHud
==
nil
)
{
_TCHud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
}
return
_TCHud
;
}
/**
* 初始化提示框
...
...
@@ -69,7 +55,6 @@
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
...
...
@@ -120,102 +105,6 @@
completion
:
nil
];
}
#pragma mark -渐隐提示框回调
-
(
void
)
SHOWPrompttext
:
(
NSString
*
)
Text
ComcpleteBlock
:
(
void
(
^
)())
completed
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
.
window
animated
:
YES
];
hud
.
labelText
=
Text
;
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
6
];
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
2
.
0
f
];
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
if
(
completed
)
{
completed
();
}
});
}
#pragma mark -显示MBProgressHUD等待视图
-
(
void
)
CreateMBProgressHUDLoding
{
self
.
TCHud
.
animationType
=
MBProgressHUDAnimationZoom
;
self
.
TCHud
.
mode
=
MBProgressHUDModeIndeterminate
;
self
.
TCHud
.
color
=
[
UIColor
clearColor
];
self
.
TCHud
.
activityIndicatorColor
=
kMainBlueColor
;
self
.
TCHud
.
removeFromSuperViewOnHide
=
YES
;
}
#pragma mark -进度条
-
(
void
)
ShowProgressView
:
(
double
)
progress
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
self
.
TCHud
.
mode
=
MBProgressHUDModeDeterminate
;
self
.
TCHud
.
labelText
=
@"上传中...."
;
self
.
TCHud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
self
.
TCHud
.
progress
=
progress
;
self
.
TCHud
.
removeFromSuperViewOnHide
=
YES
;
});
}
#pragma mark -移除MBProgressHUD等待视图
-
(
void
)
RemoveMBProgressHUDLoding
;
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
TCHud
hide
:
YES
];
self
.
TCHud
=
nil
;
});
}
#pragma mark -显示成功的提示框
-
(
void
)
SuccessMBProgressView
:
(
NSString
*
)
successString
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeCustomView
;
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Checkmark"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysOriginal
];
hud
.
customView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
6
];
hud
.
labelFont
=
[
UIFont
systemFontOfSize
:
15
];
hud
.
labelText
=
successString
;
[
hud
hide
:
YES
afterDelay
:
3
];
}
#pragma mark -显示信息的提示框
-
(
void
)
ErrorMBProgressView
:
(
NSString
*
)
errorString
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
labelText
=
errorString
;
hud
.
margin
=
10
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
minSize
=
CGSizeMake
(
250
,
70
);
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
3
.
0
f
];
}
#pragma mark -渐隐提示框
-
(
void
)
SHOWPrompttext
:
(
NSString
*
)
Text
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
labelText
=
Text
;
hud
.
margin
=
10
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
minSize
=
CGSizeMake
(
200
,
50
);
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
3
.
0
f
];
}
#pragma mark -结束MJRfresh刷新
-
(
void
)
endRefreshingForTableView
:
(
UIScrollView
*
)
TableView
{
...
...
@@ -281,15 +170,6 @@
}
#pragma mark -提示文本,图片
-
(
void
)
PromptinformationViewWithimage
:
(
UIImage
*
)
image
withTitle
:
(
NSString
*
)
title
withpoint
:
(
CGPoint
)
point
{
self
.
promptView
.
tipsImage
.
image
=
image
;
self
.
promptView
.
tipsTitle
.
text
=
title
;
self
.
promptView
.
frame
=
CGRectMake
(
point
.
x
,
point
.
y
,
250
,
170
);
[
self
.
view
addSubview
:
self
.
promptView
];
}
#pragma mark - 提示框
-
(
void
)
promptCustomerTitle
:
(
NSString
*
)
title
withMessage
:
(
NSString
*
)
message
finish
:
(
void
(
^
)())
complete
{
...
...
@@ -405,7 +285,6 @@
#pragma mark -查询购物车数量
-
(
void
)
QueryShoppingCarNumber
{
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
SERVERREQUESTURL
(
QUERYSHOPPINGBAGNUMBER
),[
Customermanager
manager
].
model
.
fid
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -414,7 +293,7 @@
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
NSLog
(
@"更新购物车数量失败"
);
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Tools/CustomWKWebViewController.m
View file @
6f6d36f1
...
...
@@ -105,18 +105,18 @@
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didStartProvisionalNavigation
:
(
null_unspecified
WKNavigation
*
)
navigation
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
}
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFinishNavigation
:
(
WKNavigation
*
)
navigation
{
[
self
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
}
-
(
void
)
webView
:
(
WKWebView
*
)
webView
didFailNavigation
:
(
WKNavigation
*
)
navigation
withError
:
(
NSError
*
)
error
{
[
self
ErrorMBProgressView
:
@"加载失败"
];
[
XBLoadingView
showHUDViewWithText
:
@"加载失败"
];
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
...
...
Tools/ExperienceCentreViewController.m
View file @
6f6d36f1
...
...
@@ -260,7 +260,7 @@
-
(
IBAction
)
ShareButtonClickAction
:
(
UIButton
*
)
sender
{
if
(
!
self
.
shareGoodsArray
.
count
)
{
[
self
ErrorMBProgressView
:
@"没有选择需要分享的商品"
];
[
XBLoadingView
showHUDViewWithText
:
@"没有选择需要分享的商品"
];
return
;
}
dispatch_async
(
dispatch_get_global_queue
(
DISPATCH_QUEUE_PRIORITY_DEFAULT
,
0
),
^
{
...
...
@@ -287,7 +287,7 @@
-
(
void
)
image
:
(
UIImage
*
)
image
didFinishSavingWithError
:
(
NSError
*
)
error
contextInfo
:
(
void
*
)
contextInfo
{
if
(
error
!=
NULL
)
{
[
self
ErrorMBProgressView
:
@"保存相册失败"
];
[
XBLoadingView
showHUDViewWithText
:
@"保存相册失败"
];
}
}
...
...
@@ -315,7 +315,7 @@
}
else
{
[
self
ErrorMBProgressView
:
@"相机无法使用"
];
[
XBLoadingView
showHUDViewWithText
:
@"相机无法使用"
];
sender
.
selected
=
NO
;
}
}]];
...
...
@@ -328,7 +328,7 @@
}
else
{
[
self
ErrorMBProgressView
:
@"相册无法打开"
];
[
XBLoadingView
showHUDViewWithText
:
@"相册无法打开"
];
sender
.
selected
=
NO
;
}
}]];
...
...
Tools/LoadingView/XBLoadingView.h
View file @
6f6d36f1
...
...
@@ -37,7 +37,7 @@
@return XBLoadingView
*/
+
(
MBProgressHUD
*
)
showHUDViewProgressLabel
:(
NSString
*
)
text
;
+
(
XBLoadingView
*
)
showHUDViewProgressLabel
:(
NSString
*
)
text
;
/**
隐藏加载框
...
...
Tools/LoadingView/XBLoadingView.m
View file @
6f6d36f1
...
...
@@ -30,6 +30,7 @@
*/
+
(
void
)
showHUDViewWithText
:
(
NSString
*
)
text
{
[[
self
class
]
hideHUDViewWithDefault
];
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
labelText
=
text
;
hud
.
margin
=
20
.
f
;
...
...
@@ -64,9 +65,9 @@
@return XBLoadingView
*/
+
(
MBProgressHUD
*
)
showHUDViewProgressLabel
:
(
NSString
*
)
text
+
(
XBLoadingView
*
)
showHUDViewProgressLabel
:
(
NSString
*
)
text
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
XBLoadingView
*
hud
=
[
XBLoadingView
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeDeterminate
;
hud
.
labelText
=
text
;
hud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
...
...
Tools/SceneViewController.m
View file @
6f6d36f1
...
...
@@ -263,7 +263,7 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
...
...
@@ -345,7 +345,7 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
id
error
)
{
...
...
@@ -453,11 +453,11 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -544,13 +544,13 @@
finish
(
sponse
);
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
sceneOrProductClollectionView
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
Tools/ShareGoodsViewController.m
View file @
6f6d36f1
...
...
@@ -30,19 +30,19 @@
WS
(
weakSelf
);
if
(
self
.
isShareOrderbill
)
{
//分享订单
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakSelf
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
NSString
*
shareOrderString
=
[
NSString
stringWithFormat
:
@"%@/%@"
,
SHAREORDERBILL
,
self
.
orderBillNumber
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
shareOrderString
)
WithRequestType
:
ZERO
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
callSharePlatform
:
returnValue
[
@"data"
][
@"url"
]
withPlatformTag
:
sender
withTitle
:
@"欧立方订单一键分享"
];
}
else
{
[
weakSelf
SHOWPromptt
ext
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithT
ext
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
else
//分享商品
{
...
...
@@ -50,11 +50,7 @@
NSData
*
imageData
=
UIImageJPEGRepresentation
(
self
.
shareImage
,
0
.
5
);
NSString
*
goodsID
=
[
self
.
goodsIds
substringToIndex
:[
self
.
goodsIds
length
]
-
1
];
NSDictionary
*
parameterDict
=
[
NSDictionary
dictionaryWithObjectsAndKeys
:[
goodsID
substringToIndex
:
self
.
goodsIds
.
length
-
1
],
@"goodsIds"
,
@""
,
@"title"
,
@""
,
@"remark"
,
nil
];
//上传图片
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
SHARED_APPDELEGATE
.
window
animated
:
YES
];
hud
.
mode
=
MBProgressHUDModeDeterminate
;
hud
.
labelText
=
@"上传中...."
;
hud
.
removeFromSuperViewOnHide
=
YES
;
XBLoadingView
*
progressView
=
[
XBLoadingView
showHUDViewProgressLabel
:
@"上传图片中"
];
[[
NetworkRequestClassManager
Manager
]
UploadImageWithURL
:
SERVERREQUESTURL
(
SHARE
)
WithRequestType
:
ZERO
WithImageDatas
:
imageData
WithParameter
:
parameterDict
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -62,23 +58,17 @@
[
self
callSharePlatform
:
shareWeb
withPlatformTag
:
sender
withTitle
:
ShareTitle
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithprogressBlock
:^
(
double
progress
)
{
if
(
progress
>=
1
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
hud
hide
:
YES
];
});
progressView
.
labelText
=
@"上传成功"
;
[
progressView
hide
:
YES
afterDelay
:
1
];
}
else
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
hud
.
progress
=
progress
;
});
progressView
.
progress
=
progress
;
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
hud
.
labelText
=
@"上传失败"
;
[
hud
hide
:
YES
afterDelay
:
1
];
});
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
}
...
...
@@ -86,7 +76,6 @@
#pragma mark - 调用分享
-
(
void
)
callSharePlatform
:
(
NSString
*
)
shareWeb
withPlatformTag
:
(
UIButton
*
)
sender
withTitle
:
(
NSString
*
)
title
{
WS
(
weakSelf
);
switch
(
sender
.
tag
)
{
case
100
:
//微信好友
{
//自定义样式
...
...
@@ -94,7 +83,7 @@
[
UMSocialData
defaultData
].
extConfig
.
wechatSessionData
.
url
=
shareWeb
;
[[
UMSocialDataService
defaultDataService
]
postSNSWithTypes
:@[
UMShareToWechatSession
]
content
:
title
image
:
self
.
shareImage
location
:
nil
urlResource
:
nil
presentedController
:
self
completion
:^
(
UMSocialResponseEntity
*
response
){
if
(
response
.
responseCode
==
UMSResponseCodeSuccess
)
{
[
weakSelf
SuccessMBProgressView
:
@"分享微信好友成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"分享微信好友成功"
];
}
}];
}
...
...
@@ -105,7 +94,7 @@
[
UMSocialData
defaultData
].
extConfig
.
wechatTimelineData
.
url
=
shareWeb
;
[[
UMSocialDataService
defaultDataService
]
postSNSWithTypes
:@[
UMShareToWechatTimeline
]
content
:
title
image
:
self
.
shareImage
location
:
nil
urlResource
:
nil
presentedController
:
self
completion
:^
(
UMSocialResponseEntity
*
response
){
if
(
response
.
responseCode
==
UMSResponseCodeSuccess
)
{
[
weakSelf
SuccessMBProgressView
:
@"分享微信朋友圈成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"分享微信朋友圈成功"
];
}
}];
}
...
...
@@ -116,7 +105,7 @@
[
UMSocialData
defaultData
].
extConfig
.
sinaData
.
shareText
=
[
NSString
stringWithFormat
:
@"%@%@"
,
@"欧普照明"
,
shareWeb
];
[[
UMSocialDataService
defaultDataService
]
postSNSWithTypes
:@[
UMShareToSina
]
content
:
title
image
:
self
.
shareImage
location
:
nil
urlResource
:
nil
presentedController
:
self
completion
:^
(
UMSocialResponseEntity
*
shareResponse
){
if
(
shareResponse
.
responseCode
==
UMSResponseCodeSuccess
)
{
[
weakSelf
SuccessMBProgressView
:
@"分享新浪微博成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"分享新浪微博成功"
];
}
}];
}
...
...
Tools/ShoppingBagViewController.m
View file @
6f6d36f1
...
...
@@ -210,7 +210,7 @@
}
}
if
(
!
indexpathArray
.
count
)
{
[
self
ErrorMBProgressView
:
@"未选中任何商品"
];
[
XBLoadingView
showHUDViewWithText
:
@"未选中任何商品"
];
}
else
{
for
(
ShopcarModel
*
model
in
delectedModelArray
)
{
...
...
@@ -237,11 +237,11 @@
}
}
if
(
!
array
.
count
)
{
[
self
ErrorMBProgressView
:
@"请先勾选商品"
];
[
XBLoadingView
showHUDViewWithText
:
@"请先勾选商品"
];
return
;
}
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
NSMutableString
*
goodsIds
=
[[
NSMutableString
alloc
]
init
];
NSMutableString
*
goodsCounts
=
[[
NSMutableString
alloc
]
init
];
for
(
ShopcarModel
*
model
in
self
.
datasArray
)
{
...
...
@@ -257,22 +257,21 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
ADDSHOPPINGBAG
)
WithRequestType
:
ZERO
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
weakSelf
.
dismissBlock
)
{
weakSelf
.
dismissBlock
();
}
[
weakSelf
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
weakSelf
QueryShoppingCarNumber
];
[
weakSelf
SuccessMBProgressView
:
@"加入购物车成功"
];
[
XBLoadingView
showHUDViewWithSuccessText
:
@"加入购物车成功"
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
@@ -290,7 +289,7 @@
#pragma mark -修改单个商品数量、价格
-
(
void
)
changeGoodsNumber
:
(
NSInteger
)
goodsNumber
WithcostPrice
:
(
CGFloat
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
returnValue
:
(
void
(
^
)(
id
))
result
{
[
self
CreateMBProgressHUDLoding
];
[
XBLoadingView
showHUDViewWithDefault
];
//保存商品数量
ShopcarModel
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
cellindex
];
model
.
goodsNum
=
goodsNumber
;
...
...
@@ -308,19 +307,18 @@
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@/%@/%@/%@"
,
SERVERREQUESTURL
(
CHANGESHOPPINGBAGNUMBERPRICE
),
carid
,
goodsis
,
costpriceString
,
goodsNumberString
]
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
XBLoadingView
hideHUDViewWithDefault
];
result
(
returnValue
);
//提供是否支持修改的参数
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
CalculateSelectedGoodsAllprice
];
[
weakSelf
QueryShoppingCarNumber
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
[
XBLoadingView
showHUDViewWithText
:
error
.
localizedDescription
];
}];
}
...
...
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