Browse Source

修改1.4-1 bug

100Years 1 month ago
parent
commit
f975732481
32 changed files with 290 additions and 120 deletions
  1. 2 2
      AIRingtone.xcodeproj/project.pbxproj
  2. 14 35
      AIRingtone/AppDelegate.swift
  3. 2 1
      AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/Contents.json
  4. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0 1.png
  5. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0@2x.png
  6. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0@3x.png
  7. 2 1
      AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/Contents.json
  8. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1 1.png
  9. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1@2x.png
  10. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1@3x.png
  11. 2 1
      AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/Contents.json
  12. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2 1.png
  13. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2@2x.png
  14. BIN
      AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2@3x.png
  15. BIN
      AIRingtone/Assets.xcassets/VIP/purchase_bj.imageset/purchase_bj@2x.png
  16. BIN
      AIRingtone/Assets.xcassets/VIP/purchase_bj.imageset/purchase_bj@3x.png
  17. BIN
      AIRingtone/Assets.xcassets/VIP/ring_vip.imageset/ring_vip@2x.png
  18. BIN
      AIRingtone/Assets.xcassets/VIP/ring_vip.imageset/ring_vip@3x.png
  19. 150 50
      AIRingtone/Business/LaunchVC/TSBootPageVC.swift
  20. 50 5
      AIRingtone/Business/LaunchVC/TSLaunchVC.swift
  21. 4 0
      AIRingtone/Business/TSAIPhotoVC/TSAIPhotoVC.swift
  22. 3 0
      AIRingtone/Business/TSAIPhotoVC/TSTextGeneralPicVC/TSTextGeneralPicVC.swift
  23. 5 3
      AIRingtone/Business/TSAIRintoneVC/TSAIRintoneVC/TSAIRintoneVC.swift
  24. 14 8
      AIRingtone/Business/TSAIRintoneVC/TSAIRintoneVC/View/TSAIRintoneHistoryCell.swift
  25. 1 1
      AIRingtone/Business/TSDiscoverVC/TSDiscoverVC/View/TSDiscoverCell.swift
  26. 12 3
      AIRingtone/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift
  27. 1 1
      AIRingtone/Business/TSSetingVC/SetingVC/View/SettingPurchaseTopView.swift
  28. 8 1
      AIRingtone/Business/TSThemeVC/TSThemeSetVC/TSThemeSetRingToneView.swift
  29. 4 1
      AIRingtone/Business/TSThemeVC/TSThemeSetVC/TSThemeSetVC.swift
  30. 3 3
      AIRingtone/Business/VIewTool/TSRingToneCellView.swift
  31. 5 3
      AIRingtone/Common/Tool/TSAudioPlayer/TSAudioPlayer.swift
  32. 8 1
      AIRingtone/Common/Tool/TSBusinessAudioPlayer.swift

+ 2 - 2
AIRingtone.xcodeproj/project.pbxproj

@@ -1271,7 +1271,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = AIRingtone/Info.plist;
@@ -1313,7 +1313,7 @@
 				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 2;
+				CURRENT_PROJECT_VERSION = 3;
 				DEVELOPMENT_TEAM = 65UD255J84;
 				GENERATE_INFOPLIST_FILE = YES;
 				INFOPLIST_FILE = AIRingtone/Info.plist;

+ 14 - 35
AIRingtone/AppDelegate.swift

@@ -28,7 +28,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
             guard let self = self else { return }
             JudgmentSkipPage()
         }
-        window?.rootViewController = launchVC
+        window?.rootViewController = TSBaseNavigationC(rootViewController: launchVC)
     }
 
     func goToTab(){
@@ -39,16 +39,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
     func JudgmentSkipPage() {
         //去掉引导页
         if UserDefaults.standard.string(forKey: "isFirstInstallApp") == nil {
-            window?.rootViewController = TSBootPageVC { [weak self]  in
+            let bootPageVC  = TSBootPageVC { [weak self]  in
                 guard let self = self else { return }
                 UserDefaults.standard.set("1", forKey: "isFirstInstallApp")
                 UserDefaults.standard.synchronize()
                 goToTab()
-                showEveryDayPopPurchase()
             }
+            let navi = TSBaseNavigationC(rootViewController: bootPageVC)
+            window?.rootViewController = navi
         }else{
             goToTab()
-            showEveryDayPopPurchase()
         }
     }
     
@@ -90,33 +90,11 @@ extension AppDelegate {
     
     
     func purchaseDidChanged(){
-        NotificationCenter.default.addObserver(forName: .kPurchasePrepared, object: nil, queue: OperationQueue.main) {notification in
-            
-//            //用户第一次安装 App 时候,要弹窗会员
-//            if UserDefaults.standard.string(forKey: "isFirstInstallAppPurchaseShow") == nil {
-//                if kPurchaseToolShared.isVip == false{
-//                    self.showTSPurchaseVC()
-//                    UserDefaults.standard.set("1", forKey: "isFirstInstallAppPurchaseShow")
-//                    UserDefaults.standard.synchronize()
-//                }
-//            }
-            
-            
-            
-        }
+//        NotificationCenter.default.addObserver(forName: .kPurchasePrepared, object: nil, queue: OperationQueue.main) {notification in
+//            self.showEveryDayPopPurchase()
+//        }
     }
     
-    @objc func vipInfoChanged()  {
-        if UserDefaults.standard.string(forKey: "isFirstInstallApp") == nil {
-            if let vc = self.window?.rootViewController {
-                TSPurchaseVC.show(target: vc, closePageBlock: nil)
-                UserDefaults.standard.set("1", forKey: "isFirstInstallApp")
-                UserDefaults.standard.synchronize()
-            }
-        }else{
-            self.showEveryDayPopPurchase()
-        }
-    }
     func showEveryDayPopPurchase() {
             // 1. 获取当前日期
             let currentDate = Date()
@@ -132,19 +110,20 @@ extension AppDelegate {
             if lastGreetingDateString != currentDateString {
                 
                 // 4. 弹窗付费引导
-                showTSPurchaseVC()
-  
-                // 5. 更新上次弹窗的日期
-                userDefaults.set(currentDateString, forKey: "kEveryDayPopPurchase")
+                if showTSPurchaseVC() {
+                    // 5. 更新上次弹窗的日期
+                    userDefaults.set(currentDateString, forKey: "kEveryDayPopPurchase")
+                }
             }
     }
     
-    func showTSPurchaseVC(){
+    func showTSPurchaseVC() -> Bool{
         if kPurchaseDefault.products.count > 0 {
             if let vc = window?.rootViewController {
                 TSPurchaseVC.show(target: vc, closePageBlock: nil)
+                return true
             }
         }
-        
+        return false
     }
 }

+ 2 - 1
AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/Contents.json

@@ -5,11 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "bootPage_0 1.png",
+      "filename" : "bootPage_0@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
+      "filename" : "bootPage_0@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0 1.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0@2x.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_0.imageset/bootPage_0@3x.png


+ 2 - 1
AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/Contents.json

@@ -5,11 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "bootPage_1 1.png",
+      "filename" : "bootPage_1@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
+      "filename" : "bootPage_1@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1 1.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1@2x.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_1.imageset/bootPage_1@3x.png


+ 2 - 1
AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/Contents.json

@@ -5,11 +5,12 @@
       "scale" : "1x"
     },
     {
-      "filename" : "bootPage_2 1.png",
+      "filename" : "bootPage_2@2x.png",
       "idiom" : "universal",
       "scale" : "2x"
     },
     {
+      "filename" : "bootPage_2@3x.png",
       "idiom" : "universal",
       "scale" : "3x"
     }

BIN
AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2 1.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2@2x.png


BIN
AIRingtone/Assets.xcassets/Launch/bootPage_2.imageset/bootPage_2@3x.png


BIN
AIRingtone/Assets.xcassets/VIP/purchase_bj.imageset/purchase_bj@2x.png


BIN
AIRingtone/Assets.xcassets/VIP/purchase_bj.imageset/purchase_bj@3x.png


BIN
AIRingtone/Assets.xcassets/VIP/ring_vip.imageset/ring_vip@2x.png


BIN
AIRingtone/Assets.xcassets/VIP/ring_vip.imageset/ring_vip@3x.png


+ 150 - 50
AIRingtone/Business/LaunchVC/TSBootPageVC.swift

@@ -17,76 +17,176 @@ class TSBootPageVC: TSBaseVC {
     @MainActor required init?(coder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
     }
+    var index:Int = 0
+    let titleStrings = ["Create Ringtones with AI".localized,"Thousands of Ringtones".localized,"Calling Theme Surprise You".localized]
+    let imageStrings = ["bootPage_0","bootPage_1","bootPage_2"]
     
     
-//    lazy var continueBtn: UIButton = {
-//        let continueBtn = kCreateNormalSubmitBtn(title: "", frame: CGRectMake(0, 0, 343, 50)) {
-//            
-//        }
+    lazy var titleLabel: UILabel = {
+        let titleLabel = UILabel.createLabel(text: titleStrings.safeString(At: index),font: .font(size: 20,weight: .semibold),textColor: "#FBDAFF".uiColor,textAlignment:.center,numberOfLines: 0)
+        return titleLabel
+    }()
+    
+    lazy var continueBtn: UIButton = {
+        let continueBtn = kCreateNormalSubmitBtn(title: "Continue".localized, frame: CGRectMake(0, 0, 343, 50)) { [weak self]  in
+            guard let self = self else { return }
+            clickContinue()
+        }
+        continueBtn.titleLabel?.font = .font(size: 18,weight: .medium)
+        
+        let imageView = UIImageView.createImageView(imageName: "launch_rightArrow")
+        continueBtn.addSubview(imageView)
+        imageView.snp.makeConstraints { make in
+            make.width.height.equalTo(24)
+            make.centerY.equalToSuperview()
+            make.trailing.equalTo(-24)
+        }
+        
+        return continueBtn
+    }()
+    
+//    lazy var scrollView: UIScrollView = {
+//        let scrollView = UIScrollView()
+//        scrollView.isScrollEnabled = false
+//        scrollView.frame = self.view.bounds
+//
+//        let imageView0 = UIImageView.createImageView(imageName: "bootPage_0",contentMode: .scaleAspectFill)
+//        imageView0.frame = CGRectMake(0, 0, k_ScreenWidth, k_ScreenHeight)
+//        scrollView.addSubview(imageView0)
+//        
+//        let imageView1 = UIImageView.createImageView(imageName: "bootPage_1",contentMode: .scaleAspectFill)
+//        imageView1.frame = CGRectMake(k_ScreenWidth, 0, k_ScreenWidth, k_ScreenHeight)
+//        scrollView.addSubview(imageView1)
+//        
+//        let imageView2 = UIImageView.createImageView(imageName: "bootPage_2",contentMode: .scaleAspectFill)
+//        imageView2.frame = CGRectMake(k_ScreenWidth*2, 0, k_ScreenWidth, k_ScreenHeight)
+//        scrollView.addSubview(imageView2)
+//        
+//        let btnH = k_ScreenHeight/5
+//        let btnTop = btnH*4
+//        
+//        let button0 = UIButton(frame: CGRectMake(0, btnTop, k_ScreenWidth, btnH))
+//        button0.tag = 1
+//        button0.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
+//        scrollView.addSubview(button0)
+//        
+//        let button1 = UIButton(frame: CGRectMake(k_ScreenWidth, btnTop, k_ScreenWidth, btnH))
+//        button1.tag = 2
+//        button1.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
+//        scrollView.addSubview(button1)
 //        
-//        let imageView = UIImageView.createImageView(imageName: "launch_rightArrow")
-//        continueBtn.addSubview(imageView)
-//        imageView.snp.makeConstraints { make in
-//            make.width.height.equalTo(24)
+//        let button2 = UIButton(frame: CGRectMake(k_ScreenWidth*2, btnTop, k_ScreenWidth, btnH))
+//        button2.tag = 3
+//        button2.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
+//        scrollView.addSubview(button2)
+//        
+//        scrollView.addSubview(titleLabel)
+//        scrollView.addSubview(continueBtn)
+//        continueBtn.snp.makeConstraints { make in
+//            make.width.equalTo(continueBtn.width)
+//            make.height.equalTo(continueBtn.height)
+//            make.bottom.equalTo(-61)
 //            make.centerY.equalToSuperview()
-//            make.trailing.equalTo(-24)
 //        }
 //        
-//        return continueBtn
+//        titleLabel.snp.makeConstraints { make in
+//            make.leading.equalTo(16)
+//            make.trailing.equalTo(-16)
+//            make.bottom.equalTo(continueBtn.snp.top).offset(-36)
+//        }
+//        return scrollView
 //    }()
+//    
+//    override func createView() {
+//        setNavBarViewHidden(true)
+//        self.view.backgroundColor = .black
+//        self.view.addSubview(scrollView)
+//        titleLabel.text = titleStrings.safeString(At: index)
+//    }
     
-    lazy var scrollView: UIScrollView = {
-        let scrollView = UIScrollView()
-        scrollView.isScrollEnabled = false
-        scrollView.frame = self.view.bounds
-
-        let imageView0 = UIImageView.createImageView(imageName: "bootPage_0",contentMode: .scaleAspectFill)
-        imageView0.frame = CGRectMake(0, 0, k_ScreenWidth, k_ScreenHeight)
-        scrollView.addSubview(imageView0)
-        
-        let imageView1 = UIImageView.createImageView(imageName: "bootPage_1",contentMode: .scaleAspectFill)
-        imageView1.frame = CGRectMake(k_ScreenWidth, 0, k_ScreenWidth, k_ScreenHeight)
-        scrollView.addSubview(imageView1)
-        
-        let imageView2 = UIImageView.createImageView(imageName: "bootPage_2",contentMode: .scaleAspectFill)
-        imageView2.frame = CGRectMake(k_ScreenWidth*2, 0, k_ScreenWidth, k_ScreenHeight)
-        scrollView.addSubview(imageView2)
-        
-        let btnH = k_ScreenHeight/5
-        let btnTop = btnH*4
-        
-        let button0 = UIButton(frame: CGRectMake(0, btnTop, k_ScreenWidth, btnH))
-        button0.tag = 1
-        button0.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
-        scrollView.addSubview(button0)
-        
-        let button1 = UIButton(frame: CGRectMake(k_ScreenWidth, btnTop, k_ScreenWidth, btnH))
-        button1.tag = 2
-        button1.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
-        scrollView.addSubview(button1)
-        
-        let button2 = UIButton(frame: CGRectMake(k_ScreenWidth*2, btnTop, k_ScreenWidth, btnH))
-        button2.tag = 3
-        button2.addTarget(self, action: #selector(clickBtn(_:)), for: .touchUpInside)
-        scrollView.addSubview(button2)
-        
-        return scrollView
-    }()
     
+//    @objc func clickBtn(_ btn:UIButton){
+//        if btn.tag <= 2{
+//            scrollView.contentOffset = CGPointMake(k_ScreenWidth*CGFloat(btn.tag), 0)
+//        }else{
+//            onComplete()
+//            self.navBarClickLeftAction()
+//        }
+//    }
     
     @objc func clickBtn(_ btn:UIButton){
         if btn.tag <= 2{
             scrollView.contentOffset = CGPointMake(k_ScreenWidth*CGFloat(btn.tag), 0)
         }else{
-            onComplete()
-            self.navBarClickLeftAction()
+            let vc = TSPurchaseVC()
+            vc.closePageBlock = { [weak self]  in
+                guard let self = self else { return }
+                onComplete()
+            }
+            self.navigationController?.pushViewController(vc, animated: true)
         }
     }
     
+    
+    lazy var scrollView: UIScrollView = {
+        let scrollView = UIScrollView()
+        scrollView.isScrollEnabled = false
+        scrollView.frame = self.view.bounds
+
+        var idx:Int = 0
+        for string in imageStrings {
+            let imageView = UIImageView.createImageView(imageName: string,contentMode: .scaleAspectFill)
+            imageView.frame = CGRectMake(k_ScreenWidth * CGFloat(idx), 0, k_ScreenWidth, k_ScreenHeight)
+            scrollView.addSubview(imageView)
+            idx+=1
+        }
+
+        return scrollView
+    }()
+    
     override func createView() {
         setNavBarViewHidden(true)
         self.view.backgroundColor = .black
         self.view.addSubview(scrollView)
-    }
+        
+        view.addSubview(titleLabel)
+        view.addSubview(continueBtn)
+        continueBtn.snp.makeConstraints { make in
+            make.width.equalTo(continueBtn.width)
+            make.height.equalTo(continueBtn.height)
+            make.bottom.equalTo(-61)
+            make.centerX.equalToSuperview()
+        }
+        
+        titleLabel.snp.makeConstraints { make in
+            make.leading.equalTo(16)
+            make.trailing.equalTo(-16)
+            make.bottom.equalTo(continueBtn.snp.top).offset(-36)
+        }
+        
 
+    }
+    
+    func clickContinue(){
+        index+=1
+        titleLabel.text = titleStrings.safeString(At: index)
+        if index <= 2{
+            scrollView.contentOffset = CGPointMake(k_ScreenWidth*CGFloat(index), 0)
+        }else{
+            let vc = TSPurchaseVC()
+            vc.closePageBlock = { [weak self]  in
+                guard let self = self else { return }
+                onComplete()
+            }
+            self.navigationController?.pushViewController(vc, animated: true)
+        }
+        
+    }
+    
+    func indexAdd(){
+        index+=1
+        if index > 2 {
+            index = 2
+        }
+    }
 }

+ 50 - 5
AIRingtone/Business/LaunchVC/TSLaunchVC.swift

@@ -15,9 +15,9 @@ class TSLaunchVC: UIViewController {
     private var timer: DispatchSourceTimer?
     // 闪屏页剩余显示时长
     #if DEBUG
-    private var remindTimeInterval: TimeInterval = 0.5
+    private var remindTimeInterval: TimeInterval = 1.5
     #else
-        private var remindTimeInterval: TimeInterval = 2.0
+        private var remindTimeInterval: TimeInterval = 3.0
     #endif
 
     private var isStop: Bool = false
@@ -58,9 +58,12 @@ class TSLaunchVC: UIViewController {
     }
 
     func enterApp() {
-        DispatchQueue.main.async {
-            self.dismissHandler?()
-        }
+        
+        showEveryDayPopPurchase()
+        
+//        DispatchQueue.main.async {
+//            self.dismissHandler?()
+//        }
     }
 
 
@@ -114,3 +117,45 @@ class TSLaunchVC: UIViewController {
     }
 }
 
+
+extension TSLaunchVC {
+    
+    func showEveryDayPopPurchase() {
+        
+        if UserDefaults.standard.string(forKey: "isFirstInstallApp") == nil || kPurchaseToolShared.isVip {
+            //启动页->引导图->会员购买
+            dismissHandler?()
+            return
+        }
+        
+        //启动页->会员购买
+        // 1. 获取当前日期
+        let currentDate = Date()
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "yyyyMMdd"
+        let currentDateString = dateFormatter.string(from: currentDate)
+        
+        // 2. 获取上次弹窗的日期
+        let userDefaults = UserDefaults.standard
+        let lastGreetingDateString = userDefaults.string(forKey: "kEveryDayPopPurchase")
+        
+        // 3. 检查是否需要显示弹窗 "20250319"
+        if lastGreetingDateString != currentDateString {
+            
+            // 4. 弹窗付费引导
+            let vc = TSPurchaseVC()
+            vc.closePageBlock = { [weak self]  in
+                guard let self = self else { return }
+                dismissHandler?()
+            }
+            self.navigationController?.pushViewController(vc, animated: true)
+        
+            // 5. 更新上次弹窗的日期
+            userDefaults.set(currentDateString, forKey: "kEveryDayPopPurchase")
+            
+//            userDefaults.set(String(Int(currentDateString)!+1), forKey: "kEveryDayPopPurchase")测试用的
+        }else{
+            dismissHandler?()
+        }
+    }
+}

+ 4 - 0
AIRingtone/Business/TSAIPhotoVC/TSAIPhotoVC.swift

@@ -36,6 +36,10 @@ class TSAIPhotoVC: TSBaseVC {
     
     lazy var generalPicVC: TSTextGeneralPicVC = {
         let generalPicVC = TSTextGeneralPicVC()
+        generalPicVC.selectedIndex = { [weak self] index in
+            guard let self = self else { return }
+            self.segmentedView.selectItemAt(index: index)
+        }
         return generalPicVC
     }()
     

+ 3 - 0
AIRingtone/Business/TSAIPhotoVC/TSTextGeneralPicVC/TSTextGeneralPicVC.swift

@@ -13,6 +13,8 @@ class TSTextGeneralPicVC: TSBaseVC {
         }
     }
     
+    var selectedIndex:((Int)->Void)?
+    
     lazy var viewModel: TSTextGeneralPicVM = {
         let viewModel:TSTextGeneralPicVM = TSTextGeneralPicVM()
         viewModel.isCanGennerateBlock = { [weak self] enabled in
@@ -44,6 +46,7 @@ class TSTextGeneralPicVC: TSBaseVC {
             guard let self = self else { return }
             viewModel.gennerateType = TSGennerateType(rawValue: index) ?? .poster
             creatBtnView.vipFreeNumType = vipFreeNumType
+            selectedIndex?(index)
         }
         photoStyleView.moreInfoBtn.addTarget(self, action: #selector(clickMoreInfoBtn), for: .touchUpInside)
         return photoStyleView

+ 5 - 3
AIRingtone/Business/TSAIRintoneVC/TSAIRintoneVC/TSAIRintoneVC.swift

@@ -33,7 +33,7 @@ class TSAIRintoneVC: TSBaseVC {
         layout.itemSize = CGSize(width: k_ScreenWidth-32, height: 74)
         layout.minimumInteritemSpacing = 10.0
         layout.minimumLineSpacing = 18.0
-        layout.headerReferenceSize = CGSizeMake(k_ScreenWidth, 48)
+        layout.headerReferenceSize = CGSizeMake(k_ScreenWidth, 62)
         layout.footerReferenceSize = CGSizeMake(k_ScreenWidth, 48)
         return layout
     }()
@@ -217,8 +217,10 @@ extension TSAIRintoneVC: UICollectionViewDataSource ,UICollectionViewDelegate,UI
     
     
     public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section: Int) -> CGSize {
-        if section == viewModel.modelList.count - 1 {
-            return  CGSizeMake(k_ScreenWidth, 48)
+        if let sectionModel = viewModel.modelList.safeObj(At: section) {
+            if  sectionModel.type == .recommend {
+                return  CGSizeMake(k_ScreenWidth, 48)
+            }
         }
         return .zero
     }

+ 14 - 8
AIRingtone/Business/TSAIRintoneVC/TSAIRintoneVC/View/TSAIRintoneHistoryCell.swift

@@ -38,18 +38,24 @@ class TSAIRintoneHistoryCell: SwipeCollectionViewCell  {
         ringToneView.backgroundColor = .clear
         ringToneView.clickPlayHandel = { [weak self] isplay in
             guard let self = self else { return }
-
             
-            if TSBusinessAudioPlayer.shared.isPlaying {
-                TSBusinessAudioPlayer.shared.stop()
+            if playSelf{
+                if TSBusinessAudioPlayer.shared.isLoading{
+                    return
+                }
+
+                if TSBusinessAudioPlayer.shared.isPlaying{
+                    TSBusinessAudioPlayer.shared.stop()
+                }else{
+                    TSBusinessAudioPlayer.shared.playUrlString(modelUrlString,indexPath: indexPath)
+                }
+                
             }else{
                 TSBusinessAudioPlayer.shared.playUrlString(modelUrlString,indexPath: indexPath)
             }
-            if isplay == false{
-                TSBusinessAudioPlayer.shared.playUrlString(modelUrlString,indexPath: indexPath)
-            }else{
-                TSBusinessAudioPlayer.shared.stop()
-            }
+            
+           
+            
         }
         return ringToneView
     }()

+ 1 - 1
AIRingtone/Business/TSDiscoverVC/TSDiscoverVC/View/TSDiscoverCell.swift

@@ -46,7 +46,7 @@ class TSDiscoverCell: TSBaseCollectionCell {
         super.renderView(with: object, component: component, attributes: attributes)
         if let itemModel = object as? TSColVVMItemModel{
             if let dataModel = itemModel.dataModel as? TSRingCategoryModel{
-                imageView.setAsyncImage(urlString: dataModel.cover,placeholder:kRingPlaceholderImage,contentMode: .scaleAspectFill)
+                imageView.setAsyncImage(urlString: dataModel.cover,placeholder:kPlaceholderImage,contentMode: .scaleAspectFill)
                 textLabel.text = dataModel.title
             }
         }

+ 12 - 3
AIRingtone/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift

@@ -175,6 +175,17 @@ class TSPurchaseVC: TSBaseVC {
         self.dismiss(animated: true)
     }
     
+    override func viewWillAppear(_ animated: Bool) {
+         super.viewWillAppear(animated)
+         // 禁用右滑返回手势
+         navigationController?.interactivePopGestureRecognizer?.isEnabled = false
+     }
+
+     override func viewWillDisappear(_ animated: Bool) {
+         super.viewWillDisappear(animated)
+         // 恢复右滑返回手势
+         navigationController?.interactivePopGestureRecognizer?.isEnabled = true
+     }
     
     deinit {
         cancellabel.removeAll()
@@ -188,7 +199,7 @@ extension TSPurchaseVC{
         let vc = TSPurchaseVC()
         vc.closePageBlock = closePageBlock
         let navi = TSBaseNavigationC(rootViewController: vc)
-        navi.modalPresentationStyle = .overFullScreen
+        navi.modalPresentationStyle = .fullScreen//.overFullScreen
         target.present(navi, animated: true)
     }
 
@@ -351,8 +362,6 @@ struct PurchaseItemView: View {
 struct TSVipRecView: View {
     var body: some View {
         
-        let corner = 16.0
-        
         HStack(spacing: 4) {
             Image("upvote_black").resizable().frame(width: 16, height: 16)
             Text("80% Choose").font(.font(size: 12,weight: .medium)).foregroundColor(.hex("#111111"))

+ 1 - 1
AIRingtone/Business/TSSetingVC/SetingVC/View/SettingPurchaseTopView.swift

@@ -85,7 +85,7 @@ struct SettingPurchaseTopView: View {
 
     // 定义一个返回 View 的方法
     func customTimeText(text:String) -> some View {
-        Text("Limited Time Discount")
+        Text(text)
             .font(.font(size: 14))
             .frame(height: 14)
             .foregroundColor(UIColor.white.withAlphaComponent(0.6).color)

+ 8 - 1
AIRingtone/Business/TSThemeVC/TSThemeSetVC/TSThemeSetRingToneView.swift

@@ -15,13 +15,20 @@ class TSThemeSetRingToneView: TSThemeSetItemView {
         numImageView.image = UIImage(named: "num_1")
         iconImageView.image = UIImage(named: "theme_icon_ringtone")
         diyView.addSubview(cellView)
-        (cellView).snp.makeConstraints { make in
+        cellView.snp.makeConstraints { make in
             make.top.bottom.equalToSuperview()
             make.width.equalTo(k_ScreenWidth-56)
             make.height.equalTo(72)
             make.center.equalToSuperview()
         }
     }
+    
+    override func dealThings() {
+    }
+    
+    func setClickPlayHandel(click:((Bool)->Void)?) {
+        cellView.clickPlayHandel = click
+    }
 }
 
 

+ 4 - 1
AIRingtone/Business/TSThemeVC/TSThemeSetVC/TSThemeSetVC.swift

@@ -33,7 +33,10 @@ class TSThemeSetVC: TSBaseVC {
         let ringView = TSThemeSetRingToneView()
         ringView.moreInfoBtn.isHidden = true
         ringView.setBtn.addTarget(self, action: #selector(clickSetRing), for: .touchUpInside)
-        ringView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(clickPlay)))
+        ringView.setClickPlayHandel { [weak self] paly in
+            guard let self = self else { return }
+            clickPlay()
+        }
         return ringView
     }()
     

+ 3 - 3
AIRingtone/Business/VIewTool/TSRingToneCellView.swift

@@ -78,12 +78,12 @@ class TSRingToneCellView: TSBaseView {
         }
         
         
-        clearBtn.backgroundColor = .yellow.withAlphaComponent(0.2)
+//        clearBtn.backgroundColor = .yellow.withAlphaComponent(0.2)
         contentView.addSubview(clearBtn)
         clearBtn.snp.makeConstraints { make in
             make.leading.top.bottom.equalToSuperview()
-//            make.trailing.equalTo(-200)
-            make.width.equalTo(72)
+//            make.width.equalTo(72)
+            make.trailing.equalTo(0)
         }
     }
     

+ 5 - 3
AIRingtone/Common/Tool/TSAudioPlayer/TSAudioPlayer.swift

@@ -65,10 +65,12 @@ class TSAudioPlayer : NSObject, AVAudioPlayerDelegate{
     /// 开始播放音频
     func play() {
         guard let audioPlayer = audioPlayer else { return }
-
-        if AVAudioSession.sharedInstance().outputVolume <= 0.1 {
+        let outputVolume = AVAudioSession.sharedInstance().outputVolume
+        dePrint("outputVolume\(outputVolume)")
+        
+        if outputVolume == 0.0 {
             TSToastShared.showToast(text: "Please turn up the volume".localized)
-         }
+        }
     
         audioPlayer.numberOfLoops = isLooping ? -1 : 0
         audioPlayer.play()

+ 8 - 1
AIRingtone/Common/Tool/TSBusinessAudioPlayer.swift

@@ -40,6 +40,14 @@ class TSBusinessAudioPlayer {
         return false
     }
     
+    var isLoading:Bool{
+        switch currentPlayerState {
+        case .loading(let float):
+            return float < 1.0 ? true : false
+        default:
+            return false
+        }
+    }
     
     //播放器是否可用
     var playerUsable:Bool {
@@ -118,7 +126,6 @@ class TSBusinessAudioPlayer {
                     self.changePlayerState(.loading(1.0))
                 
                     if isStopPlayingAfterLoading == true || currentURLString != urlString{
-                        self.stop()
                         isStopPlayingAfterLoading = false
                         return
                     }