Parcourir la source

feat:3.6.6(1)活照片开发完毕-2

100Years il y a 2 mois
Parent
commit
49860d69be

+ 0 - 4
TSLiveWallpaper.xcodeproj/project.pbxproj

@@ -150,7 +150,6 @@
 		A8F8BCE02E04210000EF4AA6 /* TSAIPhotoDetailsVC+Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCDF2E0420FB00EF4AA6 /* TSAIPhotoDetailsVC+Video.swift */; };
 		A8F8BCE32E0423B100EF4AA6 /* TSAIPhotoDetailsVC+View.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */; };
 		A8F8BCE62E04F62400EF4AA6 /* TSAIListPhotoGeneratorModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */; };
-		A8F8BCE82E04FA5900EF4AA6 /* TSAIPhotoDetailsBrowserVideoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8F8BCE72E04FA5200EF4AA6 /* TSAIPhotoDetailsBrowserVideoCell.swift */; };
 		A8FD8F332DFBCB85008CAACF /* ZillaSlab-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F322DFBCB85008CAACF /* ZillaSlab-Regular.ttf */; };
 		A8FD8F342DFBCB85008CAACF /* ZillaSlab-Medium.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F312DFBCB85008CAACF /* ZillaSlab-Medium.ttf */; };
 		A8FD8F352DFBCB85008CAACF /* ZillaSlab-BoldItalic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A8FD8F302DFBCB85008CAACF /* ZillaSlab-BoldItalic.ttf */; };
@@ -319,7 +318,6 @@
 		A8F8BCDF2E0420FB00EF4AA6 /* TSAIPhotoDetailsVC+Video.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIPhotoDetailsVC+Video.swift"; sourceTree = "<group>"; };
 		A8F8BCE22E0423AD00EF4AA6 /* TSAIPhotoDetailsVC+View.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSAIPhotoDetailsVC+View.swift"; sourceTree = "<group>"; };
 		A8F8BCE52E04F62200EF4AA6 /* TSAIListPhotoGeneratorModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIListPhotoGeneratorModel.swift; sourceTree = "<group>"; };
-		A8F8BCE72E04FA5200EF4AA6 /* TSAIPhotoDetailsBrowserVideoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSAIPhotoDetailsBrowserVideoCell.swift; sourceTree = "<group>"; };
 		A8FD8F302DFBCB85008CAACF /* ZillaSlab-BoldItalic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ZillaSlab-BoldItalic.ttf"; sourceTree = "<group>"; };
 		A8FD8F312DFBCB85008CAACF /* ZillaSlab-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ZillaSlab-Medium.ttf"; sourceTree = "<group>"; };
 		A8FD8F322DFBCB85008CAACF /* ZillaSlab-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "ZillaSlab-Regular.ttf"; sourceTree = "<group>"; };
@@ -876,7 +874,6 @@
 				A8F8BCE12E04211300EF4AA6 /* TSAIPhotoDetailsVC */,
 				A87CF8512E0296960063CB7E /* TSAIPhotoDetailsBrowserVC.swift */,
 				A87CF8532E029B3F0063CB7E /* TSAIPhotoDetailsBrowserCell.swift */,
-				A8F8BCE72E04FA5200EF4AA6 /* TSAIPhotoDetailsBrowserVideoCell.swift */,
 			);
 			path = TSAIPhotoDetailsVC;
 			sourceTree = "<group>";
@@ -1338,7 +1335,6 @@
 				A8C4C0A62D24218A003C46FC /* AVAssetExtension.swift in Sources */,
 				A8C4C0A72D24218A003C46FC /* LivePhotoUtil.m in Sources */,
 				A8F8BCDE2E0420EE00EF4AA6 /* TSAIPhotoDetailsVC+Image.swift in Sources */,
-				A8F8BCE82E04FA5900EF4AA6 /* TSAIPhotoDetailsBrowserVideoCell.swift in Sources */,
 				A86857AC2DF921160089D222 /* TSAIListHintBaseVC.swift in Sources */,
 				A8C4C0A82D24218A003C46FC /* Converter4Image.swift in Sources */,
 				A83946432D1D701500ABFF0D /* TSLiveWallpaperCopyrightVC.swift in Sources */,

+ 0 - 27
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsBrowserVideoCell.swift

@@ -1,27 +0,0 @@
-//
-//  TSAIPhotoDetailsBrowserVideoCell.swift
-//  TSLiveWallpaper
-//
-//  Created by 100Years on 2025/6/19.
-//
-
-//class TSAIVideoBrowseCell : TSBaseCollectionCell{
-//
-//    var videoPlayerVC: TSAIListVideoPlayerVC?
-//    override func creatUI() {
-//
-//    }
-//    
-//    var model:TSActionInfoModel = TSActionInfoModel(){
-//        didSet{
-//            self.videoPlayerVC?.view.removeFromSuperview()
-//            self.videoPlayerVC = TSAIListVideoPlayerVC(videoURL: self.model.videoURL)
-//            self.bgContentView.addSubview(self.videoPlayerVC!.view)
-//            self.videoPlayerVC!.view.snp.remakeConstraints { make in
-//                make.center.equalToSuperview()
-//                make.width.equalTo(k_ScreenWidth)
-//                make.height.equalTo(k_ScreenHeight)
-//            }
-//        }
-//    }
-//}

+ 0 - 249
TSLiveWallpaper/Business/TSAIListVC/TSAIPhotoDetailsVC/TSAIPhotoDetailsVC.swift

@@ -1,249 +0,0 @@
-//
-//  TSAIPhotoDetailsVC.swift
-//  TSLiveWallpaper
-//
-//  Created by 100Years on 2025/6/11.
-//
-
-class TSAIPhotoDetailsVC: TSBaseVC {
-    var deleteBlock:(()->Void)?
-    var infoModel:TSActionInfoModel?{
-        didSet{
-            updateImageView()
-        }
-    }
-
-    lazy var bottomViewH = 60+k_Height_safeAreaInsetsBottom()
-    lazy var panComparisonView : TSImageIPanComparisonView = {
-        let panComparisonView = TSImageIPanComparisonView()
-        return panComparisonView
-    }()
-    
-    lazy var expandAreaView: TSAIExpandChangeView = {
-        let view = TSAIExpandChangeView()
-        return view
-    }()
-    
-    lazy var switchOriginalPictureBtn: TSUIExpandedTouchButton = {
-        let switchOriginalPictureBtn = TSUIExpandedTouchButton()
-        switchOriginalPictureBtn.setUpButton(image:UIImage(named: "switch_original_picture"))
-        switchOriginalPictureBtn.addTarget(self, action: #selector(switchOriginalPictureTouchDown), for: .touchDown)
-        switchOriginalPictureBtn.addTarget(self, action: #selector(switchOriginalPictureTouchUp), for: [.touchUpInside, .touchUpOutside, .touchCancel])
-        switchOriginalPictureBtn.isHidden = true
-        return switchOriginalPictureBtn
-    }()
-    
-//    lazy var rotatingPictureBtn: TSUIExpandedTouchButton = {
-//        let rotatingPictureBtn = TSUIExpandedTouchButton()
-//        rotatingPictureBtn.setUpButton(image:UIImage(named: "rotating_picture")){ [weak self]  in
-//            guard let self = self else { return }
-//            //旋转图片并储存
-//            if let image = netWorkImageView.image?.rotated(by: .degrees90) {
-//                netWorkImageView.image = image
-//                if let resultUrl = self.infoModel?.response.resultUrl,
-//                   let url = URL(string: resultUrl){
-//                    ImageCache.default.store(image, forKey: url.cacheKey)
-//                }
-//            }
-//        }
-//        rotatingPictureBtn.isHidden = true
-//        return rotatingPictureBtn
-//    }()
-    
-    
-    lazy var saveBtn: UIButton = {
-        let saveBtn = kCreateNormalSubmitBtn(title: "Save".localized) { [weak self]  in
-            guard let self = self else { return }
-            clickSaveBtn()
-        }
-        return saveBtn
-    }()
-    
-    var navRightBtn:UIButton = UIButton()
-    override func createView() {
-        
-        let imageView = UIImageView.createImageView(image: .navShadow,contentMode: .scaleToFill)
-        navBarContentView.addSubview(imageView)
-        imageView.snp.makeConstraints { make in
-            make.edges.equalToSuperview()
-        }
-
-        addNormalNavBarView()
-        setPageTitle("Result".localized)
-        navRightBtn = setNavigationItem("", imageName: "ai_delete", direction: .right, action: #selector(clickNavRight))
-        contentView.snp.updateConstraints { make in
-            make.top.equalTo(0)
-        }
-
-        contentView.addSubview(panComparisonView)
-        panComparisonView.snp.makeConstraints { make in
-            make.height.equalTo(k_ScreenHeight)
-            make.leading.trailing.equalTo(0)
-            make.centerY.equalToSuperview()
-        }
-        
-        contentView.addSubview(saveBtn)
-        saveBtn.snp.makeConstraints { make in
-            make.centerX.equalToSuperview()
-            make.width.equalTo(250*kDesignScale)
-            make.height.equalTo(48)
-            make.bottom.equalTo(-12-k_Height_safeAreaInsetsBottom())
-        }
-        
-        contentView.addSubview(switchOriginalPictureBtn)
-        switchOriginalPictureBtn.snp.makeConstraints { make in
-            make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 76)
-            make.trailing.equalTo(-16)
-            make.width.equalTo(40)
-            make.height.equalTo(40)
-        }
-        
-//        contentView.addSubview(rotatingPictureBtn)
-//        rotatingPictureBtn.snp.makeConstraints { make in
-//            make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 76)
-//            make.trailing.equalTo(-16)
-//            make.width.equalTo(40)
-//            make.height.equalTo(40)
-//        }
-        
-        saveBtn.setTitleImageSpace(spacing: 0)
-        
-//        if viewModel.generatorModel.generatorStyle == .photoExpand {
-//            setUpExpandAreaView()
-//        }
-
-    }
-    
-//    func setUpExpandAreaView(){
-//        netWorkImageView.addSubview(expandAreaView)
-//        expandAreaView.snp.makeConstraints { make in
-//            make.top.leading.trailing.bottom.equalTo(0)
-//        }
-//
-//        expandAreaView.showImageView.isHidden = true
-//        expandAreaView.boardView.isHidden = true
-//
-//        if let sizes = self.viewModel.generatorModel.expandViewSizes {
-//            expandAreaView.updateExpandAreaView(width: sizes.0.width, height: sizes.0.height)
-//            expandAreaView.updateImageView(width: sizes.1.width, height: sizes.1.height)
-//        }
-//    }
-
-    //保存功能
-    @objc func clickSaveBtn(){
-        guard let infoModel = infoModel else { return }
-//        if viewModel.generatorModel.generatorStyle == .photoLive{
-//            TSDownloadManager.getDownLoadVideo(urlString: infoModel.response.resultUrl) { url, success in
-//                if let url = url {
-//                    PhotoManagerShared.saveVideoToAlbum(videoURL: url) { [weak self] success, error in
-//                        guard let self = self else { return }
-//                        if success {
-//                            isSavePhotoMark = true
-//                            kSaveSuccesswShared.show(atView:self.view)
-//                        }else{
-//                            debugPrint(error)
-//                        }
-//                    }
-//                }
-//            }
-//        }else{
-            TSImageStoreTool.downloadImageWithProgress(urlString: infoModel.response.resultUrl) { image in
-                if let image = image {
-                    PhotoManagerShared.saveImageToAlbum(image) { [weak self] success, error in
-                        guard let self = self else { return }
-                        if success {
-                            kSaveSuccesswShared.show(atView:self.view)
-                        }else{
-                            debugPrint(error)
-                        }
-                    }
-                }
-            }
-//        }
-    }
-    
-    override func navBarClickLeftAction() {
-        dismiss(animated: true)
-    }
-    
-    @objc func clickNavRight() {
-
-        TSCustomAlertController.show(in: self, config: TSCustomAlertController.AlertConfig(
-            message: "Are you sure to delete?".localized,
-            cancelTitle: "Delete".localized,
-            cancelColor: .red,
-            confirmTitle: "Retain".localized,
-            confirmColor: .white,
-            cancelAction: { [weak self]  in
-                guard let self = self else { return }
-                self.deleteBlock?()
-                self.navBarClickLeftAction()
-            }
-        ))
-    }
-}
-
-
-extension TSAIPhotoDetailsVC {
-    
-    
-    func updateImageView(){
-        
-        kMainAsync {
-            self.uploadPanComparisonView()
-        }
-        
-        
-//        self.netWorkImageView.setAsyncImage(urlString:infoModel.response.resultUrl,placeholder:kPlaceholderImage)
-    }
-    
-    func uploadPanComparisonView(){
-        guard let infoModel = infoModel else { return }
-        DispatchQueue.global(qos: .userInitiated).async {
-            var oldImage:UIImage?
-            var newImage:UIImage?
-            let grounp = DispatchGroup()
-            grounp.enter()
-            TSImageStoreTool.downloadImageWithProgress(urlString: infoModel.request.imageUrl) { image in
-                grounp.leave()
-                oldImage = image
-                
-            }
-            
-            grounp.enter()
-            TSImageStoreTool.downloadImageWithProgress(urlString: infoModel.response.resultUrl) { image in
-                grounp.leave()
-                newImage = image
-            }
-            
-            grounp.notify(queue: .main) {
-                if let oldImage = oldImage,let newImage = newImage {
-                    let size = oldImage.size.height > newImage.size.height ? oldImage.size : newImage.size
-                    self.panComparisonView.snp.updateConstraints { make in
-                        make.height.equalTo(kGetUIWdith(designSize: size, currentW: k_ScreenWidth))
-                    }
-                }
-                
-                self.panComparisonView.configure(oldImage: oldImage, newImage: newImage)
-            }
-        }
-    }
-    @objc func switchOriginalPictureTouchDown() {
-//        if viewModel.generatorModel.generatorStyle == .photoExpand {
-//            expandAreaView.onlyBgImage(only: false)
-//        }else{
-//        guard let infoModel = infoModel else { return }
-//        self.netWorkImageView.setAsyncImage(urlString: infoModel.request.imageUrl,placeholder:kPlaceholderImage)
-//        }
-    }
-    
-    @objc func switchOriginalPictureTouchUp() {
-        guard let infoModel = infoModel else { return }
-        
-//        if viewModel.generatorModel.generatorStyle == .photoExpand {
-//            expandAreaView.onlyBgImage(only: true)
-//        }else{
-//            self.netWorkImageView.setAsyncImage(urlString:infoModel.response.resultUrl,placeholder:kPlaceholderImage)
-//        }
-    }
-}