|
@@ -391,8 +391,8 @@
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- subject=[NSString stringWithFormat:@"%@ -- SO# %@ from HOMELEGANCE LA, INC.",company,so];
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
|
|
+ subject=[NSString stringWithFormat:@"%@ -- SO# %@ from %@",company,so,COMPANY_NAME];
|
|
|
|
|
|
|
|
if (appDelegate.user_type == USER_ROLE_CUSTOMER&&self.is_shoporder) {
|
|
if (appDelegate.user_type == USER_ROLE_CUSTOMER&&self.is_shoporder) {
|
|
|
NSString *companyName = [appDelegate.customerInfo objectForKey:@"customer_name"];
|
|
NSString *companyName = [appDelegate.customerInfo objectForKey:@"customer_name"];
|
|
@@ -400,14 +400,6 @@
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
- subject=[NSString stringWithFormat:@"%@ -- SO# %@ from HOMELEGANCE LA, INC.",company,so];
|
|
|
|
|
-
|
|
|
|
|
- if (appDelegate.user_type == USER_ROLE_CUSTOMER&&self.is_shoporder) {
|
|
|
|
|
- NSString *companyName = [appDelegate.customerInfo objectForKey:@"customer_name"];
|
|
|
|
|
- subject=[NSString stringWithFormat:@"%@ -- SO# %@ from %@",company,so,companyName];
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
#ifdef BUILD_HMLG
|
|
#ifdef BUILD_HMLG
|
|
|
|
|
|
|
@@ -690,7 +682,7 @@
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
int count = [[self.content_data objectForKey:@"count"] intValue];
|
|
int count = [[self.content_data objectForKey:@"count"] intValue];
|
|
|
for (int i = 0; i < count; i++) {
|
|
for (int i = 0; i < count; i++) {
|
|
|
NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
@@ -704,19 +696,6 @@
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
- int count = [[self.content_data objectForKey:@"count"] intValue];
|
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
|
- NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
|
|
|
- NSMutableDictionary *section = [[self.content_data objectForKey:key] mutableCopy];
|
|
|
|
|
- NSString *type = [section objectForKey:@"type"];
|
|
|
|
|
- if ([type isEqualToString:@"sign_url"]) {
|
|
|
|
|
- [section setObject:img_url_down forKey:@"data"];
|
|
|
|
|
- [self.content_data setObject:section forKey:key];
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
#ifdef BUILD_HMLG
|
|
#ifdef BUILD_HMLG
|
|
|
|
|
|
|
@@ -791,20 +770,7 @@
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- int count = [[weakSelf.content_data objectForKey:@"count"] intValue];
|
|
|
|
|
- for (int i = 0; i < count; i++) {
|
|
|
|
|
- NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
|
|
|
- NSMutableDictionary *section = [[weakSelf.content_data objectForKey:key] mutableCopy];
|
|
|
|
|
- NSString *type = [section objectForKey:@"type"];
|
|
|
|
|
- if ([type isEqualToString:@"sign_url"]) {
|
|
|
|
|
- [section setObject:img_url_down forKey:@"data"];
|
|
|
|
|
- [weakSelf.content_data setObject:section forKey:key];
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-#endif
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
int count = [[weakSelf.content_data objectForKey:@"count"] intValue];
|
|
int count = [[weakSelf.content_data objectForKey:@"count"] intValue];
|
|
|
for (int i = 0; i < count; i++) {
|
|
for (int i = 0; i < count; i++) {
|
|
|
NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
NSString *key = [NSString stringWithFormat:@"section_%d",i];
|
|
@@ -1409,52 +1375,7 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",indexPath.section]];
|
|
|
|
|
- NSDictionary *data = [section_item objectForKey:@"data"];
|
|
|
|
|
- NSString *type = [section_item objectForKey:@"type"];
|
|
|
|
|
- if ([type isEqualToString:@"order_info"]) {
|
|
|
|
|
-
|
|
|
|
|
- float height= self.web_info_height;
|
|
|
|
|
- if(height==0)
|
|
|
|
|
- height=DEF_TABLE_HEIGHT;
|
|
|
|
|
-
|
|
|
|
|
- return height;
|
|
|
|
|
-
|
|
|
|
|
- } else if ([type isEqualToString:@"sign_url"]) {
|
|
|
|
|
- return 148;
|
|
|
|
|
- } else if ([type isEqualToString:@"more_order_info"]) {
|
|
|
|
|
-
|
|
|
|
|
- float height= self.web_moreinfo_height;
|
|
|
|
|
- if(height==0)
|
|
|
|
|
- height=DEF_TABLE_HEIGHT;
|
|
|
|
|
-
|
|
|
|
|
- return height;
|
|
|
|
|
-
|
|
|
|
|
- } else if ([type isEqualToString:@"sub_order"]) {
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary *item = [data objectForKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
|
|
|
|
|
- NSString *item_type = [item objectForKey:@"type"];
|
|
|
|
|
- if ([item_type isEqualToString:@"pick_info"]) {
|
|
|
|
|
- return 218;
|
|
|
|
|
- } else {
|
|
|
|
|
- NSString* notes =[item valueForKey:@"note"];
|
|
|
|
|
- if(notes.length>0)
|
|
|
|
|
- {
|
|
|
|
|
- return 190;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- return 162;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else if ([type isEqualToString:@"price_info"]) {
|
|
|
|
|
- return 44;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",indexPath.section]];
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",indexPath.section]];
|
|
|
NSDictionary *data = [section_item objectForKey:@"data"];
|
|
NSDictionary *data = [section_item objectForKey:@"data"];
|
|
|
NSString *type = [section_item objectForKey:@"type"];
|
|
NSString *type = [section_item objectForKey:@"type"];
|
|
@@ -1658,51 +1579,7 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
|
|
|
- NSString *title = [section_item objectForKey:@"title"];
|
|
|
|
|
- labeltitle = title;
|
|
|
|
|
- if ([title isEqualToString:@"More Info"]) {
|
|
|
|
|
-
|
|
|
|
|
- NSString* btntitle=nil ;
|
|
|
|
|
- if(self.showMore)
|
|
|
|
|
- {
|
|
|
|
|
- btntitle=@"Hide";
|
|
|
|
|
- }
|
|
|
|
|
- else{
|
|
|
|
|
- btntitle=@"Show";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
|
|
|
|
|
- btn.tag=section;
|
|
|
|
|
- [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
- [btn setTitle:btntitle forState:UIControlStateNormal];
|
|
|
|
|
- btn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
|
|
|
|
|
- [myView addSubview:btn];
|
|
|
|
|
-
|
|
|
|
|
- } else if ([title containsString:@"Models"]) {
|
|
|
|
|
-
|
|
|
|
|
- BOOL item_switch = [[section_item objectForKey:@"switch"] boolValue];
|
|
|
|
|
- NSString *normalTitle = @"Show";
|
|
|
|
|
- NSString *selectedTitle = @"Hide";
|
|
|
|
|
- if (item_switch == YES) {
|
|
|
|
|
- normalTitle = @"Hide";
|
|
|
|
|
- selectedTitle = @"Show";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- UIButton * btn =[[UIButton alloc] initWithFrame:CGRectMake(tableView.bounds.size.width-50-15, 0, 50, 33)];
|
|
|
|
|
- btn.tag=section;
|
|
|
|
|
- [btn addTarget:self action:@selector(HideSction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
- [btn setTitle:normalTitle forState:UIControlStateNormal];
|
|
|
|
|
- [btn setTitle:selectedTitle forState:UIControlStateSelected];
|
|
|
|
|
- btn.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin;
|
|
|
|
|
- [myView addSubview:btn];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
|
NSString *title = [section_item objectForKey:@"title"];
|
|
NSString *title = [section_item objectForKey:@"title"];
|
|
|
labeltitle = title;
|
|
labeltitle = title;
|
|
@@ -1867,36 +1744,7 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- NSUInteger section = sender.tag;
|
|
|
|
|
- NSMutableDictionary *section_item = [[self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]] mutableCopy];
|
|
|
|
|
- NSString *title = [section_item objectForKey:@"title"];
|
|
|
|
|
-
|
|
|
|
|
- if ([title isEqualToString:@"More Info"]) {
|
|
|
|
|
-
|
|
|
|
|
- self.showMore = !self.showMore;
|
|
|
|
|
- NSRange range = NSMakeRange(section, 1);
|
|
|
|
|
- NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
|
|
|
|
|
- [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
|
|
|
|
|
-
|
|
|
|
|
- } else if ([title containsString:@"Models"]) {
|
|
|
|
|
-
|
|
|
|
|
- BOOL item_switch = [[section_item objectForKey:@"switch"] boolValue];
|
|
|
|
|
- if (item_switch == YES) {
|
|
|
|
|
- [section_item setObject:@(NO) forKey:@"switch"];
|
|
|
|
|
- } else {
|
|
|
|
|
- [section_item setObject:@(YES) forKey:@"switch"];
|
|
|
|
|
- }
|
|
|
|
|
- [self.content_data setObject:section_item forKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
|
|
|
-
|
|
|
|
|
- sender.selected = !sender.selected;
|
|
|
|
|
- NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndex:section];
|
|
|
|
|
- [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
NSUInteger section = sender.tag;
|
|
NSUInteger section = sender.tag;
|
|
|
NSMutableDictionary *section_item = [[self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]] mutableCopy];
|
|
NSMutableDictionary *section_item = [[self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]] mutableCopy];
|
|
|
NSString *title = [section_item objectForKey:@"title"];
|
|
NSString *title = [section_item objectForKey:@"title"];
|
|
@@ -1980,11 +1828,7 @@
|
|
|
return [[self.content_data objectForKey:@"count"] integerValue];
|
|
return [[self.content_data objectForKey:@"count"] integerValue];
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- return [[self.content_data objectForKey:@"count"] integerValue];
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
return [[self.content_data objectForKey:@"count"] integerValue];
|
|
return [[self.content_data objectForKey:@"count"] integerValue];
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -2034,43 +1878,7 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
|
|
|
- NSDictionary *data = [section_item objectForKey:@"data"];
|
|
|
|
|
- NSString *section_type = [section_item objectForKey:@"type"];
|
|
|
|
|
- if ([section_type isEqualToString:@"sub_order"]) {
|
|
|
|
|
-
|
|
|
|
|
- BOOL item_switch = [[section_item objectForKey:@"switch"] boolValue];
|
|
|
|
|
- if (item_switch == YES) {
|
|
|
|
|
- return [[data objectForKey:@"count"] integerValue];
|
|
|
|
|
- } else {
|
|
|
|
|
- return 0;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else if ([section_type isEqualToString:@"order_info"]){
|
|
|
|
|
- if (self.showModels) {
|
|
|
|
|
- return 1;
|
|
|
|
|
- } else {
|
|
|
|
|
- return 0;
|
|
|
|
|
- }
|
|
|
|
|
- } else if ([section_type isEqualToString:@"sign_url"]){
|
|
|
|
|
- return 1;
|
|
|
|
|
- } else if ([section_type isEqualToString:@"more_order_info"]){
|
|
|
|
|
- if(self.showMore)
|
|
|
|
|
- return 1;
|
|
|
|
|
- else
|
|
|
|
|
- return 0;
|
|
|
|
|
- }else if ([section_type isEqualToString:@"price_info"]){
|
|
|
|
|
- return [[data objectForKey:@"count"] integerValue];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- return 0;
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
|
|
|
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
NSDictionary *section_item = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",section]];
|
|
|
NSDictionary *data = [section_item objectForKey:@"data"];
|
|
NSDictionary *data = [section_item objectForKey:@"data"];
|
|
@@ -2133,11 +1941,7 @@
|
|
|
return 6;
|
|
return 6;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- return 6;
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
return 6;
|
|
return 6;
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
@@ -2545,7 +2349,7 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
/**
|
|
/**
|
|
|
* ver1.90
|
|
* ver1.90
|
|
|
*/
|
|
*/
|
|
@@ -2931,401 +2735,14 @@
|
|
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
- /**
|
|
|
|
|
- * ver1.90
|
|
|
|
|
- */
|
|
|
|
|
- NSDictionary *section = [self.content_data objectForKey:[NSString stringWithFormat:@"section_%ld",indexPath.section]];
|
|
|
|
|
- NSString *type = [section objectForKey:@"type"];
|
|
|
|
|
|
|
+#ifdef BUILD_HMLG
|
|
|
|
|
|
|
|
- if ([type isEqualToString:@"order_info"]) {/** Order Info */
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailHtmlCell";
|
|
|
|
|
- OrderDetailHtmlCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- cell.webview.tag = indexPath.section;
|
|
|
|
|
-
|
|
|
|
|
- cell.webview.delegate = self;
|
|
|
|
|
- // cell.webView.scrollView.contentSize.height = 0;
|
|
|
|
|
- cell.webview.scrollView.bounces=NO;
|
|
|
|
|
- cell.webview.scrollView.directionalLockEnabled = true;
|
|
|
|
|
- CGSize size= cell.webview.scrollView.contentSize;
|
|
|
|
|
- size.height=10;
|
|
|
|
|
- cell.webview.scrollView.contentSize=size;
|
|
|
|
|
-
|
|
|
|
|
- [cell.webview loadHTMLString:[section valueForKey:@"data"] baseURL:nil];
|
|
|
|
|
-
|
|
|
|
|
- cell.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
- return cell;
|
|
|
|
|
- } else if ([type isEqualToString:@"sign_url"]) { /** Sign */
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailSignatureCell";
|
|
|
|
|
- OrderDetailSignatureCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
- NSString* img_url = [section valueForKey:@"data"];
|
|
|
|
|
-
|
|
|
|
|
- cell.sign_img.userInteractionEnabled = NO;
|
|
|
|
|
- __block BOOL hasTapGesture = NO;
|
|
|
|
|
- [cell.sign_img.gestureRecognizers enumerateObjectsUsingBlock:^(__kindof UIGestureRecognizer * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
|
|
|
-
|
|
|
|
|
- if ([obj isKindOfClass:[UITapGestureRecognizer class]]) {
|
|
|
|
|
- hasTapGesture = YES;
|
|
|
|
|
- *stop = YES;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }];
|
|
|
|
|
-
|
|
|
|
|
- if (!hasTapGesture) {
|
|
|
|
|
- UITapGestureRecognizer *signatureTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onSignOrderClick:)];
|
|
|
|
|
- [cell.sign_img addGestureRecognizer:signatureTap];
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- int status_code = [[self.content_data valueForKey:@"orderStatus"] intValue];
|
|
|
|
|
- bool offline_edit =[[self.content_data valueForKey:@"offline_edit"] boolValue];
|
|
|
|
|
- if(status_code==1) {
|
|
|
|
|
|
|
+ switch(indexPath.section)
|
|
|
|
|
+ {
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ {
|
|
|
|
|
|
|
|
- BOOL condition = offline_edit;
|
|
|
|
|
-#ifdef OFFLINE_MODE
|
|
|
|
|
- condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
-#else
|
|
|
|
|
- condition = YES;
|
|
|
|
|
-#endif
|
|
|
|
|
- if (condition)
|
|
|
|
|
- {
|
|
|
|
|
- cell.sign_img.userInteractionEnabled = YES;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else if(status_code==0) {
|
|
|
|
|
- BOOL condition = offline_edit;
|
|
|
|
|
-#ifdef OFFLINE_MODE
|
|
|
|
|
- condition = condition || appDelegate.offline_mode==false;
|
|
|
|
|
-#else
|
|
|
|
|
- condition = YES;
|
|
|
|
|
-#endif
|
|
|
|
|
- if (condition)
|
|
|
|
|
- {
|
|
|
|
|
- cell.sign_img.userInteractionEnabled = YES;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString* file_name=[img_url lastPathComponent];
|
|
|
|
|
- NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
|
|
|
|
|
- if(img_data!=nil)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- UIImage * img =[UIImage imageWithData:img_data];
|
|
|
|
|
- cell.sign_img.image=img ;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
-
|
|
|
|
|
- NSData* downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
|
|
|
|
|
-
|
|
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(downloadimg_data!=nil)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url];
|
|
|
|
|
-
|
|
|
|
|
- UIImage * img =[UIImage imageWithData:downloadimg_data];
|
|
|
|
|
- cell.sign_img.image=img ;
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- if (cell.sign_img.userInteractionEnabled) {
|
|
|
|
|
- cell.sign_img.image=[UIImage imageNamed:@"taptosign_s"];
|
|
|
|
|
- } else {
|
|
|
|
|
- cell.sign_img.image = nil;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- cell.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
- return cell;
|
|
|
|
|
- } else if ([type isEqualToString:@"more_order_info"]) { /** More Info */
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailHtmlCell";
|
|
|
|
|
- OrderDetailHtmlCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- cell.webview.tag = indexPath.section;
|
|
|
|
|
- cell.webview.delegate = self;
|
|
|
|
|
- // cell.webView.scrollView.contentSize.height = 0;
|
|
|
|
|
- cell.webview.scrollView.bounces=NO;
|
|
|
|
|
- cell.webview.scrollView.directionalLockEnabled = true;
|
|
|
|
|
- CGSize size= cell.webview.scrollView.contentSize;
|
|
|
|
|
- size.height=10;
|
|
|
|
|
- cell.webview.scrollView.contentSize=size;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- [cell.webview loadHTMLString:[section valueForKey:@"data"] baseURL:nil];
|
|
|
|
|
-
|
|
|
|
|
- cell.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
- return cell;
|
|
|
|
|
-
|
|
|
|
|
- } else if ([type isEqualToString:@"sub_order"]) { /** Sub Order */
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary *data = [section objectForKey:@"data"];
|
|
|
|
|
- NSDictionary *item = [data objectForKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
|
|
|
|
|
- NSString *item_type = [item objectForKey:@"type"];
|
|
|
|
|
-
|
|
|
|
|
- if ([item_type isEqualToString:@"pick_info"]) { /** Pick Info */
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailPickInfoCell";
|
|
|
|
|
- OrderDetailPickInfoCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
-
|
|
|
|
|
- NSString *carrier = [item objectForKey:@"delivery_carrier"];
|
|
|
|
|
- NSString *web_url = [item objectForKey:@"delivery_web_url"];
|
|
|
|
|
- NSString *track_number = [item objectForKey:@"tracking_number"];
|
|
|
|
|
- NSString *status = [item objectForKey:@"status"];
|
|
|
|
|
-
|
|
|
|
|
- cell.track_number_lb.text = track_number;
|
|
|
|
|
- cell.status_lb.text = status;
|
|
|
|
|
- cell.carrier_lb.text = carrier;
|
|
|
|
|
- cell.url_lb.text = web_url;
|
|
|
|
|
-
|
|
|
|
|
- return cell;
|
|
|
|
|
-
|
|
|
|
|
- } else if ([item_type isEqualToString:@"order_item"]) { /** Item Info */
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailModelCell";
|
|
|
|
|
- OrderDetailModelCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
- NSDictionary * item_json = item;
|
|
|
|
|
-
|
|
|
|
|
- // int count = [[item_json valueForKey:@"count"] intValue];
|
|
|
|
|
- NSDictionary * combine_json =[item_json objectForKey:@"combine"];
|
|
|
|
|
- cell.bundle_item=combine_json;
|
|
|
|
|
- NSDictionary * master_json = [item_json objectForKey:@"combine_master"];
|
|
|
|
|
- if (cell.masterBtn != nil) {
|
|
|
|
|
- if (master_json == nil) {
|
|
|
|
|
- cell.masterBtn.hidden = YES;
|
|
|
|
|
- } else{
|
|
|
|
|
- cell.masterBtn.hidden = NO;
|
|
|
|
|
- cell.master_items = master_json;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- double dprice=0.0;
|
|
|
|
|
-
|
|
|
|
|
- if(cell.bundle_item!=nil)
|
|
|
|
|
- {
|
|
|
|
|
- int citem=0;
|
|
|
|
|
-
|
|
|
|
|
- int bcount=[[cell.bundle_item valueForKey:@"count"] intValue];
|
|
|
|
|
- for(int bc=0;bc<bcount;bc++)
|
|
|
|
|
- {
|
|
|
|
|
- NSDictionary * bitem = [cell.bundle_item objectForKey:[NSString stringWithFormat:@"item_%d",bc]];
|
|
|
|
|
- int modulus= [[bitem valueForKey:@"modulus"] intValue];
|
|
|
|
|
- citem+= modulus;
|
|
|
|
|
- double uprice= [[bitem valueForKey:@"unit_price"]doubleValue];
|
|
|
|
|
- dprice+= uprice*modulus;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- if(citem==1)
|
|
|
|
|
- [ cell.buttonBundle setTitle:[NSString stringWithFormat: @"%d bundle item with price of $ %.2f",citem,dprice ]forState:UIControlStateNormal];
|
|
|
|
|
- else
|
|
|
|
|
- [ cell.buttonBundle setTitle:[NSString stringWithFormat: @"%d bundle items with price of $ %.2f",citem,dprice ]forState:UIControlStateNormal];
|
|
|
|
|
-
|
|
|
|
|
- cell.buttonBundle.hidden = NO;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- cell.buttonBundle.hidden = YES;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- NSString* img_url = [item_json valueForKey:@"img"];
|
|
|
|
|
- NSString* description = [item_json valueForKey:@"Item Number"];
|
|
|
|
|
-
|
|
|
|
|
- NSString* unitprice = [item_json valueForKey:@"The unit price"];
|
|
|
|
|
- NSString* origin_price = [item_json valueForKey:@"origin_price"];
|
|
|
|
|
- NSString* subtotal = [item_json valueForKey:@"Subtotal"];
|
|
|
|
|
- NSString* qty = [item_json valueForKey:@"QTY"];
|
|
|
|
|
- NSString* status = [item_json valueForKey:@"order_item_status"];
|
|
|
|
|
- NSString* notes = [item_json valueForKey:@"note"];
|
|
|
|
|
-
|
|
|
|
|
- if(notes.length>0)
|
|
|
|
|
- {
|
|
|
|
|
- cell.noteLabel.text = [@"Note: " stringByAppendingString:[notes stringByReplacingOccurrencesOfString:@"\n" withString:@" "]];
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- cell.noteLabel.text = nil;
|
|
|
|
|
- if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- unitprice=nil;
|
|
|
|
|
- origin_price=nil;
|
|
|
|
|
- subtotal=nil;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- float duprice = [unitprice floatValue];
|
|
|
|
|
- float dsubtotal = (duprice+dprice)*[qty intValue];
|
|
|
|
|
-
|
|
|
|
|
- cell.descriptionLabel.text=description;
|
|
|
|
|
- if(dprice>0)
|
|
|
|
|
- cell.unitpriceLabel.text = [NSString stringWithFormat:@"%.2f+%.2f",duprice,dprice];//unitprice;
|
|
|
|
|
- else
|
|
|
|
|
- cell.unitpriceLabel.text = [NSString stringWithFormat:@"%.2f",duprice];//unitprice;
|
|
|
|
|
- cell.subtotalLabel.text = [NSString stringWithFormat:@"%.2f",dsubtotal];//subtotal;
|
|
|
|
|
- cell.qtyLabel.text = qty;
|
|
|
|
|
- cell.statusLabel.text = status;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- cell.labelOldPrice.text = origin_price;
|
|
|
|
|
-
|
|
|
|
|
- double discount =[[item_json valueForKey:@"discount"] doubleValue];
|
|
|
|
|
- NSString* discountstr=[NSString stringWithFormat:@"%@%% off", [RAUtils FloatFormat:discount]];
|
|
|
|
|
- cell.labelDiscount.text = discountstr;
|
|
|
|
|
- bool isfree = [[item_json valueForKey:@"is_free"]boolValue];
|
|
|
|
|
- if(isfree)
|
|
|
|
|
- {
|
|
|
|
|
- cell.labelOldPrice.hidden = false;
|
|
|
|
|
- cell.labelOldPrice.textColor = [UIColor redColor];
|
|
|
|
|
- cell.labelOldPrice.text=@"Free";
|
|
|
|
|
- cell.labelOldPrice.hideline = true;
|
|
|
|
|
-
|
|
|
|
|
- cell.labelDiscount.hidden = true;
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- cell.labelOldPrice.textColor = [UIColor blackColor];
|
|
|
|
|
- cell.labelOldPrice.hideline = false;
|
|
|
|
|
- if(discount==0)
|
|
|
|
|
- {
|
|
|
|
|
- cell.labelOldPrice.hidden = true;
|
|
|
|
|
- cell.labelDiscount.hidden = true;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- cell.labelOldPrice.hidden = false;
|
|
|
|
|
- cell.labelDiscount.hidden = false;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // Button 设置了大小约束,Size就不会随内容变化
|
|
|
|
|
- [cell.imgbtn setContentMode:UIViewContentModeScaleAspectFit];
|
|
|
|
|
- [cell.imgbtn setContentEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 0)];
|
|
|
|
|
- [cell.imgbtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentFill];
|
|
|
|
|
- [cell.imgbtn setContentVerticalAlignment:UIControlContentVerticalAlignmentFill];
|
|
|
|
|
- cell.imgbtn.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
|
|
-
|
|
|
|
|
- if (![cell.imageName isEqualToString:img_url]) {
|
|
|
|
|
- cell.imageName = img_url;
|
|
|
|
|
-// [cell.imgbtn setBackgroundImage:[UIImage imageNamed:@"loading_s"] forState:UIControlStateNormal];
|
|
|
|
|
- [cell.imgbtn setImage:[UIImage imageNamed:@"loading_s"] forState:UIControlStateNormal];
|
|
|
|
|
-
|
|
|
|
|
- NSString* file_name=[img_url lastPathComponent];
|
|
|
|
|
- NSData* img_data=[iSalesDB load_cached_img:file_name loadFrom:img_url];
|
|
|
|
|
- if(img_data!=nil)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- UIImage * img =[UIImage imageWithData:img_data];
|
|
|
|
|
-// [cell.imgbtn setBackgroundImage:img forState:UIControlStateNormal];
|
|
|
|
|
- [cell.imgbtn setImage:img forState:UIControlStateNormal];
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
|
|
|
|
-
|
|
|
|
|
- NSData* downloadimg_data = [NSData dataWithContentsOfURL:[NSURL URLWithString:img_url]];
|
|
|
|
|
-
|
|
|
|
|
- dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- if(downloadimg_data!=nil)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- [iSalesDB cache_img:downloadimg_data filename:file_name saveTo:img_url];
|
|
|
|
|
-
|
|
|
|
|
- UIImage * img =[UIImage imageWithData:downloadimg_data];
|
|
|
|
|
-// [cell.imgbtn setBackgroundImage:img forState:UIControlStateNormal];
|
|
|
|
|
- [cell.imgbtn setImage:img forState:UIControlStateNormal];
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
-// [cell.imgbtn setBackgroundImage:[UIImage imageNamed:@"notfound_s"] forState:UIControlStateNormal];
|
|
|
|
|
- [cell.imgbtn setImage:[UIImage imageNamed:@"notfound_s"] forState:UIControlStateNormal];
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- cell.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
- return cell;
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- } else if ([type isEqualToString:@"price_info"]) { /** Price */
|
|
|
|
|
-
|
|
|
|
|
- NSString *CellIdentifier = @"OrderDetailPriceCell";
|
|
|
|
|
- OrderDetailPriceCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
|
|
|
-
|
|
|
|
|
- NSDictionary *data = [section objectForKey:@"data"];
|
|
|
|
|
- NSDictionary *item = [data objectForKey:[NSString stringWithFormat:@"item_%ld",indexPath.row]];
|
|
|
|
|
- NSString *title = [item objectForKey:@"title"];
|
|
|
|
|
- NSString *value = [item objectForKey:@"value"];
|
|
|
|
|
- if ([title isEqualToString:@"Sub-Total"] || [title isEqualToString:@"Total"]) {
|
|
|
|
|
- if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- else
|
|
|
|
|
- {
|
|
|
|
|
- value=nil;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- cell.chargeLabel.text = [title stringByAppendingString:@":"];
|
|
|
|
|
- cell.priceLabel.text = value;
|
|
|
|
|
-
|
|
|
|
|
- cell.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
- return cell;
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-#ifdef BUILD_HMLG
|
|
|
|
|
-
|
|
|
|
|
- switch(indexPath.section)
|
|
|
|
|
- {
|
|
|
|
|
- case 0:
|
|
|
|
|
- {
|
|
|
|
|
-
|
|
|
|
|
- if(indexPath.row==0)
|
|
|
|
|
|
|
+ if(indexPath.row==0)
|
|
|
{
|
|
{
|
|
|
NSString *CellIdentifier = @"OrderDetailHtmlCell";
|
|
NSString *CellIdentifier = @"OrderDetailHtmlCell";
|
|
|
OrderDetailHtmlCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
OrderDetailHtmlCell * cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
|
|
@@ -3730,11 +3147,7 @@
|
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- cell.chargeLabel.text = @"Liftgate Fee(No loading dock):";
|
|
|
|
|
- cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
|
|
|
|
|
-#endif
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
cell.chargeLabel.text = @"Liftgate Fee(No loading dock):";
|
|
cell.chargeLabel.text = @"Liftgate Fee(No loading dock):";
|
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Liftgate Fee(No loading dock)"];
|
|
|
#endif
|
|
#endif
|
|
@@ -3751,14 +3164,11 @@
|
|
|
cell.chargeLabel.text = @"Handling Fee:";
|
|
cell.chargeLabel.text = @"Handling Fee:";
|
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Handling Fee"];
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Handling Fee"];
|
|
|
#endif
|
|
#endif
|
|
|
-#ifdef BUILD_HOMER
|
|
|
|
|
- cell.chargeLabel.text = @"Handling Fee:";
|
|
|
|
|
- cell.priceLabel.text =[self.content_data valueForKey:@"Handling Fee"];
|
|
|
|
|
-#endif
|
|
|
|
|
-#ifdef BUILD_GATIT
|
|
|
|
|
|
|
+#if defined(BUILD_HOMER) || defined(BUILD_GATIT)
|
|
|
cell.chargeLabel.text = @"Handling Fee:";
|
|
cell.chargeLabel.text = @"Handling Fee:";
|
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Handling Fee"];
|
|
cell.priceLabel.text =[self.content_data valueForKey:@"Handling Fee"];
|
|
|
#endif
|
|
#endif
|
|
|
|
|
+
|
|
|
#ifdef BUILD_HMLG
|
|
#ifdef BUILD_HMLG
|
|
|
NSString* price=[self.content_data valueForKey:@"Total"];
|
|
NSString* price=[self.content_data valueForKey:@"Total"];
|
|
|
if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
|
|
if(appDelegate.can_see_price&&appDelegate.price_hidden==false)
|