فهرست منبع

增加Order Detail的Show Models

Pen Li 9 سال پیش
والد
کامیت
d5682af654

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 1 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -2432,6 +2432,7 @@
 - (void)HideSction:(UIButton *)sender {
     
     NSMutableDictionary* section=  [[self.content_data_download objectForKey:[NSString stringWithFormat:@"section_%ld",(long)sender.tag]] mutableCopy];
+
     bool hide = [[section valueForKey:@"hide"]boolValue];
     if(hide)
     {

+ 1 - 1
RedAnt ERP Mobile/common/Functions/offline/OLDataProvider.m

@@ -6064,7 +6064,7 @@
             moreInfo = [self replaceHtml:moreInfo String:@"ReturnToAddress_or_" withString:returnToAddr];
             //
             
-            DebugLog(@"more info : %@",moreInfo);
+//            DebugLog(@"more info : %@",moreInfo);
             
             // handling fee
             handlingFee = sqlite3_column_double(statement, 33);

+ 53 - 7
RedAnt ERP Mobile/common/Functions/order/OrderDetailViewController.m

@@ -36,6 +36,8 @@
 
 @interface OrderDetailViewController ()
 
+@property (nonatomic,assign) BOOL showModels;
+
 @end
 
 @implementation OrderDetailViewController
@@ -95,6 +97,7 @@
     self.label_net_err.layer.cornerRadius=15;
     self.label_net_err.layer.masksToBounds=true;
     
+    self.showModels = YES;
     
     
     
@@ -1092,8 +1095,28 @@
             
         }
             break;
-        case 2:
+        case 2:{
             labeltitle= @"Models";
+            
+            NSString* btntitle=nil ;
+            if(self.showModels)
+            {
+                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];
+            [myView addSubview:btn];
+            
+        }
             break;
         case 3:
             labeltitle= @"Price Info";
@@ -1133,10 +1156,29 @@
      
      */
     
-    self.showMore=!self.showMore;
-    NSRange range = NSMakeRange(1, 1);
-    NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
-    [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
+    switch (sender.tag) {
+        case 0:{
+            
+        }
+            break;
+        case 1:{
+            self.showMore=!self.showMore;
+            NSRange range = NSMakeRange(1, 1);
+            NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndexesInRange:range];
+            [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
+        }
+            break;
+        case 2:{
+            self.showModels = !self.showModels;
+            
+            NSIndexSet *sectionToReload = [NSIndexSet indexSetWithIndex:2];
+            [self.detailTable reloadSections:sectionToReload withRowAnimation:UITableViewRowAnimationAutomatic];
+        }
+            break;
+            
+        default:
+            break;
+    }
     
     
     
@@ -1184,8 +1226,12 @@
     
     if(section==2)
     {
-        int count =[[self.content_data valueForKey:@"model_count"] intValue];
-        return count;
+        if (self.showModels) {
+            int count =[[self.content_data valueForKey:@"model_count"] intValue];
+            return count;
+        } else {
+            return 0;
+        }
     }
     if(section==3)
         return 5;