Quellcode durchsuchen

- 전화번호 출력시 중간번호 별표 표시 로직 추

KaRam Kim vor 8 Jahren
Ursprung
Commit
c6c14aa571

+ 2 - 2
OneCable/Base.lproj/Main.storyboard

@@ -5987,7 +5987,7 @@
                                                 <rect key="frame" x="0.0" y="28" width="320" height="151"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="OiY-nb-fUX" id="u2m-Xz-g6m">
-                                                    <rect key="frame" x="0.0" y="0.0" width="320" height="150"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="320" height="151"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="6Qt-zh-SIL" userLabel="View - cell">
@@ -6458,7 +6458,7 @@
                                                 <rect key="frame" x="0.0" y="22" width="320" height="82"/>
                                                 <autoresizingMask key="autoresizingMask"/>
                                                 <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="rnB-by-AAV" id="OYL-xo-VJL">
-                                                    <rect key="frame" x="0.0" y="0.0" width="320" height="81"/>
+                                                    <rect key="frame" x="0.0" y="0.0" width="320" height="82"/>
                                                     <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="HJD-h4-u7i" userLabel="View - Cell">

+ 3 - 0
OneCable/Classes/Util/CommonUtil.h

@@ -194,6 +194,7 @@ typedef enum {
 + (NSString *)currencyString2:(NSInteger)number;
 
 + (NSString *)svcNoString:(NSString *)svcNo;
++ (NSString *)telNoString:(NSString *)telNo;
 + (NSString *)cutSaName:(NSString *)saName;
 + (NSInteger)getIntegerFromCurrency:(NSString *)currency;
 
@@ -202,6 +203,8 @@ typedef enum {
 
 + (NSInteger)countForOccurrencesOfString:(NSString *)occurString;
 
+
+
 #pragma mark - TimeUtil
 + (NSString *)formattedTime:(NSString *)timeString;
 + (NSString *)formattedTime2:(NSString *)timeString;

+ 32 - 2
OneCable/Classes/Util/CommonUtil.m

@@ -16,6 +16,7 @@
 #import "SortDictionary.h"
 
 #import "UIDeviceUtil.h"
+#import "NSString-Addtions.h"
 
 #define ksEmptyString @""
 
@@ -982,6 +983,33 @@
     return tmpSvcNo;
 }
 
++ (NSString *)telNoString:(NSString *)telNo
+{
+    NSArray *tmp = [telNo explode:@"-"];
+    
+    NSString *result = @"";
+    
+    int i = 0;
+    for (NSString *tmpStr in tmp) {
+        if (i) {
+            if (i == 1) {
+                NSString *strAsteric = @"";
+                for (int k = 0; k < [tmpStr length]; k++) {
+                    strAsteric = [strAsteric stringByAppendingString:@"*"];
+                }
+                result = [NSString stringWithFormat:@"%@-%@", result, strAsteric];
+            } else {
+                result = [NSString stringWithFormat:@"%@-%@", result, tmpStr];
+            }
+            
+        } else {
+            result = tmpStr;
+        }
+        i++;
+    }
+    return result;
+}
+
 
 + (NSString *)cutSaName:(NSString *)saName {
     NSRange range = [saName rangeOfString:@"]"];
@@ -1009,7 +1037,8 @@
 
 + (NSString *)formattedPhoneNumber:(NSString *)phoneNumber {
     if ([phoneNumber rangeOfString:@"-"].location != NSNotFound) {//이미 포맷에 맞춰진 경우는 리턴
-        return phoneNumber;
+//        return phoneNumber;
+        return [CommonUtil telNoString:phoneNumber];
     }
     
     NSMutableString *rString = [NSMutableString stringWithString:phoneNumber];
@@ -1018,7 +1047,8 @@
     [rString insertString:@"-" atIndex:3];
     [rString insertString:@"-" atIndex:lastIndex];
     
-    return rString;
+//    return rString;
+    return [CommonUtil telNoString:rString];
 }
 
 + (NSString *)formattedIAId:(NSString *)iaId {

+ 5 - 3
OneCable/Classes/ViewControllers/MainScreens/HomeModeSettingsViewController.m

@@ -70,11 +70,13 @@
 
 - (void)requestDeviceListForHome {
     //parameters
-    NSDictionary *parameter = @{@"item_type_code": ksItemTypeCodeAction};
+//    NSDictionary *parameter = @{@"item_type_code": ksItemTypeCodeAction};
     
-    NSString *path = [NSString stringWithFormat:API_GET_ITEM_DEVICES, ksItemTypeCodeAction];
+    NSArray *arr = @[ksItemTypeCodeAction];
+    //    NSString *path = [NSString stringWithFormat:API_GET_ITEM_DEVICES, ksItemTypeCodeAction];
+    NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_GET_ITEM_DEVICES arguments:arr];
     
-    [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:parameter modelClass:[ItemListModel class] completion:^(id responseObject) {
+    [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[ItemListModel class] completion:^(id responseObject) {
         if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
             return;
         }