|
@@ -688,11 +688,15 @@
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Create Order" completion:^{
|
|
|
|
|
|
|
+// __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Create Order" completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ PopWaitAlert* pop = [RAUtils waiting_pop:@"Create Order" completion:nil];
|
|
|
[RANetwork request_create_order:^(NSMutableDictionary *result) {
|
|
[RANetwork request_create_order:^(NSMutableDictionary *result) {
|
|
|
NSMutableDictionary* return_json = result;
|
|
NSMutableDictionary* return_json = result;
|
|
|
|
|
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ [pop hide];
|
|
|
|
|
|
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
|
|
@@ -732,9 +736,10 @@
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
|
|
+// [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil] ;
|
|
|
|
|
+ [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -743,58 +748,6 @@
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
- }];
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* return_json = [RANetwork new_Order];
|
|
|
|
|
- //
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- // [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- // int result=[[return_json valueForKey:@"result"] intValue];
|
|
|
|
|
- // if(result==2)
|
|
|
|
|
- // {
|
|
|
|
|
- // //successed.
|
|
|
|
|
- //
|
|
|
|
|
- // NSString* order_code = [return_json valueForKey:@"orderCode"];
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
- // appDelegate.order_code = order_code;
|
|
|
|
|
- // appDelegate.order_status = [[return_json valueForKey:@"orderStatus"] intValue];
|
|
|
|
|
- //
|
|
|
|
|
- // [self addtocart];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // // [self ReloadData];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // // if(self.shopCartBlock!=nil)
|
|
|
|
|
- // // {
|
|
|
|
|
- // // UIImage* img=[self photoStackView:self.photoStack photoForIndex:0];
|
|
|
|
|
- // //
|
|
|
|
|
- // //
|
|
|
|
|
- // // CGRect iv_rect = CGRectMake(self.btnaddCart.center.x-50, self.btnaddCart.center.y-50, 100, 100);
|
|
|
|
|
- // // UIImageView* iv = [[UIImageView alloc] initWithFrame:iv_rect];
|
|
|
|
|
- // // iv.image = img;
|
|
|
|
|
- // // // [self.contentView addSubview:iv];
|
|
|
|
|
- // // self.shopCartBlock(iv);
|
|
|
|
|
- // //
|
|
|
|
|
- // // }
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
}
|
|
}
|
|
|
- (IBAction)onAddPortfolioClick:(id)sender {
|
|
- (IBAction)onAddPortfolioClick:(id)sender {
|
|
|
UIApplication * app = [UIApplication sharedApplication];
|
|
UIApplication * app = [UIApplication sharedApplication];
|
|
@@ -920,13 +873,14 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!count) {
|
|
if (!count) {
|
|
|
- [RAUtils message_alert:@"There is no model." title:@"Cannot Add to cart." controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to cart." message:@"There is no model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(!self.addAll && checked.count==0)
|
|
if(!self.addAll && checked.count==0)
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:@"You must select at least one model." title:@"Cannot Add to cart." controller:self] ;
|
|
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to cart." message:@"You must select at least one model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -934,14 +888,17 @@
|
|
|
self.addCartBtn.enabled = false;
|
|
self.addCartBtn.enabled = false;
|
|
|
|
|
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Cart" completion:^{
|
|
|
|
|
|
|
+// __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Cart" completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ PopWaitAlert* pop = [RAUtils waiting_pop:@"Add Models To Cart" completion:nil];
|
|
|
if (self.addAll)
|
|
if (self.addAll)
|
|
|
{
|
|
{
|
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:appDelegate.order_code addTo:@"cart" completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:appDelegate.order_code addTo:@"cart" completionHandler:^(NSMutableDictionary *result) {
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
NSDictionary* return_json=result;
|
|
NSDictionary* return_json=result;
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ [pop hide];
|
|
|
self.addCartBtn.enabled = true;
|
|
self.addCartBtn.enabled = true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -975,7 +932,8 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:msg message:nil completion:nil];
|
|
|
|
|
|
|
|
[self end_select:4];
|
|
[self end_select:4];
|
|
|
|
|
|
|
@@ -996,13 +954,15 @@
|
|
|
[((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
[((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
#endif
|
|
#endif
|
|
|
[self end_select:4];
|
|
[self end_select:4];
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1018,7 +978,8 @@
|
|
|
[RANetwork request_addto_cart_byname:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addto_cart_byname:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
|
|
|
|
|
|
NSDictionary* return_json=result;
|
|
NSDictionary* return_json=result;
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ [pop hide];
|
|
|
self.addCartBtn.enabled = true;
|
|
self.addCartBtn.enabled = true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -1052,8 +1013,8 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:msg message:nil completion:nil];
|
|
|
[self end_select:2];
|
|
[self end_select:2];
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1073,14 +1034,16 @@
|
|
|
[((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
[((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
#endif
|
|
#endif
|
|
|
[self end_select:2];
|
|
[self end_select:2];
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Cart" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1089,105 +1052,17 @@
|
|
|
|
|
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* return_json = nil;
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
- // return_json = [RANetwork Search_addall:self.offset limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:appDelegate.order_code addTo:@"cart"];
|
|
|
|
|
- // } else {
|
|
|
|
|
- // return_json = [RANetwork add_toCart_byName:ids withScreen:ScreenCodeSearch];
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- //
|
|
|
|
|
- //// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- // [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // self.addCartBtn.enabled = true;
|
|
|
|
|
- //
|
|
|
|
|
- // if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //#ifdef RA_NOTIFICATION
|
|
|
|
|
- // [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
- //#else
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
|
|
- //#endif
|
|
|
|
|
- // NSString * msg = nil;
|
|
|
|
|
- //
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- //
|
|
|
|
|
- // unsigned long checkedCount = [return_json[@"count"] integerValue];
|
|
|
|
|
- //
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to Cart",checkedCount];
|
|
|
|
|
- // } else {
|
|
|
|
|
- //
|
|
|
|
|
- // if(checked.count==1)
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=@"1 item added to Cart";
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to Cart",(unsigned long)checked.count];
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
- //
|
|
|
|
|
- // [self end_select:2];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //// }
|
|
|
|
|
- // }
|
|
|
|
|
- // else if([[return_json valueForKey:@"result"] intValue]==8)
|
|
|
|
|
- // {
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //#ifdef RA_NOTIFICATION
|
|
|
|
|
- // [ActiveViewController Notify:@"CartViewController,OrderListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
- //#else
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
- // // appDelegate.order_code = order_code;
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadCart:true immediately:false];
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadOrder:true immediately:false];
|
|
|
|
|
- //#endif
|
|
|
|
|
- // [self end_select:2];
|
|
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Cart" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
}
|
|
}
|
|
|
-(void) addtoportfolio
|
|
-(void) addtoportfolio
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
- // if (appDelegate.offline_mode) {
|
|
|
|
|
- //
|
|
|
|
|
- // [RAUtils message_alert:@"offline mode does not support this function." title:@"Add to Portfolio" controller:self] ;
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
NSMutableDictionary* items =[[self.category_data objectForKey:@"items"] mutableCopy];
|
|
NSMutableDictionary* items =[[self.category_data objectForKey:@"items"] mutableCopy];
|
|
|
|
|
|
|
|
int count = [[items valueForKey:@"count"] intValue];
|
|
int count = [[items valueForKey:@"count"] intValue];
|
|
@@ -1203,37 +1078,39 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // if(checked.count==0)
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:@"You must select at least one model." title:@"Cannot Add to portfolio." controller:self] ;
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
|
|
if (appDelegate.user && appDelegate.user_type == USER_ROLE_CUSTOMER && appDelegate.customer_type == CustomerTypeStore) {
|
|
|
- [RAUtils message_alert:@"Cannot Add to portfolio." title:@"Warning" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Warning" message:@"Cannot Add to portfolio." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!count) {
|
|
if (!count) {
|
|
|
- [RAUtils message_alert:@"There is no model." title:@"Cannot Add to portfolio." controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to portfolio." message:@"There is no model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(!self.addAll && checked.count==0)
|
|
if(!self.addAll && checked.count==0)
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:@"You must select at least one model." title:@"Cannot Add to portfolio." controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to portfolio." message:@"You must select at least one model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
NSString * ids = [checked componentsJoinedByString:@","];
|
|
NSString * ids = [checked componentsJoinedByString:@","];
|
|
|
self.addPortfolioBtn.enabled =false;
|
|
self.addPortfolioBtn.enabled =false;
|
|
|
|
|
|
|
|
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Portfolio" completion:^{
|
|
|
|
|
|
|
+// __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Portfolio" completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ PopWaitAlert* pop = [RAUtils waiting_pop:@"Add Models To Portfolio" completion:nil];
|
|
|
if (self.addAll) {
|
|
if (self.addAll) {
|
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"portfolio" completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"portfolio" completionHandler:^(NSMutableDictionary *result) {
|
|
|
NSMutableDictionary* return_json = result;
|
|
NSMutableDictionary* return_json = result;
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+ [pop hide];
|
|
|
self.addPortfolioBtn.enabled =true;
|
|
self.addPortfolioBtn.enabled =true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -1270,7 +1147,8 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:msg message:nil completion:nil];
|
|
|
|
|
|
|
|
|
|
|
|
|
[self end_select:END_SELECT_PORTFOLIO];
|
|
[self end_select:END_SELECT_PORTFOLIO];
|
|
@@ -1278,9 +1156,10 @@
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Portfolio" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Portfolio" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1291,7 +1170,9 @@
|
|
|
} else {
|
|
} else {
|
|
|
[RANetwork request_addto_portfolio:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addto_portfolio:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
|
NSMutableDictionary* return_json = result;
|
|
NSMutableDictionary* return_json = result;
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ [pop hide];
|
|
|
self.addPortfolioBtn.enabled =true;
|
|
self.addPortfolioBtn.enabled =true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -1328,17 +1209,18 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:msg message:nil completion:nil];
|
|
|
|
|
|
|
|
[self end_select:END_SELECT_PORTFOLIO];
|
|
[self end_select:END_SELECT_PORTFOLIO];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Portfolio" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Portfolio" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1348,78 +1230,11 @@
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* return_json = nil;
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- //// AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
- // return_json = [RANetwork Search_addall:self.offset limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"portfolio"];
|
|
|
|
|
- // } else {
|
|
|
|
|
- // return_json = [RANetwork add_toPortfolio:ids withScreen:ScreenCodeSearch];
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- //// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- // [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- //
|
|
|
|
|
- // self.addPortfolioBtn.enabled =true;
|
|
|
|
|
- //
|
|
|
|
|
- // if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //#ifdef RA_NOTIFICATION
|
|
|
|
|
- // [ActiveViewController Notify:@"PortfolioViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
- //#else
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadPortfolio :true immediately:false];
|
|
|
|
|
- //#endif
|
|
|
|
|
- //
|
|
|
|
|
- // NSString * msg = nil;
|
|
|
|
|
- //
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- //
|
|
|
|
|
- // unsigned long checkedCount = [return_json[@"count"] integerValue];
|
|
|
|
|
- //
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to Portfolio",checkedCount];
|
|
|
|
|
- // } else {
|
|
|
|
|
- //
|
|
|
|
|
- // if(checked.count==1)
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=@"1 item added to Portfolio";
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to Portfolio",(unsigned long)checked.count];
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // [RAUtils message_alert:nil title:msg controller:self] ;
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // [self end_select:3];
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Portfolio" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
}
|
|
}
|
|
|
-(void) addtowish
|
|
-(void) addtowish
|
|
|
{
|
|
{
|
|
@@ -1438,21 +1253,17 @@
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- // if(checked.count==0)
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:@"You must select at least one model." title:@"Cannot Add To Wish List." controller:self] ;
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (!count) {
|
|
if (!count) {
|
|
|
- [RAUtils message_alert:@"There is no model." title:@"Cannot Add to Wish List." controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to Wish List." message:@"There is no model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(!self.addAll && checked.count==0)
|
|
if(!self.addAll && checked.count==0)
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:@"You must select at least one model." title:@"Cannot Add to Wish List." controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Cannot Add to Wish List." message:@"You must select at least one model." completion:nil];
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1460,13 +1271,17 @@
|
|
|
NSString * ids = [checked componentsJoinedByString:@","];
|
|
NSString * ids = [checked componentsJoinedByString:@","];
|
|
|
self.addWishBtn.enabled =false;
|
|
self.addWishBtn.enabled =false;
|
|
|
|
|
|
|
|
- __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Wish List" completion:^{
|
|
|
|
|
|
|
+// __block UIAlertController * waitalert = [RAUtils waiting_alert:self title:@"Add Models To Wish List" completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ PopWaitAlert* pop = [RAUtils waiting_pop:@"Add Models To Wish List" completion:nil];
|
|
|
if (self.addAll) {
|
|
if (self.addAll) {
|
|
|
|
|
|
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"wishlist" completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addall_search:self.offset limit:PAGE_ITEM keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"wishlist" completionHandler:^(NSMutableDictionary *result) {
|
|
|
NSDictionary* return_json =result;
|
|
NSDictionary* return_json =result;
|
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ [pop hide];
|
|
|
self.addWishBtn.enabled =true;
|
|
self.addWishBtn.enabled =true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -1502,17 +1317,18 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+ [RAUtils message_box:@" Multiple items added to \nWish List" message:nil completion:nil];
|
|
|
[self end_select:3];
|
|
[self end_select:3];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Wish List" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Wish List" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1525,7 +1341,9 @@
|
|
|
[RANetwork request_addto_wishlist:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
[RANetwork request_addto_wishlist:ids withScreen:ScreenCodeSearch completionHandler:^(NSMutableDictionary *result) {
|
|
|
NSDictionary* return_json =result;
|
|
NSDictionary* return_json =result;
|
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
- [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
|
|
+// [waitalert dismissViewControllerAnimated:YES completion:^{
|
|
|
|
|
+
|
|
|
|
|
+ [pop hide];
|
|
|
self.addWishBtn.enabled =true;
|
|
self.addWishBtn.enabled =true;
|
|
|
|
|
|
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
if([[return_json valueForKey:@"result"] intValue]==2)
|
|
@@ -1561,17 +1379,16 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ [RAUtils message_box:@" Multiple items added to \nWish List" message:nil completion:nil];
|
|
|
[self end_select:1];
|
|
[self end_select:1];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Wish List" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Add To Wish List" message:[return_json valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1581,77 +1398,10 @@
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
- }];
|
|
|
|
|
|
|
+// }];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* return_json = nil;
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- //// AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
|
|
|
|
- // return_json = [RANetwork Search_addall:self.offset limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull orderCode:nil addTo:@"wishlist"];
|
|
|
|
|
- // } else {
|
|
|
|
|
- // return_json = [RANetwork add_toWatchList:ids withScreen:ScreenCodeSearch];
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- //
|
|
|
|
|
- //// [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- // [waitalert dismissViewControllerAnimated:YES completion:nil];
|
|
|
|
|
- //
|
|
|
|
|
- // self.addWishBtn.enabled =true;
|
|
|
|
|
- //
|
|
|
|
|
- // if([[return_json valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //#ifdef RA_NOTIFICATION
|
|
|
|
|
- // [ActiveViewController Notify:@"WatchListViewController" Message:RA_NOTIFICATION_RELOAD_DATA];
|
|
|
|
|
- //#else
|
|
|
|
|
- // AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
|
|
|
|
|
- //
|
|
|
|
|
- // [((MainViewController*)appDelegate.main_vc) reloadWish:true immediately:false];
|
|
|
|
|
- //#endif
|
|
|
|
|
- //
|
|
|
|
|
- // NSString * msg = nil;
|
|
|
|
|
- //
|
|
|
|
|
- // if (self.addAll) {
|
|
|
|
|
- //
|
|
|
|
|
- // unsigned long checkedCount = [return_json[@"count"] integerValue];
|
|
|
|
|
- //
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to \nWish List",checkedCount];
|
|
|
|
|
- // } else {
|
|
|
|
|
- //
|
|
|
|
|
- // if(checked.count==1)
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=@"1 item added to \nWish List";
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // msg=[NSString stringWithFormat:@"%lu items added to \nWish List",(unsigned long)checked.count];
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // [RAUtils message_alert:nil title:@" Multiple items added to \nWish List" controller:self] ;
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // [self end_select:1];
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[return_json valueForKey:@"err_msg"] title:@"Add To Wish List" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-(void) operation_loadMore
|
|
-(void) operation_loadMore
|
|
@@ -1666,7 +1416,9 @@
|
|
|
if(self.showalert)
|
|
if(self.showalert)
|
|
|
{
|
|
{
|
|
|
self.showalert=false;
|
|
self.showalert=false;
|
|
|
- [RAUtils message_alert:@"All loaded" title:@"Loading items" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Loading items" message:@"All loaded" completion:nil];
|
|
|
}
|
|
}
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -1722,7 +1474,7 @@
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[category_more valueForKey:@"err_msg"] title:@"Search" controller:self] ;
|
|
|
|
|
|
|
+ [RAUtils message_box:@"Search" message:[category_more valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
self.isrefreshing=false;
|
|
self.isrefreshing=false;
|
|
|
|
|
|
|
@@ -1731,99 +1483,7 @@
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* category_more=[RANetwork Search:self.offset limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull];
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- // [self.mum stopAnimating];
|
|
|
|
|
- // self.isrefreshing=false;
|
|
|
|
|
- // if (self.dataOperationQueue.operationCount > 1) {
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* more_items=[category_more objectForKey:@"items"];
|
|
|
|
|
- // if([[category_more valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- // // self.category_data = category_data;
|
|
|
|
|
- // NSMutableDictionary* items_json= [[self.category_data objectForKey:@"items"] mutableCopy];
|
|
|
|
|
- //
|
|
|
|
|
- // int count =[[more_items valueForKey:@"count"] intValue];
|
|
|
|
|
- // for(int i=0;i<count;i++)
|
|
|
|
|
- // {
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary * item_json = [more_items objectForKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
|
|
- // [items_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",i+self.offset]];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // long newcount=[[[self.category_data objectForKey:@"items"] valueForKey:@"count"] intValue]+count;
|
|
|
|
|
- // [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
|
|
|
|
|
- // [self.category_data setObject:items_json forKey:@"items"];
|
|
|
|
|
- // self.offset+=count;
|
|
|
|
|
- // if(count<20)
|
|
|
|
|
- // {
|
|
|
|
|
- // self.loadall=true;
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // // NSDictionary * item_json = [self.category_data objectForKey:@"items"];
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- //
|
|
|
|
|
- // // DebugLog(@"%@",self.category_data);
|
|
|
|
|
- //
|
|
|
|
|
- // [self.collectionview reloadData];
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[category_more valueForKey:@"err_msg"] title:@"Search" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- // self.isrefreshing=false;
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- //// dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- //// // self.category_data = category_data;
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- //// if([[category_more valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- //// {
|
|
|
|
|
- //// NSMutableDictionary* items_json= [[self.category_data objectForKey:@"items"] mutableCopy];
|
|
|
|
|
- ////
|
|
|
|
|
- //// int count =[[category_more valueForKey:@"count"] intValue];
|
|
|
|
|
- //// for(int i=0;i<count;i++)
|
|
|
|
|
- //// {
|
|
|
|
|
- ////
|
|
|
|
|
- //// NSDictionary * item_json = [category_more objectForKey:[NSString stringWithFormat:@"item_%d",i]];
|
|
|
|
|
- //// [items_json setObject:item_json forKey:[NSString stringWithFormat:@"item_%ld",i+self.offset]];
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- //// }
|
|
|
|
|
- //// long newcount=[[[self.category_data objectForKey:@"items"] valueForKey:@"count"] intValue]+count;
|
|
|
|
|
- //// [items_json setValue: [NSString stringWithFormat:@"%ld",newcount] forKey:@"count"];
|
|
|
|
|
- //// [self.category_data setObject:items_json forKey:@"items"];
|
|
|
|
|
- //// self.offset+=count;
|
|
|
|
|
- //// // NSDictionary * item_json = [self.category_data objectForKey:@"items"];
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- //// DebugLog(@"%@",self.category_data);
|
|
|
|
|
- ////
|
|
|
|
|
- //// [self.collectionview reloadData];
|
|
|
|
|
- //// }
|
|
|
|
|
- //// else
|
|
|
|
|
- //// {
|
|
|
|
|
- //// [RAUtils error_alert:[category_more valueForKey:@"err_msg"]] ;
|
|
|
|
|
- //// }
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- ////
|
|
|
|
|
- //// });
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1907,7 +1567,9 @@
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- [RAUtils message_alert:[category_data valueForKey:@"err_msg"] title:@"Search" controller:self] ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ [RAUtils message_box:@"Search" message:[category_data valueForKey:@"err_msg"] completion:nil];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
self.isrefreshing=false;
|
|
self.isrefreshing=false;
|
|
@@ -1917,57 +1579,7 @@
|
|
|
|
|
|
|
|
return;
|
|
return;
|
|
|
|
|
|
|
|
- // dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // NSDictionary* category_data=[RANetwork Search:0 limit:20 keywords:self.keywords matchfull:self.loadmore_matchfull];
|
|
|
|
|
- //
|
|
|
|
|
- // dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
- //
|
|
|
|
|
- // [self.mum stopAnimating];
|
|
|
|
|
- // self.isrefreshing=false;
|
|
|
|
|
- // if (self.dataOperationQueue.operationCount > 1) {
|
|
|
|
|
- // return;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // self.category_data = [category_data mutableCopy];
|
|
|
|
|
- // [self.collectionview reloadData];
|
|
|
|
|
- //
|
|
|
|
|
- // if([[category_data valueForKey:@"result"] intValue]==2)
|
|
|
|
|
- // {
|
|
|
|
|
- // self.collectionview.hidden=false;
|
|
|
|
|
- // NSDictionary * item_json = [self.category_data objectForKey:@"items"];
|
|
|
|
|
- // self.offset =[[item_json valueForKey:@"count"] intValue];
|
|
|
|
|
- //
|
|
|
|
|
- // int total = [[self.category_data valueForKey:@"item_total_count"]intValue];
|
|
|
|
|
- //
|
|
|
|
|
- // if(total<2)
|
|
|
|
|
- // {
|
|
|
|
|
- // self.labelTotal.text = [NSString stringWithFormat:@"Total %d item",total];
|
|
|
|
|
- // if(total==1)
|
|
|
|
|
- // {
|
|
|
|
|
- // NSDictionary * detail_item = [item_json objectForKey:@"item_0"];
|
|
|
|
|
- // NSString* detail_id= [detail_item valueForKey:@"product_id"] ;
|
|
|
|
|
- //
|
|
|
|
|
- // [self showDetailat:detail_id category_id:nil name:[detail_item objectForKey:@"fash_name"] index:0];
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // self.labelTotal.text = [NSString stringWithFormat:@"Total %d items",total];
|
|
|
|
|
- // }
|
|
|
|
|
- // else if([[category_data valueForKey:@"result"] intValue]==RESULT_NET_ERROR)
|
|
|
|
|
- // {
|
|
|
|
|
- // self.collectionview.hidden=true;
|
|
|
|
|
- // self.label_net_err.hidden=false;
|
|
|
|
|
- // }
|
|
|
|
|
- // else
|
|
|
|
|
- // {
|
|
|
|
|
- // [RAUtils message_alert:[category_data valueForKey:@"err_msg"] title:@"Search" controller:self] ;
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
- // self.isrefreshing=false;
|
|
|
|
|
- //
|
|
|
|
|
- // });
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1985,30 +1597,7 @@
|
|
|
[self.dataOperationQueue addOperation:operation];
|
|
[self.dataOperationQueue addOperation:operation];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-//-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
|
|
|
|
|
-//{
|
|
|
|
|
-// [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
|
|
|
|
|
-// UIInterfaceOrientation orientation = [[UIApplication sharedApplication]statusBarOrientation];
|
|
|
|
|
-// if (UIInterfaceOrientationIsLandscape(orientation)|| UIInterfaceOrientationIsPortrait(orientation))
|
|
|
|
|
-// {
|
|
|
|
|
-// // self.orientation = orientation;
|
|
|
|
|
-// [self.collectionview.collectionViewLayout invalidateLayout];
|
|
|
|
|
-// DebugLog(@"routed");
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-//}
|
|
|
|
|
|
|
|
|
|
-//- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
|
|
|
|
|
-//
|
|
|
|
|
-// [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
|
|
|
|
|
-//
|
|
|
|
|
-// self.toOrientation = toInterfaceOrientation;
|
|
|
|
|
-// [self.collectionview.collectionViewLayout invalidateLayout];
|
|
|
|
|
-//
|
|
|
|
|
-//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
|
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator {
|
|
@@ -2033,15 +1622,7 @@
|
|
|
*/
|
|
*/
|
|
|
- (IBAction)onMatchFullChanged:(id)sender {
|
|
- (IBAction)onMatchFullChanged:(id)sender {
|
|
|
|
|
|
|
|
- // NSDictionary * item_json = [self.category_data objectForKey:@"items"];
|
|
|
|
|
- // int count =[[item_json valueForKey:@"count"] intValue];
|
|
|
|
|
-
|
|
|
|
|
- // if(count!=0)
|
|
|
|
|
- // {
|
|
|
|
|
- // self.offset = 0;
|
|
|
|
|
- // [self reload];
|
|
|
|
|
- // }
|
|
|
|
|
- //
|
|
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - searchBar delegate;
|
|
#pragma mark - searchBar delegate;
|
|
@@ -2703,114 +2284,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-//#pragma mark - UIAlertViewDelegate
|
|
|
|
|
-//// Called when a button is clicked. The view will be automatically dismissed after this call returns
|
|
|
|
|
-//- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
|
|
|
|
-//{
|
|
|
|
|
-// UIApplication * app = [UIApplication sharedApplication];
|
|
|
|
|
-// AppDelegate *appDelegate = (AppDelegate *)[app delegate];
|
|
|
|
|
-// // if(alertView.tag==1234)
|
|
|
|
|
-// // {
|
|
|
|
|
-// //
|
|
|
|
|
-// // // availability warring;
|
|
|
|
|
-// //
|
|
|
|
|
-// //
|
|
|
|
|
-// // if(buttonIndex!=alertView.cancelButtonIndex)
|
|
|
|
|
-// // {
|
|
|
|
|
-// // if(appDelegate.order_code==nil)
|
|
|
|
|
-// // {
|
|
|
|
|
-// // [self neworder];
|
|
|
|
|
-// // }
|
|
|
|
|
-// // else
|
|
|
|
|
-// // {
|
|
|
|
|
-// // [self addtocart];
|
|
|
|
|
-// // }
|
|
|
|
|
-// // }
|
|
|
|
|
-// // return;
|
|
|
|
|
-// // }
|
|
|
|
|
-// // int count=[self.quantity_text.text intValue];
|
|
|
|
|
-//
|
|
|
|
|
-// // MainViewController* main_vc=(MainViewController*)appDelegate.main_vc;
|
|
|
|
|
-// if(buttonIndex==alertView.cancelButtonIndex)
|
|
|
|
|
-// {
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-// else if(buttonIndex==1)
|
|
|
|
|
-// {
|
|
|
|
|
-// //open exist
|
|
|
|
|
-// self.disable_refresh = true;
|
|
|
|
|
-// OrderListViewController* ovc =[ [UIStoryboard storyboardWithName:@"ERP_Mobile_Order" bundle:nil] instantiateViewControllerWithIdentifier:@"OrderListViewController"];
|
|
|
|
|
-// ovc.showNavibar = true;
|
|
|
|
|
-// ovc.selectOrder = ^(NSMutableDictionary* order_detail){
|
|
|
|
|
-// if(appDelegate.order_code==nil)
|
|
|
|
|
-// {
|
|
|
|
|
-// [self neworder];
|
|
|
|
|
-// }
|
|
|
|
|
-// else
|
|
|
|
|
-// {
|
|
|
|
|
-// [self addtocart];
|
|
|
|
|
-// // [main_vc checklogin:true];
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// };
|
|
|
|
|
-// ovc.init_style = OL_OPEN;
|
|
|
|
|
-// ovc.onCancel = ^(){
|
|
|
|
|
-// self.disable_refresh = false;
|
|
|
|
|
-// // [main_vc checklogin:true];
|
|
|
|
|
-//
|
|
|
|
|
-// };
|
|
|
|
|
-//
|
|
|
|
|
-// [self.navigationController pushViewController:ovc animated:true];
|
|
|
|
|
-// }
|
|
|
|
|
-// else
|
|
|
|
|
-// {
|
|
|
|
|
-// //create new;
|
|
|
|
|
-// self.disable_refresh = true;
|
|
|
|
|
-// if(appDelegate.customerInfo==nil)// select contact if current contact not exist
|
|
|
|
|
-// {
|
|
|
|
|
-// ContactListViewController* cvc = [[UIStoryboard storyboardWithName:@"ERP_Mobile_Contact" bundle:nil] instantiateViewControllerWithIdentifier:@"ContactListViewController" ];
|
|
|
|
|
-// cvc.showNavibar = true;
|
|
|
|
|
-// cvc.contact_type = @"Sales_Order_Customer";
|
|
|
|
|
-// cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
|
|
|
|
|
-//
|
|
|
|
|
-// appDelegate.contact_id=[value valueForKey:@"customer_cid"];
|
|
|
|
|
-// appDelegate.customerInfo = value;
|
|
|
|
|
-//
|
|
|
|
|
-//
|
|
|
|
|
-// if(appDelegate.order_code==nil)
|
|
|
|
|
-// [self neworder];
|
|
|
|
|
-//
|
|
|
|
|
-// // [main_vc checklogin:true];
|
|
|
|
|
-// // [self handle_action_return:value indexPath:indexPath action:ACTION_FILL_SECTION];
|
|
|
|
|
-//
|
|
|
|
|
-// //
|
|
|
|
|
-// // if(self.returnValue)
|
|
|
|
|
-// // self.returnValue(value);
|
|
|
|
|
-// };
|
|
|
|
|
-//
|
|
|
|
|
-// cvc.onCancel = ^(){
|
|
|
|
|
-//
|
|
|
|
|
-// [RAUtils message_alert:@"Can ot create order without cursomer infomation." title:@"" controller:self];
|
|
|
|
|
-//
|
|
|
|
|
-// self.disable_refresh = false;
|
|
|
|
|
-//
|
|
|
|
|
-// };
|
|
|
|
|
-// cvc.onReset = ^(){
|
|
|
|
|
-// // [main_vc checklogin:true];
|
|
|
|
|
-// };
|
|
|
|
|
-//
|
|
|
|
|
-// [self.navigationController pushViewController:cvc animated:true];
|
|
|
|
|
-// }
|
|
|
|
|
-// else
|
|
|
|
|
-// {
|
|
|
|
|
-// [self neworder];
|
|
|
|
|
-// }
|
|
|
|
|
-//
|
|
|
|
|
-// }
|
|
|
|
|
-//}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Support scanner
|
|
#pragma mark - Support scanner
|
|
|
-(void) onDecodedData:(NSString*) value
|
|
-(void) onDecodedData:(NSString*) value
|