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
71db7491
Commit
71db7491
authored
7 years ago
by
houweibin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.oschina.net/kollway-kollway/newcemarose
parents
648e2a1b
ab7f3920
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
64 additions
and
46 deletions
+64
-46
KWMAPIManager.m
iCemarose/Class/Api/KWMAPIManager.m
+1
-1
AppDelegate+Deeplink.m
iCemarose/Class/AppDelegate+Deeplink.m
+7
-3
KWMProductDetailVC.m
iCemarose/Class/UI/Product/KWMProductDetailVC.m
+2
-2
KWMSelectedGoodsVC.h
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.h
+4
-1
KWMSelectedGoodsVC.m
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
+36
-28
KWMBeforePayVC.m
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
+1
-0
KWMPayUtil.m
iCemarose/Class/Util/KWMPayUtil.m
+4
-10
Header-Prefix.h
iCemarose/Header-Prefix.h
+1
-1
Info.plist
iCemarose/Info.plist
+8
-0
No files found.
iCemarose/Class/Api/KWMAPIManager.m
View file @
71db7491
...
@@ -664,7 +664,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
...
@@ -664,7 +664,7 @@ static NSString *const passwordTest = @"9e84aae218c57cdf0762763c4cf5a651";
-
(
NSURLSessionDataTask
*
)
getExchangeRate
:
(
NSDictionary
*
)
parameters
-
(
NSURLSessionDataTask
*
)
getExchangeRate
:
(
NSDictionary
*
)
parameters
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
))
success
success
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
KWMExchangeRateResult
*
result
))
success
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
failure
:
(
void
(
^
)(
NSURLSessionDataTask
*
task
,
NSError
*
error
))
failure
{
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/app/exchange/rate"
,
Additional
_API_DOMAIN
];
NSString
*
apiPath
=
[
NSString
stringWithFormat
:
@"https://%@/app/exchange/rate"
,
Pay
_API_DOMAIN
];
// NSString *sign = [KWMStringUtil MD5:[KWMStringUtil BASE64:@"currency=EUR&key=bd3f58f5cd3d7a217ac8c8e655ab52f8"]];
// NSString *sign = [KWMStringUtil MD5:[KWMStringUtil BASE64:@"currency=EUR&key=bd3f58f5cd3d7a217ac8c8e655ab52f8"]];
// NSLog(@"rate sign: %@",sign);
// NSLog(@"rate sign: %@",sign);
// NSDictionary *params = @{@"currency":@"EUR",@"sign":sign};
// NSDictionary *params = @{@"currency":@"EUR",@"sign":sign};
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/AppDelegate+Deeplink.m
View file @
71db7491
...
@@ -19,14 +19,18 @@
...
@@ -19,14 +19,18 @@
[
routes
addRoute
:
@"/collections/*"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/collections/*"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
NSArray
*
tags
=
parameters
[
JLRouteWildcardComponentsKey
];
NSArray
*
tags
=
parameters
[
JLRouteWildcardComponentsKey
];
NSLog
(
@"trace tags %@"
,[
tags
componentsJoinedByString
:
@","
]);
NSLog
(
@"trace tags %@"
,[
tags
componentsJoinedByString
:
@","
]);
KWMSelectedGoodsVC
*
selectedGoodsVC
=
(
KWMSelectedGoodsVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMSelectedGoodsVC
kwmTag
]
fromStoryboard
:
@"New"
];
selectedGoodsVC
.
ctags
=
tags
;
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
selectedGoodsVC
animated
:
YES
];
return
YES
;
return
YES
;
}];
}];
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
//
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"];
KWMProductDetailVC
*
productDetailVC
=
(
KWMProductDetailVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMProductDetailVC
kwmTag
]
fromStoryboard
:
@"New"
];
// productDetailVC.product = brandCell.leftProduct;
// productDetailVC.product = brandCell.leftProduct;
// productDetailVC.handle = parameters[@"id"];
productDetailVC
.
handle
=
parameters
[
@"id"
];
// [[AppDelegate mainViewController].selectedViewController.navigationController pushViewController:productDetailVC animated:YES];
NSLog
(
@"%@"
,[
AppDelegate
mainViewController
].
selectedViewController
);
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
productDetailVC
animated
:
YES
];
return
YES
;
return
YES
;
}];
}];
}
}
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/KWMProductDetailVC.m
View file @
71db7491
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
[
self
initRecommendProduct
];
[
self
initRecommendProduct
];
// [self initShopCartCount];
// [self initShopCartCount];
//刷新product,如果是缓存的product,因为没有字典,所以会发生错误,需要重新请求一个有字典的product
//刷新product,如果是缓存的product,因为没有字典,所以会发生错误,需要重新请求一个有字典的product
if
(
!
self
.
handle
||
(
self
.
product
&&
self
.
product
.
identifier
&&
!
self
.
product
.
JSONDictionary
)){
if
(
self
.
handle
||
(
self
.
product
&&
self
.
product
.
identifier
&&
!
self
.
product
.
JSONDictionary
)){
[
self
getProductBy
:
nil
product
:
self
.
product
];
[
self
getProductBy
:
nil
product
:
self
.
product
];
}
}
NSArray
*
types
=
@[
@"baby"
,
@"girls"
,
@"boys"
,
@"shoes"
,
@"newborn"
];
NSArray
*
types
=
@[
@"baby"
,
@"girls"
,
@"boys"
,
@"shoes"
,
@"newborn"
];
...
@@ -449,6 +449,7 @@
...
@@ -449,6 +449,7 @@
[
self
hideLoading
];
[
self
hideLoading
];
if
(
product
!=
nil
&&
error
==
nil
)
{
if
(
product
!=
nil
&&
error
==
nil
)
{
self
.
product
=
product
;
self
.
product
=
product
;
[
self
.
productDetailView
setData
:
product
];
if
(
productId
){
if
(
productId
){
[
self
kwm_clickCollectionCell
:
product
];
[
self
kwm_clickCollectionCell
:
product
];
}
}
...
@@ -464,5 +465,4 @@
...
@@ -464,5 +465,4 @@
}
}
}
}
@end
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.h
View file @
71db7491
...
@@ -32,7 +32,10 @@
...
@@ -32,7 +32,10 @@
@property
(
nonatomic
)
BOOL
isLoading
;
@property
(
nonatomic
)
BOOL
isLoading
;
@property
(
strong
,
nonatomic
)
NSArray
*
ctags
;
/**
* deeplink tags
*/
@property
(
strong
,
nonatomic
)
NSArray
<
NSString
*>*
ctags
;
@property
(
nonatomic
)
KWMProductType
*
productType
;
@property
(
nonatomic
)
KWMProductType
*
productType
;
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
View file @
71db7491
...
@@ -52,6 +52,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -52,6 +52,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
self
.
hasNextPage
=
NO
;
self
.
hasNextPage
=
NO
;
self
.
collectionSort
=
BUYCollectionSortCreatedDescending
;
self
.
collectionSort
=
BUYCollectionSortCreatedDescending
;
if
(
self
.
ctags
)
{
self
.
title
=
self
.
ctags
.
firstObject
.
capitalizedString
;
}
else
if
(
self
.
productType
!=
nil
){
if
(
self
.
productType
!=
nil
){
//初始化双行标题栏
//初始化双行标题栏
NSString
*
mTitle
;
NSString
*
mTitle
;
...
@@ -239,6 +242,38 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -239,6 +242,38 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
}
-
(
void
)
requestProductList
{
-
(
void
)
requestProductList
{
__weak
KWMSelectedGoodsVC
*
weakSelf
=
self
;
NSInteger
tagetPage
=
self
.
currentPage
.
integerValue
+
1
;
void
(
^
completion
)(
NSArray
<
BUYProduct
*>
*
,
NSUInteger
,
BOOL
,
NSError
*
)
=
^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
[
weakSelf
hideLoading
];
if
(
tagetPage
==
1
){
if
(
!
products
||
products
.
count
==
0
){
self
.
vNoData
.
hidden
=
NO
;
[
weakSelf
.
dataList
removeAllObjects
];
[
weakSelf
.
tbvSelectedGoods
reloadData
];
return
;
}
}
weakSelf
.
isLoading
=
NO
;
if
(
error
==
nil
&&
products
)
{
self
.
vNoData
.
hidden
=
YES
;
weakSelf
.
hasNextPage
=
!
reachedEnd
;
[
weakSelf
appendDataList
:
products
setPage
:
page
];
}
else
{
[
self
showError
:
error
];
NSLog
(
@"Error fetching products: %@"
,
error
);
}
};
if
(
self
.
ctags
)
{
[
self
.
client
getCollectionByHandle
:
self
.
ctags
.
lastObject
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collection
.
identifier
withTags
:
self
.
ctags
sortOrder
:
self
.
filterView
.
selectedSort
completion
:
completion
];
}];
// [self.client getProductsPage:tagetPage inCollection:nil withTags:self.ctags sortOrder:self.filterView.selectedSort completion:completion];
return
;
}
NSNumber
*
collectionId
;
NSNumber
*
collectionId
;
if
(
self
.
collection
!=
nil
){
if
(
self
.
collection
!=
nil
){
collectionId
=
self
.
collection
.
identifier
;
collectionId
=
self
.
collection
.
identifier
;
...
@@ -269,36 +304,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -269,36 +304,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
}
self
.
isLoading
=
YES
;
self
.
isLoading
=
YES
;
__weak
KWMSelectedGoodsVC
*
weakSelf
=
self
;
NSInteger
tagetPage
=
self
.
currentPage
.
integerValue
+
1
;
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:
completion
];
[
weakSelf
hideLoading
];
if
(
tagetPage
==
1
){
if
(
tags
.
count
==
1
){
[
weakSelf
.
userDao
saveCollectionCache
:
products
collectionId
:
collectionId
tags
:
tags
];
}
if
(
!
products
||
products
.
count
==
0
){
self
.
vNoData
.
hidden
=
NO
;
[
weakSelf
.
dataList
removeAllObjects
];
[
weakSelf
.
tbvSelectedGoods
reloadData
];
return
;
}
}
weakSelf
.
isLoading
=
NO
;
if
(
error
==
nil
&&
products
)
{
self
.
vNoData
.
hidden
=
YES
;
weakSelf
.
hasNextPage
=
!
reachedEnd
;
[
weakSelf
appendDataList
:
products
setPage
:
page
];
}
else
{
[
self
showError
:
error
];
NSLog
(
@"Error fetching products: %@"
,
error
);
}
}];
}
}
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/ShopCart/KWMBeforePayVC.m
View file @
71db7491
...
@@ -660,6 +660,7 @@
...
@@ -660,6 +660,7 @@
return
;
return
;
}
}
if
(
!
result
.
code
||
result
.
code
.
integerValue
!=
1000
){
if
(
!
result
.
code
||
result
.
code
.
integerValue
!=
1000
){
NSLog
(
@"error: %@"
,
result
.
message
);
return
;
return
;
}
}
NSString
*
alipayData
=
(
NSString
*
)
result
.
message
;
NSString
*
alipayData
=
(
NSString
*
)
result
.
message
;
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/Util/KWMPayUtil.m
View file @
71db7491
...
@@ -38,23 +38,20 @@
...
@@ -38,23 +38,20 @@
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
//先写test,后面改成正式的订单描述
//先写test,后面改成正式的订单描述
NSString
*
subject
=
@"test"
;
#else
#else
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
checkout_token
=
checkout
.
token
;
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
[
NSString
stringWithFormat
:
@"CemaroseOrder-%@"
,
checkout
.
token
];
#endif
#endif
NSString
*
ip_address
=
@"127.0.0.1"
;
NSString
*
ip_address
=
@"127.0.0.1"
;
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&
subject=%@&
total_price=%@&key=%@"
,
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&ip_address=%@&total_price=%@&key=%@"
,
checkout_token
,
ip_address
,
subject
,
total_price
,
User_Pay_KEY
];
checkout_token
,
ip_address
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSDictionary
*
parameters
=
@{
NSDictionary
*
parameters
=
@{
@"ip_address"
:
ip_address
,
@"ip_address"
:
ip_address
,
@"checkout_token"
:
checkout_token
,
@"checkout_token"
:
checkout_token
,
@"subject"
:
subject
,
@"total_price"
:
total_price
,
@"total_price"
:
total_price
,
@"sign"
:
sign
@"sign"
:
sign
};
};
...
@@ -66,21 +63,18 @@
...
@@ -66,21 +63,18 @@
#if DEBUG
#if DEBUG
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
@"test"
;
#else
#else
NSString
*
checkout_token
=
checkout
.
token
;
NSString
*
checkout_token
=
checkout
.
token
;
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
//需要保留小数点后两位(包括小数点后的.00),以保持与后台一致,从而验证通过
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
total_price
=
[
NSString
stringWithFormat
:
@"%.2f"
,
checkout
.
totalPrice
.
floatValue
];
NSString
*
subject
=
[
NSString
stringWithFormat
:
@"CemaroseOrder-%@"
,
checkout
.
token
];
#endif
#endif
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&
subject=%@&
total_price=%@&key=%@"
,
NSString
*
before_sign
=
[
NSString
stringWithFormat
:
@"checkout_token=%@&total_price=%@&key=%@"
,
checkout_token
,
subject
,
total_price
,
User_Pay_KEY
];
checkout_token
,
total_price
,
User_Pay_KEY
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
base64String
=
[
KWMStringUtil
BASE64
:
before_sign
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSString
*
sign
=
[
KWMStringUtil
MD5
:
base64String
];
NSDictionary
*
parameters
=
@{
NSDictionary
*
parameters
=
@{
@"checkout_token"
:
checkout_token
,
@"checkout_token"
:
checkout_token
,
@"subject"
:
subject
,
@"total_price"
:
total_price
,
@"total_price"
:
total_price
,
@"sign"
:
sign
@"sign"
:
sign
};
};
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Header-Prefix.h
View file @
71db7491
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
#define User_Pay_KEY @"bd3f58f5cd3d7a217ac8c8e655ab52f8"
#define User_Pay_KEY @"bd3f58f5cd3d7a217ac8c8e655ab52f8"
#if DEBUG &&
1
#if DEBUG &&
0
//测试
//测试
#define TestModel @"YES"
#define TestModel @"YES"
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Info.plist
View file @
71db7491
...
@@ -46,6 +46,14 @@
...
@@ -46,6 +46,14 @@
<
string
>
cemarose
<
/string
>
<
string
>
cemarose
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
I
<
/string
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
2017070509
<
/string
>
<
string
>
2017070509
<
/string
>
...
...
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