Pārlūkot izejas kodu

NPD MOBILE

修改 PDF 加载逻辑。
Ray Zhang 8 gadi atpakaļ
vecāks
revīzija
400dbebe89

+ 16 - 0
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -387,5 +387,21 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "common/Functions/portfolio/PDFListViewController.m"
+            timestampString = "524114259.737369"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "500"
+            endingLineNumber = "500"
+            landmarkName = "-tableView:didSelectRowAtIndexPath:"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 2 - 1
RedAnt ERP Mobile/common/Functions/PDF+Web/PDFViewController.m

@@ -250,7 +250,8 @@
         
         self.content= [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error];
         
-        self.filename = [urlResponse suggestedFilename];
+        if(self.filename.length<=0)
+            self.filename = [urlResponse suggestedFilename];
         
         
         dispatch_async(dispatch_get_main_queue(), ^{

+ 5 - 1
RedAnt ERP Mobile/common/Functions/portfolio/PDFListViewController.m

@@ -15,6 +15,8 @@
 #import "DefaultTableHeaderView.h"
 #import "SortItemViewController.h"
 #import "UIColor+JK_HEX.h"
+#import "TextUtils.h"
+
 
 @interface PDFListViewController ()
 
@@ -544,7 +546,9 @@
     //                    {
     //                        subject = [NSString stringWithFormat:@"Tear sheet for %@",company ];
     //                    }
-    ViewController.attachment_name = [NSString stringWithFormat:@"NPD_Product_List %@.pdf",cur_time];
+    NSString* lfilename = [TextUtils legalFilename:name];
+    ViewController.attachment_name = [NSString stringWithFormat:@"%@.pdf",lfilename];
+    ViewController.filename = [NSString stringWithFormat:@"%@.pdf",lfilename];
     ViewController.mail_subject = subject;
 
     ViewController.hidenavi = false;

+ 2 - 0
RedAnt ERP Mobile/common/TextUtils.h

@@ -18,4 +18,6 @@
 
 +(NSString*) encodePhoneNumber:(NSString*) phone;
 +(NSString*) RegularExpReplace:(NSString*) content from:(NSString*) pattern to:(NSString*) to_pattern;
+
++(NSString*) legalFilename:(NSString*) str;
 @end

+ 6 - 0
RedAnt ERP Mobile/common/TextUtils.m

@@ -190,4 +190,10 @@
     return rect;
     
 }
++(NSString*) legalFilename:(NSString*) str
+{
+    NSString* ret = str;
+    //....... todo
+    return ret;
+}
 @end