Ray Zhang 10 년 전
부모
커밋
58019eccc9

+ 4 - 0
RedAnt ERP Mobile/common/Functions/MainViewController.h

@@ -44,6 +44,10 @@
 @property  (strong,nonatomic)ContactListViewController* contactListViewController;
 @property  (strong,nonatomic)PDFListViewController* pdfListViewController;
 @property (strong, nonatomic) IBOutlet UIButton *backgroundButton;
+
+@property (strong, nonatomic) IBOutlet UIButton *btn_LogoHome;
+
+
 @property  (strong,nonatomic)SearchViewController* searchViewController;
 //@property (strong, nonatomic) IBOutlet UILabel *labelUser;
 //@property (strong, nonatomic) IBOutlet UILabel *labelHello;

+ 50 - 5
RedAnt ERP Mobile/common/Functions/MainViewController.m

@@ -26,6 +26,7 @@
 #import "SimplifiedBuyingProgramViewController.h"
 #import "UserListViewController.h"
 #import "OfflineSettingViewController.h"
+#import "DefaultAppearance.h"
 
 @interface MainViewController ()
 
@@ -183,15 +184,19 @@
     
     
     
+    NSDictionary * customerinfo=appDelegate.customerInfo;
     
     
-    
-    
-    if(contact==nil||contact.length==0)
+    if(customerinfo==nil)
     {
-        contact=@"No Name";
+        contact=@"Select Contact";
         [self.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
     }
+//    if(contact==nil||contact.length==0)
+//    {
+//        contact=@"No Name";
+//        [self.btnContact setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
+//    }
     else
     {
         
@@ -332,6 +337,8 @@
         cvc.contact_type = @"Sales_Order_Customer";
         cvc.returnValue = ^(NSMutableDictionary* value,NSIndexPath* source){
             
+            
+            [self.navigationController popViewControllerAnimated:false];
             appDelegate.contact_id=[value valueForKey:@"customer_cid"];
             appDelegate.customerInfo = value;
             
@@ -394,6 +401,35 @@
     [super viewDidLoad];
     
     
+    
+    NSString* value =[DefaultAppearance get_noneappearance_value:@"DefaultColor" valuename:@"labelcolor"];
+    
+    if(value==nil)
+        value=@"";
+    unsigned long frontcolor = strtoul([value UTF8String],0,16);
+    [self.labelSo setTextColor:UIColorFromRGB(frontcolor)];
+    
+    
+    
+    
+    
+    float vx =[[DefaultAppearance get_noneappearance_value:@"MainLogo" valuename:@"x"] floatValue];
+    float vy =[[DefaultAppearance get_noneappearance_value:@"MainLogo" valuename:@"y"] floatValue];
+    float vwidth =[[DefaultAppearance get_noneappearance_value:@"MainLogo" valuename:@"width"] floatValue];
+    float vheight =[[DefaultAppearance get_noneappearance_value:@"MainLogo" valuename:@"height"] floatValue];
+    
+    self.btn_LogoHome.frame = CGRectMake(vx, vy, vwidth, vheight);
+    
+    
+    float mvx =[[DefaultAppearance get_noneappearance_value:@"ModePos" valuename:@"x"] floatValue];
+    float mvy =[[DefaultAppearance get_noneappearance_value:@"ModePos" valuename:@"y"] floatValue];
+    float mvwidth =[[DefaultAppearance get_noneappearance_value:@"ModePos" valuename:@"width"] floatValue];
+    float mvheight =[[DefaultAppearance get_noneappearance_value:@"ModePos" valuename:@"height"] floatValue];
+    
+    self.labelMode.frame = CGRectMake(mvx, mvy, mvwidth, mvheight);
+    
+    
+    
     self.label_ccount.layer.cornerRadius=10.5;
     self.label_ccount.layer.masksToBounds=true;
     
@@ -1054,6 +1090,11 @@
     
     self.itemSearchViewController.covertype = coverttype;
     self.itemSearchViewController.saved_covertype = coverttype;
+    
+    self.categoryViewController.p_available = nil;
+    self.categoryViewController.p_price = nil;
+    self.categoryViewController.p_QTY = nil;
+    self.categoryViewController.p_bestseller = nil;
     [self.itemSearchViewController reload_container_getdata:true];
     
     //    .categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
@@ -1085,7 +1126,7 @@
     
     UIApplication * app = [UIApplication sharedApplication];
     AppDelegate *appDelegate = (AppDelegate *)[app delegate];
-    
+    NSString* aaa =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];;
     self.categoryViewController.categoryString = [@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
     self.categoryViewController.cagegoryLabel.text =self.categoryViewController.categoryString;
     //   NSString* sss =[@"Category" stringByAppendingString:[self categoryString:categoryid node:appDelegate.categoryMenu level:0]];
@@ -1096,6 +1137,10 @@
         self.categoryViewController.p_available = nil;
         self.categoryViewController.p_price = nil;
         self.categoryViewController.p_QTY = nil;
+    self.categoryViewController.p_bestseller = nil;
+    
+    self.categoryViewController.modelname = nil;
+    self.categoryViewController.modeldescrip = nil;
     [self.categoryViewController reload_container_getdata:true];
     [self.categoryViewController showCategory];
     if([self.current_VC isKindOfClass:[CategoryViewController class]])

+ 4 - 1
RedAnt ERP Mobile/iSales-NPD/AppDelegate.h

@@ -86,7 +86,7 @@
 
 -(void) update_count_mark;
 // downloader
-
+-(void) check_offline:(NSString*) ver;
 @property (nonatomic, strong) OfflineSettingViewController *settingUI;
 @property (nonatomic, strong) NSFileHandle *fileHandle;
 @property (nonatomic, assign) long long currentLength; //>>写入文件的长度
@@ -128,4 +128,7 @@
 -(void) printPdf:(NSString*) url company:(NSString*)company send_to:(NSString*)send_to soid:(NSString*)soid content:(NSString*)content;
 @property (strong, nonatomic) NSMutableDictionary* OrderFilter;
 
+
+
+
 @end

+ 61 - 46
RedAnt ERP Mobile/iSales-NPD/AppDelegate.m

@@ -552,68 +552,83 @@
         self.connection = nil;
     }
 }
--(void) check_offline
+-(void) check_offline:(NSString*) ver
 {
     
-    
-    
-    NSMutableDictionary* json=[[iSalesNetwork  check_Offline:nil] mutableCopy];
-    
-    dispatch_async(dispatch_get_main_queue(), ^{
+
+
+    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        
+        NSMutableDictionary* json=[[iSalesNetwork  check_Offline:ver] mutableCopy];
+        
+        NSMutableDictionary* download_json=nil;
+        
+        //      dispatch_async(dispatch_get_main_queue(), ^{
         //  [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
-        NSString* vid=[json valueForKey:@"vid"];
+        NSString* vid=[json valueForKey:@"downSerial"];
         //                        sleep(3);
         //UIAlertView * waitalert1 = [RAUtils waiting_alert:@"Please wait..." title:@"Server is preparing data for you"];
         
         
-        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
-            __block bool preparing = true;
-            while (preparing) {
-                sleep(10);
-                
-                
-                
-                NSMutableDictionary* download_json=[[iSalesNetwork  download_Offline:vid] mutableCopy];
-                
-                dispatch_sync(dispatch_get_main_queue(), ^{
-                    
-                    
-                    int aaa=123;
-                    
-                    if([[download_json valueForKey:@"result"] intValue]==2)
-                    {
-                        preparing = false;
-                        //   [waitalert1 dismissWithClickedButtonIndex:0 animated:FALSE];
-                    }
-                    else if([[download_json valueForKey:@"result"] intValue]==1)
-                    {
-                        // preparing.
-                    }
-                    else
-                    {
-                        //wrong.
-                        preparing = false;
-                        //  [waitalert1 dismissWithClickedButtonIndex:0 animated:FALSE];
-                        //  [RAUtils message_alert:@"Download data wrong, canceled." title:@"Offline" controller:self] ;
-                        
-                    }
-                    
-                    
-                });
-                
-                
-                
-            }
-        });
+        //     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
+        int count=0;
+      //  __block bool preparing = true;
+        while ([[download_json valueForKey:@"result"] intValue]!=2&&count<180) //超过60分钟还没准被好数据就视为服务器出错。
+        {
+            sleep(20);
+            
+            
+            count++;
+            download_json=[[iSalesNetwork  download_Offline:vid] mutableCopy];
+            
+            //                    dispatch_sync(dispatch_get_main_queue(), ^{
+            
+            
+            
+            
+//            if([[download_json valueForKey:@"result"] intValue]==2)
+//            {
+//                preparing = false;
+//                //   [waitalert1 dismissWithClickedButtonIndex:0 animated:FALSE];
+//            }
+//            else if([[download_json valueForKey:@"result"] intValue]==1)
+//            {
+//                // preparing.
+//            }
+//            else
+//            {
+//                //wrong.
+//                preparing = false;
+//                //  [waitalert1 dismissWithClickedButtonIndex:0 animated:FALSE];
+//                //  [RAUtils message_alert:@"Download data wrong, canceled." title:@"Offline" controller:self] ;
+//                
+//            }
+            
+            
+            //                   });
+            
+            
+            
+        }
+        
+        //服务器准备数据完毕,进入处理数据逻辑。
+        
+        int aaa=123;
         
+        //      });
         
         
         
         
         
+        
+        //     });
     });
     
     
+
+    
+    
 }
 -(void) download_offline:(NSMutableDictionary*) source
 {

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 219 - 146
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


+ 2 - 2
RedAnt ERP Mobile/iSales-NPD/Base.lproj/OLM.storyboard

@@ -89,14 +89,14 @@
                                 <rect key="frame" x="217" y="172" width="147" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Progress" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="sDs-06-tny">
                                 <rect key="frame" x="20" y="252" width="68" height="21"/>
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                 <fontDescription key="fontDescription" type="system" pointSize="17"/>
-                                <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
+                                <color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
                                 <nil key="highlightedColor"/>
                             </label>
                             <progressView opaque="NO" contentMode="scaleToFill" verticalHuggingPriority="750" progress="0.5" id="vOC-FT-Ods">

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.