Bläddra i källkod

1.修改隐私跳转

wenweiwei 4 år sedan
förälder
incheckning
0cc648b525

+ 4 - 4
MusicVideoPlus/MusicVideoPlus.xcodeproj/project.pbxproj

@@ -8,6 +8,7 @@
 
 /* Begin PBXBuildFile section */
 		2D076756266DF8E300E64472 /* PQServerProtocalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076755266DF8E300E64472 /* PQServerProtocalView.swift */; };
+		2D076758266E08E700E64472 /* MVHomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D076757266E08E700E64472 /* MVHomeController.swift */; };
 		2D1EC138266B4F4900CBACE4 /* MVUMApiUtil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D1EC137266B4F4900CBACE4 /* MVUMApiUtil.swift */; };
 		4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD822669BFA600A5AFD9 /* MVBanner.swift */; };
 		4112DD862669BFFA00A5AFD9 /* MVBannerFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4112DD852669BFFA00A5AFD9 /* MVBannerFlowLayout.swift */; };
@@ -19,7 +20,6 @@
 		418532302665342100DCA2C1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4185322F2665342100DCA2C1 /* AppDelegate.swift */; };
 		418532392665342200DCA2C1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 418532382665342200DCA2C1 /* Assets.xcassets */; };
 		41CA6E5E266782EC00874B19 /* MVBaseController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CA6E5D266782EC00874B19 /* MVBaseController.swift */; };
-		41CA6E632667853C00874B19 /* MVHomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CA6E622667853C00874B19 /* MVHomeController.swift */; };
 		41CA6E662667887C00874B19 /* MVMineController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CA6E652667887C00874B19 /* MVMineController.swift */; };
 		41CA6E69266788C000874B19 /* MVLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CA6E68266788C000874B19 /* MVLoginController.swift */; };
 		41CA6E6C266788F700874B19 /* MVPlayerConntroller.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CA6E6B266788F700874B19 /* MVPlayerConntroller.swift */; };
@@ -31,6 +31,7 @@
 
 /* Begin PBXFileReference section */
 		2D076755266DF8E300E64472 /* PQServerProtocalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PQServerProtocalView.swift; sourceTree = "<group>"; };
+		2D076757266E08E700E64472 /* MVHomeController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MVHomeController.swift; sourceTree = "<group>"; };
 		2D1EC137266B4F4900CBACE4 /* MVUMApiUtil.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVUMApiUtil.swift; sourceTree = "<group>"; };
 		3FA19A38D145C54301B3CD85 /* Pods_MusicVideoPlus.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_MusicVideoPlus.framework; sourceTree = BUILT_PRODUCTS_DIR; };
 		4112DCF02668C45B00A5AFD9 /* MusicVideoPlus.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = MusicVideoPlus.entitlements; sourceTree = "<group>"; };
@@ -47,7 +48,6 @@
 		418532382665342200DCA2C1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
 		4185323D2665342200DCA2C1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		41CA6E5D266782EC00874B19 /* MVBaseController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVBaseController.swift; sourceTree = "<group>"; };
-		41CA6E622667853C00874B19 /* MVHomeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MVHomeController.swift; path = MusicVideoPlus/Classes/Modules/Home/MVHomeController.swift; sourceTree = SOURCE_ROOT; };
 		41CA6E652667887C00874B19 /* MVMineController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVMineController.swift; sourceTree = "<group>"; };
 		41CA6E68266788C000874B19 /* MVLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVLoginController.swift; sourceTree = "<group>"; };
 		41CA6E6B266788F700874B19 /* MVPlayerConntroller.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MVPlayerConntroller.swift; sourceTree = "<group>"; };
@@ -197,7 +197,7 @@
 		41CA6E41266782C900874B19 /* Controllers */ = {
 			isa = PBXGroup;
 			children = (
-				41CA6E622667853C00874B19 /* MVHomeController.swift */,
+				2D076757266E08E700E64472 /* MVHomeController.swift */,
 			);
 			path = Controllers;
 			sourceTree = "<group>";
@@ -564,11 +564,11 @@
 			files = (
 				4112DD862669BFFA00A5AFD9 /* MVBannerFlowLayout.swift in Sources */,
 				41CA6E702667953700874B19 /* MVSettingController.swift in Sources */,
+				2D076758266E08E700E64472 /* MVHomeController.swift in Sources */,
 				4112DD912669C11C00A5AFD9 /* MVBannerCell.swift in Sources */,
 				41CA6E6C266788F700874B19 /* MVPlayerConntroller.swift in Sources */,
 				41CA6E5E266782EC00874B19 /* MVBaseController.swift in Sources */,
 				417D86A7266A3CC900DA2444 /* MVHotVideoModel.swift in Sources */,
-				41CA6E632667853C00874B19 /* MVHomeController.swift in Sources */,
 				4149C8932669FE6F0055CAA2 /* MVTagsCell.swift in Sources */,
 				4112DD832669BFA600A5AFD9 /* MVBanner.swift in Sources */,
 				2D1EC138266B4F4900CBACE4 /* MVUMApiUtil.swift in Sources */,

+ 33 - 16
MusicVideoPlus/MusicVideoPlus/Classes/Modules/Home/MVHomeController.swift → MusicVideoPlus/MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -87,22 +87,14 @@ class MVHomeController: MVBaseController {
         cell?.pauseView.isHidden = false
         PQSingletoVideoPlayer.shared.stopPlayer(isRemove: false)
     }
-
-    override func viewDidLoad() {
-        super.viewDidLoad()
-//        view.addSubview(mineBtn)
-        view.addSubview(stuckPointBtn)
-        view.addSubview(settingBtn)
-        view.addSubview(banner)
-        view.addSubview(collectionView)
-        banner.dataSource = self
-        banner.delegate = self
-        banner.isShowPageControl = false
-        banner.reloadData()
-
-        addLayout()
-
-        MVHomeViewModel.getHomeHotVideos { [weak self] hotVideos, _ in
+    
+    func getData(){
+        
+        if(mVideos.count > 0){
+            BFLog(message: "已经请求过数据")
+            return
+        }
+        MVHomeViewModel.getHomeHotVideos {[weak self] hotVideos, _ in
             BFLog(message: "hotVideos count is :\(hotVideos.count)")
 
             self?.mVideos = hotVideos
@@ -120,7 +112,32 @@ class MVHomeController: MVBaseController {
 
             self?.banner.reloadData()
         }
+    }
+
+    override func viewDidLoad() {
+        super.viewDidLoad()
+//        view.addSubview(mineBtn)
+        view.addSubview(stuckPointBtn)
+        view.addSubview(settingBtn)
+        view.addSubview(banner)
+        view.addSubview(collectionView)
+        banner.dataSource = self
+        banner.delegate = self
+        banner.isShowPageControl = false
+        banner.reloadData()
 
+        addLayout()
+        
+        getData()
+        
+        manager?.startListening()
+        manager?.listener = { [weak self] status in
+            
+            if status == .reachable(.wwan) || status == .reachable(.ethernetOrWiFi) {
+               BFLog(message: "来网了")
+                self?.getData()
+            }
+        }
         PQSingletoVideoPlayer.shared.progressBloc = { [weak self] loadProgress, playProgress, duration in
 
             BFLog(message: "loadProgress \(loadProgress) playProgress\(playProgress) \(duration)")

+ 1 - 1
MusicVideoPlus/MusicVideoPlus/Info.plist

@@ -25,7 +25,7 @@
 			<string>Editor</string>
 			<key>CFBundleURLSchemes</key>
 			<array>
-				<string>wxfc2fc07ab379e4bf</string>
+				<string>wx0e8234aac576d1e0</string>
 			</array>
 		</dict>
 	</array>