jikaipeng 5 年之前
父節點
當前提交
9fc01c7143
共有 27 個文件被更改,包括 1191 次插入3 次删除
  1. 110 0
      KuDianProject.xcodeproj/project.pbxproj
  2. 1 1
      KuDianProject.xcodeproj/xcuserdata/kaipeng.xcuserdatad/xcschemes/xcschememanagement.plist
  3. 二進制
      KuDianProject.xcworkspace/xcuserdata/kaipeng.xcuserdatad/UserInterfaceState.xcuserstate
  4. 二進制
      KuDianProject/.DS_Store
  5. 6 0
      KuDianProject/LiveData/Controller/KDPLiveLeftViewController.m
  6. 17 0
      KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.h
  7. 143 0
      KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.m
  8. 17 0
      KuDianProject/LiveData/Controller/KDPOrderDetailViewController.h
  9. 65 0
      KuDianProject/LiveData/Controller/KDPOrderDetailViewController.m
  10. 二進制
      KuDianProject/Search/.DS_Store
  11. 二進制
      KuDianProject/Search/Controller/.DS_Store
  12. 19 0
      KuDianProject/Search/Controller/KDPSearchResultViewController.h
  13. 42 0
      KuDianProject/Search/Controller/KDPSearchResultViewController.m
  14. 19 0
      KuDianProject/Search/Controller/KDPSearchViewController.h
  15. 267 0
      KuDianProject/Search/Controller/KDPSearchViewController.m
  16. 17 0
      KuDianProject/Search/Controller/View/KDPSearchResuCollectionViewCell.h
  17. 20 0
      KuDianProject/Search/Controller/View/KDPSearchResuCollectionViewCell.m
  18. 40 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlow.h
  19. 156 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlow.m
  20. 18 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowCell.h
  21. 51 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowCell.m
  22. 27 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowConfig.h
  23. 44 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowConfig.m
  24. 30 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowLayout.h
  25. 78 0
      KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowLayout.m
  26. 3 1
      KuDianProject/SupplyGood/Controller/KDPSupplyGoodViewController.m
  27. 1 1
      Pods/Pods.xcodeproj/xcuserdata/kaipeng.xcuserdatad/xcschemes/xcschememanagement.plist

+ 110 - 0
KuDianProject.xcodeproj/project.pbxproj

@@ -31,6 +31,15 @@
31 31
 		764A24F822D4A39B009B3891 /* XLPageViewControllerUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = 764A24F122D4A39B009B3891 /* XLPageViewControllerUtil.m */; };
32 32
 		76D6EE7122D4A7A100E7AC1C /* KDPTabBarVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE6F22D4A7A100E7AC1C /* KDPTabBarVC.m */; };
33 33
 		76D6EE7422D4A7D600E7AC1C /* KDPSupplyContentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE7322D4A7D600E7AC1C /* KDPSupplyContentViewController.m */; };
34
+		76D6EE7722D4AA7D00E7AC1C /* KDPOrderDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE7622D4AA7D00E7AC1C /* KDPOrderDetailViewController.m */; };
35
+		76D6EE7A22D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE7922D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.m */; };
36
+		76D6EE8122D587D300E7AC1C /* KDPSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE8022D587D300E7AC1C /* KDPSearchViewController.m */; };
37
+		76D6EE8B22D5885600E7AC1C /* MSSAutoresizeLabelFlow.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE8322D5885600E7AC1C /* MSSAutoresizeLabelFlow.m */; };
38
+		76D6EE8C22D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE8422D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.m */; };
39
+		76D6EE8D22D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE8922D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.m */; };
40
+		76D6EE8E22D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE8A22D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.m */; };
41
+		76D6EE9122D5996100E7AC1C /* KDPSearchResultViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE9022D5996100E7AC1C /* KDPSearchResultViewController.m */; };
42
+		76D6EE9622D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D6EE9522D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.m */; };
34 43
 		76D7941322CDCC9C00C2ECFA /* KDPLiveDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D7941222CDCC9C00C2ECFA /* KDPLiveDataViewController.m */; };
35 44
 		76D7941622CDCCB900C2ECFA /* KDPSupplyGoodViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D7941522CDCCB900C2ECFA /* KDPSupplyGoodViewController.m */; };
36 45
 		76D7942522CDD3CB00C2ECFA /* UINavigationBar+handle.m in Sources */ = {isa = PBXBuildFile; fileRef = 76D7941922CDD3C900C2ECFA /* UINavigationBar+handle.m */; };
@@ -168,6 +177,24 @@
168 177
 		76D6EE7022D4A7A100E7AC1C /* KDPTabBarVC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KDPTabBarVC.h; sourceTree = "<group>"; };
169 178
 		76D6EE7222D4A7D600E7AC1C /* KDPSupplyContentViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KDPSupplyContentViewController.h; sourceTree = "<group>"; };
170 179
 		76D6EE7322D4A7D600E7AC1C /* KDPSupplyContentViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KDPSupplyContentViewController.m; sourceTree = "<group>"; };
180
+		76D6EE7522D4AA7D00E7AC1C /* KDPOrderDetailViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPOrderDetailViewController.h; sourceTree = "<group>"; };
181
+		76D6EE7622D4AA7D00E7AC1C /* KDPOrderDetailViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KDPOrderDetailViewController.m; sourceTree = "<group>"; };
182
+		76D6EE7822D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KDPOrderDetailTableViewCell.h; path = KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.h; sourceTree = SOURCE_ROOT; };
183
+		76D6EE7922D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = KDPOrderDetailTableViewCell.m; path = KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.m; sourceTree = SOURCE_ROOT; };
184
+		76D6EE7F22D587D300E7AC1C /* KDPSearchViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPSearchViewController.h; sourceTree = "<group>"; };
185
+		76D6EE8022D587D300E7AC1C /* KDPSearchViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KDPSearchViewController.m; sourceTree = "<group>"; };
186
+		76D6EE8322D5885600E7AC1C /* MSSAutoresizeLabelFlow.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSSAutoresizeLabelFlow.m; sourceTree = "<group>"; };
187
+		76D6EE8422D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSSAutoresizeLabelFlowLayout.m; sourceTree = "<group>"; };
188
+		76D6EE8522D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSSAutoresizeLabelFlowCell.h; sourceTree = "<group>"; };
189
+		76D6EE8622D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSSAutoresizeLabelFlowConfig.h; sourceTree = "<group>"; };
190
+		76D6EE8722D5885600E7AC1C /* MSSAutoresizeLabelFlow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSSAutoresizeLabelFlow.h; sourceTree = "<group>"; };
191
+		76D6EE8822D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MSSAutoresizeLabelFlowLayout.h; sourceTree = "<group>"; };
192
+		76D6EE8922D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSSAutoresizeLabelFlowCell.m; sourceTree = "<group>"; };
193
+		76D6EE8A22D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MSSAutoresizeLabelFlowConfig.m; sourceTree = "<group>"; };
194
+		76D6EE8F22D5996100E7AC1C /* KDPSearchResultViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPSearchResultViewController.h; sourceTree = "<group>"; };
195
+		76D6EE9022D5996100E7AC1C /* KDPSearchResultViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KDPSearchResultViewController.m; sourceTree = "<group>"; };
196
+		76D6EE9422D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPSearchResuCollectionViewCell.h; sourceTree = "<group>"; };
197
+		76D6EE9522D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KDPSearchResuCollectionViewCell.m; sourceTree = "<group>"; };
171 198
 		76D7941122CDCC9C00C2ECFA /* KDPLiveDataViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPLiveDataViewController.h; sourceTree = "<group>"; };
172 199
 		76D7941222CDCC9C00C2ECFA /* KDPLiveDataViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KDPLiveDataViewController.m; sourceTree = "<group>"; };
173 200
 		76D7941422CDCCB900C2ECFA /* KDPSupplyGoodViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KDPSupplyGoodViewController.h; sourceTree = "<group>"; };
@@ -420,6 +447,75 @@
420 447
 			path = XLPageViewController;
421 448
 			sourceTree = "<group>";
422 449
 		};
450
+		76D6EE7B22D5879C00E7AC1C /* Search */ = {
451
+			isa = PBXGroup;
452
+			children = (
453
+				76D6EE7E22D587B800E7AC1C /* model */,
454
+				76D6EE7D22D587B300E7AC1C /* view */,
455
+				76D6EE7C22D587AB00E7AC1C /* Controller */,
456
+			);
457
+			path = Search;
458
+			sourceTree = "<group>";
459
+		};
460
+		76D6EE7C22D587AB00E7AC1C /* Controller */ = {
461
+			isa = PBXGroup;
462
+			children = (
463
+				76D6EE9322D5B07900E7AC1C /* Model */,
464
+				76D6EE9222D5B07400E7AC1C /* View */,
465
+				76D6EE8222D5885600E7AC1C /* search */,
466
+				76D6EE7F22D587D300E7AC1C /* KDPSearchViewController.h */,
467
+				76D6EE8022D587D300E7AC1C /* KDPSearchViewController.m */,
468
+				76D6EE8F22D5996100E7AC1C /* KDPSearchResultViewController.h */,
469
+				76D6EE9022D5996100E7AC1C /* KDPSearchResultViewController.m */,
470
+			);
471
+			path = Controller;
472
+			sourceTree = "<group>";
473
+		};
474
+		76D6EE7D22D587B300E7AC1C /* view */ = {
475
+			isa = PBXGroup;
476
+			children = (
477
+			);
478
+			path = view;
479
+			sourceTree = "<group>";
480
+		};
481
+		76D6EE7E22D587B800E7AC1C /* model */ = {
482
+			isa = PBXGroup;
483
+			children = (
484
+			);
485
+			path = model;
486
+			sourceTree = "<group>";
487
+		};
488
+		76D6EE8222D5885600E7AC1C /* search */ = {
489
+			isa = PBXGroup;
490
+			children = (
491
+				76D6EE8322D5885600E7AC1C /* MSSAutoresizeLabelFlow.m */,
492
+				76D6EE8422D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.m */,
493
+				76D6EE8522D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.h */,
494
+				76D6EE8622D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.h */,
495
+				76D6EE8722D5885600E7AC1C /* MSSAutoresizeLabelFlow.h */,
496
+				76D6EE8822D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.h */,
497
+				76D6EE8922D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.m */,
498
+				76D6EE8A22D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.m */,
499
+			);
500
+			path = search;
501
+			sourceTree = "<group>";
502
+		};
503
+		76D6EE9222D5B07400E7AC1C /* View */ = {
504
+			isa = PBXGroup;
505
+			children = (
506
+				76D6EE9422D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.h */,
507
+				76D6EE9522D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.m */,
508
+			);
509
+			path = View;
510
+			sourceTree = "<group>";
511
+		};
512
+		76D6EE9322D5B07900E7AC1C /* Model */ = {
513
+			isa = PBXGroup;
514
+			children = (
515
+			);
516
+			path = Model;
517
+			sourceTree = "<group>";
518
+		};
423 519
 		76D7940922CDCB6700C2ECFA /* LiveData */ = {
424 520
 			isa = PBXGroup;
425 521
 			children = (
@@ -449,6 +545,8 @@
449 545
 				764A24D822D46B2E009B3891 /* KDPLiveLeftViewController.m */,
450 546
 				764A24DD22D476DF009B3891 /* KDPLiveRightViewController.h */,
451 547
 				764A24DE22D476DF009B3891 /* KDPLiveRightViewController.m */,
548
+				76D6EE7522D4AA7D00E7AC1C /* KDPOrderDetailViewController.h */,
549
+				76D6EE7622D4AA7D00E7AC1C /* KDPOrderDetailViewController.m */,
452 550
 			);
453 551
 			path = Controller;
454 552
 			sourceTree = "<group>";
@@ -462,6 +560,8 @@
462 560
 				764A24E122D47CEC009B3891 /* KDPLiveRightHeaderView.m */,
463 561
 				764A24E322D489F6009B3891 /* KDPLiveRightTableViewCell.h */,
464 562
 				764A24E422D489F6009B3891 /* KDPLiveRightTableViewCell.m */,
563
+				76D6EE7822D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.h */,
564
+				76D6EE7922D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.m */,
465 565
 			);
466 566
 			path = View;
467 567
 			sourceTree = "<group>";
@@ -627,6 +727,7 @@
627 727
 				76D7940A22CDCB7200C2ECFA /* SupplyGood */,
628 728
 				C5D5623B22CD9D300035A714 /* TOP */,
629 729
 				764A24B322D32215009B3891 /* Login */,
730
+				76D6EE7B22D5879C00E7AC1C /* Search */,
630 731
 				C5D561FA22CD97840035A714 /* AppDelegate.h */,
631 732
 				C5D561FB22CD97840035A714 /* AppDelegate.m */,
632 733
 				C5D561FD22CD97840035A714 /* ViewController.h */,
@@ -1014,6 +1115,7 @@
1014 1115
 				C5D5625C22CDCA350035A714 /* KDPublicMethod.m in Sources */,
1015 1116
 				C5D5626822CDD74A0035A714 /* KDPRecommendGoodCell.m in Sources */,
1016 1117
 				C5D5626B22CDD75B0035A714 /* KDPRecommendHeadView.m in Sources */,
1118
+				76D6EE8D22D5885600E7AC1C /* MSSAutoresizeLabelFlowCell.m in Sources */,
1017 1119
 				C5D5627122CDFDF00035A714 /* KDPEarnTableHeadView.m in Sources */,
1018 1120
 				C5D561FF22CD97840035A714 /* ViewController.m in Sources */,
1019 1121
 				76D7941322CDCC9C00C2ECFA /* KDPLiveDataViewController.m in Sources */,
@@ -1024,6 +1126,7 @@
1024 1126
 				C53FD3F522D31C8900687706 /* KDPUserInfoVC.m in Sources */,
1025 1127
 				C53FD3FB22D3361F00687706 /* KDPForecastListCell.m in Sources */,
1026 1128
 				76D7942922CDD3CB00C2ECFA /* UIButton+WSLTitleImage.m in Sources */,
1129
+				76D6EE8122D587D300E7AC1C /* KDPSearchViewController.m in Sources */,
1027 1130
 				C5BAD0CD22D46E150084663A /* KDPDetailGoodInformationView.m in Sources */,
1028 1131
 				C5D5626222CDD6A10035A714 /* KDPLiveEarningCell.m in Sources */,
1029 1132
 				764A24CD22D43DE4009B3891 /* ActivityIndicatorView.m in Sources */,
@@ -1032,8 +1135,11 @@
1032 1135
 				764A24DF22D476DF009B3891 /* KDPLiveRightViewController.m in Sources */,
1033 1136
 				764A24B922D32273009B3891 /* KDPWelcomePageViewController.m in Sources */,
1034 1137
 				764A24F522D4A39B009B3891 /* XLPageBasicTitleView.m in Sources */,
1138
+				76D6EE8B22D5885600E7AC1C /* MSSAutoresizeLabelFlow.m in Sources */,
1139
+				76D6EE9622D5BBB100E7AC1C /* KDPSearchResuCollectionViewCell.m in Sources */,
1035 1140
 				C53FD3FE22D33BD400687706 /* KDPForecastOrderListVC.m in Sources */,
1036 1141
 				C5D5624922CD9F350035A714 /* KDPMainViewController.m in Sources */,
1142
+				76D6EE8E22D5885600E7AC1C /* MSSAutoresizeLabelFlowConfig.m in Sources */,
1037 1143
 				C5D5625022CDA1140035A714 /* KDPTopViewController.m in Sources */,
1038 1144
 				C5D5620A22CD97860035A714 /* main.m in Sources */,
1039 1145
 				76D7945722D2E3EB00C2ECFA /* KDPScreenBtnView.m in Sources */,
@@ -1051,6 +1157,7 @@
1051 1157
 				C5BAD0B822D42F180084663A /* KDPUserInfoListCell.m in Sources */,
1052 1158
 				C53FD3F822D330EA00687706 /* KDPForecastVC.m in Sources */,
1053 1159
 				764A24B122D2EE20009B3891 /* KDPNavBar.m in Sources */,
1160
+				76D6EE9122D5996100E7AC1C /* KDPSearchResultViewController.m in Sources */,
1054 1161
 				76D7942822CDD3CB00C2ECFA /* UIView+Gradient.m in Sources */,
1055 1162
 				C53FD40122D33C7A00687706 /* KDPForecastOrderCell.m in Sources */,
1056 1163
 				C5BAD0DD22D47DFD0084663A /* KDPTodayListViewController.m in Sources */,
@@ -1062,8 +1169,10 @@
1062 1169
 				764A24F722D4A39B009B3891 /* XLPageTitleCell.m in Sources */,
1063 1170
 				76D7942B22CDD3CB00C2ECFA /* UICollectionViewCell+Extension.m in Sources */,
1064 1171
 				764A24F822D4A39B009B3891 /* XLPageViewControllerUtil.m in Sources */,
1172
+				76D6EE7722D4AA7D00E7AC1C /* KDPOrderDetailViewController.m in Sources */,
1065 1173
 				764A24F322D4A39B009B3891 /* XLPageViewController.m in Sources */,
1066 1174
 				764A24BC22D329F7009B3891 /* KDPPhoneLoginViewController.m in Sources */,
1175
+				76D6EE7A22D4AA9B00E7AC1C /* KDPOrderDetailTableViewCell.m in Sources */,
1067 1176
 				C5BAD0BB22D441910084663A /* KDPWebVC.m in Sources */,
1068 1177
 				76D7942522CDD3CB00C2ECFA /* UINavigationBar+handle.m in Sources */,
1069 1178
 				764A24DC22D46C2F009B3891 /* KDPLiveLeftTableViewCell.m in Sources */,
@@ -1085,6 +1194,7 @@
1085 1194
 				C53FD40422D34DBD00687706 /* KDPDrawerListCell.m in Sources */,
1086 1195
 				C5BAD0E022D4845B0084663A /* KDPTodayListCell.m in Sources */,
1087 1196
 				C5D5625922CDC9870035A714 /* MBProgressHUD+KDPCategory.m in Sources */,
1197
+				76D6EE8C22D5885600E7AC1C /* MSSAutoresizeLabelFlowLayout.m in Sources */,
1088 1198
 				C5D5626E22CDFDD20035A714 /* KDPEarningHeadView.m in Sources */,
1089 1199
 				764A24D322D43FA4009B3891 /* KDPAccountTool.m in Sources */,
1090 1200
 				764A24F422D4A39B009B3891 /* XLPageSegmentedTitleView.m in Sources */,

+ 1 - 1
KuDianProject.xcodeproj/xcuserdata/kaipeng.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
7 7
 		<key>KuDianProject.xcscheme_^#shared#^_</key>
8 8
 		<dict>
9 9
 			<key>orderHint</key>
10
-			<integer>1</integer>
10
+			<integer>0</integer>
11 11
 		</dict>
12 12
 	</dict>
13 13
 </dict>

二進制
KuDianProject.xcworkspace/xcuserdata/kaipeng.xcuserdatad/UserInterfaceState.xcuserstate


二進制
KuDianProject/.DS_Store


+ 6 - 0
KuDianProject/LiveData/Controller/KDPLiveLeftViewController.m

@@ -8,6 +8,7 @@
8 8
 
9 9
 #import "KDPLiveLeftViewController.h"
10 10
 #import "KDPLiveLeftTableViewCell.h"
11
+#import "KDPOrderDetailViewController.h"
11 12
 @interface KDPLiveLeftViewController ()<UITableViewDelegate,UITableViewDataSource>
12 13
 
13 14
 @property (nonatomic, strong) UITableView *tableView;
@@ -55,6 +56,11 @@
55 56
 
56 57
 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
57 58
     KDPLiveLeftTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([KDPLiveLeftTableViewCell class])];
59
+        cell.orderClickBlock = ^(UIButton * _Nonnull btn) {
60
+        KDPOrderDetailViewController *detailVC = [[KDPOrderDetailViewController alloc] init];
61
+        WeakSelf(weakSelf);
62
+        [weakSelf.navigationController pushViewController:detailVC animated:YES];
63
+    };
58 64
     cell.selectionStyle = UITableViewCellSelectionStyleNone;
59 65
     return cell;
60 66
 }

+ 17 - 0
KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.h

@@ -0,0 +1,17 @@
1
+//
2
+//  KDPOrderDetailTableViewCell.h
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/9.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface KDPOrderDetailTableViewCell : UITableViewCell
14
+
15
+@end
16
+
17
+NS_ASSUME_NONNULL_END

+ 143 - 0
KuDianProject/LiveData/Controller/KDPOrderDetailTableViewCell.m

@@ -0,0 +1,143 @@
1
+//
2
+//  KDPOrderDetailTableViewCell.m
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/9.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPOrderDetailTableViewCell.h"
10
+
11
+@interface KDPOrderDetailTableViewCell ()
12
+
13
+@property (nonatomic, strong) UILabel *timeLabel;
14
+
15
+@property (nonatomic, strong) UIImageView *iconImageView;
16
+
17
+@property (nonatomic, strong) UILabel *goodTitleLabel;
18
+
19
+@property (nonatomic, strong) UILabel *createTimeLabel;
20
+
21
+@property (nonatomic, strong) UILabel *endTimeLabel;
22
+
23
+@property (nonatomic, strong) UILabel *payMonny;
24
+
25
+@property (nonatomic, strong) UILabel *commMonny; // 佣金
26
+
27
+@end
28
+
29
+@implementation KDPOrderDetailTableViewCell
30
+
31
+- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
32
+    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
33
+        [self setContentView];
34
+        [self setContentViewConstraints];
35
+    }
36
+    return self;
37
+}
38
+
39
+- (void)setContentView{
40
+    self.contentView.backgroundColor = [UIColor whiteColor];
41
+    self.contentView.layer.cornerRadius = 6;
42
+    self.contentView.layer.masksToBounds = YES;
43
+    self.iconImageView = [[UIImageView alloc] init];
44
+    [self.contentView addSubview:self.iconImageView];
45
+    
46
+    self.timeLabel = [[UILabel alloc] init];
47
+    self.timeLabel.textColor = [UIColor colorWithHex:0x333333];
48
+    self.timeLabel.font = FONT_SYS(12);
49
+    self.timeLabel.text = @"直播时间:2019-07-03 20:00:00";
50
+    [self.contentView addSubview:self.timeLabel];
51
+    
52
+    self.goodTitleLabel = [[UILabel alloc] init];
53
+    self.goodTitleLabel.textColor = [UIColor colorWithHex:0x333333];
54
+    self.goodTitleLabel.font = FONT_SYS(15);
55
+    self.goodTitleLabel.text = @"这是一个商品名这是一个商品名这是";
56
+    [self.contentView addSubview:self.goodTitleLabel];
57
+    
58
+    self.createTimeLabel = [[UILabel alloc] init];
59
+    self.createTimeLabel.textColor = [UIColor colorWithHex:0x999999];
60
+    self.createTimeLabel.font = FONT_SYS(12);
61
+    self.createTimeLabel.text = @"创建日:04-04 12:00";
62
+    [self.contentView addSubview:self.createTimeLabel];
63
+    
64
+    self.endTimeLabel = [[UILabel alloc] init];
65
+    self.endTimeLabel.textColor = [UIColor colorWithHex:0x999999];
66
+    self.endTimeLabel.font = FONT_SYS(12);
67
+    self.endTimeLabel.text = @"结算日:05-05 12:12";
68
+    [self.contentView addSubview:self.endTimeLabel];
69
+    
70
+    self.payMonny = [[UILabel alloc] init];
71
+    self.payMonny.textColor = [UIColor colorWithHex:0x666666];
72
+    self.payMonny.font = FONT_SYS(12);
73
+    self.payMonny.text = @"付款金额¥29.8";
74
+    [self.contentView addSubview:self.payMonny];
75
+    
76
+    self.commMonny = [[UILabel alloc] init];
77
+    NSString *string = @"结算佣金¥5.00";
78
+    NSMutableAttributedString *commAtt = [[NSMutableAttributedString alloc] initWithString:string attributes:@{NSForegroundColorAttributeName:[UIColor baseColor],NSFontAttributeName:FONT_SYS(12)}];
79
+    [commAtt addAttributes:@{NSForegroundColorAttributeName:[UIColor colorWithHex:0x666666]} range:[string rangeOfString:@"结算佣金"]];
80
+    [self.commMonny setAttributedText:commAtt];
81
+    [self.contentView addSubview:self.commMonny];
82
+    
83
+}
84
+
85
+- (void)setContentViewConstraints{
86
+    self.backgroundColor = [UIColor clearColor];
87
+    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
88
+        make.edges.equalTo(UIEdgeInsetsMake(0, 10, 6, 10));
89
+    }];
90
+    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
91
+        make.left.equalTo(self.contentView.mas_left).offset(8);
92
+        make.top.equalTo(self.contentView.mas_top).offset(7);
93
+        make.size.equalTo(CGSizeMake(SCREEN_WIDTH-30, 17));
94
+    }];
95
+    
96
+    // 虚线
97
+    CAShapeLayer *dotteShapeLayer = [CAShapeLayer layer];
98
+    CGMutablePathRef dotteshapePath = CGPathCreateMutable();
99
+    // 设置虚线颜色
100
+    [dotteShapeLayer setStrokeColor:[UIColor colorWithHex:0xC5C5C5].CGColor];
101
+    dotteShapeLayer.lineWidth = 0.3f;
102
+    NSArray *dottehShapeArr = [[NSArray alloc] initWithObjects:[NSNumber numberWithInt:4],[NSNumber numberWithInt:4],[NSNumber numberWithInt:4],[NSNumber numberWithInt:4],[NSNumber numberWithInt:4], nil];
103
+    [dotteShapeLayer setLineDashPattern:dottehShapeArr];
104
+    CGPathMoveToPoint(dotteshapePath, NULL, 8,29);
105
+    CGPathAddLineToPoint(dotteshapePath, NULL, self.contentView.width-7, 29);
106
+    [dotteShapeLayer setPath:dotteshapePath];
107
+    CGPathRelease(dotteshapePath);
108
+    [self.contentView.layer addSublayer:dotteShapeLayer];
109
+    
110
+    [self.iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
111
+        make.left.equalTo(self.contentView.mas_left).offset(8);
112
+        make.bottom.equalTo(self.contentView.mas_bottom).offset(-8);
113
+        make.size.equalTo(CGSizeMake(80, 80));
114
+    }];
115
+    [self.goodTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
116
+        make.left.equalTo(self.iconImageView.mas_right).offset(6);
117
+        make.top.equalTo(self.iconImageView.mas_top);
118
+        make.right.equalTo(self.contentView.mas_right).offset(-10);
119
+    }];
120
+    [self.createTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
121
+        make.left.equalTo(self.goodTitleLabel);
122
+        make.top.equalTo(self.goodTitleLabel.mas_bottom).offset(9);
123
+        make.width.equalTo(120);
124
+    }];
125
+    [self.endTimeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
126
+        make.left.equalTo(self.createTimeLabel.mas_right).offset(15);
127
+        make.right.equalTo(self.contentView.mas_right).offset(-10);
128
+        make.top.equalTo(self.createTimeLabel);
129
+    }];
130
+    [self.payMonny mas_makeConstraints:^(MASConstraintMaker *make) {
131
+        make.left.equalTo(self.goodTitleLabel);
132
+        make.top.equalTo(self.createTimeLabel.mas_bottom).offset(10);
133
+        make.width.equalTo(self.createTimeLabel);
134
+    }];
135
+    [self.commMonny mas_makeConstraints:^(MASConstraintMaker *make) {
136
+        make.left.right.equalTo(self.endTimeLabel);
137
+        make.top.equalTo(self.payMonny);
138
+    }];
139
+    
140
+    
141
+}
142
+
143
+@end

+ 17 - 0
KuDianProject/LiveData/Controller/KDPOrderDetailViewController.h

@@ -0,0 +1,17 @@
1
+//
2
+//  KDPOrderDetailViewController.h
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/9.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPMainViewController.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface KDPOrderDetailViewController : KDPMainViewController
14
+
15
+@end
16
+
17
+NS_ASSUME_NONNULL_END

+ 65 - 0
KuDianProject/LiveData/Controller/KDPOrderDetailViewController.m

@@ -0,0 +1,65 @@
1
+//
2
+//  KDPOrderDetailViewController.m
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/9.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPOrderDetailViewController.h"
10
+#import "KDPOrderDetailTableViewCell.h"
11
+@interface KDPOrderDetailViewController ()<UITableViewDelegate,UITableViewDataSource>
12
+
13
+@property (nonatomic, strong) UITableView *tableview;
14
+
15
+@end
16
+
17
+@implementation KDPOrderDetailViewController
18
+
19
+- (void)viewDidLoad {
20
+    [super viewDidLoad];
21
+    // Do any additional setup after loading the view.
22
+    self.view.backgroundColor = [UIColor colorWithHex:0xF9F9F9];
23
+    self.navBar.navTitleLabel.text = @"直播订单明细";
24
+    [self.view addSubview:self.tableview];
25
+    [self.navBar addleftReturnButton:self selector:@selector(popAction)];
26
+}
27
+
28
+- (void)popAction{
29
+    [self.navigationController popViewControllerAnimated:YES];
30
+}
31
+
32
+- (UITableView *)tableview{
33
+    if (!_tableview) {
34
+        _tableview = [[UITableView alloc] initWithFrame:CGRectMake(0, KDNavBarHeight+10, SCREEN_WIDTH, SCREEN_HEIGHT-KDNavBarHeight-10) style:UITableViewStylePlain];
35
+        _tableview.dataSource = self;
36
+        _tableview.delegate = self;
37
+        _tableview.rowHeight = 136;
38
+        _tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
39
+        _tableview.backgroundColor = [UIColor clearColor];
40
+        [_tableview registerClass:[KDPOrderDetailTableViewCell class] forCellReuseIdentifier:NSStringFromClass([KDPOrderDetailTableViewCell class])];
41
+        _tableview.showsVerticalScrollIndicator = NO;
42
+        _tableview.showsHorizontalScrollIndicator = NO;
43
+    }
44
+    return _tableview;
45
+}
46
+
47
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
48
+    KDPOrderDetailTableViewCell *detailCell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([KDPOrderDetailTableViewCell class])];
49
+    detailCell.selectionStyle = UITableViewCellSelectionStyleNone;
50
+    return detailCell;
51
+}
52
+
53
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
54
+    return 1;
55
+}
56
+
57
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
58
+    return 10;
59
+}
60
+
61
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
62
+    
63
+}
64
+
65
+@end

二進制
KuDianProject/Search/.DS_Store


二進制
KuDianProject/Search/Controller/.DS_Store


+ 19 - 0
KuDianProject/Search/Controller/KDPSearchResultViewController.h

@@ -0,0 +1,19 @@
1
+//
2
+//  KDPSearchResultViewController.h
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPMainViewController.h"
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface KDPSearchResultViewController : KDPMainViewController
14
+
15
+@property (nonatomic, copy) NSString *keyWordStr;
16
+
17
+@end
18
+
19
+NS_ASSUME_NONNULL_END

+ 42 - 0
KuDianProject/Search/Controller/KDPSearchResultViewController.m

@@ -0,0 +1,42 @@
1
+//
2
+//  KDPSearchResultViewController.m
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPSearchResultViewController.h"
10
+#import "KDPSupplyContentReusableView.h"
11
+@interface KDPSearchResultViewController ()
12
+
13
+@property (nonatomic, strong) UICollectionView *collectionView;
14
+
15
+@property (nonatomic, strong) NSMutableArray *dataSource;
16
+
17
+@end
18
+
19
+@implementation KDPSearchResultViewController
20
+
21
+- (void)viewDidLoad {
22
+    [super viewDidLoad];
23
+    // Do any additional setup after loading the view.
24
+}
25
+
26
+- (void)setupNav{
27
+    self.navBar.hidden = YES;
28
+    
29
+}
30
+
31
+- (void)viewWillAppear:(BOOL)animated{
32
+    [super viewWillAppear:animated];
33
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
34
+}
35
+
36
+- (void)viewWillDisappear:(BOOL)animated{
37
+    [super viewWillDisappear:animated];
38
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
39
+}
40
+
41
+
42
+@end

+ 19 - 0
KuDianProject/Search/Controller/KDPSearchViewController.h

@@ -0,0 +1,19 @@
1
+//
2
+//  KDPSearchViewController.h
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPMainViewController.h"
10
+
11
+#define SearchPath  [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"historySearch.data"]
12
+
13
+NS_ASSUME_NONNULL_BEGIN
14
+
15
+@interface KDPSearchViewController : KDPMainViewController
16
+
17
+@end
18
+
19
+NS_ASSUME_NONNULL_END

+ 267 - 0
KuDianProject/Search/Controller/KDPSearchViewController.m

@@ -0,0 +1,267 @@
1
+//
2
+//  KDPSearchViewController.m
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPSearchViewController.h"
10
+#import "MSSAutoresizeLabelFlow.h"
11
+#import "KDPSearchResultViewController.h"
12
+@interface KDPSearchViewController ()<UITextFieldDelegate,UITableViewDelegate,UITableViewDataSource>
13
+
14
+@property (nonatomic, strong) UITableView *tableview;
15
+
16
+@property (nonatomic, strong) NSMutableArray *historyDataArray;
17
+
18
+@property (nonatomic, strong) NSMutableArray *searchArray;
19
+
20
+@property (nonatomic, strong) UIView *historyView;
21
+
22
+@property (nonatomic, strong) UITextField *searchTextField;
23
+
24
+@property (nonatomic, strong) MSSAutoresizeLabelFlow *flowView;
25
+
26
+@end
27
+
28
+@implementation KDPSearchViewController
29
+
30
+- (void)viewDidLoad {
31
+    [super viewDidLoad];
32
+    // Do any additional setup after loading the view.
33
+    [self setUpNav];
34
+    [self loadHisttoryData];
35
+    [self setContentView];
36
+}
37
+
38
+- (void)setUpNav{
39
+    [self.navBar setLineViewWithHidden:YES];
40
+    self.navBar.backgroundColor = [UIColor colorWithHex:0xf9f9f9];
41
+    self.view.backgroundColor = [UIColor whiteColor];
42
+    
43
+    UIView *searchView = [[UIView alloc] initWithFrame:CGRectMake(10, KDStatusHeight + 7, SCREEN_WIDTH-85, 31)];
44
+    searchView.layer.cornerRadius = 16;
45
+    searchView.layer.masksToBounds = YES;
46
+    searchView.backgroundColor = [UIColor whiteColor];
47
+    [self.navBar addSubview:searchView];
48
+    
49
+    UIImageView *searchIcon = [[UIImageView alloc] initWithFrame:CGRectMake(13, 8, 15, 15)];
50
+    searchIcon.image = [UIImage imageNamed:@"search_icon"];
51
+    [searchView addSubview:searchIcon];
52
+    
53
+    self.searchTextField = [[UITextField alloc] initWithFrame:CGRectMake(searchIcon.right + 7, 4.5, searchView.width-45, 22)];
54
+    self.searchTextField.delegate = self;
55
+    self.searchTextField.font = FONT_SYS(14);
56
+    self.searchTextField.textColor = [UIColor colorWithHex:0x8F8F95];
57
+    self.searchTextField.returnKeyType = UIReturnKeySearch;
58
+    self.searchTextField.backgroundColor = [UIColor clearColor];
59
+    self.searchTextField.placeholder = @"搜索想要的内容";
60
+    [searchView addSubview:self.searchTextField];
61
+    
62
+    UIButton *cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom];
63
+    cancelBtn.frame = CGRectMake(SCREEN_WIDTH-55, 0, 35, 21);
64
+    cancelBtn.centerY = searchView.centerY;
65
+    [cancelBtn setTitle:@"取消" forState:UIControlStateNormal];
66
+    [cancelBtn setTitleColor:[UIColor colorWithHex:0x666666] forState:UIControlStateNormal];
67
+    cancelBtn.titleLabel.font = FONT_SYS(15);
68
+    [cancelBtn addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside];
69
+    [self.navBar addSubview:cancelBtn];
70
+    
71
+    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(textchangeclick) name:UITextFieldTextDidChangeNotification object:nil];
72
+
73
+}
74
+
75
+- (void)loadHisttoryData{
76
+    [self.historyDataArray removeAllObjects];
77
+    NSArray *saveHistory = [NSKeyedUnarchiver unarchiveObjectWithFile:SearchPath];
78
+    [self.historyDataArray addObjectsFromArray:saveHistory];
79
+}
80
+
81
+- (void)setContentView{
82
+    [self.view addSubview:self.tableview];
83
+    [self.tableview mas_makeConstraints:^(MASConstraintMaker *make) {
84
+        make.edges.equalTo(UIEdgeInsetsMake(KDNavBarHeight, 0, 0, 0));
85
+    }];
86
+    
87
+    [self.view addSubview:self.historyView];
88
+    [self.historyView mas_makeConstraints:^(MASConstraintMaker *make) {
89
+        make.edges.equalTo(UIEdgeInsetsZero);
90
+    }];
91
+    
92
+    UILabel *searchHistLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, KDNavBarHeight + 10, 100, 30)];
93
+    searchHistLabel.text = @"搜索历史";
94
+    searchHistLabel.textColor = [UIColor colorWithHex:0x666666];
95
+    searchHistLabel.font = FONT_SYS(14);
96
+    [self.historyView addSubview:searchHistLabel];
97
+    
98
+    UIButton *deleteBtn = [UIButton buttonWithType:UIButtonTypeCustom];
99
+    [deleteBtn setTitle:@"清空" forState:UIControlStateNormal];
100
+    [deleteBtn setTitleColor:[UIColor colorWithHex:0x808080] forState:UIControlStateNormal];
101
+    [deleteBtn setImage:[UIImage imageNamed:@"delete_collection"] forState:UIControlStateNormal];
102
+    [deleteBtn addTarget:self action:@selector(deleteAction) forControlEvents:UIControlEventTouchUpInside];
103
+    deleteBtn.titleLabel.font = FONT_SYS(13);
104
+    [deleteBtn setButtonStyle:WSLButtonStyleImageLeft spacing:3];
105
+    [self.historyView addSubview:deleteBtn];
106
+    [deleteBtn mas_makeConstraints:^(MASConstraintMaker *make) {
107
+        make.top.equalTo(KDNavBarHeight + 10);
108
+        make.right.equalTo(-20);
109
+        make.height.equalTo(30);
110
+    }];
111
+    
112
+    self.flowView = [[MSSAutoresizeLabelFlow  alloc] initWithFrame:CGRectMake(0, searchHistLabel.bottom, self.view.width, 10) titles:self.historyDataArray selectedHandler:^(NSUInteger index, NSString *title) {
113
+        [self skipToResultWithString:title];
114
+    }];
115
+    [self.historyView addSubview:self.flowView];
116
+    
117
+    self.historyView.hidden = self.historyDataArray.count == 0 ? YES : NO;
118
+    
119
+}
120
+
121
+- (void)requestSearchData:(NSString *)keyWord{
122
+    NSString *searchUrl = [NSString stringWithFormat:@"%@api/goods/searchAdvice",KDURL];
123
+    [self.searchArray removeAllObjects];
124
+    [KDPNetworkRequestHTTP postURL:searchUrl params:@{@"keyword":keyWord} success:^(id  _Nonnull json) {
125
+        NSArray *data = json[@"data"];
126
+        [self.searchArray addObjectsFromArray:data];
127
+        if (self.searchArray.count) {
128
+            self.historyView.hidden = YES;
129
+            self.tableview.hidden = NO;
130
+            [self.tableview reloadData];
131
+        } else{
132
+            self.historyView.hidden = NO;
133
+            self.tableview.hidden = YES;
134
+        }
135
+    } failure:^(NSError * _Nonnull error) {
136
+        
137
+    }];
138
+}
139
+
140
+- (void)skipToResultWithString:(NSString *)searchText{
141
+    if (![self.historyDataArray containsObject:searchText]) {
142
+        [self.historyDataArray addObject:searchText];
143
+    }
144
+    [self saveHistory];
145
+    
146
+    // 跳转到结果页
147
+    KDPSearchResultViewController *searchResultVC = [[KDPSearchResultViewController alloc] init];
148
+    searchResultVC.keyWordStr = searchText;
149
+    [self.navigationController pushViewController:searchResultVC animated:NO];
150
+    
151
+}
152
+
153
+- (void)saveHistory{
154
+    BOOL success = [NSKeyedArchiver archiveRootObject:self.historyDataArray toFile:SearchPath];
155
+    if (success) {
156
+        NSLog(@"保存成功");
157
+        [self.flowView reloadAllWithTitles:self.historyDataArray];
158
+    }
159
+}
160
+
161
+- (void)cancelAction:(UIButton *)sender{
162
+    [self.navigationController popViewControllerAnimated:NO];
163
+}
164
+
165
+- (void)textchangeclick{
166
+    if (self.searchTextField.text.length>0) {
167
+        [self requestSearchData:self.searchTextField.text];
168
+    }
169
+}
170
+
171
+- (void)viewWillAppear:(BOOL)animated{
172
+    [super viewWillAppear:animated];
173
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
174
+}
175
+
176
+- (void)viewWillDisappear:(BOOL)animated{
177
+    [super viewWillDisappear:animated];
178
+    [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
179
+}
180
+
181
+- (BOOL)textFieldShouldReturn:(UITextField *)textField
182
+{
183
+    if ( textField.text.length>0) {
184
+        [self skipToResultWithString:textField.text];
185
+    }
186
+    return YES;
187
+}
188
+
189
+- (void)deleteAction{
190
+    [self.historyDataArray removeAllObjects];
191
+    [self saveHistory];
192
+    [self.flowView reloadAllWithTitles:self.historyDataArray];
193
+    self.historyView.hidden = YES;
194
+}
195
+
196
+#pragma UITableview delegate and datasource
197
+
198
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
199
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"searchList"];
200
+    if (!cell) {
201
+        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"searchList"];
202
+        cell.selectionStyle = UITableViewCellSelectionStyleNone;
203
+        UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(0, 49, SCREEN_WIDTH, 1)];
204
+        lineView.backgroundColor = [UIColor colorWithHex:0xf4f4f4];
205
+        [cell.contentView addSubview:lineView];
206
+    }
207
+    cell.textLabel.text = self.searchArray[indexPath.row];
208
+    return cell;
209
+}
210
+
211
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
212
+    return 1;
213
+}
214
+
215
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
216
+    return self.searchArray.count;
217
+}
218
+
219
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
220
+    [self requestSearchData:self.searchArray[indexPath.row]];
221
+}
222
+
223
+#pragma mark - 懒加载
224
+
225
+- (NSMutableArray *)historyDataArray{
226
+    if (!_historyDataArray) {
227
+        _historyDataArray = [NSMutableArray array];
228
+    }
229
+    return _historyDataArray;
230
+}
231
+
232
+- (NSMutableArray *)searchArray{
233
+    if (!_searchArray) {
234
+        _searchArray = [NSMutableArray array];
235
+    }
236
+    return _searchArray;
237
+}
238
+
239
+- (UITableView *)tableview{
240
+    if (!_tableview) {
241
+        _tableview = [[UITableView alloc] init];
242
+        _tableview.delegate = self;
243
+        _tableview.dataSource = self;
244
+        _tableview.backgroundColor = [UIColor whiteColor];
245
+        _tableview.separatorStyle = UITableViewCellSeparatorStyleNone;
246
+        _tableview.hidden = YES;
247
+        _tableview.showsVerticalScrollIndicator = NO;
248
+        _tableview.showsHorizontalScrollIndicator = NO;
249
+        _tableview.rowHeight = 50;
250
+        [_tableview registerClass:[UITableViewCell class] forCellReuseIdentifier:@"searchList"];
251
+    }
252
+    return _tableview;
253
+}
254
+
255
+- (UIView *)historyView{
256
+    if (!_historyView) {
257
+        _historyView = [[UIView alloc] init];
258
+        _historyView.backgroundColor = [UIColor whiteColor];
259
+    }
260
+    return _historyView;
261
+}
262
+
263
+- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
264
+    [self.view endEditing:YES];
265
+}
266
+
267
+@end

+ 17 - 0
KuDianProject/Search/Controller/View/KDPSearchResuCollectionViewCell.h

@@ -0,0 +1,17 @@
1
+//
2
+//  KDPSearchResuCollectionViewCell.h
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+NS_ASSUME_NONNULL_BEGIN
12
+
13
+@interface KDPSearchResuCollectionViewCell : UICollectionViewCell
14
+
15
+@end
16
+
17
+NS_ASSUME_NONNULL_END

+ 20 - 0
KuDianProject/Search/Controller/View/KDPSearchResuCollectionViewCell.m

@@ -0,0 +1,20 @@
1
+//
2
+//  KDPSearchResuCollectionViewCell.m
3
+//  KuDianProject
4
+//
5
+//  Created by admin on 2019/7/10.
6
+//  Copyright © 2019 KDP. All rights reserved.
7
+//
8
+
9
+#import "KDPSearchResuCollectionViewCell.h"
10
+
11
+@implementation KDPSearchResuCollectionViewCell
12
+
13
+- (instancetype)initWithFrame:(CGRect)frame{
14
+    if (self = [super initWithFrame:frame]) {
15
+        
16
+    }
17
+    return self;
18
+}
19
+
20
+@end

+ 40 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlow.h

@@ -0,0 +1,40 @@
1
+//
2
+//  MSSAutoresizeLabelFlow.h
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+typedef void(^selectedHandler)(NSUInteger index,NSString *title);
12
+
13
+@interface MSSAutoresizeLabelFlow : UIView
14
+
15
+- (instancetype)initWithFrame:(CGRect)frame
16
+                       titles:(NSArray *)titles
17
+              selectedHandler:(selectedHandler)handler;
18
+
19
+- (void)insertLabelWithTitle:(NSString *)title
20
+                     atIndex:(NSUInteger)index
21
+                    animated:(BOOL)animated;
22
+
23
+- (void)insertLabelsWithTitles:(NSArray *)titles
24
+                     atIndexes:(NSIndexSet *)indexes
25
+                      animated:(BOOL)animated;
26
+
27
+- (void)deleteLabelAtIndex:(NSUInteger)index
28
+                  animated:(BOOL)animated;
29
+
30
+- (void)deleteLabelsAtIndexes:(NSIndexSet *)indexes
31
+                     animated:(BOOL)animated;
32
+
33
+- (void)reloadAllWithTitles:(NSArray *)titles;
34
+
35
+
36
+@end
37
+
38
+
39
+
40
+

+ 156 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlow.m

@@ -0,0 +1,156 @@
1
+//
2
+//  MSSAutoresizeLabelFlow.m
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import "MSSAutoresizeLabelFlow.h"
10
+#import "MSSAutoresizeLabelFlowLayout.h"
11
+#import "MSSAutoresizeLabelFlowCell.h"
12
+#import "MSSAutoresizeLabelFlowConfig.h"
13
+
14
+static NSString *const cellId = @"cellId";
15
+
16
+@interface MSSAutoresizeLabelFlow () <UICollectionViewDataSource,UICollectionViewDelegate,MSSAutoresizeLabelFlowLayoutDataSource,MSSAutoresizeLabelFlowLayoutDelegate>
17
+@property (nonatomic,strong) UICollectionView *collection;
18
+@property (nonatomic,strong) NSMutableArray   *data;
19
+@property (nonatomic,  copy) selectedHandler  handler;
20
+
21
+@end
22
+
23
+@implementation MSSAutoresizeLabelFlow
24
+
25
+- (instancetype)initWithFrame:(CGRect)frame titles:(NSArray *)titles selectedHandler:(selectedHandler)handler {
26
+    self = [super initWithFrame:frame];
27
+    if (!titles.count) {
28
+        return self;
29
+    }
30
+    if (self) {
31
+        self.backgroundColor = [UIColor whiteColor];
32
+        self.data = [titles mutableCopy];
33
+        self.handler = handler;
34
+        [self setup];
35
+    }
36
+    return self;
37
+}
38
+
39
+- (void)setup {
40
+//    UICollectionViewFlowLayout *layout =[[UICollectionViewFlowLayout alloc]init];
41
+    MSSAutoresizeLabelFlowLayout *layout = [[MSSAutoresizeLabelFlowLayout alloc]init];
42
+    layout.delegate = self;
43
+    layout.dataSource = self;
44
+    self.collection = [[UICollectionView alloc]initWithFrame:self.bounds collectionViewLayout:layout];
45
+    self.collection.backgroundColor = [UIColor clearColor];
46
+    self.collection.allowsMultipleSelection = YES;
47
+    self.collection.delegate = self;
48
+    self.collection.dataSource = self;
49
+    [self.collection registerClass:[MSSAutoresizeLabelFlowCell class] forCellWithReuseIdentifier:cellId];
50
+    [self addSubview:self.collection];
51
+    
52
+}
53
+
54
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
55
+    return 1;
56
+}
57
+
58
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
59
+    return self.data.count;
60
+}
61
+
62
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
63
+    MSSAutoresizeLabelFlowCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellId forIndexPath:indexPath];
64
+    [cell configCellWithTitle:self.data[indexPath.item]];
65
+    return cell;
66
+}
67
+
68
+
69
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
70
+    if (self.handler) {
71
+        NSUInteger index = indexPath.item;
72
+        NSString *title = self.data[index];
73
+        self.handler(index,title);
74
+    }
75
+}
76
+
77
+- (NSString *)titleForLabelAtIndexPath:(NSIndexPath *)indexPath {
78
+    return self.data[indexPath.item];
79
+}
80
+
81
+- (void)layoutFinishWithNumberOfline:(NSInteger)number {
82
+    NSInteger numberCount = 0 ;
83
+    if (numberCount == number) {
84
+        return;
85
+    }
86
+    numberCount = number;
87
+    MSSAutoresizeLabelFlowConfig *config = [MSSAutoresizeLabelFlowConfig shareConfig];
88
+    CGFloat h = config.contentInsets.top+config.contentInsets.bottom+config.itemHeight*number+config.lineSpace*(number-1);
89
+    self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, self.frame.size.width, h);
90
+    self.collection.frame = self.bounds;
91
+//    [UIView animateWithDuration:0.1 animations:^{
92
+//        
93
+//    }];
94
+}
95
+
96
+- (void)insertLabelWithTitle:(NSString *)title atIndex:(NSUInteger)index animated:(BOOL)animated {
97
+    NSIndexPath *indexPath = [NSIndexPath indexPathForItem:index inSection:0];
98
+    [self.data insertObject:title atIndex:index];
99
+    [self performBatchUpdatesWithAction:UICollectionUpdateActionInsert indexPaths:@[indexPath] animated:animated];
100
+}
101
+
102
+- (void)insertLabelsWithTitles:(NSArray *)titles atIndexes:(NSIndexSet *)indexes animated:(BOOL)animated {
103
+    NSArray *indexPaths = [self indexPathsWithIndexes:indexes];
104
+    [self.data insertObjects:titles atIndexes:indexes];
105
+    [self performBatchUpdatesWithAction:UICollectionUpdateActionInsert indexPaths:indexPaths animated:animated];
106
+}
107
+
108
+- (void)deleteLabelAtIndex:(NSUInteger)index animated:(BOOL)animated {
109
+    [self deleteLabelsAtIndexes:[NSIndexSet indexSetWithIndex:index] animated:animated];
110
+}
111
+
112
+- (void)deleteLabelsAtIndexes:(NSIndexSet *)indexes animated:(BOOL)animated {
113
+    NSArray *indexPaths = [self indexPathsWithIndexes:indexes];
114
+    [self.data removeObjectsAtIndexes:indexes];
115
+    [self performBatchUpdatesWithAction:UICollectionUpdateActionDelete indexPaths:indexPaths animated:animated];
116
+}
117
+
118
+- (void)reloadAllWithTitles:(NSArray *)titles {
119
+    self.data = [titles mutableCopy];
120
+    [self.collection reloadData];
121
+}
122
+
123
+- (void)performBatchUpdatesWithAction:(UICollectionUpdateAction)action indexPaths:(NSArray *)indexPaths animated:(BOOL)animated {
124
+    if (!animated) {
125
+        [UIView setAnimationsEnabled:NO];
126
+    }
127
+    [self.collection performBatchUpdates:^{
128
+        switch (action) {
129
+            case UICollectionUpdateActionInsert:
130
+                [self.collection insertItemsAtIndexPaths:indexPaths];
131
+                break;
132
+            case UICollectionUpdateActionDelete:
133
+                [self.collection deleteItemsAtIndexPaths:indexPaths];
134
+            default:
135
+                break;
136
+        }
137
+    } completion:^(BOOL finished) {
138
+        if (!animated) {
139
+            [UIView setAnimationsEnabled:YES];
140
+        }
141
+    }];
142
+}
143
+
144
+- (NSArray *)indexPathsWithIndexes:(NSIndexSet *)set {
145
+    NSMutableArray *indexPaths = [NSMutableArray arrayWithCapacity:set.count];
146
+    [set enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
147
+        NSIndexPath *indexPath = [NSIndexPath indexPathForItem:idx inSection:0];
148
+        [indexPaths addObject:indexPath];
149
+    }];
150
+    return [indexPaths copy];
151
+}
152
+
153
+
154
+
155
+@end
156
+

+ 18 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowCell.h

@@ -0,0 +1,18 @@
1
+//
2
+//  MSSAutoresizeLabelFlowCell.h
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+@interface MSSAutoresizeLabelFlowCell : UICollectionViewCell
12
+
13
+- (void)configCellWithTitle:(NSString *)title;
14
+
15
+@end
16
+
17
+
18
+

+ 51 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowCell.m

@@ -0,0 +1,51 @@
1
+//
2
+//  MSSAutoresizeLabelFlowCell.m
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import "MSSAutoresizeLabelFlowCell.h"
10
+#import "MSSAutoresizeLabelFlowConfig.h"
11
+#define JKColor(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
12
+@interface MSSAutoresizeLabelFlowCell ()
13
+
14
+@property (nonatomic,strong) UILabel *titleLabel;
15
+
16
+@end
17
+
18
+@implementation MSSAutoresizeLabelFlowCell
19
+
20
+- (UILabel *)titleLabel {
21
+    if (_titleLabel == nil) {
22
+        _titleLabel = [[UILabel alloc]init];
23
+        _titleLabel.backgroundColor = [UIColor colorWithHex:0xF5F4F4];
24
+        _titleLabel.textColor = [UIColor colorWithHex:0x808080];
25
+        _titleLabel.font = [UIFont systemFontOfSize:13];
26
+        _titleLabel.layer.cornerRadius = 3;
27
+        _titleLabel.layer.masksToBounds = YES;
28
+        _titleLabel.textAlignment = NSTextAlignmentCenter;
29
+       
30
+       
31
+    }
32
+    return _titleLabel;
33
+}
34
+
35
+- (instancetype)initWithFrame:(CGRect)frame {
36
+    self = [super initWithFrame:frame];
37
+    if (self) {
38
+        self.backgroundColor=[UIColor colorWithHex:0xF5F4F4];
39
+        self.layer.cornerRadius=3;
40
+        self.layer.masksToBounds=YES;
41
+        [self.contentView addSubview:self.titleLabel];
42
+    }
43
+    return self;
44
+}
45
+
46
+- (void)configCellWithTitle:(NSString *)title {
47
+    self.titleLabel.frame = self.bounds;
48
+    self.titleLabel.text = title;
49
+}
50
+
51
+@end

+ 27 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowConfig.h

@@ -0,0 +1,27 @@
1
+//
2
+//  MSSAutoresizeLabelFlowConfig.h
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import <Foundation/Foundation.h>
10
+#import <UIKit/UIKit.h>
11
+
12
+@interface MSSAutoresizeLabelFlowConfig : NSObject
13
+
14
++ (MSSAutoresizeLabelFlowConfig *)  shareConfig;
15
+
16
+@property (nonatomic) UIEdgeInsets  contentInsets;
17
+@property (nonatomic) CGFloat       textMargin;
18
+@property (nonatomic) CGFloat       lineSpace;
19
+@property (nonatomic) CGFloat       itemHeight;
20
+@property (nonatomic) CGFloat       itemSpace;
21
+@property (nonatomic) CGFloat       itemCornerRaius;
22
+@property (nonatomic) UIColor       *itemColor;
23
+@property (nonatomic) UIColor       *textColor;
24
+@property (nonatomic) UIFont        *textFont;
25
+@property (nonatomic) UIColor       *backgroundColor;
26
+
27
+@end

+ 44 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowConfig.m

@@ -0,0 +1,44 @@
1
+//
2
+//  MSSAutoresizeLabelFlowConfig.m
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import "MSSAutoresizeLabelFlowConfig.h"
10
+
11
+@implementation MSSAutoresizeLabelFlowConfig
12
+
13
++ (MSSAutoresizeLabelFlowConfig *)shareConfig {
14
+    static MSSAutoresizeLabelFlowConfig *config;
15
+    static dispatch_once_t onceToken;
16
+    dispatch_once(&onceToken, ^{
17
+        config = [[self alloc]init];
18
+    });
19
+    return config;
20
+}
21
+
22
+// default
23
+
24
+- (instancetype)init {
25
+    self = [super init];
26
+    if (self) {
27
+        self.contentInsets = UIEdgeInsetsMake(10, 10, 10, 2);
28
+        self.lineSpace = 10;
29
+        self.itemHeight = 25;
30
+        self.itemSpace = 10;
31
+        self.itemCornerRaius = 3;
32
+        self.itemColor = [UIColor whiteColor];
33
+        self.itemColor = [UIColor clearColor];
34
+        self.textMargin = 20;
35
+        self.textColor = [UIColor darkTextColor];
36
+        self.textColor = [UIColor whiteColor];
37
+        self.textFont = [UIFont systemFontOfSize:15];
38
+        self.backgroundColor = [UIColor colorWithRed:0.85 green:0.85 blue:0.85 alpha:1];
39
+        self.backgroundColor = [UIColor blackColor];
40
+    }
41
+    return self;
42
+}
43
+
44
+@end

+ 30 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowLayout.h

@@ -0,0 +1,30 @@
1
+//
2
+//  MSSAutoresizeLabelFlowLayout.h
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import <UIKit/UIKit.h>
10
+
11
+@protocol MSSAutoresizeLabelFlowLayoutDelegate <NSObject>
12
+
13
+@optional
14
+
15
+- (void)layoutFinishWithNumberOfline:(NSInteger)number;
16
+
17
+@end
18
+
19
+@protocol MSSAutoresizeLabelFlowLayoutDataSource <NSObject>
20
+
21
+- (NSString *)titleForLabelAtIndexPath:(NSIndexPath *)indexPath;
22
+
23
+@end
24
+
25
+@interface MSSAutoresizeLabelFlowLayout : UICollectionViewFlowLayout
26
+
27
+@property (nonatomic,weak) id <MSSAutoresizeLabelFlowLayoutDataSource> dataSource;
28
+@property (nonatomic,weak) id <MSSAutoresizeLabelFlowLayoutDelegate> delegate;
29
+
30
+@end

+ 78 - 0
KuDianProject/Search/Controller/search/MSSAutoresizeLabelFlowLayout.m

@@ -0,0 +1,78 @@
1
+//
2
+//  MSSAutoresizeLabelFlowLayout.m
3
+//  MSSAutoresizeLabelFlow
4
+//
5
+//  Created by Mrss on 15/12/26.
6
+//  Copyright © 2015年 expai. All rights reserved.
7
+//
8
+
9
+#import "MSSAutoresizeLabelFlowLayout.h"
10
+#import "MSSAutoresizeLabelFlowConfig.h"
11
+
12
+typedef struct currentOrigin {
13
+    CGFloat     lineX;
14
+    NSInteger   lineNumber;
15
+}currentOrigin;
16
+
17
+@implementation MSSAutoresizeLabelFlowLayout {
18
+    UIEdgeInsets    contentInsets;
19
+    CGFloat         itemHeight;
20
+    CGFloat         itemSpace;
21
+    CGFloat         lineSpace;
22
+    CGFloat         itemMargin;
23
+    UIFont          *titleFont;
24
+    NSInteger       itemCount;
25
+    currentOrigin   orgin;
26
+}
27
+
28
+- (void)prepareLayout {
29
+    [super prepareLayout];
30
+    MSSAutoresizeLabelFlowConfig *config = [MSSAutoresizeLabelFlowConfig shareConfig];
31
+    contentInsets = config.contentInsets;
32
+    titleFont = config.textFont;
33
+    lineSpace = config.lineSpace;
34
+    itemHeight = config.itemHeight;
35
+    itemSpace = config.itemSpace;
36
+    itemCount = [self.collectionView numberOfItemsInSection:0];
37
+    itemMargin = config.textMargin;
38
+    orgin.lineNumber = 0;
39
+    orgin.lineX = contentInsets.left;
40
+}
41
+
42
+- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect {
43
+    NSArray *attributesArray = [super layoutAttributesForElementsInRect:rect];
44
+    for (NSInteger i = 0; i<attributesArray.count; i++) {
45
+        UICollectionViewLayoutAttributes *att = attributesArray[i];
46
+        NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0];
47
+        NSString *title = [self.dataSource titleForLabelAtIndexPath:indexPath];
48
+        CGSize size = [self sizeWithTitle:title font:titleFont];
49
+        CGFloat itemOrginX = orgin.lineX;
50
+        CGFloat itemOrginY = orgin.lineNumber*(itemHeight+lineSpace) + contentInsets.top;
51
+        CGFloat itemWidth = size.width+itemMargin;
52
+        if (itemWidth > CGRectGetWidth(self.collectionView.frame)-(contentInsets.left+contentInsets.right)) {
53
+            itemWidth = CGRectGetWidth(self.collectionView.frame)-(contentInsets.left+contentInsets.right);
54
+        }
55
+        att.frame = CGRectMake(itemOrginX, itemOrginY, itemWidth, itemHeight);
56
+        orgin.lineX += itemWidth+itemSpace;
57
+        if (i < attributesArray.count-1) {
58
+            NSIndexPath *nextIndexPath = [NSIndexPath indexPathForItem:i+1 inSection:0];
59
+            NSString *nextTitle = [self.dataSource titleForLabelAtIndexPath:nextIndexPath];
60
+            CGSize nextSize = [self sizeWithTitle:nextTitle font:titleFont];
61
+            if (nextSize.width+itemMargin > CGRectGetWidth(self.collectionView.frame)-contentInsets.right-orgin.lineX) {
62
+                orgin.lineNumber ++;
63
+                orgin.lineX = contentInsets.left;
64
+            }
65
+        }
66
+        else {
67
+            [self.delegate layoutFinishWithNumberOfline:orgin.lineNumber+1];
68
+        }
69
+    }
70
+    return attributesArray;
71
+}
72
+
73
+- (CGSize)sizeWithTitle:(NSString *)title font:(UIFont *)font {
74
+    CGRect rect = [title boundingRectWithSize:CGSizeMake(1000, itemHeight) options:NSStringDrawingTruncatesLastVisibleLine | NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil];
75
+    return rect.size;
76
+}
77
+
78
+@end

+ 3 - 1
KuDianProject/SupplyGood/Controller/KDPSupplyGoodViewController.m

@@ -10,6 +10,7 @@
10 10
 #import "XLPageViewController.h"
11 11
 #import "XLPageViewControllerConfig.h"
12 12
 #import "KDPSupplyContentViewController.h"
13
+#import "KDPSearchViewController.h"
13 14
 @interface KDPSupplyGoodViewController ()<XLPageViewControllerDelegate,XLPageViewControllerDataSrouce>
14 15
 
15 16
 @property (nonatomic, strong) XLPageViewController *pageVC;
@@ -70,7 +71,8 @@
70 71
 
71 72
 
72 73
 - (void)searchBtnClick:(UIButton *)sender{
73
-    
74
+    KDPSearchViewController *searchVC = [[KDPSearchViewController alloc] init];
75
+    [self.navigationController pushViewController:searchVC animated:NO];
74 76
 }
75 77
 
76 78
 

+ 1 - 1
Pods/Pods.xcodeproj/xcuserdata/kaipeng.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -7,7 +7,7 @@
7 7
 		<key>AFNetworking.xcscheme_^#shared#^_</key>
8 8
 		<dict>
9 9
 			<key>orderHint</key>
10
-			<integer>0</integer>
10
+			<integer>1</integer>
11 11
 		</dict>
12 12
 		<key>Bugly.xcscheme_^#shared#^_</key>
13 13
 		<dict>