南鑫林 5 anni fa
parent
commit
4af015612e

+ 25 - 29
RainbowPlanet/RainbowPlanet.xcodeproj/project.pbxproj

@@ -342,8 +342,9 @@
 		A7D5F22922BB686200F8E9AF /* BaseJSWebBaseViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F22822BB686200F8E9AF /* BaseJSWebBaseViewController.swift */; };
 		A7D5F22B22BB687100F8E9AF /* BaseJSWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F22A22BB687100F8E9AF /* BaseJSWebViewController.swift */; };
 		A7D5F22D22BB689700F8E9AF /* WKWebViewEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F22C22BB689700F8E9AF /* WKWebViewEnum.swift */; };
-		A7D5F22F22BB93C100F8E9AF /* ExampleApp.html in Resources */ = {isa = PBXBuildFile; fileRef = A7D5F22E22BB93C100F8E9AF /* ExampleApp.html */; };
 		A7D5F23322BB9BE600F8E9AF /* CommunityMyInvitationViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F23222BB9BE600F8E9AF /* CommunityMyInvitationViewController.swift */; };
+		A7D5F24D22BC720000F8E9AF /* WVJBModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F24C22BC720000F8E9AF /* WVJBModel.swift */; };
+		A7D5F25022BC7B3700F8E9AF /* WebViewJavascriptBridgeManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7D5F24F22BC7B3700F8E9AF /* WebViewJavascriptBridgeManager.swift */; };
 		A7DC467F22783A47001F3EFC /* EditExpressAddressTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */; };
 		A7DF50D622A4E8B400998908 /* OrderDetailProductTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF50D522A4E8B400998908 /* OrderDetailProductTableViewCell.swift */; };
 		A7DF50D822A4FAFC00998908 /* ProductDetailEvaluationImageCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7DF50D722A4FAFC00998908 /* ProductDetailEvaluationImageCollectionViewCell.swift */; };
@@ -457,7 +458,6 @@
 		BD1DC6C9228D005000B89C57 /* OrderCreateParameterModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6C8228D005000B89C57 /* OrderCreateParameterModel.swift */; };
 		BD1DC6CB228D157000B89C57 /* OrderCreateBackModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6CA228D157000B89C57 /* OrderCreateBackModel.swift */; };
 		BD1DC6CD228D160D00B89C57 /* OrderPurchaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1DC6CC228D160D00B89C57 /* OrderPurchaseModel.swift */; };
-		BD1EF11722BA637D0052D87A /* PublishVideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1EF11622BA637D0052D87A /* PublishVideoView.swift */; };
 		BD1FC17F22B08D3C00D55081 /* CommunityMyFollowTopicController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1FC17E22B08D3C00D55081 /* CommunityMyFollowTopicController.swift */; };
 		BD1FC18122B08D7A00D55081 /* CommunityMyFollowTopicCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1FC18022B08D7A00D55081 /* CommunityMyFollowTopicCell.swift */; };
 		BD1FC18622B09F9800D55081 /* CommunitySubCommentController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD1FC18522B09F9800D55081 /* CommunitySubCommentController.swift */; };
@@ -491,11 +491,8 @@
 		BD7AB841228438C80030646A /* OrderPaySelfPickAddressCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB840228438C80030646A /* OrderPaySelfPickAddressCell.swift */; };
 		BD7AB8432284390B0030646A /* OrderPaySelfPickInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8422284390B0030646A /* OrderPaySelfPickInfoCell.swift */; };
 		BD7AB8452284398A0030646A /* OrderPaySelfPickAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD7AB8442284398A0030646A /* OrderPaySelfPickAddInfoCell.swift */; };
-		BD8CAE3822BBA58900873C45 /* FilterResource.bundle in Resources */ = {isa = PBXBuildFile; fileRef = BD8CAE3722BBA58900873C45 /* FilterResource.bundle */; };
-		BD8CAE3A22BBB5ED00873C45 /* PublishFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD8CAE3922BBB5ED00873C45 /* PublishFilterView.swift */; };
 		BD929CCA22B8CFB10098C139 /* AliyunPathManager.m in Sources */ = {isa = PBXBuildFile; fileRef = BD929CC822B8CFB10098C139 /* AliyunPathManager.m */; };
 		BD929CCE22B904A30098C139 /* PublishViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CCD22B904A30098C139 /* PublishViewController.swift */; };
-		BD929CD422B906C10098C139 /* PublishVideoRecorderController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */; };
 		BDAA40F7228E947500CF841D /* OrderApplyRefundAccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */; };
 		BDAA40F9228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40F8228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift */; };
 		BDAA40FB228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */; };
@@ -904,8 +901,9 @@
 		A7D5F22822BB686200F8E9AF /* BaseJSWebBaseViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseJSWebBaseViewController.swift; sourceTree = "<group>"; };
 		A7D5F22A22BB687100F8E9AF /* BaseJSWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseJSWebViewController.swift; sourceTree = "<group>"; };
 		A7D5F22C22BB689700F8E9AF /* WKWebViewEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKWebViewEnum.swift; sourceTree = "<group>"; };
-		A7D5F22E22BB93C100F8E9AF /* ExampleApp.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = ExampleApp.html; sourceTree = "<group>"; };
 		A7D5F23222BB9BE600F8E9AF /* CommunityMyInvitationViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityMyInvitationViewController.swift; sourceTree = "<group>"; };
+		A7D5F24C22BC720000F8E9AF /* WVJBModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WVJBModel.swift; sourceTree = "<group>"; };
+		A7D5F24F22BC7B3700F8E9AF /* WebViewJavascriptBridgeManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebViewJavascriptBridgeManager.swift; sourceTree = "<group>"; };
 		A7DC467E22783A47001F3EFC /* EditExpressAddressTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditExpressAddressTableViewCell.swift; sourceTree = "<group>"; };
 		A7DF50D522A4E8B400998908 /* OrderDetailProductTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderDetailProductTableViewCell.swift; sourceTree = "<group>"; };
 		A7DF50D722A4FAFC00998908 /* ProductDetailEvaluationImageCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductDetailEvaluationImageCollectionViewCell.swift; sourceTree = "<group>"; };
@@ -1023,7 +1021,6 @@
 		BD1DC6C8228D005000B89C57 /* OrderCreateParameterModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCreateParameterModel.swift; sourceTree = "<group>"; };
 		BD1DC6CA228D157000B89C57 /* OrderCreateBackModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderCreateBackModel.swift; sourceTree = "<group>"; };
 		BD1DC6CC228D160D00B89C57 /* OrderPurchaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPurchaseModel.swift; sourceTree = "<group>"; };
-		BD1EF11622BA637D0052D87A /* PublishVideoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishVideoView.swift; sourceTree = "<group>"; };
 		BD1FC17E22B08D3C00D55081 /* CommunityMyFollowTopicController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityMyFollowTopicController.swift; sourceTree = "<group>"; };
 		BD1FC18022B08D7A00D55081 /* CommunityMyFollowTopicCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunityMyFollowTopicCell.swift; sourceTree = "<group>"; };
 		BD1FC18522B09F9800D55081 /* CommunitySubCommentController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommunitySubCommentController.swift; sourceTree = "<group>"; };
@@ -1062,13 +1059,10 @@
 		BD7AB840228438C80030646A /* OrderPaySelfPickAddressCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPaySelfPickAddressCell.swift; sourceTree = "<group>"; };
 		BD7AB8422284390B0030646A /* OrderPaySelfPickInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPaySelfPickInfoCell.swift; sourceTree = "<group>"; };
 		BD7AB8442284398A0030646A /* OrderPaySelfPickAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderPaySelfPickAddInfoCell.swift; sourceTree = "<group>"; };
-		BD8CAE3722BBA58900873C45 /* FilterResource.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = FilterResource.bundle; sourceTree = "<group>"; };
-		BD8CAE3922BBB5ED00873C45 /* PublishFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishFilterView.swift; sourceTree = "<group>"; };
 		BD9052C044FD3AE4E62D3929 /* Pods-RainbowPlanet.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RainbowPlanet.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RainbowPlanet/Pods-RainbowPlanet.debug.xcconfig"; sourceTree = "<group>"; };
 		BD929CC822B8CFB10098C139 /* AliyunPathManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AliyunPathManager.m; sourceTree = "<group>"; };
 		BD929CC922B8CFB10098C139 /* AliyunPathManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AliyunPathManager.h; sourceTree = "<group>"; };
 		BD929CCD22B904A30098C139 /* PublishViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishViewController.swift; sourceTree = "<group>"; };
-		BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublishVideoRecorderController.swift; sourceTree = "<group>"; };
 		BDAA40F6228E947500CF841D /* OrderApplyRefundAccountCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundAccountCell.swift; sourceTree = "<group>"; };
 		BDAA40F8228E9ADA00CF841D /* OrderApplyRefundReasonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundReasonCell.swift; sourceTree = "<group>"; };
 		BDAA40FA228E9CC300CF841D /* OrderApplyRefundNoteInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OrderApplyRefundNoteInfoCell.swift; sourceTree = "<group>"; };
@@ -1501,8 +1495,8 @@
 		A719EE6622AF4374001AAC98 /* CommunityModule */ = {
 			isa = PBXGroup;
 			children = (
-				A7D5F23022BB9B6D00F8E9AF /* CommunityMyInvitation */,
 				A719EE6722AF438E001AAC98 /* Community */,
+				A7D5F23022BB9B6D00F8E9AF /* CommunityMyInvitation */,
 				A74322A522B8FE5F0017C367 /* CommunityFindFriends */,
 				A7C0FDFC22B66B3C00BC1E86 /* CommunityFeaturedTopics */,
 				BD1FC18222B09F4700D55081 /* CommunitySubComment */,
@@ -1854,6 +1848,7 @@
 		A72A725422321B9400B21995 /* Manager */ = {
 			isa = PBXGroup;
 			children = (
+				A7D5F24E22BC7B0500F8E9AF /* WebViewJavascriptBridgeManager */,
 				A73911AB229CD6080033177E /* AlamofireReachabilityManager */,
 				A7778CA52243A03400C7C47A /* IQKeyboardManagerSwiftManager */,
 				A72A730522321F1D00B21995 /* PayManager */,
@@ -2065,6 +2060,7 @@
 		A738D203225AEAD000EEE860 /* Model */ = {
 			isa = PBXGroup;
 			children = (
+				A7D5F24B22BC71ED00F8E9AF /* WVJB */,
 				A72A73722233966800B21995 /* RootModel */,
 				A71738A922898651000AEA6A /* ShopModel */,
 				A7B4E736228190810012914A /* CommonModel */,
@@ -2369,7 +2365,6 @@
 				A77F2C5E2231FB49001BD3F6 /* Products */,
 				618631008656829220117ED1 /* Pods */,
 				FA8AAFBADE8BD144A5C36FDB /* Frameworks */,
-				A7D5F24022BC643000F8E9AF /* Recovered References */,
 			);
 			sourceTree = "<group>";
 		};
@@ -2537,10 +2532,10 @@
 		A77F2CA92232010F001BD3F6 /* MineModule */ = {
 			isa = PBXGroup;
 			children = (
+				A77F2CAA2232010F001BD3F6 /* Mine */,
 				A790705922B9B663008CE279 /* ModifyData */,
 				A7D07CB822B73E5500186014 /* PersonalCenter */,
 				A743229C22B8D13B0017C367 /* MyFollowAndFan */,
-				A77F2CAA2232010F001BD3F6 /* Mine */,
 				A7CC75302271AB6C003C4F38 /* AddressManager */,
 				A71AA50D22721537008FF1A5 /* ExpressAddressList */,
 				A71AA51622721980008FF1A5 /* EditExpressAddress */,
@@ -3435,7 +3430,6 @@
 		A7D5F21D22BB1F6D00F8E9AF /* CommunityPlanet */ = {
 			isa = PBXGroup;
 			children = (
-				A7D5F22E22BB93C100F8E9AF /* ExampleApp.html */,
 				A7D5F21E22BB1FA800F8E9AF /* CommunityPlanetViewController.swift */,
 			);
 			path = CommunityPlanet;
@@ -3457,24 +3451,29 @@
 			path = ViewController;
 			sourceTree = "<group>";
 		};
-		A7D5F24022BC643000F8E9AF /* Recovered References */ = {
+		A7D5F24822BC64B600F8E9AF /* AliyunVideoSDK */ = {
 			isa = PBXGroup;
 			children = (
-				BD1EF11622BA637D0052D87A /* PublishVideoView.swift */,
-				BD8CAE3922BBB5ED00873C45 /* PublishFilterView.swift */,
-				BD929CD322B906C10098C139 /* PublishVideoRecorderController.swift */,
-				BD8CAE3722BBA58900873C45 /* FilterResource.bundle */,
+				BD01B1F522BC670A00CE9F36 /* FilterResource.bundle */,
 			);
-			name = "Recovered References";
+			name = AliyunVideoSDK;
+			path = ../../../../../../Desktop/AliyunVideoSDK;
 			sourceTree = "<group>";
 		};
-		A7D5F24822BC64B600F8E9AF /* AliyunVideoSDK */ = {
+		A7D5F24B22BC71ED00F8E9AF /* WVJB */ = {
 			isa = PBXGroup;
 			children = (
-				BD01B1F522BC670A00CE9F36 /* FilterResource.bundle */,
+				A7D5F24C22BC720000F8E9AF /* WVJBModel.swift */,
 			);
-			name = AliyunVideoSDK;
-			path = ../../../../../../Desktop/AliyunVideoSDK;
+			path = WVJB;
+			sourceTree = "<group>";
+		};
+		A7D5F24E22BC7B0500F8E9AF /* WebViewJavascriptBridgeManager */ = {
+			isa = PBXGroup;
+			children = (
+				A7D5F24F22BC7B3700F8E9AF /* WebViewJavascriptBridgeManager.swift */,
+			);
+			path = WebViewJavascriptBridgeManager;
 			sourceTree = "<group>";
 		};
 		A7DF50D922A556C300998908 /* BrowsePictures */ = {
@@ -4533,7 +4532,6 @@
 			files = (
 				A7CC74DE22703B4A003C4F38 /* MineModule.xcassets in Resources */,
 				A7BF202422B392D600396DB3 /* CommunityModule.xcassets in Resources */,
-				BD8CAE3822BBA58900873C45 /* FilterResource.bundle in Resources */,
 				A71AF0BE226F1792001730FE /* ShoppingMallModule.xcassets in Resources */,
 				A7931DFE22AF827600297D0A /* Localizable.strings in Resources */,
 				A7778C9722438F5D00C7C47A /* AlipaySDK.bundle in Resources */,
@@ -4543,7 +4541,6 @@
 				BD108C9B22A60C3300837DAB /* HGImage.storyboard in Resources */,
 				A7FF1577228C824300A85748 /* OrderModule.xcassets in Resources */,
 				BD01B1F622BC670A00CE9F36 /* FilterResource.bundle in Resources */,
-				A7D5F22F22BB93C100F8E9AF /* ExampleApp.html in Resources */,
 				A7931E0822AF855E00297D0A /* RegisterLoginModule.xcassets in Resources */,
 				A7778C9922438F5D00C7C47A /* README.txt in Resources */,
 				A7BF202722B3930100396DB3 /* MessageModule.xcassets in Resources */,
@@ -4797,7 +4794,6 @@
 				A754150F224CACF9002480B5 /* SwiftSign.swift in Sources */,
 				A71AF0BA226F00F8001730FE /* SearchResultView.swift in Sources */,
 				A77F2CB52232010F001BD3F6 /* ShoppingMallViewController.swift in Sources */,
-				BD1EF11722BA637D0052D87A /* PublishVideoView.swift in Sources */,
 				A7D07CD622B78BC300186014 /* PersonViewUserAndOtherListCollectionViewCell.swift in Sources */,
 				A71AA513227215B5008FF1A5 /* ExpressAddressListView.swift in Sources */,
 				A7B4E723228154750012914A /* ProductFloorBannerView.swift in Sources */,
@@ -4875,6 +4871,7 @@
 				A70B2C6D2288815E00B2449F /* PickViewOneComponentsView.swift in Sources */,
 				BDD4FB1422840954006FE833 /* ShoppingCartOrderPayView.swift in Sources */,
 				A70B2C222286BF5900B2449F /* ProductDetailTableViewHeaderView.swift in Sources */,
+				A7D5F24D22BC720000F8E9AF /* WVJBModel.swift in Sources */,
 				A74322A222B8D5A90017C367 /* SearchUserLitTableViewCell.swift in Sources */,
 				A7CC75432271E038003C4F38 /* SelfMentionContactsListViewController.swift in Sources */,
 				BDF47D872282C92200941AB9 /* ShoppingCartListTableViewHeader.swift in Sources */,
@@ -4892,7 +4889,6 @@
 				BD20F1D32283D0ED00677D8E /* OrderFinishPaySuccessCell.swift in Sources */,
 				A7E19FAC22BA2D01009BCCE1 /* SearchTopicListViewController.swift in Sources */,
 				A71AA52822732173008FF1A5 /* SwiftMoyaNetWorkServiceConfig.swift in Sources */,
-				BD8CAE3A22BBB5ED00873C45 /* PublishFilterView.swift in Sources */,
 				A70B2C732289019200B2449F /* ProductDetailSkuView.swift in Sources */,
 				A70B2C4322883B4E00B2449F /* ProductDetailShopTableViewCell.swift in Sources */,
 				A70B2C102286A3BC00B2449F /* ProductDetailModel.swift in Sources */,
@@ -4985,6 +4981,7 @@
 				BDF862A1228E41CC000DEF84 /* OrderLogisticsController.swift in Sources */,
 				A72A73162232481600B21995 /* WeChatpayManager.swift in Sources */,
 				A7931E1822AFC1DF00297D0A /* CommunityListViewController.swift in Sources */,
+				A7D5F25022BC7B3700F8E9AF /* WebViewJavascriptBridgeManager.swift in Sources */,
 				A7F2D6D922B250EF0093000B /* CardContentPicVideoTableViewCell.swift in Sources */,
 				A7B4E72D228176060012914A /* ProductMallBarChartCollectionViewCell.swift in Sources */,
 				A70B2C4E22884AE800B2449F /* ProductDetailDescriptionTableViewCell.swift in Sources */,
@@ -5039,7 +5036,6 @@
 				A70B2C3E228825B100B2449F /* ProductDetailEvaluationTableViewCell.swift in Sources */,
 				A79057022276C9770037F823 /* SetPasswordModel.swift in Sources */,
 				BD12B68022B4EF2600AEB10B /* KSMediaPickerViewImageCell.swift in Sources */,
-				BD929CD422B906C10098C139 /* PublishVideoRecorderController.swift in Sources */,
 				A7274C5A228EE636000E3A07 /* LBXScanView.swift in Sources */,
 				A7FF1560228C693D00A85748 /* OrderViewController.swift in Sources */,
 				A729B5B42267254B004AE098 /* PasswordLoginViewController.swift in Sources */,

+ 32 - 0
RainbowPlanet/RainbowPlanet/Manager/WebViewJavascriptBridgeManager/WebViewJavascriptBridgeManager.swift

@@ -0,0 +1,32 @@
+//
+//  WebViewJavascriptBridgeManager.swift
+//  RainbowPlanet
+//
+//  Created by 南鑫林 on 2019/6/21.
+//  Copyright © 2019 RainbowPlanet. All rights reserved.
+//
+
+import UIKit
+import WebViewJavascriptBridge
+import SwiftyJSON
+
+class WebViewJavascriptBridgeManager: NSObject {
+    static let shared : WebViewJavascriptBridgeManager = WebViewJavascriptBridgeManager()
+    
+    func callHandlerH5(bridge: WebViewJavascriptBridge) {
+        bridge.callHandler("h5", data:  UserModel.shared().getH5UserInfo())
+    }
+    
+//    typealias CallDataClosure = (_ <#arguments#>: <#type#>) -> <#return value#>
+//    
+//    func registerHandlerApp(bridge: WebViewJavascriptBridge) {
+//        bridge.registerHandler("app", handler: { data, responseCallback in
+//            if let data = data {
+//                let jsonData = JSON(data)
+//            }
+//            responseCallback!(nil)
+//        })
+//    }
+    
+    
+}

+ 3 - 11
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/CommunityPlanetViewController.swift

@@ -19,8 +19,7 @@ class CommunityPlanetViewController: BaseJSWebViewController {
         super.viewDidLoad()
         
 //        self.URLString = "http://h5.dev.caihongxingqiu.com/planet"
-        self.URLString = "http://192.168.23.141:8820/planet"
-//        self.HTMLName = "ExampleApp"
+        self.URLString = "http://192.168.23.135:8899/planet"
         setupViews()
         setupData()
         
@@ -36,14 +35,8 @@ class CommunityPlanetViewController: BaseJSWebViewController {
         super.setupViews()
         self.wkWebView.navigationDelegate = self
         self.wkWebView.scrollView.addHeaderWithHeader(withBeginRefresh: true, animation: false) { [weak self] (page) in
-            //获取当前时间
-            let userModel = UserModel.shared().getModel()
-            var dic = Dictionary<String,Any>()
-            dic.updateValue(userModel?.token as Any, forKey: "token")
-            dic.updateValue(userModel?.accessToken as Any, forKey: "accessToken")
-            self?.bridge.callHandler("bridgeReady", data: dic)
+            self?.bridge.callHandler("h5", data:  UserModel.shared().getH5UserInfo())
             self?.reload()
-
         }
 
     }
@@ -54,10 +47,9 @@ class CommunityPlanetViewController: BaseJSWebViewController {
         var dic = Dictionary<String,Any>()
         dic.updateValue(userModel?.token as Any, forKey: "token")
         dic.updateValue(userModel?.accessToken as Any, forKey: "accessToken")
-        bridge.registerHandler("readyTest", handler: { data, responseCallback in
+        bridge.registerHandler("app", handler: { data, responseCallback in
             if let data = data {
                 let jsonData = JSON(data)
-                NXLLog("bridgeReady==\(jsonData)")
                 NotificationCenter.default.post(name: NSNotification.Name("CommunityPlanetH5"), object: jsonData)
             }
             responseCallback!(nil)

+ 0 - 64
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/Community/ViewController/Planet/CommunityPlanet/ExampleApp.html

@@ -1,64 +0,0 @@
-<!doctype html>
-<html><head>
-    <meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0">
-	<style type='text/css'>
-		html { font-family:Helvetica; color:#222; }
-		h1 { color:steelblue; font-size:24px; margin-top:24px; }
-		button { margin:0 3px 10px; font-size:12px; }
-		.logLine { border-bottom:1px solid #ccc; padding:4px 2px; font-family:courier; font-size:11px; }
-	</style>
-</head><body>
-	<h1>WebViewJavascriptBridge Demo</h1>
-	<script>
-	window.onerror = function(err) {
-		log('window.onerror: ' + err)
-	}
-
-    function setupWebViewJavascriptBridge(callback) {
-        if (window.WebViewJavascriptBridge) { return callback(WebViewJavascriptBridge); }
-        if (window.WVJBCallbacks) { return window.WVJBCallbacks.push(callback); }
-        window.WVJBCallbacks = [callback];
-        var WVJBIframe = document.createElement('iframe');
-        WVJBIframe.style.display = 'none';
-        WVJBIframe.src = 'https://__bridge_loaded__';
-        document.documentElement.appendChild(WVJBIframe);
-        setTimeout(function() { document.documentElement.removeChild(WVJBIframe) }, 0)
-    }
-
-    setupWebViewJavascriptBridge(function(bridge) {
-		var uniqueId = 1
-		function log(message, data) {
-			var log = document.getElementById('log')
-			var el = document.createElement('div')
-			el.className = 'logLine'
-			el.innerHTML = uniqueId++ + '. ' + message + ':<br/>' + JSON.stringify(data)
-			if (log.children.length) { log.insertBefore(el, log.children[0]) }
-			else { log.appendChild(el) }
-		}
-
-		bridge.registerHandler('testJavascriptHandler', function(data, responseCallback) {
-			log('ObjC called testJavascriptHandler with', data)
-			var responseData = { 'Javascript Says':'Right back atcha!' }
-			log('JS responding with', responseData)
-			responseCallback(responseData)
-		})
-
-		document.body.appendChild(document.createElement('br'))
-
-		var callbackButton = document.getElementById('buttons').appendChild(document.createElement('button'))
-        var p = document.createElement('p')
-        p.innerHTML = window.navigator.userAgent.toLowerCase()
-        document.getElementById('buttons').appendChild(p)
-
-		callbackButton.innerHTML = 'Fire testObjcCallback'
-		callbackButton.onclick = function(e) {
-			e.preventDefault()
-			log('JS calling handler "testObjcCallback"')
-			bridge.callHandler('testObjcCallback', {'foo': 'bar','foo1': 'bar1'}, function(response) {
-				log('JS got response', response)
-			})
-		}
-	})
-	</script>
-	<div id='buttons'></div> <div id='log'></div>
-</body></html>

+ 4 - 11
RainbowPlanet/RainbowPlanet/Modules/CommunityModule/CommunityMyInvitation/ViewController/CommunityMyInvitationViewController.swift

@@ -14,9 +14,9 @@ import SwiftyJSON
 class CommunityMyInvitationViewController: BaseJSWebBaseViewController {
     override func viewDidLoad() {
         super.viewDidLoad()
-        
-                self.URLString = "http://h5.dev.caihongxingqiu.com/planet"
-//        self.URLString = "http://192.168.23.141:8820/planet"
+        view.insertSubview(navigationBar, aboveSubview: wkWebView)
+//                self.URLString = "http://h5.dev.caihongxingqiu.com/planet"
+        self.URLString = "http://192.168.23.135:8899/planet"
         //        self.HTMLName = "ExampleApp"
         setupViews()
         setupData()
@@ -112,13 +112,7 @@ extension CommunityMyInvitationViewController : WKNavigationDelegate {
     
     //这个是网页加载完成,导航的变化
     func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
-        //        // 判断是否需要加载(仅在第一次加载)
-        //        if self.needLoadJSPOST == true {
-        //            // 调用使用JS发送POST请求的方法
-        ////            run_JavaScript(javaScript: POSTJavaScript)
-        //            // 将Flag置为NO(后面就不需要加载了)
-        //            needLoadJSPOST = false
-        //        }
+
     }
     
     //跳转失败的时候调用
@@ -128,7 +122,6 @@ extension CommunityMyInvitationViewController : WKNavigationDelegate {
     // 内容加载失败时候调用
     func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
         progressView.isHidden = true
-        NXLLog(error)
     }
     
     // 打开新窗口委托

+ 17 - 0
RainbowPlanet/RainbowPlanet/Service/Model/UserModel/UserModel.swift

@@ -142,5 +142,22 @@ class UserModel : NSObject, NSCoding, Mappable{
     func removeLoginModel() {
         UserDefaults.standard.removeObject(forKey: "UserModel")
     }
+    
+    
+    /// 获取H5需要的对象
+    func getH5UserInfo() -> Dictionary<String,Any> {
+        //获取当前时间
+        let userModel = getModel()
+        var dic = Dictionary<String,Any>()
+        dic.updateValue(userModel?.token as Any, forKey: "token")
+        dic.updateValue(userModel?.accessToken as Any, forKey: "accessToken")
+        var userInfoDic = Dictionary<String,Any>()
+        userInfoDic.updateValue("userInfo", forKey: "type")
+        userInfoDic.updateValue(dic, forKey: "params")
+        
+        return userInfoDic
+    }
 
 }
+
+

+ 67 - 0
RainbowPlanet/RainbowPlanet/Service/Model/WVJB/WVJBModel.swift

@@ -0,0 +1,67 @@
+//
+//	WebViewJavascriptBridgeModel.swift
+//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport
+
+import Foundation 
+import ObjectMapper
+
+/// h5交互的类型
+///
+/// - share: 分享
+/// - view: 跳转原生
+enum WVJBModelType : String {
+    case share = "share"
+    case view = "view"
+}
+/// WebViewJavascriptBridgeModel 简写 WVJBModel
+class WVJBModel:NSObject,Mappable{
+
+    var type : WVJBModelType?
+    var params : WVJBParamsModel?
+
+	class func newInstance(map: Map) -> Mappable?{
+		return WVJBModel()
+	}
+	required init?(map: Map){}
+	private override init(){}
+    
+    func mapping(map: Map)
+    {
+        type <- map["type"]
+        params <- map["params"]
+    }
+
+}
+enum WVJBParamsModelType : String {
+    case invite = "invite"
+}
+
+
+
+/// 交互类型参数
+///
+/// - publist: 发布
+/// - join: 参与
+enum WVJBParamsModelPage : String {
+    case publist = "publist"
+    case join = "join"
+}
+/// WebViewJavascriptBridgeParameterModel 简写 WVJBParameterModel
+class WVJBParamsModel:NSObject,Mappable {
+
+    var type : WVJBParamsModelPage?
+    var page : WVJBParamsModelPage?
+    
+    class func newInstance(map: Map) -> Mappable?{
+        return WVJBParamsModel()
+    }
+    required init?(map: Map){}
+    private override init(){}
+    
+    func mapping(map: Map)
+    {
+        type <- map["type"]
+        page <- map["page"]
+    }
+
+}