Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
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
cemarose
ios1x
Commits
84515bb6
Commit
84515bb6
authored
7 years ago
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单时discount code设置相关问题。
parent
5c4f2d3e
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+15
-9
No files found.
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
84515bb6
...
...
@@ -423,24 +423,30 @@
[
self
showToast
:
@"未成功创建订单"
];
return
;
}
if
([
KWMStringUtil
isBlank
:
self
.
tfDiscount
.
text
]){
[
self
showToast
:
@"优惠码不能为空"
];
return
;
}
NSString
*
code
=
self
.
tfDiscount
.
text
;
// if([KWMStringUtil isBlank:code]){
// [self showToast:@"优惠码不能为空"];
// return;
// }
BUYDiscount
*
discount
=
[
self
.
client
.
modelManager
discountWithCode
:
code
];
self
.
checkout
.
discount
=
discount
;
[
self
.
tfDiscount
resignFirstResponder
];
[
self
showLoading
];
__weak
typeof
(
self
)
this
=
self
;
[
self
.
client
updateCheckout
:
self
.
checkout
completion
:
^
(
NSDictionary
*
dictionary
,
BUYCheckout
*
checkout
,
NSError
*
error
)
{
[
this
hideLoading
];
if
(
error
==
nil
&&
checkout
&&
checkout
.
discount
)
{
if
(
checkout
)
{
this
.
checkout
=
checkout
;
[
this
showToast
:
@"添加优惠码成功"
];
[
this
flushCheckout
:
dictionary
];
this
.
isEditingDiscount
=
NO
;
[
this
initData
];
}
else
{
[
this
showToast
:
@"添加优惠码失败"
];
[
this
showError
:
error
];
}
if
(
!
error
&&
checkout
&&
!
[
KWMStringUtil
isBlank
:
code
]
&&
checkout
.
discount
)
{
[
this
showToast
:
@"添加优惠码成功"
];
}
else
if
(
!
error
&&
checkout
&&
[
KWMStringUtil
isBlank
:
code
]
&&
!
checkout
.
discount
){
[
this
showToast
:
@"清空优惠码成功"
];
}
else
{
[
this
showToast
:
@"设置优惠码失败"
];
}
}];
}
...
...
This diff is collapsed.
Click to expand it.
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