Pārlūkot izejas kodu

添加地区选择

liuzhenxing1118 8 mēneši atpakaļ
vecāks
revīzija
c0271252ba

+ 0 - 4
artimenring-iOS/Artimenring/ARMacros.h

@@ -17,10 +17,6 @@
 #endif
 
 //====================== FUNCTION ======================//
-//使用手机号、邮箱登录
-#ifndef FUNCTION_EMAIL
-//#define FUNCTION_EMAIL
-#endif
 
 //加密
 #ifndef SK_FUNCTION_ENCRYPT

+ 13 - 8
artimenring-iOS/Artimenring/AppDelegate+login.m

@@ -11,15 +11,20 @@
 @implementation AppDelegate (login)
 
 + (void)checkLogin {
-    NSDictionary* loginData = [UserDataHelper getLastLoginInfo];
-    LogInModel* loginModel = [LogInModel mj_objectWithKeyValues:loginData];
-    
-    if(loginData && loginModel && loginModel.uid.length > 0 && [UserDataHelper hasLogin]) {
-        [DataManager shared].loginModel = loginModel;
-        [[DataManager shared] showTabBarController];
+    int area = [UserDataHelper getSelectArea];
+    if (area == -1) {
+        [[DataManager shared] showSKSelectAreaViewController];
     } else {
-        [DataManager shared].loginModel = nil;
-        [[DataManager shared] showSKLoginViewController];
+        NSDictionary* loginData = [UserDataHelper getLastLoginInfo];
+        LogInModel* loginModel = [LogInModel mj_objectWithKeyValues:loginData];
+        
+        if(loginData && loginModel && loginModel.uid.length > 0 && [UserDataHelper hasLogin]) {
+            [DataManager shared].loginModel = loginModel;
+            [[DataManager shared] showTabBarController];
+        } else {
+            [DataManager shared].loginModel = nil;
+            [[DataManager shared] showSKLoginViewController];
+        }
     }
 }
 

+ 70 - 5
artimenring-iOS/Artimenring/Base.lproj/Main.storyboard

@@ -4744,7 +4744,7 @@
         <!--Call Records View Controller-->
         <scene sceneID="aVx-gR-1LD">
             <objects>
-                <viewController storyboardIdentifier="CallRecordsVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="G9Y-Ih-vG0" customClass="CallRecordsViewController" customModule="VeryFit_Kids" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="CallRecordsVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="G9Y-Ih-vG0" customClass="CallRecordsViewController" customModule="SikeyComm" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="Rw1-nI-ztC">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -4754,7 +4754,7 @@
                                 <color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                 <color key="sectionIndexBackgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
                                 <prototypes>
-                                    <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="111" id="WNM-ij-n86" customClass="CallRecordsTableViewCell" customModule="VeryFit_Kids" customModuleProvider="target">
+                                    <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="cell" rowHeight="111" id="WNM-ij-n86" customClass="CallRecordsTableViewCell" customModule="SikeyComm" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="50" width="380" height="111"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WNM-ij-n86" id="hEg-Bo-TMa">
@@ -4885,7 +4885,7 @@
         <!--Fence List View Controller-->
         <scene sceneID="gqR-lj-TRU">
             <objects>
-                <viewController storyboardIdentifier="FenceListVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="sjp-gH-Bpi" customClass="SKFenceListViewController" customModule="VeryFit_Kids" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="FenceListVC" useStoryboardIdentifierAsRestorationIdentifier="YES" id="sjp-gH-Bpi" customClass="SKFenceListViewController" customModule="SikeyComm" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="ZIz-o2-1s8"/>
                         <viewControllerLayoutGuide type="bottom" id="Soj-t9-Pf4"/>
@@ -4899,7 +4899,7 @@
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                 <inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                 <prototypes>
-                                    <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="FenceListTableViewCell" rowHeight="78" id="kdC-Zg-hZg" customClass="FenceListTableViewCell" customModule="VeryFit_Kids" customModuleProvider="target">
+                                    <tableViewCell contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="FenceListTableViewCell" rowHeight="78" id="kdC-Zg-hZg" customClass="FenceListTableViewCell" customModule="SikeyComm" customModuleProvider="target">
                                         <rect key="frame" x="0.0" y="50" width="375" height="78"/>
                                         <autoresizingMask key="autoresizingMask"/>
                                         <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="kdC-Zg-hZg" id="aoF-V6-RDr">
@@ -5212,7 +5212,7 @@
         <!--Fence Map View Controller-->
         <scene sceneID="PdV-pI-dbt">
             <objects>
-                <viewController storyboardIdentifier="FenceMapVC" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="1Mc-zc-WVb" customClass="SKFenceMapViewController" customModule="VeryFit_Kids" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="FenceMapVC" automaticallyAdjustsScrollViewInsets="NO" useStoryboardIdentifierAsRestorationIdentifier="YES" id="1Mc-zc-WVb" customClass="SKFenceMapViewController" customModule="SikeyComm" customModuleProvider="target" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="neS-C7-ORs"/>
                         <viewControllerLayoutGuide type="bottom" id="bPd-D5-JCv"/>
@@ -9845,6 +9845,71 @@ If you still can't scan the code properly after inserting it correctly, please s
             </objects>
             <point key="canvasLocation" x="985" y="3188"/>
         </scene>
+        <!--Select Area View Controller-->
+        <scene sceneID="INs-zH-68x">
+            <objects>
+                <viewController storyboardIdentifier="SelectAreaVC" id="ZVn-bQ-u4X" customClass="SKSelectAreaViewController" sceneMemberID="viewController">
+                    <layoutGuides>
+                        <viewControllerLayoutGuide type="top" id="7Jw-jh-UV0"/>
+                        <viewControllerLayoutGuide type="bottom" id="cSc-xi-Chx"/>
+                    </layoutGuides>
+                    <view key="view" contentMode="scaleToFill" id="08A-Sp-v0a">
+                        <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="TU1-Cs-Hni">
+                                <rect key="frame" x="0.0" y="94" width="375" height="684"/>
+                                <color key="backgroundColor" red="0.97647058819999999" green="0.97647058819999999" blue="0.98823529409999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                <prototypes>
+                                    <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CountryCodeCellID" textLabel="x6z-yd-fiO" detailTextLabel="rxg-ct-v6z" rowHeight="64" style="IBUITableViewCellStyleValue1" id="opB-i7-zsP">
+                                        <rect key="frame" x="0.0" y="50" width="375" height="64"/>
+                                        <autoresizingMask key="autoresizingMask"/>
+                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="opB-i7-zsP" id="oEw-se-MCJ">
+                                            <rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
+                                            <autoresizingMask key="autoresizingMask"/>
+                                            <subviews>
+                                                <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="x6z-yd-fiO">
+                                                    <rect key="frame" x="16" y="22" width="33" height="20.333333333333332"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                                    <color key="textColor" red="0.0" green="0.0039215686269999999" blue="0.29411764709999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                                <label opaque="NO" multipleTouchEnabled="YES" contentMode="left" text="Detail" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rxg-ct-v6z">
+                                                    <rect key="frame" x="319.66666666666669" y="24" width="39.333333333333336" height="18"/>
+                                                    <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                                                    <fontDescription key="fontDescription" type="system" pointSize="15"/>
+                                                    <color key="textColor" red="0.0" green="0.0039215686269999999" blue="0.29411764709999999" alpha="0.59852139260000004" colorSpace="custom" customColorSpace="sRGB"/>
+                                                    <nil key="highlightedColor"/>
+                                                </label>
+                                            </subviews>
+                                        </tableViewCellContentView>
+                                    </tableViewCell>
+                                </prototypes>
+                                <connections>
+                                    <outlet property="dataSource" destination="ZVn-bQ-u4X" id="kyW-Fn-A9N"/>
+                                    <outlet property="delegate" destination="ZVn-bQ-u4X" id="TNF-eq-yxz"/>
+                                </connections>
+                            </tableView>
+                        </subviews>
+                        <viewLayoutGuide key="safeArea" id="BNK-I9-9Ur"/>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="TU1-Cs-Hni" firstAttribute="trailing" secondItem="08A-Sp-v0a" secondAttribute="trailing" id="2Ov-zD-tq1"/>
+                            <constraint firstItem="cSc-xi-Chx" firstAttribute="top" secondItem="TU1-Cs-Hni" secondAttribute="bottom" id="BQP-Mn-eke"/>
+                            <constraint firstAttribute="leading" secondItem="TU1-Cs-Hni" secondAttribute="leading" id="PQe-em-lpG"/>
+                            <constraint firstItem="TU1-Cs-Hni" firstAttribute="top" secondItem="7Jw-jh-UV0" secondAttribute="bottom" id="zeJ-Km-s4F"/>
+                        </constraints>
+                    </view>
+                    <simulatedNavigationBarMetrics key="simulatedTopBarMetrics" prompted="NO"/>
+                    <connections>
+                        <outlet property="tableview" destination="TU1-Cs-Hni" id="S6u-Lc-qPB"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="FY4-et-8pe" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="1207" y="486"/>
+        </scene>
     </scenes>
     <resources>
         <image name="Keep calling selected.png" width="62" height="62"/>

+ 1 - 1
artimenring-iOS/Artimenring/Classes/Data/DataManager.h

@@ -54,7 +54,7 @@ typedef enum BindOptions{
 /** 设置根控制器 */
 - (void)showTabBarController;
 - (void)showSKLoginViewController;
-- (void)showPhoneNumberViewController;
+- (void)showSKSelectAreaViewController;
 - (void)showBindViewController;
 - (BOOL)isRootTabBarController;
 

+ 3 - 2
artimenring-iOS/Artimenring/Classes/Data/DataManager.m

@@ -73,9 +73,10 @@
     [[[UIApplication sharedApplication] delegate].window setRootViewController:nav];
 }
 
-- (void)showPhoneNumberViewController {
+- (void)showSKSelectAreaViewController {
+    NSString* identifier = @"SelectAreaVC";
     UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
-    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"BindPhoneVC"];
+    UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:identifier];
     UINavigationController* nav = [[UINavigationController alloc] initWithRootViewController:vc];
     [[[UIApplication sharedApplication] delegate].window setRootViewController:nav];
 }

+ 4 - 2
artimenring-iOS/Artimenring/Classes/Util/UserDataHelper.h

@@ -46,7 +46,9 @@
 + (void)setPushToken:(NSString*)token;
 + (NSString*)getPushToken;
 
-+ (void)setCountryArea:(NSInteger)value;
-+ (int)getCountryArea;
+
+//0:大陆 1:除大陆外的所有国家和地区
++ (void)setSelectArea:(NSInteger)value;
++ (int)getSelectArea;
 
 @end

+ 7 - 8
artimenring-iOS/Artimenring/Classes/Util/UserDataHelper.m

@@ -22,7 +22,7 @@ static NSString* s_receivedVoiceNum = @"__receivedVoiceNum__";
 static NSString* s_lastUpdateVoiceDate = @"__lastUpdateVoiceDate";
 static NSString* s_lastSimulatorUserIdKey = @"__lastSimulatorUserIdKey__";
 static NSString* s_pushTokenKey = @"__pushTokenKey__";
-static NSString* s_countryAreaKey = @"__countryAreaKey__";
+static NSString* s_selectAreaKey = @"__selectAreaKey__";
 
 @implementation UserDataHelper
 
@@ -134,22 +134,21 @@ static NSString* s_countryAreaKey = @"__countryAreaKey__";
     return token;
 }
 
-+ (void)setCountryArea:(NSInteger)value {
++ (void)setSelectArea:(NSInteger)value {
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-    [userDefaults setObject:@(value) forKey:s_countryAreaKey];
+    [userDefaults setObject:@(value) forKey:s_selectAreaKey];
     [userDefaults synchronize];
 }
 
-+ (int)getCountryArea {
++ (int)getSelectArea {
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
-    id value = [userDefaults valueForKey:s_countryAreaKey];
+    id value = [userDefaults valueForKey:s_selectAreaKey];
     if(value == nil)
-        return 0;
+        return -1;
     return [value intValue];
 }
 
-+ (void)setLastLoginInfo:(NSDictionary*)loingInfo
-{
++ (void)setLastLoginInfo:(NSDictionary*)loingInfo {
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
     [userDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:loingInfo] forKey:s_lastLoginInfoKey];
     [userDefaults synchronize];

+ 1 - 4
artimenring-iOS/Artimenring/Classes/ViewController/Base/SKBaseAccountViewController+user.m

@@ -12,11 +12,10 @@
 
 - (void)requestRegister:(BOOL)isEmail areaCode:(NSString*)areaCode phone:(NSString*)phone email:(NSString*)email password:(NSString*)password captcha:(NSString*)captcha callback:(void(^)(BOOL isOK))callback {
     NSDictionary *params = @{
-        @"isEmail" : @(isEmail),
         @"email" : email,
+        @"areaCode" : areaCode,
         @"phoneNumber" : phone,
         @"password" :password,
-        @"areaCode" : areaCode,
         @"captcha" : captcha,
     };
     
@@ -35,9 +34,7 @@
 }
 
 - (void)requestLogin:(BOOL)isEmail areaCode:(NSString*)areaCode phone:(NSString*)phone email:(NSString*)email password:(NSString*)password captcha:(NSString*)captcha callback:(void(^)(BOOL isOK, BOOL isChildExist))callback {
-    
     NSDictionary *params = @{
-        @"isEmail" : @(isEmail),
         @"email" : email,
         @"phoneNumber" : phone,
         @"password" :password,

+ 8 - 9
artimenring-iOS/Artimenring/Classes/ViewController/Base/SKBaseAccountViewController.m

@@ -93,10 +93,8 @@
 
 //100:手机号码  200:邮箱
 - (void)initAccountType {
-    int type = 200;
-#ifndef FUNCTION_EMAIL
-    type = 100;
-#endif
+    int area = [UserDataHelper getSelectArea];
+    int type = area == 0 ? 100 : 200;
     
     NSInteger start = type;
     NSInteger end = start + 99;
@@ -219,11 +217,12 @@
 }
 
 - (BOOL)checkAccount {
-#ifndef FUNCTION_EMAIL
-    return [self checkPhoneAccount];
-#else
-    return [self checkEmailAccount];
-#endif
+    int area = [UserDataHelper getSelectArea];
+    if (area == 0) {
+        return [self checkPhoneAccount];
+    } else {
+        return [self checkEmailAccount];
+    }
 }
 
 - (BOOL)checkEmailAccount {

+ 6 - 5
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKEnterPassWordViewController.m

@@ -29,11 +29,12 @@
     if ([self checkAccountPasswordTextField] == NO)
         return;
     
-#ifndef FUNCTION_EMAIL
-    [self requstPhonePwd];
-#else
-    [self requstEmailPwd];
-#endif
+    int area = [UserDataHelper getSelectArea];
+    if (area == 0) {
+        [self requstPhonePwd];
+    } else {
+        [self requstEmailPwd];
+    }
 }
 
 #pragma mark - Requst

+ 10 - 9
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKForgetPassWordViewController.m

@@ -55,16 +55,17 @@
     if ([self checkAccount] == NO)
         return;
     
+    int area = [UserDataHelper getSelectArea];
     SKEnterPassWordViewController* controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"EnterPassWordVC"];
-#ifdef FUNCTION_EMAIL
-    controller.mAccount = self.mEmailNumTextField.text;
-    controller.mCaptcha = self.mEmailCaptchaLocalTextField.text;
-#else
-    NSString* areaCode = [self.mPhoneCountryLabel.text stringByReplacingOccurrencesOfString:@"+" withString:@""];
-    controller.mAreaCode = areaCode;
-    controller.mAccount = self.mPhoneNumTextField.text;
-    controller.mCaptcha = self.mPhoneCaptchaTextField.text;
-#endif
+    if (area == 0) {
+        NSString* areaCode = [self.mPhoneCountryLabel.text stringByReplacingOccurrencesOfString:@"+" withString:@""];
+        controller.mAreaCode = areaCode;
+        controller.mAccount = self.mPhoneNumTextField.text;
+        controller.mCaptcha = self.mPhoneCaptchaTextField.text;
+    } else {
+        controller.mAccount = self.mEmailNumTextField.text;
+        controller.mCaptcha = self.mEmailCaptchaLocalTextField.text;
+    }
     [self pushViewController:controller animated:YES];
 }
 

+ 1 - 0
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKLoginViewController+guide.m

@@ -17,6 +17,7 @@
 @implementation SKLoginViewController (guide)
 
 - (void)createGuideView {
+    return; //yama说去掉
     if([EUtil getShowGuideKey] != nil)
         return;
     [self.mGuideView setHidden:NO];

+ 6 - 5
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKLoginViewController.m

@@ -80,11 +80,12 @@
 }
 
 - (void)confirmActionEx {
-#ifndef FUNCTION_EMAIL
-    [self phoneLoginRequest];
-#else
-    [self emailLoginRequest];
-#endif
+    int area = [UserDataHelper getSelectArea];
+    if (area == 0) {
+        [self phoneLoginRequest];
+    } else {
+        [self emailLoginRequest];
+    }
 }
 
 @end

+ 6 - 5
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKRegisterViewController.m

@@ -65,11 +65,12 @@
 }
 
 - (void)confirmActionEx {
-#ifndef FUNCTION_EMAIL
-    [self phoneRegisterRequest];
-#else
-    [self showBindPhoneNumber:nil];
-#endif
+    int area = [UserDataHelper getSelectArea];
+    if (area == 0) {
+        [self phoneRegisterRequest];
+    } else {
+        [self showBindPhoneNumber:nil];
+    }
 }
 
 #pragma mark -

+ 13 - 0
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKSelectAreaViewController.h

@@ -0,0 +1,13 @@
+//
+//  CountryCodeViewController.h
+//  Artimenring
+//
+//  Created by YangJianguo on 6/14/15.
+//  Copyright (c) 2015 BaH Cy. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SKSelectAreaViewController : SKBaseViewController
+
+@end

+ 91 - 0
artimenring-iOS/Artimenring/Classes/ViewController/Login/SKSelectAreaViewController.m

@@ -0,0 +1,91 @@
+//
+//  CountryCodeViewController.m
+//  Artimenring
+//
+//  Created
+//  Copyright (c) 2015 BaH Cy. All rights reserved.
+//
+
+#import "SKSelectAreaViewController.h"
+
+#define COUNTRY_CODE @"code"
+#define COUNTRY_EN @"en"
+#define COUNTRY_ZH @"zh"
+
+@interface SKSelectAreaViewController ()<UITableViewDataSource, UITableViewDelegate> {
+    NSMutableArray* mCodeArray;
+    NSString* mLanguageKey;
+}
+
+@property (nonatomic, weak) IBOutlet UITableView *tableview;
+@end
+
+@implementation SKSelectAreaViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    //获取当前设备语言
+    NSArray *appLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
+    NSString *languageName = [appLanguages objectAtIndex:0];
+    if ([languageName isStartWithString:COUNTRY_ZH])
+        mLanguageKey = COUNTRY_ZH;
+    else
+        mLanguageKey = COUNTRY_EN;
+    
+    mCodeArray = [NSMutableArray new];
+    mCodeArray = [EUtil getCountryCodeArray];
+}
+
+- (void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:NO];
+    self.title = NSLocalizedString(@"CountryC.Title", nil);
+}
+
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    self.title = @"";
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    return mCodeArray.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
+    static NSString *cellID = @"CountryCodeCellID";
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath];
+    if(cell == nil) {
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellID];
+    }
+    
+    NSMutableDictionary* dic = mCodeArray[indexPath.row];
+    cell.textLabel.text = [dic[mLanguageKey] description];
+    cell.detailTextLabel.text = [NSString stringWithFormat:@"+%@",[dic[COUNTRY_CODE] description]];
+    cell.accessoryType = UITableViewCellAccessoryNone;
+    return cell;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
+    [self.tableview deselectRowAtIndexPath:indexPath animated:YES];
+    NSMutableDictionary* dic = mCodeArray[indexPath.row];
+    NSString* code = [NSString stringWithFormat:@"%@",[dic[COUNTRY_CODE] description]];
+    [self setSelectArea:code];
+    [[DataManager shared] showSKLoginViewController];
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
+    return 50;
+}
+
+- (void)setSelectArea:(NSString*)code {
+    //0:大陆 1:除大陆外的所有国家和地区
+    if ([code isEqualToString:@"86"] || [code isEqualToString:@"+86"]) {
+        [UserDataHelper setSelectArea:0];
+    } else {
+        [UserDataHelper setSelectArea:1];
+    }
+}
+
+@end

+ 12 - 6
artimenring-iOS/SikeyComm.xcodeproj/project.pbxproj

@@ -300,6 +300,7 @@
 		E4A1B5AB2B707F3800E19B22 /* SKForgetPassWordViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A1B5AA2B707F3800E19B22 /* SKForgetPassWordViewController.m */; };
 		E4A44AEB2D228B8900FCB559 /* SKNavigationView.m in Sources */ = {isa = PBXBuildFile; fileRef = E4A44AEA2D228B8900FCB559 /* SKNavigationView.m */; };
 		E4B054602D2BBE560047C60A /* launch_sk_1.png in Resources */ = {isa = PBXBuildFile; fileRef = E4B0545F2D2BBE560047C60A /* launch_sk_1.png */; };
+		E4B054632D2CBFF00047C60A /* SKSelectAreaViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B054622D2CBFF00047C60A /* SKSelectAreaViewController.m */; };
 		E4B112192B9AFDBA00F48C90 /* SKBabyListCellViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B112152B9AFDBA00F48C90 /* SKBabyListCellViewCell.m */; };
 		E4B1121A2B9AFDBA00F48C90 /* SKBabyListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B112172B9AFDBA00F48C90 /* SKBabyListViewController.m */; };
 		E4B1121F2B9B213200F48C90 /* SKRelationViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E4B1121B2B9B213200F48C90 /* SKRelationViewController.m */; };
@@ -948,6 +949,8 @@
 		E4B0545A2D2BB75A0047C60A /* zh-HK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-HK"; path = "zh-HK.lproj/Main.strings"; sourceTree = "<group>"; };
 		E4B0545E2D2BBACA0047C60A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Main.strings"; sourceTree = "<group>"; };
 		E4B0545F2D2BBE560047C60A /* launch_sk_1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = launch_sk_1.png; sourceTree = "<group>"; };
+		E4B054612D2CBFF00047C60A /* SKSelectAreaViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKSelectAreaViewController.h; sourceTree = "<group>"; };
+		E4B054622D2CBFF00047C60A /* SKSelectAreaViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKSelectAreaViewController.m; sourceTree = "<group>"; };
 		E4B112152B9AFDBA00F48C90 /* SKBabyListCellViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKBabyListCellViewCell.m; sourceTree = "<group>"; };
 		E4B112162B9AFDBA00F48C90 /* SKBabyListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SKBabyListViewController.h; sourceTree = "<group>"; };
 		E4B112172B9AFDBA00F48C90 /* SKBabyListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SKBabyListViewController.m; sourceTree = "<group>"; };
@@ -1670,18 +1673,20 @@
 				E4A1B5AA2B707F3800E19B22 /* SKForgetPassWordViewController.m */,
 				27D7A7532146733200FCDCF6 /* SKLiscenseViewController.h */,
 				27D7A74D2146733200FCDCF6 /* SKLiscenseViewController.m */,
-				27D7A7502146733200FCDCF6 /* SKModifyPasswordViewController.h */,
-				27D7A7492146733200FCDCF6 /* SKModifyPasswordViewController.m */,
-				27D2E7FC21C26D7A00D88158 /* SKPrivacyPolicyViewController.h */,
-				27D2E7FD21C26D7A00D88158 /* SKPrivacyPolicyViewController.m */,
-				E483C5A12B8F0D1F00EBF8AC /* SKRegisterViewController.h */,
-				E483C5A02B8F0D1F00EBF8AC /* SKRegisterViewController.m */,
 				E41ECBA12CF95EAF00C4C36C /* SKLoginViewController.h */,
 				E41ECBA42CF95EAF00C4C36C /* SKLoginViewController.m */,
 				E41ECBA32CF95EAF00C4C36C /* SKLoginViewController+guide.h */,
 				E41ECBA52CF95EAF00C4C36C /* SKLoginViewController+guide.m */,
 				E41ECBA22CF95EAF00C4C36C /* SKLoginViewController+thirdparty.h */,
 				E41ECBA62CF95EAF00C4C36C /* SKLoginViewController+thirdparty.m */,
+				27D7A7502146733200FCDCF6 /* SKModifyPasswordViewController.h */,
+				27D7A7492146733200FCDCF6 /* SKModifyPasswordViewController.m */,
+				27D2E7FC21C26D7A00D88158 /* SKPrivacyPolicyViewController.h */,
+				27D2E7FD21C26D7A00D88158 /* SKPrivacyPolicyViewController.m */,
+				E483C5A12B8F0D1F00EBF8AC /* SKRegisterViewController.h */,
+				E483C5A02B8F0D1F00EBF8AC /* SKRegisterViewController.m */,
+				E4B054612D2CBFF00047C60A /* SKSelectAreaViewController.h */,
+				E4B054622D2CBFF00047C60A /* SKSelectAreaViewController.m */,
 			);
 			path = Login;
 			sourceTree = "<group>";
@@ -2898,6 +2903,7 @@
 				E43714722B4D50D2003CA842 /* DataManager+delegate.m in Sources */,
 				27CF315E2003048B008600C2 /* SKFenceDetailViewController.m in Sources */,
 				27E011CA202AA01900F1F22E /* SKBabyQRCodeViewController.m in Sources */,
+				E4B054632D2CBFF00047C60A /* SKSelectAreaViewController.m in Sources */,
 				E4B112362B9B269900F48C90 /* EBaseTableViewCell.m in Sources */,
 				273E818C2074A2D0006FAAB6 /* UITableViewCell+accessory.m in Sources */,
 				E4FE9B922AD9465100DEABCA /* PDTSimpleCalendarViewWeekdayHeader.m in Sources */,