Sfoglia il codice sorgente

移除多余图片;优化首页缓存数据持久化

harry 3 anni fa
parent
commit
5ba6b55e37
33 ha cambiato i file con 40 aggiunte e 26 eliminazioni
  1. 2 2
      MusicVideoPlus/AppDelegate.swift
  2. 6 0
      MusicVideoPlus/Assets.xcassets/Custom/Contents.json
  3. 0 1
      MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/Contents.json
  4. 0 0
      MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/back_black@2x.png
  5. 0 0
      MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/back_black@3x.png
  6. 22 0
      MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/Contents.json
  7. BIN
      MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/deleteAudio@2x.png
  8. BIN
      MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/deleteAudio@3x.png
  9. 0 0
      MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/Contents.json
  10. 0 0
      MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/icon_detail_back@2x.png
  11. 0 0
      MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/icon_detail_back@3x.png
  12. 0 1
      MusicVideoPlus/Assets.xcassets/Home/add.imageset/Contents.json
  13. BIN
      MusicVideoPlus/Assets.xcassets/Home/add.imageset/add.png
  14. 0 1
      MusicVideoPlus/Assets.xcassets/Home/home_marks.imageset/Contents.json
  15. BIN
      MusicVideoPlus/Assets.xcassets/Home/home_marks.imageset/home_marks.png
  16. 0 1
      MusicVideoPlus/Assets.xcassets/Home/set.imageset/Contents.json
  17. BIN
      MusicVideoPlus/Assets.xcassets/Home/set.imageset/set.png
  18. 0 1
      MusicVideoPlus/Assets.xcassets/Home/video_pause.imageset/Contents.json
  19. BIN
      MusicVideoPlus/Assets.xcassets/Home/video_pause.imageset/video_pause.png
  20. 0 1
      MusicVideoPlus/Assets.xcassets/Home/wode.imageset/Contents.json
  21. BIN
      MusicVideoPlus/Assets.xcassets/Home/wode.imageset/wode.png
  22. 1 1
      MusicVideoPlus/Assets.xcassets/Login/1024x1024px.imageset/Contents.json
  23. 0 1
      MusicVideoPlus/Assets.xcassets/Login/close.imageset/Contents.json
  24. BIN
      MusicVideoPlus/Assets.xcassets/Login/close.imageset/close.png
  25. 0 1
      MusicVideoPlus/Assets.xcassets/Login/weichatLogin.imageset/Contents.json
  26. BIN
      MusicVideoPlus/Assets.xcassets/Login/weichatLogin.imageset/weichatLogin.png
  27. 0 1
      MusicVideoPlus/Assets.xcassets/Setting/logoutBtn.imageset/Contents.json
  28. BIN
      MusicVideoPlus/Assets.xcassets/Setting/logoutBtn.imageset/logoutBtn.png
  29. BIN
      MusicVideoPlus/Assets.xcassets/back_black.imageset/back_black.png
  30. 2 2
      MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift
  31. 1 3
      MusicVideoPlus/Classes/Modules/Home/Models/MVHotVideoModel.swift
  32. 4 8
      MusicVideoPlus/Classes/Modules/Home/ViewModels/MVHomeViewModel.swift
  33. 2 1
      MusicVideoPlus/Classes/Modules/Mine/Controllers/MVPlayViewController.swift

+ 2 - 2
MusicVideoPlus/AppDelegate.swift

@@ -6,6 +6,7 @@
 //
 
 import UIKit
+import BFMaterialKit
 
 @_exported import BFUIKit
 @_exported import BFFramework
@@ -40,8 +41,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         PQSingletoBuglyUtil.shared.registerBugly(appID: PQBFConfig.shared.buglyAppkey)
         
         //设置相册的删除 btn背景图mdf by ak 
-        PQBFConfig.shared.materialDeleteImage =
-            UIImage.moduleImage(named: "deleteAudio", moduleName: "BFFramework",isAssets: false) ?? UIImage.init()
+        BFMaterialConfig.shared.materialDeleteImage = UIImage(named: "deleteAudio")
         // 注册友盟
         MVThirdApiUtil.registerUM()
        

+ 6 - 0
MusicVideoPlus/Assets.xcassets/Custom/Contents.json

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

+ 0 - 1
MusicVideoPlus/Assets.xcassets/back_black.imageset/Contents.json → MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "back_black.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

+ 0 - 0
MusicVideoPlus/Assets.xcassets/back_black.imageset/back_black@2x.png → MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/back_black@2x.png


+ 0 - 0
MusicVideoPlus/Assets.xcassets/back_black.imageset/back_black@3x.png → MusicVideoPlus/Assets.xcassets/Custom/back_black.imageset/back_black@3x.png


+ 22 - 0
MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/Contents.json

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

BIN
MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/deleteAudio@2x.png


BIN
MusicVideoPlus/Assets.xcassets/Custom/deleteAudio.imageset/deleteAudio@3x.png


+ 0 - 0
MusicVideoPlus/Assets.xcassets/icon_detail_back.imageset/Contents.json → MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/Contents.json


+ 0 - 0
MusicVideoPlus/Assets.xcassets/icon_detail_back.imageset/icon_detail_back@2x.png → MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/icon_detail_back@2x.png


+ 0 - 0
MusicVideoPlus/Assets.xcassets/icon_detail_back.imageset/icon_detail_back@3x.png → MusicVideoPlus/Assets.xcassets/Custom/icon_detail_back.imageset/icon_detail_back@3x.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Home/add.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "add.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Home/add.imageset/add.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Home/home_marks.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "home_marks.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Home/home_marks.imageset/home_marks.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Home/set.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "set.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Home/set.imageset/set.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Home/video_pause.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "video_pause.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Home/video_pause.imageset/video_pause.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Home/wode.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "wode.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Home/wode.imageset/wode.png


+ 1 - 1
MusicVideoPlus/Assets.xcassets/Login/1024x1024px.imageset/Contents.json

@@ -1,11 +1,11 @@
 {
   "images" : [
     {
-      "filename" : "1024x1024px.png",
       "idiom" : "universal",
       "scale" : "1x"
     },
     {
+      "filename" : "1024x1024px.png",
       "idiom" : "universal",
       "scale" : "2x"
     },

+ 0 - 1
MusicVideoPlus/Assets.xcassets/Login/close.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "close.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Login/close.imageset/close.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Login/weichatLogin.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "weichatLogin.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Login/weichatLogin.imageset/weichatLogin.png


+ 0 - 1
MusicVideoPlus/Assets.xcassets/Setting/logoutBtn.imageset/Contents.json

@@ -1,7 +1,6 @@
 {
   "images" : [
     {
-      "filename" : "logoutBtn.png",
       "idiom" : "universal",
       "scale" : "1x"
     },

BIN
MusicVideoPlus/Assets.xcassets/Setting/logoutBtn.imageset/logoutBtn.png


BIN
MusicVideoPlus/Assets.xcassets/back_black.imageset/back_black.png


+ 2 - 2
MusicVideoPlus/Classes/Modules/Home/Controllers/MVHomeController.swift

@@ -262,7 +262,7 @@ class MVHomeController: MVBaseController {
         // 播放器进度和状态回调
         PQSingletoVideoPlayer.shared.progressBloc = { [weak self] _, playProgress, duration in
 
-            BFLog(message: "duration \(duration) playProgress\(playProgress) \(duration) 进度\(playProgress / duration)")
+//            BFLog(message: "duration \(duration) playProgress\(playProgress) \(duration) 进度\(playProgress / duration)")
             let cell: MVBannerCell? = self?.viewListView.collectionView.cellForItem(at: self?.lastBnnerSelectIndex ?? IndexPath()) as? MVBannerCell
             cell?.progressView.progress = playProgress / duration
         }
@@ -534,7 +534,7 @@ extension MVHomeController {
                 PQSingletoVideoPlayer.shared.startPlayr()
                 PQSingletoVideoPlayer.shared.progressBloc = { [weak self] _, playProgress, duration in
 
-                    BFLog(message: "duration \(duration) playProgress\(playProgress) \(duration) 进度\(playProgress / duration)")
+//                    BFLog(message: "duration \(duration) playProgress\(playProgress) \(duration) 进度\(playProgress / duration)")
                     let cell: MVBannerCell? = self?.viewListView.collectionView.cellForItem(at: self?.lastBnnerSelectIndex ?? IndexPath()) as? MVBannerCell
                     cell?.progressView.progress = playProgress / duration
                 }

+ 1 - 3
MusicVideoPlus/Classes/Modules/Home/Models/MVHotVideoModel.swift

@@ -51,8 +51,6 @@ class MVHotVideoModel: NSObject {
    class  func saveCacheData(data:Array<Any>) {
         
         saveUserDefaults(key: kSaveHotVideoData, value: arrayToJsonString(data))
-    
-        
-       
+ 
     }
 }

+ 4 - 8
MusicVideoPlus/Classes/Modules/Home/ViewModels/MVHomeViewModel.swift

@@ -25,24 +25,20 @@ class MVHomeViewModel: NSObject {
     /// - Returns: <#description#>
     class func  getHomeHotVideos(completeHander: @escaping (_ hotVideos: Array<MVHotVideoModel>, _ msg: String?) -> Void) {
         
-        let start: TimeInterval = Date().timeIntervalSince1970
+        let start = Date()
         
         var url: String = PQENVUtil.shared.longvideoapi
         url = url + "rhythmapp/homepage/getAllVideos"
         BFNetRequestAdaptor.postRequestData(url: url, parames: nil, commonParams: commonParams()) { response, _, error, _ in
             DispatchQueue.global().async {
-                
-                let end: TimeInterval = Date().timeIntervalSince1970
-                
-                BFLog(message: "getAllVideos tiimes is \(end - start)")
                 var hotVideos:Array = Array<MVHotVideoModel>.init()
                 if !(response is NSNull), response != nil {
                     let tempArr = response as! [[String: Any]]
+                    DispatchQueue.global().async {
+                        MVHotVideoModel.saveCacheData(data: tempArr)
+                    }
 
-                    MVHotVideoModel.saveCacheData(data: tempArr)
-               
                     for item in tempArr {
-                        
                         let hotVideoModel:MVHotVideoModel = MVHotVideoModel.init()
                         hotVideoModel.categoryId = item["categoryId"] as? Int ?? 0
                         hotVideoModel.categoryName = item["categoryName"]  as? String ?? ""

+ 2 - 1
MusicVideoPlus/Classes/Modules/Mine/Controllers/MVPlayViewController.swift

@@ -7,6 +7,7 @@
 
 import BFFramework
 import UIKit
+import BFUIKit
 import WechatOpenSDK
 
 class MVPlayViewController: BFBaseViewController {
@@ -22,7 +23,7 @@ class MVPlayViewController: BFBaseViewController {
         leftBtn.frame = CGRect(x: 0, y: cDevice_iPhoneStatusBarHei, width: cDefaultMargin * 4, height: cDefaultMargin * 4)
         leftBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: -5, right: 0)
         leftBtn.tintColor = UIColor.white
-        leftBtn.setImage(UIImage().BF_Image(named: "icon_detail_back").withRenderingMode(.alwaysTemplate), for: .normal)
+        leftBtn.setImage((imageInUIKit(by: "icon_detail_back") ?? UIImage()).withRenderingMode(.alwaysTemplate), for: .normal)
         leftBtn.addTarget(self, action: #selector(backBtnClick), for: .touchUpInside)
         return leftBtn
     }()