Просмотр исходного кода

1.修改iOS Apex Mobile登陆界面增加Ver。
2.修改iOS Apex Mobile登陆AuthVer参数错误。
3.修改iOS Apex Mobile搜索条件清空时正在编辑的数据没有清除。
4.修改iOS Apex Mobile History增加Title。

Pen Li 8 лет назад
Родитель
Сommit
264c80155e

+ 3 - 0
Apex Mobile/Apex Mobile/ApexHistoryViewController.m

@@ -39,6 +39,9 @@
 - (void)viewDidLoad
 {
     [super viewDidLoad];
+    
+     self.title = @"Apex History";
+    
     NSString *filePath = [[NSBundle mainBundle]pathForResource:@"about" ofType:@"htm"];
     NSString *htmlString = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
     [self.webview loadHTMLString:htmlString baseURL:[NSURL URLWithString:filePath]];

+ 1 - 1
Apex Mobile/Apex Mobile/AppDelegate.h

@@ -20,7 +20,7 @@ UIKIT_EXTERN NSString * const APLogoutNotification;
 @property (strong,nonatomic) NSString * duid;
 
 
-
+@property (nonatomic,assign) long authVer;
 @property (strong,nonatomic) NSString* build;
 @property (strong,nonatomic) NSString* shortver;
 -(void)Logout;

+ 35 - 0
Apex Mobile/Apex Mobile/AppDelegate.m

@@ -124,6 +124,39 @@ void UncaughtExceptionHandler(NSException *exception) {
     
 }
 
+- (void)loadAuthVer {
+    self.authVer = 0;
+    
+    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
+    
+    __weak typeof(self) weakSelf = self;
+    if (self.user) {
+        
+        NSString *auth_ver_key = [NSString stringWithFormat:@"%@_Auth_InfoVer",self.user];
+        if ([defaults objectForKey:auth_ver_key] != nil) {
+            
+            weakSelf.authVer = [defaults integerForKey:auth_ver_key];
+            [defaults removeObjectForKey:auth_ver_key];
+            
+            NSString *sql = [NSString stringWithFormat:@"insert into auth_ver (ver) values (%ld);",weakSelf.authVer];
+            [ApexMobileDB jk_excute:sql completion:nil];
+            
+        } else {
+            
+            NSString *sql = @"select ver from auth_ver;";
+            [ApexMobileDB jk_query:sql completion:^(sqlite3_stmt *stmt, long *count) {
+                
+                weakSelf.authVer = sqlite3_column_int(stmt, 0);
+                
+            } failure:^(NSString *err_msg) {
+                weakSelf.authVer = 0;
+            }];
+        }
+    } else {
+        self.authVer = 0;
+    }
+}
+
 #pragma mark - AppDelegate
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
@@ -160,6 +193,8 @@ void UncaughtExceptionHandler(NSException *exception) {
     
     [self changeAppearance];
     
+    [self loadAuthVer];
+    
     return YES;
 }
 -(void)Logout

+ 7 - 0
Apex Mobile/Apex Mobile/LoginViewController.m

@@ -10,6 +10,7 @@
 #import "RetrievePasswordViewController.h"
 
 @interface LoginViewController ()
+@property (strong, nonatomic) IBOutlet UILabel *verLabel;
 
 @end
 
@@ -146,6 +147,12 @@
     // Do any additional setup after loading the view, typically from a nib.
     
     self.mum.backgroundColor = [UIColor clearColor];
+    
+    NSDictionary* infoDict =[[NSBundle mainBundle] infoDictionary];
+    NSString* versionNum =[infoDict objectForKey:@"CFBundleVersion"];
+    versionNum = [NSString stringWithFormat:@"ver:A%@",versionNum];
+    
+    self.verLabel.text = versionNum;
 }
 
 - (void)viewWillAppear:(BOOL)animated {

+ 9 - 0
Apex Mobile/Apex Mobile/Main.storyboard

@@ -235,15 +235,23 @@
                                     <action selector="RetrieveButtonClick:" destination="RGM-u2-C1G" eventType="touchUpInside" id="kKP-WL-fGb"/>
                                 </connections>
                             </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ver:A160422" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NL1-l0-Yvv">
+                                <rect key="frame" x="20" y="30" width="82.5" height="17"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                                <color key="textColor" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
+                                <nil key="highlightedColor"/>
+                            </label>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                         <constraints>
                             <constraint firstItem="Hzc-kg-csR" firstAttribute="top" secondItem="vvk-xp-NJf" secondAttribute="bottom" constant="24" id="Fha-yZ-KoM"/>
+                            <constraint firstItem="NL1-l0-Yvv" firstAttribute="leading" secondItem="lHV-oi-ARt" secondAttribute="leading" constant="20" id="HXH-ng-Zje"/>
                             <constraint firstItem="zKh-Ur-Gus" firstAttribute="top" secondItem="Fgn-Jb-we3" secondAttribute="bottom" constant="29" id="NCe-W2-EeK"/>
                             <constraint firstItem="Hzc-kg-csR" firstAttribute="trailing" secondItem="O5q-tH-vch" secondAttribute="trailing" id="QQT-w5-bCg"/>
                             <constraint firstItem="zKh-Ur-Gus" firstAttribute="centerX" secondItem="lHV-oi-ARt" secondAttribute="centerX" id="de4-gF-h5y"/>
                             <constraint firstItem="OnO-n9-f7N" firstAttribute="width" secondItem="lHV-oi-ARt" secondAttribute="width" id="jGj-UK-dEj"/>
                             <constraint firstItem="OnO-n9-f7N" firstAttribute="centerY" secondItem="lHV-oi-ARt" secondAttribute="centerY" id="raF-GG-xW9"/>
+                            <constraint firstItem="NL1-l0-Yvv" firstAttribute="top" secondItem="Fgn-Jb-we3" secondAttribute="bottom" constant="10" id="srL-26-Op0"/>
                             <constraint firstItem="OnO-n9-f7N" firstAttribute="centerX" secondItem="lHV-oi-ARt" secondAttribute="centerX" id="vXY-JI-MLZ"/>
                         </constraints>
                     </view>
@@ -258,6 +266,7 @@
                         <outlet property="editUser" destination="dHA-PV-ECL" id="mAU-kL-bDw"/>
                         <outlet property="loginButton" destination="vvk-xp-NJf" id="8CI-V3-a6b"/>
                         <outlet property="mum" destination="wIj-4p-xEI" id="3zo-bA-MZw"/>
+                        <outlet property="verLabel" destination="NL1-l0-Yvv" id="TjJ-55-mT6"/>
                     </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="Dne-E0-wdc" sceneMemberID="firstResponder"/>

+ 3 - 23
Apex Mobile/Apex Mobile/RANetwork.m

@@ -1137,32 +1137,12 @@
         return RESULT_NET_NOTAVAILABLE;
     //    if(![RANetwork IsHostAvailable:URL_UPDATE_AUTH])
     //        return RESULT_NET_ERROR;
-    NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
-    __block long ver = 0;
-    NSString *auth_ver_key = [NSString stringWithFormat:@"%@_Auth_InfoVer",user];
-    if ([defaults objectForKey:auth_ver_key] != nil) {
-        
-        ver = [defaults integerForKey:auth_ver_key];
-        [defaults removeObjectForKey:auth_ver_key];
-        
-        NSString *sql = [NSString stringWithFormat:@"insert into auth_ver (ver) values (%ld);",ver];
-        [ApexMobileDB jk_excute:sql completion:nil];
-        
-    } else {
-        
-        NSString *sql = @"select ver from auth_ver;";
-        [ApexMobileDB jk_query:sql completion:^(sqlite3_stmt *stmt, long *count) {
-            
-            ver = sqlite3_column_int(stmt, 0);
-            
-        } failure:^(NSString *err_msg) {
-            ver = 0;
-        }];
-    }
+    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
     
+    long ver = appDelegate.authVer;
     
     NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
-    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
+    
     if(appDelegate.duid !=nil)
         [params setValue:appDelegate.duid forKey:@"udid"];
     [params setValue:@"handset_login" forKey:@"action"];

+ 1 - 1
Apex Mobile/Apex Mobile/SearchViewController.m

@@ -307,7 +307,7 @@
     
     if(buttonIndex!=alertView.cancelButtonIndex)
     {
-        
+        [self.view endEditing:YES];
         _adapter=[[SearchTableAdapter alloc] init];
         [_adapter initfields:_function_name];