浏览代码

4.3a改造:tssmallcocoapod 全部改造没有了

kln 1 周之前
父节点
当前提交
1af2531306

+ 9 - 49
AIPlayRingtones.xcodeproj/project.pbxproj

@@ -16,12 +16,10 @@
 		3DB4D4A12DDC2CCE0082596A /* ring_rtr_style.json in Resources */ = {isa = PBXBuildFile; fileRef = 3DB4D4A02DDC2CC90082596A /* ring_rtr_style.json */; };
 		3DB4D4A32DDC34100082596A /* ASRTRFileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB4D4A22DDC34020082596A /* ASRTRFileView.swift */; };
 		3DB4D4A52DDC8E830082596A /* APSettingVC+Col.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB4D4A42DDC8E7B0082596A /* APSettingVC+Col.swift */; };
-		3DB4D4A82DDC92560082596A /* ASBusinessWebVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB4D4A72DDC92530082596A /* ASBusinessWebVC.swift */; };
 		3DB4D4AA2DDDCEA50082596A /* Poppins-BoldItalic.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3DB4D4A92DDDCEA50082596A /* Poppins-BoldItalic.otf */; };
 		3DB4D4B22DDF0B960082596A /* FakeBlurView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB4D4B12DDF0B940082596A /* FakeBlurView.swift */; };
 		3DB4D4B52DE025920082596A /* ASTutorialsVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DB4D4B42DE025910082596A /* ASTutorialsVC.swift */; };
-		3DBEA0CE2DE69B2E000C6859 /* TSSimpleCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA0B52DE69B2E000C6859 /* TSSimpleCollectionView.swift */; };
-		3DBEA1102DE6A04B000C6859 /* SimpleWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA10F2DE6A04B000C6859 /* SimpleWebViewController.m */; };
+		3DBEA1102DE6A04B000C6859 /* ASWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA10F2DE6A04B000C6859 /* ASWebViewController.m */; };
 		3DBEA11A2DE6B086000C6859 /* CustomTabBarController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1192DE6B086000C6859 /* CustomTabBarController.m */; };
 		3DBEA11E2DE6B229000C6859 /* NSString+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA11D2DE6B229000C6859 /* NSString+AS.m */; };
 		3DBEA1252DE6B36D000C6859 /* UIColor+AS.m in Sources */ = {isa = PBXBuildFile; fileRef = 3DBEA1242DE6B36D000C6859 /* UIColor+AS.m */; };
@@ -138,13 +136,11 @@
 		3DB4D4A02DDC2CC90082596A /* ring_rtr_style.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = ring_rtr_style.json; sourceTree = "<group>"; };
 		3DB4D4A22DDC34020082596A /* ASRTRFileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASRTRFileView.swift; sourceTree = "<group>"; };
 		3DB4D4A42DDC8E7B0082596A /* APSettingVC+Col.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "APSettingVC+Col.swift"; sourceTree = "<group>"; };
-		3DB4D4A72DDC92530082596A /* ASBusinessWebVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASBusinessWebVC.swift; sourceTree = "<group>"; };
 		3DB4D4A92DDDCEA50082596A /* Poppins-BoldItalic.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-BoldItalic.otf"; sourceTree = "<group>"; };
 		3DB4D4B12DDF0B940082596A /* FakeBlurView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeBlurView.swift; sourceTree = "<group>"; };
 		3DB4D4B42DE025910082596A /* ASTutorialsVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASTutorialsVC.swift; sourceTree = "<group>"; };
-		3DBEA0B52DE69B2E000C6859 /* TSSimpleCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSSimpleCollectionView.swift; sourceTree = "<group>"; };
-		3DBEA10E2DE6A04B000C6859 /* SimpleWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SimpleWebViewController.h; sourceTree = "<group>"; };
-		3DBEA10F2DE6A04B000C6859 /* SimpleWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SimpleWebViewController.m; sourceTree = "<group>"; };
+		3DBEA10E2DE6A04B000C6859 /* ASWebViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ASWebViewController.h; sourceTree = "<group>"; };
+		3DBEA10F2DE6A04B000C6859 /* ASWebViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ASWebViewController.m; sourceTree = "<group>"; };
 		3DBEA1182DE6B086000C6859 /* CustomTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CustomTabBarController.h; sourceTree = "<group>"; };
 		3DBEA1192DE6B086000C6859 /* CustomTabBarController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CustomTabBarController.m; sourceTree = "<group>"; };
 		3DBEA11C2DE6B229000C6859 /* NSString+AS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSString+AS.h"; sourceTree = "<group>"; };
@@ -303,14 +299,6 @@
 			path = View;
 			sourceTree = "<group>";
 		};
-		3DB4D4A62DDC924B0082596A /* ASBusinessWebVC */ = {
-			isa = PBXGroup;
-			children = (
-				3DB4D4A72DDC92530082596A /* ASBusinessWebVC.swift */,
-			);
-			path = ASBusinessWebVC;
-			sourceTree = "<group>";
-		};
 		3DB4D4AD2DDDCED00082596A /* Ex */ = {
 			isa = PBXGroup;
 			children = (
@@ -338,37 +326,13 @@
 			path = ASTutorialsVC;
 			sourceTree = "<group>";
 		};
-		3DBEA0B62DE69B2E000C6859 /* TSReusableCollectionView */ = {
-			isa = PBXGroup;
-			children = (
-				3DBEA0B52DE69B2E000C6859 /* TSSimpleCollectionView.swift */,
-			);
-			path = TSReusableCollectionView;
-			sourceTree = "<group>";
-		};
-		3DBEA0C52DE69B2E000C6859 /* View */ = {
-			isa = PBXGroup;
-			children = (
-				3DBEA0B62DE69B2E000C6859 /* TSReusableCollectionView */,
-			);
-			path = View;
-			sourceTree = "<group>";
-		};
-		3DBEA0C72DE69B2E000C6859 /* Classes */ = {
-			isa = PBXGroup;
-			children = (
-				3DBEA0C52DE69B2E000C6859 /* View */,
-			);
-			path = Classes;
-			sourceTree = "<group>";
-		};
-		3DBEA10D2DE6A02F000C6859 /* SimpleWebViewController */ = {
+		3DBEA10D2DE6A02F000C6859 /* ASWebViewController */ = {
 			isa = PBXGroup;
 			children = (
-				3DBEA10E2DE6A04B000C6859 /* SimpleWebViewController.h */,
-				3DBEA10F2DE6A04B000C6859 /* SimpleWebViewController.m */,
+				3DBEA10E2DE6A04B000C6859 /* ASWebViewController.h */,
+				3DBEA10F2DE6A04B000C6859 /* ASWebViewController.m */,
 			);
-			path = SimpleWebViewController;
+			path = ASWebViewController;
 			sourceTree = "<group>";
 		};
 		3DBEA1132DE6B037000C6859 /* CustomTabBarController */ = {
@@ -533,7 +497,6 @@
 		A848F8812DD6D1AF00B746EC /* AIPlayRingtones */ = {
 			isa = PBXGroup;
 			children = (
-				3DBEA0C72DE69B2E000C6859 /* Classes */,
 				A848F88F2DD6D4E800B746EC /* Common */,
 				A800FEAF2DDAC0E9009DABDC /* CommonView */,
 				A848F8EF2DD7526600B746EC /* OperationQueue */,
@@ -554,8 +517,7 @@
 			isa = PBXGroup;
 			children = (
 				3DBEA1132DE6B037000C6859 /* CustomTabBarController */,
-				3DBEA10D2DE6A02F000C6859 /* SimpleWebViewController */,
-				3DB4D4A62DDC924B0082596A /* ASBusinessWebVC */,
+				3DBEA10D2DE6A02F000C6859 /* ASWebViewController */,
 				A848F8B62DD6DF5500B746EC /* ASCommonView */,
 				A848F8AE2DD6D76F00B746EC /* ASTabBarVC */,
 				A848F8A72DD6D74300B746EC /* APSettingVC */,
@@ -950,7 +912,6 @@
 				3DB4D4972DDC28D40082596A /* APAudioToRingVC+View.swift in Sources */,
 				A800FEBD2DDACCD4009DABDC /* ASRingGeneratorBaseVC.swift in Sources */,
 				A800FEB62DDAC764009DABDC /* ASGeneratorErrorView.swift in Sources */,
-				3DB4D4A82DDC92560082596A /* ASBusinessWebVC.swift in Sources */,
 				3DBEA1602DE6F322000C6859 /* GlobalImports.swift in Sources */,
 				A800FEB82DDAC826009DABDC /* TSNetWork+Error.swift in Sources */,
 				A848F8FA2DD7536700B746EC /*  Notification+Ex.swift in Sources */,
@@ -999,7 +960,7 @@
 				3DBEA1762DE6FB18000C6859 /* ASFileManager.swift in Sources */,
 				A848F8C42DD6E70500B746EC /* APRingTonesVC+Style.swift in Sources */,
 				A848F8F82DD752E700B746EC /* ASGenerateTextToRingOperation.swift in Sources */,
-				3DBEA1102DE6A04B000C6859 /* SimpleWebViewController.m in Sources */,
+				3DBEA1102DE6A04B000C6859 /* ASWebViewController.m in Sources */,
 				A800FEB42DDAC73E009DABDC /* ASGeneratorLoadingView.swift in Sources */,
 				A848F8EC2DD74EF800B746EC /* ASActionInfoModel.swift in Sources */,
 				A848F8F62DD752D700B746EC /* ASGenerateBaseOperation.swift in Sources */,
@@ -1020,7 +981,6 @@
 				3DBEA17C2DE70336000C6859 /* ASSaveResultManager.swift in Sources */,
 				A848F8C62DD6E72D00B746EC /* APRingTonesVC+View.swift in Sources */,
 				A848F8862DD6D1AF00B746EC /* AppDelegate.swift in Sources */,
-				3DBEA0CE2DE69B2E000C6859 /* TSSimpleCollectionView.swift in Sources */,
 				3DBEA1312DE6D825000C6859 /* ASBaseCollectionCell.m in Sources */,
 				3DBEA12B2DE6BCE3000C6859 /* ASBaseNavigationController.m in Sources */,
 				3DBEA1562DE6EBAD000C6859 /* UIButton+AS.swift in Sources */,

+ 2 - 0
AIPlayRingtones/AIPlayRingtones-Bridging-Header.h

@@ -22,3 +22,5 @@
 #import "ASRandomTextTool.h"
 #import "ASColObserver.h"
 #import "ASFileManager.h"
+#import "ASWebViewController.h"
+

+ 55 - 45
AIPlayRingtones/AppPage/APAudioToRingVC/View/ASRTRStyleView.swift

@@ -14,7 +14,7 @@ class ASRTRStyleView: ASBaseView {
         didSet{
             if generateStyleModels.count <= 0 { return }
             DispatchQueue.main.async {
-                self.colView.collectionView.selectItem(at: IndexPath(item: self.generateStyleIndex, section: 0), animated: true, scrollPosition: .centeredVertically)
+                self.collectionView.selectItem(at: IndexPath(item: self.generateStyleIndex, section: 0), animated: false, scrollPosition: .left)
             }
         }
     }
@@ -22,7 +22,7 @@ class ASRTRStyleView: ASBaseView {
     var generateStyleModels:[ASGenerateStyleModel] = []
     {
         didSet{
-            colView.reload(with: [TSSimpleSectionData(items: generateStyleModels)])
+            collectionView.reloadData()
             self.generateStyleIndex = abs(generateStyleIndex)
         }
     }
@@ -35,30 +35,35 @@ class ASRTRStyleView: ASBaseView {
     }
 
     private var collectionViewObserver: ASColObserver!
-    lazy var colView: TSSimpleCollectionView = {
-        let identifier = "ASRTRStyleViewCell"
-
+    lazy var layout: UICollectionViewFlowLayout = {
         let layout = UICollectionViewFlowLayout()
-        let cp = TSSimpleCollectionView()
-        cp.collectionView.isScrollEnabled = false
-        cp.layout.minimumLineSpacing = 16
-        cp.layout.minimumInteritemSpacing = 8
-        cp.layout.scrollDirection = .vertical
-        cp.delegate = self
-        let contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
-        cp.collectionView.contentInset = contentInset
-        cp.layout.itemSize = kGetCollectionViewCellSize(sectionInset: contentInset, itemSpacing: 16, originalSize: CGSize(width: 80, height: 104), cellRowNum: 4)
-        cp.registerCell(ASRTRStyleViewCell.self,identifier:identifier)
-        cp.cellIdentifierForItem = { data in
-            return identifier
+        layout.scrollDirection = .vertical
+        layout.itemSize = kGetCollectionViewCellSize(sectionInset: UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16), itemSpacing: 16, originalSize: CGSize(width: 80, height: 104), cellRowNum: 4)
+        layout.minimumInteritemSpacing = 8
+        layout.minimumLineSpacing = 16
+        return layout
+    }()
+    
+    lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.isScrollEnabled = false
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = .clear
+        collectionView.contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
+        collectionView.register(ASRTRStyleViewCell.self, forCellWithReuseIdentifier: ASRTRStyleViewCell.cellID)
+        if #available(iOS 11.0, *) {
+            collectionView.contentInsetAdjustmentBehavior = .never
         }
-
-        return cp
+        return collectionView
     }()
     
+    
     override func creatUI() {
-        contentView.addSubview(colView)
-        colView.snp.makeConstraints { make in
+        contentView.addSubview(collectionView)
+        collectionView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
             make.height.equalTo(0)
         }
@@ -67,45 +72,50 @@ class ASRTRStyleView: ASBaseView {
     override func dealThings() {
 
         // 监听collectionView 的 contentSize
-        collectionViewObserver = ASColObserver(collectionView: colView.collectionView)
+        collectionViewObserver = ASColObserver(collectionView: collectionView)
         collectionViewObserver.onContentSizeChange = { [weak self] size in
             guard let self = self else { return }
             print("collectionViewObserver 内容大小变化: \(size)")
-            self.colView.snp.updateConstraints { make in
+            self.collectionView.snp.updateConstraints { make in
                 make.height.equalTo(size.height)
             }
         }
     }
 }
-
-extension ASRTRStyleView: TSSimpleCollectionViewDelegate {
+extension ASRTRStyleView: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
     
-    func collectionView(didTrigger event: TSSimpleCellEvent) {
-        switch event.action {
-        case .tap:
-            generateStyleIndex = event.indexPath.row
-            if let model = generateStyleModels.safeAny(At: generateStyleIndex) {
-                generateStyleModel = model
-            }
-        default:
-            break
+    public func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return generateStyleModels.count
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ASRTRStyleViewCell.cellID, for: indexPath) as! ASRTRStyleViewCell
+        if let model = generateStyleModels.safeAny(At: indexPath.item){
+            cell.model = model
+        }
+        return cell
+    }
+
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        generateStyleIndex = indexPath.item
+        if let model = generateStyleModels.safeAny(At: generateStyleIndex) {
+            generateStyleModel = model
         }
     }
     
 }
 
-
-class ASRTRStyleViewCell: ASBaseCollectionCell ,TSSimpleConfigurableView {
-    
-    weak var delegate: (any TSSimpleCollectionViewDelegate)?
-    var indexPath: IndexPath = IndexPath(item: 0, section: 0)
-    var data: Any? {
+class ASRTRStyleViewCell: ASBaseCollectionCell  {
+    static let cellID = "ASRTRStyleViewCell"
+    var model: ASGenerateStyleModel = ASGenerateStyleModel()  {
         didSet {
-            if let model = data as? ASGenerateStyleModel {
-                proImageView.isHidden = !model.vip
-                textLab.text = model.imageText.localized
-                imageView.image = UIImage(named: model.imageName)
-            }
+            proImageView.isHidden = !model.vip
+            textLab.text = model.imageText.localized
+            imageView.image = UIImage(named: model.imageName)
         }
     }
     

+ 56 - 46
AIPlayRingtones/AppPage/APRingTonesVC/APRingStyleVC/APRingStyleVC.swift

@@ -15,7 +15,7 @@ class APRingStyleVC: ASBaseViewController {
         didSet{
             if generateStyleModels.count <= 0 { return }
             DispatchQueue.main.async {
-                self.colView.collectionView.selectItem(at: IndexPath(item: self.generateStyleIndex, section: 0), animated: true, scrollPosition: .centeredVertically)
+                self.collectionView.selectItem(at: IndexPath(item: self.generateStyleIndex, section: 0), animated: true, scrollPosition: .centeredVertically)
             }
         }
     }
@@ -40,31 +40,35 @@ class APRingStyleVC: ASBaseViewController {
     }()
     
     private var collectionViewObserver: ASColObserver!
-    lazy var colView: TSSimpleCollectionView = {
-        let identifier = "APRingStyleCell"
-
+    lazy var layout: UICollectionViewFlowLayout = {
         let layout = UICollectionViewFlowLayout()
-        let cp = TSSimpleCollectionView()
-        cp.collectionView.isScrollEnabled = false
-        cp.layout.minimumLineSpacing = 16
-        cp.layout.minimumInteritemSpacing = 16
-        cp.layout.scrollDirection = .vertical
-        cp.delegate = self
-        let contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
-        cp.collectionView.contentInset = contentInset
-        cp.layout.itemSize = kGetCollectionViewCellSize(sectionInset: contentInset, itemSpacing: 16, originalSize: CGSize(width: 104, height: 104), cellRowNum: 3)
-        cp.registerCell(APRingStyleCell.self,identifier:identifier)
-        cp.cellIdentifierForItem = { data in
-            return identifier
+        layout.scrollDirection = .vertical
+        layout.itemSize = kGetCollectionViewCellSize(sectionInset: UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16), itemSpacing: 16, originalSize: CGSize(width: 104, height: 104), cellRowNum: 3)
+        layout.minimumInteritemSpacing = 16
+        layout.minimumLineSpacing = 16
+        return layout
+    }()
+    
+    lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.isScrollEnabled = false
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = .clear
+        collectionView.contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
+        collectionView.register(APRingStyleCell.self, forCellWithReuseIdentifier: APRingStyleCell.cellID)
+        if #available(iOS 11.0, *) {
+            collectionView.contentInsetAdjustmentBehavior = .never
         }
-
-        return cp
+        return collectionView
     }()
     
     override func createView() {
         setNavBarViewHidden(true)
-        contentView.addSubview(colView)
-        colView.snp.makeConstraints { make in
+        contentView.addSubview(collectionView)
+        collectionView.snp.makeConstraints { make in
             make.edges.equalToSuperview()
             make.height.equalTo(k_ScreenHeight)
         }
@@ -73,48 +77,54 @@ class APRingStyleVC: ASBaseViewController {
     override func dealThings() {
 
         // 监听collectionView 的 contentSize
-        collectionViewObserver = ASColObserver(collectionView: colView.collectionView)
+        collectionViewObserver = ASColObserver(collectionView: collectionView)
         collectionViewObserver.onContentSizeChange = { [weak self] size in
             guard let self = self else { return }
             print("collectionViewObserver 内容大小变化: \(size)")
-            self.colView.snp.updateConstraints { make in
+            collectionView.snp.updateConstraints { make in
                 make.height.equalTo(size.height)
             }
         }
         
-        colView.reload(with: [TSSimpleSectionData(items: generateStyleModels)])
+        collectionView.reloadData()
         self.generateStyleIndex = abs(generateStyleIndex)
     }
 }
-extension APRingStyleVC: TSSimpleCollectionViewDelegate {
-    
-    func collectionView(didTrigger event: TSSimpleCellEvent) {
-        switch event.action {
-        case .tap:
-            generateStyleIndex = event.indexPath.row
-            if let model = generateStyleModels.safeAny(At: generateStyleIndex) {
-                generateStyleModel = model
-            }
-        default:
-            break
+
+extension APRingStyleVC: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
+    
+    public func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return generateStyleModels.count
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: APRingStyleCell.cellID, for: indexPath) as! APRingStyleCell
+        if let model = generateStyleModels.safeAny(At: indexPath.item){
+            cell.model = model
+        }
+        return cell
+    }
+
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        generateStyleIndex = indexPath.item
+        if let model = generateStyleModels.safeAny(At: generateStyleIndex) {
+            generateStyleModel = model
         }
     }
     
 }
 
-
-
-class APRingStyleCell: ASBaseCollectionCell ,TSSimpleConfigurableView {
-    
-    weak var delegate: (any TSSimpleCollectionViewDelegate)?
-    var indexPath: IndexPath = IndexPath(item: 0, section: 0)
-    var data: Any? {
+class APRingStyleCell: ASBaseCollectionCell {
+    static let cellID = "APRingStyleCell"
+    var model: ASGenerateStyleModel = ASGenerateStyleModel()  {
         didSet {
-            if let model = data as? ASGenerateStyleModel {
-                proImageView.isHidden = !model.vip
-                textLab.text = model.imageText.localized
-                imageView.image = UIImage(named: model.imageName)
-            }
+            proImageView.isHidden = !model.vip
+            textLab.text = model.imageText.localized
+            imageView.image = UIImage(named: model.imageName)
         }
     }
     

+ 51 - 39
AIPlayRingtones/AppPage/APRingTonesVC/APRingTonesVC/View/ASDurationColView.swift

@@ -12,37 +12,43 @@ class ASGenerateDurationColView: ASBaseView {
     var currentSelectedIndex:Int = 0 {
         didSet{
             if self.secModelArray.count <= 0 { return }
-            collectionView.collectionView.selectItem(at: IndexPath(item: currentSelectedIndex, section: 0), animated: true, scrollPosition: .centeredHorizontally)
+            collectionView.selectItem(at: IndexPath(item: currentSelectedIndex, section: 0), animated: true, scrollPosition: .centeredHorizontally)
         }
     }
     var secModelArray:[ASRingGenerateSecModel] = [] {
         didSet{
-            collectionView.reload(with: [TSSimpleSectionData(items: secModelArray)])
+            collectionView.reloadData()
             let index = currentSelectedIndex
             kExecuteOnMainThread {
                 self.currentSelectedIndex = index
             }
         }
     }
-    lazy var collectionView: TSSimpleCollectionView = {
-        let identifier = "ASDurationColViewCell"
 
+    lazy var layout: UICollectionViewFlowLayout = {
         let layout = UICollectionViewFlowLayout()
-        let cp = TSSimpleCollectionView()
-        cp.layout.itemSize = CGSize(width: 88, height: 36)
-        cp.layout.minimumLineSpacing = 16
-        cp.layout.minimumInteritemSpacing = 0
-        cp.layout.scrollDirection = .horizontal
-        cp.delegate = self
-        cp.collectionView.contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
-        cp.registerCell(ASDurationColViewCell.self,identifier:identifier)
-        cp.cellIdentifierForItem = { data in
-            return identifier
-        }
-
-        return cp
+        layout.scrollDirection = .horizontal
+        layout.itemSize = CGSize(width: 88, height: 36)
+        layout.minimumInteritemSpacing = 0
+        layout.minimumLineSpacing = 16
+        return layout
     }()
     
+    lazy var collectionView: UICollectionView = {
+        let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
+        collectionView.isScrollEnabled = false
+        collectionView.delegate = self
+        collectionView.dataSource = self
+        collectionView.showsVerticalScrollIndicator = false
+        collectionView.showsHorizontalScrollIndicator = false
+        collectionView.backgroundColor = .clear
+        collectionView.contentInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)
+        collectionView.register(ASDurationColViewCell.self, forCellWithReuseIdentifier: ASDurationColViewCell.cellID)
+        if #available(iOS 11.0, *) {
+            collectionView.contentInsetAdjustmentBehavior = .never
+        }
+        return collectionView
+    }()
     
     override func creatUI(){
         contentView.addSubview(collectionView)
@@ -51,37 +57,43 @@ class ASGenerateDurationColView: ASBaseView {
         }
     }
 }
-extension ASGenerateDurationColView: TSSimpleCollectionViewDelegate {
+
+extension ASGenerateDurationColView: UICollectionViewDataSource ,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout {
     
-    func collectionView(didTrigger event: TSSimpleCellEvent) {
-        switch event.action {
-        case .tap:
-            currentSelectedIndex = event.indexPath.row
-            if let model = secModelArray.safeAny(At: currentSelectedIndex) {
-                selectedCompleted?(model,currentSelectedIndex)
-            }
-        default:
-            break
-        }
+    public func numberOfSections(in collectionView: UICollectionView) -> Int {
+        return 1
     }
     
-}
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        return secModelArray.count
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: ASDurationColViewCell.cellID, for: indexPath) as! ASDurationColViewCell
+        if let model = secModelArray.safeAny(At: indexPath.item){
+            cell.model = model
+        }
+        return cell
+    }
 
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        currentSelectedIndex = indexPath.row
+        if let model = secModelArray.safeAny(At: currentSelectedIndex) {
+            selectedCompleted?(model,currentSelectedIndex)
+        }
+    }
 
+}
 
-class ASDurationColViewCell: ASBaseCollectionCell ,TSSimpleConfigurableView {
-    
-    weak var delegate: (any TSSimpleCollectionViewDelegate)?
-    var indexPath: IndexPath = IndexPath(item: 0, section: 0)
-    var data: Any? {
+
+class ASDurationColViewCell: ASBaseCollectionCell {
+    static let cellID = "ASDurationColViewCell"
+    var model: ASRingGenerateSecModel = ASRingGenerateSecModel()  {
         didSet {
-            if let model = data as? ASRingGenerateSecModel {
-                textLab.text = "\(model.duration) Sec"
-                proImageView.isHidden = !model.vip
-            }
+            textLab.text = "\(model.duration) Sec"
+            proImageView.isHidden = !model.vip
         }
     }
-    
     override var isSelected: Bool{
         didSet{
             bgImageView.image = isSelected ? .secSelectedBg : .secUnSelectedBg

+ 2 - 2
AIPlayRingtones/AppPage/APSettingVC/APSettingVC.swift

@@ -105,7 +105,7 @@ class APSettingVC: ASBaseViewController {
                 rightIsHave: true,
                 tapBlock: { [weak self] model, _, _ in
                 guard let self = self else { return }
-                 let vc = ASBusinessWebVC(urlType: .privacy)
+                 let vc = ASWebViewController(urlString: "https://doc-hosting.flycricket.io/ai-ringtones-privacy-policy/ad14f989-96c0-4f31-a711-8db8b288d0e2/privacy", titleString: "Privacy Policy".localized)!
                  vc.hidesBottomBarWhenPushed = true
                  navigationController?.pushViewController(vc, animated: true)
         }))
@@ -117,7 +117,7 @@ class APSettingVC: ASBaseViewController {
                 rightIsHave: true,
                 tapBlock: { [weak self] model, _, _ in
                    guard let self = self else { return }
-                    let vc = ASBusinessWebVC(urlType: .terms)
+                    let vc = ASWebViewController(urlString: "https://doc-hosting.flycricket.io/ai-ringtones-terms-of-use/4f89d174-1559-453f-b12c-47a85e21cc01/terms", titleString: "Terms of Service".localized)!
                     vc.hidesBottomBarWhenPushed = true
                     navigationController?.pushViewController(vc, animated: true)
         }))

+ 0 - 73
AIPlayRingtones/AppPage/ASBusinessWebVC/ASBusinessWebVC.swift

@@ -1,73 +0,0 @@
-//
-//  ASBusinessWebVC.swift
-//  AIPlayRingtones
-//
-//  Created by mini on 2025/5/20.
-//
-
-
-import UIKit
-import WebKit
-class ASBusinessWebVC: ASBaseViewController , WKNavigationDelegate {
-    
-    enum UrlType:String {
-        case privacy = "https://doc-hosting.flycricket.io/ai-ringtones-privacy-policy/ad14f989-96c0-4f31-a711-8db8b288d0e2/privacy"
-        case terms = "https://doc-hosting.flycricket.io/ai-ringtones-terms-of-use/4f89d174-1559-453f-b12c-47a85e21cc01/terms"
-
-        func getTitle() -> String {
-            switch self {
-            case .privacy:
-                return "Privacy Policy".localized
-            case .terms:
-                return "Terms of Service".localized
-            }
-        }
-    }
-    
-    private var webView: WKWebView!
-    private var urlType: UrlType
-    private var progressView: UIProgressView!
-    
-    init(urlType: UrlType) {
-        self.urlType = urlType
-        super.init()
-    }
-    
-    required init?(coder: NSCoder) {
-        fatalError("init(coder:) has not been implemented")
-    }
-    
-    override func createView() {
-        addNormalNavBarView()
-        setPageTitle(urlType.getTitle())
-    }
-    
-    override func viewDidLoad() {
-        super.viewDidLoad()
-        setupWebView()
-        loadURL()
-    }
-    
-    private func setupWebView() {
-        // 初始化 WKWebView
-        let webConfiguration = WKWebViewConfiguration()
-        webView = WKWebView(frame: .zero, configuration: webConfiguration)
-        webView.navigationDelegate = self
-        webView.translatesAutoresizingMaskIntoConstraints = false
-        contentView.addSubview(webView)
-        webView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-    }
-
-    private func loadURL() {
-        guard let url = URL(string: urlType.rawValue) else {
-            logPrint("无效的 URL")
-            return
-        }
-        let request = URLRequest(url: url)
-        webView.load(request)
-    }
-    
-}

+ 6 - 6
AIPlayRingtones/AppPage/SimpleWebViewController/SimpleWebViewController.h → AIPlayRingtones/AppPage/ASWebViewController/ASWebViewController.h

@@ -1,5 +1,5 @@
 //
-//  SimpleWebViewController.h
+//  ASWebViewController.h
 //  AIPlayRingtones
 //
 //  Created by mini on 2025/5/27.
@@ -7,16 +7,16 @@
 
 #import <UIKit/UIKit.h>
 #import <WebKit/WebKit.h>
-
-@interface SimpleWebViewController : UIViewController  <WKNavigationDelegate, WKUIDelegate>
+#import "ASBaseViewController.h"
+@interface ASWebViewController : ASBaseViewController  <WKNavigationDelegate, WKUIDelegate>
 
 @property (nonatomic, strong) WKWebView *webView;
 @property (nonatomic, strong) UIProgressView *progressView;
 @property (nonatomic, strong) NSURL *urlToLoad;
-
+@property (nonatomic, copy) NSString * titleString;
 // 初始化方法
-- (instancetype)initWithURL:(NSURL *)url;
-- (instancetype)initWithURLString:(NSString *)urlString;
+- (instancetype)initWithURL:(NSURL *)url titleString:(NSString *)titleString;
+- (instancetype)initWithURLString:(NSString *)urlString titleString:(NSString *)titleString;
 
 // 加载URL
 - (void)loadURL:(NSURL *)url;

+ 12 - 10
AIPlayRingtones/AppPage/SimpleWebViewController/SimpleWebViewController.m → AIPlayRingtones/AppPage/ASWebViewController/ASWebViewController.m

@@ -1,41 +1,43 @@
 //
-//  SimpleWebViewController.m
+//  ASWebViewController.m
 //  AIPlayRingtones
 //
 //  Created by mini on 2025/5/27.
 //
 
-#import "SimpleWebViewController.h"
+#import "ASWebViewController.h"
 
-@interface SimpleWebViewController ()
+@interface ASWebViewController ()
 
 @property (nonatomic, strong) WKWebViewConfiguration *webConfig;
 @property (nonatomic, assign) BOOL isObservingProgress;
 
 @end
 
-@implementation SimpleWebViewController
+@implementation ASWebViewController
 
 #pragma mark - Initialization
 
-- (instancetype)initWithURL:(NSURL *)url {
+- (instancetype)initWithURL:(NSURL *)url titleString:(NSString *)titleString {
     self = [super init];
     if (self) {
         _urlToLoad = url;
+        _titleString = titleString;
     }
     return self;
 }
 
-- (instancetype)initWithURLString:(NSString *)urlString {
+- (instancetype)initWithURLString:(NSString *)urlString titleString:(NSString *)titleString {
     NSURL *url = [NSURL URLWithString:urlString];
-    return [self initWithURL:url];
+    return [self initWithURL:url titleString:titleString];
 }
 
 #pragma mark - Lifecycle
 
 - (void)viewDidLoad {
     [super viewDidLoad];
-    
+    [self addNormalNavBarView];
+    [self setPageTitle:_titleString];
     [self setupWebView];
     [self setupProgressView];
     [self setupNavigationItems];
@@ -76,12 +78,12 @@
 - (void)setupWebView {
     self.webConfig = [[WKWebViewConfiguration alloc] init];
     
-    self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds configuration:self.webConfig];
+    self.webView = [[WKWebView alloc] initWithFrame:self.contentView.bounds configuration:self.webConfig];
     self.webView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
     self.webView.navigationDelegate = self;
     self.webView.UIDelegate = self;
     
-    [self.view addSubview:self.webView];
+    [self.contentView addSubview:self.webView];
 }
 
 - (void)setupProgressView {

+ 0 - 201
AIPlayRingtones/Classes/View/TSReusableCollectionView/TSSimpleCollectionView.swift

@@ -1,201 +0,0 @@
-//
-//  TSReusableCollectionView.swift
-//  Pods
-//
-//  Created by 100Years on 2025/4/25.
-//
-import UIKit
-
-// 单元格配置协议
-public protocol TSSimpleConfigurableView {
-    var data:Any? { get set }
-    var delegate:TSSimpleCollectionViewDelegate? { get set }
-    var indexPath:IndexPath { get set }
-}
-
-public extension TSSimpleConfigurableView {
-    func actionCustom(custom:String){
-        delegate?.collectionView(didTrigger: TSSimpleCellEvent(action: .custom(custom), indexPath: indexPath, data: data))
-    }
-}
-
-// 单元格事件类型
-public enum TSSimpleCellAction {
-    case tap
-    case buttonTapped(String) // 支持自定义按钮标识
-    case custom(String)
-}
-
-// 回调参数结构体
-public struct TSSimpleCellEvent {
-    public let action: TSSimpleCellAction
-    public let indexPath: IndexPath
-    public let data: Any?
-    
-    public init(action: TSSimpleCellAction, indexPath: IndexPath, data: Any) {
-        self.action = action
-        self.indexPath = indexPath
-        self.data = data
-    }
-}
-
-// 集合视图回调协议
-public protocol TSSimpleCollectionViewDelegate: AnyObject {
-    func collectionView(didTrigger event: TSSimpleCellEvent)
-}
-
-
-public class TSSimpleSectionData {
-    public var title: String = ""
-    public var items: [Any] = []
-    
-    public init(
-        title:String = "",
-        items:[Any] = []
-    ) {
-        self.title = title
-        self.items = items
-    }
-}
-
-open class TSSimpleCollectionView: UIView {
-    
-    public lazy var layout: UICollectionViewFlowLayout = {
-        let layout = UICollectionViewFlowLayout()
-        layout.scrollDirection = .vertical
-        return layout
-    }()
-    
-    // MARK: - Properties
-    public  lazy var collectionView: UICollectionView = {
-        let cv = UICollectionView(frame: .zero, collectionViewLayout: layout)
-        // 禁用自动 contentInset 调整
-        if #available(iOS 11.0, *) {
-            cv.contentInsetAdjustmentBehavior = .never
-        }
-        cv.backgroundColor = .clear
-        cv.delegate = self
-        cv.dataSource = self
-        cv.showsHorizontalScrollIndicator = false
-        cv.showsVerticalScrollIndicator = false
-        return cv
-    }()
-    
-    public var sections: [TSSimpleSectionData] = []
-    public weak var delegate: TSSimpleCollectionViewDelegate?
-    
-    public var cellTypes: [String: (UIView & TSSimpleConfigurableView).Type] = [:]
-    public var cellIdentifierForItem: ((Any) -> String)?
-    
-    public var headerTypes: [String: (UIView & TSSimpleConfigurableView).Type] = [:]
-    public var headerIdentifierForItem: ((Any) -> String)?
-    
-    public var bottomTypes: [String: (UIView & TSSimpleConfigurableView).Type] = [:]
-    public var bottomIdentifierForItem: ((Any) -> String)?
-    
-    // MARK: - Initialization
-    override init(frame: CGRect) {
-        super.init(frame: frame)
-        setupViews()
-    }
-    
-    required public init?(coder: NSCoder) {
-        super.init(coder: coder)
-        setupViews()
-    }
-    
-    private func setupViews() {
-        addSubview(collectionView)
-        collectionView.translatesAutoresizingMaskIntoConstraints = false
-        NSLayoutConstraint.activate([
-            collectionView.topAnchor.constraint(equalTo: topAnchor),
-            collectionView.leadingAnchor.constraint(equalTo: leadingAnchor),
-            collectionView.trailingAnchor.constraint(equalTo: trailingAnchor),
-            collectionView.bottomAnchor.constraint(equalTo: bottomAnchor)
-        ])
-    }
-    
-    // MARK: - Public Methods
-    public func registerCell<Cell: UIView & TSSimpleConfigurableView>(_ cellType: Cell.Type, identifier: String) {
-        cellTypes[identifier] = cellType
-        collectionView.register(cellType, forCellWithReuseIdentifier: identifier)
-    }
-    
-    public func registerSectionHeader<Cell: UIView & TSSimpleConfigurableView>(_ cellType: Cell.Type, identifier: String) {
-        headerTypes[identifier] = cellType
-        collectionView.register(cellType, forSupplementaryViewOfKind: UICollectionView.elementKindSectionHeader, withReuseIdentifier: identifier)
-    }
-    
-    public func registerSectionFooter<Cell: UIView & TSSimpleConfigurableView>(_ cellType: Cell.Type, identifier: String) {
-        bottomTypes[identifier] = cellType
-        collectionView.register(cellType, forSupplementaryViewOfKind: UICollectionView.elementKindSectionFooter, withReuseIdentifier: identifier)
-    }
-    
-    public func reload(with sections: [TSSimpleSectionData]) {
-        self.sections = sections
-        collectionView.reloadData()
-    }
-    
-    public func reloadItem(at indexPath: IndexPath) {
-        collectionView.reloadItems(at: [indexPath])
-    }
-    
-    public func reloadSection(_ section: Int) {
-        collectionView.reloadSections(IndexSet(integer: section))
-    }
-}
-
-// MARK: - UICollectionViewDataSource & Delegate
-extension TSSimpleCollectionView: UICollectionViewDataSource, UICollectionViewDelegate {
-    public func numberOfSections(in collectionView: UICollectionView) -> Int {
-        return sections.count
-    }
-    
-    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
-        return sections[section].items.count
-    }
-    
-    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
-        let data = sections[indexPath.section].items[indexPath.item]
-        let identifier = cellIdentifierForItem?(data) ?? String(describing: type(of: data))
-        
-        guard let cellType = cellTypes[identifier] else {
-            fatalError("未注册对应数据类型的单元格: \(identifier)")
-        }
-        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: identifier, for: indexPath)
-       
-        if var configurableCell = cell as? (UICollectionViewCell & TSSimpleConfigurableView) {
-            
-            configurableCell.data = data
-            weak var delegate: TSSimpleCollectionViewDelegate? = delegate
-            configurableCell.delegate = delegate
-            configurableCell.indexPath = indexPath
-        }
-        
-        return cell
-    }
-    
-    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
-        let data = sections[indexPath.section].items[indexPath.item]
-        let event = TSSimpleCellEvent(action: .tap, indexPath: indexPath, data: data)
-        delegate?.collectionView(didTrigger: event)
-    }
-    
-    
-    public func collectionView(_ collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, at indexPath: IndexPath) -> UICollectionReusableView {
-        let data = sections[indexPath.section]
-        let identifier = headerIdentifierForItem?(data) ?? String(describing: type(of: data))
-        
-        guard let headerType = headerTypes[identifier] else {
-            fatalError("未注册对应数据类型的区间头尾: \(identifier)")
-        }
-        
-        let reusableView = collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: identifier, for: indexPath)
-        if var configurableCell = reusableView as? TSSimpleConfigurableView {
-            configurableCell.data = data
-            configurableCell.delegate = delegate
-            configurableCell.indexPath = indexPath
-        }
-        return reusableView
-    }
-}

+ 2 - 4
AIPlayRingtones/Common/BaseClass/ASBaseViewController.m

@@ -83,10 +83,8 @@
 }
 
 - (void)setPageTitle:(NSString *)title {
-    NSString *pageTitle = title;
-    NSString *backTitle = @" ";
-    [self setTitleText:pageTitle];
-    [self setNavigationItem:backTitle imageName:@"navi_back_white" direction:NSTextAlignmentLeft action:@selector(navBarClickLeftAction)];
+    [self setTitleText:title];
+    [self setNavigationItem:@"" imageName:@"navi_back_white" direction:NSTextAlignmentLeft action:@selector(navBarClickLeftAction)];
 }
 
 - (UIButton *)setNavigationItem:(NSString *)name imageName:(NSString *)imageName direction:(NSTextAlignment)direction action:(SEL)action {