Commit a07e140b by lee

Merge branch 'master' of git.oschina.net:kollway-kollway/newcemarose

parents c5965b3d 058a9d44
...@@ -280,6 +280,8 @@ ...@@ -280,6 +280,8 @@
} }
self.product = product; self.product = product;
self.productId = product.identifier; self.productId = product.identifier;
self.colorMeterfield = nil;
self.adminProduct = nil;
[self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES]; [self.scrollView setContentOffset:CGPointMake(0, 0) animated:YES];
[self initView]; [self initView];
[self clearSelect]; [self clearSelect];
...@@ -427,11 +429,17 @@ ...@@ -427,11 +429,17 @@
[weakSelf showError:error]; [weakSelf showError:error];
}else if(product){ }else if(product){
weakSelf.product = product; weakSelf.product = product;
weakSelf.productId = product.identifier;
[weakSelf initMidViewHight]; [weakSelf initMidViewHight];
weakSelf.midDetailView.product = product; weakSelf.midDetailView.product = product;
[weakSelf.detailView1 setData:product]; [weakSelf.detailView1 setData:product];
[self requestBrandProducts:1]; [self requestBrandProducts:1];
[self requestCategoryProducts:1]; [self requestCategoryProducts:1];
if(self.handle){
[self requestAdminProduct];
[self requestColorMetafield];
}
} }
}; };
if (self.handle) { if (self.handle) {
...@@ -500,6 +508,9 @@ ...@@ -500,6 +508,9 @@
#pragma mark -- API KWMApimanager #pragma mark -- API KWMApimanager
-(void)requestAdminProduct{ -(void)requestAdminProduct{
NSNumber *productId = self.product?self.product.identifier:self.productId; NSNumber *productId = self.product?self.product.identifier:self.productId;
if(!productId){
return;
}
__weak KWMNewProductVC *weakSelf = self; __weak KWMNewProductVC *weakSelf = self;
void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){ void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){
}; };
...@@ -515,9 +526,12 @@ ...@@ -515,9 +526,12 @@
-(void)requestColorMetafield{ -(void)requestColorMetafield{
NSNumber *productId = self.product?self.product.identifier:self.productId; NSNumber *productId = self.product?self.product.identifier:self.productId;
if(!productId){
return;
}
__weak KWMNewProductVC *weakSelf = self; __weak KWMNewProductVC *weakSelf = self;
void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){ void(^failure)(NSURLSessionDataTask *,NSError *) = ^(NSURLSessionDataTask *task,NSError *error){
[weakSelf showError:error]; // [weakSelf showError:error];
}; };
void(^success)(NSURLSessionDataTask *,KWMMetafieldResult *) = ^(NSURLSessionDataTask *task,KWMMetafieldResult *result){ void(^success)(NSURLSessionDataTask *,KWMMetafieldResult *) = ^(NSURLSessionDataTask *task,KWMMetafieldResult *result){
if(!result.metafields){ if(!result.metafields){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment