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
2860048d
Commit
2860048d
authored
Jun 09, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkoutNow bug fixs
parent
fb2ff498
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+7
-2
KWMShopCartVC.m
iCemarose/Class/UI/ShopCart/KWMShopCartVC.m
+8
-3
No files found.
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
2860048d
...
...
@@ -470,7 +470,12 @@
AFHTTPSessionManager
*
manager
=
[
AFHTTPSessionManager
manager
];
if
(
self
.
cartCookie
)
{
[
manager
.
requestSerializer
setHTTPShouldHandleCookies
:
NO
];
NSString
*
cookie
=
[[
KWMHttpUtil
buildRequestCookieString
]
stringByReplacingOccurrencesOfRegex
:
@"cart=.*?;"
withString
:[
NSString
stringWithFormat
:
@"cart=%@;"
,
self
.
cartCookie
]];
NSString
*
cookie
=
[
KWMHttpUtil
buildRequestCookieString
];
if
([
cookie
isMatchedByRegex
:
@"cart=.*?;"
])
{
cookie
=
[
cookie
stringByReplacingOccurrencesOfRegex
:
@"cart=.*?;"
withString
:[
NSString
stringWithFormat
:
@"cart=%@;"
,
self
.
cartCookie
]];
}
else
{
cookie
=
[
NSString
stringWithFormat
:
@"cart=%@; %@"
,
self
.
cartCookie
,
cookie
];
}
[
manager
.
requestSerializer
setValue
:
cookie
forHTTPHeaderField
:
@"Cookie"
];
}
[
manager
setTaskWillPerformHTTPRedirectionBlock
:
^
NSURLRequest
*
_Nonnull
(
NSURLSession
*
_Nonnull
session
,
NSURLSessionTask
*
_Nonnull
task
,
NSURLResponse
*
_Nonnull
response
,
NSURLRequest
*
_Nonnull
request
)
{
...
...
@@ -502,7 +507,7 @@
this
.
checkout
=
checkout
;
[
this
initData
];
[
this
.
userDao
saveCheckoutCache
:
responseObject
[
@"checkout"
]];
if
(
!
this
.
checkout
.
shippingRate
)
{
if
(
this
.
checkout
.
shippingAddress
&&
!
this
.
checkout
.
shippingRate
)
{
[
this
requestShippingData
];
}
}
failure
:^
(
NSURLSessionDataTask
*
_Nullable
task
,
NSError
*
_Nonnull
error
)
{
...
...
iCemarose/Class/UI/ShopCart/KWMShopCartVC.m
View file @
2860048d
...
...
@@ -50,12 +50,17 @@
[
self
setTotalPrice
];
__weak
typeof
(
self
)
this
=
self
;
[[
KWMShoppingCart
sharedInstance
]
allItemsWithCallback
:
^
(
NSError
*
error
,
KWMCartResult
*
cart
)
{
[
this
refresh
];
}];
dispatch_time_t
delay
=
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
1
*
NSEC_PER_SEC
));
dispatch_after
(
delay
,
dispatch_get_main_queue
(),
^
{
[[
KWMShoppingCart
sharedInstance
]
allItemsWithCallback
:
^
(
NSError
*
error
,
KWMCartResult
*
cart
)
{
[
this
refresh
];
}];
});
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
if
(
_shopCartList
.
count
==
0
)
{
...
...
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