Browse Source

Merge remote-tracking branch 'origin/developPay'

# Conflicts:
#	ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj
#	ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
#	ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
#	ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch
#	ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m
#	ios/JianYuIOS/JianYuIOS/ViewController.m
apple 6 years ago
parent
commit
6fde80061a
97 changed files with 10979 additions and 509 deletions
  1. 183 17
      ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj
  2. 2 2
      ios/JianYuIOS/JianYuIOS.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/JianYuIOS.xcscheme
  3. BIN
      ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
  4. 6 1
      ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  5. 129 63
      ios/JianYuIOS/JianYuIOS/AppDelegate.m
  6. 22 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/Contents.json
  7. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/icon-home@2x.png
  8. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/icon-home@3x.png
  9. 6 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/Contents.json
  10. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/Contents.json
  11. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory.png
  12. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory@2x.png
  13. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory@3x.png
  14. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/Contents.json
  15. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1.png
  16. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1@2x.png
  17. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1@3x.png
  18. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/Contents.json
  19. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine.png
  20. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine@2x.png
  21. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine@3x.png
  22. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/Contents.json
  23. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1.png
  24. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1@2x.png
  25. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1@3x.png
  26. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/Contents.json
  27. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search.png
  28. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search@2x.png
  29. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search@3x.png
  30. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/Contents.json
  31. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1.png
  32. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1@2x.png
  33. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1@3x.png
  34. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/Contents.json
  35. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe.png
  36. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe@2x.png
  37. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe@3x.png
  38. 23 0
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/Contents.json
  39. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1.png
  40. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1@2x.png
  41. BIN
      ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1@3x.png
  42. 1 8
      ios/JianYuIOS/JianYuIOS/Base.lproj/Main.storyboard
  43. 18 0
      ios/JianYuIOS/JianYuIOS/BaseClass1/GlobalData.h
  44. 50 0
      ios/JianYuIOS/JianYuIOS/BaseClass1/GlobalData.m
  45. 8 2
      ios/JianYuIOS/JianYuIOS/BaseClass1/LXNetworkManager.m
  46. 92 2
      ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch
  47. 15 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.h
  48. 946 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m
  49. 15 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.h
  50. 1023 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m
  51. 16 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.h
  52. 1213 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m
  53. 15 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.h
  54. 938 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m
  55. 94 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/UIView+Extension.h
  56. 212 0
      ios/JianYuIOS/JianYuIOS/Classes(模块)/UIView+Extension.m
  57. 23 6
      ios/JianYuIOS/JianYuIOS/Info.plist
  58. 13 0
      ios/JianYuIOS/JianYuIOS/JYNavigationController.h
  59. 87 0
      ios/JianYuIOS/JianYuIOS/JYNavigationController.m
  60. 13 0
      ios/JianYuIOS/JianYuIOS/JYTabBarController.h
  61. 221 0
      ios/JianYuIOS/JianYuIOS/JYTabBarController.m
  62. 17 0
      ios/JianYuIOS/JianYuIOS/UITabBar+badge.h
  63. 55 0
      ios/JianYuIOS/JianYuIOS/UITabBar+badge.m
  64. 10 1
      ios/JianYuIOS/JianYuIOS/ViewController.h
  65. 110 9
      ios/JianYuIOS/JianYuIOS/ViewController.m
  66. 895 0
      ios/JianYuIOS/JianYuIOS/ViewController_BACKUP_16982.m
  67. 715 0
      ios/JianYuIOS/JianYuIOS/ViewController_BASE_16982.m
  68. 794 0
      ios/JianYuIOS/JianYuIOS/ViewController_LOCAL_16982.m
  69. 868 0
      ios/JianYuIOS/JianYuIOS/ViewController_REMOTE_16982.m
  70. 4 0
      ios/JianYuIOS/Podfile
  71. 15 2
      ios/JianYuIOS/Podfile.lock
  72. 1 0
      ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WXApi.h
  73. 1 0
      ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WXApiObject.h
  74. 1 0
      ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WechatAuthSDK.h
  75. 1 0
      ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WXApi.h
  76. 1 0
      ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WXApiObject.h
  77. 1 0
      ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WechatAuthSDK.h
  78. 15 2
      ios/JianYuIOS/Pods/Manifest.lock
  79. 360 351
      ios/JianYuIOS/Pods/Pods.xcodeproj/project.pbxproj
  80. 60 0
      ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/AFNetworking.xcscheme
  81. 60 0
      ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/FMDB.xcscheme
  82. 60 0
      ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/MBProgressHUD.xcscheme
  83. 60 0
      ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/Pods-JianYuIOS.xcscheme
  84. 10 8
      ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist
  85. 4 4
      ios/JianYuIOS/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig
  86. 4 4
      ios/JianYuIOS/Pods/Target Support Files/FMDB/FMDB.xcconfig
  87. 4 4
      ios/JianYuIOS/Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig
  88. 5 0
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-acknowledgements.markdown
  89. 11 0
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-acknowledgements.plist
  90. 49 8
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-frameworks.sh
  91. 15 3
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-resources.sh
  92. 6 6
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.debug.xcconfig
  93. 6 6
      ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.release.xcconfig
  94. 193 0
      ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WXApi.h
  95. 959 0
      ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WXApiObject.h
  96. 64 0
      ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WechatAuthSDK.h
  97. BIN
      ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/libWeChatSDK.a

+ 183 - 17
ios/JianYuIOS/JianYuIOS.xcodeproj/project.pbxproj

@@ -7,7 +7,20 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
+<<<<<<< HEAD
 		1876C3EA2199044700BC23DE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1876C3E92199044700BC23DE /* ViewController.m */; };
+=======
+		1876C3FC219920DE00BC23DE /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1876C3FB219920DE00BC23DE /* ViewController.m */; };
+		187B4EE321EC356100A9368D /* UIView+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 187B4EE221EC356100A9368D /* UIView+Extension.m */; };
+		187B4EE621EC635700A9368D /* GlobalData.m in Sources */ = {isa = PBXBuildFile; fileRef = 187B4EE521EC635700A9368D /* GlobalData.m */; };
+		188036FB2193EA09006F9D7B /* JYNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188036F72193EA08006F9D7B /* JYNavigationController.m */; };
+		188036FC2193EA09006F9D7B /* JYTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188036F92193EA09006F9D7B /* JYTabBarController.m */; };
+		1880371E2193EB25006F9D7B /* JYSearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188037162193EB25006F9D7B /* JYSearchViewController.m */; };
+		1880371F2193EB25006F9D7B /* JYMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 188037172193EB25006F9D7B /* JYMineViewController.m */; };
+		188037202193EB25006F9D7B /* JYSubViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1880371B2193EB25006F9D7B /* JYSubViewController.m */; };
+		188037212193EB25006F9D7B /* JYExpViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1880371C2193EB25006F9D7B /* JYExpViewController.m */; };
+		18C9D8E7219A5F9F001AC829 /* UITabBar+badge.m in Sources */ = {isa = PBXBuildFile; fileRef = 18C9D8E6219A5F9F001AC829 /* UITabBar+badge.m */; };
+>>>>>>> origin/developPay
 		9ADF6A094C6E01A55F2E47CC /* libPods-JianYuIOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0CA962A24EED00910F83394E /* libPods-JianYuIOS.a */; };
 		C519972C2020238D007946E8 /* LXUserDefaults.m in Sources */ = {isa = PBXBuildFile; fileRef = C51997232020238D007946E8 /* LXUserDefaults.m */; };
 		C519972D2020238D007946E8 /* LXMD5.m in Sources */ = {isa = PBXBuildFile; fileRef = C51997242020238D007946E8 /* LXMD5.m */; };
@@ -56,7 +69,30 @@
 /* Begin PBXFileReference section */
 		0CA962A24EED00910F83394E /* libPods-JianYuIOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-JianYuIOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
 		10D9BC27D00CB4DF3F791728 /* Pods-JianYuIOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JianYuIOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.release.xcconfig"; sourceTree = "<group>"; };
+<<<<<<< HEAD
 		1876C3E92199044700BC23DE /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+=======
+		1876C3FB219920DE00BC23DE /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
+		187B4EE121EC356100A9368D /* UIView+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIView+Extension.h"; sourceTree = "<group>"; };
+		187B4EE221EC356100A9368D /* UIView+Extension.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIView+Extension.m"; sourceTree = "<group>"; };
+		187B4EE421EC635700A9368D /* GlobalData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalData.h; sourceTree = "<group>"; };
+		187B4EE521EC635700A9368D /* GlobalData.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GlobalData.m; sourceTree = "<group>"; };
+		188036F72193EA08006F9D7B /* JYNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYNavigationController.m; sourceTree = "<group>"; };
+		188036F82193EA09006F9D7B /* JYTabBarController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYTabBarController.h; sourceTree = "<group>"; };
+		188036F92193EA09006F9D7B /* JYTabBarController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYTabBarController.m; sourceTree = "<group>"; };
+		188036FA2193EA09006F9D7B /* JYNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYNavigationController.h; sourceTree = "<group>"; };
+		188037162193EB25006F9D7B /* JYSearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYSearchViewController.m; sourceTree = "<group>"; };
+		188037172193EB25006F9D7B /* JYMineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYMineViewController.m; sourceTree = "<group>"; };
+		188037182193EB25006F9D7B /* JYMineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYMineViewController.h; sourceTree = "<group>"; };
+		188037192193EB25006F9D7B /* JYExpViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYExpViewController.h; sourceTree = "<group>"; };
+		1880371A2193EB25006F9D7B /* JYSubViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYSubViewController.h; sourceTree = "<group>"; };
+		1880371B2193EB25006F9D7B /* JYSubViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYSubViewController.m; sourceTree = "<group>"; };
+		1880371C2193EB25006F9D7B /* JYExpViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JYExpViewController.m; sourceTree = "<group>"; };
+		1880371D2193EB25006F9D7B /* JYSearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JYSearchViewController.h; sourceTree = "<group>"; };
+		18B2DF4021ACDA5D00B5C93F /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
+		18C9D8E5219A5F9F001AC829 /* UITabBar+badge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UITabBar+badge.h"; sourceTree = "<group>"; };
+		18C9D8E6219A5F9F001AC829 /* UITabBar+badge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UITabBar+badge.m"; sourceTree = "<group>"; };
+>>>>>>> origin/developPay
 		775098970477D1E68FB48E59 /* Pods-JianYuIOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JianYuIOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.debug.xcconfig"; sourceTree = "<group>"; };
 		C51997222020238D007946E8 /* LXViewControllerManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LXViewControllerManager.h; sourceTree = "<group>"; };
 		C51997232020238D007946E8 /* LXUserDefaults.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LXUserDefaults.m; sourceTree = "<group>"; };
@@ -131,6 +167,30 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		183487ED21A8E68A009FDA1D /* Libs(第三方) */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = "Libs(第三方)";
+			sourceTree = "<group>";
+		};
+		188037092193EAD1006F9D7B /* Classes(模块) */ = {
+			isa = PBXGroup;
+			children = (
+				1880371D2193EB25006F9D7B /* JYSearchViewController.h */,
+				188037162193EB25006F9D7B /* JYSearchViewController.m */,
+				1880371A2193EB25006F9D7B /* JYSubViewController.h */,
+				1880371B2193EB25006F9D7B /* JYSubViewController.m */,
+				188037192193EB25006F9D7B /* JYExpViewController.h */,
+				1880371C2193EB25006F9D7B /* JYExpViewController.m */,
+				188037182193EB25006F9D7B /* JYMineViewController.h */,
+				188037172193EB25006F9D7B /* JYMineViewController.m */,
+				187B4EE121EC356100A9368D /* UIView+Extension.h */,
+				187B4EE221EC356100A9368D /* UIView+Extension.m */,
+			);
+			path = "Classes(模块)";
+			sourceTree = "<group>";
+		};
 		6EA6142EFDB37618478F7732 /* Pods */ = {
 			isa = PBXGroup;
 			children = (
@@ -143,6 +203,7 @@
 		954256EB2ECEF2507E4350ED /* Frameworks */ = {
 			isa = PBXGroup;
 			children = (
+				18B2DF4021ACDA5D00B5C93F /* WebKit.framework */,
 				C550BF352018591400F0BC2A /* CoreGraphics.framework */,
 				C550BF332018590A00F0BC2A /* libsqlite3.tbd */,
 				0CA962A24EED00910F83394E /* libPods-JianYuIOS.a */,
@@ -164,6 +225,8 @@
 				C51997232020238D007946E8 /* LXUserDefaults.m */,
 				C51997222020238D007946E8 /* LXViewControllerManager.h */,
 				C51997282020238D007946E8 /* LXViewControllerManager.m */,
+				187B4EE421EC635700A9368D /* GlobalData.h */,
+				187B4EE521EC635700A9368D /* GlobalData.m */,
 				C51997292020238D007946E8 /* PrefixHeader.pch */,
 			);
 			path = BaseClass1;
@@ -218,12 +281,24 @@
 		C5BE6E392011D99100F28B36 /* JianYuIOS */ = {
 			isa = PBXGroup;
 			children = (
+				183487ED21A8E68A009FDA1D /* Libs(第三方) */,
 				C5321C73202BD8800023CFEA /* CustomView */,
 				C519972120202348007946E8 /* BaseClass1 */,
 				C5493106201F04120080CD63 /* Image */,
 				C550BEF420180AB700F0BC2A /* JianYuIOS.entitlements */,
+				188037092193EAD1006F9D7B /* Classes(模块) */,
 				C5BE6E3D2011D99100F28B36 /* ViewController.h */,
+<<<<<<< HEAD
 				1876C3E92199044700BC23DE /* ViewController.m */,
+=======
+				1876C3FB219920DE00BC23DE /* ViewController.m */,
+				188036FA2193EA09006F9D7B /* JYNavigationController.h */,
+				188036F72193EA08006F9D7B /* JYNavigationController.m */,
+				188036F82193EA09006F9D7B /* JYTabBarController.h */,
+				188036F92193EA09006F9D7B /* JYTabBarController.m */,
+				18C9D8E5219A5F9F001AC829 /* UITabBar+badge.h */,
+				18C9D8E6219A5F9F001AC829 /* UITabBar+badge.m */,
+>>>>>>> origin/developPay
 				C55FF3BC20230E7E0088AECC /* NewWebController.h */,
 				C55FF3BD20230E7E0088AECC /* NewWebController.m */,
 				C55FF3BE20230E7E0088AECC /* NewWebController.xib */,
@@ -267,7 +342,6 @@
 				C5BE6E332011D99100F28B36 /* Sources */,
 				C5BE6E342011D99100F28B36 /* Frameworks */,
 				C5BE6E352011D99100F28B36 /* Resources */,
-				E4A6CD0CC38A016FEC9976FB /* [CP] Embed Pods Frameworks */,
 				AD91A30993F62DBBFD1AA485 /* [CP] Copy Pods Resources */,
 			);
 			buildRules = (
@@ -437,28 +511,14 @@
 			);
 			name = "[CP] Copy Pods Resources";
 			outputPaths = (
-				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}",
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UMSocialSDKPromptResources.bundle",
+				"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/UMSocialSDKResources.bundle",
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 		};
-		E4A6CD0CC38A016FEC9976FB /* [CP] Embed Pods Frameworks */ = {
-			isa = PBXShellScriptBuildPhase;
-			buildActionMask = 2147483647;
-			files = (
-			);
-			inputPaths = (
-			);
-			name = "[CP] Embed Pods Frameworks";
-			outputPaths = (
-			);
-			runOnlyForDeploymentPostprocessing = 0;
-			shellPath = /bin/sh;
-			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-frameworks.sh\"\n";
-			showEnvVarsInLog = 0;
-		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */
@@ -466,17 +526,33 @@
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+<<<<<<< HEAD
+=======
+				1876C3FC219920DE00BC23DE /* ViewController.m in Sources */,
+>>>>>>> origin/developPay
 				C55FF3BF20230E7E0088AECC /* NewWebController.m in Sources */,
 				C519972D2020238D007946E8 /* LXMD5.m in Sources */,
+				18C9D8E7219A5F9F001AC829 /* UITabBar+badge.m in Sources */,
 				C555EC282047DC5E0084642F /* LXNetworkManager.m in Sources */,
 				C519972F2020238D007946E8 /* LXDataBaseManager.m in Sources */,
+				187B4EE321EC356100A9368D /* UIView+Extension.m in Sources */,
 				C550BEFA20180AF000F0BC2A /* main.m in Sources */,
+<<<<<<< HEAD
 				1876C3EA2199044700BC23DE /* ViewController.m in Sources */,
+=======
+				188036FC2193EA09006F9D7B /* JYTabBarController.m in Sources */,
+				188036FB2193EA09006F9D7B /* JYNavigationController.m in Sources */,
+>>>>>>> origin/developPay
 				C5321C76202BD89B0023CFEA /* LXProgressView.m in Sources */,
 				C519972C2020238D007946E8 /* LXUserDefaults.m in Sources */,
 				C5FE4B5720468BC900CC8A2F /* NoNetView.m in Sources */,
 				C519972E2020238D007946E8 /* LXViewControllerManager.m in Sources */,
+				188037202193EB25006F9D7B /* JYSubViewController.m in Sources */,
+				188037212193EB25006F9D7B /* JYExpViewController.m in Sources */,
+				1880371F2193EB25006F9D7B /* JYMineViewController.m in Sources */,
 				C550BEF920180AF000F0BC2A /* AppDelegate.m in Sources */,
+				187B4EE621EC635700A9368D /* GlobalData.m in Sources */,
+				1880371E2193EB25006F9D7B /* JYSearchViewController.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -659,6 +735,51 @@
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/SocialLibraries/WeChat",
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/SocialLibraries/QQ",
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/UMSocialSDKPlugin",
+					"$(PROJECT_DIR)/JianYuIOS/Libs(第三方)/WeChatSDK1.8.3",
+				);
+				OTHER_LDFLAGS = (
+					"$(inherited)",
+					"-ObjC",
+					"-l\"AFNetworking\"",
+					"-l\"FMDB\"",
+					"-l\"MBProgressHUD\"",
+					"-l\"SocialQQ\"",
+					"-l\"SocialWeChat\"",
+					"-l\"UMSocialLog\"",
+					"-l\"jcore-ios-1.1.7\"",
+					"-l\"jpush-ios-3.0.8\"",
+					"-l\"resolv\"",
+					"-l\"sqlite3\"",
+					"-l\"z\"",
+					"-framework",
+					"\"CFNetwork\"",
+					"-framework",
+					"\"CoreFoundation\"",
+					"-framework",
+					"\"CoreGraphics\"",
+					"-framework",
+					"\"CoreTelephony\"",
+					"-framework",
+					"\"Foundation\"",
+					"-framework",
+					"\"MobileCoreServices\"",
+					"-framework",
+					"\"QuartzCore\"",
+					"-framework",
+					"\"Security\"",
+					"-framework",
+					"\"SystemConfiguration\"",
+					"-framework",
+					"\"UIKit\"",
+					"-framework",
+					"\"UMSocialCore\"",
+					"-framework",
+					"\"UMSocialNetwork\"",
+					"-framework",
+					"\"UShareUI\"",
+					"-weak_framework",
+					"\"UserNotifications\"",
+					"-all_load",
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = com.topnet.jianyuiOS;
 				PRODUCT_NAME = "$(TARGET_NAME)";
@@ -694,6 +815,51 @@
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/SocialLibraries/WeChat",
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/SocialLibraries/QQ",
 					"$(PROJECT_DIR)/JianYuIOS/ThirdSDK/UMSocial/UMSocialSDKPlugin",
+					"$(PROJECT_DIR)/JianYuIOS/Libs(第三方)/WeChatSDK1.8.3",
+				);
+				OTHER_LDFLAGS = (
+					"$(inherited)",
+					"-ObjC",
+					"-l\"AFNetworking\"",
+					"-l\"FMDB\"",
+					"-l\"MBProgressHUD\"",
+					"-l\"SocialQQ\"",
+					"-l\"SocialWeChat\"",
+					"-l\"UMSocialLog\"",
+					"-l\"jcore-ios-1.1.7\"",
+					"-l\"jpush-ios-3.0.8\"",
+					"-l\"resolv\"",
+					"-l\"sqlite3\"",
+					"-l\"z\"",
+					"-framework",
+					"\"CFNetwork\"",
+					"-framework",
+					"\"CoreFoundation\"",
+					"-framework",
+					"\"CoreGraphics\"",
+					"-framework",
+					"\"CoreTelephony\"",
+					"-framework",
+					"\"Foundation\"",
+					"-framework",
+					"\"MobileCoreServices\"",
+					"-framework",
+					"\"QuartzCore\"",
+					"-framework",
+					"\"Security\"",
+					"-framework",
+					"\"SystemConfiguration\"",
+					"-framework",
+					"\"UIKit\"",
+					"-framework",
+					"\"UMSocialCore\"",
+					"-framework",
+					"\"UMSocialNetwork\"",
+					"-framework",
+					"\"UShareUI\"",
+					"-weak_framework",
+					"\"UserNotifications\"",
+					"-all_load",
 				);
 				PRODUCT_BUNDLE_IDENTIFIER = com.topnet.jianyuiOS;
 				PRODUCT_NAME = "$(TARGET_NAME)";

+ 2 - 2
ios/JianYuIOS/JianYuIOS.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/JianYuIOS.xcscheme

@@ -85,7 +85,7 @@
          <EnvironmentVariable
             key = "OS_ACTIVITY_MODE"
             value = "disable"
-            isEnabled = "NO">
+            isEnabled = "YES">
          </EnvironmentVariable>
       </EnvironmentVariables>
       <AdditionalOptions>
@@ -109,7 +109,7 @@
       </BuildableProductRunnable>
    </ProfileAction>
    <AnalyzeAction
-      buildConfiguration = "Debug">
+      buildConfiguration = "Release">
    </AnalyzeAction>
    <ArchiveAction
       buildConfiguration = "Release"

BIN
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate


+ 6 - 1
ios/JianYuIOS/JianYuIOS.xcworkspace/xcuserdata/apple.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -4,11 +4,12 @@
    version = "2.0">
    <Breakpoints>
       <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
          <BreakpointContent
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
+<<<<<<< HEAD
             filePath = "JianYuIOS/Classes&#xff08;&#x6a21;&#x5757;&#xff09;/JYMineViewController.m"
             timestampString = "563446397.612505"
             startingColumnNumber = "9223372036854775807"
@@ -33,6 +34,10 @@
             endingLineNumber = "407"
             landmarkName = "-application:openURL:sourceApplication:annotation:"
             landmarkType = "7">
+=======
+            scope = "0"
+            stopOnStyle = "0">
+>>>>>>> origin/developPay
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>

+ 129 - 63
ios/JianYuIOS/JianYuIOS/AppDelegate.m

@@ -17,6 +17,9 @@
 #import <AdSupport/AdSupport.h>
 #import <UMSocialCore/UMSocialCore.h>
 
+#import "JYTabBarController.h"
+
+
 @interface AppDelegate ()<JPUSHRegisterDelegate>
 
 @property(nonatomic, strong)UIImageView *imgView;
@@ -29,6 +32,16 @@
 
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
     // Override point for customization after application launch.
+    [[NSUserDefaults standardUserDefaults] setObject:@"0" forKey:@"FirstLogin"];
+    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
+    JYTabBarController *tabBarVc = [[JYTabBarController alloc] init];
+    self.window.rootViewController = tabBarVc;
+    [self.window makeKeyAndVisible];
+    
+    [GlobalData shareInstance];
+    [LXDataBaseManager shareDataBaseManager];//初始化单例
+    [LXViewControllerManager shareViewControllerManager];
+    
     [self initJPush:launchOptions];
     [self initUM];
     
@@ -77,6 +90,7 @@
     NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
     [defaultCenter addObserver:self selector:@selector(networkDidReceiveMessage:) name:kJPFNetworkDidReceiveMessageNotification object:nil];
     [JPUSHService registrationIDCompletionHandler:^(int resCode, NSString *registrationID) {
+        NSLog(@"registrationID==%@",registrationID);
         [LXUserDefaults saveRegistrationID:registrationID];
     }];
 //    NSDictionary * userInfo =
@@ -104,6 +118,9 @@
 - (void)configUSharePlatforms{
     [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_WechatSession appKey:@"wx0e6a5b18f4cfd10d" appSecret:@"bf12200554cb6edeb2be69d49dc11a3e" redirectURL:nil];
     [[UMSocialManager defaultManager] setPlaform:UMSocialPlatformType_QQ appKey:@"1106703118"/*设置QQ平台的appID*/  appSecret:@"MYFVJZhtygWy5hzh" redirectURL:@"http://mobile.umeng.com/social"];
+    
+    
+    [WXApi registerApp:@"wx0e6a5b18f4cfd10d"];
 }
 
 
@@ -215,45 +232,61 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
         NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
         if (info[@"url"]) {
             
-            if (userInfo[@"type"] && ![userInfo[@"type"] isEqualToString:@""]) {
-                [temp setObject:userInfo[@"type"] forKey:@"type"];
-            }
+//            if (userInfo[@"type"] && ![userInfo[@"type"] isEqualToString:@""]) {
+//                [temp setObject:userInfo[@"type"] forKey:@"type"];
+//            }
+//
+//
+//            NSString *pushTime = info[@"pushTime"];
+//            if (pushTime && ![pushTime isEqualToString:@""]) {
+//
+//                if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
+////                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
+//                }
+//                [[LXDataBaseManager shareDataBaseManager] changeReadedWithPushTime:info[@"pushTime"]];
+//                if (!info[@"type"] || [info[@"type"] isEqualToString:@""]) {
+//                    NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnID:info[@"pushTime"] inTable:kNewsTable];
+//                    if (ids) {
+//                        [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
+//                    }
+//                }
+//            }else{
+//
+//                if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
+////                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
+//                }
+//                [[LXDataBaseManager shareDataBaseManager] changeReadedWithURL:info[@"url"] openid:info[@"openid"]];
+//                NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnIDWithUrl:info[@"url"] openid:info[@"openid"] inTable:kNewsTable];
+//                if (ids) {
+//                    [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
+//                }
+//            }
             
+            // 跳转到该链接
             
-            NSString *pushTime = info[@"pushTime"];
-            if (pushTime && ![pushTime isEqualToString:@""]) {
-                
-                if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
-                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
-                }
-                [[LXDataBaseManager shareDataBaseManager] changeReadedWithPushTime:info[@"pushTime"]];
-                if (!info[@"type"] || [info[@"type"] isEqualToString:@""]) {
-                    NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnID:info[@"pushTime"] inTable:kNewsTable];
-                    if (ids) {
-                        [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
-                    }
-                }
-            }else{
-                
-                if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
-                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
-                }
-                [[LXDataBaseManager shareDataBaseManager] changeReadedWithURL:info[@"url"] openid:info[@"openid"]];
-                NSString *ids = [[LXDataBaseManager shareDataBaseManager] returnIDWithUrl:info[@"url"] openid:info[@"openid"] inTable:kNewsTable];
-                if (ids) {
-                    [temp setObject:[NSString stringWithFormat:@"%@%@", info[@"url"], ids] forKey:@"url"];
-                }
+
+            
+            if([userInfo[@"type"] isEqualToString:@"bid"]) {
+                //如果是订阅消息
+                [[NSNotificationCenter defaultCenter] postNotificationName:ClickSubNotiMethods object:userInfo userInfo:nil];
+            }else {
+                [[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
             }
             
-            // 跳转到该链接
-            [[NSNotificationCenter defaultCenter] postNotificationName:kRequestWebViewWithUrl object:temp userInfo:nil];
+            if(self.wakeUpBool) {
+                //刚启动
+                [[NSUserDefaults standardUserDefaults]setObject:userInfo forKey:@"NotiDict"];
+                self.wakeUpBool = NO;
+            }
             
-             if([info[@"type"] isEqualToString:@"message"]) {
+            NSLog(@"%@",info);
+             if([userInfo[@"type"] isEqualToString:@"message"]) {
                  
-                 [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:info[@"url"]];
+                 [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:userInfo[@"url"]];
                  
                  NSDictionary * infoDic;
                  if(self.wakeUpBool) {
+                     //刚启动
                      infoDic = @{@"url":info[@"url"],
                                  @"rectype":@"A",
                                  @"openid":info[@"openid"],
@@ -281,6 +314,8 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
             
             
             
+            
+            
         }
     }
     
@@ -311,42 +346,42 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     NSLog(@"info--新消息%@",info);
     if (info ) {
         if (info[@"url"]) {
-            NSString *pushTime = info[@"pushTime"];
-            if (pushTime && ![pushTime isEqualToString:@""]) {
-                
-                if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
-                    NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
-                    if (userInfo[@"type"]) {
-                        [temp setObject:userInfo[@"type"] forKey:@"type"];
-                    }
-                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
-                }
-            }
-            else{
-                
-                if([info[@"type"] isEqualToString:@"message"]) {
-                    NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
-                    if (userInfo[@"type"]) {
-                        [temp setObject:userInfo[@"type"] forKey:@"type"];
-                    }
-                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
-                }else {
-                    if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
-                        NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
-                        if (userInfo[@"type"]) {
-                            [temp setObject:userInfo[@"type"] forKey:@"type"];
-                        }
-                        [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
-                    }
-                }
-
-            }
+//            NSString *pushTime = info[@"pushTime"];
+//            if (pushTime && ![pushTime isEqualToString:@""]) {
+//
+//                if (![[LXDataBaseManager shareDataBaseManager] returnPushTime:info[@"pushTime"] inTable:kNewsTable]) {
+//                    NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
+//                    if (userInfo[@"type"]) {
+//                        [temp setObject:userInfo[@"type"] forKey:@"type"];
+//                    }
+////                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
+//                }
+//            }
+//            else{
+//
+//                if([info[@"type"] isEqualToString:@"message"]) {
+//                    NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
+//                    if (userInfo[@"type"]) {
+//                        [temp setObject:userInfo[@"type"] forKey:@"type"];
+//                    }
+////                    [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
+//                }else {
+//                    if (![[LXDataBaseManager shareDataBaseManager] returnURL:info[@"url"] openid:info[@"openid"] inTable:kNewsTable]) {
+//                        NSMutableDictionary *temp = [NSMutableDictionary dictionaryWithDictionary:info];
+//                        if (userInfo[@"type"]) {
+//                            [temp setObject:userInfo[@"type"] forKey:@"type"];
+//                        }
+////                        [[LXDataBaseManager shareDataBaseManager] insertMessage:temp toTable:kNewsTable];
+//                    }
+//                }
+//
+//            }
             
             [[NSNotificationCenter defaultCenter] postNotificationName:kAfterReceiveNewMsg object:nil];
             
             
 //
-            if([info[@"type"] isEqualToString:@"message"]) {
+            if([userInfo[@"type"] isEqualToString:@"message"]) {
             
                 NSDictionary * infoDic = @{@"url":info[@"url"],
                                            @"rectype":@"D",
@@ -365,7 +400,22 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 
             }
             
-            
+            if([userInfo[@"type"] isEqualToString:@"bid"]) {
+                //收到订阅推送,展示红点
+                NSLog(@"收到订阅推送");
+                [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"1",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
+                [GlobalData shareInstance].subIsRed = YES;
+            }else {
+                NSLog(@"不是订阅推送");
+            }
+            if([userInfo[@"type"] isEqualToString:@"message"]||[userInfo[@"type"] isEqualToString:@"feedback"]||[userInfo[@"type"] isEqualToString:@"project"]||[userInfo[@"type"] isEqualToString:@"entname"]) {
+                NSLog(@"收到我的推送");
+                //收到我的推送,展示红点
+                [[NSNotificationCenter defaultCenter] postNotificationName:JYNewsRedPoint object:nil userInfo:@{@"type":@"2",@"typeMsg":userInfo[@"type"],@"url":info[@"url"]}];
+                [GlobalData shareInstance].mineIsRed = YES;
+            }else {
+                NSLog(@"不是我的推送");
+            }
             
         }
     }
@@ -389,7 +439,17 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
 //    NSDictionary *extras = [userInfo valueForKey:@"extras"];
 //    NSString *customizeField1 = [extras valueForKey:@"customizeField1"]; //服务端传递的Extras附加字段,key是自己定
     if ([LXUserDefaults token] && userInfo[@"content_type"] && [userInfo[@"content_type"] isEqualToString:@"signOut"]) {
-        [[NSNotificationCenter defaultCenter] postNotificationName:kLoginOut object:content];
+        
+        
+        AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+        JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+        NSLog(@"%lu",(unsigned long)tab.selectedIndex);
+        
+        //判断第几个底部栏
+        [[NSNotificationCenter defaultCenter] postNotificationName:kLoginOut object:content userInfo:@{@"item_index":[NSString stringWithFormat:@"%lu",(unsigned long)tab.selectedIndex]}];
+        
+        
+        //
     }
 }
 
@@ -399,6 +459,9 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url];
     if (!result) {
         // 其他如支付等SDK的回调
+        if ([url.scheme isEqualToString:@"wx0e6a5b18f4cfd10d"]) {
+            return  [WXApi handleOpenURL:url delegate:(id<WXApiDelegate>)self];
+        }
     }
     return result;
 }
@@ -409,6 +472,9 @@ didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
     BOOL result = [[UMSocialManager defaultManager] handleOpenURL:url sourceApplication:sourceApplication annotation:annotation];
     if (!result) {
         // 其他如支付等SDK的回调
+        if ([url.scheme isEqualToString:@"wx0e6a5b18f4cfd10d"]) {
+            return  [WXApi handleOpenURL:url delegate:(id<WXApiDelegate>)self];
+        }
     }
     return result;
 }

+ 22 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/icon-home@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/icon-home.imageset/icon-home@3x.png


+ 6 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/Contents.json

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

+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory.imageset/laboratory@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/laboratory1.imageset/laboratory1@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine.imageset/mine@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/mine1.imageset/mine1@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search.imageset/search@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/search1.imageset/search1@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe.imageset/subscribe@3x.png


+ 23 - 0
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/Contents.json

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

BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1@2x.png


BIN
ios/JianYuIOS/JianYuIOS/Assets.xcassets/tab/subscribe1.imageset/subscribe1@3x.png


+ 1 - 8
ios/JianYuIOS/JianYuIOS/Base.lproj/Main.storyboard

@@ -12,7 +12,7 @@
         <!--View Controller-->
         <scene sceneID="tne-QT-ifu">
             <objects>
-                <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
+                <viewController id="BYZ-38-t0r" sceneMemberID="viewController">
                     <layoutGuides>
                         <viewControllerLayoutGuide type="top" id="KRu-Xv-QLR"/>
                         <viewControllerLayoutGuide type="bottom" id="mUM-zT-OLx"/>
@@ -24,9 +24,6 @@
                             <webView contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="FYC-rR-cTH">
                                 <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                                 <color key="backgroundColor" red="0.36078431370000003" green="0.38823529410000002" blue="0.4039215686" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                                <connections>
-                                    <outlet property="delegate" destination="BYZ-38-t0r" id="KFh-B8-R7t"/>
-                                </connections>
                             </webView>
                         </subviews>
                         <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -37,10 +34,6 @@
                             <constraint firstItem="mUM-zT-OLx" firstAttribute="top" secondItem="FYC-rR-cTH" secondAttribute="bottom" id="zCw-HF-R5H"/>
                         </constraints>
                     </view>
-                    <connections>
-                        <outlet property="topC" destination="cVW-Na-SF6" id="iL3-Tw-knQ"/>
-                        <outlet property="webView" destination="FYC-rR-cTH" id="tcX-u7-hU5"/>
-                    </connections>
                 </viewController>
                 <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
             </objects>

+ 18 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/GlobalData.h

@@ -0,0 +1,18 @@
+//
+//  GlobalData.h
+//  JianYuIOS
+//
+//  Created by apple on 2019/1/14.
+//  Copyright © 2019年 lixianglan. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+@interface GlobalData : NSObject
+
++(GlobalData *)shareInstance;//单例
+
+@property (nonatomic,assign)BOOL subIsRed;
+@property (nonatomic,assign)BOOL mineIsRed;
+
+@end

+ 50 - 0
ios/JianYuIOS/JianYuIOS/BaseClass1/GlobalData.m

@@ -0,0 +1,50 @@
+//
+//  GlobalData.m
+//  JianYuIOS
+//
+//  Created by apple on 2019/1/14.
+//  Copyright © 2019年 lixianglan. All rights reserved.
+//
+
+#import "GlobalData.h"
+
+@implementation GlobalData
+
+
+
++ (GlobalData *)shareInstance
+{
+    static GlobalData *globalData = nil;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        globalData = [[super allocWithZone:NULL] init];
+    });
+    return globalData;
+}
+
+- (instancetype)init
+{
+    if (self = [super init])
+    {
+        [self setInitValues];
+    }
+    return self;
+    
+    
+    
+}
+
+-(void)setInitValues
+{
+    //初始化属性
+    [self initShuXing];
+}
+
+
+-(void)initShuXing
+{
+    self.subIsRed = NO;
+    self.mineIsRed = NO;
+}
+
+@end

+ 8 - 2
ios/JianYuIOS/JianYuIOS/BaseClass1/LXNetworkManager.m

@@ -32,7 +32,10 @@ progress:(void (^)(NSProgress * progress))upProgress
     manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", @"application/json",@"image/png",@"application/pdf",@"image/jpeg", @"application/octet-stream",@"text/json", nil];
     
     [manager POST:urlstr parameters:parameters progress:upProgress success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
-        success(responseObject);
+//        success(responseObject);
+        NSError *error=nil;
+        id Object=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:&error];
+        success(Object);
     } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
         LXLog(@"afn post request error:%@",error);
         failure(error);
@@ -50,7 +53,10 @@ progress:(void (^)(NSProgress * progress))upProgress
     manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"text/html", @"application/json", nil];
     [manager GET:urlstr parameters:parameters progress:upProgress success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
         //回传成功
-        success(responseObject);
+//        success(responseObject);
+        NSError *error=nil;
+        id Object=[NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:&error];
+        success(Object);
     } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
         //回传失败
         LXLog(@"afn get request error:%@", error);

+ 92 - 2
ios/JianYuIOS/JianYuIOS/BaseClass1/PrefixHeader.pch

@@ -14,26 +14,116 @@
 #import "LXDataBaseManager.h"
 #import "LXProgressView.h"
 #import "LXNetworkManager.h"
-
-
+#import "AppDelegate.h"
+#import "UITabBar+badge.h"
+
+#define LocalStr_None @""//空字符串
+#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+
+//色值转换
+#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
+// 判断是否是iPhone X
+#define iPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+// 状态栏高度
+#define STATUS_BAR_HEIGHT (iPhoneX ? 44.f : 20.f)
+// 导航栏高度
+#define NAVIGATION_BAR_HEIGHT (iPhoneX ? 88.f : 64.f)
+// tabBar高度
+#define TAB_BAR_HEIGHT (iPhoneX ? (49.f+34.f) : 49.f)
+// home indicator
+#define HOME_INDICATOR_HEIGHT (iPhoneX ? 34.f : 0.f)
+
+//屏幕宽
+#define WIDTH [UIScreen mainScreen].bounds.size.width
+//屏幕高
+#define HEIGHT [UIScreen mainScreen].bounds.size.height
+//屏幕高 frame
+#define HEIGHT_NEW [UIScreen mainScreen].bounds.size.height - NAVIGATION_BAR_HEIGHT
+
+
+
+#define  adjustsScrollViewInsets(scrollView)\
+do {\
+_Pragma("clang diagnostic push")\
+_Pragma("clang diagnostic ignored \"-Warc-performSelector-leaks\"")\
+if ([scrollView respondsToSelector:NSSelectorFromString(@"setContentInsetAdjustmentBehavior:")]) {\
+NSMethodSignature *signature = [UIScrollView instanceMethodSignatureForSelector:@selector(setContentInsetAdjustmentBehavior:)];\
+NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];\
+NSInteger argument = 2;\
+invocation.target = scrollView;\
+invocation.selector = @selector(setContentInsetAdjustmentBehavior:);\
+[invocation setArgument:&argument atIndex:2];\
+[invocation retainArguments];\
+[invocation invoke];\
+}\
+_Pragma("clang diagnostic pop")\
+} while (0)
+
+
+// 调试打印输出
+#ifdef DEBUG
+#define NSLog(format, ...) printf("[%s] %s [第%d行] %s\n", __TIME__, __FUNCTION__, __LINE__, [[NSString stringWithFormat:format, ## __VA_ARGS__] UTF8String]);
+#define FLog(...) NSLog(__VA_ARGS__);
+#else
+#define NSLog(format, ...)
+#define FLog(...)
+#endif
+#define FLogFunc FLog(@"%s",__func__)
+
+
+
+
+
+#import <JavaScriptCore/JavaScriptCore.h>
+#import <UShareUI/UShareUI.h>
+#import <UMSocialCore/UMSocialCore.h>
+#import "NewWebController.h"
+#import <UMSocialCore/UMSocialCore.h>
+#import <AFNetworking.h>
+#import "NoNetView.h"
+//#import <WebKit/WebKit.h>
+#import  <CommonCrypto/CommonCryptor.h>
 
 
 
 #define kRequestWebViewWithUrl @"kRequestWebViewWithUrl"
+
 #define kUpdateNotifyState @"kUpdateNotifyState"
 #define kAfterReceiveNewMsg @"kAfterReceiveNewMsg"
+#define JYNewsRedPoint @"JYNewsRedPoint"
 #define kReloadWebVIew @"kReloadWebVIew"
 #define kLoginOut @"kLoginOut"
 #define kNewsTable @"kNewsTable"
+//点击订阅通知
+#define ClickSubNotiMethods @"ClickSubNotiMethods"
 
+
+<<<<<<< HEAD
 #define kHost @"https://www.jianyu360.com/"
 
 //#define kHost @"http://weblxl.qmx.top/" //小璐
 //#define kHost @"http://webws.qmx.top/" //王山
 //#define kHost @"http://webwcj.qmx.top/"//王传近
 //#define kHost @"http://w2blmjy.qmx.top/"//测试环境
+=======
+
+//微信SDK头文件 支付
+#import "WXApi.h"
+#import "UIView+Extension.h"
+#import "GlobalData.h"
+//#define kHost @"https://www.jianyu360.com/"
+
+//#define kHost @"http://weblxl.qmx.top/" //小璐
+//#define kHost @"http://webws.qmx.top/" //王山
+#define kHost @"http://webwcj.qmx.top/"//王传近
+//#define kHost @"http://w2blmjy.qmx.top/"//测试环境
+//#define kHost @"http://w4blmjy.qmx.top/"//测试环境2
+>>>>>>> origin/developPay
 //#define kHost @"123.56.103.12/"
 
+//#define kHost @"https://app1.jianyu360.com/"
+
+
 
 #endif /* PrefixHeader_pch */
 

+ 15 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.h

@@ -0,0 +1,15 @@
+//
+//  JYExpViewController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYExpViewController : UIViewController
+
+-(void)dealTabBar;
+
+@end

+ 946 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYExpViewController.m

@@ -0,0 +1,946 @@
+//
+//  JYExpViewController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYExpViewController.h"
+#import "JYTabBarController.h"
+
+
+@protocol JYExpViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+//新增
+JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
+
+
+JSExportAs(checkLab, -(void)jsCheckLab:(NSString*)str);
+
+
+
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
+
+JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
+
+@end
+
+
+@interface JYExpViewController ()<UIWebViewDelegate, JYExpViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+    BOOL searchRefreshBool;
+}
+
+
+@property(nonatomic, strong)UIWebView *webView;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+@end
+
+NSString *const kInitVector_2 = @"1389461544135476";
+size_t const kKeySize_2 = kCCKeySizeAES128;
+NSString *const AesKey_2 = @"mGlAgnIBB8bx2nch";
+
+@implementation JYExpViewController
+
+-(void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:YES animated:animated];
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newsRedPoint:) name:JYNewsRedPoint object:nil];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    //手势
+    
+//    [self clearWeb];
+    
+    
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshAllVC:) name:@"refreshAllVC" object:nil];
+    
+}
+
+
+-(void)newsRedPoint:(NSNotification *)notificaition
+{
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
+    NSLog(@"%@",textJS);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:textJS];
+}
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    
+    if([current_url containsString:@"jyapp/free/login"]) {
+        return;
+    }
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/jylab/index"];
+//    NSString *token = [LXUserDefaults token];
+//    if (token) {
+//        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+//    }
+    
+    NSLog(@"333第一次加载%@",url);
+    
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    })
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+//    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        
+        if(self.tabBarController.selectedIndex != 2) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+    }
+    
+    
+}
+
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 2) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    if([notification.userInfo[@"item_index"] integerValue]!=2) {
+        return;
+    }
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+- (void)hideTabBar {
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == YES) {
+        return;
+    }
+    UIView *contentView;
+    if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    else
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == NO)
+    {
+        return;
+    }
+    UIView *contentView;
+    if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    
+    else
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = NO;
+        
+        });
+}
+
+
+-(void)dealTabBar
+{
+    NSLog(@"刷新第三个页面");
+    kMainQueue(^{
+        
+        [self webViewFirstRequest];
+    });
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    //http://w4blmjy.qmx.top/jyapp/free/login?back=index
+    NSLog(@"%@",current_url);
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]
+       ||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/login?back=index",kHost]]){
+        NSLog(@"展示");
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        NSLog(@"隐藏");
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+    
+    if(searchRefreshBool) {
+        searchRefreshBool = NO;
+    }else {
+        //正常的网页加载
+        [self judgeIsHidden];//是否隐藏
+    }
+
+    
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize_2 + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey_2 getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector_2 dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize_2,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    
+    NSLog(@"让我展示隐藏bottom==%@",hidden);
+    if([hidden integerValue]==0) {
+        
+        [self hideTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+        });
+        
+    }else {
+        [self showTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+        });
+    }
+}
+
+
+
+
+-(void)jsCheckLab:(NSString*)str
+{
+    [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshSS" object:nil userInfo:nil];
+}
+
+
+//首页登录通知刷新页面
+-(void)refreshAllVC:(NSNotification *)notificaition{
+    searchRefreshBool = YES;
+    [self webViewFirstRequest];
+}
+
+
+
+-(void)jsBackUrl:(NSString*)str
+{
+    NSLog(@"Mine返回首页%@",str);
+    if([str isEqualToString:@"H"]) {
+        //测试返回首页
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"0"}];
+            
+            [self dealTabBar];
+        });
+        
+    }
+    
+    
+}
+
+
+
+-(void)jsLoginSuccess:(NSString*)status
+{
+    NSLog(@"Mine登录成功提示");
+    if([status isEqualToString:@"S"]) {
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"5"}];
+        });
+    }else {
+        
+    }
+}
+
+
+/*
+ #pragma mark - Navigation
+ 
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+@end

+ 15 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.h

@@ -0,0 +1,15 @@
+//
+//  JYMineViewController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYMineViewController : UIViewController
+
+-(void)dealTabBar;
+
+@end

+ 1023 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYMineViewController.m

@@ -0,0 +1,1023 @@
+//
+//  JYMineViewController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYMineViewController.h"
+#import "JYTabBarController.h"
+
+@protocol JYMineViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+
+
+//新增
+JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
+
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
+
+JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
+
+
+
+//测试支付
+JSExportAs(payment, -(void)jsPayment:(NSString*)str);
+
+
+JSExportAs(hideRedSpotOnMenu, -(void)jsHideRedSpotOnMenu:(NSString*)str);
+
+@end
+
+
+@interface JYMineViewController ()<UIWebViewDelegate, JYMineViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+    BOOL searchRefreshBool;
+}
+
+
+@property(nonatomic, strong)UIWebView *webView;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+@end
+
+NSString *const kInitVector_3 = @"1389461544135476";
+size_t const kKeySize_3 = kCCKeySizeAES128;
+NSString *const AesKey_3 = @"mGlAgnIBB8bx2nch";
+
+@implementation JYMineViewController
+
+-(void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:YES animated:animated];
+    
+    if([GlobalData shareInstance].mineIsRed) {
+        [GlobalData shareInstance].mineIsRed = NO;
+        [self webViewFirstRequest];
+    }
+}
+
+-(void)viewDidAppear:(BOOL)animated
+{
+    [super viewDidAppear:animated];
+//    [self.webView reload];
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshMine:) name:@"refreshMine" object:nil];
+   
+    
+    
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newsRedPoint:) name:JYNewsRedPoint object:nil];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    //手势
+    
+//    [self clearWeb];
+    
+    
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshAllVC:) name:@"refreshAllVC" object:nil];
+    
+    
+}
+
+-(void)newsRedPoint:(NSNotification *)notificaition
+{
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
+    NSLog(@"%@",textJS);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:textJS];
+}
+
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    if([current_url containsString:@"jyapp/free/login"]) {
+        return;
+    }
+    
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/me"];
+//    NSString *token = [LXUserDefaults token];
+//    if (token) {
+//        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+//    }
+    NSLog(@"444第一次加载%@",url);
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+    
+    
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    })
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+//    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+//刷新我的
+-(void)refreshMine:(NSNotification *)notification{
+    [self webViewFirstRequest];
+}
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex != 3) {
+            return;
+        }else {
+            [self webViewFirstRequest];
+        }
+        
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+    }
+    
+    
+}
+
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 3) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    if([notification.userInfo[@"item_index"] integerValue]!=3) {
+        return;
+    }
+    
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+    //    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+- (void)hideTabBar {
+    
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == YES) {
+        return;
+    }
+    UIView *contentView;
+    if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    else
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == NO)
+    {
+        return;
+    }
+    UIView *contentView;
+    if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    
+    else
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = NO;
+        });
+}
+
+-(void)dealTabBar
+{
+    NSLog(@"刷新第四个页面");
+    kMainQueue(^{
+        [self webViewFirstRequest];
+    });
+    
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"%@",current_url);
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]){
+        NSLog(@"展示");
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        NSLog(@"隐藏");
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+
+    
+    if(searchRefreshBool) {
+        searchRefreshBool = NO;
+    }else {
+        //正常的网页加载
+        [self judgeIsHidden];//是否隐藏
+    }
+
+    
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    NSLog(@"Mine移除数据");
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+//    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
+//        //显示
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+//        });
+//    }else {
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+//        });
+//    }
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize_3 + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey_3 getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector_3 dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize_3,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+-(void)jsBackUrl:(NSString*)str
+{
+    NSLog(@"Mine返回首页%@",str);
+    if([str isEqualToString:@"H"]) {
+        //测试返回首页
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"0"}];
+            
+            [self dealTabBar];
+        });
+     
+    }
+ 
+    
+}
+
+
+
+-(void)jsLoginSuccess:(NSString*)status
+{
+    NSLog(@"Mine登录成功提示");
+    if([status isEqualToString:@"S"]) {
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"5"}];
+        });
+    }else {
+    
+    }
+}
+
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    
+    NSLog(@"让我展示隐藏bottom==%@",hidden);
+    if([hidden integerValue]==0) {
+        
+        [self hideTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+        });
+        
+    }else {
+        [self showTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+        });
+    }
+}
+
+
+
+
+
+//首页登录通知刷新页面
+-(void)refreshAllVC:(NSNotification *)notificaition{
+    searchRefreshBool = YES;
+    [self webViewFirstRequest];
+}
+
+
+-(void)jsPayment:(NSString*)str
+{
+    NSLog(@"支付");
+    return;
+    NSDictionary *data = @{ @"appId":@"wx0e6a5b18f4cfd10d",
+                            @"nonceStr":@"ZMZqGVibnrQSGlmq",
+                            @"partnerid":@"1513535801",
+                            @"paySign":@"046AFF278351BD5B685F153057B61CF9",
+                            @"prepay_id":@"wx241022000493643eb8db09901655699181",
+                            @"timeStamp":@"1543026120",
+                            };
+    
+    
+    /*
+     {
+     appId = wx0666de5698bc8d59;
+     nonceStr = ZMZqGVibnrQSGlmq;
+     "order_no" = AB24261197794989;
+     partnerid = 1513535801;
+     paySign = 046AFF278351BD5B685F153057B61CF9;
+     "prepay_id" = wx241022000493643eb8db09901655699181;
+     timeStamp = 1543026120;
+     }
+     */
+    
+    //吊起微信
+    PayReq *request = [[PayReq alloc] init] ;
+    request.package = @"Sign=WXPay";
+    request.nonceStr= data[@"nonceStr"];
+    request.partnerId = data[@"partnerid"];
+    request.sign= data[@"paySign"];
+    request.timeStamp= [data[@"timeStamp"] intValue];
+    request.openID = data[@"appId"];
+    request.prepayId= data[@"prepay_id"];
+    [WXApi sendReq:request];
+}
+
+
+
+-(void)jsHideRedSpotOnMenu:(NSString*)str
+{
+    NSLog(@"wd:%@",str);
+    kMainQueue(^{
+        [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+    });
+}
+
+/*
+ #pragma mark - Navigation
+ 
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+@end

+ 16 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.h

@@ -0,0 +1,16 @@
+//
+//  JYSearchViewController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYSearchViewController : UIViewController
+
+
+-(void)dealTabBar;
+
+@end

+ 1213 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSearchViewController.m

@@ -0,0 +1,1213 @@
+//
+//  JYSearchViewController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYSearchViewController.h"
+#import "JYTabBarController.h"
+
+@protocol JYSearchViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+
+
+
+//新增
+JSExportAs(hiddenBottom, -(void)jsHiddenBottom:(NSString*)hidden);
+
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
+
+JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
+
+
+JSExportAs(redirectKeyset, -(void)jsRedirectKeyset:(NSString*)str);
+
+
+
+
+@end
+
+
+@interface JYSearchViewController ()<UIWebViewDelegate, JYSearchViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+    NSInteger pushIndex;
+    
+    NSInteger _timeTick;
+    NSInteger _time;
+    
+    BOOL autologin;
+    BOOL notiFinish;
+    
+    BOOL expRefreshBool; //实验室 是否刷新
+}
+
+
+@property(nonatomic, strong)UIWebView *webView;
+
+//@property (weak, nonatomic) IBOutlet UIWebView *webView;
+
+
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+
+@property (nonatomic, strong)NSMutableDictionary *notiDict;
+@property (nonatomic,weak)NSTimer *timer;
+
+@end
+
+NSString *const kInitVector_0 = @"1389461544135476";
+size_t const kKeySize_0 = kCCKeySizeAES128;
+NSString *const AesKey_0 = @"mGlAgnIBB8bx2nch";
+
+@implementation JYSearchViewController
+
+-(void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:YES animated:animated];
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+
+    
+    //前往登录通知-tabbar
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(isLoginTabBar:) name:@"isLoginTabBar" object:nil];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    //手势
+    
+//    [self clearWeb];
+    
+    
+    
+    
+    //新增监听
+    self.notiDict = [[NSMutableDictionary alloc]initWithDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"NotiDict"]];
+    if(self.notiDict.count) {
+        self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];
+    }
+    
+    
+    //新增刷新通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshSS:) name:@"refreshSS" object:nil];
+    
+    //展示底部红的通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newsRedPoint:) name:JYNewsRedPoint object:nil];
+    
+    
+    //是否需要显示小红点
+    [self haveRedPoint];
+    
+}
+-(void)newsRedPoint:(NSNotification *)notificaition
+{
+    NSDictionary *dict = notificaition.userInfo;
+    NSLog(@"%@",dict);
+    NSInteger type = [dict[@"type"] integerValue];
+    if(type==1) {
+        //显示
+        kMainQueue(^{
+            [self.tabBarController.tabBar showBadgeOnItemIndex:1];
+        });
+    }else if (type==2) {
+        //显示
+        kMainQueue(^{
+            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+        });
+    }else {
+        
+    }
+    
+    
+    
+    
+    
+    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
+    NSLog(@"%@",textJS);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:textJS];
+}
+
+-(void)haveRedPoint
+{
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/showRedSpotOnMenu",kHost] parameters:@{@"token":token} progress:^(NSProgress *progress) {
+            NSLog(@"%@",progress);
+        } success:^(id responseObject) {
+            NSLog(@"responseObject=%@",responseObject);
+            
+            if([responseObject[@"subscribe"] integerValue]>=1) {
+                //显示
+                [GlobalData shareInstance].subIsRed = YES;
+                kMainQueue(^{
+                    [self.tabBarController.tabBar showBadgeOnItemIndex:1];
+                });
+            }else {
+                [GlobalData shareInstance].subIsRed = NO;
+                kMainQueue(^{
+                    [self.tabBarController.tabBar hideBadgeOnItemIndex:1];
+                });
+            }
+            
+            if([responseObject[@"my"] integerValue]>=1) {
+                //显示
+                [GlobalData shareInstance].mineIsRed = YES;
+                kMainQueue(^{
+                    [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+                });
+            }else {
+                [GlobalData shareInstance].mineIsRed = NO;
+                kMainQueue(^{
+                    [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+                });
+            }
+            
+        } failure:^(NSError *error) {
+            NSLog(@"error=%@",error);
+        }];
+    }
+}
+
+
+//2.5.1
+-(void)timeFireMethod{
+    _timeTick++;
+    NSLog(@"定时器");
+    if(self.webView&&notiFinish) {
+        NSString * urlStr = [NSString stringWithFormat:@"%@",self.notiDict[@"info"][@"url"]];
+        
+        if (urlStr) {
+            if([self.notiDict[@"type"] isEqualToString:@"bid"]) {
+                AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+                JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+                tab.selectedIndex = 1;
+            }else {
+                [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+                self.afterOpenPushMessage = YES;
+                [self performSelector:@selector(requestWebTime:) withObject:self.notiDict afterDelay:1];
+            }
+            
+            
+            [self.timer invalidate];
+            self.timer = nil;
+            _timeTick = 0;
+            [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
+            
+        }
+        return;
+    }
+    
+    if (_timeTick == 60) {
+        [self.timer invalidate];
+        self.timer = nil;
+        _timeTick = 0;
+        [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"NotiDict"];
+    }
+}
+
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    
+    
+    if([current_url containsString:@"jyapp/free/login"]) {
+        return;
+    }
+    
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+    }
+    NSLog(@"111第一次加载%@",url);
+    
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+    
+    //[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReloadRevalidatingCacheData timeoutInterval:20]];
+    
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    })
+    
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+//    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t"];
+    
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        //当前控制器
+        if(self.tabBarController.selectedIndex != 0) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
+        
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+    }
+    
+    
+}
+
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 0) {
+            //底部栏置换到订阅
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 1;
+        }
+    }
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    if([notification.userInfo[@"item_index"] integerValue]!=0) {
+        return;
+    }
+    
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+//前往登录页面
+-(void)isLoginTabBar:(NSNotification *)notification
+{
+    NSDictionary *dict = notification.userInfo;
+    //
+    NSLog(@"我从第几个页面过来:%@",dict[@"item_index"]);
+    pushIndex = [dict[@"item_index"] integerValue];
+
+    
+    
+    
+    
+    //
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+    
+    
+    
+//    NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+//    [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":index}];
+    
+}
+
+//js返回首页
+-(void)jsBackUrl:(NSString*)str
+{
+    NSLog(@"search返回首页,search返回首页,search返回首页,search返回首页,search返回首页,search返回首页");
+    if([str isEqualToString:@"H"]) {
+        pushIndex = 0;
+        [self webViewFirstRequest];
+    }
+    
+    
+}
+
+//js方法登录成功
+-(void)jsLoginSuccess:(NSString*)status
+{
+    NSLog(@"Search登录成功提示;;;%@当前下标:%ld",status,(long)pushIndex);
+    
+    //显示
+    kMainQueue(^{
+        [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+    });
+    
+
+
+    
+    
+    if([status isEqualToString:@"S"]) {
+        if(pushIndex!=0) {
+            NSLog(@"SSSSSS");
+            
+            kMainQueue((^{
+                NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+                [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":index}];
+                AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+                JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+                tab.selectedIndex = pushIndex;
+                pushIndex = 0;
+            }));
+        }else {
+            [self webViewFirstRequest];
+        }
+        
+    }else if ([status isEqualToString:@""]) {
+        //手动tabbar点击
+    NSLog(@"statusstatusstatusstatusstatusstatusstatusstatusstatusstatus=======%@",status);
+//        NSString *index = [NSString stringWithFormat:@"%ld",pushIndex];
+//        [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":index}];
+//        pushIndex = 0;
+        
+        //刷新 订阅 和 我的
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshAllVC" object:nil userInfo:nil];
+        
+        
+        
+        
+        //首页跳转登录刷新 我们+订阅
+        
+    }else {
+        
+    }
+}
+
+-(void)dealTabBar
+{
+    NSLog(@"刷新第一个页面");
+    kMainQueue(^{
+//        [self showTabBar];
+//        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+        [self webViewFirstRequest];
+    });
+
+    
+    
+}
+
+
+- (void)hideTabBar {
+    NSLog(@"隐藏tabbar");
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == YES) {
+        return;
+    }
+    UIView *contentView;
+    if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    else
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == NO)
+    {
+        return;
+    }
+    UIView *contentView;
+    if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    
+    else
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = NO;
+    });
+}
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    
+    NSLog(@"让我展示隐藏bottom==%@",hidden);
+    if([hidden integerValue]==0) {
+        
+        [self hideTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+        });
+        
+    }else {
+        [self showTabBar];
+        kMainQueue(^{
+            self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+        });
+    }
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    
+    //[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/index",kHost]]
+    NSLog(@"%@",current_url);
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        NSLog(@"展示");
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        NSLog(@"隐藏");
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+    if(!notiFinish) {
+        notiFinish = YES;
+    }
+    
+    if(expRefreshBool) {
+        expRefreshBool = NO;
+    }else {
+        //正常的网页加载
+        [self judgeIsHidden];//是否隐藏
+    }
+   
+    
+    
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+    
+    
+    
+    
+    
+    //加载第一次成功的时候 调JS
+//    if(!autologin&&[LXUserDefaults token]) {
+//        autologin = YES;
+//        NSString *textJS =  [NSString stringWithFormat:@"refAutoLogin('%@')",@"S"];
+//        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+//        [context evaluateScript:textJS];
+//    }
+    
+    if(!autologin) {
+        //第一次加载页面成功
+        if([LXUserDefaults token]) {
+            //如果登录
+            NSString *textJS =  [NSString stringWithFormat:@"refAutoLogin('%@')",@"S"];
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            [context evaluateScript:textJS];
+        }
+        autologin = YES;
+    }
+    
+    
+//    CGSize actualSize =[webView sizeThatFits:CGSizeZero];
+//
+//    CGRect newFrame = webView.frame;
+//
+//    newFrame.size.height = actualSize.height;
+//
+//    webView.frame = newFrame;
+    
+    
+    
+    
+    
+}
+
+//15737190152
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+    
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+
+
+
+
+
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    NSLog(@"登陆成功");
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    NSLog(@"取用户token");
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    NSLog(@"清除用户token");
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+//    if([[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid] ==0){
+//        //显示
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar hideBadgeOnItemIndex:3];
+//        });
+//    }else {
+//        kMainQueue(^{
+//            [self.tabBarController.tabBar showBadgeOnItemIndex:3];
+//        });
+//    }
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize_0 + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey_0 getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector_0 dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize_0,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+-(void)jsRedirectKeyset:(NSString*)str
+{
+
+    
+    [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshDY" object:nil userInfo:nil];
+    
+    [self performSelector:@selector(nextVC) withObject:nil afterDelay:0.5];
+}
+
+
+-(void)nextVC
+{
+    AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+    JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+    tab.selectedIndex = 1;
+    
+    [self webViewFirstRequest];
+}
+
+
+//通知刷新页面
+-(void)refreshSS:(NSNotification *)notificaition{
+    
+    expRefreshBool = YES;
+    [self webViewFirstRequest];
+}
+
+
+
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 15 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.h

@@ -0,0 +1,15 @@
+//
+//  JYSubViewController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYSubViewController : UIViewController
+
+-(void)dealTabBar;
+
+@end

+ 938 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/JYSubViewController.m

@@ -0,0 +1,938 @@
+//
+//  JYSubViewController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYSubViewController.h"
+#import "JYTabBarController.h"
+
+@protocol JYSubViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+JSExportAs(loginSuccess, -(void)jsLoginSuccess:(NSString*)status);
+
+JSExportAs(backUrl, -(void)jsBackUrl:(NSString*)str);
+
+JSExportAs(hideRedSpotOnMenu, -(void)jsHideRedSpotOnMenu:(NSString*)str);
+
+
+
+@end
+
+
+@interface JYSubViewController ()<UIWebViewDelegate, JYSubViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+    BOOL searchRefreshBool;
+}
+
+
+@property(nonatomic, strong)UIWebView *webView;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+@end
+
+NSString *const kInitVector_1 = @"1389461544135476";
+size_t const kKeySize_1 = kCCKeySizeAES128;
+NSString *const AesKey_1 = @"mGlAgnIBB8bx2nch";
+
+@implementation JYSubViewController
+
+-(void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    [self.navigationController setNavigationBarHidden:YES animated:animated];
+    if([GlobalData shareInstance].subIsRed) {
+        [GlobalData shareInstance].subIsRed = NO;
+        [self webViewFirstRequest];
+    }
+}
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    self.view.backgroundColor = [UIColor whiteColor];
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    
+    //点击订阅通知
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(clickSubNotiMethods:) name:ClickSubNotiMethods object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(newsRedPoint:) name:JYNewsRedPoint object:nil];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    //手势
+    
+    [self clearWeb];
+    
+    
+
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshDY:) name:@"refreshDY" object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshAllVC:) name:@"refreshAllVC" object:nil];
+    
+}
+
+-(void)newsRedPoint:(NSNotification *)notificaition
+{
+    NSDictionary *dict = notificaition.userInfo;
+    NSString *textJS =  [NSString stringWithFormat:@"afterReceivePushMessage('%@','%@')",dict[@"typeMsg"],dict[@"url"]];
+    NSLog(@"%@",textJS);
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:textJS];
+}
+
+
+
+
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    
+    if([current_url containsString:@"jyapp/free/login"]) {
+        return;
+    }
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/swordfish/historypush"];
+//swordfish/historypush   swordfish/historypush
+    NSLog(@"222第一次加载%@",url);
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    kMainQueue(^{
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    })
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+//    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/login?back=index&isios=t"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        
+        if(self.tabBarController.selectedIndex != 1) {
+            return;
+        }else {
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"refreshMine" object:nil];;
+        }
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+    }
+    
+    
+}
+
+
+-(void)clickSubNotiMethods:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object][@"info"];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    if (urlStr) {
+        if(self.tabBarController.selectedIndex == 1) {
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    if([notification.userInfo[@"item_index"] integerValue]!=1) {
+        return;
+    }
+    
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    
+    
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+- (void)hideTabBar {
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == YES) {
+        return;
+    }
+    UIView *contentView;
+    if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    else
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = YES;
+        
+        });
+    
+}
+- (void)showTabBar{
+    kMainQueue(^{
+    if (self.tabBarController.tabBar.hidden == NO)
+    {
+        return;
+    }
+    UIView *contentView;
+    if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+    
+    else
+        
+        contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+    contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+    self.tabBarController.tabBar.hidden = NO;
+        
+        });
+}
+
+//
+
+-(void)dealTabBar
+{
+    NSLog(@"刷新第二个页面");
+    kMainQueue(^{
+        [self webViewFirstRequest];
+    });
+}
+
+-(void)judgeIsHidden
+{   
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    //http://w4blmjy.qmx.top/jyapp/free/login?back=index
+    NSLog(@"%@",current_url);
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/swordfish/historypush",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/login?back=index",kHost]]){
+        NSLog(@"展示");
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        NSLog(@"隐藏");
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+
+    
+    if(searchRefreshBool) {
+        searchRefreshBool = NO;
+    }else {
+        //正常的网页加载
+        [self judgeIsHidden];//是否隐藏
+    }
+
+    
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize_1 + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey_1 getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector_1 dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize_1,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+
+//通知刷新页面
+-(void)refreshDY:(NSNotification *)notificaition{
+    [self webViewFirstRequest];
+}
+
+//首页登录通知刷新页面
+-(void)refreshAllVC:(NSNotification *)notificaition{
+    searchRefreshBool = YES;
+    [self webViewFirstRequest];
+}
+
+
+
+-(void)jsBackUrl:(NSString*)str
+{
+    NSLog(@"Mine返回首页%@",str);
+    if([str isEqualToString:@"H"]) {
+        //测试返回首页
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"0"}];
+            
+            [self dealTabBar];
+        });
+        
+    }
+    
+    
+}
+
+
+
+-(void)jsLoginSuccess:(NSString*)status
+{
+    NSLog(@"Mine登录成功提示");
+    if([status isEqualToString:@"S"]) {
+        kMainQueue(^{
+            AppDelegate *delegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
+            JYTabBarController *tab = (JYTabBarController *)delegate.window.rootViewController;
+            tab.selectedIndex = 0;
+            
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeItems" object:nil userInfo:@{@"item_index":@"5"}];
+        });
+    }else {
+        
+    }
+}
+
+
+
+-(void)jsHideRedSpotOnMenu:(NSString*)str
+{
+    NSLog(@"dy:%@",str);
+    kMainQueue(^{
+        [self.tabBarController.tabBar hideBadgeOnItemIndex:1];
+    });
+}
+
+/*
+ #pragma mark - Navigation
+ 
+ // In a storyboard-based application, you will often want to do a little preparation before navigation
+ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+ // Get the new view controller using [segue destinationViewController].
+ // Pass the selected object to the new view controller.
+ }
+ */
+
+@end

+ 94 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/UIView+Extension.h

@@ -0,0 +1,94 @@
+//
+//  UIView+Extension.h
+//  JianYuIOS
+//
+//  Created by apple on 2019/1/14.
+//  Copyright © 2019年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (Extension)
+
+@end
+
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIView (Extension)
+@property (nonatomic, assign) CGFloat x;
+@property (nonatomic, assign) CGFloat y;
+@property (nonatomic, assign) CGFloat centerX;
+@property (nonatomic, assign) CGFloat centerY;
+@property (nonatomic, assign) CGFloat width;
+@property (nonatomic, assign) CGFloat height;
+@property (nonatomic, assign) CGSize size;
+
+
+
+/**
+ * Shortcut for frame.origin.x.
+ *
+ * Sets frame.origin.x = left
+ */
+@property (nonatomic) CGFloat left;
+
+/**
+ * Shortcut for frame.origin.y
+ *
+ * Sets frame.origin.y = top
+ */
+@property (nonatomic) CGFloat top;
+
+/**
+ * Shortcut for frame.origin.x + frame.size.width
+ *
+ * Sets frame.origin.x = right - frame.size.width
+ */
+@property (nonatomic) CGFloat right;
+
+/**
+ * Shortcut for frame.origin.y + frame.size.height
+ *
+ * Sets frame.origin.y = bottom - frame.size.height
+ */
+@property (nonatomic) CGFloat bottom;
+
+
+
+/**
+ * Return the x coordinate on the screen.
+ */
+@property (nonatomic, readonly) CGFloat ttScreenX;
+
+/**
+ * Return the y coordinate on the screen.
+ */
+@property (nonatomic, readonly) CGFloat ttScreenY;
+
+/**
+ * Return the x coordinate on the screen, taking into account scroll views.
+ */
+@property (nonatomic, readonly) CGFloat screenViewX;
+
+/**
+ * Return the y coordinate on the screen, taking into account scroll views.
+ */
+@property (nonatomic, readonly) CGFloat screenViewY;
+
+/**
+ * Return the view frame on the screen, taking into account scroll views.
+ */
+@property (nonatomic, readonly) CGRect screenFrame;
+
+/**
+ * Shortcut for frame.origin
+ */
+@property (nonatomic) CGPoint origin;
+
+
+@property (nonatomic,readonly) NSArray * allSubviews;
+
+@end
+

+ 212 - 0
ios/JianYuIOS/JianYuIOS/Classes(模块)/UIView+Extension.m

@@ -0,0 +1,212 @@
+
+
+#import "UIView+Extension.h"
+
+@implementation UIView (Extension)
+
+- (void)setX:(CGFloat)x
+{
+    CGRect frame = self.frame;
+    frame.origin.x = x;
+    self.frame = frame;
+}
+
+- (CGFloat)x
+{
+    return self.frame.origin.x;
+}
+
+- (void)setY:(CGFloat)y
+{
+    CGRect frame = self.frame;
+    frame.origin.y = y;
+    self.frame = frame;
+}
+
+- (CGFloat)y
+{
+    return self.frame.origin.y;
+}
+
+- (void)setCenterX:(CGFloat)centerX
+{
+    CGPoint center = self.center;
+    center.x = centerX;
+    self.center = center;
+}
+
+- (CGFloat)centerX
+{
+    return self.center.x;
+}
+
+- (void)setCenterY:(CGFloat)centerY
+{
+    CGPoint center = self.center;
+    center.y = centerY;
+    self.center = center;
+}
+
+- (CGFloat)centerY
+{
+    return self.center.y;
+}
+
+- (void)setWidth:(CGFloat)width
+{
+    CGRect frame = self.frame;
+    frame.size.width = width;
+    self.frame = frame;
+}
+
+- (CGFloat)width
+{
+    return self.frame.size.width;
+}
+
+- (void)setHeight:(CGFloat)height
+{
+    CGRect frame = self.frame;
+    frame.size.height = height;
+    self.frame = frame;
+}
+
+- (CGFloat)height
+{
+    return self.frame.size.height;
+}
+
+- (void)setSize:(CGSize)size
+{
+    //    self.width = size.width;
+    //    self.height = size.height;
+    CGRect frame = self.frame;
+    frame.size = size;
+    self.frame = frame;
+}
+
+- (CGSize)size
+{
+    return self.frame.size;
+}
+
+
+
+
+- (CGFloat)left {
+    return self.frame.origin.x;
+}
+- (void)setLeft:(CGFloat)x {
+    CGRect frame = self.frame;
+    frame.origin.x = x;
+    self.frame = frame;
+}
+- (CGFloat)top {
+    return self.frame.origin.y;
+}
+- (void)setTop:(CGFloat)y {
+    CGRect frame = self.frame;
+    frame.origin.y = y;
+    self.frame = frame;
+}
+- (CGFloat)right {
+    return self.frame.origin.x + self.frame.size.width;
+}
+- (void)setRight:(CGFloat)right {
+    CGRect frame = self.frame;
+    frame.origin.x = right - frame.size.width;
+    self.frame = frame;
+}
+- (CGFloat)bottom {
+    return self.frame.origin.y + self.frame.size.height;
+}
+- (void)setBottom:(CGFloat)bottom {
+    CGRect frame = self.frame;
+    frame.origin.y = bottom - frame.size.height;
+    self.frame = frame;
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGFloat)ttScreenX {
+    CGFloat x = 0;
+    for (UIView* view = self; view; view = view.superview) {
+        x += view.left;
+    }
+    return x;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGFloat)ttScreenY {
+    CGFloat y = 0;
+    for (UIView* view = self; view; view = view.superview) {
+        y += view.top;
+    }
+    return y;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGFloat)screenViewX {
+    CGFloat x = 0;
+    for (UIView* view = self; view; view = view.superview) {
+        x += view.left;
+        
+        if ([view isKindOfClass:[UIScrollView class]]) {
+            UIScrollView* scrollView = (UIScrollView*)view;
+            x -= scrollView.contentOffset.x;
+        }
+    }
+    
+    return x;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGFloat)screenViewY {
+    CGFloat y = 0;
+    for (UIView* view = self; view; view = view.superview) {
+        y += view.top;
+        
+        if ([view isKindOfClass:[UIScrollView class]]) {
+            UIScrollView* scrollView = (UIScrollView*)view;
+            y -= scrollView.contentOffset.y;
+        }
+    }
+    return y;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGRect)screenFrame {
+    return CGRectMake(self.screenViewX, self.screenViewY, self.width, self.height);
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (CGPoint)origin {
+    return self.frame.origin;
+}
+
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+- (void)setOrigin:(CGPoint)origin {
+    CGRect frame = self.frame;
+    frame.origin = origin;
+    self.frame = frame;
+}
+
+
+
+-(NSArray*)allSubviews {
+    NSMutableArray *arr = [NSMutableArray array];
+    [arr addObject:self];
+    for (UIView * subview in self.subviews) {
+        [arr addObjectsFromArray:(NSArray*)[subview allSubviews]];
+    }
+    return arr;
+}
+
+
+
+@end
+

+ 23 - 6
ios/JianYuIOS/JianYuIOS/Info.plist

@@ -17,7 +17,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.0.8</string>
+	<string>2.5.1</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -56,7 +56,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>12</string>
+	<string>15</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>wtloginmqq2</string>
@@ -79,10 +79,20 @@
 		<true/>
 		<key>NSExceptionDomains</key>
 		<dict>
-			<key>NSExceptionAllowsInsecureHTTPLoads</key>
-			<true/>
-			<key>NSIncludesSubdomains</key>
-			<true/>
+			<key>app1.jianyu360.com</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
+			<key>jianyu360.mikecrm.com</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
 			<key>w2blmjy.qmx.top</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>
@@ -90,6 +100,13 @@
 				<key>NSIncludesSubdomains</key>
 				<true/>
 			</dict>
+			<key>webwcj.qmx.top</key>
+			<dict>
+				<key>NSExceptionAllowsInsecureHTTPLoads</key>
+				<true/>
+				<key>NSIncludesSubdomains</key>
+				<true/>
+			</dict>
 			<key>webws.qmx.top</key>
 			<dict>
 				<key>NSExceptionAllowsInsecureHTTPLoads</key>

+ 13 - 0
ios/JianYuIOS/JianYuIOS/JYNavigationController.h

@@ -0,0 +1,13 @@
+//
+//  JYNavigationController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYNavigationController : UINavigationController
+
+@end

+ 87 - 0
ios/JianYuIOS/JianYuIOS/JYNavigationController.m

@@ -0,0 +1,87 @@
+//
+//  JYNavigationController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYNavigationController.h"
+
+#import "JYTabBarController.h"
+
+
+
+@interface JYNavigationController ()
+
+@end
+
+@implementation JYNavigationController
+
++(void)load
+{
+    UINavigationBar *navBar=[UINavigationBar appearance];
+    [navBar setBarTintColor:[UIColor whiteColor]];
+    navBar.translucent=NO;
+    NSMutableDictionary *attrs=[NSMutableDictionary dictionary];
+    attrs[NSForegroundColorAttributeName]=UIColorFromRGB(0x171717);
+    attrs[NSFontAttributeName]=[UIFont systemFontOfSize:21];
+    [navBar setTitleTextAttributes:attrs];
+}
+
+
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+#pragma mark - navi delegate
+- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
+    if(self.viewControllers.count>1) {
+        self.interactivePopGestureRecognizer.enabled = YES;
+    }else {
+        self.interactivePopGestureRecognizer.enabled = NO;
+    }
+}
+
+- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated
+{
+    if (self.viewControllers.count > 0) {
+        viewController.hidesBottomBarWhenPushed = YES;
+        viewController.navigationItem.leftBarButtonItem = [self createBackButton];
+    }
+    return [super pushViewController:viewController animated:animated];
+}
+
+#pragma mark - 自定义导航栏返回按钮
+-(void)popself
+{
+    [self popViewControllerAnimated:YES];
+}
+
+- (UIBarButtonItem *) createBackButton
+{
+    UIImage *image = [UIImage imageNamed:@""];
+    UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    backBtn.frame = CGRectMake(0.0, 0.0, 50, 44.0);
+    [backBtn setImageEdgeInsets:UIEdgeInsetsMake(0, -20, 0, 0)];
+    [backBtn setImage:image forState:UIControlStateNormal];
+    [backBtn addTarget:self action:@selector(popself) forControlEvents:UIControlEventTouchUpInside];
+    UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithCustomView:backBtn];
+    
+    return backItem;
+    
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 13 - 0
ios/JianYuIOS/JianYuIOS/JYTabBarController.h

@@ -0,0 +1,13 @@
+//
+//  JYTabBarController.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface JYTabBarController : UITabBarController
+
+@end

+ 221 - 0
ios/JianYuIOS/JianYuIOS/JYTabBarController.m

@@ -0,0 +1,221 @@
+//
+//  JYTabBarController.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/8.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "JYTabBarController.h"
+#import "JYNavigationController.h"
+#import "JYSearchViewController.h"
+#import "JYSubViewController.h"
+#import "JYExpViewController.h"
+#import "JYMineViewController.h"
+
+
+@interface JYTabBarController ()<UITabBarControllerDelegate>
+
+@property (nonatomic,strong)JYSearchViewController *V1;
+@property (nonatomic,strong)JYSubViewController *V2;
+@property (nonatomic,strong)JYExpViewController *V3;
+@property (nonatomic,strong)JYMineViewController *V4;
+
+
+@end
+
+
+
+
+
+@implementation JYTabBarController
+
+
++(void)initialize
+{
+    
+    if (@available(iOS 9.0, *)) {
+        UITabBarItem *tabBarItem = [UITabBarItem appearanceWhenContainedInInstancesOfClasses:@[self]];
+        
+        NSMutableDictionary *dictNormal = [NSMutableDictionary dictionary];
+        dictNormal[NSForegroundColorAttributeName] = UIColorFromRGB(0x888888);
+        dictNormal[NSFontAttributeName] = [UIFont systemFontOfSize:10];
+        
+        NSMutableDictionary *dictSelected = [NSMutableDictionary dictionary];
+        dictSelected[NSForegroundColorAttributeName] = UIColorFromRGB(0x2cb7ca);
+        dictSelected[NSFontAttributeName] = [UIFont systemFontOfSize:10];
+        
+        [tabBarItem setTitleTextAttributes:dictNormal forState:UIControlStateNormal];
+        [tabBarItem setTitleTextAttributes:dictSelected forState:UIControlStateSelected];
+    } else {
+        // Fallback on earlier versions
+    }
+    
+    
+}
+
+
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    self.delegate = self;
+//    self.tabBarController.tabBar.delegate = self;
+    [self setUpAllChildVc];
+    [self setSelectedIndex:0];
+    
+    [self switchRootViewController];
+}
+
+
+//判断是否跳转
+- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
+    NSLog(@"点击了第几个item:%ld",tabBarController.tabBar.selectedItem.tag);
+//    if(tabBarController.tabBar.selectedItem.tag==0) {
+//        return NO;
+//    }
+    if (![LXUserDefaults token]) {
+        
+        if(tabBarController.tabBar.selectedItem.tag!=0) {
+            NSLog(@"没有token前往登录");
+            NSString *index = [NSString stringWithFormat:@"%ld",tabBarController.tabBar.selectedItem.tag];
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"isLoginTabBar" object:nil userInfo:@{@"item_index":index}];
+            return NO;
+        }else {
+            NSLog(@"没有token,当前在搜索页面");
+        }
+    }
+    return YES;
+    
+}
+
+- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
+//    NSLog(@"点击了第几个item:%ld",item.tag);
+}
+
+#pragma mark - -----------------------------------------
+- (void)setUpAllChildVc
+{
+    self.V1 = [[JYSearchViewController alloc] init];
+    [self setUpOneChildVcWithVc:self.V1 Image:@"search" selectedImage:@"search1" title:@"搜索" tag:0];
+
+    self.V2 = [[JYSubViewController alloc] init];
+    [self setUpOneChildVcWithVc:self.V2 Image:@"subscribe" selectedImage:@"subscribe1" title:@"订阅" tag:1];
+
+    self.V3 = [[JYExpViewController alloc] init];
+    [self setUpOneChildVcWithVc:self.V3 Image:@"laboratory" selectedImage:@"laboratory1" title:@"实验室" tag:2];
+
+
+    self.V4 = [[JYMineViewController alloc] init];
+    [self setUpOneChildVcWithVc:self.V4 Image:@"mine" selectedImage:@"mine1" title:@"我的" tag:3];
+    
+    
+//    self.VV1 = [[ViewController1 alloc] init];
+//    [self setUpOneChildVcWithVc:self.VV1 Image:@"icon-home" selectedImage:@"icon-home2" title:@"搜索" tag:0];
+//
+//    self.VV2 = [[ViewController2 alloc] init];
+//    [self setUpOneChildVcWithVc:self.VV2 Image:@"icon-home" selectedImage:@"icon-home2" title:@"订阅" tag:1];
+//
+//    self.VV3 = [[ViewController3 alloc] init];
+//    [self setUpOneChildVcWithVc:self.VV3 Image:@"icon-home" selectedImage:@"icon-home2" title:@"实验室" tag:2];
+    
+//    self.VV4 = [[ViewController4 alloc] init];
+//    [self setUpOneChildVcWithVc:self.VV4 Image:@"icon-home" selectedImage:@"icon-home2" title:@"我的" tag:3];
+    
+
+}
+
+#pragma mark - 初始化设置tabBar上面单个按钮的方法
+
+/**
+ *
+ *  设置单个tabBarButton
+ *
+ *  @param VC            每一个按钮对应的控制器
+ *  @param image         每一个按钮对应的普通状态下图片
+ *  @param selectedImage 每一个按钮对应的选中状态下的图片
+ *  @param title         每一个按钮对应的标题
+ */
+- (void)setUpOneChildVcWithVc:(UIViewController *)VC Image:(NSString *)image selectedImage:(NSString *)selectedImage title:(NSString *)title tag:(NSInteger)current_tag
+{
+    JYNavigationController *nav = [[JYNavigationController alloc] initWithRootViewController:VC];
+    UIImage *myImage = [UIImage imageNamed:image];
+    myImage = [myImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    
+    //tabBarItem,是系统提供模型,专门负责tabbar上按钮的文字以及图片展示
+    VC.tabBarItem.image = myImage;
+    UIImage *mySelectedImage = [UIImage imageNamed:selectedImage];
+    mySelectedImage = [mySelectedImage imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
+    VC.tabBarItem.selectedImage = mySelectedImage;
+    VC.tabBarItem.title = title;
+    //    VC.navigationItem.title = title;
+    VC.tabBarItem.tag = current_tag;
+    [self addChildViewController:nav];
+}
+
+-(UIColor *)randomColor
+{
+    return [UIColor whiteColor];
+}
+
+
+#pragma mark - 根控制器的切换
+-(void)switchRootViewController
+{
+   [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeItems:) name:@"changeItems" object:nil];
+}
+
+-(void)changeItems:(NSNotification *)notification
+{
+    
+    NSLog(@"收到改变tabbar的通知");
+    NSDictionary *dict = notification.userInfo;
+    NSInteger index = [dict[@"item_index"] integerValue];
+//    if(index==1) {
+//        [self setSelectedIndex:1];
+//    }else if (index==2) {
+//        [self setSelectedIndex:2];
+//    }else if (index==3) {
+//        [self setSelectedIndex:3];
+//    }else {
+//
+//    }
+    [self.V1 dealTabBar];
+    [self.V2 dealTabBar];
+    [self.V3 dealTabBar];
+    [self.V4 dealTabBar];
+//    if(index==0) {
+//        [self.V1 dealTabBar];
+//    }else if (index==1) {
+//        [self.V2 dealTabBar];
+//    }else if (index==2) {
+//        [self.V3 dealTabBar];
+//    }else if (index==3){
+//        [self.V4 dealTabBar];
+//    }else if (index==5){
+//        //登录 刷新其他页面新的数据
+//        NSLog(@"刷新其他页面的数据");
+//        [self.V1 dealTabBar];
+//        [self.V2 dealTabBar];
+//        [self.V3 dealTabBar];
+//        [self.V4 dealTabBar];
+//
+//    }
+    
+}
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    // Dispose of any resources that can be recreated.
+}
+
+/*
+#pragma mark - Navigation
+
+// In a storyboard-based application, you will often want to do a little preparation before navigation
+- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
+    // Get the new view controller using [segue destinationViewController].
+    // Pass the selected object to the new view controller.
+}
+*/
+
+@end

+ 17 - 0
ios/JianYuIOS/JianYuIOS/UITabBar+badge.h

@@ -0,0 +1,17 @@
+//
+//  UITabBar+badge.h
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/13.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UITabBar (badge)
+
+- (void)showBadgeOnItemIndex:(int)index;   //显示小红点
+
+- (void)hideBadgeOnItemIndex:(int)index; //隐藏小红点
+
+@end

+ 55 - 0
ios/JianYuIOS/JianYuIOS/UITabBar+badge.m

@@ -0,0 +1,55 @@
+//
+//  UITabBar+badge.m
+//  JianYuIOS
+//
+//  Created by apple on 2018/11/13.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "UITabBar+badge.h"
+
+@implementation UITabBar (badge)
+
+- (void)showBadgeOnItemIndex:(int)index{
+    
+    //移除之前的小红点
+    [self removeBadgeOnItemIndex:index];
+    
+    //新建小红点
+    UIView *badgeView = [[UIView alloc]init];
+    badgeView.tag = 888 + index;
+    badgeView.layer.cornerRadius = 4;
+    badgeView.backgroundColor = UIColorFromRGB(0xf12c20);
+    CGRect tabFrame = self.frame;
+    
+    //确定小红点的位置
+    float percentX = (index +0.6) * 0.25;
+    CGFloat x = ceilf(percentX * tabFrame.size.width);
+    CGFloat y = ceilf(0.1 * tabFrame.size.height);
+    badgeView.frame = CGRectMake(x, y, 8, 8);
+    [self addSubview:badgeView];
+    
+}
+
+- (void)hideBadgeOnItemIndex:(int)index{
+    
+    //移除小红点
+    [self removeBadgeOnItemIndex:index];
+    
+}
+
+- (void)removeBadgeOnItemIndex:(int)index{
+    
+    //按照tag值进行移除
+    for (UIView *subView in self.subviews) {
+        
+        if (subView.tag == 888+index) {
+            
+            [subView removeFromSuperview];
+            
+        }
+    }
+}
+
+
+@end

+ 10 - 1
ios/JianYuIOS/JianYuIOS/ViewController.h

@@ -10,6 +10,15 @@
 
 @interface ViewController : UIViewController
 
-
+//@property (weak, nonatomic) IBOutlet UIWebView *webView;
+//@property(nonatomic, assign)BOOL ;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC;
+//@property(nonatomic, strong)WKWebView *wkWebView;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+@property(nonatomic, strong)UIWebView *webView;
 @end
 

+ 110 - 9
ios/JianYuIOS/JianYuIOS/ViewController.m

@@ -55,12 +55,19 @@ JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否
 JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
 JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
 
+<<<<<<< HEAD
 JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+=======
+JSExportAs(getCipherText, -(NSString *)jsGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+>>>>>>> origin/developPay
 
 JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
 
 
 
+@end
 
 @end
 
@@ -70,17 +77,13 @@ JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSIntege
     CGPoint startTouch;
     BOOL _isMoving;
     
+<<<<<<< HEAD
+=======
+    
+    BOOL _isFirstLogin;
+>>>>>>> origin/developPay
 }
 
-@property (weak, nonatomic) IBOutlet UIWebView *webView;
-//@property(nonatomic, assign)BOOL ;
-@property(nonatomic, assign)BOOL updateNotify;
-@property(nonatomic, assign)BOOL afterOpenPushMessage;
-@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC;
-//@property(nonatomic, strong)WKWebView *wkWebView;
-@property(nonatomic, strong)NoNetView *noNetView;
-@property(nonatomic, strong)NSURLRequest *errRequest;
-@property(nonatomic, strong)NSString *signOutContent;
 
 
 
@@ -96,6 +99,9 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
 - (void)viewDidLoad {
     [super viewDidLoad];
     
+    
+    NSLog(@"viewDidLoadviewDidLoad   初始化");
+    
     [LXDataBaseManager shareDataBaseManager];
     if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
         //        if(KIsiPhoneX) {
@@ -109,7 +115,18 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
         [self.webView updateConstraints];
     }
     
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    
+    
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
     self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    
+    
+    
     [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
     [self webViewFirstRequest];//请求页面数据
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
@@ -122,13 +139,21 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
     
     
+<<<<<<< HEAD
     
     
 //    [self clearWeb];
+=======
+    
+    
+    [self clearWeb];
+>>>>>>> origin/developPay
     
     UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
     [recognizer delaysTouchesBegan];
     [self.view addGestureRecognizer:recognizer];
+    
+    
 }
 
 -(void)moveViewWithX:(float)x
@@ -314,10 +339,18 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
     NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
     url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
     
+<<<<<<< HEAD
     UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
     webView.delegate = self;
     [self.view addSubview:webView];
     [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+=======
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+>>>>>>> origin/developPay
     
     //    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
     [self jsRemoveUserToken:nil];
@@ -326,11 +359,72 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
 
 
 
+- (void)hideTabBar {
+    
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == YES) {
+            return;
+        }
+        UIView *contentView;
+        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        else
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == NO)
+        {
+            return;
+        }
+        UIView *contentView;
+        if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        
+        else
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = NO;
+    });
+}
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    if([hidden integerValue]==0) {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+    
+}
 
 #pragma mark  捕获js中调用的方法
 
 //捕获js中调用的方法
 - (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+    [self judgeIsHidden];//是否隐藏
     [self removeNoNetViews];
     [[LXViewControllerManager shareViewControllerManager] hideHud];
     JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
@@ -390,6 +484,9 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
     [super didReceiveMemoryWarning];
 //    [self clearWeb];
     // Dispose of any resources that can be recreated.
+    
+    //当前页面:http://jianyu360.mikecrm.com/9Li9dpM
+    //https://mp.weixin.qq.com/s/jomQtxcanA-Nszgy1ubuhA
 }
 
 -(void)clearWeb{
@@ -725,7 +822,11 @@ NSString *const AesKey = @"mGlAgnIBB8bx2nch";
 
 
 
+<<<<<<< HEAD
 -(NSString *)jsGGetCipherText:(NSString *)phone
+=======
+-(NSString *)jsGetCipherText:(NSString *)phone
+>>>>>>> origin/developPay
 {
     
     NSDate *date=[NSDate date];

+ 895 - 0
ios/JianYuIOS/JianYuIOS/ViewController_BACKUP_16982.m

@@ -0,0 +1,895 @@
+//
+//  ViewController.m
+//  JianYuIOS
+//
+//  Created by lixianglan on 2018/1/19.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "ViewController.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+#import <UShareUI/UShareUI.h>
+#import <UMSocialCore/UMSocialCore.h>
+#import "NewWebController.h"
+#import <UMSocialCore/UMSocialCore.h>
+#import <AFNetworking.h>
+#import "NoNetView.h"
+//#import <WebKit/WebKit.h>
+#import  <CommonCrypto/CommonCryptor.h>
+
+
+
+#define LocalStr_None @""//空字符串
+#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+
+@protocol ViewControllerMain<JSExport>
+
+//测试
+
+
+@end
+
+
+
+@protocol ViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+<<<<<<< HEAD
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+=======
+JSExportAs(getCipherText, -(NSString *)jsGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+>>>>>>> origin/developPay
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+
+@end
+
+@end
+
+
+@interface ViewController ()<UIWebViewDelegate, ViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+<<<<<<< HEAD
+=======
+    
+    BOOL _isFirstLogin;
+>>>>>>> origin/developPay
+}
+
+
+
+
+
+@end
+
+NSString *const kInitVector = @"1389461544135476";
+size_t const kKeySize = kCCKeySizeAES128;
+NSString *const AesKey = @"mGlAgnIBB8bx2nch";
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    
+    NSLog(@"viewDidLoadviewDidLoad   初始化");
+    
+    [LXDataBaseManager shareDataBaseManager];
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
+        //        if(KIsiPhoneX) {
+        //            self.topC.constant = -44;
+        //            [self.webView updateConstraints];
+        //        }else {
+        //            self.topC.constant = -20;
+        //            [self.webView updateConstraints];
+        //        }
+        self.topC.constant = -20;
+        [self.webView updateConstraints];
+    }
+    
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    
+    
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    
+    
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    
+    
+<<<<<<< HEAD
+    
+    
+//    [self clearWeb];
+=======
+    
+    
+    [self clearWeb];
+>>>>>>> origin/developPay
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    
+    
+}
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+    }
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+        //        if([infoDict[@"type"] isEqualToString:@"message"]) {
+        //            NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }else {
+        //            NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }
+        
+        
+    }
+    
+    
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+<<<<<<< HEAD
+    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+    webView.delegate = self;
+    [self.view addSubview:webView];
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+=======
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+>>>>>>> origin/developPay
+    
+    //    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+
+
+
+- (void)hideTabBar {
+    
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == YES) {
+            return;
+        }
+        UIView *contentView;
+        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        else
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == NO)
+        {
+            return;
+        }
+        UIView *contentView;
+        if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        
+        else
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = NO;
+    });
+}
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    if([hidden integerValue]==0) {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+    
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+    [self judgeIsHidden];//是否隐藏
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+    
+    //当前页面:http://jianyu360.mikecrm.com/9Li9dpM
+    //https://mp.weixin.qq.com/s/jomQtxcanA-Nszgy1ubuhA
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+<<<<<<< HEAD
+-(NSString *)jsGGetCipherText:(NSString *)phone
+=======
+-(NSString *)jsGetCipherText:(NSString *)phone
+>>>>>>> origin/developPay
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@end

+ 715 - 0
ios/JianYuIOS/JianYuIOS/ViewController_BASE_16982.m

@@ -0,0 +1,715 @@
+//
+//  ViewController.m
+//  JianYuIOS
+//
+//  Created by lixianglan on 2018/1/19.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "ViewController.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+#import <UShareUI/UShareUI.h>
+#import <UMSocialCore/UMSocialCore.h>
+#import "NewWebController.h"
+#import <UMSocialCore/UMSocialCore.h>
+#import <AFNetworking.h>
+#import "NoNetView.h"
+//#import <WebKit/WebKit.h>
+
+
+
+#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+
+@protocol ViewControllerMain<JSExport>
+
+//测试
+
+
+@end
+
+@protocol ViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+
+
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+
+
+
+@end
+
+
+
+@interface ViewController ()<UIWebViewDelegate, ViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+}
+
+@property (weak, nonatomic) IBOutlet UIWebView *webView;
+//@property(nonatomic, assign)BOOL ;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC;
+//@property(nonatomic, strong)WKWebView *wkWebView;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+
+
+
+@end
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    [LXDataBaseManager shareDataBaseManager];
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
+//        if(KIsiPhoneX) {
+//            self.topC.constant = -44;
+//            [self.webView updateConstraints];
+//        }else {
+//            self.topC.constant = -20;
+//            [self.webView updateConstraints];
+//        }
+        self.topC.constant = -20;
+        [self.webView updateConstraints];
+    }
+    
+    self.webView.scrollView.bounces = NO;
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    
+    
+
+    
+//    [self clearWeb];
+
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+}
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+//    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+    }
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+//
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+
+    if (urlStr) {
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+//        if([infoDict[@"type"] isEqualToString:@"message"]) {
+//            NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+//            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+//            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+//        }else {
+//            NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+//            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+//            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+//        }
+        
+        
+    }
+
+    
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+
+    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+    webView.delegate = self;
+    [self.view addSubview:webView];
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+
+//    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+
+
+
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+//        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+//        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+//    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+//        [[LXViewControllerManager shareViewControllerManager] hideHud];
+//    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            LXLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue(^{
+        
+//         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+//         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                UMSocialLogInfo(@"************Share fail with error %@*********",error);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"%@",resp.message);
+                    NSLog(@"response originalResponse data is %@",resp.originalResponse);
+                    //分享结果消息
+                    UMSocialLogInfo(@"response message is %@",resp.message);
+                    //第三方原始返回的数据
+                    UMSocialLogInfo(@"response originalResponse data is %@",resp.originalResponse);
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                }
+            }
+        }];
+    });
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+//    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+         [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+         [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return@"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+//    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+//            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+//         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+
+
+
+@end

+ 794 - 0
ios/JianYuIOS/JianYuIOS/ViewController_LOCAL_16982.m

@@ -0,0 +1,794 @@
+//
+//  ViewController.m
+//  JianYuIOS
+//
+//  Created by lixianglan on 2018/1/19.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "ViewController.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+#import <UShareUI/UShareUI.h>
+#import <UMSocialCore/UMSocialCore.h>
+#import "NewWebController.h"
+#import <UMSocialCore/UMSocialCore.h>
+#import <AFNetworking.h>
+#import "NoNetView.h"
+//#import <WebKit/WebKit.h>
+#import  <CommonCrypto/CommonCryptor.h>
+
+
+
+#define LocalStr_None @""//空字符串
+#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+
+@protocol ViewControllerMain<JSExport>
+
+//测试
+
+
+@end
+
+
+
+@protocol ViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+
+
+@end
+
+
+@interface ViewController ()<UIWebViewDelegate, ViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+}
+
+@property (weak, nonatomic) IBOutlet UIWebView *webView;
+//@property(nonatomic, assign)BOOL ;
+@property(nonatomic, assign)BOOL updateNotify;
+@property(nonatomic, assign)BOOL afterOpenPushMessage;
+@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topC;
+//@property(nonatomic, strong)WKWebView *wkWebView;
+@property(nonatomic, strong)NoNetView *noNetView;
+@property(nonatomic, strong)NSURLRequest *errRequest;
+@property(nonatomic, strong)NSString *signOutContent;
+
+
+
+
+@end
+
+NSString *const kInitVector = @"1389461544135476";
+size_t const kKeySize = kCCKeySizeAES128;
+NSString *const AesKey = @"mGlAgnIBB8bx2nch";
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    [LXDataBaseManager shareDataBaseManager];
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
+        //        if(KIsiPhoneX) {
+        //            self.topC.constant = -44;
+        //            [self.webView updateConstraints];
+        //        }else {
+        //            self.topC.constant = -20;
+        //            [self.webView updateConstraints];
+        //        }
+        self.topC.constant = -20;
+        [self.webView updateConstraints];
+    }
+    
+    self.webView.scrollView.bounces = NO;
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    
+    
+    
+    
+//    [self clearWeb];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+}
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+    }
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+        //        if([infoDict[@"type"] isEqualToString:@"message"]) {
+        //            NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }else {
+        //            NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }
+        
+        
+    }
+    
+    
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+    webView.delegate = self;
+    [self.view addSubview:webView];
+    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+    //    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+
+
+
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+//    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@end

+ 868 - 0
ios/JianYuIOS/JianYuIOS/ViewController_REMOTE_16982.m

@@ -0,0 +1,868 @@
+//
+//  ViewController.m
+//  JianYuIOS
+//
+//  Created by lixianglan on 2018/1/19.
+//  Copyright © 2018年 lixianglan. All rights reserved.
+//
+
+#import "ViewController.h"
+#import <JavaScriptCore/JavaScriptCore.h>
+#import <UShareUI/UShareUI.h>
+#import <UMSocialCore/UMSocialCore.h>
+#import "NewWebController.h"
+#import <UMSocialCore/UMSocialCore.h>
+#import <AFNetworking.h>
+#import "NoNetView.h"
+//#import <WebKit/WebKit.h>
+#import  <CommonCrypto/CommonCryptor.h>
+
+
+
+#define LocalStr_None @""//空字符串
+#define KIsiPhoneX ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1125, 2436), [[UIScreen mainScreen] currentMode].size) : NO)
+
+@protocol ViewControllerMain<JSExport>
+
+//测试
+
+
+@end
+
+
+
+@protocol ViewControllerJSExport<JSExport>
+
+JSExportAs(loginByWeixin, -(NSString *)jsLoginByWeixin:(NSString *)str);// 微信登录 openid
+JSExportAs(share, -(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link); // 调用分享
+JSExportAs(saveUserToken, -(void)jsSaveUserToken:(NSString *)token);// 登录时获取令牌 保存
+JSExportAs(getUserToken, -(NSString *)jsGetUserToken:(NSString *)str);// 取本地存的令牌
+JSExportAs(removeUserToken, -(void)jsRemoveUserToken:(NSString *)str); // 退出时清空数据
+JSExportAs(checkNoticePermission, -(int)jsCheckNoticePermission:(NSString *)str); // 查询手机通知是否打开
+JSExportAs(openSystemNotification, -(void)jsOpenSystemNotification:(NSString *)str);// 跳转到系统设置
+JSExportAs(getPushRid, -(NSString *)jsGetPushRid:(NSString *)str);// 返回极光id
+JSExportAs(getMessageList, -(NSString *)jsGetMessageList:(NSString *)openid);// 按通知接收时间倒排,取前100条
+JSExportAs(updateMessageState, -(void)jsUpdateMessageState:(NSString *)lxID state:(NSString *)state);// 更新状态
+JSExportAs(deleteMessageById, -(void)jsDeleteMessageById:(NSString *)lxID);// 删除一条消息
+JSExportAs(getMessage, -(NSString *)jsGetMessage:(NSString *)lxID);// 取单条数据
+JSExportAs(getUnReadMessageCount, -(int)jsGetUnReadMessageCount:(NSString *)openid);// 获取未读消息总数
+JSExportAs(updateAllUnReadMessage, -(void)jsUpdateAllUnReadMessage:(NSString *)openid);// 全部置为已读
+JSExportAs(lightStatusBar, -(void)jsLightStatusBar:(NSString *)status);// 导航栏文字颜色
+JSExportAs(openExternalLink, -(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title);// 打开新控制器 加载新web
+JSExportAs(getVersion, -(NSString *)jsGetVersion:(NSString *)str);// 获取当前版本号
+JSExportAs(alert, -(void)jsAlert:(NSString *)content);// 弹框
+JSExportAs(isInstallWeixin, -(int)jsIsInstallWeixin:(NSString *)str);// 是否安装微信
+JSExportAs(changeMessageType, -(void)jsChangeMessageType:(NSString *)link);//已读操作处理
+JSExportAs(openActivityPage, -(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid);
+
+JSExportAs(getCipherText, -(NSString *)jsGetCipherText:(NSString *)phone);
+
+JSExportAs(business, -(NSInteger)jsBusiness:(NSInteger)shooID shopType:(NSInteger )shopType);
+
+
+
+
+@end
+
+
+@interface ViewController ()<UIWebViewDelegate, ViewControllerJSExport>
+{
+    CGPoint startTouch;
+    BOOL _isMoving;
+    
+    
+    BOOL _isFirstLogin;
+}
+
+
+
+
+
+@end
+
+NSString *const kInitVector = @"1389461544135476";
+size_t const kKeySize = kCCKeySizeAES128;
+NSString *const AesKey = @"mGlAgnIBB8bx2nch";
+
+@implementation ViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    
+    
+    NSLog(@"viewDidLoadviewDidLoad   初始化");
+    
+    [LXDataBaseManager shareDataBaseManager];
+    if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
+        //        if(KIsiPhoneX) {
+        //            self.topC.constant = -44;
+        //            [self.webView updateConstraints];
+        //        }else {
+        //            self.topC.constant = -20;
+        //            [self.webView updateConstraints];
+        //        }
+        self.topC.constant = -20;
+        [self.webView updateConstraints];
+    }
+    
+    
+    self.view.backgroundColor = [UIColor whiteColor];
+    
+    
+    self.webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT)];
+    [self.view addSubview: self.webView];
+    self.webView.scrollView.bounces = NO;
+    self.webView.delegate = self;
+    
+    
+    
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    [self webViewFirstRequest];//请求页面数据
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(requestWebView:) name:kRequestWebViewWithUrl object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateNotifyState) name:kUpdateNotifyState object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(afterReceiveNewMsg) name:kAfterReceiveNewMsg object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reloadWebView) name:kReloadWebVIew object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginOut:) name:kLoginOut object:nil];
+    
+    [[AFNetworkReachabilityManager sharedManager] startMonitoring];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(netReachChanged:) name:AFNetworkingReachabilityDidChangeNotification object:nil];
+    
+    
+    
+    
+    [self clearWeb];
+    
+    UIPanGestureRecognizer *recognizer = [[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(paningGestureReceive:)];
+    [recognizer delaysTouchesBegan];
+    [self.view addGestureRecognizer:recognizer];
+    
+    
+}
+
+-(void)moveViewWithX:(float)x
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    x = x>width?width:x;
+    x = x<0?0:x;
+    CGRect frame = self.webView.frame;
+    frame.origin.x = x;
+    self.webView.frame = frame;
+}
+
+#pragma mark – Gesture Recognizer –
+-(void)paningGestureReceive:(UIPanGestureRecognizer *)recoginzer
+{
+    CGRect rect = self.view.bounds;
+    CGFloat width = CGRectGetWidth(rect);
+    if (![self.webView canGoBack]) {
+        NSLog(@"不可返回");
+        return;
+    }
+    
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    NSLog(@"当前页面:%@",current_url);
+    //    NSString *current_url = self.webView.request.URL.absoluteString;
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        return;
+    }
+    
+    //https://www.jianyu360.com/jyapp/free/me
+    //https://www.jianyu360.com/jyapp/jylab/index
+    //https://www.jianyu360.com/jyapp/wxkeyset/keyset/index
+    //https://www.jianyu360.com/jyapp/jylab/mainSearch
+    
+    CGPoint touchPoint = [recoginzer locationInView:[UIApplication sharedApplication].keyWindow];
+    if (recoginzer.state==UIGestureRecognizerStateBegan) {
+        _isMoving = YES;
+        startTouch = touchPoint;
+    } else if (recoginzer.state==UIGestureRecognizerStateEnded){
+        if (touchPoint.x - startTouch.x > width*0.125) {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:width];
+                [self.webView goBack];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+                [self moveViewWithX:0];
+            }];
+        } else {
+            [UIView animateWithDuration:0.3 animations:^{
+                [self moveViewWithX:0];
+            } completion:^(BOOL finished) {
+                _isMoving = NO;
+            }];
+        }
+        return;
+    } else if (recoginzer.state==UIGestureRecognizerStateCancelled){
+        [UIView animateWithDuration:0.3 animations:^{
+            [self moveViewWithX:0];
+        } completion:^(BOOL finished) {
+            _isMoving = NO;
+        }];
+        return;
+    }
+    if (_isMoving) {
+        [self moveViewWithX:touchPoint.x - startTouch.x];
+    }
+}
+
+
+// 监控网络状态变化
+-(void)netReachChanged:(NSNotification *)notificaition{
+    NSDictionary *userInfo = notificaition.userInfo;
+    if ([userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == 0 || [userInfo[@"AFNetworkingReachabilityNotificationStatusItem"] intValue] == -1) {
+        [self addNoNetViews];
+    }else{
+        if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"firstLoad"] intValue] == 0) {
+            [[NSUserDefaults standardUserDefaults] setObject:@"1" forKey:@"firstLoad"];
+            [self removeNoNetViews];
+            [self webViewFirstRequest];
+        }
+    }
+}
+
+// 再次加载页面
+-(void)reloadWebView{
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    if (!self.webView.canGoBack) {
+        [self webViewFirstRequest];
+    }else{
+        [self.webView reload];
+    }
+    
+}
+
+// 首次加载web
+-(void)webViewFirstRequest{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/index"];
+    NSString *token = [LXUserDefaults token];
+    if (token) {
+        url = [url stringByAppendingString:[NSString stringWithFormat:@"?sign=%@&url=/jyapp/jylab/mainSearch&from=restart", token]];
+    }
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+}
+
+//收到消息退出并重新加载web
+-(void)webViewRequestByMsg{
+    NSString *url = [NSString stringWithFormat:@"%@%@", kHost, @"jyapp/free/kicked"];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+}
+
+-(void)requestWebTime:(NSDictionary *)infoDict
+{
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if([infoDict[@"type"] isEqualToString:@"message"]) {
+        NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        NSArray * array = [url componentsSeparatedByString:@"=="];
+        url =  [array.firstObject stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //
+    }else {
+        NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+    }
+    
+}
+
+// 点击通知 跳转到通知内url
+-(void)requestWebView:(NSNotification *)notification{
+    NSDictionary * infoDict = [notification object];
+    if (!infoDict) {
+        return;
+    }
+    NSString * urlStr = [NSString stringWithFormat:@"%@",infoDict[@"url"]];
+    
+    if (urlStr) {
+        [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+        self.afterOpenPushMessage = YES;
+        
+        
+        [self performSelector:@selector(requestWebTime:) withObject:infoDict afterDelay:1];
+        //        if([infoDict[@"type"] isEqualToString:@"message"]) {
+        //            NSString *url = [NSString stringWithFormat:@"%@",urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }else {
+        //            NSString *url = [NSString stringWithFormat:@"%@%@", kHost, urlStr];
+        //            url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+        //            [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+        //            [[NSNotificationCenter defaultCenter] postNotificationName:@"kNewWebControllerDismiss" object:nil];
+        //        }
+        
+        
+    }
+    
+    
+}
+
+
+
+
+// 收到通知消息
+-(void)afterReceiveNewMsg{
+    NSLog(@"afterReceiveNewMsg");
+    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    [context evaluateScript:@"afterReceiveNewMsg()"];
+}
+
+// 收到退出登录消息
+-(void)loginOut:(NSNotification *)notification{
+    self.signOutContent = notification.object;
+    if (!self.signOutContent) {
+        self.signOutContent = @"1";
+    }
+    NSString *url = [NSString stringWithFormat:@"%@%@?sign=%@", kHost, @"jyapp/free/signOut", [LXUserDefaults token]];
+    url =  [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
+    
+    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+//    UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
+//    webView.delegate = self;
+//    [self.view addSubview:webView];
+//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    
+    //    [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
+    [self jsRemoveUserToken:nil];
+}
+
+
+
+
+- (void)hideTabBar {
+    
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == YES) {
+            return;
+        }
+        UIView *contentView;
+        if ( [[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] )
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        else
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x,  contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height + self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = YES;
+    });
+}
+- (void)showTabBar{
+    kMainQueue(^{
+        if (self.tabBarController.tabBar.hidden == NO)
+        {
+            return;
+        }
+        UIView *contentView;
+        if ([[self.tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]])
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:1];
+        
+        else
+            
+            contentView = [self.tabBarController.view.subviews objectAtIndex:0];
+        contentView.frame = CGRectMake(contentView.bounds.origin.x, contentView.bounds.origin.y,  contentView.bounds.size.width, contentView.bounds.size.height - self.tabBarController.tabBar.frame.size.height);
+        self.tabBarController.tabBar.hidden = NO;
+    });
+}
+
+-(void)jsHiddenBottom:(NSString *)hidden
+{
+    if([hidden integerValue]==0) {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }
+}
+
+-(void)judgeIsHidden
+{
+    NSString *current_url = [self.webView stringByEvaluatingJavaScriptFromString:@"document.location.href"];
+    
+    if([current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/free/me",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/wxkeyset/keyset/index",kHost]]||[current_url isEqualToString:[NSString stringWithFormat:@"%@jyapp/jylab/mainSearch",kHost]]){
+        
+        [self showTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT-TAB_BAR_HEIGHT+STATUS_BAR_HEIGHT);
+    }else {
+        [self hideTabBar];
+        self.webView.frame = CGRectMake(0, -STATUS_BAR_HEIGHT, WIDTH, HEIGHT+STATUS_BAR_HEIGHT);
+    }
+    
+}
+
+#pragma mark  捕获js中调用的方法
+
+//捕获js中调用的方法
+- (void)webViewDidFinishLoad:(UIWebView *)webView{
+    
+    [self judgeIsHidden];//是否隐藏
+    [self removeNoNetViews];
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    JSContext *context = [webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    // Disable user selection
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitUserSelect='none';"];
+    // Disable callout
+    [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.style.webkitTouchCallout='none';"];
+    
+    context[@"JyObj"] = self;
+    
+    [context evaluateScript:@"afterPageInit()"];
+    if (self.afterOpenPushMessage) {
+        self.afterOpenPushMessage = NO;
+        //        [context evaluateScript:@"afterOpenPushMessage()"];
+        [context evaluateScript:[NSString stringWithFormat:@"afterOpenPushMessage('%d')", [self jsIsCanBack:nil]]];
+    }
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+-(void)doSomeWithLoadUrl:(NSString *)url{
+    if (!url) {
+        return;
+    }
+    if ([url containsString:@"signOut"]) { // 收到退出消息后 跳转到登录页面
+        //        [self webViewFirstRequest];
+        [self webViewRequestByMsg];
+    }else if ([url containsString:@"/free/login"]){ //  如果通过接收消息 跳转到登录页面 展示消息内容
+        if (self.signOutContent && ![self.signOutContent isEqualToString:@"1"]) {
+            [[LXViewControllerManager shareViewControllerManager] showAlertViewWithTitle:@"提示" message:self.signOutContent actions:@[[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
+                self.signOutContent = nil;
+            }]]];
+        }else{
+            self.signOutContent = nil;
+        }
+    }
+}
+
+-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    
+    NSString *url = webView.request.URL.absoluteString;
+    [self doSomeWithLoadUrl:url];
+}
+
+
+
+-(void)webViewDidStartLoad:(UIWebView *)webView{
+    //    if ([[UIDevice currentDevice].systemVersion floatValue] < 10) {
+    //        [[LXViewControllerManager shareViewControllerManager] hideHud];
+    //    }
+}
+
+
+- (void)didReceiveMemoryWarning {
+    [super didReceiveMemoryWarning];
+    [self clearWeb];
+    // Dispose of any resources that can be recreated.
+    
+    //当前页面:http://jianyu360.mikecrm.com/9Li9dpM
+    //https://mp.weixin.qq.com/s/jomQtxcanA-Nszgy1ubuhA
+}
+
+-(void)clearWeb{
+    NSURLCache * cache = [NSURLCache sharedURLCache];
+    [cache removeAllCachedResponses];
+    [cache setDiskCapacity:0];
+    [cache setMemoryCapacity:0];
+}
+
+-(void)addNoNetViews{
+    kMainQueue(^{
+        [self removeNoNetViews];
+        self.noNetView = [NoNetView shareView];
+        [self.view addSubview:self.noNetView];
+    });
+}
+
+-(void)removeNoNetViews{
+    if (self.noNetView ) {
+        [self.noNetView removeFromSuperview];
+        self.noNetView  = nil;
+    }
+}
+
+
+#pragma  mark JS 回调
+// 微信登录
+-(NSString *)jsLoginByWeixin:(NSString *)str{
+    
+    if ([LXUserDefaults isInstallWeiXin] != 1) { // 没有安装微信 不走友盟
+        [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"微信登录失败,没有安装微信" delay:1.5];
+        return nil;
+    }
+    
+    kMainQueue(^{
+        
+        [[UMSocialManager defaultManager] getUserInfoWithPlatform:UMSocialPlatformType_WechatSession currentViewController:self completion:^(id result, NSError *error) {
+            
+            UMSocialUserInfoResponse *resp = result;
+            
+            [self dealWXDic:(NSDictionary *)resp.originalResponse];
+            
+            [[LXViewControllerManager shareViewControllerManager] hideHud];
+        }];
+        
+        
+        
+    });
+    
+    return nil;
+}
+// 处理微信登录获取到的数据
+-(void)dealWXDic:(NSDictionary *)dictionary{
+    
+    [[LXViewControllerManager shareViewControllerManager] showHudText:nil];
+    //如果获取到用户信息,即用户点击了“登录”,则进行用户信息获取
+    if (dictionary.count > 0) {
+        
+        NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:dictionary];
+        
+        if (dic) {
+            [dic removeObjectForKey:@"privilege"];
+            [dic removeObjectForKey:@"language"];
+            double currDouble = [[NSDate date] timeIntervalSince1970];
+            [dic setObject:[NSNumber numberWithLong:(long)currDouble] forKey:@"createtime"];
+            
+            //         拼接标志位
+            NSString *sign = [NSString stringWithFormat:@"city=%@&country=%@&createtime=%@&headimgurl=%@&nickname=%@&openid=%@&province=%@&sex=%@&unionid=%@", dic[@"city"], dic[@"country"], dic[@"createtime"], dic[@"headimgurl"], dic[@"nickname"], dic[@"openid"], dic[@"province"],dic[@"sex"],dic[@"unionid"]];
+            sign = [LXMD5 md532BitLower:sign];
+            [dic setObject:sign forKey:@"sign"];
+            NSString *endStr = [[LXViewControllerManager shareViewControllerManager] getJsonStr:dic];
+            NSData *data = [endStr dataUsingEncoding:NSUTF8StringEncoding];
+            endStr = [data base64EncodedStringWithOptions:0];
+            
+            
+            JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+            NSString * textJS1 = [NSString stringWithFormat:@"loginByWeixinCallBack('%@')", endStr];
+            JSValue *value =   [context evaluateScript:textJS1];
+            NSLog(@"%@", value);
+            
+        }
+    }
+    
+}
+
+// js 调用分享
+-(void)jsShare:(NSString *)type title:(NSString *)title content:(NSString *)content link:(NSString *)link{
+    UMSocialPlatformType shareType;
+    
+    if ([type intValue] == 1) { // 微信好友
+        shareType = UMSocialPlatformType_WechatSession;
+    }else if ([type intValue] == 2){ /// qq好友
+        shareType = UMSocialPlatformType_QQ;
+    }else if ([type intValue] == 3){ // 朋友圈
+        shareType = UMSocialPlatformType_WechatTimeLine;
+    }else{
+        shareType = UMSocialPlatformType_WechatSession;
+    }
+    
+    kMainQueue((^{
+        
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 1 || [type intValue] == 3) {
+            if ([LXUserDefaults isInstallWeiXin] != 1) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装微信" delay:1.5];
+                return;
+            }
+        }
+        //         没有安装app 不走分享逻辑
+        if ([type intValue] == 2) {
+            if (![[UMSocialManager defaultManager] isInstall:UMSocialPlatformType_QQ]) {
+                [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"没有安装QQ" delay:1.5];
+                return;
+            }
+        }
+        
+        //创建分享消息对象
+        UMSocialMessageObject *messageObject = [UMSocialMessageObject messageObject];
+        //创建网页内容对象
+        UMShareWebpageObject *shareObject = [UMShareWebpageObject shareObjectWithTitle:title descr:content thumImage:[UIImage imageNamed:@"logo"]];
+        //设置网页地址
+        shareObject.webpageUrl = link;
+        messageObject.shareObject = shareObject;
+        //调用分享接口
+        [[UMSocialManager defaultManager] shareToPlatform:shareType messageObject:messageObject currentViewController:self completion:^(id data, NSError *error) {
+            if (error) {
+                NSLog(@"22222222%@",error.userInfo);
+                if (error.userInfo[@"message"] && [error.userInfo[@"message"] containsString:@"Operation is cancel"]) {
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:@"取消分享" delay:1];
+                }else{
+                    [[LXViewControllerManager shareViewControllerManager] showHudOnlyText:error.userInfo[@"message"] delay:1];
+                }
+                
+                NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"0"];
+                JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                [context evaluateScript:textJS];
+                
+            }else{
+                if ([data isKindOfClass:[UMSocialShareResponse class]]) {
+                    UMSocialShareResponse *resp = data;
+                    NSLog(@"33333%@",resp.message);
+                    NSLog(@"44444%@",resp.originalResponse);
+                    
+                    NSString *textJS =  [NSString stringWithFormat:@"shareCallBack('%@','%@')",type,@"1"];
+                    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+                    [context evaluateScript:textJS];
+                    
+                }else{
+                    UMSocialLogInfo(@"response data is %@",data);
+                    NSLog(@"55555%@",data);
+                }
+            }
+        }];
+    }));
+}
+
+// 登录时获取到令牌 并保存
+-(void)jsSaveUserToken:(NSString *)token{
+    [[LXViewControllerManager shareViewControllerManager] hideHud];
+    [LXUserDefaults saveToken:token];
+}
+
+// 取本地的用户令牌
+-(NSString *)jsGetUserToken:(NSString *)str{
+    return [LXUserDefaults token];
+}
+
+// 退出时 清空用户数据
+-(void)jsRemoveUserToken:(NSString *)str{
+    [LXUserDefaults clearAll];
+    //    [[LXDataBaseManager shareDataBaseManager] clearAll];
+    
+}
+
+
+// 手机通知权限是否打开
+-(int)jsCheckNoticePermission:(NSString *)str{
+    int a = [LXUserDefaults notifyState];
+    return a;
+}
+
+// 跳转到系统设置
+-(void)jsOpenSystemNotification:(NSString *)str{
+    self.updateNotify = YES;
+    kMainQueue(^{
+        [[UIApplication sharedApplication]openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
+    });
+}
+
+// 调用js方法 刷新推送权限状态
+-(void)updateNotifyState{
+    if (self.updateNotify) {
+        self.updateNotify = NO;
+        JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+        NSString * textJS1 = [NSString stringWithFormat:@"updateNoticeSwitch()"];
+        [context evaluateScript:textJS1];
+    }
+}
+// 获取推送id
+-(NSString *)jsGetPushRid:(NSString *)str{
+    return [LXUserDefaults registrationID];
+}
+
+// 按通知取数据
+-(NSString *)jsGetMessageList:(NSString *)openid{
+    NSArray *arr = [[LXDataBaseManager shareDataBaseManager] getMessageWithKey:nil openid:openid fromTable:kNewsTable start:0 length:100];
+    if (arr.count > 0) {
+        return [[LXViewControllerManager shareViewControllerManager] getJsonStr:arr];
+    }
+    return @"";
+}
+
+// 更新消息状态
+-(void)jsUpdateMessageState:(NSNumber *)lxID state:(NSNumber *)state{
+    [[LXDataBaseManager shareDataBaseManager] changeReadedWithID:lxID state:state];
+}
+
+// 删除一条数据
+-(void)jsDeleteMessageById:(NSNumber *)lxID{
+    [[LXDataBaseManager shareDataBaseManager] deleteMessage:lxID fromTable:kNewsTable];
+}
+
+// 取单条数据
+-(NSString *)jsGetMessage:(NSString *)lxID{
+    return [[LXViewControllerManager shareViewControllerManager] getJsonStr:[[LXDataBaseManager shareDataBaseManager] getMessageWithKey:lxID openid:nil fromTable:kNewsTable start:0 length:0]];
+}
+// 取未读消息总数
+-(int)jsGetUnReadMessageCount:(NSString *)openid{
+    NSLog(@"openid=%@",openid);
+    //    NSLog(@"%d",[[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid]);
+    
+    return [[LXDataBaseManager shareDataBaseManager] getUnReadMessageCount:openid];
+}
+
+// 全部置为已读
+-(void)jsUpdateAllUnReadMessage:(NSString *)openid{
+    [[LXDataBaseManager shareDataBaseManager] updateAllUnReadMessage:openid];
+}
+
+// 改变状态栏文字颜色
+-(void)jsLightStatusBar:(NSString *)status{
+    kMainQueue(^{
+        NSInteger index = 0;
+        if ([status intValue] == 1) {
+            index = 1;// hei
+        }else{
+            index = 0;// bai
+        }
+        [[UIApplication sharedApplication] setStatusBarStyle:index];
+    });
+    
+}
+// 打开新页面 加载新web
+-(void)jsOpenExternalLink:(NSString *)url title:(NSString *)title{
+    if (url) {
+        if ([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable || [AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusUnknown) {
+            //            [self addNoNetViews];
+        }
+        NewWebController *ctr = [[NewWebController alloc] init];
+        ctr.url = url;
+        //         有title的话 会显示自定义的导航栏 没有的话不显示导航栏 显示加载进度条
+        if (!title || [title isEqualToString:@""] || [title isEqualToString:@"undefined"]) {
+            ctr.titleShow = nil;
+        }else{
+            ctr.titleShow = title;
+        }
+        kMainQueue(^{
+            [self presentViewController:ctr animated:NO completion:nil];
+        });
+    }
+}
+
+// 获取当前版本号
+-(NSString *)jsGetVersion:(NSString *)str{
+    return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
+}
+
+// web是否可退回上页面
+-(int)jsIsCanBack:(NSString *)str{
+    return self.webView.canGoBack ? 1:0;
+}
+
+// 弹框
+-(void)jsAlert:(NSString *)content{
+    [[LXViewControllerManager shareViewControllerManager] showAlertViewWithMessage:content];
+}
+
+// 是否安装微信
+-(int)jsIsInstallWeixin:(NSString *)str{
+    return [LXUserDefaults isInstallWeiXin];
+}
+
+
+-(void)jsChangeMessageType:(NSString *)link
+{
+    //已读操作处理
+    NSLog(@"已读操作处理-更改");
+    [[LXDataBaseManager shareDataBaseManager] changeCatagoryTypeWithURL:link];
+}
+
+
+
+
+
+
+
+-(void)jsOpenActivityPage:(NSString *)url rectype:(NSString *)rectype openid:(NSString *)openid
+{
+    NSDictionary * infoDic = @{@"url":url,
+                               @"rectype":rectype,
+                               @"openid":openid,
+                               };
+    
+    //    NSString *textJS =  [NSString stringWithFormat:@"messageAccept('%@','%@','%@')",infoDic[@"mid"],infoDic[@"rectype"],infoDic[@"openid"]];
+    //    JSContext *context = [self.webView valueForKeyPath:@"documentView.webView.mainFrame.javaScriptContext"];
+    //    [context evaluateScript:textJS];
+    
+    
+    //post请求
+    NSLog(@"%@",[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost]);
+    [[LXNetworkManager shareLXNetworkManager]postWithURLStr:[NSString stringWithFormat:@"%@jyapp/free/message/receive",kHost] parameters:infoDic progress:^(NSProgress *progress) {
+        NSLog(@"成功:%@",progress);
+    } success:^(id responseObject) {
+        NSLog(@"responseObject=%@",responseObject);
+    } failure:^(NSError *error) {
+        NSLog(@"error=%@",error);
+    }];
+    
+    
+}
+
+
+
+
+
+-(NSString *)jsGetCipherText:(NSString *)phone
+{
+    
+    NSDate *date=[NSDate date];
+    NSDateFormatter *format1=[[NSDateFormatter alloc] init];
+    [format1 setDateFormat:@"yyyyMMddhhmmss"];
+    NSString *dateStr;
+    dateStr=[format1 stringFromDate:date];
+    NSLog(@"%@",dateStr);
+    
+    NSString *content = [[NSString stringWithFormat:@"%@_%@",phone,dateStr] stringByAppendingString:[NSString stringWithFormat:@"_%@",[LXMD5 md532BitLower:[NSString stringWithFormat:@"%@&%@",phone,dateStr]]]];
+    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
+    NSUInteger dataLength = contentData.length;
+    // 为结束符'\\0' +1
+    char keyPtr[kKeySize + 1];
+    memset(keyPtr, 0, sizeof(keyPtr));
+    [AesKey getCString:keyPtr maxLength:sizeof(keyPtr) encoding:NSUTF8StringEncoding];
+    // 密文长度 <= 明文长度 + BlockSize
+    size_t encryptSize = dataLength + kCCBlockSizeAES128;
+    void *encryptedBytes = malloc(encryptSize);
+    size_t actualOutSize = 0;
+    NSData *initVector = [kInitVector dataUsingEncoding:NSUTF8StringEncoding];
+    CCCryptorStatus cryptStatus = CCCrypt(kCCEncrypt,
+                                          kCCAlgorithmAES,
+                                          kCCOptionPKCS7Padding,  // 系统默认使用 CBC,然后指明使用 PKCS7Padding
+                                          keyPtr,
+                                          kKeySize,
+                                          initVector.bytes,
+                                          contentData.bytes,
+                                          dataLength,
+                                          encryptedBytes,
+                                          encryptSize,
+                                          &actualOutSize);
+    if (cryptStatus == kCCSuccess) {
+        // 对加密后的数据进行 base64 编码
+        return [[NSData dataWithBytesNoCopy:encryptedBytes length:actualOutSize] base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
+    }
+    free(encryptedBytes);
+    return nil;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+@end

+ 4 - 0
ios/JianYuIOS/Podfile

@@ -7,4 +7,8 @@ pod 'UMengUShare/UI'
 pod 'UMengUShare/Social/ReducedWeChat'
 pod 'UMengUShare/Social/ReducedQQ'
 pod 'FMDB'
+
+
+pod 'WechatOpenSDK'
+
 end

+ 15 - 2
ios/JianYuIOS/Podfile.lock

@@ -30,6 +30,7 @@ PODS:
     - UMengUShare/Core
   - UMengUShare/UI (6.4.8.1):
     - UMengUShare/Core
+  - WechatOpenSDK (1.8.2)
 
 DEPENDENCIES:
   - AFNetworking
@@ -39,6 +40,17 @@ DEPENDENCIES:
   - UMengUShare/Social/ReducedQQ
   - UMengUShare/Social/ReducedWeChat
   - UMengUShare/UI
+  - WechatOpenSDK
+
+SPEC REPOS:
+  https://github.com/CocoaPods/Specs.git:
+    - AFNetworking
+    - FMDB
+    - JCore
+    - JPush
+    - MBProgressHUD
+    - UMengUShare
+    - WechatOpenSDK
 
 SPEC CHECKSUMS:
   AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
@@ -47,7 +59,8 @@ SPEC CHECKSUMS:
   JPush: 9574d072cc37e93fa293ba69b43ce763c440943a
   MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
   UMengUShare: 9e2d22f32aeaf09702ca833ec530895aab995c4f
+  WechatOpenSDK: 676feec516a11173eafd1fe64b10d27babf28701
 
-PODFILE CHECKSUM: 51ee5bdc5cc0d3b5ce359f4b50cc28407dd2887c
+PODFILE CHECKSUM: 0c9e7f54578ebabf029b8a955d84f26abcc07d29
 
-COCOAPODS: 1.3.1
+COCOAPODS: 1.5.0

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WXApi.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WXApi.h

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WXApiObject.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WXApiObject.h

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Private/WechatOpenSDK/WechatAuthSDK.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WechatAuthSDK.h

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WXApi.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WXApi.h

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WXApiObject.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WXApiObject.h

+ 1 - 0
ios/JianYuIOS/Pods/Headers/Public/WechatOpenSDK/WechatAuthSDK.h

@@ -0,0 +1 @@
+../../../WechatOpenSDK/WechatSDK1.8.2/WechatAuthSDK.h

+ 15 - 2
ios/JianYuIOS/Pods/Manifest.lock

@@ -30,6 +30,7 @@ PODS:
     - UMengUShare/Core
   - UMengUShare/UI (6.4.8.1):
     - UMengUShare/Core
+  - WechatOpenSDK (1.8.2)
 
 DEPENDENCIES:
   - AFNetworking
@@ -39,6 +40,17 @@ DEPENDENCIES:
   - UMengUShare/Social/ReducedQQ
   - UMengUShare/Social/ReducedWeChat
   - UMengUShare/UI
+  - WechatOpenSDK
+
+SPEC REPOS:
+  https://github.com/CocoaPods/Specs.git:
+    - AFNetworking
+    - FMDB
+    - JCore
+    - JPush
+    - MBProgressHUD
+    - UMengUShare
+    - WechatOpenSDK
 
 SPEC CHECKSUMS:
   AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
@@ -47,7 +59,8 @@ SPEC CHECKSUMS:
   JPush: 9574d072cc37e93fa293ba69b43ce763c440943a
   MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9
   UMengUShare: 9e2d22f32aeaf09702ca833ec530895aab995c4f
+  WechatOpenSDK: 676feec516a11173eafd1fe64b10d27babf28701
 
-PODFILE CHECKSUM: 51ee5bdc5cc0d3b5ce359f4b50cc28407dd2887c
+PODFILE CHECKSUM: 0c9e7f54578ebabf029b8a955d84f26abcc07d29
 
-COCOAPODS: 1.3.1
+COCOAPODS: 1.5.0

File diff suppressed because it is too large
+ 360 - 351
ios/JianYuIOS/Pods/Pods.xcodeproj/project.pbxproj


+ 60 - 0
ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/AFNetworking.xcscheme

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0930"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForAnalyzing = "YES"
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "9E033EDB5EC0819481B0546434FA577B"
+               BlueprintName = "AFNetworking"
+               ReferencedContainer = "container:Pods.xcodeproj"
+               BuildableName = "libAFNetworking.a">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      buildConfiguration = "Debug"
+      allowLocationSimulation = "YES">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 60 - 0
ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/FMDB.xcscheme

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0930"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForAnalyzing = "YES"
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "8642CC820CE8C5B88C113D7F47AF4BC3"
+               BlueprintName = "FMDB"
+               ReferencedContainer = "container:Pods.xcodeproj"
+               BuildableName = "libFMDB.a">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      buildConfiguration = "Debug"
+      allowLocationSimulation = "YES">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 60 - 0
ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/MBProgressHUD.xcscheme

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0930"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForAnalyzing = "YES"
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "586F2DFA9BDCC6675C2546793A69E5CC"
+               BlueprintName = "MBProgressHUD"
+               ReferencedContainer = "container:Pods.xcodeproj"
+               BuildableName = "libMBProgressHUD.a">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      buildConfiguration = "Debug"
+      allowLocationSimulation = "YES">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 60 - 0
ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/Pods-JianYuIOS.xcscheme

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "0930"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForAnalyzing = "YES"
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "10E1ED4B18EA509DD137E8F3063C935D"
+               BlueprintName = "Pods-JianYuIOS"
+               ReferencedContainer = "container:Pods.xcodeproj"
+               BuildableName = "libPods-JianYuIOS.a">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      buildConfiguration = "Debug">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </TestAction>
+   <LaunchAction
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      buildConfiguration = "Debug"
+      allowLocationSimulation = "YES">
+      <AdditionalOptions>
+      </AdditionalOptions>
+   </LaunchAction>
+   <ProfileAction
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 10 - 8
ios/JianYuIOS/Pods/Pods.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -6,24 +6,26 @@
 	<dict>
 		<key>AFNetworking.xcscheme</key>
 		<dict>
-			<key>orderHint</key>
-			<integer>1</integer>
+			<key>isShown</key>
+			<false/>
 		</dict>
 		<key>FMDB.xcscheme</key>
 		<dict>
-			<key>orderHint</key>
-			<integer>2</integer>
+			<key>isShown</key>
+			<false/>
 		</dict>
 		<key>MBProgressHUD.xcscheme</key>
 		<dict>
-			<key>orderHint</key>
-			<integer>3</integer>
+			<key>isShown</key>
+			<false/>
 		</dict>
 		<key>Pods-JianYuIOS.xcscheme</key>
 		<dict>
-			<key>orderHint</key>
-			<integer>4</integer>
+			<key>isShown</key>
+			<false/>
 		</dict>
 	</dict>
+	<key>SuppressBuildableAutocreation</key>
+	<dict/>
 </dict>
 </plist>

+ 4 - 4
ios/JianYuIOS/Pods/Target Support Files/AFNetworking/AFNetworking.xcconfig

@@ -1,9 +1,9 @@
-CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/AFNetworking
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JCore" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/AFNetworking" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking"
 OTHER_LDFLAGS = -framework "CoreGraphics" -framework "MobileCoreServices" -framework "Security" -framework "SystemConfiguration"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_ROOT = ${SRCROOT}
 PODS_TARGET_SRCROOT = ${PODS_ROOT}/AFNetworking
 PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

+ 4 - 4
ios/JianYuIOS/Pods/Target Support Files/FMDB/FMDB.xcconfig

@@ -1,9 +1,9 @@
-CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FMDB
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/FMDB
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JCore" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FMDB" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FMDB"
 OTHER_LDFLAGS = -l"sqlite3"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_ROOT = ${SRCROOT}
 PODS_TARGET_SRCROOT = ${PODS_ROOT}/FMDB
 PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

+ 4 - 4
ios/JianYuIOS/Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig

@@ -1,9 +1,9 @@
-CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD
+CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JCore" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD"
 OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_ROOT = ${SRCROOT}
 PODS_TARGET_SRCROOT = ${PODS_ROOT}/MBProgressHUD
 PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

+ 5 - 0
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-acknowledgements.markdown

@@ -89,4 +89,9 @@ THE SOFTWARE.
 
 Copyright 2011 - 2017 UMeng.com. All rights reserved.
 
+
+## WechatOpenSDK
+
+Copyright 2018 tencent.com. All rights reserved.
+
 Generated by CocoaPods - https://cocoapods.org

+ 11 - 0
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-acknowledgements.plist

@@ -137,6 +137,17 @@ THE SOFTWARE.</string>
 			<key>Type</key>
 			<string>PSGroupSpecifier</string>
 		</dict>
+		<dict>
+			<key>FooterText</key>
+			<string>Copyright 2018 tencent.com. All rights reserved.
+</string>
+			<key>License</key>
+			<string>Copyright</string>
+			<key>Title</key>
+			<string>WechatOpenSDK</string>
+			<key>Type</key>
+			<string>PSGroupSpecifier</string>
+		</dict>
 		<dict>
 			<key>FooterText</key>
 			<string>Generated by CocoaPods - https://cocoapods.org</string>

+ 49 - 8
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-frameworks.sh

@@ -1,15 +1,28 @@
 #!/bin/sh
 set -e
+set -u
+set -o pipefail
+
+if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
+    # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
+    # frameworks to, so exit 0 (signalling the script phase was successful).
+    exit 0
+fi
 
 echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
 mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
 
+COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
 SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
 
+# Used as a return value for each invocation of `strip_invalid_archs` function.
+STRIP_BINARY_RETVAL=0
+
 # This protects against multiple targets copying the same framework dependency at the same time. The solution
 # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
 RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
 
+# Copies and strips a vendored framework
 install_framework()
 {
   if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@@ -58,21 +71,40 @@ install_framework()
   fi
 }
 
-# Copies the dSYM of a vendored framework
+# Copies and strips a vendored dSYM
 install_dsym() {
   local source="$1"
   if [ -r "$source" ]; then
-    echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
-    rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
+    # Copy the dSYM into a the targets temp dir.
+    echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
+    rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
+
+    local basename
+    basename="$(basename -s .framework.dSYM "$source")"
+    binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
+
+    # Strip invalid architectures so "fat" simulator / device frameworks work on device
+    if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
+      strip_invalid_archs "$binary"
+    fi
+
+    if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
+      # Move the stripped file into its final destination.
+      echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
+      rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
+    else
+      # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
+      touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
+    fi
   fi
 }
 
 # Signs a framework with the provided identity
 code_sign_if_enabled() {
-  if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
+  if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
     # Use the current code_sign_identitiy
     echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
-    local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
+    local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
 
     if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
       code_sign_cmd="$code_sign_cmd &"
@@ -85,10 +117,18 @@ code_sign_if_enabled() {
 # Strip invalid architectures
 strip_invalid_archs() {
   binary="$1"
-  # Get architectures for current file
-  archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
+  # Get architectures for current target binary
+  binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
+  # Intersect them with the architectures we are building for
+  intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
+  # If there are no archs supported by this binary then warn the user
+  if [[ -z "$intersected_archs" ]]; then
+    echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
+    STRIP_BINARY_RETVAL=0
+    return
+  fi
   stripped=""
-  for arch in $archs; do
+  for arch in $binary_archs; do
     if ! [[ "${ARCHS}" == *"$arch"* ]]; then
       # Strip non-valid architectures in-place
       lipo -remove "$arch" -output "$binary" "$binary" || exit 1
@@ -98,6 +138,7 @@ strip_invalid_archs() {
   if [[ "$stripped" ]]; then
     echo "Stripped $binary of architectures:$stripped"
   fi
+  STRIP_BINARY_RETVAL=1
 }
 
 if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then

+ 15 - 3
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS-resources.sh

@@ -1,5 +1,13 @@
 #!/bin/sh
 set -e
+set -u
+set -o pipefail
+
+if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
+    # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
+    # resources to, so exit 0 (signalling the script phase was successful).
+    exit 0
+fi
 
 mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
 
@@ -12,7 +20,7 @@ XCASSET_FILES=()
 # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
 RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
 
-case "${TARGETED_DEVICE_FAMILY}" in
+case "${TARGETED_DEVICE_FAMILY:-}" in
   1,2)
     TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
     ;;
@@ -100,7 +108,7 @@ if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
 fi
 rm -f "$RESOURCES_TO_COPY"
 
-if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
+if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
 then
   # Find all other xcassets (this unfortunately includes those of path pods and other targets).
   OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
@@ -110,5 +118,9 @@ then
     fi
   done <<<"$OTHER_XCASSETS"
 
-  printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+  if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
+    printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
+  else
+    printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist"
+  fi
 fi

+ 6 - 6
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.debug.xcconfig

@@ -1,10 +1,10 @@
 FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialUI"
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JCore" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare"
-LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "${PODS_ROOT}/JCore" "${PODS_ROOT}/JPush" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat"
-OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/JCore" -isystem "${PODS_ROOT}/Headers/Public/JPush" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare"
-OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"FMDB" -l"MBProgressHUD" -l"SocialQQ" -l"SocialWeChat" -l"UMSocialLog" -l"jcore-ios-1.1.7" -l"jpush-ios-3.0.8" -l"resolv" -l"sqlite3" -l"z" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -weak_framework "UserNotifications"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_ROOT}/JCore" "${PODS_ROOT}/JPush" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat" "${PODS_ROOT}/WechatOpenSDK/WechatSDK1.8.2"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/JPush" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"FMDB" -l"MBProgressHUD" -l"SocialQQ" -l"SocialWeChat" -l"UMSocialLog" -l"WeChatSDK" -l"c++" -l"jcore-ios-1.1.7" -l"jpush-ios-3.0.8" -l"resolv" -l"sqlite3" -l"sqlite3.0" -l"z" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -weak_framework "UserNotifications"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
 PODS_ROOT = ${SRCROOT}/Pods

+ 6 - 6
ios/JianYuIOS/Pods/Target Support Files/Pods-JianYuIOS/Pods-JianYuIOS.release.xcconfig

@@ -1,10 +1,10 @@
 FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDK" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialUI"
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JCore" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare"
-LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/AFNetworking" "$PODS_CONFIGURATION_BUILD_DIR/FMDB" "$PODS_CONFIGURATION_BUILD_DIR/MBProgressHUD" "${PODS_ROOT}/JCore" "${PODS_ROOT}/JPush" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat"
-OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/JCore" -isystem "${PODS_ROOT}/Headers/Public/JPush" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare"
-OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"FMDB" -l"MBProgressHUD" -l"SocialQQ" -l"SocialWeChat" -l"UMSocialLog" -l"jcore-ios-1.1.7" -l"jpush-ios-3.0.8" -l"resolv" -l"sqlite3" -l"z" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -weak_framework "UserNotifications"
-PODS_BUILD_DIR = $BUILD_DIR
-PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/AFNetworking" "${PODS_ROOT}/Headers/Public/FMDB" "${PODS_ROOT}/Headers/Public/JPush" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/UMengUShare" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/AFNetworking" "${PODS_CONFIGURATION_BUILD_DIR}/FMDB" "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_ROOT}/JCore" "${PODS_ROOT}/JPush" "${PODS_ROOT}/UMengUShare/UShareSDK/UMSocialSDKPlugin" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/QQ" "${PODS_ROOT}/UMengUShare/UShareSDK/SocialLibraries/WeChat" "${PODS_ROOT}/WechatOpenSDK/WechatSDK1.8.2"
+OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/AFNetworking" -isystem "${PODS_ROOT}/Headers/Public/FMDB" -isystem "${PODS_ROOT}/Headers/Public/JPush" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/UMengUShare" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
+OTHER_LDFLAGS = $(inherited) -ObjC -l"AFNetworking" -l"FMDB" -l"MBProgressHUD" -l"SocialQQ" -l"SocialWeChat" -l"UMSocialLog" -l"WeChatSDK" -l"c++" -l"jcore-ios-1.1.7" -l"jpush-ios-3.0.8" -l"resolv" -l"sqlite3" -l"sqlite3.0" -l"z" -framework "CFNetwork" -framework "CoreFoundation" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Foundation" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "SystemConfiguration" -framework "UIKit" -framework "UMSocialCore" -framework "UMSocialNetwork" -framework "UShareUI" -weak_framework "UserNotifications"
+PODS_BUILD_DIR = ${BUILD_DIR}
+PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
 PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
 PODS_ROOT = ${SRCROOT}/Pods

+ 193 - 0
ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WXApi.h

@@ -0,0 +1,193 @@
+//
+//  WXApi.h
+//  所有Api接口
+//
+//  Created by Wechat on 12-2-28.
+//  Copyright (c) 2012年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "WXApiObject.h"
+
+
+#pragma mark - WXApiDelegate
+/*! @brief 接收并处理来自微信终端程序的事件消息
+ *
+ * 接收并处理来自微信终端程序的事件消息,期间微信界面会切换到第三方应用程序。
+ * WXApiDelegate 会在handleOpenURL:delegate:中使用并触发。
+ */
+@protocol WXApiDelegate <NSObject>
+@optional
+
+/*! @brief 收到一个来自微信的请求,第三方应用程序处理完后调用sendResp向微信发送结果
+ *
+ * 收到一个来自微信的请求,异步处理完成后必须调用sendResp发送处理结果给微信。
+ * 可能收到的请求有GetMessageFromWXReq、ShowMessageFromWXReq等。
+ * @param req 具体请求内容,是自动释放的
+ */
+-(void) onReq:(BaseReq*)req;
+
+
+
+/*! @brief 发送一个sendReq后,收到微信的回应
+ *
+ * 收到一个来自微信的处理结果。调用一次sendReq后会收到onResp。
+ * 可能收到的处理结果有SendMessageToWXResp、SendAuthResp等。
+ * @param resp具体的回应内容,是自动释放的
+ */
+-(void) onResp:(BaseResp*)resp;
+
+@end
+
+#pragma mark - WXApiLogDelegate
+
+@protocol WXApiLogDelegate <NSObject>
+
+-(void) onLog:(NSString*)log logLevel:(WXLogLevel)level;
+
+@end
+
+#pragma mark - WXApi
+
+/*! @brief 微信Api接口函数类
+ *
+ * 该类封装了微信终端SDK的所有接口
+ */
+@interface WXApi : NSObject
+
+/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
+ *
+ * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现,默认开启MTA数据上报。
+ * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。
+ * @attention 请保证在主线程中调用此函数
+ * @param appid 微信开发者ID
+ * @param typeFlag 应用支持打开的文件类型
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) registerApp:(NSString *)appid;
+
+/*! @brief WXApi的成员函数,向微信终端程序注册第三方应用。
+ *
+ * 需要在每次启动第三方应用程序时调用。第一次调用后,会在微信的可用应用列表中出现。
+ * iOS7及以上系统需要调起一次微信才会出现在微信的可用应用列表中。
+ * @attention 请保证在主线程中调用此函数
+ * @param appid 微信开发者ID
+ * @param isEnableMTA 是否支持MTA数据上报
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) registerApp:(NSString *)appid enableMTA:(BOOL)isEnableMTA;
+
+
+/*! @brief WXApi的成员函数,向微信终端程序注册应用支持打开的文件类型。
+ *
+ * 需要在每次启动第三方应用程序时调用。调用后并第一次成功分享数据到微信后,会在微信的可用应用列表中出现。
+ * @see registerApp
+ * @param typeFlag 应用支持打开的数据类型, enAppSupportContentFlag枚举类型 “|” 操作后结果
+ */
++(void) registerAppSupportContentFlag:(UInt64)typeFlag;
+
+
+
+/*! @brief 处理微信通过URL启动App时传递的数据
+ *
+ * 需要在 application:openURL:sourceApplication:annotation:或者application:handleOpenURL中调用。
+ * @param url 微信启动第三方应用时传递过来的URL
+ * @param delegate  WXApiDelegate对象,用来接收微信触发的消息。
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) handleOpenURL:(NSURL *) url delegate:(id<WXApiDelegate>) delegate;
+
+
+
+/*! @brief 检查微信是否已被用户安装
+ *
+ * @return 微信已安装返回YES,未安装返回NO。
+ */
++(BOOL) isWXAppInstalled;
+
+
+
+/*! @brief 判断当前微信的版本是否支持OpenApi
+ *
+ * @return 支持返回YES,不支持返回NO。
+ */
++(BOOL) isWXAppSupportApi;
+
+
+
+/*! @brief 获取微信的itunes安装地址
+ *
+ * @return 微信的安装地址字符串。
+ */
++(NSString *) getWXAppInstallUrl;
+
+
+
+/*! @brief 获取当前微信SDK的版本号
+ *
+ * @return 返回当前微信SDK的版本号
+ */
++(NSString *) getApiVersion;
+
+
+
+/*! @brief 打开微信
+ *
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) openWXApp;
+
+
+
+/*! @brief 发送请求到微信,等待微信返回onResp
+ *
+ * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持以下类型
+ * SendAuthReq、SendMessageToWXReq、PayReq等。
+ * @param req 具体的发送请求,在调用函数后,请自己释放。
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) sendReq:(BaseReq*)req;
+
+/*! @brief 发送Auth请求到微信,支持用户没安装微信,等待微信返回onResp
+ *
+ * 函数调用后,会切换到微信的界面。第三方应用程序等待微信返回onResp。微信在异步处理完成后一定会调用onResp。支持SendAuthReq类型。
+ * @param req 具体的发送请求,在调用函数后,请自己释放。
+ * @param viewController 当前界面对象。
+ * @param delegate  WXApiDelegate对象,用来接收微信触发的消息。
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) sendAuthReq:(SendAuthReq*)req viewController:(UIViewController*)viewController delegate:(id<WXApiDelegate>)delegate;
+
+
+/*! @brief 收到微信onReq的请求,发送对应的应答给微信,并切换到微信界面
+ *
+ * 函数调用后,会切换到微信的界面。第三方应用程序收到微信onReq的请求,异步处理该请求,完成后必须调用该函数。可能发送的相应有
+ * GetMessageFromWXResp、ShowMessageFromWXResp等。
+ * @param resp 具体的应答内容,调用函数后,请自己释放
+ * @return 成功返回YES,失败返回NO。
+ */
++(BOOL) sendResp:(BaseResp*)resp;
+
+
+/*! @brief WXApi的成员函数,接受微信的log信息。byBlock
+    注意1:SDK会强引用这个block,注意不要导致内存泄漏,注意不要导致内存泄漏
+    注意2:调用过一次startLog by block之后,如果再调用一次任意方式的startLoad,会释放上一次logBlock,不再回调上一个logBlock
+ *
+ *  @param level 打印log的级别
+ *  @param logBlock 打印log的回调block
+ */
++(void) startLogByLevel:(WXLogLevel)level logBlock:(WXLogBolock)logBlock;
+
+/*! @brief WXApi的成员函数,接受微信的log信息。byDelegate 
+    注意1:sdk会弱引用这个delegate,这里可加任意对象为代理,不需要与WXApiDelegate同一个对象
+    注意2:调用过一次startLog by delegate之后,再调用一次任意方式的startLoad,不会再回调上一个logDelegate对象
+ *  @param level 打印log的级别
+ *  @param logDelegate 打印log的回调代理,
+ */
++ (void)startLogByLevel:(WXLogLevel)level logDelegate:(id<WXApiLogDelegate>)logDelegate;
+
+/*! @brief 停止打印log,会清理block或者delegate为空,释放block
+ *  @param 
+ */
++ (void)stopLog;
+@end

+ 959 - 0
ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WXApiObject.h

@@ -0,0 +1,959 @@
+//
+//  MMApiObject.h
+//  Api对象,包含所有接口和对象数据定义
+//
+//  Created by Wechat on 12-2-28.
+//  Copyright (c) 2012年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+/*! @brief 错误码
+ *
+ */
+enum  WXErrCode {
+    WXSuccess           = 0,    /**< 成功    */
+    WXErrCodeCommon     = -1,   /**< 普通错误类型    */
+    WXErrCodeUserCancel = -2,   /**< 用户点击取消并返回    */
+    WXErrCodeSentFail   = -3,   /**< 发送失败    */
+    WXErrCodeAuthDeny   = -4,   /**< 授权失败    */
+    WXErrCodeUnsupport  = -5,   /**< 微信不支持    */
+};
+
+
+
+/*! @brief 请求发送场景
+ *
+ */
+enum WXScene {
+    WXSceneSession  = 0,        /**< 聊天界面    */
+    WXSceneTimeline = 1,        /**< 朋友圈      */
+    WXSceneFavorite = 2,        /**< 收藏       */
+};
+
+
+
+enum WXAPISupport {
+    WXAPISupportSession = 0,
+};
+
+
+
+/*! @brief 跳转profile类型
+ *
+ */
+enum WXBizProfileType{
+    WXBizProfileType_Normal = 0,    //**< 普通公众号  */
+    WXBizProfileType_Device = 1,    //**< 硬件公众号  */
+};
+
+/*! @brief 分享小程序类型
+ *
+ */
+typedef NS_ENUM(NSUInteger, WXMiniProgramType){
+    WXMiniProgramTypeRelease = 0,       //**< 正式版  */
+    WXMiniProgramTypeTest = 1,        //**< 开发版  */
+    WXMiniProgramTypePreview = 2,         //**< 体验版  */
+};
+
+/*! @brief 跳转mp网页类型
+ *
+ */
+enum WXMPWebviewType {
+    WXMPWebviewType_Ad = 0,        /**< 广告网页 **/
+};
+
+
+
+/*! @brief 应用支持接收微信的文件类型
+ *
+ */
+typedef NS_ENUM(UInt64, enAppSupportContentFlag)
+{
+    MMAPP_SUPPORT_NOCONTENT = 0x0,
+    MMAPP_SUPPORT_TEXT      = 0x1,
+    MMAPP_SUPPORT_PICTURE   = 0x2,
+    MMAPP_SUPPORT_LOCATION  = 0x4,
+    MMAPP_SUPPORT_VIDEO     = 0x8,
+    MMAPP_SUPPORT_AUDIO     = 0x10,
+    MMAPP_SUPPORT_WEBPAGE   = 0x20,
+    
+    // Suport File Type
+    MMAPP_SUPPORT_DOC  = 0x40,               // doc
+    MMAPP_SUPPORT_DOCX = 0x80,               // docx
+    MMAPP_SUPPORT_PPT  = 0x100,              // ppt
+    MMAPP_SUPPORT_PPTX = 0x200,              // pptx
+    MMAPP_SUPPORT_XLS  = 0x400,              // xls
+    MMAPP_SUPPORT_XLSX = 0x800,              // xlsx
+    MMAPP_SUPPORT_PDF  = 0x1000,             // pdf
+};
+
+/*! @brief log的级别
+ *
+ */
+typedef NS_ENUM(NSInteger,WXLogLevel){
+    WXLogLevelNormal = 0,      // 打印日常的日志
+    WXLogLevelDetail = 1,      // 打印详细的日志
+};
+
+
+/*! @brief 打印回调的block
+ *
+ */
+typedef void(^WXLogBolock)(NSString * log);
+
+#pragma mark - BaseReq
+/*! @brief 该类为微信终端SDK所有请求类的基类
+ *
+ */
+@interface BaseReq : NSObject
+
+/** 请求类型 */
+@property (nonatomic, assign) int type;
+/** 由用户微信号和AppID组成的唯一标识,发送请求时第三方程序必须填写,用于校验微信用户是否换号登录*/
+@property (nonatomic, retain) NSString* openID;
+
+@end
+
+
+
+#pragma mark - BaseResp
+/*! @brief 该类为微信终端SDK所有响应类的基类
+ *
+ */
+@interface BaseResp : NSObject
+/** 错误码 */
+@property (nonatomic, assign) int errCode;
+/** 错误提示字符串 */
+@property (nonatomic, retain) NSString *errStr;
+/** 响应类型 */
+@property (nonatomic, assign) int type;
+
+@end
+
+
+
+#pragma mark - WXMediaMessage
+@class WXMediaMessage;
+
+#ifndef BUILD_WITHOUT_PAY
+
+/*! @brief 第三方向微信终端发起支付的消息结构体
+ *
+ *  第三方向微信终端发起支付的消息结构体,微信终端处理后会向第三方返回处理结果
+ * @see PayResp
+ */
+@interface PayReq : BaseReq
+
+/** 商家向财付通申请的商家id */
+@property (nonatomic, retain) NSString *partnerId;
+/** 预支付订单 */
+@property (nonatomic, retain) NSString *prepayId;
+/** 随机串,防重发 */
+@property (nonatomic, retain) NSString *nonceStr;
+/** 时间戳,防重发 */
+@property (nonatomic, assign) UInt32 timeStamp;
+/** 商家根据财付通文档填写的数据和签名 */
+@property (nonatomic, retain) NSString *package;
+/** 商家根据微信开放平台文档对数据做的签名 */
+@property (nonatomic, retain) NSString *sign;
+
+@end
+
+#endif
+
+
+#ifndef BUILD_WITHOUT_PAY
+
+#pragma mark - PayResp
+/*! @brief 微信终端返回给第三方的关于支付结果的结构体
+ *
+ *  微信终端返回给第三方的关于支付结果的结构体
+ */
+@interface PayResp : BaseResp
+
+/** 财付通返回给商家的信息 */
+@property (nonatomic, retain) NSString *returnKey;
+
+@end
+
+#endif
+
+
+
+#pragma mark - SendAuthReq
+/*! @brief 第三方程序向微信终端请求认证的消息结构
+ *
+ * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,
+ * 向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
+ * @see SendAuthResp
+ */
+@interface SendAuthReq : BaseReq
+/** 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。微信终端处理完后会向第三方程序发送一个处理结果。
+ * @see SendAuthResp
+ * @note scope字符串长度不能超过1K
+ */
+@property (nonatomic, retain) NSString* scope;
+/** 第三方程序本身用来标识其请求的唯一性,最后跳转回第三方程序时,由微信终端回传。
+ * @note state字符串长度不能超过1K
+ */
+@property (nonatomic, retain) NSString* state;
+@end
+
+
+
+#pragma mark - SendAuthResp
+/*! @brief 微信处理完第三方程序的认证和权限申请后向第三方程序回送的处理结果。
+ *
+ * 第三方程序要向微信申请认证,并请求某些权限,需要调用WXApi的sendReq成员函数,向微信终端发送一个SendAuthReq消息结构。
+ * 微信终端处理完后会向第三方程序发送一个SendAuthResp。
+ * @see onResp
+ */
+@interface SendAuthResp : BaseResp
+@property (nonatomic, retain) NSString* code;
+/** 第三方程序发送时用来标识其请求的唯一性的标志,由第三方程序调用sendReq时传入,由微信终端回传
+ * @note state字符串长度不能超过1K
+ */
+@property (nonatomic, retain) NSString* state;
+@property (nonatomic, retain) NSString* lang;
+@property (nonatomic, retain) NSString* country;
+@end
+
+
+
+#pragma mark - SendMessageToWXReq
+/*! @brief 第三方程序发送消息至微信终端程序的消息结构体
+ *
+ * 第三方程序向微信发送信息需要传入SendMessageToWXReq结构体,信息类型包括文本消息和多媒体消息,
+ * 分别对应于text和message成员。调用该方法后,微信处理完信息会向第三方程序发送一个处理结果。
+ * @see SendMessageToWXResp
+ */
+@interface SendMessageToWXReq : BaseReq
+/** 发送消息的文本内容
+ * @note 文本长度必须大于0且小于10K
+ */
+@property (nonatomic, retain) NSString* text;
+/** 发送消息的多媒体内容
+ * @see WXMediaMessage
+ */
+@property (nonatomic, retain) WXMediaMessage* message;
+/** 发送消息的类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
+@property (nonatomic, assign) BOOL bText;
+/** 发送的目标场景,可以选择发送到会话(WXSceneSession)或者朋友圈(WXSceneTimeline)。 默认发送到会话。
+ * @see WXScene
+ */
+@property (nonatomic, assign) int scene;
+
+@end
+
+
+
+#pragma mark - SendMessageToWXResp
+/*! @brief 微信终端向第三方程序返回的SendMessageToWXReq处理结果。
+ *
+ * 第三方程序向微信终端发送SendMessageToWXReq后,微信发送回来的处理结果,该结果用SendMessageToWXResp表示。
+ */
+@interface SendMessageToWXResp : BaseResp
+@property(nonatomic, retain) NSString* lang;
+@property(nonatomic, retain) NSString* country;
+@end
+
+
+
+#pragma mark - GetMessageFromWXReq
+/*! @brief 微信终端向第三方程序请求提供内容的消息结构体。
+ *
+ * 微信终端向第三方程序请求提供内容,微信终端会向第三方程序发送GetMessageFromWXReq消息结构体,
+ * 需要第三方程序调用sendResp返回一个GetMessageFromWXResp消息结构体。
+ */
+@interface GetMessageFromWXReq : BaseReq
+@property (nonatomic, retain) NSString* lang;
+@property (nonatomic, retain) NSString* country;
+@end
+
+
+
+#pragma mark - GetMessageFromWXResp
+/*! @brief 微信终端向第三方程序请求提供内容,第三方程序向微信终端返回的消息结构体。
+ *
+ * 微信终端向第三方程序请求提供内容,第三方程序调用sendResp向微信终端返回一个GetMessageFromWXResp消息结构体。
+ */
+@interface GetMessageFromWXResp : BaseResp
+/** 向微信终端提供的文本内容
+ @note 文本长度必须大于0且小于10K
+ */
+@property (nonatomic, retain) NSString* text;
+/** 向微信终端提供的多媒体内容。
+ * @see WXMediaMessage
+ */
+@property (nonatomic, retain) WXMediaMessage* message;
+/** 向微信终端提供内容的消息类型,包括文本消息和多媒体消息两种,两者只能选择其一,不能同时发送文本和多媒体消息 */
+@property (nonatomic, assign) BOOL bText;
+@end
+
+
+
+#pragma mark - ShowMessageFromWXReq
+/*! @brief 微信通知第三方程序,要求第三方程序显示的消息结构体。
+ *
+ * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
+ * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
+ */
+@interface ShowMessageFromWXReq : BaseReq
+/** 微信终端向第三方程序发送的要求第三方程序处理的多媒体内容
+ * @see WXMediaMessage
+ */
+@property (nonatomic, retain) WXMediaMessage* message;
+@property (nonatomic, retain) NSString* lang;
+@property (nonatomic, retain) NSString* country;
+@end
+
+
+
+#pragma mark - ShowMessageFromWXResp
+/*! @brief 微信通知第三方程序,要求第三方程序显示或处理某些消息,第三方程序处理完后向微信终端发送的处理结果。
+ *
+ * 微信需要通知第三方程序显示或处理某些内容时,会向第三方程序发送ShowMessageFromWXReq消息结构体。
+ * 第三方程序处理完内容后调用sendResp向微信终端发送ShowMessageFromWXResp。
+ */
+@interface ShowMessageFromWXResp : BaseResp
+@end
+
+
+
+#pragma mark - LaunchFromWXReq
+/*! @brief 微信终端打开第三方程序携带的消息结构体
+ *
+ *  微信向第三方发送的结构体,第三方不需要返回
+ */
+@interface LaunchFromWXReq : BaseReq
+@property (nonatomic, retain) WXMediaMessage* message;
+@property (nonatomic, retain) NSString* lang;
+@property (nonatomic, retain) NSString* country;
+@end
+
+#pragma mark - OpenTempSessionReq
+/* ! @brief 第三方通知微信,打开临时会话
+ *
+ * 第三方通知微信,打开临时会话
+ */
+@interface OpenTempSessionReq : BaseReq
+/** 需要打开的用户名
+ * @attention 长度不能超过512字节
+ */
+@property (nonatomic, retain) NSString* username;
+/** 开发者自定义参数,拉起临时会话后会发给开发者后台,可以用于识别场景
+ * @attention 长度不能超过32位
+ */
+@property (nonatomic, retain) NSString*  sessionFrom;
+@end
+
+#pragma mark - OpenTempSessionResp
+/*! @brief 微信终端向第三方程序返回的OpenTempSessionReq处理结果。
+ *
+ * 第三方程序向微信终端发送OpenTempSessionReq后,微信发送回来的处理结果,该结果用OpenTempSessionResp表示。
+ */
+@interface OpenTempSessionResp : BaseResp
+
+@end
+
+#pragma mark - OpenWebviewReq
+/* ! @brief 第三方通知微信启动内部浏览器,打开指定网页
+ *
+ *  第三方通知微信启动内部浏览器,打开指定Url对应的网页
+ */
+@interface OpenWebviewReq : BaseReq
+/** 需要打开的网页对应的Url
+ * @attention 长度不能超过1024
+ */
+@property(nonatomic,retain)NSString* url;
+
+@end
+
+#pragma mark - OpenWebviewResp
+/*! @brief 微信终端向第三方程序返回的OpenWebviewReq处理结果
+ *
+ * 第三方程序向微信终端发送OpenWebviewReq后,微信发送回来的处理结果,该结果用OpenWebviewResp表示
+ */
+@interface OpenWebviewResp : BaseResp
+
+@end
+
+#pragma mark - OpenRankListReq
+/* ! @brief 第三方通知微信,打开硬件排行榜
+ *
+ * 第三方通知微信,打开硬件排行榜
+ */
+@interface OpenRankListReq : BaseReq
+
+@end
+
+#pragma mark - OpenRanklistResp
+/*! @brief 微信终端向第三方程序返回的OpenRankListReq处理结果。
+ *
+ * 第三方程序向微信终端发送OpenRankListReq后,微信发送回来的处理结果,该结果用OpenRankListResp表示。
+ */
+@interface OpenRankListResp : BaseResp
+
+@end
+
+#pragma mark - JumpToBizProfileReq
+/* ! @brief 第三方通知微信,打开指定微信号profile页面
+ *
+ * 第三方通知微信,打开指定微信号profile页面
+ */
+@interface JumpToBizProfileReq : BaseReq
+/** 跳转到该公众号的profile
+ * @attention 长度不能超过512字节
+ */
+@property (nonatomic, retain) NSString* username;
+/** 如果用户加了该公众号为好友,extMsg会上传到服务器
+ * @attention 长度不能超过1024字节
+ */
+@property (nonatomic, retain) NSString* extMsg;
+/**
+ * 跳转的公众号类型
+ * @see WXBizProfileType
+ */
+@property (nonatomic, assign) int profileType;
+@end
+
+
+
+#pragma mark - JumpToBizWebviewReq
+/* ! @brief 第三方通知微信,打开指定usrname的profile网页版
+ *
+ */
+@interface JumpToBizWebviewReq : BaseReq
+/** 跳转的网页类型,目前只支持广告页
+ * @see WXMPWebviewType
+ */
+@property(nonatomic, assign) int webType;
+/** 跳转到该公众号的profile网页版
+ * @attention 长度不能超过512字节
+ */
+@property(nonatomic, retain) NSString* tousrname;
+/** 如果用户加了该公众号为好友,extMsg会上传到服务器
+ * @attention 长度不能超过1024字节
+ */
+@property(nonatomic, retain) NSString* extMsg;
+
+@end
+
+#pragma mark - WXCardItem
+
+@interface WXCardItem : NSObject
+/** 卡id
+ * @attention 长度不能超过1024字节
+ */
+@property (nonatomic,retain) NSString* cardId;
+/** ext信息
+ * @attention 长度不能超过2024字节
+ */
+@property (nonatomic,retain) NSString* extMsg;
+/**
+ * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
+ */
+@property (nonatomic,assign) UInt32 cardState;
+/**
+ * @attention req不需要填,chooseCard返回的。
+ */
+@property (nonatomic,retain) NSString* encryptCode;
+/**
+ * @attention req不需要填,chooseCard返回的。
+ */
+@property (nonatomic,retain) NSString* appID;
+@end;
+
+#pragma mark - WXInvoiceItem
+
+@interface WXInvoiceItem : NSObject
+/** 卡id
+ * @attention 长度不能超过1024字节
+ */
+@property (nonatomic,retain) NSString* cardId;
+/** ext信息
+ * @attention 长度不能超过2024字节
+ */
+@property (nonatomic,retain) NSString* extMsg;
+/**
+ * @attention 卡的状态,req不需要填。resp:0为未添加,1为已添加。
+ */
+@property (nonatomic,assign) UInt32 cardState;
+/**
+ * @attention req不需要填,chooseCard返回的。
+ */
+@property (nonatomic,retain) NSString* encryptCode;
+/**
+ * @attention req不需要填,chooseCard返回的。
+ */
+@property (nonatomic,retain) NSString* appID;
+
+@end
+
+#pragma mark - AddCardToWXCardPackageReq
+/* ! @brief 请求添加卡券至微信卡包
+ *
+ */
+
+@interface AddCardToWXCardPackageReq : BaseReq
+/** 卡列表
+ * @attention 个数不能超过40个 类型WXCardItem
+ */
+@property (nonatomic,retain) NSArray* cardAry;
+
+@end
+
+
+#pragma mark - AddCardToWXCardPackageResp
+/** ! @brief 微信返回第三方添加卡券结果
+ *
+ */
+
+@interface AddCardToWXCardPackageResp : BaseResp
+/** 卡列表
+ * @attention 个数不能超过40个 类型WXCardItem
+ */
+@property (nonatomic,retain) NSArray* cardAry;
+@end
+
+#pragma mark - WXChooseCardReq
+/* ! @brief 请求从微信选取卡券
+ *
+ */
+
+@interface WXChooseCardReq : BaseReq
+@property(nonatomic, strong) NSString *appID;
+@property(nonatomic, assign) UInt32 shopID;
+@property(nonatomic, assign) UInt32 canMultiSelect;
+@property(nonatomic, strong) NSString *cardType;
+@property(nonatomic, strong) NSString *cardTpID;
+@property(nonatomic, strong) NSString *signType;
+@property(nonatomic, strong) NSString *cardSign;
+@property(nonatomic, assign) UInt32 timeStamp;
+@property(nonatomic, strong) NSString *nonceStr;
+@end
+
+
+#pragma mark - WXChooseCardResp
+/** ! @brief 微信返回第三方请求选择卡券结果
+ *
+ */
+
+@interface WXChooseCardResp : BaseResp
+@property (nonatomic,retain) NSArray* cardAry;
+@end
+
+
+#pragma mark - WXChooseInvoiceReq
+/* ! @brief 请求从微信选取发票
+ *
+ */
+@interface WXChooseInvoiceReq : BaseReq
+@property (nonatomic, strong) NSString *appID;
+@property (nonatomic, assign) UInt32 shopID;
+@property (nonatomic, strong) NSString *signType;
+@property (nonatomic, strong) NSString *cardSign;
+@property (nonatomic, assign) UInt32 timeStamp;
+@property (nonatomic, strong) NSString *nonceStr;
+@end
+
+#pragma mark - WXChooseInvoiceResp
+/** ! @brief 微信返回第三方请求选择发票结果
+ *
+ */
+@interface WXChooseInvoiceResp : BaseResp
+@property (nonatomic, strong) NSArray* cardAry;
+@end
+
+#pragma mark - WXSubscriptionReq
+@interface WXSubscribeMsgReq : BaseReq
+@property (nonatomic, assign) UInt32 scene;
+@property (nonatomic, strong) NSString * templateId;
+@property (nonatomic, strong) NSString * reserved;
+@end
+
+#pragma mark - WXSubscriptionReq
+@interface WXSubscribeMsgResp : BaseResp
+
+@property (nonatomic, strong) NSString *templateId;
+@property (nonatomic, assign) UInt32 scene;
+@property (nonatomic, strong) NSString *action;
+@property (nonatomic, strong) NSString * reserved;
+@property (nonatomic, strong) NSString * openId;
+
+@end
+
+#pragma mark - WXinvoiceAuthInsertReq
+@interface WXInvoiceAuthInsertReq : BaseReq
+
+@property (nonatomic, strong) NSString *urlString;
+
+@end
+
+#pragma mark - WXinvoiceAuthInsertResp
+
+@interface WXInvoiceAuthInsertResp : BaseResp
+
+@property (nonatomic, strong) NSString * wxOrderId;
+
+@end
+
+#pragma mark - WXNontaxPayReq
+@interface WXNontaxPayReq:BaseReq
+
+@property (nonatomic, strong) NSString *urlString;
+
+@end
+
+#pragma mark - WXNontaxPayResp
+@interface WXNontaxPayResp : BaseResp
+
+@property (nonatomic, strong) NSString *wxOrderId;
+
+@end
+
+#pragma mark - WXPayInsuranceReq
+@interface WXPayInsuranceReq : BaseReq
+
+@property (nonatomic, strong) NSString *urlString;
+
+@end
+
+#pragma mark - WXPayInsuranceResp
+@interface WXPayInsuranceResp : BaseResp
+
+@property (nonatomic, strong) NSString *wxOrderId;
+
+@end
+
+#pragma mark - WXMediaMessage
+
+
+#pragma mark - WXMediaMessage
+
+/*! @brief 多媒体消息结构体
+ *
+ * 用于微信终端和第三方程序之间传递消息的多媒体消息内容
+ */
+@interface WXMediaMessage : NSObject
+
++(WXMediaMessage *) message;
+
+/** 标题
+ * @note 长度不能超过512字节
+ */
+@property (nonatomic, retain) NSString *title;
+/** 描述内容
+ * @note 长度不能超过1K
+ */
+@property (nonatomic, retain) NSString *description;
+/** 缩略图数据
+ * @note 大小不能超过32K
+ */
+@property (nonatomic, retain) NSData   *thumbData;
+/**
+ * @note 长度不能超过64字节
+ */
+@property (nonatomic, retain) NSString *mediaTagName;
+/**
+ *
+ */
+@property (nonatomic, retain) NSString *messageExt;
+@property (nonatomic, retain) NSString *messageAction;
+/**
+ * 多媒体数据对象,可以为WXImageObject,WXMusicObject,WXVideoObject,WXWebpageObject等。
+ */
+@property (nonatomic, retain) id        mediaObject;
+
+/*! @brief 设置消息缩略图的方法
+ *
+ * @param image 缩略图
+ * @note 大小不能超过32K
+ */
+- (void) setThumbImage:(UIImage *)image;
+
+@end
+
+
+
+#pragma mark - WXImageObject
+/*! @brief 多媒体消息中包含的图片数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的图片数据对象。
+ * @note imageData成员不能为空
+ * @see WXMediaMessage
+ */
+@interface WXImageObject : NSObject
+/*! @brief 返回一个WXImageObject对象
+ *
+ * @note 返回的WXImageObject对象是自动释放的
+ */
++(WXImageObject *) object;
+
+/** 图片真实数据内容
+ * @note 大小不能超过10M
+ */
+@property (nonatomic, retain) NSData    *imageData;
+
+@end
+
+
+#pragma mark - WXMusicObject
+/*! @brief 多媒体消息中包含的音乐数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的音乐数据对象。
+ * @note musicUrl和musicLowBandUrl成员不能同时为空。
+ * @see WXMediaMessage
+ */
+@interface WXMusicObject : NSObject
+/*! @brief 返回一个WXMusicObject对象
+ *
+ * @note 返回的WXMusicObject对象是自动释放的
+ */
++(WXMusicObject *) object;
+
+/** 音乐网页的url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *musicUrl;
+/** 音乐lowband网页的url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *musicLowBandUrl;
+/** 音乐数据url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *musicDataUrl;
+
+/**音乐lowband数据url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *musicLowBandDataUrl;
+
+@end
+
+
+
+#pragma mark - WXVideoObject
+/*! @brief 多媒体消息中包含的视频数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的视频数据对象。
+ * @note videoUrl和videoLowBandUrl不能同时为空。
+ * @see WXMediaMessage
+ */
+@interface WXVideoObject : NSObject
+/*! @brief 返回一个WXVideoObject对象
+ *
+ * @note 返回的WXVideoObject对象是自动释放的
+ */
++(WXVideoObject *) object;
+
+/** 视频网页的url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *videoUrl;
+/** 视频lowband网页的url地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *videoLowBandUrl;
+
+@end
+
+
+
+#pragma mark - WXWebpageObject
+/*! @brief 多媒体消息中包含的网页数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的网页数据对象。
+ * @see WXMediaMessage
+ */
+@interface WXWebpageObject : NSObject
+/*! @brief 返回一个WXWebpageObject对象
+ *
+ * @note 返回的WXWebpageObject对象是自动释放的
+ */
++(WXWebpageObject *) object;
+
+/** 网页的url地址
+ * @note 不能为空且长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *webpageUrl;
+
+@end
+
+
+
+#pragma mark - WXAppExtendObject
+/*! @brief 多媒体消息中包含的App扩展数据对象
+ *
+ * 第三方程序向微信终端发送包含WXAppExtendObject的多媒体消息,
+ * 微信需要处理该消息时,会调用该第三方程序来处理多媒体消息内容。
+ * @note url,extInfo和fileData不能同时为空
+ * @see WXMediaMessage
+ */
+@interface WXAppExtendObject : NSObject
+/*! @brief 返回一个WXAppExtendObject对象
+ *
+ * @note 返回的WXAppExtendObject对象是自动释放的
+ */
++(WXAppExtendObject *) object;
+
+/** 若第三方程序不存在,微信终端会打开该url所指的App下载地址
+ * @note 长度不能超过10K
+ */
+@property (nonatomic, retain) NSString *url;
+/** 第三方程序自定义简单数据,微信终端会回传给第三方程序处理
+ * @note 长度不能超过2K
+ */
+@property (nonatomic, retain) NSString *extInfo;
+/** App文件数据,该数据发送给微信好友,微信好友需要点击后下载数据,微信终端会回传给第三方程序处理
+ * @note 大小不能超过10M
+ */
+@property (nonatomic, retain) NSData   *fileData;
+
+@end
+
+
+
+#pragma mark - WXEmoticonObject
+/*! @brief 多媒体消息中包含的表情数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的表情数据对象。
+ * @see WXMediaMessage
+ */
+@interface WXEmoticonObject : NSObject
+
+/*! @brief 返回一个WXEmoticonObject对象
+ *
+ * @note 返回的WXEmoticonObject对象是自动释放的
+ */
++(WXEmoticonObject *) object;
+
+/** 表情真实数据内容
+ * @note 大小不能超过10M
+ */
+@property (nonatomic, retain) NSData    *emoticonData;
+
+@end
+
+
+
+#pragma mark - WXFileObject
+/*! @brief 多媒体消息中包含的文件数据对象
+ *
+ * @see WXMediaMessage
+ */
+@interface WXFileObject : NSObject
+
+/*! @brief 返回一个WXFileObject对象
+ *
+ * @note 返回的WXFileObject对象是自动释放的
+ */
++(WXFileObject *) object;
+
+/** 文件后缀名
+ * @note 长度不超过64字节
+ */
+@property (nonatomic, retain) NSString  *fileExtension;
+
+/** 文件真实数据内容
+ * @note 大小不能超过10M
+ */
+@property (nonatomic, retain) NSData    *fileData;
+
+@end
+
+
+#pragma mark - WXLocationObject
+/*! @brief 多媒体消息中包含的地理位置数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的地理位置数据对象。
+ * @see WXMediaMessage
+ */
+@interface WXLocationObject : NSObject
+
+/*! @brief 返回一个WXLocationObject对象
+ *
+ * @note 返回的WXLocationObject对象是自动释放的
+ */
++(WXLocationObject *) object;
+
+/** 地理位置信息
+ * @note 经纬度
+ */
+@property (nonatomic, assign) double lng; //经度
+@property (nonatomic, assign) double lat; //纬度
+
+@end
+
+@interface WXMiniProgramObject : NSObject
+
+/*! @brief WXMiniProgramObject对象
+ *
+ * @note 返回的WXMiniProgramObject对象是自动释放的
+ */
++(WXMiniProgramObject *) object;
+
+@property (nonatomic, strong) NSString *webpageUrl; //低版本网页链接
+
+@property (nonatomic, strong) NSString *userName;   //小程序username
+
+@property (nonatomic, strong) NSString *path;       //小程序页面的路径
+
+@property (nonatomic, strong) NSData *hdImageData;   // 小程序新版本的预览图 128k
+
+@property (nonatomic, assign) BOOL withShareTicket;   //是否使用带 shareTicket 的转发
+
+@property (nonatomic, assign) WXMiniProgramType miniProgramType;  // 分享小程序的版本(正式,开发,体验)
+
+@end
+
+#pragma mark - WXLaunchMiniProgramReq
+
+/*! @brief WXLaunchMiniProgramReq对象, 可实现通过sdk拉起微信小程序
+ *
+ * @note 返回的WXLaunchMiniProgramReq对象是自动释放的
+ */
+@interface WXLaunchMiniProgramReq : BaseReq
+
++(WXLaunchMiniProgramReq *) object;
+
+@property (nonatomic, strong) NSString *userName;   //拉起的小程序的username
+@property (nonatomic, strong) NSString *path;       //拉起小程序页面的路径,不填默认拉起小程序首页
+@property (nonatomic, assign) WXMiniProgramType miniProgramType; //拉起小程序的类型
+
+@end
+
+#pragma mark - WXLaunchMiniProgramResp
+/*! @brief 微信终端向第三方程序返回的WXLaunchMiniProgramReq处理结果。
+ *
+ * 第三方程序向微信终端发送WXLaunchMiniProgramReq后,微信发送回来的处理结果,该结果用WXLaunchMiniProgramResp表示。
+ */
+@interface WXLaunchMiniProgramResp : BaseResp
+
+@property (nonatomic, retain) NSString *extMsg;
+
+@end
+
+
+#pragma mark - WXTextObject
+/*! @brief 多媒体消息中包含的文本数据对象
+ *
+ * 微信终端和第三方程序之间传递消息中包含的文本数据对象。
+ * @see WXMediaMessage
+ */
+@interface WXTextObject : NSObject
+
+/*! @brief 返回一个WXTextObject对象
+ *
+ * @note 返回的WXTextObject对象是自动释放的
+ */
++(WXTextObject *) object;
+
+/** 地理位置信息
+ * @note 文本内容
+ */
+@property (nonatomic, retain) NSString *contentText;
+
+@end

+ 64 - 0
ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/WechatAuthSDK.h

@@ -0,0 +1,64 @@
+//
+//  WechatAuthSDK.h
+//  WechatAuthSDK
+//
+//  Created by 李凯 on 13-11-29.
+//  Copyright (c) 2013年 Tencent. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <UIKit/UIKit.h>
+
+enum  AuthErrCode {
+    WechatAuth_Err_Ok = 0,  //Auth成功
+    WechatAuth_Err_NormalErr = -1,  //普通错误
+    WechatAuth_Err_NetworkErr = -2, //网络错误
+    WechatAuth_Err_GetQrcodeFailed = -3,    //获取二维码失败
+    WechatAuth_Err_Cancel = -4,     //用户取消授权
+    WechatAuth_Err_Timeout = -5,    //超时
+};
+
+@protocol WechatAuthAPIDelegate<NSObject>
+@optional
+
+- (void)onAuthGotQrcode:(UIImage *)image;  //得到二维码
+- (void)onQrcodeScanned;    //二维码被扫描
+- (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode;    //成功登录
+
+@end
+
+@interface WechatAuthSDK : NSObject{
+    NSString *_sdkVersion;
+    __weak id<WechatAuthAPIDelegate> _delegate;
+}
+
+@property(nonatomic, weak) id<WechatAuthAPIDelegate> delegate;
+@property(nonatomic, readonly) NSString *sdkVersion;   //authSDK版本号
+
+/*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
+ *
+ * @param appId 微信开发者ID
+ * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同
+ * @param timeStamp 时间戳
+ * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔
+ * @param signature 签名
+ * @param schemeData 会在扫码后拼在scheme后
+ * @return 成功返回YES,失败返回NO
+    注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。
+ */
+
+- (BOOL)Auth:(NSString *)appId
+    nonceStr:(NSString *)nonceStr
+   timeStamp:(NSString*)timeStamp
+       scope:(NSString *)scope
+   signature:(NSString *)signature
+  schemeData:(NSString *)schemeData;
+
+
+/*! @brief 暂停登录请求
+ *
+ * @return 成功返回YES,失败返回NO。
+ */
+- (BOOL)StopAuth;
+
+@end

BIN
ios/JianYuIOS/Pods/WechatOpenSDK/WechatSDK1.8.2/libWeChatSDK.a


Some files were not shown because too many files changed in this diff