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
21d4ff21
Commit
21d4ff21
authored
Dec 19, 2017
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索moncler商品后,商品详情页显示获取商品数据失败的问题。
parent
53469421
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
0 deletions
+51
-0
KWMProductResult.h
iCemarose/Class/Api/Cemarose/KWMProductResult.h
+2
-0
KWMProductResult.m
iCemarose/Class/Api/Cemarose/KWMProductResult.m
+1
-0
KWMNewProductVC.h
iCemarose/Class/UI/NewProduct/KWMNewProductVC.h
+3
-0
KWMNewProductVC.m
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
+43
-0
KWMSearchFeedbackVC.m
iCemarose/Class/UI/Product/KWMSearchFeedbackVC.m
+2
-0
No files found.
iCemarose/Class/Api/Cemarose/KWMProductResult.h
View file @
21d4ff21
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
@property
(
nonatomic
)
id
<
Optional
>
product
;
@property
(
nonatomic
)
id
<
Optional
>
product
;
@property
(
nonatomic
)
NSDictionary
<
Ignore
>
*
productDict
;
@property
(
nonatomic
)
NSArray
<
Optional
>
*
products
;
@property
(
nonatomic
)
NSArray
<
Optional
>
*
products
;
@end
@end
iCemarose/Class/Api/Cemarose/KWMProductResult.m
View file @
21d4ff21
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
if
(
self
)
{
if
(
self
)
{
NSDictionary
*
dataDictionary
=
dict
[
@"product"
];
NSDictionary
*
dataDictionary
=
dict
[
@"product"
];
if
(
dataDictionary
){
if
(
dataDictionary
){
self
.
productDict
=
dataDictionary
;
self
.
product
=
[
self
buildData
:
modelClass
jsonDictionary
:
dataDictionary
];
self
.
product
=
[
self
buildData
:
modelClass
jsonDictionary
:
dataDictionary
];
}
}
...
...
iCemarose/Class/UI/NewProduct/KWMNewProductVC.h
View file @
21d4ff21
...
@@ -22,4 +22,7 @@
...
@@ -22,4 +22,7 @@
@property
(
nonatomic
)
NSNumber
*
productId
;
@property
(
nonatomic
)
NSNumber
*
productId
;
//当传入的vendor为moncler时,会进行处理
@property
(
nonatomic
)
NSString
*
vendor
;
@end
@end
iCemarose/Class/UI/NewProduct/KWMNewProductVC.m
View file @
21d4ff21
...
@@ -115,8 +115,14 @@
...
@@ -115,8 +115,14 @@
[
self
requestBrandProducts
:
1
];
[
self
requestBrandProducts
:
1
];
[
self
requestCategoryProducts
:
1
];
[
self
requestCategoryProducts
:
1
];
}
else
{
}
else
{
NSString
*
productVendor
=
self
.
vendor
?
[
self
.
vendor
lowercaseString
]
:
@""
;
BOOL
isMoncler
=
[
productVendor
isEqualToString
:
@"moncler"
];
if
(
isMoncler
&&
self
.
productId
){
[
self
requestAdminProductDetail
];
}
else
{
[
self
requestProductDetail
];
[
self
requestProductDetail
];
}
}
}
[
self
requestColorMetafield
];
[
self
requestColorMetafield
];
[
self
requestAdminProduct
];
[
self
requestAdminProduct
];
// [self initShopCartCount];
// [self initShopCartCount];
...
@@ -536,6 +542,43 @@
...
@@ -536,6 +542,43 @@
}
}
}
}
-
(
void
)
requestAdminProductDetail
{
NSNumber
*
productId
=
self
.
product
?
self
.
product
.
identifier
:
self
.
productId
;
if
(
!
productId
){
return
;
}
[
self
showLoading
];
__weak
KWMNewProductVC
*
weakSelf
=
self
;
void
(
^
failure
)(
NSURLSessionDataTask
*
,
NSError
*
)
=
^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
){
[
weakSelf
hideLoading
];
[
weakSelf
showError
:
error
];
};
void
(
^
success
)(
NSURLSessionDataTask
*
,
KWMProductResult
*
)
=
^
(
NSURLSessionDataTask
*
task
,
KWMProductResult
*
result
){
[
weakSelf
hideLoading
];
BUYProduct
*
product
=
nil
;
if
(
result
&&
result
.
productDict
){
@try
{
BUYModelManager
*
modelManager
=
[[
BUYModelManager
alloc
]
init
];
product
=
(
BUYProduct
*
)[
modelManager
buy_objectWithEntityName
:[
BUYProduct
entityName
]
JSONDictionary
:
result
.
productDict
];
}
@catch
(
NSException
*
exception
){
NSLog
(
@"exception Name: %@"
,
exception
.
name
);
NSLog
(
@"exception Reason: %@"
,
exception
.
reason
);
}
}
if
(
product
){
weakSelf
.
product
=
product
;
weakSelf
.
productId
=
product
.
identifier
;
[
weakSelf
initBottomViewHidden
];
weakSelf
.
midDetailView
.
product
=
product
;
[
weakSelf
.
detailView1
setData
:
product
];
[
weakSelf
requestBrandProducts
:
1
];
[
weakSelf
requestCategoryProducts
:
1
];
}
};
[
self
.
api
getAdminProduct
:
nil
productId
:
productId
success
:
success
failure
:
failure
];
}
-
(
void
)
requestProductByColor
:
(
KWMColor
*
)
color
{
-
(
void
)
requestProductByColor
:
(
KWMColor
*
)
color
{
__weak
KWMNewProductVC
*
weakSelf
=
self
;
__weak
KWMNewProductVC
*
weakSelf
=
self
;
...
...
iCemarose/Class/UI/Product/KWMSearchFeedbackVC.m
View file @
21d4ff21
...
@@ -94,6 +94,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -94,6 +94,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
-
(
void
)
kwm_onClickLeftIamge
:
(
KWMBrandCaramelCell
*
)
brandCell
{
-
(
void
)
kwm_onClickLeftIamge
:
(
KWMBrandCaramelCell
*
)
brandCell
{
KWMNewProductVC
*
productDetailVC
=
[
KWMNewProductVC
getNewInstance
];
KWMNewProductVC
*
productDetailVC
=
[
KWMNewProductVC
getNewInstance
];
productDetailVC
.
productId
=
brandCell
.
leftDataProduct
.
id
;
productDetailVC
.
productId
=
brandCell
.
leftDataProduct
.
id
;
productDetailVC
.
vendor
=
brandCell
.
leftDataProduct
.
vendor
;
[
self
.
navigationController
pushViewController
:
productDetailVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
productDetailVC
animated
:
YES
];
}
}
...
@@ -101,6 +102,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -101,6 +102,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
-
(
void
)
kwm_onClickRightIamge
:
(
KWMBrandCaramelCell
*
)
brandCell
{
-
(
void
)
kwm_onClickRightIamge
:
(
KWMBrandCaramelCell
*
)
brandCell
{
KWMNewProductVC
*
productDetailVC
=
[
KWMNewProductVC
getNewInstance
];
KWMNewProductVC
*
productDetailVC
=
[
KWMNewProductVC
getNewInstance
];
productDetailVC
.
productId
=
brandCell
.
rightDataProduct
.
id
;
productDetailVC
.
productId
=
brandCell
.
rightDataProduct
.
id
;
productDetailVC
.
vendor
=
brandCell
.
rightDataProduct
.
vendor
;
[
self
.
navigationController
pushViewController
:
productDetailVC
animated
:
YES
];
[
self
.
navigationController
pushViewController
:
productDetailVC
animated
:
YES
];
}
}
...
...
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