浏览代码

修改sort图标,定制sort按钮

Pen Li 9 年之前
父节点
当前提交
36d7f1139d
共有 50 个文件被更改,包括 515 次插入28 次删除
  1. 二进制
      RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate
  2. 51 6
      RedAnt ERP Mobile/common/Functions/cart/CartViewController.m
  3. 50 5
      RedAnt ERP Mobile/common/Functions/portfolio/PortfolioViewController.m
  4. 54 16
      RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m
  5. 6 0
      RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj
  6. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/Contents.json
  7. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18.png
  8. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18@2x.png
  9. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18@3x.png
  10. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/Contents.json
  11. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22.png
  12. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22@2x.png
  13. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22@3x.png
  14. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/Contents.json
  15. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18.png
  16. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18@2x.png
  17. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18@3x.png
  18. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/Contents.json
  19. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22.png
  20. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22@2x.png
  21. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22@3x.png
  22. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/Contents.json
  23. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18.png
  24. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18@2x.png
  25. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18@3x.png
  26. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/Contents.json
  27. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22.png
  28. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22@2x.png
  29. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22@3x.png
  30. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/Contents.json
  31. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18.png
  32. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18@2x.png
  33. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18@3x.png
  34. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/Contents.json
  35. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22.png
  36. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22@2x.png
  37. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22@3x.png
  38. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/Contents.json
  39. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18.png
  40. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18@2x.png
  41. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18@3x.png
  42. 23 0
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/Contents.json
  43. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22.png
  44. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22@2x.png
  45. 二进制
      RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22@3x.png
  46. 19 0
      RedAnt ERP Mobile/iSales-NPD/SortButton.h
  47. 66 0
      RedAnt ERP Mobile/iSales-NPD/SortButton.m
  48. 2 0
      RedAnt ERP Mobile/iSales-NPD/SortItemCell.h
  49. 34 1
      RedAnt ERP Mobile/iSales-NPD/SortItemCell.m
  50. 3 0
      RedAnt ERP Mobile/iSales-NPD/SortItemViewController.m

二进制
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 51 - 6
RedAnt ERP Mobile/common/Functions/cart/CartViewController.m

@@ -23,7 +23,7 @@
 #import "DefaultAppearance.h"
 #import "DefaultTableHeaderView.h"
 #import "SortItemViewController.h"
-
+#import "SortButton.h"
 
 #define ALERT_FREE 1024
 #define ALERT_DEL 1025
@@ -34,6 +34,7 @@
 
 @property (nonatomic,strong) SortItemViewController *sortItemController;
 @property (nonatomic,assign) int sortIndex;
+@property (nonatomic,strong) SortButton *sortButton;
 
 @end
 
@@ -1285,11 +1286,11 @@
     myView.layer.shadowOpacity = 0.5;
     myView.layer.shadowRadius = 2.0;
     
-    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    sortButton.frame = CGRectMake(10, 5.5, (40 - 5.5 * 2), (40 - 5.5 * 2));
-    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
-    [sortButton addTarget:self action:@selector(cartSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [myView addSubview:sortButton];
+//    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
+//    sortButton.frame = CGRectMake(10, 5.5, (40 - 5.5 * 2), (40 - 5.5 * 2));
+//    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
+//    [sortButton addTarget:self action:@selector(cartSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    [myView addSubview:self.sortButton];
     
     UILabel *solabel = [[UILabel alloc] initWithFrame:CGRectMake(130, 5.5, 90, 22)];
     solabel.textColor=UIColorFromRGB(color);
@@ -2465,5 +2466,49 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     return _sortItemController;
 }
 
+- (SortButton *)sortButton {
+    if (!_sortButton) {
+        _sortButton = [SortButton sortButtonWithHeight:40];
+        
+        [_sortButton addTarget:self action:@selector(cartSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _sortButton;
+}
+
+- (void)setSortIndex:(int)sortIndex {
+    _sortIndex = sortIndex;
+    
+    NSString *selectedImageName = @"";
+    switch (sortIndex) {
+        case 0:{
+            selectedImageName = @"TX_22";
+        }
+            break;
+        case 1:{
+            selectedImageName = @"TS_22";
+        }
+            break;
+        case 2:{
+            selectedImageName = @"IX_22";
+        }
+            break;
+        case 3:{
+            selectedImageName = @"IS_22";
+        }
+            break;
+        case 4:{
+            selectedImageName = @"DX_22";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    
+    self.sortButton.imageView.image = [UIImage imageNamed:selectedImageName];
+    
+}
+
+
 
 @end

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

@@ -22,6 +22,7 @@
 #import "DefaultTableHeaderView.h"
 #import "DefaultAppearance.h"
 #import "SortItemViewController.h"
+#import "SortButton.h"
 
 #define ALERT_DEL 1025
 #define checked_Count @"checkedCount"
@@ -29,6 +30,7 @@
 
 @property (nonatomic,strong) SortItemViewController *sortItemController;
 @property (nonatomic,assign) int sortIndex;
+@property (nonatomic,strong) SortButton *sortButton;
 
 @end
 
@@ -978,11 +980,11 @@
     
     DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 33)];
     
-    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
-    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
-    [sortButton addTarget:self action:@selector(portfolioSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [myView addSubview:sortButton];
+//    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
+//    sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
+//    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
+//    [sortButton addTarget:self action:@selector(portfolioSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    [myView addSubview:self.sortButton];
     
     
     UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5.5, tableView.bounds.size.width, 22)];
@@ -1607,6 +1609,49 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     [self.view addSubview:self.sortItemController.view];
 }
 
+- (SortButton *)sortButton {
+    if (!_sortButton) {
+        _sortButton = [SortButton sortButtonWithHeight:33];
+        
+        [_sortButton addTarget:self action:@selector(portfolioSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _sortButton;
+}
+
+- (void)setSortIndex:(int)sortIndex {
+    _sortIndex = sortIndex;
+    
+    NSString *selectedImageName = @"";
+    switch (sortIndex) {
+        case 0:{
+            selectedImageName = @"TX_22";
+        }
+            break;
+        case 1:{
+            selectedImageName = @"TS_22";
+        }
+            break;
+        case 2:{
+            selectedImageName = @"IX_22";
+        }
+            break;
+        case 3:{
+            selectedImageName = @"IS_22";
+        }
+            break;
+        case 4:{
+            selectedImageName = @"DX_22";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    
+    self.sortButton.imageView.image = [UIImage imageNamed:selectedImageName];
+    
+}
+
 
 
 @end

+ 54 - 16
RedAnt ERP Mobile/common/Functions/watchlist/WatchListViewController.m

@@ -19,6 +19,7 @@
 #import "DefaultTableHeaderView.h"
 #import "DefaultAppearance.h"
 #import "SortItemViewController.h"
+#import "SortButton.h"
 
 #define ALERT_DEL 1025
 //#import "PDFViewController.h"
@@ -26,6 +27,7 @@
 
 @property (nonatomic,strong) SortItemViewController *sortItemController;
 @property (nonatomic,assign) int sortIndex;
+@property (nonatomic,strong) SortButton *sortButton;
 
 @end
 
@@ -674,11 +676,12 @@
     
     DefaultTableHeaderView* myView = [[DefaultTableHeaderView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 33)];
 
-    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
-    sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
-    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
-    [sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
-    [myView addSubview:sortButton];
+//    UIButton *sortButton = [UIButton buttonWithType:UIButtonTypeCustom];
+//    sortButton.frame = CGRectMake(20, 5.5, (33 - 5.5 * 2), (33 - 5.5 * 2));
+//    [sortButton setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateNormal];
+//    [sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+//    [myView addSubview:sortButton];
+    [myView addSubview:self.sortButton];
     
     
     UILabel *titlelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 5.5, tableView.bounds.size.width, 22)];
@@ -1115,17 +1118,6 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
 }
 
 
-/*
- #pragma mark - Navigation
- 
- // In a storyboard-based application, you will often want to do a little preparation before navigation
- - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
- {
- // Get the new view controller using [segue destinationViewController].
- // Pass the selected object to the new view controller.
- }
- */
-
 - (SortItemViewController *)sortItemController {
     if (!_sortItemController) {
         _sortItemController = [[SortItemViewController alloc] initWithTableOrigin:CGPointMake(40, 40)];
@@ -1136,6 +1128,7 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
             weakSelf.sortIndex = sort;
 
             [weakSelf reload_data];
+
         };
 
     }
@@ -1144,4 +1137,49 @@ commitEditingStyle:(UITableViewCellEditingStyle)editingStyle  forRowAtIndexPath:
     return _sortItemController;
 }
 
+- (SortButton *)sortButton {
+    if (!_sortButton) {
+        _sortButton = [SortButton sortButtonWithHeight:33];
+        
+        [_sortButton addTarget:self action:@selector(wishlistSortButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    }
+    return _sortButton;
+}
+
+- (void)setSortIndex:(int)sortIndex {
+    _sortIndex = sortIndex;
+    
+    NSString *selectedImageName = @"";
+    switch (sortIndex) {
+        case 0:{
+            selectedImageName = @"TX_22";
+        }
+            break;
+        case 1:{
+            selectedImageName = @"TS_22";
+        }
+            break;
+        case 2:{
+            selectedImageName = @"IX_22";
+        }
+            break;
+        case 3:{
+            selectedImageName = @"IS_22";
+        }
+            break;
+        case 4:{
+            selectedImageName = @"DX_22";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    
+    self.sortButton.imageView.image = [UIImage imageNamed:selectedImageName];
+    
+}
+
+
+
 @end

+ 6 - 0
RedAnt ERP Mobile/iSales-NPD.xcodeproj/project.pbxproj

@@ -17,6 +17,7 @@
 		42B99E161D7D052A00E773CD /* SortItemCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42B99E151D7D052A00E773CD /* SortItemCell.m */; };
 		42C9FB151D5B28FA001DCA8B /* contactAdvanceSearch.json in Resources */ = {isa = PBXBuildFile; fileRef = 42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */; };
 		42DC31131D546FBE00BCD1C6 /* category.json in Resources */ = {isa = PBXBuildFile; fileRef = 42DC31121D546FBE00BCD1C6 /* category.json */; };
+		42E58BFB1D7E5EF50092810A /* SortButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 42E58BFA1D7E5EF50092810A /* SortButton.m */; };
 		710274251CC606C4009FD219 /* UserListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 710274241CC606C4009FD219 /* UserListViewController.m */; };
 		7111E5721C76C557004763B3 /* customer_info_template_edit.json in Resources */ = {isa = PBXBuildFile; fileRef = 7111E5711C76C557004763B3 /* customer_info_template_edit.json */; };
 		71131F921CA1372300DBF6E2 /* SimplifiedBuyingProgramViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 71131F911CA1372300DBF6E2 /* SimplifiedBuyingProgramViewController.m */; };
@@ -214,6 +215,8 @@
 		42B99E151D7D052A00E773CD /* SortItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SortItemCell.m; sourceTree = "<group>"; };
 		42C9FB141D5B28FA001DCA8B /* contactAdvanceSearch.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contactAdvanceSearch.json; sourceTree = "<group>"; };
 		42DC31121D546FBE00BCD1C6 /* category.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = category.json; sourceTree = "<group>"; };
+		42E58BF91D7E5EF50092810A /* SortButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SortButton.h; sourceTree = "<group>"; };
+		42E58BFA1D7E5EF50092810A /* SortButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SortButton.m; sourceTree = "<group>"; };
 		56528CA8B8A71F67C2EE5366 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
 		6C826876B24EFB83AC94A464 /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
 		710274231CC606C4009FD219 /* UserListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserListViewController.h; path = common/Functions/sidemenu/UserListViewController.h; sourceTree = SOURCE_ROOT; };
@@ -1168,6 +1171,8 @@
 				42B99E121D7D032300E773CD /* SortItemViewController.m */,
 				42B99E141D7D052A00E773CD /* SortItemCell.h */,
 				42B99E151D7D052A00E773CD /* SortItemCell.m */,
+				42E58BF91D7E5EF50092810A /* SortButton.h */,
+				42E58BFA1D7E5EF50092810A /* SortButton.m */,
 			);
 			name = CommonUI;
 			sourceTree = "<group>";
@@ -1424,6 +1429,7 @@
 				71DF74661C575E7900F2789C /* DatePickerViewController.m in Sources */,
 				71DF74831C57608F00F2789C /* ImageScrollerView.m in Sources */,
 				71DF74871C57608F00F2789C /* NIDropDown.m in Sources */,
+				42E58BFB1D7E5EF50092810A /* SortButton.m in Sources */,
 				710274251CC606C4009FD219 /* UserListViewController.m in Sources */,
 				71DF74881C57608F00F2789C /* PulldownMenu.m in Sources */,
 				7141DD551C57459B00F7DF59 /* split.c in Sources */,

+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "DX_18.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "DX_18@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "DX_18@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_18.imageset/DX_18@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "DX_22.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "DX_22@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "DX_22@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/DX_22.imageset/DX_22@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "IS_18.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IS_18@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IS_18@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_18.imageset/IS_18@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "IS_22.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IS_22@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IS_22@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IS_22.imageset/IS_22@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "IX_18.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IX_18@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IX_18@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_18.imageset/IX_18@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "IX_22.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IX_22@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "IX_22@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/IX_22.imageset/IX_22@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "TS_18.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TS_18@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TS_18@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_18.imageset/TS_18@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "TS_22.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TS_22@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TS_22@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TS_22.imageset/TS_22@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "TX_18.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TX_18@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TX_18@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_18.imageset/TX_18@3x.png


+ 23 - 0
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "TX_22.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TX_22@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "TX_22@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22@2x.png


二进制
RedAnt ERP Mobile/iSales-NPD/Images.xcassets/TX_22.imageset/TX_22@3x.png


+ 19 - 0
RedAnt ERP Mobile/iSales-NPD/SortButton.h

@@ -0,0 +1,19 @@
+//
+//  SortButton.h
+//  iSales-NPD
+//
+//  Created by Jack on 16/9/6.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface SortButton : UIControl
+
+@property (nonatomic,strong) UILabel *titleLabel;
+
+@property (nonatomic,strong) UIImageView *imageView;
+
++ (SortButton*)sortButtonWithHeight:(CGFloat)height;
+
+@end

+ 66 - 0
RedAnt ERP Mobile/iSales-NPD/SortButton.m

@@ -0,0 +1,66 @@
+//
+//  SortButton.m
+//  iSales-NPD
+//
+//  Created by Jack on 16/9/6.
+//  Copyright © 2016年 United Software Applications, Inc. All rights reserved.
+//
+
+#import "SortButton.h"
+
+@implementation SortButton
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        [self addSubview:self.titleLabel];
+        [self addSubview:self.imageView];
+    }
+    return self;
+}
+
++ (SortButton*)sortButtonWithHeight:(CGFloat)height {
+    SortButton *btn = [[SortButton alloc] initWithFrame:CGRectMake(10, 0, 85, height)];
+    
+    return btn;
+}
+
+- (UILabel *)titleLabel {
+    if (!_titleLabel) {
+        CGSize size = [self string:@"sort by" sizeWithSize:CGSizeMake(60, 22) font:[UIFont systemFontOfSize:17]];
+        CGFloat h = CGRectGetHeight(self.bounds);
+        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, (h - size.height) / 2, size.width, size.height)];
+        _titleLabel.font = [UIFont systemFontOfSize:17];
+        _titleLabel.textColor = [UIColor blackColor];
+        _titleLabel.text = @"Sort By";
+        [_titleLabel sizeToFit];
+        
+    }
+    return _titleLabel;
+}
+
+- (UIImageView *)imageView {
+    if (!_imageView) {
+        CGFloat h = CGRectGetHeight(self.bounds);
+        CGFloat x = CGRectGetMaxX(self.titleLabel.frame) + 5;
+        CGFloat y = (h - 22) / 2;
+        
+        _imageView = [[UIImageView alloc] initWithFrame:CGRectMake(x, y, 22, 22)];
+        _imageView.image = [UIImage imageNamed:@"DX_22"];
+        
+        _imageView.userInteractionEnabled = YES;
+    }
+    return _imageView;
+}
+
+-(CGSize)string:(NSString *)string sizeWithSize:(CGSize)size font:(UIFont *)font{
+    NSDictionary *attribute = @{NSFontAttributeName: font};
+    
+    CGSize resSize = [string boundingRectWithSize:size
+                                        options:(NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading)
+                                     attributes:attribute
+                                        context:nil].size;
+    
+    return resSize;
+}
+
+@end

+ 2 - 0
RedAnt ERP Mobile/iSales-NPD/SortItemCell.h

@@ -18,4 +18,6 @@
 
 @property (nonatomic,assign) BOOL selectedSort;
 
+@property (nonatomic,assign) NSInteger sortIndex;
+
 @end

+ 34 - 1
RedAnt ERP Mobile/iSales-NPD/SortItemCell.m

@@ -66,7 +66,7 @@
 
         CGFloat h = CGRectGetHeight(self.bounds);
         _selectedView = [[UIButton alloc] initWithFrame:CGRectMake(10, (h - 18) / 2, 18, 18)];
-        [_selectedView setImage:[UIImage imageNamed:@"check_1_24"] forState:UIControlStateSelected];
+        
         _selectedView.userInteractionEnabled = NO;
     }
     return _selectedView;
@@ -81,8 +81,41 @@
 
 - (void)setSelectedSort:(BOOL)selectedSort {
     _selectedSort = selectedSort;
+
     self.selectedView.selected = selectedSort;
 }
 
+- (void)setSortIndex:(NSInteger)sortIndex {
+    _sortIndex = sortIndex;
+    
+    NSString *selectedImageName = @"";
+    switch (sortIndex) {
+        case 0:{
+            selectedImageName = @"TX_18";
+        }
+            break;
+        case 1:{
+            selectedImageName = @"TS_18";
+        }
+            break;
+        case 2:{
+            selectedImageName = @"IX_18";
+        }
+            break;
+        case 3:{
+            selectedImageName = @"IS_18";
+        }
+            break;
+        case 4:{
+            selectedImageName = @"DX_18";
+        }
+            break;
+            
+        default:
+            break;
+    }
+    [self.selectedView setImage:[UIImage imageNamed:selectedImageName] forState:UIControlStateSelected];
+}
+
 
 @end

+ 3 - 0
RedAnt ERP Mobile/iSales-NPD/SortItemViewController.m

@@ -44,6 +44,8 @@
     // Dispose of any resources that can be recreated.
 }
 
+#pragma mark - view
+
 - (UIView *)tableBackgroundView {
     if (!_tableBackgroundView) {
         
@@ -108,6 +110,7 @@
         default:
             break;
     }
+    cell.sortIndex = indexPath.row;
     
     if (self.sortIndex == indexPath.row) {
         cell.selectedSort = YES;