Parcourir la source

生成二维码 功能完成

openlockPPP il y a 1 an
Parent
commit
5e00f8c83d
81 fichiers modifiés avec 2619 ajouts et 391 suppressions
  1. 78 4
      JiaPeiManage.xcodeproj/project.pbxproj
  2. 6 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/Contents.json
  3. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/Contents.json
  4. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标.png
  5. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标@2x.png
  6. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标@3x.png
  7. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/Contents.json
  8. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长.png
  9. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长@2x.png
  10. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长@3x.png
  11. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/Contents.json
  12. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短.png
  13. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短@2x.png
  14. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短@3x.png
  15. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/Contents.json
  16. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家.png
  17. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家@2x.png
  18. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家@3x.png
  19. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/Contents.json
  20. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部.png
  21. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部@2x.png
  22. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部@3x.png
  23. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/Contents.json
  24. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标.png
  25. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标@2x.png
  26. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标@3x.png
  27. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/Contents.json
  28. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长.png
  29. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长@2x.png
  30. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长@3x.png
  31. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/Contents.json
  32. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短.png
  33. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短@2x.png
  34. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短@3x.png
  35. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/Contents.json
  36. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框.png
  37. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框@2x.png
  38. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框@3x.png
  39. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/Contents.json
  40. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框.png
  41. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框@2x.png
  42. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框@3x.png
  43. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/Contents.json
  44. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长.png
  45. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长@2x.png
  46. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长@3x.png
  47. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/Contents.json
  48. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短.png
  49. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短@2x.png
  50. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短@3x.png
  51. 23 0
      JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/Contents.json
  52. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部.png
  53. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部@2x.png
  54. BIN
      JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部@3x.png
  55. 2 1
      JiaPeiManage/JSJP-Brigding-Header.h
  56. 2 0
      JiaPeiManage/Sources/Extensions/DefaultsKeys+Key.swift
  57. 36 0
      JiaPeiManage/Sources/Extensions/UIImage+Placeholder.swift
  58. 1 1
      JiaPeiManage/Sources/Main/App/CompositionRoot.swift
  59. 17 1
      JiaPeiManage/Sources/Models/CoachcityModel.swift
  60. 29 2
      JiaPeiManage/Sources/Models/UserInfoModel.swift
  61. 10 3
      JiaPeiManage/Sources/Modulars/Home/Controllers/HomeViewController.swift
  62. 4 4
      JiaPeiManage/Sources/Modulars/Home/Controllers/HomeViewController.xib
  63. 14 3
      JiaPeiManage/Sources/Modulars/Login/Controllers/LoginViewController.swift
  64. 0 327
      JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsOfficialPageController.swift
  65. 103 35
      JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsPageController.swift
  66. 83 0
      JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsOfficialPageHeaderView.swift
  67. 279 0
      JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsOfficialPageHeaderView.xib
  68. 49 0
      JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachAppdownloadPageController.swift
  69. 92 0
      JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachAppdownloadPageController.xib
  70. 100 0
      JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachQRPageController.swift
  71. 253 0
      JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachQRPageController.xib
  72. 2 2
      JiaPeiManage/Sources/Networking/NetEnvironment.swift
  73. 1 1
      JiaPeiManage/Sources/Networking/Networking.swift
  74. 3 3
      JiaPeiManage/Sources/Services/CoachService.swift
  75. 18 0
      JiaPeiManage/Sources/Thirdparty/Utils/3DES/DES3Util.h
  76. 97 0
      JiaPeiManage/Sources/Thirdparty/Utils/3DES/DES3Util.m
  77. 183 0
      JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMBase64.h
  78. 697 0
      JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMBase64.m
  79. 138 0
      JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMDefines.h
  80. 6 1
      JiaPeiManage/Sources/Utils/NYSwRouter.swift
  81. 17 3
      JiaPeiManage/Sources/Utils/URLNavigationMap.swift

+ 78 - 4
JiaPeiManage.xcodeproj/project.pbxproj

@@ -22,6 +22,14 @@
 		903628D02A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 903628CF2A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib */; };
 		903628D22A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 903628D12A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift */; };
 		903628D42A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 903628D32A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib */; };
+		9043AD9B2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9043AD9A2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift */; };
+		9043AD9D2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9043AD9C2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib */; };
+		9043ADA22A554DE9005F6F81 /* CoachQRPageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9043ADA12A554DE9005F6F81 /* CoachQRPageController.swift */; };
+		9043ADA42A554E2E005F6F81 /* CoachQRPageController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9043ADA32A554E2E005F6F81 /* CoachQRPageController.xib */; };
+		9043ADA62A556349005F6F81 /* CoachAppdownloadPageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9043ADA52A556349005F6F81 /* CoachAppdownloadPageController.swift */; };
+		9043ADA82A5563A9005F6F81 /* CoachAppdownloadPageController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9043ADA72A5563A9005F6F81 /* CoachAppdownloadPageController.xib */; };
+		9043ADB02A569309005F6F81 /* GTMBase64.m in Sources */ = {isa = PBXBuildFile; fileRef = 9043ADAE2A569309005F6F81 /* GTMBase64.m */; };
+		9043ADB12A569309005F6F81 /* DES3Util.m in Sources */ = {isa = PBXBuildFile; fileRef = 9043ADAF2A569309005F6F81 /* DES3Util.m */; };
 		9076C5DA2A386B2300E5E33F /* MineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9076C5D92A386B2300E5E33F /* MineViewController.swift */; };
 		9076C5DC2A386B2F00E5E33F /* MineViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9076C5DB2A386B2F00E5E33F /* MineViewController.xib */; };
 		9076C5DF2A387CBC00E5E33F /* MeTraineeListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9076C5DE2A387CBC00E5E33F /* MeTraineeListViewController.swift */; };
@@ -69,7 +77,6 @@
 		90BC4BE02A3C46C4006FD683 /* MeTraineeDetailsPageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90BC4BDF2A3C46C4006FD683 /* MeTraineeDetailsPageViewController.xib */; };
 		90BC4BE52A3DDF33006FD683 /* MeTraineeSubjectHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90BC4BE42A3DDF33006FD683 /* MeTraineeSubjectHeaderView.swift */; };
 		90BC4BE72A3DDF44006FD683 /* MeTraineeSubjectHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 90BC4BE62A3DDF44006FD683 /* MeTraineeSubjectHeaderView.xib */; };
-		90C9C5552A4C7189006D3921 /* StatisticsOfficialPageController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C9C5542A4C7189006D3921 /* StatisticsOfficialPageController.swift */; };
 		90C9C5592A4C7B45006D3921 /* Notification+NY.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90C9C5582A4C7B45006D3921 /* Notification+NY.swift */; };
 		90CE52192A36C0710033BD06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90CE52182A36C0710033BD06 /* AppDelegate.swift */; };
 		90CE52222A36C0720033BD06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90CE52212A36C0720033BD06 /* Assets.xcassets */; };
@@ -184,6 +191,17 @@
 		903628CF2A41AF3100F0AA6C /* MeTraineeDetails02HeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeDetails02HeaderView.xib; sourceTree = "<group>"; };
 		903628D12A41AFA400F0AA6C /* MeTraineeDetails02Cell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeDetails02Cell.swift; sourceTree = "<group>"; };
 		903628D32A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeDetails02Cell.xib; sourceTree = "<group>"; };
+		9043AD9A2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsOfficialPageHeaderView.swift; sourceTree = "<group>"; };
+		9043AD9C2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = StatisticsOfficialPageHeaderView.xib; sourceTree = "<group>"; };
+		9043ADA12A554DE9005F6F81 /* CoachQRPageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoachQRPageController.swift; sourceTree = "<group>"; };
+		9043ADA32A554E2E005F6F81 /* CoachQRPageController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoachQRPageController.xib; sourceTree = "<group>"; };
+		9043ADA52A556349005F6F81 /* CoachAppdownloadPageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoachAppdownloadPageController.swift; sourceTree = "<group>"; };
+		9043ADA72A5563A9005F6F81 /* CoachAppdownloadPageController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CoachAppdownloadPageController.xib; sourceTree = "<group>"; };
+		9043ADAB2A569309005F6F81 /* DES3Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DES3Util.h; sourceTree = "<group>"; };
+		9043ADAC2A569309005F6F81 /* GTMBase64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMBase64.h; sourceTree = "<group>"; };
+		9043ADAD2A569309005F6F81 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMDefines.h; sourceTree = "<group>"; };
+		9043ADAE2A569309005F6F81 /* GTMBase64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMBase64.m; sourceTree = "<group>"; };
+		9043ADAF2A569309005F6F81 /* DES3Util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DES3Util.m; sourceTree = "<group>"; };
 		9076C5D92A386B2300E5E33F /* MineViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MineViewController.swift; sourceTree = "<group>"; };
 		9076C5DB2A386B2F00E5E33F /* MineViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MineViewController.xib; sourceTree = "<group>"; };
 		9076C5DE2A387CBC00E5E33F /* MeTraineeListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeListViewController.swift; sourceTree = "<group>"; };
@@ -235,7 +253,6 @@
 		90BC4BDF2A3C46C4006FD683 /* MeTraineeDetailsPageViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeDetailsPageViewController.xib; sourceTree = "<group>"; };
 		90BC4BE42A3DDF33006FD683 /* MeTraineeSubjectHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MeTraineeSubjectHeaderView.swift; sourceTree = "<group>"; };
 		90BC4BE62A3DDF44006FD683 /* MeTraineeSubjectHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MeTraineeSubjectHeaderView.xib; sourceTree = "<group>"; };
-		90C9C5542A4C7189006D3921 /* StatisticsOfficialPageController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatisticsOfficialPageController.swift; sourceTree = "<group>"; };
 		90C9C5582A4C7B45006D3921 /* Notification+NY.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Notification+NY.swift"; sourceTree = "<group>"; };
 		90CE52152A36C0700033BD06 /* JiaPeiManage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JiaPeiManage.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		90CE52182A36C0710033BD06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -370,6 +387,53 @@
 			path = MeTraineeDetails;
 			sourceTree = "<group>";
 		};
+		9043AD9E2A554BF9005F6F81 /* 二维码 */ = {
+			isa = PBXGroup;
+			children = (
+				9043ADA02A554C2F005F6F81 /* Views */,
+				9043AD9F2A554C27005F6F81 /* Controllers */,
+			);
+			path = "二维码";
+			sourceTree = "<group>";
+		};
+		9043AD9F2A554C27005F6F81 /* Controllers */ = {
+			isa = PBXGroup;
+			children = (
+				9043ADA12A554DE9005F6F81 /* CoachQRPageController.swift */,
+				9043ADA32A554E2E005F6F81 /* CoachQRPageController.xib */,
+				9043ADA52A556349005F6F81 /* CoachAppdownloadPageController.swift */,
+				9043ADA72A5563A9005F6F81 /* CoachAppdownloadPageController.xib */,
+			);
+			path = Controllers;
+			sourceTree = "<group>";
+		};
+		9043ADA02A554C2F005F6F81 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
+		9043ADA92A5692DE005F6F81 /* Utils */ = {
+			isa = PBXGroup;
+			children = (
+				9043ADAA2A569309005F6F81 /* 3DES */,
+			);
+			path = Utils;
+			sourceTree = "<group>";
+		};
+		9043ADAA2A569309005F6F81 /* 3DES */ = {
+			isa = PBXGroup;
+			children = (
+				9043ADAB2A569309005F6F81 /* DES3Util.h */,
+				9043ADAF2A569309005F6F81 /* DES3Util.m */,
+				9043ADAC2A569309005F6F81 /* GTMBase64.h */,
+				9043ADAD2A569309005F6F81 /* GTMDefines.h */,
+				9043ADAE2A569309005F6F81 /* GTMBase64.m */,
+			);
+			path = 3DES;
+			sourceTree = "<group>";
+		};
 		9076C5D52A38694000E5E33F /* Controllers */ = {
 			isa = PBXGroup;
 			children = (
@@ -465,6 +529,8 @@
 				90971E972A4AB20600267B7F /* StatisticsPageCell.xib */,
 				900C73122A4D216D00532B3D /* StatisticsSelectDateView.swift */,
 				900C73142A4D220000532B3D /* StatisticsSelectDateView.xib */,
+				9043AD9A2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift */,
+				9043AD9C2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib */,
 			);
 			path = Views;
 			sourceTree = "<group>";
@@ -473,7 +539,6 @@
 			isa = PBXGroup;
 			children = (
 				90971E732A498C4C00267B7F /* StatisticsPageController.swift */,
-				90C9C5542A4C7189006D3921 /* StatisticsOfficialPageController.swift */,
 			);
 			path = Controllers;
 			sourceTree = "<group>";
@@ -481,6 +546,7 @@
 		90971E812A4A87EF00267B7F /* Thirdparty */ = {
 			isa = PBXGroup;
 			children = (
+				9043ADA92A5692DE005F6F81 /* Utils */,
 				90971E822A4A87EF00267B7F /* GJRatioAutoLayout */,
 			);
 			path = Thirdparty;
@@ -587,6 +653,7 @@
 		90CE523B2A36E4EE0033BD06 /* Modulars */ = {
 			isa = PBXGroup;
 			children = (
+				9043AD9E2A554BF9005F6F81 /* 二维码 */,
 				90971E702A498A2000267B7F /* Statistics */,
 				9076C5D62A386AFA00E5E33F /* 学员 */,
 				90CE52E52A36E7D00033BD06 /* Mine */,
@@ -1011,6 +1078,7 @@
 				908FEEAD2A42E23C00BEB81C /* MeTraineeDetails03Cell.xib in Resources */,
 				90CE528A2A36E5460033BD06 /* PopOverViewCell.xib in Resources */,
 				909DA5D12A3AC2460034501F /* UpdatePasswordViewController.xib in Resources */,
+				9043AD9D2A5422BE005F6F81 /* StatisticsOfficialPageHeaderView.xib in Resources */,
 				90CE52222A36C0720033BD06 /* Assets.xcassets in Resources */,
 				900C73152A4D220000532B3D /* StatisticsSelectDateView.xib in Resources */,
 				90971E942A4AB18D00267B7F /* StatisticsPageHeaderView.xib in Resources */,
@@ -1019,10 +1087,12 @@
 				90CE52EB2A36E8680033BD06 /* LoginViewController.xib in Resources */,
 				909DA5D52A3AE0160034501F /* MeTraineeSubjectCell.xib in Resources */,
 				908FEE9D2A42CA3F00BEB81C /* MeTraineeDetails04HeaderView.xib in Resources */,
+				9043ADA82A5563A9005F6F81 /* CoachAppdownloadPageController.xib in Resources */,
 				90CE52852A36E5460033BD06 /* EmptyView.xib in Resources */,
 				908FEEA92A42E1BF00BEB81C /* MeTraineeDetails03HeaderView.xib in Resources */,
 				90CE53002A36F7110033BD06 /* HomeViewController.xib in Resources */,
 				90BC4BE72A3DDF44006FD683 /* MeTraineeSubjectHeaderView.xib in Resources */,
+				9043ADA42A554E2E005F6F81 /* CoachQRPageController.xib in Resources */,
 				909DA5CD2A3AC00D0034501F /* MeTraineeSearchPageViewController.xib in Resources */,
 				903628D42A41AFD700F0AA6C /* MeTraineeDetails02Cell.xib in Resources */,
 				903628CC2A417BE700F0AA6C /* MeTraineeDetails01HeaderView.xib in Resources */,
@@ -1117,10 +1187,12 @@
 				90971E962A4AB1F400267B7F /* StatisticsPageCell.swift in Sources */,
 				90CE52892A36E5460033BD06 /* PopOverViewCell.swift in Sources */,
 				90CE52332A36E4600033BD06 /* BaseViewController.swift in Sources */,
+				9043ADB02A569309005F6F81 /* GTMBase64.m in Sources */,
 				90CE52A32A36E59A0033BD06 /* UIImageView+Kingfisher.swift in Sources */,
 				903628C22A41768400F0AA6C /* MeTraineeDetails03Controller.swift in Sources */,
 				90CE527D2A36E5460033BD06 /* Refreshable.swift in Sources */,
 				90CE52472A36E5170033BD06 /* NYImage.swift in Sources */,
+				9043AD9B2A542267005F6F81 /* StatisticsOfficialPageHeaderView.swift in Sources */,
 				90CE52A42A36E59A0033BD06 /* DispatchQueue+Extension.swift in Sources */,
 				90CE52782A36E5460033BD06 /* Timer+LWPlayer.swift in Sources */,
 				90CE52A02A36E59A0033BD06 /* Data+Cache.swift in Sources */,
@@ -1204,8 +1276,8 @@
 				908FEEA32A42D35000BEB81C /* BaseGroupTableViewController.swift in Sources */,
 				90CE527E2A36E5460033BD06 /* NetAnimationLoadable.swift in Sources */,
 				90CE52D62A36E6000033BD06 /* NYSwRouter.swift in Sources */,
-				90C9C5552A4C7189006D3921 /* StatisticsOfficialPageController.swift in Sources */,
 				90CE52AB2A36E59A0033BD06 /* UIViewController+NetAnimation.swift in Sources */,
+				9043ADB12A569309005F6F81 /* DES3Util.m in Sources */,
 				900C73132A4D216D00532B3D /* StatisticsSelectDateView.swift in Sources */,
 				90CE527A2A36E5460033BD06 /* LWPlayerDelegate.swift in Sources */,
 				90CE52CC2A36E5EC0033BD06 /* NotificationCenter+Rx.swift in Sources */,
@@ -1219,6 +1291,7 @@
 				90971E6D2A4979D000267B7F /* StatisticsAPI.swift in Sources */,
 				90CE52802A36E5460033BD06 /* NYSwToaster.swift in Sources */,
 				908FEE9F2A42CBDB00BEB81C /* MeTraineeDetails04Cell.swift in Sources */,
+				9043ADA22A554DE9005F6F81 /* CoachQRPageController.swift in Sources */,
 				90CE52DC2A36E6250033BD06 /* NYAppCongfigure.swift in Sources */,
 				90CE52322A36E4600033BD06 /* BaseCollectionViewController.swift in Sources */,
 				903628CE2A41AF1500F0AA6C /* MeTraineeDetails02HeaderView.swift in Sources */,
@@ -1227,6 +1300,7 @@
 				903628BE2A41766B00F0AA6C /* MeTraineeDetails01Controller.swift in Sources */,
 				90971E6F2A4979F300267B7F /* StatisticsService.swift in Sources */,
 				908FEE9B2A42CA1D00BEB81C /* MeTraineeDetails04HeaderView.swift in Sources */,
+				9043ADA62A556349005F6F81 /* CoachAppdownloadPageController.swift in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 6 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/android_icon.imageset/安卓图标@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_long.imageset/背景长@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/androidviewbg_short.imageset/背景短@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/coach_top.imageset/教练管家@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/code-navtop.imageset/顶部@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/ios_icon.imageset/苹果图标@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_long.imageset/背景长@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/iosviewbg_short.imageset/背景短@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "filename" : "二维码手机框.png",
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "二维码手机框@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "二维码手机框@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/qrcode_bg.imageset/二维码手机框@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/texts_image.imageset/文字框@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_long.imageset/背景长@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/viewbg_short.imageset/背景短@3x.png


+ 23 - 0
JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/Contents.json

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

BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部@2x.png


BIN
JiaPeiManage/Assets.xcassets/Modules/QRCode/顶部.imageset/顶部@3x.png


+ 2 - 1
JiaPeiManage/JSJP-Brigding-Header.h

@@ -14,5 +14,6 @@
 #import <QMUIKit/QMUIKit.h>
 #import <SDWebImage/SDWebImage.h>
 #import <UMCommon/UMCommon.h>
-
+//加密
+#import "DES3Util.h"
 #endif /* JSJP_Brigding_Header_h */

+ 2 - 0
JiaPeiManage/Sources/Extensions/DefaultsKeys+Key.swift

@@ -24,5 +24,7 @@ extension DefaultsKeys {
     
     var city:DefaultsKey<String?> { .init("userCity", defaultValue:"") }
     
+    var cityPower:DefaultsKey<String?> { .init("cityPower", defaultValue:"") }
+    
     var currentEnvironment: DefaultsKey<NetEnvironment> { .init("currentEnvironment", defaultValue: .res) }
 }

+ 36 - 0
JiaPeiManage/Sources/Extensions/UIImage+Placeholder.swift

@@ -37,5 +37,41 @@ extension UIImage {
         return newImage
     }
     
+    class func generateQRCode(from jsonString: String, size: CGSize) -> UIImage? {
+        // 将 JSON 字符串转换为二进制数据
+        guard let jsonData = jsonString.data(using: .utf8) else {
+            return nil
+        }
+        
+        // 创建 CIFilter 对象,使用 "CIQRCodeGenerator" 过滤器生成二维码
+        guard let filter = CIFilter(name: "CIQRCodeGenerator") else {
+            return nil
+        }
+        
+        // 设置输入数据
+        filter.setValue(jsonData, forKey: "inputMessage")
+        
+        // 设置纠错级别,默认为 "L" (低)
+        filter.setValue("M", forKey: "inputCorrectionLevel")
+        
+        // 获取生成的 CIImage
+        guard let ciImage = filter.outputImage else {
+            return nil
+        }
+        
+        // 对 CIImage 进行缩放,以适应目标大小
+        let scaleX = size.width / ciImage.extent.size.width
+        let scaleY = size.height / ciImage.extent.size.height
+        let transformedImage = ciImage.transformed(by: CGAffineTransform(scaleX: scaleX, y: scaleY))
+        
+        // 将 CIImage 转换为 UIImage
+        let context = CIContext()
+        guard let cgImage = context.createCGImage(transformedImage, from: transformedImage.extent) else {
+            return nil
+        }
+        let qrCodeImage = UIImage(cgImage: cgImage)
+        
+        return qrCodeImage
+    }
     
 }

+ 1 - 1
JiaPeiManage/Sources/Main/App/CompositionRoot.swift

@@ -87,7 +87,7 @@ final class CompositionRoot {
         LocalManager.userInfo.openTimes += 1
 
         //设置环境  --默认是线上环境
-        Defaults.currentEnvironment = .res
+        Defaults.currentEnvironment = .dev
 
         //ToastView
         ToastView.appearance().font = NYFont.SysFont.sys_15

+ 17 - 1
JiaPeiManage/Sources/Models/CoachcityModel.swift

@@ -8,7 +8,23 @@ import ObjectMapper
 import SwiftyUserDefaults
 
 struct CityItem :ImmutableMappable{
-
+//    "searchValue": null,
+//            "createBy": "admin",
+//            "createTime": "2023-06-12 17:35:14",
+//            "updateTime": null,
+//            "updateBy": null,
+//            "remark": "1",
+//            "params": {},
+//            "dictCode": 295,
+//            "dictSort": 0,
+//            "dictLabel": "福州市",
+//            "dictValue": "3501",
+//            "dictType": "coach_city",
+//            "cssClass": null,
+//            "listClass": null,
+//            "isDefault": "N",
+//            "status": "0",
+//            "default": false
     var searchValue:String  = ""
     var createBy:String  = ""
     var createTime:String  = ""

+ 29 - 2
JiaPeiManage/Sources/Models/UserInfoModel.swift

@@ -121,11 +121,29 @@ struct SchInfo :ImmutableMappable{
     }
 }
 
+struct CoachJsonInfo :ImmutableMappable,Codable{
+    
+    var coachNum:String = ""
+    var dqbh:String = ""
+    var id:Int = 0
+    var name:String = ""
+    var schoolId:Int = 0
+    var schoolName:String = ""
+    
+    init(map: Map) throws {
+        coachNum = try map.value("coachNum") ?? ""
+        dqbh = try map.value("dqbh") ?? ""
+        id = try map.value("id") ?? 0
+        name = try map.value("name") ?? ""
+        schoolId = try map.value("schoolId") ?? 0
+        schoolName = try map.value("schoolName") ?? ""
+    }
+}
 
 
 struct UserInfo :ImmutableMappable{
    
-    
+
     var id:Int = 0
     var coachNum:String = ""
     var recordDate:String = ""
@@ -233,7 +251,16 @@ struct UserInfo :ImmutableMappable{
             return Defaults.city
         }
     }
-    
+    var cityPower:String? {
+        set {
+            if newValue != nil{
+                Defaults.cityPower = newValue! ?? ""
+            }
+        }
+        get {
+            return Defaults.cityPower
+        }
+    }
     
     init(){}
     init(map: Map) throws {

+ 10 - 3
JiaPeiManage/Sources/Modulars/Home/Controllers/HomeViewController.swift

@@ -54,7 +54,11 @@ final class HomeViewController: BaseViewController {
         //我的学员-action-btn
         self.meStuAction_button.rx.tap.subscribe ({ [unowned self] (_)  in
             if !LocalManager.isOpenLogin() { return}
-            NYSwRouter.open(NYSwOpenType.traineetab.rawValue)
+            if LocalManager.userInfo.cityPower == "1"{
+                NYSwRouter.open(NYSwOpenType.traineetab.rawValue)
+                return
+            }
+            NYSwRouter.push(NYSwPushType.trainee_list.path)
         }).disposed(by: disposeBag)
         //在校学员-action
         self.onSchoolAction_button.rx.tap.subscribe ({ [unowned self] (_)  in
@@ -64,7 +68,7 @@ final class HomeViewController: BaseViewController {
         //生成二维码-action
         self.codeQrAction_button.rx.tap.subscribe ({ [unowned self] (_)  in
             if !LocalManager.isOpenLogin() { return}
-            
+            NYSwRouter.push(NYSwPushType.coach_qrcode.path)
         }).disposed(by: disposeBag)
         //绑定学员-action
         self.biandAction_button.rx.tap.subscribe ({ [unowned self] (_)  in
@@ -75,8 +79,11 @@ final class HomeViewController: BaseViewController {
         self.statisticsAction_button.rx.tap.subscribe ({ [unowned self] (_)  in
             if !LocalManager.isOpenLogin() { return}
             print("统计-action")
+            if LocalManager.userInfo.cityPower == "1"{
+                NYSwRouter.push(NYSwPushType.trainee_statistics_official.path)
+                return
+            }
             NYSwRouter.push(NYSwPushType.trainee_statistics.path)
-//            NYSwRouter.push(NYSwPushType.trainee_statistics_official.path)
         }).disposed(by: disposeBag)
         //个人中心-action
         self.mineAction_button.rx.tap.subscribe ({ [unowned self] (_)  in

+ 4 - 4
JiaPeiManage/Sources/Modulars/Home/Controllers/HomeViewController.xib

@@ -226,7 +226,7 @@
                                     </userDefinedRuntimeAttributes>
                                 </view>
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="BOF-BH-jPr" userLabel="View-统计">
-                                    <rect key="frame" x="15" y="386" width="170" height="150"/>
+                                    <rect key="frame" x="15" y="541" width="170" height="150"/>
                                     <subviews>
                                         <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="home_06" translatesAutoresizingMaskIntoConstraints="NO" id="VCf-ID-72R">
                                             <rect key="frame" x="52" y="64" width="66" height="66"/>
@@ -270,7 +270,7 @@
                                     </userDefinedRuntimeAttributes>
                                 </view>
                                 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="jJu-2o-jKp" userLabel="View-绑定学员">
-                                    <rect key="frame" x="15" y="541" width="170" height="150"/>
+                                    <rect key="frame" x="15" y="386" width="170" height="150"/>
                                     <subviews>
                                         <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="绑定学员" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qLB-zu-zdB">
                                             <rect key="frame" x="20" y="21" width="100" height="30"/>
@@ -387,11 +387,11 @@
                                 <constraint firstAttribute="trailing" secondItem="Mdn-AQ-I8p" secondAttribute="trailing" constant="15" id="OPw-0s-Jgk"/>
                                 <constraint firstItem="Jve-BG-5J7" firstAttribute="width" secondItem="Mdn-AQ-I8p" secondAttribute="width" id="POr-HD-leU"/>
                                 <constraint firstAttribute="height" constant="750" id="Uk1-43-dGS"/>
-                                <constraint firstItem="BOF-BH-jPr" firstAttribute="top" secondItem="4a7-TG-aBk" secondAttribute="bottom" constant="5" id="X5S-8l-UHp"/>
+                                <constraint firstItem="BOF-BH-jPr" firstAttribute="top" secondItem="jJu-2o-jKp" secondAttribute="bottom" constant="5" id="X5S-8l-UHp"/>
                                 <constraint firstAttribute="trailing" secondItem="Jve-BG-5J7" secondAttribute="trailing" constant="15" id="Yqj-s9-DdD"/>
                                 <constraint firstItem="4a7-TG-aBk" firstAttribute="top" secondItem="obS-bj-agt" secondAttribute="bottom" constant="20" id="ZeU-p5-ZEx"/>
                                 <constraint firstItem="4a7-TG-aBk" firstAttribute="leading" secondItem="ire-nL-N9x" secondAttribute="leading" constant="15" id="apO-Zv-kfo"/>
-                                <constraint firstItem="jJu-2o-jKp" firstAttribute="top" secondItem="BOF-BH-jPr" secondAttribute="bottom" constant="5" id="az9-4P-QN7"/>
+                                <constraint firstItem="jJu-2o-jKp" firstAttribute="top" secondItem="4a7-TG-aBk" secondAttribute="bottom" constant="5" id="az9-4P-QN7"/>
                                 <constraint firstAttribute="trailing" secondItem="6eJ-gf-jfD" secondAttribute="trailing" constant="15" id="dFV-k5-EFe"/>
                                 <constraint firstItem="Jve-BG-5J7" firstAttribute="leading" secondItem="4a7-TG-aBk" secondAttribute="trailing" constant="5" id="elU-kM-Bzh"/>
                                 <constraint firstItem="jJu-2o-jKp" firstAttribute="width" secondItem="6eJ-gf-jfD" secondAttribute="width" id="g1F-GS-anS"/>

+ 14 - 3
JiaPeiManage/Sources/Modulars/Login/Controllers/LoginViewController.swift

@@ -38,6 +38,7 @@ final class LoginViewController: BaseViewController {
     @IBOutlet weak var userprivacy_button: UIButton!
     
     var city:String = ""
+    var cityPower:String = ""  //地区权限
     var cityItems:[CityItem] = []
     var citys: [String:String] = [:]
     var selectedItemIndex = 0
@@ -145,6 +146,7 @@ final class LoginViewController: BaseViewController {
                         LocalManager.userInfo.userAccount = account
                         LocalManager.userInfo.password = password
                         LocalManager.userInfo.city = city
+                        LocalManager.userInfo.cityPower = cityPower
                         //登录api RX 订阅 观察 销毁 三部曲
                         NYTips.show()
                         self.loginService.loginRequest(user_name: account, user_password: password,city: city)
@@ -188,9 +190,18 @@ final class LoginViewController: BaseViewController {
                 return
             }
             self?.selectedItemIndex = dialogViewController.selectedItemIndex
-            let item = self!.cityItems[dialogViewController.selectedItemIndex]
-            self?.city = item.dictValue //编码
-            self?.userlocation_textField.text = item.dictLabel
+            let keyname = dialogViewController.items![self!.selectedItemIndex]
+//            self.citys[cityItem.dictLabel] = cityItem.dictValue
+            var item:CityItem?
+            for cityItem in self!.cityItems {
+                if cityItem.dictLabel == keyname {
+                    item = cityItem
+                    break
+                }
+            }
+            self?.city = item!.dictValue //编码
+            self?.cityPower = item!.remark //地区权限
+            self?.userlocation_textField.text = item?.dictLabel
             dialogViewController.hide()
         }
         dialogViewController.show()

+ 0 - 327
JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsOfficialPageController.swift

@@ -1,327 +0,0 @@
-//
-//  StatisticsOfficialPageController.swift
-//  JiaPeiManage
-//
-//  Created by Ning.ge on 2023/6/28.
-//
-
-import UIKit
-import RxSwift
-import RxCocoa
-import PGDatePicker
-
-final class StatisticsOfficialPageController: BaseGroupTableViewController {
-
-    let cellIdentifier:String = "_StatisticsOfficialPageCell"
-    // MARK: 服务属性
-    private let statisticsService: StatisticsServiceType = StatisticsService(networking: StatisticsNetworking())
-    // MARK: UI let
-    let statusBar = UIView().then {
-        $0.backgroundColor = UIColor.db_theme
-    }
-    
-    let navBar = MeTraineeNavBar.loadFromNib().then {
-        $0.title_label.text = "全部报名统计"
-    }
-    
-    let headerView = StatisticsPageHeaderView.loadFromNib().then {
-        $0.backgroundColor = .db_theme
-    }
-    // MARK: 数据
-    var stuTotalCountDataModel:StuTotalCountDataModel?
-    var stuCountDataModel:StuCountDataModel?
-    var dateType:DateType = .day
-    var startDate:String = ""
-    var endDate:String = ""
-    var fieldType:Int = 1 //1:时间 2:学员数
-    var sortType:Int = 2 //1:正序 2:倒序
-    
-    var datePicCount = 0 //选择器 -日期end 2
-    
-    override func setupConstraints() {
-        
-        statusBar.snp.makeConstraints { (make) in
-            make.left.right.top.equalToSuperview()
-            make.height.equalTo(Metric.statusBarHeight)
-        }
-        
-        navBar.snp.remakeConstraints { (make) in
-            make.left.right.equalToSuperview()
-            make.height.equalTo(Metric.navBarHeight)
-            make.top.equalTo(statusBar.snp.bottom)
-        }
-        
-        tableView.snp.remakeConstraints { make in
-            make.top.equalTo(navBar.snp.bottom)
-            make.left.right.bottom.equalToSuperview()
-        }
-        
-    }
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupUI()
-        biandView()
-        getStatisticsList(isLoading: true)
-    }
-    
-    // MARK: 私有方法
-    //显示时间选择器
-    func showPGDatePickManager(){
-        self.datePicCount+=1
-        switch dateType {
-        case .day:
-            let datePickerManager = PGDatePickManager()
-            datePickerManager.headerViewBackgroundColor = UIColor("#031223")
-            datePickerManager.titleLabel.text = "选择年月日"
-            datePickerManager.titleLabel.textColor = UIColor.white
-            datePickerManager.cancelButtonTextColor = .db_fontGray
-            datePickerManager.confirmButtonTextColor = .db_green
-            let datePicker = datePickerManager.datePicker!
-            datePicker.lineBackgroundColor = .db_green
-            datePicker.textColorOfSelectedRow = .db_green
-            datePicker.backgroundColor = UIColor("#031223")
-            datePicker.delegate = self
-            datePicker.isHiddenMiddleText = false;
-            datePicker.datePickerType = .segment;
-            datePicker.datePickerMode = .date
-            self.present(datePickerManager, animated: false, completion: nil)
-        case .month:
-            let datePickerManager = PGDatePickManager()
-            datePickerManager.headerViewBackgroundColor = UIColor("#031223")
-            datePickerManager.titleLabel.text = "选择年月"
-            datePickerManager.titleLabel.textColor = UIColor.white
-            datePickerManager.cancelButtonTextColor = .db_fontGray
-            datePickerManager.confirmButtonTextColor = .db_green
-            let datePicker = datePickerManager.datePicker!
-            datePicker.lineBackgroundColor = .db_green
-            datePicker.textColorOfSelectedRow = .db_green
-            datePicker.backgroundColor = UIColor("#031223")
-            datePicker.delegate = self
-            datePicker.isHiddenMiddleText = false;
-            datePicker.datePickerType = .segment
-            datePicker.datePickerMode = .yearAndMonth
-            self.present(datePickerManager, animated: false, completion: nil)
-        case .year:
-            let datePickerManager = PGDatePickManager()
-            datePickerManager.headerViewBackgroundColor = UIColor("#031223")
-            datePickerManager.titleLabel.text = "选择年"
-            datePickerManager.titleLabel.textColor = UIColor.white
-            datePickerManager.cancelButtonTextColor = .db_fontGray
-            datePickerManager.confirmButtonTextColor = .db_green
-            let datePicker = datePickerManager.datePicker!
-            datePicker.lineBackgroundColor = .db_green
-            datePicker.textColorOfSelectedRow = .db_green
-            datePicker.backgroundColor = UIColor("#031223")
-            datePicker.delegate = self
-            datePicker.isHiddenMiddleText = false;
-            datePicker.datePickerType = .segment
-            datePicker.datePickerMode = .year
-            self.present(datePickerManager, animated: false, completion: nil)
-        }
-    }
-    //配置显示时间
-    func configUIdata(){
-        
-        // 根据不同的 dateType 进行相应的数据请求
-        var starttime = ""
-        var endtime = ""
-        switch dateType {
-        case .day:
-            starttime = startDate
-            endtime = endDate
-        case .month:
-            starttime = String(startDate.prefix(7))
-            endtime = String(endDate.prefix(7))
-        case .year:
-            starttime = String(startDate.prefix(4))
-            endtime = String(endDate.prefix(4))
-        }
-        headerView.date_section_button.setTitle("\(starttime)~\(endtime)", for: .normal)
-        
-    }
-    
-    func setupUI(){
-        self.view.addSubview(navBar)
-        self.view.addSubview(statusBar)
-        self.view.backgroundColor = .db_theme
-        self.navBar.back_button.addTarget(self, action: #selector(actionBackdo), for: .touchUpInside)
-        self.navBar.search_button.isHidden = true
-        self.endDate = NYDate.getThisDate()
-        self.startDate = self.endDate.prefix(7)+"-01"
-        configUIdata()
-        //header - 事件
-        headerView.items_date_segmented.rx.selectedSegmentIndex
-                .map { DateType(rawValue: $0)! }
-                    .subscribe(onNext: { [weak self] dateType in
-                        self?.dateType = dateType
-                        self?.configUIdata()
-                        self?.switchStatisticsStuCount()
-                        print("datetype = \(dateType)")
-                    })
-                    .disposed(by: disposeBag)
-        //日前选择
-        headerView.date_section_button.rx.tap.subscribe ({  [unowned self] (_) in
-            self.showPGDatePickManager()
-        }).disposed(by: disposeBag)
-        //时间排序
-        headerView.time_button.rx.tap
-            .subscribe ({  [unowned self] (_) in
-                headerView.time_button.isSelected = !headerView.time_button.isSelected
-                self.fieldType = 1 //1:时间 2:学员数
-                self.sortType = headerView.time_button.isSelected ? 1:2
-                self.switchStatisticsStuCount()
-        }).disposed(by: disposeBag)
-        //学员排序
-        headerView.student_button.rx.tap.subscribe ({  [unowned self] (_) in
-            headerView.student_button.isSelected = !headerView.student_button.isSelected
-            self.fieldType = 2 //1:时间 2:学员数
-            self.sortType = headerView.student_button.isSelected ? 1:2
-            self.switchStatisticsStuCount()
-        }).disposed(by: disposeBag)
-    }
-    func biandView(){
-        tableView.delegate = self
-        tableView.dataSource = self
-        tableView.separatorStyle = .none //去除分割线
-        tableView.register(UINib(nibName: "StatisticsPageCell", bundle: nil), forCellReuseIdentifier: cellIdentifier)
-        tableView.rowHeight = 44.f
-        tableView.contentInset = UIEdgeInsets(top: -25, left: 0, bottom: -25, right: 0)
-        setupRefreshHeader(tableView) {[unowned self] in
-            self.getStatisticsList(isLoading: false)
-        }
-    }
-    
-
-    //获取统计报名
-    func getStatisticsList(isLoading:Bool){
-        if isLoading {NYTips.show()}
-        self.statisticsService.statisticsStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId).subscribe(onSuccess: {[unowned self] stuTotalCountDataModel in
-                print("成功%@",stuTotalCountDataModel)
-                self.stuTotalCountDataModel = stuTotalCountDataModel
-                
-                self.statisticsService.everyDayStuCountRequest(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startDate: self.startDate, endDate: self.endDate, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
-                        self.stuCountDataModel = stuCountDataModel
-                        self.hideLoadAnimation()
-                        self.tableView.reloadData()
-                        self.stopRefresh()
-                        NYTips.hide()
-                    }, onError: { error in
-                        self.stopRefresh()
-                        NYTips.hide()
-                    })
-                    .disposed(by: disposeBag)
-            }, onError: { error in
-                self.stopRefresh()
-                NYTips.hide()
-            })
-            .disposed(by: disposeBag)
-    }
-    
-    //切换
-    func switchStatisticsStuCount(){
-        // 根据不同的 dateType 进行相应的数据请求
-        switch dateType {
-        case .day:
-            // 发起请求,获取日数据
-            self.statisticsService.everyDayStuCountRequest(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startDate: self.startDate, endDate: self.endDate, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
-                    self.stuCountDataModel = stuCountDataModel
-                    self.tableView.reloadData()
-                }, onError: { error in
-                })
-                .disposed(by: disposeBag)
-        case .month:
-            // 发起请求,获取月数据
-            let startMonth = String(self.startDate.prefix(7))
-            let endMonth =  String(self.endDate.prefix(7))
-            self.statisticsService.everyMonthStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startMonth: startMonth, endMonth: endMonth, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
-                    self.stuCountDataModel = stuCountDataModel
-                    self.tableView.reloadData()
-                }, onError: { error in
-                })
-                .disposed(by: disposeBag)
-        case .year:
-            // 发起请求,获取年数据
-            let startYear = String(self.startDate.prefix(4))
-            let endYear =  String(self.endDate.prefix(4))
-            self.statisticsService.everyYearStuCount(city: LocalManager.userInfo.city!, schoolId: LocalManager.userInfo.schoolId, startYear: startYear, endYear: endYear, fieldType: self.fieldType,sortType: self.sortType).subscribe(onSuccess: { stuCountDataModel in
-                    self.stuCountDataModel = stuCountDataModel
-                    self.tableView.reloadData()
-                }, onError: { error in
-                })
-                .disposed(by: disposeBag)
-        }
-
-    }
-
-    
-}
-
-
-//数据源
-extension StatisticsOfficialPageController:UITableViewDataSource {
-    
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        if  stuCountDataModel != nil&&(stuCountDataModel?.rows!.count)!>0 {
-            return (stuCountDataModel?.rows.count)!+1
-        }
-        return 0
-    }
-    
-    func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        if stuTotalCountDataModel != nil {
-            headerView.setStuTotalCountDataModel(stuTotalCountDataModel: stuTotalCountDataModel!)
-        }
-        return headerView
-    }
-    
-    func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 352.f
-    }
-    
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) as! StatisticsPageCell
-        cell.contentView.backgroundColor = ((indexPath.row%2) != 0) ? UIColor("#113357") : UIColor("#0B2B4D")
-        cell.backgroundColor = ((indexPath.row%2) != 0) ? UIColor("#113357") : UIColor("#0B2B4D")
-        if (indexPath.row==0){
-            let obj = (stuCountDataModel?.data)! as StuCountTotalModel
-            cell.date_label.text = "总计"
-            cell.num_label.text = String(obj.total)
-            cell.num_label.textColor = .db_green
-        }else{
-            let info = (stuCountDataModel?.rows[indexPath.row-1])! as StuCountInfoModel
-            cell.date_label.text = info.dateTime
-            cell.num_label.text = String(info.stuCount)
-            cell.num_label.textColor = .db_fontGray
-        }
-        return cell
-    }
-}
-
-//事件
-extension StatisticsOfficialPageController:UITableViewDelegate {
-
-    
-}
-//PGDatePickerDelegate
-extension StatisticsOfficialPageController: PGDatePickerDelegate {
-    func datePicker(_ datePicker: PGDatePicker!, didSelectDate dateComponents: DateComponents!) {
-        
-        print("dateComponents = ", dateComponents)
-        if datePicCount>=2 {
-            self.endDate = String(format: "%02d", dateComponents.year ?? 0)+"-"+String(format: "%02d", dateComponents.month ?? 0)+"-"+String(format: "%02d", dateComponents.day ?? 0)
-            datePicCount=0
-            configUIdata()
-            self.switchStatisticsStuCount()
-        }
-        else {
-            self.startDate = String(format: "%02d", dateComponents.year ?? 0)+"-"+String(format: "%02d", dateComponents.month ?? 0)+"-"+String(format: "%02d", dateComponents.day ?? 0)
-            configUIdata()
-            DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
-                // 在延迟 1 秒后执行的代码
-                self.showPGDatePickManager()
-            }
-            
-        }
-    }
-}

+ 103 - 35
JiaPeiManage/Sources/Modulars/Statistics/Controllers/StatisticsPageController.swift

@@ -10,6 +10,11 @@ import RxSwift
 import RxCocoa
 import PGDatePicker
 
+enum StatisticsType: Int {
+    case normal
+    case presell
+}
+
 final class StatisticsPageController: BaseGroupTableViewController {
 
     let cellIdentifier:String = "_StatisticsPageCell"
@@ -27,6 +32,9 @@ final class StatisticsPageController: BaseGroupTableViewController {
     let headerView = StatisticsPageHeaderView.loadFromNib().then {
         $0.backgroundColor = .db_theme
     }
+    let officialheaderView = StatisticsOfficialPageHeaderView.loadFromNib().then {
+        $0.backgroundColor = .db_theme
+    }
     //头部 日期选择
     let selectDateViewBgBtn = UIButton(type:.custom).then {
         $0.isHidden = true
@@ -43,6 +51,7 @@ final class StatisticsPageController: BaseGroupTableViewController {
     var endDate:String = ""
     var fieldType:Int = 1 //1:时间 2:学员数
     var sortType:Int = 2 //1:正序 2:倒序
+    var type:StatisticsType = .normal // 普通-预售
     
     override func setupConstraints() {
         
@@ -72,6 +81,16 @@ final class StatisticsPageController: BaseGroupTableViewController {
             make.height.equalTo(172.f)
         }
     }
+    
+    init(type:StatisticsType) {
+        self.type = type
+        super.init()
+    }
+    
+    required convenience init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         setupUI()
@@ -84,8 +103,9 @@ final class StatisticsPageController: BaseGroupTableViewController {
     func showSelectDateView(){
         if(self.selectDateView.isHidden)
         {
+            let  bottomY = (type == .presell ? headerView.qmui_bottom : officialheaderView.qmui_bottom )
             //计算相对坐标
-            let headerFrameInSuperview = tableView.convert(CGPoint(x: 0, y: headerView.qmui_bottom), to: tableView.superview)
+            let headerFrameInSuperview = tableView.convert(CGPoint(x: 0, y: bottomY), to: tableView.superview)
             selectDateView.snp.remakeConstraints { make in
                 make.top.equalTo(headerFrameInSuperview.y-navBar.bottom)
                 make.left.right.equalToSuperview()
@@ -194,8 +214,11 @@ final class StatisticsPageController: BaseGroupTableViewController {
             starttime = String(startDate.prefix(4))
             endtime = String(endDate.prefix(4))
         }
-        headerView.date_section_button.setTitle("\(starttime)~\(endtime)", for: .normal)
-        
+        if(type == .presell){
+            headerView.date_section_button.setTitle("\(starttime)~\(endtime)", for: .normal)
+        }else {
+            officialheaderView.date_section_button.setTitle("\(starttime)~\(endtime)", for: .normal)
+        }
     }
     //confirm 确定处理
     func confirmHandledo(){
@@ -236,36 +259,71 @@ final class StatisticsPageController: BaseGroupTableViewController {
         self.navBar.search_button.isHidden = true
         configDefaulthDate()
         configUIdata()
-        //header - 事件
-        headerView.items_date_segmented.rx.selectedSegmentIndex
-                .map { DateType(rawValue: $0)! }
-                    .subscribe(onNext: { [weak self] dateType in
-                        self?.dateType = dateType
-                        self?.configDefaulthDate()
-                        self?.configUIdata()
-                        self?.switchStatisticsStuCount()
-                        print("datetype = \(dateType)")
-                    })
-                    .disposed(by: disposeBag)
-        //日前选择
-        headerView.date_section_button.rx.tap.subscribe ({  [unowned self] (_) in
-            self.showSelectDateView()
-        }).disposed(by: disposeBag)
-        //时间排序
-        headerView.time_button.rx.tap
-            .subscribe ({  [unowned self] (_) in
-                headerView.time_button.isSelected = !headerView.time_button.isSelected
-                self.fieldType = 1 //1:时间 2:学员数
-                self.sortType = headerView.time_button.isSelected ? 1:2
+        if(type == .presell){
+            //header - 事件
+            headerView.items_date_segmented.rx.selectedSegmentIndex
+                    .map { DateType(rawValue: $0)! }
+                        .subscribe(onNext: { [weak self] dateType in
+                            self?.dateType = dateType
+                            self?.configDefaulthDate()
+                            self?.configUIdata()
+                            self?.switchStatisticsStuCount()
+                            print("datetype = \(dateType)")
+                        })
+                        .disposed(by: disposeBag)
+            //日前选择
+            headerView.date_section_button.rx.tap.subscribe ({  [unowned self] (_) in
+                self.showSelectDateView()
+            }).disposed(by: disposeBag)
+            //时间排序
+            headerView.time_button.rx.tap
+                .subscribe ({  [unowned self] (_) in
+                    headerView.time_button.isSelected = !headerView.time_button.isSelected
+                    self.fieldType = 1 //1:时间 2:学员数
+                    self.sortType = headerView.time_button.isSelected ? 1:2
+                    self.switchStatisticsStuCount()
+            }).disposed(by: disposeBag)
+            //学员排序
+            headerView.student_button.rx.tap.subscribe ({  [unowned self] (_) in
+                headerView.student_button.isSelected = !headerView.student_button.isSelected
+                self.fieldType = 2 //1:时间 2:学员数
+                self.sortType = headerView.student_button.isSelected ? 1:2
                 self.switchStatisticsStuCount()
-        }).disposed(by: disposeBag)
-        //学员排序
-        headerView.student_button.rx.tap.subscribe ({  [unowned self] (_) in
-            headerView.student_button.isSelected = !headerView.student_button.isSelected
-            self.fieldType = 2 //1:时间 2:学员数
-            self.sortType = headerView.student_button.isSelected ? 1:2
-            self.switchStatisticsStuCount()
-        }).disposed(by: disposeBag)
+            }).disposed(by: disposeBag)
+        }else{
+            //普通模式
+            //header - 事件
+            officialheaderView.items_date_segmented.rx.selectedSegmentIndex
+                    .map { DateType(rawValue: $0)! }
+                        .subscribe(onNext: { [weak self] dateType in
+                            self?.dateType = dateType
+                            self?.configDefaulthDate()
+                            self?.configUIdata()
+                            self?.switchStatisticsStuCount()
+                            print("datetype = \(dateType)")
+                        })
+                        .disposed(by: disposeBag)
+            //日前选择
+            officialheaderView.date_section_button.rx.tap.subscribe ({  [unowned self] (_) in
+                self.showSelectDateView()
+            }).disposed(by: disposeBag)
+            //时间排序
+            officialheaderView.time_button.rx.tap
+                .subscribe ({  [unowned self] (_) in
+                    officialheaderView.time_button.isSelected = !officialheaderView.time_button.isSelected
+                    self.fieldType = 1 //1:时间 2:学员数
+                    self.sortType = officialheaderView.time_button.isSelected ? 1:2
+                    self.switchStatisticsStuCount()
+            }).disposed(by: disposeBag)
+            //学员排序
+            officialheaderView.student_button.rx.tap.subscribe ({  [unowned self] (_) in
+                officialheaderView.student_button.isSelected = !officialheaderView.student_button.isSelected
+                self.fieldType = 2 //1:时间 2:学员数
+                self.sortType = officialheaderView.student_button.isSelected ? 1:2
+                self.switchStatisticsStuCount()
+            }).disposed(by: disposeBag)
+        }
+        
         //hide showSelectDateView
         selectDateViewBgBtn.rx.tap.subscribe ({  [unowned self] (_) in
             self.showSelectDateView()
@@ -394,14 +452,24 @@ extension StatisticsPageController:UITableViewDataSource {
     }
     
     func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
+        if (type == .presell){
+            if stuTotalCountDataModel != nil {
+                headerView.setStuTotalCountDataModel(stuTotalCountDataModel: stuTotalCountDataModel!)
+            }
+            return headerView
+        }
         if stuTotalCountDataModel != nil {
-            headerView.setStuTotalCountDataModel(stuTotalCountDataModel: stuTotalCountDataModel!)
+            officialheaderView.setStuTotalCountDataModel(stuTotalCountDataModel: stuTotalCountDataModel!)
         }
-        return headerView
+        return officialheaderView
     }
     
     func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
-        return 352.f
+        var height = 232.f
+        if (type == .presell){
+            height = 352.f
+        }
+        return height
     }
     
     func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

+ 83 - 0
JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsOfficialPageHeaderView.swift

@@ -0,0 +1,83 @@
+//
+//  StatisticsOfficialPageHeaderView.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/4.
+//
+
+final class StatisticsOfficialPageHeaderView: UIView,NibLoadable {
+    
+    //今日
+    @IBOutlet weak var today_num_label: UILabel!
+    //昨日
+    @IBOutlet weak var yesterday_num_label: UILabel!
+    //当月
+    @IBOutlet weak var thismonth_num_label: UILabel!
+    //上月
+    @IBOutlet weak var lastmonth_num_label: UILabel!
+    //今年
+    @IBOutlet weak var thisyear_num_label: UILabel!
+    //去年
+    @IBOutlet weak var lastyear_num_label: UILabel!
+    //日月年-selgment
+    @IBOutlet weak var items_date_segmented: UISegmentedControl!
+    //日前
+    @IBOutlet weak var date_section_button: QMUIButton!
+    //时间
+    @IBOutlet weak var time_button: QMUIButton!
+    //学员
+    @IBOutlet weak var student_button: QMUIButton!
+    
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        //日期
+        self.date_section_button.imagePosition = .right
+        self.date_section_button.spacingBetweenImageAndTitle = 9.f
+        //时间
+        self.time_button.imagePosition = .right
+        self.time_button.spacingBetweenImageAndTitle = 9.f
+        //学员
+        self.student_button.imagePosition = .right
+        self.student_button.spacingBetweenImageAndTitle = 9.f
+      
+        if #available(iOS 13.0, *) {
+            items_date_segmented.selectedSegmentTintColor = UIColor("#35BF5E")
+            items_date_segmented.backgroundColor = UIColor("#0B424D")
+        } else {
+            // Fallback on earlier versions
+            items_date_segmented.setBackgroundImage(UIColor.imageWithColor(UIColor("#35BF5E")!), for: .selected, barMetrics: .default)
+            items_date_segmented.layer.masksToBounds = true
+            items_date_segmented.layer.cornerRadius = 6
+            // 去掉分割线
+            items_date_segmented.setDividerImage(UIImage(), forLeftSegmentState: .normal, rightSegmentState: .normal, barMetrics: .default)
+            let image = UIColor.imageWithColor(UIColor("#0B424D")!)
+            // 设置未选中背景色
+            items_date_segmented.setBackgroundImage(image, for: .normal, barMetrics: .default)
+        }
+        // 设置选中字体色
+        items_date_segmented.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.white], for: .selected)
+        // 设置未选中字体色
+        items_date_segmented.setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor("#899199")!], for: .normal)
+
+    }
+    
+    func setStuTotalCountDataModel(stuTotalCountDataModel:StuTotalCountDataModel){
+        if(stuTotalCountDataModel != nil){
+            //今日
+            today_num_label.text = String(stuTotalCountDataModel.day)
+            //昨日
+            yesterday_num_label.text = "昨日  " + String(stuTotalCountDataModel.yesterday)
+            //当月
+            thismonth_num_label.text = String(stuTotalCountDataModel.month)
+            //上月
+            lastmonth_num_label.text = "上月  " + String(stuTotalCountDataModel.lastMonth)
+            //今年
+            thisyear_num_label.text = String(stuTotalCountDataModel.year)
+            //去年
+            lastyear_num_label.text = "去年  " + String(stuTotalCountDataModel.lastYear)
+        }
+    }
+
+    
+}

+ 279 - 0
JiaPeiManage/Sources/Modulars/Statistics/Views/StatisticsOfficialPageHeaderView.xib

@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB" customClass="StatisticsOfficialPageHeaderView" customModule="JiaPeiManage" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="232"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="sBY-6l-8BQ" userLabel="View-bottom">
+                    <rect key="frame" x="0.0" y="188" width="375" height="44"/>
+                    <subviews>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="05o-oH-t2c" customClass="QMUIButton">
+                            <rect key="frame" x="25" y="0.0" width="75" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="75" id="c0Q-KV-jTh"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="时间" image="btn_arrow_down">
+                                <color key="titleColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            </state>
+                            <state key="selected" image="btn_arrow_up"/>
+                        </button>
+                        <button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="GHt-Dr-GJj" customClass="QMUIButton">
+                            <rect key="frame" x="275" y="0.0" width="75" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="75" id="A6O-jK-5xR"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" title="学员" image="btn_arrow_down">
+                                <color key="titleColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            </state>
+                            <state key="selected" image="btn_arrow_up"/>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" red="0.14901960780000001" green="0.28235294119999998" blue="0.41960784309999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="bottom" secondItem="05o-oH-t2c" secondAttribute="bottom" id="2Rp-RB-vhs"/>
+                        <constraint firstItem="05o-oH-t2c" firstAttribute="leading" secondItem="sBY-6l-8BQ" secondAttribute="leading" constant="25" id="6ft-80-JzQ"/>
+                        <constraint firstItem="05o-oH-t2c" firstAttribute="top" secondItem="sBY-6l-8BQ" secondAttribute="top" id="72Q-q9-gJw"/>
+                        <constraint firstAttribute="bottom" secondItem="GHt-Dr-GJj" secondAttribute="bottom" id="7Y8-kT-K7E"/>
+                        <constraint firstAttribute="trailing" secondItem="GHt-Dr-GJj" secondAttribute="trailing" constant="25" id="BqN-SR-cCt"/>
+                        <constraint firstAttribute="height" constant="44" id="Ygr-5C-yZt"/>
+                        <constraint firstItem="GHt-Dr-GJj" firstAttribute="top" secondItem="sBY-6l-8BQ" secondAttribute="top" id="scN-6o-xhN"/>
+                    </constraints>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="UC2-tt-gIX" userLabel="View-今日报名">
+                    <rect key="frame" x="14.999999999999993" y="10" width="107.33333333333331" height="100"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今日报名" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0kL-oA-wsz">
+                            <rect key="frame" x="11.333333333333329" y="11" width="85" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="85" id="9aG-xV-3re"/>
+                                <constraint firstAttribute="height" constant="18" id="yWe-hy-m7F"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="J2F-Wf-N8Q">
+                            <rect key="frame" x="0.0" y="29" width="107.33333333333333" height="42"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="42" id="8ka-3b-Rm8"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="30"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="昨日 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="9F7-sa-1Ow">
+                            <rect key="frame" x="0.0" y="71" width="107.33333333333333" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="18" id="b1R-XS-21e"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" red="0.047058823530000002" green="0.21960784310000001" blue="0.23137254900000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstItem="9F7-sa-1Ow" firstAttribute="leading" secondItem="UC2-tt-gIX" secondAttribute="leading" id="7Rb-il-eZl"/>
+                        <constraint firstAttribute="height" constant="100" id="AAE-SG-R9G"/>
+                        <constraint firstAttribute="trailing" secondItem="J2F-Wf-N8Q" secondAttribute="trailing" id="Rlm-Ye-WKS"/>
+                        <constraint firstAttribute="trailing" secondItem="9F7-sa-1Ow" secondAttribute="trailing" id="hhO-LQ-pbH"/>
+                        <constraint firstItem="9F7-sa-1Ow" firstAttribute="top" secondItem="J2F-Wf-N8Q" secondAttribute="bottom" id="i6c-tf-DFA"/>
+                        <constraint firstItem="J2F-Wf-N8Q" firstAttribute="leading" secondItem="UC2-tt-gIX" secondAttribute="leading" id="oF1-Zi-Bi0"/>
+                        <constraint firstItem="0kL-oA-wsz" firstAttribute="top" secondItem="UC2-tt-gIX" secondAttribute="top" constant="11" id="oYF-AB-ALd"/>
+                        <constraint firstItem="J2F-Wf-N8Q" firstAttribute="top" secondItem="0kL-oA-wsz" secondAttribute="bottom" id="puu-On-4JS"/>
+                        <constraint firstItem="0kL-oA-wsz" firstAttribute="centerX" secondItem="UC2-tt-gIX" secondAttribute="centerX" id="sBR-ce-8rw"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qsN-aN-JsK" userLabel="View-本月">
+                    <rect key="frame" x="133.33333333333334" y="10" width="107.66666666666666" height="100"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本月报名" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kWS-ie-oMx">
+                            <rect key="frame" x="11.333333333333314" y="11" width="85" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="18" id="1DF-MW-Nda"/>
+                                <constraint firstAttribute="width" constant="85" id="LL6-OX-TIa"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CZf-ir-TXF">
+                            <rect key="frame" x="0.0" y="29" width="107.66666666666667" height="42"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="42" id="xxk-Nx-SUv"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="30"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="上月 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AqZ-zf-Ce4">
+                            <rect key="frame" x="0.0" y="71" width="107.66666666666667" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="18" id="fdN-1Y-If1"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" red="0.20392156859999999" green="0.20392156859999999" blue="0.1450980392" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstItem="kWS-ie-oMx" firstAttribute="top" secondItem="qsN-aN-JsK" secondAttribute="top" constant="11" id="AbY-9G-Xdb"/>
+                        <constraint firstItem="AqZ-zf-Ce4" firstAttribute="top" secondItem="CZf-ir-TXF" secondAttribute="bottom" id="BGh-Gk-cHl"/>
+                        <constraint firstAttribute="trailing" secondItem="CZf-ir-TXF" secondAttribute="trailing" id="BuR-7b-PsU"/>
+                        <constraint firstItem="CZf-ir-TXF" firstAttribute="top" secondItem="kWS-ie-oMx" secondAttribute="bottom" id="DdP-EW-VSd"/>
+                        <constraint firstItem="AqZ-zf-Ce4" firstAttribute="leading" secondItem="qsN-aN-JsK" secondAttribute="leading" id="OfA-aW-1la"/>
+                        <constraint firstItem="kWS-ie-oMx" firstAttribute="centerX" secondItem="qsN-aN-JsK" secondAttribute="centerX" id="VX9-pY-UOR"/>
+                        <constraint firstAttribute="height" constant="100" id="fHi-uF-dze"/>
+                        <constraint firstItem="CZf-ir-TXF" firstAttribute="leading" secondItem="qsN-aN-JsK" secondAttribute="leading" id="gbq-R9-7dB"/>
+                        <constraint firstAttribute="trailing" secondItem="AqZ-zf-Ce4" secondAttribute="trailing" id="gzG-gB-pEa"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XWr-2B-n6N" userLabel="View-本年">
+                    <rect key="frame" x="252" y="10" width="108" height="100"/>
+                    <subviews>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="本年报名" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="qJg-Bt-e1p">
+                            <rect key="frame" x="11.333333333333314" y="11" width="85" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="18" id="AKo-vZ-OgJ"/>
+                                <constraint firstAttribute="width" constant="85" id="Jw0-uz-M9a"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AvZ-e5-p2v">
+                            <rect key="frame" x="0.0" y="29" width="108" height="42"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="42" id="PIf-0z-bax"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="boldSystem" pointSize="30"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="去年 0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="tIH-fY-Sjl">
+                            <rect key="frame" x="0.0" y="71" width="108" height="18"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="18" id="lhT-69-9ob"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" pointSize="13"/>
+                            <color key="textColor" red="0.53725490200000003" green="0.56862745100000001" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                    </subviews>
+                    <color key="backgroundColor" red="0.043137254899999998" green="0.16862745100000001" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="trailing" secondItem="AvZ-e5-p2v" secondAttribute="trailing" id="KaA-Og-X9T"/>
+                        <constraint firstItem="qJg-Bt-e1p" firstAttribute="centerX" secondItem="XWr-2B-n6N" secondAttribute="centerX" id="NQd-1u-2DC"/>
+                        <constraint firstAttribute="trailing" secondItem="tIH-fY-Sjl" secondAttribute="trailing" id="duP-jW-aTJ"/>
+                        <constraint firstItem="tIH-fY-Sjl" firstAttribute="leading" secondItem="XWr-2B-n6N" secondAttribute="leading" id="j4T-fd-Osw"/>
+                        <constraint firstItem="tIH-fY-Sjl" firstAttribute="top" secondItem="AvZ-e5-p2v" secondAttribute="bottom" id="pzx-Ot-k3k"/>
+                        <constraint firstAttribute="height" constant="100" id="qkC-hV-YWr"/>
+                        <constraint firstItem="qJg-Bt-e1p" firstAttribute="top" secondItem="XWr-2B-n6N" secondAttribute="top" constant="11" id="y5p-iJ-Mtq"/>
+                        <constraint firstItem="AvZ-e5-p2v" firstAttribute="leading" secondItem="XWr-2B-n6N" secondAttribute="leading" id="z4B-J4-qyT"/>
+                        <constraint firstItem="AvZ-e5-p2v" firstAttribute="top" secondItem="qJg-Bt-e1p" secondAttribute="bottom" id="zpk-yK-xiv"/>
+                    </constraints>
+                    <userDefinedRuntimeAttributes>
+                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                            <real key="value" value="5"/>
+                        </userDefinedRuntimeAttribute>
+                    </userDefinedRuntimeAttributes>
+                </view>
+                <segmentedControl opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="top" segmentControlStyle="plain" selectedSegmentIndex="0" translatesAutoresizingMaskIntoConstraints="NO" id="yQM-Kq-goa">
+                    <rect key="frame" x="15" y="125" width="138" height="31"/>
+                    <color key="backgroundColor" red="0.043137254899999998" green="0.25882352939999997" blue="0.30196078430000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="138" id="1MA-5g-4Oy"/>
+                        <constraint firstAttribute="height" constant="30" id="BTX-2X-oZH"/>
+                    </constraints>
+                    <segments>
+                        <segment title="日"/>
+                        <segment title="月"/>
+                        <segment title="年"/>
+                    </segments>
+                    <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <color key="selectedSegmentTintColor" red="0.20784313730000001" green="0.74901960779999999" blue="0.36862745099999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                </segmentedControl>
+                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5w0-yC-ww2" customClass="QMUIButton">
+                    <rect key="frame" x="142" y="125" width="218" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="218" id="aix-bJ-eqd"/>
+                        <constraint firstAttribute="height" constant="30" id="eym-px-8hz"/>
+                    </constraints>
+                    <fontDescription key="fontDescription" type="system" pointSize="14"/>
+                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                    <state key="normal" title="日期~日期" image="btn_arrow_gray">
+                        <color key="titleColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                    </state>
+                </button>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="sBY-6l-8BQ" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="9aL-zS-zb7"/>
+                <constraint firstItem="qsN-aN-JsK" firstAttribute="leading" secondItem="UC2-tt-gIX" secondAttribute="trailing" constant="11" id="DPE-YP-Enx"/>
+                <constraint firstItem="qsN-aN-JsK" firstAttribute="width" secondItem="XWr-2B-n6N" secondAttribute="width" multiplier="0.993827" id="FPA-05-k3F"/>
+                <constraint firstItem="yQM-Kq-goa" firstAttribute="top" secondItem="UC2-tt-gIX" secondAttribute="bottom" constant="15" id="aXG-Nn-IPo"/>
+                <constraint firstItem="UC2-tt-gIX" firstAttribute="width" secondItem="qsN-aN-JsK" secondAttribute="width" id="ajN-gf-vhY"/>
+                <constraint firstItem="qsN-aN-JsK" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="g3q-L1-VFc"/>
+                <constraint firstItem="5w0-yC-ww2" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" constant="-15" id="gqD-lJ-kCf"/>
+                <constraint firstItem="5w0-yC-ww2" firstAttribute="top" secondItem="qsN-aN-JsK" secondAttribute="bottom" constant="15" id="iRP-mh-ECs"/>
+                <constraint firstItem="sBY-6l-8BQ" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="jpb-la-0F9"/>
+                <constraint firstItem="UC2-tt-gIX" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="15" id="khc-jE-dxP"/>
+                <constraint firstItem="XWr-2B-n6N" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="lf9-Jo-dL9"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="XWr-2B-n6N" secondAttribute="trailing" constant="15" id="lhL-PD-wa9"/>
+                <constraint firstItem="XWr-2B-n6N" firstAttribute="leading" secondItem="qsN-aN-JsK" secondAttribute="trailing" constant="11" id="oyA-hv-PSd"/>
+                <constraint firstItem="UC2-tt-gIX" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="10" id="t5a-QL-YOu"/>
+                <constraint firstAttribute="bottom" secondItem="sBY-6l-8BQ" secondAttribute="bottom" id="wXI-Kc-nTO"/>
+                <constraint firstItem="yQM-Kq-goa" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" constant="15" id="zWH-bM-SHZ"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <connections>
+                <outlet property="date_section_button" destination="5w0-yC-ww2" id="Wx4-8V-bcc"/>
+                <outlet property="items_date_segmented" destination="yQM-Kq-goa" id="1h4-SR-d4K"/>
+                <outlet property="lastmonth_num_label" destination="AqZ-zf-Ce4" id="41a-MM-tgy"/>
+                <outlet property="lastyear_num_label" destination="tIH-fY-Sjl" id="LjN-Z2-fcz"/>
+                <outlet property="student_button" destination="GHt-Dr-GJj" id="99o-AD-MyV"/>
+                <outlet property="thismonth_num_label" destination="CZf-ir-TXF" id="t2X-9y-K1S"/>
+                <outlet property="thisyear_num_label" destination="AvZ-e5-p2v" id="sGB-B6-Ro6"/>
+                <outlet property="time_button" destination="05o-oH-t2c" id="pr9-Sz-xTk"/>
+                <outlet property="today_num_label" destination="J2F-Wf-N8Q" id="POe-ZF-P7N"/>
+                <outlet property="yesterday_num_label" destination="9F7-sa-1Ow" id="x9J-0w-qmi"/>
+            </connections>
+            <point key="canvasLocation" x="52" y="-11.083743842364532"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="btn_arrow_down" width="8" height="15"/>
+        <image name="btn_arrow_gray" width="16" height="12"/>
+        <image name="btn_arrow_up" width="8" height="15"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 49 - 0
JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachAppdownloadPageController.swift

@@ -0,0 +1,49 @@
+//
+//  CoachAppdownloadPageController.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/5.
+//
+import UIKit
+import RxSwift
+import RxCocoa
+
+enum PageAppType: Int {
+    case android=0
+    case ios=1
+}
+
+final class CoachAppdownloadPageController: BaseViewController {
+    
+  
+    @IBOutlet weak var viewbg_imageView: UIImageView!
+    
+    var type:PageAppType = .ios
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        //UI
+        setupUI()
+    }
+    
+    // MARK: 私有方法
+    func setupUI(){
+        if isIphoneX {self.nav_top_layout.constant = 24.f}
+        self.view.backgroundColor = .db_theme
+        if(type == .android){
+            if kScreenHeight >= 736.f{
+                self.viewbg_imageView.image = UIImage(named: "androidviewbg_long");
+            }else {
+                self.viewbg_imageView.image = UIImage(named: "androidviewbg_short");
+            }
+        }else {
+            if kScreenHeight >= 736.f{
+                self.viewbg_imageView.image = UIImage(named: "iosviewbg_long");
+            }else {
+                self.viewbg_imageView.image = UIImage(named: "iosviewbg_short");
+            }
+        }
+    }
+        
+}
+

+ 92 - 0
JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachAppdownloadPageController.xib

@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina5_5" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CoachAppdownloadPageController" customModule="JiaPeiManage" customModuleProvider="target">
+            <connections>
+                <outlet property="nav_top_layout" destination="f2T-MW-HFg" id="sRg-0I-Mbn"/>
+                <outlet property="view" destination="iN0-l3-epB" id="rnr-Bg-3LT"/>
+                <outlet property="viewbg_imageView" destination="ZuI-I8-bGm" id="PGZ-H3-b43"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="iosviewbg_long" translatesAutoresizingMaskIntoConstraints="NO" id="ZuI-I8-bGm">
+                    <rect key="frame" x="0.0" y="0.0" width="414" height="736"/>
+                </imageView>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2wu-oH-GhK" userLabel="View-nav">
+                    <rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="code-navtop" translatesAutoresizingMaskIntoConstraints="NO" id="TAc-gF-lX8">
+                            <rect key="frame" x="0.0" y="0.0" width="414" height="64"/>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DNY-pI-Vbd">
+                            <rect key="frame" x="82" y="20" width="250" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="CC1-Ii-dd6"/>
+                                <constraint firstAttribute="width" constant="250" id="aqe-s1-lqF"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pTj-03-HfO">
+                            <rect key="frame" x="0.0" y="20" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="6Pg-05-MnI"/>
+                                <constraint firstAttribute="width" constant="44" id="mpw-fQ-edz"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="back-white"/>
+                            <connections>
+                                <action selector="actionBackdo:" destination="-1" eventType="touchUpInside" id="97n-Vg-sKR"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="TAc-gF-lX8" firstAttribute="leading" secondItem="2wu-oH-GhK" secondAttribute="leading" id="2AX-qa-Toy"/>
+                        <constraint firstItem="DNY-pI-Vbd" firstAttribute="centerX" secondItem="2wu-oH-GhK" secondAttribute="centerX" id="9NE-vR-m7F"/>
+                        <constraint firstAttribute="trailing" secondItem="TAc-gF-lX8" secondAttribute="trailing" id="EKk-tT-3FD"/>
+                        <constraint firstAttribute="bottom" secondItem="TAc-gF-lX8" secondAttribute="bottom" id="Ofs-ld-T80"/>
+                        <constraint firstAttribute="height" constant="64" id="Tee-2p-cCU"/>
+                        <constraint firstItem="pTj-03-HfO" firstAttribute="leading" secondItem="2wu-oH-GhK" secondAttribute="leading" id="aBr-Wj-Prv"/>
+                        <constraint firstItem="TAc-gF-lX8" firstAttribute="top" secondItem="2wu-oH-GhK" secondAttribute="top" id="kA7-jC-pQa"/>
+                        <constraint firstAttribute="bottom" secondItem="pTj-03-HfO" secondAttribute="bottom" id="ldw-Tt-Mwd"/>
+                        <constraint firstAttribute="bottom" secondItem="DNY-pI-Vbd" secondAttribute="bottom" id="ppb-xV-8cO"/>
+                    </constraints>
+                </view>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="2wu-oH-GhK" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="3IW-rV-aWV"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="ZuI-I8-bGm" secondAttribute="trailing" id="GXr-jV-hwK"/>
+                <constraint firstItem="ZuI-I8-bGm" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="KLy-qG-HCX"/>
+                <constraint firstItem="ZuI-I8-bGm" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="Z3b-O6-gBK"/>
+                <constraint firstItem="2wu-oH-GhK" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="df7-c1-vKd"/>
+                <constraint firstItem="2wu-oH-GhK" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="f2T-MW-HFg"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="ZuI-I8-bGm" secondAttribute="bottom" id="prG-s6-XQe"/>
+            </constraints>
+            <point key="canvasLocation" x="61.600000000000001" y="-12.561576354679804"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="back-white" width="9.3333330154418945" height="17"/>
+        <image name="code-navtop" width="375" height="69"/>
+        <image name="iosviewbg_long" width="375" height="812"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 100 - 0
JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachQRPageController.swift

@@ -0,0 +1,100 @@
+//
+//  CoachQRPageController.swift
+//  JiaPeiManage
+//
+//  Created by Ning.ge on 2023/7/5.
+//
+import UIKit
+import RxSwift
+import RxCocoa
+
+final class CoachQRPageController: BaseViewController {
+    
+    // MARK: 服务属性
+    private let cocahService: CoachServiceType = CoachService(networking: CoachNetworking())
+    
+    @IBOutlet weak var user_iconimageView: UIImageView!
+    
+    @IBOutlet weak var user_nameLabel: UILabel!
+    
+    @IBOutlet weak var idcard_label: UILabel!
+    
+    @IBOutlet weak var qrcode_imageView: UIImageView!
+    
+    @IBOutlet weak var android_button: UIButton!
+    
+    @IBOutlet weak var ios_button: UIButton!
+    
+    @IBOutlet weak var viewbg_imageView: UIImageView!
+    
+    var coachJsonInfo:CoachJsonInfo?
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        //UI
+        setupUI()
+        //biand绑定
+        biandView()
+        //获取信息
+        getCoachQrInfo()
+    }
+    
+    // MARK: 私有方法
+    
+    func getCoachQrInfo(){
+        NYTips.show()
+        let  suid:String = String(LocalManager.userInfo.id)
+        self.cocahService.coachQrInfoRequest(id:suid,city:  LocalManager.userInfo.city!).subscribe(onSuccess: {[unowned self] coachJsonInfo in
+            print("%@",coachJsonInfo)
+            self.coachJsonInfo = coachJsonInfo
+            self.user_nameLabel.text = coachJsonInfo.name
+            self.idcard_label.text = LocalManager.userInfo.idcard
+            
+            self.user_iconimageView.sd_setImage(with: LocalManager.userInfo.photoPath.urlValue, placeholderImage: LocalManager.userInfo.sex == "1" ?  NYImage.Mine.usermale:NYImage.Mine.userfemale)
+//            let encoder = JSONEncoder()
+//            encoder.outputFormatting = .prettyPrinted
+//            do {
+//                let jsonData = try encoder.encode(coachJsonInfo)
+//                // 将 JSON 数据转换为字符串
+//                if let jsonString = String(data: jsonData, encoding: .utf8) {
+//                    self.qrcode_imageView.image = UIImage.generateQRCode(from: jsonString, size: CGSize(width: 124.f, height: 124.f))
+//                }
+//            } catch {
+//                print("Failed to encode CoachJsonInfo object:", error)
+//            }
+            let content = "#FJCOACH#@@\(coachJsonInfo.id)@@"+coachJsonInfo.dqbh
+            let result = "#DECODE#"+DES3Util.encrypt(content)
+            self.qrcode_imageView.image = UIImage.generateQRCode(from: result, size: CGSize(width: 124.f, height: 124.f))
+            NYTips.hide()
+        }, onError: { error in
+            NYTips.hide()
+        })
+        .disposed(by: disposeBag)
+    }
+    
+    func setupUI(){
+        if isIphoneX {self.nav_top_layout.constant = 24.f}
+        self.view.backgroundColor = .db_theme
+        if kScreenHeight >= 736.f{
+            self.viewbg_imageView.image = UIImage(named: "viewbg_long");
+        }else {
+            self.viewbg_imageView.image = UIImage(named: "viewbg_short");
+        }
+    }
+    //绑定-rx
+    func biandView(){
+        //android
+        self.android_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            if !LocalManager.isOpenLogin() { return}
+            NYSwRouter.push(NYSwPushType.coach_qrcode_download,context:0)
+        }).disposed(by: disposeBag)
+        
+        //ios
+        self.ios_button.rx.tap.subscribe ({ [unowned self] (_)  in
+            if !LocalManager.isOpenLogin() { return}
+            NYSwRouter.push(NYSwPushType.coach_qrcode_download,context:1)
+        }).disposed(by: disposeBag)
+    }
+        
+}
+

+ 253 - 0
JiaPeiManage/Sources/Modulars/二维码/Controllers/CoachQRPageController.xib

@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina5_9" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="CoachQRPageController" customModule="JiaPeiManage" customModuleProvider="target">
+            <connections>
+                <outlet property="android_button" destination="YNn-px-Z9f" id="wPN-cA-jse"/>
+                <outlet property="idcard_label" destination="kig-mj-OUl" id="RQp-dA-3UE"/>
+                <outlet property="ios_button" destination="uAg-tu-zut" id="7da-KA-eW1"/>
+                <outlet property="nav_top_layout" destination="1oO-7G-Lnn" id="6Bg-vO-L5t"/>
+                <outlet property="qrcode_imageView" destination="0NN-S3-F1s" id="b87-gQ-zhJ"/>
+                <outlet property="user_iconimageView" destination="VYZ-RH-l56" id="vNa-N2-4eh"/>
+                <outlet property="user_nameLabel" destination="BEM-GK-QrF" id="987-w0-oTy"/>
+                <outlet property="view" destination="iN0-l3-epB" id="Acl-mw-INz"/>
+                <outlet property="viewbg_imageView" destination="zRZ-JU-Qx5" id="0nw-l6-t3g"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="viewbg_long" translatesAutoresizingMaskIntoConstraints="NO" id="zRZ-JU-Qx5">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="778"/>
+                </imageView>
+                <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="MPr-mb-o4G" userLabel="View-nav">
+                    <rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
+                    <subviews>
+                        <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="顶部" translatesAutoresizingMaskIntoConstraints="NO" id="YrD-tY-ZHn">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="64"/>
+                        </imageView>
+                        <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q71-Yr-6vj">
+                            <rect key="frame" x="62.666666666666657" y="20" width="249.99999999999997" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="250" id="Kqf-ve-cMX"/>
+                                <constraint firstAttribute="height" constant="44" id="Q0x-MQ-SDq"/>
+                            </constraints>
+                            <fontDescription key="fontDescription" type="system" weight="medium" pointSize="15"/>
+                            <color key="textColor" red="0.83137254900000002" green="0.86666666670000003" blue="0.90196078430000004" alpha="1" colorSpace="calibratedRGB"/>
+                            <nil key="highlightedColor"/>
+                        </label>
+                        <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="PI1-UH-mSZ">
+                            <rect key="frame" x="0.0" y="20" width="44" height="44"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="44" id="FQv-8y-Jf2"/>
+                                <constraint firstAttribute="width" constant="44" id="KPD-lt-cTv"/>
+                            </constraints>
+                            <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            <state key="normal" image="back-white"/>
+                            <connections>
+                                <action selector="actionBackdo:" destination="-1" eventType="touchUpInside" id="Adm-tG-YAf"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="64" id="AAZ-8a-uZl"/>
+                        <constraint firstItem="YrD-tY-ZHn" firstAttribute="leading" secondItem="MPr-mb-o4G" secondAttribute="leading" id="Atn-Kp-KnF"/>
+                        <constraint firstItem="Q71-Yr-6vj" firstAttribute="centerX" secondItem="MPr-mb-o4G" secondAttribute="centerX" id="B8H-WG-fYO"/>
+                        <constraint firstAttribute="bottom" secondItem="Q71-Yr-6vj" secondAttribute="bottom" id="GId-eL-cSo"/>
+                        <constraint firstAttribute="bottom" secondItem="YrD-tY-ZHn" secondAttribute="bottom" id="L5E-sT-5zt"/>
+                        <constraint firstItem="PI1-UH-mSZ" firstAttribute="leading" secondItem="MPr-mb-o4G" secondAttribute="leading" id="SVr-BA-Myd"/>
+                        <constraint firstAttribute="trailing" secondItem="YrD-tY-ZHn" secondAttribute="trailing" id="StI-xN-DGQ"/>
+                        <constraint firstAttribute="bottom" secondItem="PI1-UH-mSZ" secondAttribute="bottom" id="VbM-6N-RqX"/>
+                        <constraint firstItem="YrD-tY-ZHn" firstAttribute="top" secondItem="MPr-mb-o4G" secondAttribute="top" id="o8A-Jd-Qad"/>
+                    </constraints>
+                </view>
+                <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="pek-13-jKU">
+                    <rect key="frame" x="0.0" y="64" width="375" height="714"/>
+                    <subviews>
+                        <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Thw-l4-pAD" userLabel="View-content">
+                            <rect key="frame" x="0.0" y="0.0" width="375" height="730"/>
+                            <subviews>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="coach_top" translatesAutoresizingMaskIntoConstraints="NO" id="8fh-fG-fxW">
+                                    <rect key="frame" x="30" y="28" width="315" height="101"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="101" id="TM2-mH-FOf"/>
+                                    </constraints>
+                                </imageView>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="qrcode_bg" translatesAutoresizingMaskIntoConstraints="NO" id="kP3-tO-1Hu">
+                                    <rect key="frame" x="30" y="154" width="311" height="296"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="296" id="SHh-ya-Zu9"/>
+                                    </constraints>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="boolean" keyPath="aLRatio" value="YES"/>
+                                    </userDefinedRuntimeAttributes>
+                                </imageView>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="user-icon" translatesAutoresizingMaskIntoConstraints="NO" id="VYZ-RH-l56">
+                                    <rect key="frame" x="110" y="174" width="38" height="38"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="38" id="5dR-wj-IVA"/>
+                                        <constraint firstAttribute="height" constant="38" id="nNw-hW-lq5"/>
+                                    </constraints>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                            <integer key="value" value="19"/>
+                                        </userDefinedRuntimeAttribute>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
+                                            <real key="value" value="1"/>
+                                        </userDefinedRuntimeAttribute>
+                                        <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+                                            <color key="value" red="0.14901960780000001" green="0.2901960784" blue="0.43137254899999999" alpha="1" colorSpace="calibratedRGB"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
+                                </imageView>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="texts_image" translatesAutoresizingMaskIntoConstraints="NO" id="Fj8-1Y-UaH">
+                                    <rect key="frame" x="24" y="460" width="327" height="249"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="249" id="mwo-aa-8Cc"/>
+                                    </constraints>
+                                </imageView>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="a峰" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BEM-GK-QrF">
+                                    <rect key="frame" x="153" y="176" width="80" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="20" id="6SH-PI-C6m"/>
+                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="A7A-Fm-RJm"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="19"/>
+                                    <color key="textColor" red="0.019607843137254902" green="0.019607843137254902" blue="0.29411764705882354" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="00000000000" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kig-mj-OUl">
+                                    <rect key="frame" x="153" y="196" width="83.333333333333314" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="80" id="oPg-dL-10D"/>
+                                        <constraint firstAttribute="height" constant="20" id="wdb-rV-YHy"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="system" pointSize="12"/>
+                                    <color key="textColor" red="0.47450980392156861" green="0.47450980392156861" blue="0.56862745098039214" alpha="1" colorSpace="calibratedRGB"/>
+                                    <nil key="highlightedColor"/>
+                                </label>
+                                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="0NN-S3-F1s">
+                                    <rect key="frame" x="126.66666666666669" y="251" width="122" height="124"/>
+                                    <constraints>
+                                        <constraint firstAttribute="width" constant="122" id="bE2-G5-Xb4"/>
+                                        <constraint firstAttribute="height" constant="124" id="dCC-Ej-Zk4"/>
+                                    </constraints>
+                                </imageView>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="YNn-px-Z9f">
+                                    <rect key="frame" x="54" y="644" width="125" height="40"/>
+                                    <color key="backgroundColor" red="0.24705882352941178" green="0.44313725490196076" blue="0.98431372549019602" alpha="1" colorSpace="calibratedRGB"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="40" id="W4N-53-Aac"/>
+                                        <constraint firstAttribute="width" constant="125" id="d0t-37-iog"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                    <inset key="titleEdgeInsets" minX="8" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="8" maxY="0.0"/>
+                                    <state key="normal" title="Android" image="android_icon"/>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="boolean" keyPath="aLRatio" value="YES"/>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                            <real key="value" value="20"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
+                                </button>
+                                <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uAg-tu-zut">
+                                    <rect key="frame" x="196" y="644" width="125" height="40"/>
+                                    <color key="backgroundColor" red="0.24705882352941178" green="0.44313725490196076" blue="0.98431372549019602" alpha="1" colorSpace="calibratedRGB"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="40" id="jpS-oc-OIh"/>
+                                        <constraint firstAttribute="width" constant="125" id="xWm-jr-XH8"/>
+                                    </constraints>
+                                    <fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
+                                    <inset key="titleEdgeInsets" minX="8" minY="0.0" maxX="0.0" maxY="0.0"/>
+                                    <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="8" maxY="0.0"/>
+                                    <state key="normal" title="iPhone" image="ios_icon"/>
+                                    <userDefinedRuntimeAttributes>
+                                        <userDefinedRuntimeAttribute type="boolean" keyPath="aLRatio" value="YES"/>
+                                        <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+                                            <real key="value" value="20"/>
+                                        </userDefinedRuntimeAttribute>
+                                    </userDefinedRuntimeAttributes>
+                                </button>
+                            </subviews>
+                            <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            <constraints>
+                                <constraint firstAttribute="trailing" secondItem="kP3-tO-1Hu" secondAttribute="trailing" constant="34" id="3Dw-hJ-Kis"/>
+                                <constraint firstItem="8fh-fG-fxW" firstAttribute="leading" secondItem="Thw-l4-pAD" secondAttribute="leading" constant="30" id="6MP-Ol-nHj"/>
+                                <constraint firstItem="Fj8-1Y-UaH" firstAttribute="top" secondItem="kP3-tO-1Hu" secondAttribute="bottom" constant="10" id="Bzf-of-4HB"/>
+                                <constraint firstItem="BEM-GK-QrF" firstAttribute="leading" secondItem="VYZ-RH-l56" secondAttribute="trailing" constant="5" id="Ctd-6A-Pdc"/>
+                                <constraint firstItem="kig-mj-OUl" firstAttribute="top" secondItem="BEM-GK-QrF" secondAttribute="bottom" id="DcG-YT-Uz0"/>
+                                <constraint firstAttribute="height" constant="730" id="FS6-hD-zge"/>
+                                <constraint firstItem="0NN-S3-F1s" firstAttribute="centerX" secondItem="Thw-l4-pAD" secondAttribute="centerX" id="MP0-xk-Ets"/>
+                                <constraint firstAttribute="trailing" secondItem="8fh-fG-fxW" secondAttribute="trailing" constant="30" id="Mi0-oi-vO1"/>
+                                <constraint firstItem="VYZ-RH-l56" firstAttribute="top" secondItem="kP3-tO-1Hu" secondAttribute="top" constant="20" id="N42-dS-GW3"/>
+                                <constraint firstItem="Fj8-1Y-UaH" firstAttribute="leading" secondItem="Thw-l4-pAD" secondAttribute="leading" constant="24" id="NGV-7c-uzA"/>
+                                <constraint firstItem="0NN-S3-F1s" firstAttribute="top" secondItem="kig-mj-OUl" secondAttribute="bottom" constant="35" id="RXL-AN-fOE"/>
+                                <constraint firstItem="kP3-tO-1Hu" firstAttribute="leading" secondItem="Thw-l4-pAD" secondAttribute="leading" constant="30" id="TTI-6r-JuD"/>
+                                <constraint firstItem="uAg-tu-zut" firstAttribute="trailing" secondItem="Fj8-1Y-UaH" secondAttribute="trailing" constant="-30" id="Y5a-bu-3Yc"/>
+                                <constraint firstItem="VYZ-RH-l56" firstAttribute="leading" secondItem="kP3-tO-1Hu" secondAttribute="leading" constant="80" id="YZE-c6-ljm"/>
+                                <constraint firstItem="YNn-px-Z9f" firstAttribute="bottom" secondItem="Fj8-1Y-UaH" secondAttribute="bottom" constant="-25" id="Yu4-rR-aRN"/>
+                                <constraint firstItem="uAg-tu-zut" firstAttribute="bottom" secondItem="Fj8-1Y-UaH" secondAttribute="bottom" constant="-25" id="bF1-EG-ti5"/>
+                                <constraint firstItem="YNn-px-Z9f" firstAttribute="leading" secondItem="Fj8-1Y-UaH" secondAttribute="leading" constant="30" id="bea-61-Q5x"/>
+                                <constraint firstItem="kig-mj-OUl" firstAttribute="leading" secondItem="VYZ-RH-l56" secondAttribute="trailing" constant="5" id="dR0-qq-X7A"/>
+                                <constraint firstItem="8fh-fG-fxW" firstAttribute="top" secondItem="Thw-l4-pAD" secondAttribute="top" constant="28" id="f8B-ls-9ZD"/>
+                                <constraint firstAttribute="trailing" secondItem="Fj8-1Y-UaH" secondAttribute="trailing" constant="24" id="h2A-DN-z6j"/>
+                                <constraint firstItem="kP3-tO-1Hu" firstAttribute="top" secondItem="8fh-fG-fxW" secondAttribute="bottom" constant="25" id="j6h-bl-rWx"/>
+                                <constraint firstItem="BEM-GK-QrF" firstAttribute="top" secondItem="kP3-tO-1Hu" secondAttribute="top" constant="22" id="jts-QG-2oC"/>
+                            </constraints>
+                        </view>
+                    </subviews>
+                    <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    <constraints>
+                        <constraint firstItem="Thw-l4-pAD" firstAttribute="leading" secondItem="pek-13-jKU" secondAttribute="leading" id="7rc-uM-DM8"/>
+                        <constraint firstItem="Thw-l4-pAD" firstAttribute="top" secondItem="pek-13-jKU" secondAttribute="top" id="X9Z-qT-TNP"/>
+                        <constraint firstItem="Thw-l4-pAD" firstAttribute="centerX" secondItem="pek-13-jKU" secondAttribute="centerX" id="yLa-lv-xRg"/>
+                        <constraint firstAttribute="trailing" secondItem="Thw-l4-pAD" secondAttribute="trailing" id="zUx-BG-zyf"/>
+                        <constraint firstAttribute="bottom" secondItem="Thw-l4-pAD" secondAttribute="bottom" constant="64" id="zsJ-5H-47U"/>
+                    </constraints>
+                </scrollView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="MPr-mb-o4G" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="1oO-7G-Lnn"/>
+                <constraint firstItem="MPr-mb-o4G" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="2OU-sp-V0a"/>
+                <constraint firstItem="zRZ-JU-Qx5" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="ETB-bB-UGD"/>
+                <constraint firstItem="pek-13-jKU" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="P6J-rD-SEo"/>
+                <constraint firstItem="zRZ-JU-Qx5" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="RDD-st-LEt"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="zRZ-JU-Qx5" secondAttribute="bottom" id="Zvu-Xv-B2h"/>
+                <constraint firstItem="pek-13-jKU" firstAttribute="bottom" secondItem="vUN-kp-3ea" secondAttribute="bottom" id="fCG-cn-kpI"/>
+                <constraint firstItem="pek-13-jKU" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="gTa-9z-zXx"/>
+                <constraint firstItem="MPr-mb-o4G" firstAttribute="trailing" secondItem="vUN-kp-3ea" secondAttribute="trailing" id="iaY-o7-zpg"/>
+                <constraint firstItem="pek-13-jKU" firstAttribute="top" secondItem="MPr-mb-o4G" secondAttribute="bottom" id="sy8-h2-zU4"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="zRZ-JU-Qx5" secondAttribute="trailing" id="wGK-WC-9pp"/>
+            </constraints>
+            <point key="canvasLocation" x="55.200000000000003" y="-12.561576354679804"/>
+        </view>
+    </objects>
+    <resources>
+        <image name="android_icon" width="20.666666030883789" height="22"/>
+        <image name="back-white" width="9.3333330154418945" height="17"/>
+        <image name="coach_top" width="317" height="101"/>
+        <image name="ios_icon" width="20" height="24.666666030883789"/>
+        <image name="qrcode_bg" width="310" height="296"/>
+        <image name="texts_image" width="327" height="249"/>
+        <image name="user-icon" width="66" height="66"/>
+        <image name="viewbg_long" width="375" height="812"/>
+        <image name="顶部" width="375" height="69"/>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 2 - 2
JiaPeiManage/Sources/Networking/NetEnvironment.swift

@@ -35,13 +35,13 @@ extension HttpRequest {
         case .app:
             return environment == .res ? "http://app.bilibili.com" : "app"
         case .api:
-            return environment == .res ? "https://jsjp-admin1.zzxcx.net" : "https://jsjp-admin1.zzxcx.net"
+            return environment == .res ? "https://jsjp-admin.zzxcx.net" : "https://jsjp-admin1.zzxcx.net"
         case .http:
             return environment == .res ? "http://fj.jppt.com.cn/" : "http://192.168.8.87:8080/xm"
         case .another:
             return environment == .res ? "https://zzjs.zzxcx.net" : "http://192.168.8.87:8080"
         case .host:
-            return environment == .res ? "https://jsjp-admin1.zzxcx.net" : "https://jsjp-admin1.zzxcx.net"
+            return environment == .res ? "https://jsjp-admin.zzxcx.net" : "https://jsjp-admin1.zzxcx.net"
         }
     }
 }

+ 1 - 1
JiaPeiManage/Sources/Networking/Networking.swift

@@ -19,7 +19,7 @@ final class Networking<Target: TargetType>: MoyaProvider<Target> {
 
     init(plugins: [PluginType] = [LoadingPlugin()]) {
         //安全证书配置DisabledEvaluator 和 host 不能动
-        let serverTrustManager = ServerTrustManager(evaluators: ["jsjp-admin1.zzxcx.net": DisabledEvaluator()])
+        let serverTrustManager = ServerTrustManager(evaluators: ["jsjp-admin1.zzxcx.net": DisabledEvaluator(),"jsjp-admin.zzxcx.net": DisabledEvaluator()])
         let sessionManager: Session = {
             let configuration = URLSessionConfiguration.default
             configuration.httpAdditionalHeaders = HTTPHeaders.default.dictionary

+ 3 - 3
JiaPeiManage/Sources/Services/CoachService.swift

@@ -13,7 +13,7 @@ protocol CoachServiceType {
     //获取教练信息
     func coachInfoRequest(id:String ,city:String) -> Single<UserInfo>
     //获取教练二维码
-    func coachQrInfoRequest(id:String ,city:String) -> Single<UserInfo>
+    func coachQrInfoRequest(id:String ,city:String) -> Single<CoachJsonInfo>
     //获取我的学员信息list
     func coachInfoListRequest(city:String,appCoachId:String ,coachId:String ,field:String ,pageNum:Int ,pageSize:Int ,schoolId:Int ,state:String) -> Single<TraineeDataModel>
     //获取我的预报名学员信息list
@@ -42,9 +42,9 @@ final class CoachService: CoachServiceType {
         return networking.request(api).map(UserInfo.self)
     }
     
-    func coachQrInfoRequest(id: String, city: String) -> RxSwift.Single<UserInfo> {
+    func coachQrInfoRequest(id: String, city: String) -> RxSwift.Single<CoachJsonInfo> {
         let api = CoachAPI.coachQrInfo(id: id, city: city)
-        return networking.request(api).map(UserInfo.self)
+        return networking.request(api).map(CoachJsonInfo.self)
     }
     
     func coachInfoListRequest(city: String, appCoachId: String, coachId: String, field: String, pageNum: Int, pageSize: Int, schoolId: Int, state: String) -> RxSwift.Single<TraineeDataModel> {

+ 18 - 0
JiaPeiManage/Sources/Thirdparty/Utils/3DES/DES3Util.h

@@ -0,0 +1,18 @@
+//
+//  DES3Util.h
+//  Miaxis
+//
+//  Created by tongjun on 14-1-14.
+//  Copyright (c) 2014年 tongjun. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface DES3Util : NSObject
+// 加密方法
++ (NSString*)encrypt:(NSString*)plainText;
+
+// 解密方法
++ (NSString*)decrypt:(NSString*)encryptText;
+@end
+

+ 97 - 0
JiaPeiManage/Sources/Thirdparty/Utils/3DES/DES3Util.m

@@ -0,0 +1,97 @@
+//
+//  DES3Util.m
+//  Miaxis
+//
+//  Created by tongjun on 14-1-14.
+//  Copyright (c) 2014年 tongjun. All rights reserved.
+//
+
+#import "DES3Util.h"
+#import <CommonCrypto/CommonCrypto.h>
+#import "GTMBase64.h"
+
+/*
+ yanlxtongjun@miaxis110$#365#$
+ */
+
+#define gkey            @"fujianxzz110@kestrel$#365#$"
+#define gIv             @"01234567"
+
+@implementation DES3Util
+
+// 加密方法
++ (NSString*)encrypt:(NSString*)plainText {
+    NSData* data = [plainText dataUsingEncoding:NSUTF8StringEncoding];
+    size_t plainTextBufferSize = [data length];
+    const void *vplainText = (const void *)[data bytes];
+    
+    CCCryptorStatus ccStatus;
+    uint8_t *bufferPtr = NULL;
+    size_t bufferPtrSize = 0;
+    size_t movedBytes = 0;
+    
+    bufferPtrSize = (plainTextBufferSize + kCCBlockSize3DES) & ~(kCCBlockSize3DES - 1);
+    bufferPtr = malloc( bufferPtrSize * sizeof(uint8_t));
+    memset((void *)bufferPtr, 0x0, bufferPtrSize);
+    
+    const void *vkey = (const void *) [gkey UTF8String];
+    const void *vinitVec = (const void *) [gIv UTF8String];
+    
+    ccStatus = CCCrypt(kCCEncrypt,
+                       kCCAlgorithm3DES,
+                       kCCOptionPKCS7Padding,
+                       vkey,
+                       kCCKeySize3DES,
+                       vinitVec,
+                       vplainText,
+                       plainTextBufferSize,
+                       (void *)bufferPtr,
+                       bufferPtrSize,
+                       &movedBytes);
+    //NSLog(@"%d",ccStatus);
+    if (ccStatus != kCCSuccess) {
+        return @"des3EncryptError";
+    }
+    NSData *myData = [NSData dataWithBytes:(const void *)bufferPtr length:(NSUInteger)movedBytes];
+    NSString *result = [GTMBase64 stringByEncodingData:myData];
+    return result;
+}
+
+// 解密方法
++ (NSString*)decrypt:(NSString*)encryptText {
+    NSData *encryptData = [GTMBase64 decodeData:[encryptText dataUsingEncoding:NSUTF8StringEncoding]];
+    size_t plainTextBufferSize = [encryptData length];
+    const void *vplainText = [encryptData bytes];
+    
+    CCCryptorStatus ccStatus;
+    uint8_t *bufferPtr = NULL;
+    size_t bufferPtrSize = 0;
+    size_t movedBytes = 0;
+    
+    bufferPtrSize = (plainTextBufferSize + kCCBlockSize3DES) & ~(kCCBlockSize3DES - 1);
+    bufferPtr = malloc( bufferPtrSize * sizeof(uint8_t));
+    memset((void *)bufferPtr, 0x0, bufferPtrSize);
+    
+    const void *vkey = (const void *) [gkey UTF8String];
+    const void *vinitVec = (const void *) [gIv UTF8String];
+    
+    ccStatus = CCCrypt(kCCDecrypt,
+                       kCCAlgorithm3DES,
+                       kCCOptionPKCS7Padding,
+                       vkey,
+                       kCCKeySize3DES,
+                       vinitVec,
+                       vplainText,
+                       plainTextBufferSize,
+                       (void *)bufferPtr,
+                       bufferPtrSize,
+                       &movedBytes);
+    //NSLog(@"%d",ccStatus);
+    if (ccStatus != kCCSuccess) {
+        return @"des3DecryptError";
+    }
+    NSString *result = [[NSString alloc] initWithData:[NSData dataWithBytes:(const void *)bufferPtr
+                                                                      length:(NSUInteger)movedBytes] encoding:NSUTF8StringEncoding];
+    return result;
+}
+@end

+ 183 - 0
JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMBase64.h

@@ -0,0 +1,183 @@
+//
+//  GTMBase64.h
+//
+//  Copyright 2006-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import <Foundation/Foundation.h>
+#import "GTMDefines.h"
+
+// GTMBase64
+//
+/// Helper for handling Base64 and WebSafeBase64 encodings
+//
+/// The webSafe methods use different character set and also the results aren't
+/// always padded to a multiple of 4 characters.  This is done so the resulting
+/// data can be used in urls and url query arguments without needing any
+/// encoding.  You must use the webSafe* methods together, the data does not
+/// interop with the RFC methods.
+//
+@interface GTMBase64 : NSObject
+
+//
+// Standard Base64 (RFC) handling
+//
+
+// encodeData:
+//
+/// Base64 encodes contents of the NSData object.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)encodeData:(NSData *)data;
+
+// decodeData:
+//
+/// Base64 decodes contents of the NSData object.
+//
+/// Returns:
+///   A new autoreleased NSData with the decoded payload.  nil for any error.
+//
++(NSData *)decodeData:(NSData *)data;
+
+// encodeBytes:length:
+//
+/// Base64 encodes the data pointed at by |bytes|.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)encodeBytes:(const void *)bytes length:(NSUInteger)length;
+
+// decodeBytes:length:
+//
+/// Base64 decodes the data pointed at by |bytes|.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)decodeBytes:(const void *)bytes length:(NSUInteger)length;
+
+// stringByEncodingData:
+//
+/// Base64 encodes contents of the NSData object.
+//
+/// Returns:
+///   A new autoreleased NSString with the encoded payload.  nil for any error.
+//
++(NSString *)stringByEncodingData:(NSData *)data;
+
+// stringByEncodingBytes:length:
+//
+/// Base64 encodes the data pointed at by |bytes|.
+//
+/// Returns:
+///   A new autoreleased NSString with the encoded payload.  nil for any error.
+//
++(NSString *)stringByEncodingBytes:(const void *)bytes length:(NSUInteger)length;
+
+// decodeString:
+//
+/// Base64 decodes contents of the NSString.
+//
+/// Returns:
+///   A new autoreleased NSData with the decoded payload.  nil for any error.
+//
++(NSData *)decodeString:(NSString *)string;
+
+//
+// Modified Base64 encoding so the results can go onto urls.
+//
+// The changes are in the characters generated and also allows the result to
+// not be padded to a multiple of 4.
+// Must use the matching call to encode/decode, won't interop with the
+// RFC versions.
+//
+
+// webSafeEncodeData:padded:
+//
+/// WebSafe Base64 encodes contents of the NSData object.  If |padded| is YES
+/// then padding characters are added so the result length is a multiple of 4.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)webSafeEncodeData:(NSData *)data
+                      padded:(BOOL)padded;
+
+// webSafeDecodeData:
+//
+/// WebSafe Base64 decodes contents of the NSData object.
+//
+/// Returns:
+///   A new autoreleased NSData with the decoded payload.  nil for any error.
+//
++(NSData *)webSafeDecodeData:(NSData *)data;
+
+// webSafeEncodeBytes:length:padded:
+//
+/// WebSafe Base64 encodes the data pointed at by |bytes|.  If |padded| is YES
+/// then padding characters are added so the result length is a multiple of 4.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)webSafeEncodeBytes:(const void *)bytes
+                       length:(NSUInteger)length
+                       padded:(BOOL)padded;
+
+// webSafeDecodeBytes:length:
+//
+/// WebSafe Base64 decodes the data pointed at by |bytes|.
+//
+/// Returns:
+///   A new autoreleased NSData with the encoded payload.  nil for any error.
+//
++(NSData *)webSafeDecodeBytes:(const void *)bytes length:(NSUInteger)length;
+
+// stringByWebSafeEncodingData:padded:
+//
+/// WebSafe Base64 encodes contents of the NSData object.  If |padded| is YES
+/// then padding characters are added so the result length is a multiple of 4.
+//
+/// Returns:
+///   A new autoreleased NSString with the encoded payload.  nil for any error.
+//
++(NSString *)stringByWebSafeEncodingData:(NSData *)data
+                                  padded:(BOOL)padded;
+
+// stringByWebSafeEncodingBytes:length:padded:
+//
+/// WebSafe Base64 encodes the data pointed at by |bytes|.  If |padded| is YES
+/// then padding characters are added so the result length is a multiple of 4.
+//
+/// Returns:
+///   A new autoreleased NSString with the encoded payload.  nil for any error.
+//
++(NSString *)stringByWebSafeEncodingBytes:(const void *)bytes
+                                   length:(NSUInteger)length
+                                   padded:(BOOL)padded;
+
+// webSafeDecodeString:
+//
+/// WebSafe Base64 decodes contents of the NSString.
+//
+/// Returns:
+///   A new autoreleased NSData with the decoded payload.  nil for any error.
+//
++(NSData *)webSafeDecodeString:(NSString *)string;
+
+@end

+ 697 - 0
JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMBase64.m

@@ -0,0 +1,697 @@
+//
+//  GTMBase64.m
+//
+//  Copyright 2006-2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+#import "GTMBase64.h"
+#import "GTMDefines.h"
+
+static const char *kBase64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+static const char *kWebSafeBase64EncodeChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+static const char kBase64PaddingChar = '=';
+static const char kBase64InvalidChar = 99;
+
+static const char kBase64DecodeChars[] = {
+    // This array was generated by the following code:
+    // #include <sys/time.h>
+    // #include <stdlib.h>
+    // #include <string.h>
+    // main()
+    // {
+    //   static const char Base64[] =
+    //     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    //   char *pos;
+    //   int idx, i, j;
+    //   printf("    ");
+    //   for (i = 0; i < 255; i += 8) {
+    //     for (j = i; j < i + 8; j++) {
+    //       pos = strchr(Base64, j);
+    //       if ((pos == NULL) || (j == 0))
+    //         idx = 99;
+    //       else
+    //         idx = pos - Base64;
+    //       if (idx == 99)
+    //         printf(" %2d,     ", idx);
+    //       else
+    //         printf(" %2d/*%c*/,", idx, j);
+    //     }
+    //     printf("\n    ");
+    //   }
+    // }
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      62/*+*/, 99,      99,      99,      63/*/ */,
+    52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
+    60/*8*/, 61/*9*/, 99,      99,      99,      99,      99,      99,
+    99,       0/*A*/,  1/*B*/,  2/*C*/,  3/*D*/,  4/*E*/,  5/*F*/,  6/*G*/,
+    7/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+    15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
+    23/*X*/, 24/*Y*/, 25/*Z*/, 99,      99,      99,      99,      99,
+    99,      26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
+    33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
+    41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
+    49/*x*/, 50/*y*/, 51/*z*/, 99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99
+};
+
+static const char kWebSafeBase64DecodeChars[] = {
+    // This array was generated by the following code:
+    // #include <sys/time.h>
+    // #include <stdlib.h>
+    // #include <string.h>
+    // main()
+    // {
+    //   static const char Base64[] =
+    //     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
+    //   char *pos;
+    //   int idx, i, j;
+    //   printf("    ");
+    //   for (i = 0; i < 255; i += 8) {
+    //     for (j = i; j < i + 8; j++) {
+    //       pos = strchr(Base64, j);
+    //       if ((pos == NULL) || (j == 0))
+    //         idx = 99;
+    //       else
+    //         idx = pos - Base64;
+    //       if (idx == 99)
+    //         printf(" %2d,     ", idx);
+    //       else
+    //         printf(" %2d/*%c*/,", idx, j);
+    //     }
+    //     printf("\n    ");
+    //   }
+    // }
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      62/*-*/, 99,      99,
+    52/*0*/, 53/*1*/, 54/*2*/, 55/*3*/, 56/*4*/, 57/*5*/, 58/*6*/, 59/*7*/,
+    60/*8*/, 61/*9*/, 99,      99,      99,      99,      99,      99,
+    99,       0/*A*/,  1/*B*/,  2/*C*/,  3/*D*/,  4/*E*/,  5/*F*/,  6/*G*/,
+    7/*H*/,  8/*I*/,  9/*J*/, 10/*K*/, 11/*L*/, 12/*M*/, 13/*N*/, 14/*O*/,
+    15/*P*/, 16/*Q*/, 17/*R*/, 18/*S*/, 19/*T*/, 20/*U*/, 21/*V*/, 22/*W*/,
+    23/*X*/, 24/*Y*/, 25/*Z*/, 99,      99,      99,      99,      63/*_*/,
+    99,      26/*a*/, 27/*b*/, 28/*c*/, 29/*d*/, 30/*e*/, 31/*f*/, 32/*g*/,
+    33/*h*/, 34/*i*/, 35/*j*/, 36/*k*/, 37/*l*/, 38/*m*/, 39/*n*/, 40/*o*/,
+    41/*p*/, 42/*q*/, 43/*r*/, 44/*s*/, 45/*t*/, 46/*u*/, 47/*v*/, 48/*w*/,
+    49/*x*/, 50/*y*/, 51/*z*/, 99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99,
+    99,      99,      99,      99,      99,      99,      99,      99
+};
+
+
+// Tests a charact to see if it's a whitespace character.
+//
+// Returns:
+//   YES if the character is a whitespace character.
+//   NO if the character is not a whitespace character.
+//
+FOUNDATION_STATIC_INLINE BOOL IsSpace(unsigned char c) {
+    // we use our own mapping here because we don't want anything w/ locale
+    // support.
+    static BOOL kSpaces[256] = {
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 1,  // 0-9
+        1, 1, 1, 1, 0, 0, 0, 0, 0, 0,  // 10-19
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 20-29
+        0, 0, 1, 0, 0, 0, 0, 0, 0, 0,  // 30-39
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 40-49
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 50-59
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 60-69
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 70-79
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 80-89
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 90-99
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 100-109
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 110-119
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 120-129
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 130-139
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 140-149
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 150-159
+        1, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 160-169
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 170-179
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 180-189
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 190-199
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 200-209
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 210-219
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 220-229
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 230-239
+        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,  // 240-249
+        0, 0, 0, 0, 0, 1,              // 250-255
+    };
+    return kSpaces[c];
+}
+
+// Calculate how long the data will be once it's base64 encoded.
+//
+// Returns:
+//   The guessed encoded length for a source length
+//
+FOUNDATION_STATIC_INLINE NSUInteger CalcEncodedLength(NSUInteger srcLen,
+                                                      BOOL padded) {
+    NSUInteger intermediate_result = 8 * srcLen + 5;
+    NSUInteger len = intermediate_result / 6;
+    if (padded) {
+        len = ((len + 3) / 4) * 4;
+    }
+    return len;
+}
+
+// Tries to calculate how long the data will be once it's base64 decoded.
+// Unlinke the above, this is always an upperbound, since the source data
+// could have spaces and might end with the padding characters on them.
+//
+// Returns:
+//   The guessed decoded length for a source length
+//
+FOUNDATION_STATIC_INLINE NSUInteger GuessDecodedLength(NSUInteger srcLen) {
+    return (srcLen + 3) / 4 * 3;
+}
+
+
+@interface GTMBase64 (PrivateMethods)
+
++(NSData *)baseEncode:(const void *)bytes
+               length:(NSUInteger)length
+              charset:(const char *)charset
+               padded:(BOOL)padded;
+
++(NSData *)baseDecode:(const void *)bytes
+               length:(NSUInteger)length
+              charset:(const char*)charset
+       requirePadding:(BOOL)requirePadding;
+
++(NSUInteger)baseEncode:(const char *)srcBytes
+                 srcLen:(NSUInteger)srcLen
+              destBytes:(char *)destBytes
+                destLen:(NSUInteger)destLen
+                charset:(const char *)charset
+                 padded:(BOOL)padded;
+
++(NSUInteger)baseDecode:(const char *)srcBytes
+                 srcLen:(NSUInteger)srcLen
+              destBytes:(char *)destBytes
+                destLen:(NSUInteger)destLen
+                charset:(const char *)charset
+         requirePadding:(BOOL)requirePadding;
+
+@end
+
+
+@implementation GTMBase64
+
+//
+// Standard Base64 (RFC) handling
+//
+
++(NSData *)encodeData:(NSData *)data {
+    return [self baseEncode:[data bytes]
+                     length:[data length]
+                    charset:kBase64EncodeChars
+                     padded:YES];
+}
+
++(NSData *)decodeData:(NSData *)data {
+    return [self baseDecode:[data bytes]
+                     length:[data length]
+                    charset:kBase64DecodeChars
+             requirePadding:YES];
+}
+
++(NSData *)encodeBytes:(const void *)bytes length:(NSUInteger)length {
+    return [self baseEncode:bytes
+                     length:length
+                    charset:kBase64EncodeChars
+                     padded:YES];
+}
+
++(NSData *)decodeBytes:(const void *)bytes length:(NSUInteger)length {
+    return [self baseDecode:bytes
+                     length:length
+                    charset:kBase64DecodeChars
+             requirePadding:YES];
+}
+
++(NSString *)stringByEncodingData:(NSData *)data {
+    NSString *result = nil;
+    NSData *converted = [self baseEncode:[data bytes]
+                                  length:[data length]
+                                 charset:kBase64EncodeChars
+                                  padded:YES];
+    if (converted) {
+        result = [[NSString alloc] initWithData:converted
+                                        encoding:NSASCIIStringEncoding];
+    }
+    return result;
+}
+
++(NSString *)stringByEncodingBytes:(const void *)bytes length:(NSUInteger)length {
+    NSString *result = nil;
+    NSData *converted = [self baseEncode:bytes
+                                  length:length
+                                 charset:kBase64EncodeChars
+                                  padded:YES];
+    if (converted) {
+        result = [[NSString alloc] initWithData:converted
+                                        encoding:NSASCIIStringEncoding];
+    }
+    return result;
+}
+
++(NSData *)decodeString:(NSString *)string {
+    NSData *result = nil;
+    NSData *data = [string dataUsingEncoding:NSASCIIStringEncoding];
+    if (data) {
+        result = [self baseDecode:[data bytes]
+                           length:[data length]
+                          charset:kBase64DecodeChars
+                   requirePadding:YES];
+    }
+    return result;
+}
+
+//
+// Modified Base64 encoding so the results can go onto urls.
+//
+// The changes are in the characters generated and also the result isn't
+// padded to a multiple of 4.
+// Must use the matching call to encode/decode, won't interop with the
+// RFC versions.
+//
+
++(NSData *)webSafeEncodeData:(NSData *)data
+                      padded:(BOOL)padded {
+    return [self baseEncode:[data bytes]
+                     length:[data length]
+                    charset:kWebSafeBase64EncodeChars
+                     padded:padded];
+}
+
++(NSData *)webSafeDecodeData:(NSData *)data {
+    return [self baseDecode:[data bytes]
+                     length:[data length]
+                    charset:kWebSafeBase64DecodeChars
+             requirePadding:NO];
+}
+
++(NSData *)webSafeEncodeBytes:(const void *)bytes
+                       length:(NSUInteger)length
+                       padded:(BOOL)padded {
+    return [self baseEncode:bytes
+                     length:length
+                    charset:kWebSafeBase64EncodeChars
+                     padded:padded];
+}
+
++(NSData *)webSafeDecodeBytes:(const void *)bytes length:(NSUInteger)length {
+    return [self baseDecode:bytes
+                     length:length
+                    charset:kWebSafeBase64DecodeChars
+             requirePadding:NO];
+}
+
++(NSString *)stringByWebSafeEncodingData:(NSData *)data
+                                  padded:(BOOL)padded {
+    NSString *result = nil;
+    NSData *converted = [self baseEncode:[data bytes]
+                                  length:[data length]
+                                 charset:kWebSafeBase64EncodeChars
+                                  padded:padded];
+    if (converted) {
+        result = [[NSString alloc] initWithData:converted
+                                        encoding:NSASCIIStringEncoding];
+    }
+    return result;
+}
+
++(NSString *)stringByWebSafeEncodingBytes:(const void *)bytes
+                                   length:(NSUInteger)length
+                                   padded:(BOOL)padded {
+    NSString *result = nil;
+    NSData *converted = [self baseEncode:bytes
+                                  length:length
+                                 charset:kWebSafeBase64EncodeChars
+                                  padded:padded];
+    if (converted) {
+        result = [[NSString alloc] initWithData:converted
+                                        encoding:NSASCIIStringEncoding];
+    }
+    return result;
+}
+
++(NSData *)webSafeDecodeString:(NSString *)string {
+    NSData *result = nil;
+    NSData *data = [string dataUsingEncoding:NSASCIIStringEncoding];
+    if (data) {
+        result = [self baseDecode:[data bytes]
+                           length:[data length]
+                          charset:kWebSafeBase64DecodeChars
+                   requirePadding:NO];
+    }
+    return result;
+}
+
+@end
+
+@implementation GTMBase64 (PrivateMethods)
+
+//
+// baseEncode:length:charset:padded:
+//
+// Does the common lifting of creating the dest NSData.  it creates & sizes the
+// data for the results.  |charset| is the characters to use for the encoding
+// of the data.  |padding| controls if the encoded data should be padded to a
+// multiple of 4.
+//
+// Returns:
+//   an autorelease NSData with the encoded data, nil if any error.
+//
++(NSData *)baseEncode:(const void *)bytes
+               length:(NSUInteger)length
+              charset:(const char *)charset
+               padded:(BOOL)padded {
+    // how big could it be?
+    NSUInteger maxLength = CalcEncodedLength(length, padded);
+    // make space
+    NSMutableData *result = [NSMutableData data];
+    [result setLength:maxLength];
+    // do it
+    NSUInteger finalLength = [self baseEncode:bytes
+                                       srcLen:length
+                                    destBytes:[result mutableBytes]
+                                      destLen:[result length]
+                                      charset:charset
+                                       padded:padded];
+    if (finalLength) {
+        _GTMDevAssert(finalLength == maxLength, @"how did we calc the length wrong?");
+    } else {
+        // shouldn't happen, this means we ran out of space
+        result = nil;
+    }
+    return result;
+}
+
+//
+// baseDecode:length:charset:requirePadding:
+//
+// Does the common lifting of creating the dest NSData.  it creates & sizes the
+// data for the results.  |charset| is the characters to use for the decoding
+// of the data.
+//
+// Returns:
+//   an autorelease NSData with the decoded data, nil if any error.
+//
+//
++(NSData *)baseDecode:(const void *)bytes
+               length:(NSUInteger)length
+              charset:(const char *)charset
+       requirePadding:(BOOL)requirePadding {
+    // could try to calculate what it will end up as
+    NSUInteger maxLength = GuessDecodedLength(length);
+    // make space
+    NSMutableData *result = [NSMutableData data];
+    [result setLength:maxLength];
+    // do it
+    NSUInteger finalLength = [self baseDecode:bytes
+                                       srcLen:length
+                                    destBytes:[result mutableBytes]
+                                      destLen:[result length]
+                                      charset:charset
+                               requirePadding:requirePadding];
+    if (finalLength) {
+        if (finalLength != maxLength) {
+            // resize down to how big it was
+            [result setLength:finalLength];
+        }
+    } else {
+        // either an error in the args, or we ran out of space
+        result = nil;
+    }
+    return result;
+}
+
+//
+// baseEncode:srcLen:destBytes:destLen:charset:padded:
+//
+// Encodes the buffer into the larger.  returns the length of the encoded
+// data, or zero for an error.
+// |charset| is the characters to use for the encoding
+// |padded| tells if the result should be padded to a multiple of 4.
+//
+// Returns:
+//   the length of the encoded data.  zero if any error.
+//
++(NSUInteger)baseEncode:(const char *)srcBytes
+                 srcLen:(NSUInteger)srcLen
+              destBytes:(char *)destBytes
+                destLen:(NSUInteger)destLen
+                charset:(const char *)charset
+                 padded:(BOOL)padded {
+    if (!srcLen || !destLen || !srcBytes || !destBytes) {
+        return 0;
+    }
+    
+    char *curDest = destBytes;
+    const unsigned char *curSrc = (const unsigned char *)(srcBytes);
+    
+    // Three bytes of data encodes to four characters of cyphertext.
+    // So we can pump through three-byte chunks atomically.
+    while (srcLen > 2) {
+        // space?
+        _GTMDevAssert(destLen >= 4, @"our calc for encoded length was wrong");
+        curDest[0] = charset[curSrc[0] >> 2];
+        curDest[1] = charset[((curSrc[0] & 0x03) << 4) + (curSrc[1] >> 4)];
+        curDest[2] = charset[((curSrc[1] & 0x0f) << 2) + (curSrc[2] >> 6)];
+        curDest[3] = charset[curSrc[2] & 0x3f];
+        
+        curDest += 4;
+        curSrc += 3;
+        srcLen -= 3;
+        destLen -= 4;
+    }
+    
+    // now deal with the tail (<=2 bytes)
+    switch (srcLen) {
+        case 0:
+            // Nothing left; nothing more to do.
+            break;
+        case 1:
+            // One byte left: this encodes to two characters, and (optionally)
+            // two pad characters to round out the four-character cypherblock.
+            _GTMDevAssert(destLen >= 2, @"our calc for encoded length was wrong");
+            curDest[0] = charset[curSrc[0] >> 2];
+            curDest[1] = charset[(curSrc[0] & 0x03) << 4];
+            curDest += 2;
+            destLen -= 2;
+            if (padded) {
+                _GTMDevAssert(destLen >= 2, @"our calc for encoded length was wrong");
+                curDest[0] = kBase64PaddingChar;
+                curDest[1] = kBase64PaddingChar;
+                curDest += 2;
+                //destLen -= 2;
+            }
+            break;
+        case 2:
+            // Two bytes left: this encodes to three characters, and (optionally)
+            // one pad character to round out the four-character cypherblock.
+            _GTMDevAssert(destLen >= 3, @"our calc for encoded length was wrong");
+            curDest[0] = charset[curSrc[0] >> 2];
+            curDest[1] = charset[((curSrc[0] & 0x03) << 4) + (curSrc[1] >> 4)];
+            curDest[2] = charset[(curSrc[1] & 0x0f) << 2];
+            curDest += 3;
+            destLen -= 3;
+            if (padded) {
+                _GTMDevAssert(destLen >= 1, @"our calc for encoded length was wrong");
+                curDest[0] = kBase64PaddingChar;
+                curDest += 1;
+                //destLen -= 1;
+            }
+            break;
+    }
+    // return the length
+    return (curDest - destBytes);
+}
+
+//
+// baseDecode:srcLen:destBytes:destLen:charset:requirePadding:
+//
+// Decodes the buffer into the larger.  returns the length of the decoded
+// data, or zero for an error.
+// |charset| is the character decoding buffer to use
+//
+// Returns:
+//   the length of the encoded data.  zero if any error.
+//
++(NSUInteger)baseDecode:(const char *)srcBytes
+                 srcLen:(NSUInteger)srcLen
+              destBytes:(char *)destBytes
+                destLen:(NSUInteger)destLen
+                charset:(const char *)charset
+         requirePadding:(BOOL)requirePadding {
+    if (!srcLen || !destLen || !srcBytes || !destBytes) {
+        return 0;
+    }
+    
+    int decode;
+    NSUInteger destIndex = 0;
+    int state = 0;
+    char ch = 0;
+    while (srcLen-- && (ch = *srcBytes++) != 0)  {
+        if (IsSpace(ch))  // Skip whitespace
+            continue;
+        
+        if (ch == kBase64PaddingChar)
+            break;
+        
+        decode = charset[(unsigned int)ch];
+        if (decode == kBase64InvalidChar)
+            return 0;
+        
+        // Four cyphertext characters decode to three bytes.
+        // Therefore we can be in one of four states.
+        switch (state) {
+            case 0:
+                // We're at the beginning of a four-character cyphertext block.
+                // This sets the high six bits of the first byte of the
+                // plaintext block.
+                _GTMDevAssert(destIndex < destLen, @"our calc for decoded length was wrong");
+                destBytes[destIndex] = decode << 2;
+                state = 1;
+                break;
+            case 1:
+                // We're one character into a four-character cyphertext block.
+                // This sets the low two bits of the first plaintext byte,
+                // and the high four bits of the second plaintext byte.
+                _GTMDevAssert((destIndex+1) < destLen, @"our calc for decoded length was wrong");
+                destBytes[destIndex] |= decode >> 4;
+                destBytes[destIndex+1] = (decode & 0x0f) << 4;
+                destIndex++;
+                state = 2;
+                break;
+            case 2:
+                // We're two characters into a four-character cyphertext block.
+                // This sets the low four bits of the second plaintext
+                // byte, and the high two bits of the third plaintext byte.
+                // However, if this is the end of data, and those two
+                // bits are zero, it could be that those two bits are
+                // leftovers from the encoding of data that had a length
+                // of two mod three.
+                _GTMDevAssert((destIndex+1) < destLen, @"our calc for decoded length was wrong");
+                destBytes[destIndex] |= decode >> 2;
+                destBytes[destIndex+1] = (decode & 0x03) << 6;
+                destIndex++;
+                state = 3;
+                break;
+            case 3:
+                // We're at the last character of a four-character cyphertext block.
+                // This sets the low six bits of the third plaintext byte.
+                _GTMDevAssert(destIndex < destLen, @"our calc for decoded length was wrong");
+                destBytes[destIndex] |= decode;
+                destIndex++;
+                state = 0;
+                break;
+        }
+    }
+    
+    // We are done decoding Base-64 chars.  Let's see if we ended
+    //      on a byte boundary, and/or with erroneous trailing characters.
+    if (ch == kBase64PaddingChar) {               // We got a pad char
+        if ((state == 0) || (state == 1)) {
+            return 0;  // Invalid '=' in first or second position
+        }
+        if (srcLen == 0) {
+            if (state == 2) { // We run out of input but we still need another '='
+                return 0;
+            }
+            // Otherwise, we are in state 3 and only need this '='
+        } else {
+            if (state == 2) {  // need another '='
+                while ((ch = *srcBytes++) && (srcLen-- > 0)) {
+                    if (!IsSpace(ch))
+                        break;
+                }
+                if (ch != kBase64PaddingChar) {
+                    return 0;
+                }
+            }
+            // state = 1 or 2, check if all remain padding is space
+            while ((ch = *srcBytes++) && (srcLen-- > 0)) {
+                if (!IsSpace(ch)) {
+                    return 0;
+                }
+            }
+        }
+    } else {
+        // We ended by seeing the end of the string.
+        
+        if (requirePadding) {
+            // If we require padding, then anything but state 0 is an error.
+            if (state != 0) {
+                return 0;
+            }
+        } else {
+            // Make sure we have no partial bytes lying around.  Note that we do not
+            // require trailing '=', so states 2 and 3 are okay too.
+            if (state == 1) {
+                return 0;
+            }
+        }
+    }
+    
+    // If then next piece of output was valid and got written to it means we got a
+    // very carefully crafted input that appeared valid but contains some trailing
+    // bits past the real length, so just toss the thing.
+    if ((destIndex < destLen) &&
+        (destBytes[destIndex] != 0)) {
+        return 0;
+    }
+    
+    return destIndex;
+}
+
+@end

+ 138 - 0
JiaPeiManage/Sources/Thirdparty/Utils/3DES/GTMDefines.h

@@ -0,0 +1,138 @@
+//
+// GTMDefines.h
+//
+//  Copyright 2008 Google Inc.
+//
+//  Licensed under the Apache License, Version 2.0 (the "License"); you may not
+//  use this file except in compliance with the License.  You may obtain a copy
+//  of the License at
+//
+//  http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+//  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+//  License for the specific language governing permissions and limitations under
+//  the License.
+//
+
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// CPP symbols that can be overridden in a prefix to control how the toolbox
+// is compiled.
+// ----------------------------------------------------------------------------
+
+
+// GTMHTTPFetcher will support logging by default but only hook its input
+// stream support for logging when requested.  You can control the inclusion of
+// the code by providing your own definitions for these w/in a prefix header.
+//
+#ifndef GTM_HTTPFETCHER_ENABLE_LOGGING
+# define GTM_HTTPFETCHER_ENABLE_LOGGING 1
+#endif // GTM_HTTPFETCHER_ENABLE_LOGGING
+#ifndef GTM_HTTPFETCHER_ENABLE_INPUTSTREAM_LOGGING
+# define GTM_HTTPFETCHER_ENABLE_INPUTSTREAM_LOGGING 0
+#endif // GTM_HTTPFETCHER_ENABLE_INPUTSTREAM_LOGGING
+
+
+// _GTMDevLog & _GTMDevAssert
+//
+// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for
+// developer level errors.  This implementation simply macros to NSLog/NSAssert.
+// It is not intended to be a general logging/reporting system.
+//
+// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
+// for a little more background on the usage of these macros.
+//
+//    _GTMDevLog           log some error/problem in debug builds
+//    _GTMDevAssert        assert if conditon isn't met w/in a method/function
+//                           in all builds.
+//
+// To replace this system, just provide different macro definitions in your
+// prefix header.  Remember, any implementation you provide *must* be thread
+// safe since this could be called by anything in what ever situtation it has
+// been placed in.
+//
+
+// We only define the simple macros if nothing else has defined this.
+#ifndef _GTMDevLog
+
+#ifdef DEBUG
+#define _GTMDevLog(...) NSLog(__VA_ARGS__)
+#else
+#define _GTMDevLog(...) do { } while (0)
+#endif
+
+// we directly invoke the NSAssert handler so we can pass on the varargs
+// (NSAssert doesn't have a macro we can use that takes varargs)
+#if !defined(NS_BLOCK_ASSERTIONS)
+#define _GTMDevAssert(condition, ...)                                    \
+do {                                                                   \
+if (!(condition)) {                                                  \
+[[NSAssertionHandler currentHandler]                               \
+handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
+file:[NSString stringWithUTF8String:__FILE__]  \
+lineNumber:__LINE__                               \
+description:__VA_ARGS__];                          \
+}                                                                    \
+} while(0)
+#else // !defined(NS_BLOCK_ASSERTIONS)
+#define _GTMDevAssert(condition, ...) do { } while (0)
+#endif // !defined(NS_BLOCK_ASSERTIONS)
+
+#endif // _GTMDevLog
+
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// CPP symbols defined based on the project settings so the GTM code has
+// simple things to test against w/o scattering the knowledge of project
+// setting through all the code.
+// ----------------------------------------------------------------------------
+
+// Provide a single constant CPP symbol that all of GTM uses for ifdefing
+// iPhone code.
+#include <TargetConditionals.h>
+#if TARGET_OS_IPHONE // iPhone SDK
+// For iPhone specific stuff
+#define GTM_IPHONE_SDK 1
+#else
+// For MacOS specific stuff
+#define GTM_MACOS_SDK 1
+#endif
+
+// To simplify support for 64bit (and Leopard in general), we provide the type
+// defines for non Leopard SDKs
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+// NSInteger/NSUInteger and Max/Mins
+#ifndef NSINTEGER_DEFINED
+#if __LP64__ || NS_BUILD_32_LIKE_64
+typedef long NSInteger;
+typedef unsigned long NSUInteger;
+#else
+typedef int NSInteger;
+typedef unsigned int NSUInteger;
+#endif
+#define NSIntegerMax    LONG_MAX
+#define NSIntegerMin    LONG_MIN
+#define NSUIntegerMax   ULONG_MAX
+#define NSINTEGER_DEFINED 1
+#endif  // NSINTEGER_DEFINED
+// CGFloat
+#ifndef CGFLOAT_DEFINED
+#if defined(__LP64__) && __LP64__
+// This really is an untested path (64bit on Tiger?)
+typedef double CGFloat;
+#define CGFLOAT_MIN DBL_MIN
+#define CGFLOAT_MAX DBL_MAX
+#define CGFLOAT_IS_DOUBLE 1
+#else /* !defined(__LP64__) || !__LP64__ */
+typedef float CGFloat;
+#define CGFLOAT_MIN FLT_MIN
+#define CGFLOAT_MAX FLT_MAX
+#define CGFLOAT_IS_DOUBLE 0
+#endif /* !defined(__LP64__) || !__LP64__ */
+#define CGFLOAT_DEFINED 1
+#endif // CGFLOAT_DEFINED
+#endif  // MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4

+ 6 - 1
JiaPeiManage/Sources/Utils/NYSwRouter.swift

@@ -9,7 +9,6 @@ import UIKit
 
 import URLNavigator
 
-
 enum NYSwPushType {
     case trainee_info
     case trainee_search
@@ -20,6 +19,8 @@ enum NYSwPushType {
     case trainee_list_school
     case trainee_statistics
     case trainee_statistics_official
+    case coach_qrcode
+    case coach_qrcode_download
 }
 
 
@@ -52,6 +53,10 @@ extension NYSwPushType {
             return "JiaPeiManage://me/trainee/statistics"
         case .trainee_statistics_official:
             return "JiaPeiManage://me/trainee/statistics/official"
+        case .coach_qrcode:
+            return "JiaPeiManage://me/coach/qrcode"
+        case .coach_qrcode_download:
+            return "JiaPeiManage://me/coach/qrcode/download"
         }
     }
 }

+ 17 - 3
JiaPeiManage/Sources/Utils/URLNavigationMap.swift

@@ -27,13 +27,13 @@ final class URLNavigationMap {
         }
         
         navigator.register(NYSwPushType.trainee_statistics.path) { (url, values, context) -> UIViewController? in
-            let statisticsPageController = StatisticsPageController()
+            let statisticsPageController = StatisticsPageController(type: .normal)
             return statisticsPageController
         }
         
         navigator.register(NYSwPushType.trainee_statistics_official.path) { (url, values, context) -> UIViewController? in
-            let statisticsOfficialPageController = StatisticsOfficialPageController()
-            return statisticsOfficialPageController
+            let statisticsPageController = StatisticsPageController(type: .presell)
+            return statisticsPageController
         }
         
         navigator.register(NYSwPushType.trainee_list.path) { (url, values, context) -> UIViewController? in
@@ -65,6 +65,20 @@ final class URLNavigationMap {
             return mineViewController
         }
         
+        navigator.register(NYSwPushType.coach_qrcode.path) { (url, values, context) -> UIViewController? in
+
+            let coachQRPageController = CoachQRPageController(nibName: "CoachQRPageController")
+    
+            return coachQRPageController
+        }
+        navigator.register(NYSwPushType.coach_qrcode_download.path) { (url, values, context) -> UIViewController? in
+
+            let coachAppdownloadPageController = CoachAppdownloadPageController(nibName: "CoachAppdownloadPageController")
+            coachAppdownloadPageController.type = (context as! Int)==1 ? .ios : .android
+            return coachAppdownloadPageController
+        }
+        
+        
         //open api
         navigator.register("http://<path:_>",self.webViewControllerFactory)
         navigator.register("https://<path:_>",self.webViewControllerFactory)