Selaa lähdekoodia

修改一批 bug

100Years 1 kuukausi sitten
vanhempi
commit
f8b7852449

+ 22 - 0
AIEmoji/Assets.xcassets/Common/yellow_warning.imageset/Contents.json

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

BIN
AIEmoji/Assets.xcassets/Common/yellow_warning.imageset/yellow_warning@2x.png


BIN
AIEmoji/Assets.xcassets/Common/yellow_warning.imageset/yellow_warning@3x.png


+ 0 - 27
AIEmoji/Business/Data/TSUserDefaultData.swift

@@ -6,33 +6,6 @@
 //
 import ObjectMapper
 
-func getUserInfoJsonString()->String {
-    let uuid: String
-    let uuidUdKey = "my_UUID"
-    if let saved = UserDefaults.standard.string(forKey: uuidUdKey),
-       !saved.isEmpty {
-        uuid = saved
-    } else {
-        let newUuid = UUID().uuidString
-        UserDefaults.standard.set(newUuid, forKey: uuidUdKey)
-        UserDefaults.standard.synchronize()
-        uuid = newUuid
-    }
-    
-    let dic:[String:Any] = [
-        "device":UIDevice.current.modelName,
-        "deviceId":uuid,
-        "iosVersion":UIDevice.current.systemVersion,
-        "appVersion":appShortVersion(),
-        "subscriptionStatus":kPurchaseDefault.isVip ? "active" : "fallow",
-    ]
-    
-    if let jSONString = dic.toJSONString() {
-        return jSONString
-    }
-    
-    return ""
-}
 
 func kHandleDBHistoryOperation(){
     let listModels = TSRMShared.ptpDBHistory.listModels

+ 4 - 1
AIEmoji/Business/TSGenmojiVC/TSGenmojiVC/Model/TSActionInfoModel.swift

@@ -100,7 +100,6 @@ class TSActionRequestModel : TSBaseModel {
     var imageUrlTimestamp:Int = 0
     var style:String = ""
     var advance:Bool = false
-    
     override func mapping(map: ObjectMapper.Map) {
         prompt              <- map["prompt"]
         promptSort          <- map["promptSort"]
@@ -111,6 +110,10 @@ class TSActionRequestModel : TSBaseModel {
         imageUrlTimestamp   <- map["imageUrlTimestamp"]
         style               <- map["style"]
         advance             <- map["advance"]
+        
+        if style.isEmpty {
+            style  <- map["styleId"]
+        }
     }
 }
 

+ 24 - 1
AIEmoji/Business/TSPTPGeneratorVC/TSAbnormalPopUpAlertVC/TSAbnormalPopUpAlertVC.swift

@@ -49,6 +49,8 @@ class TSAbnormalPopUpAlertVC: TSBaseVC {
             }else{
                 self.dismiss()
             }
+            
+            TSAbnormalPopUpAlertVC.resetNavigationState()
         }
         return submitBtn
     }()
@@ -80,7 +82,7 @@ class TSAbnormalPopUpAlertVC: TSBaseVC {
             make.bottom.equalTo(-20)
         }
         
-        let topImageView = UIImageView.createImageView(imageName: "red_warning")
+        let topImageView = UIImageView.createImageView(imageName: "yellow_warning")
         contentView.addSubview(topImageView)
         topImageView.snp.makeConstraints { make in
             make.bottom.equalTo(alertView.snp.top).offset(28.0)
@@ -103,4 +105,25 @@ extension TSAbnormalPopUpAlertVC {
         }
 
     }
+    
+    private static func resetNavigationState() {
+        guard let window = UIApplication.shared.keyWindow,
+              let rootVC = window.rootViewController else { return }
+        
+        // 处理 UITabBarController
+        if let tabBarController = rootVC as? UITabBarController {
+            // 获取当前选中的导航控制器
+            if let navController = tabBarController.selectedViewController as? UINavigationController {
+                // pop 到根视图控制器
+                navController.popToRootViewController(animated: false)
+            }
+        }
+        
+        // 处理模态展示的视图控制器
+        var presentedVC = rootVC.presentedViewController
+        while presentedVC != nil {
+            presentedVC?.dismiss(animated: false, completion: nil)
+            presentedVC = presentedVC?.presentedViewController
+        }
+    }
 }

+ 5 - 5
AIEmoji/Business/TSPTPGeneratorVC/TSGennertatorSelectStyleVC/StyleList/TSGennertatorSelectStyleCell.swift

@@ -28,7 +28,7 @@ class TSGennertatorSelectStyleCell: TSBaseCollectionCell {
             }else{
                 hotImageView.isHidden = true
             }
-            textLabel.text = itemModel.styleName
+            textLabel.text = itemModel.name
         }
     }
     
@@ -52,13 +52,13 @@ class TSGennertatorSelectStyleCell: TSBaseCollectionCell {
     }()
     
     lazy var textLabel: UILabel = {
-        let textLabel = UILabel.createLabel(font: .font(size: 14),textColor: .white,textAlignment: .center,numberOfLines: 2)
-        textLabel.adjustsFontSizeToFitWidth = true
+        let textLabel = UILabel.createLabel(font: .font(size: 12),textColor: .white.withAlphaComponent(0.8),textAlignment: .center,numberOfLines: 2)
         return textLabel
     }()
     
     override func creatUI() {
-        let w = contentView.width
+//        let w = contentView.width
+        let w = 78
         bgContentView.addSubview(boardImageView)
         boardImageView.snp.makeConstraints { make in
             make.top.centerX.equalToSuperview()
@@ -81,7 +81,7 @@ class TSGennertatorSelectStyleCell: TSBaseCollectionCell {
         
         bgContentView.addSubview(textLabel)
         textLabel.snp.makeConstraints { make in
-            make.top.equalTo(boardImageView.snp.bottom).offset(2)
+            make.top.equalTo(imageView.snp.bottom).offset(2)
             make.leading.trailing.bottom.equalToSuperview()
         }
     

+ 5 - 3
AIEmoji/Business/TSPTPGeneratorVC/TSGennertatorSelectStyleVC/StyleList/TSGennertatorSelectStyleListVc.swift

@@ -58,9 +58,9 @@ class TSGennertatorSelectStyleListVc: TSBaseVC {
         viewModel.$datas.receive(on: DispatchQueue.main).sink { [weak self] datas in
             guard let self = self else { return }
             if !datas.isEmpty && viewModel.currentIndexPath.item < datas.count {
-                DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
+//                DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
                     self.selectIndex(indexPath: self.viewModel.currentIndexPath, dir: .centeredVertically)
-                }
+//                }
             }
         }.store(in: &cancellable)
     }
@@ -96,7 +96,9 @@ class TSGennertatorSelectStyleListVc: TSBaseVC {
 
     public func selectIndex(indexPath: IndexPath, dir: UICollectionView.ScrollPosition = .centeredHorizontally) {
         viewModel.currentIndexPath = indexPath
-        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {
+        
+        DispatchQueue.main.async{
+//        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
             if let model = self.viewModel.datas.safeObj(At: indexPath.item) {
                 self.selectedValueBlock?(indexPath, model)
             }

+ 5 - 5
AIEmoji/Business/TSPTPGeneratorVC/TSGennertatorSelectStyleVC/StyleList/TSGennertatorSelectStyleListViewModel.swift

@@ -14,18 +14,18 @@ class TSGennertatorSelectStyleListViewModel {
 
     var currentIndexPath: IndexPath = IndexPath(item: 0, section: 0)
 
-    var viewH: CGFloat = 110.0
+    var viewH: CGFloat = 108.0
     ///是否需要展示鱼骨图
     var isBigLoading : Bool = true
 
-    var layout: UICollectionViewFlowLayout = {
+    lazy var layout: UICollectionViewFlowLayout = {
         let w = (k_ScreenWidth - 32.0 - 30.0 - 2.0) / 4.0
         let layout = UICollectionViewFlowLayout()
-        layout.itemSize = CGSize(width: w, height: 110)
+        layout.itemSize = CGSize(width: w, height: viewH)
 
         layout.scrollDirection = .vertical
         layout.minimumInteritemSpacing = 0.0
-        layout.minimumLineSpacing = 10.0
+        layout.minimumLineSpacing = 4.0
         layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: k_Height_safeAreaInsetsBottom(), right: 16)
         return layout
     }()
@@ -39,7 +39,7 @@ class TSGennertatorSelectStyleListViewModel {
             return
         }
         loadState = .loading
-        _ = TSNetworkShared.get(urlType: .imageToImageStyle) { [weak self] data, _ in
+        _ = TSNetworkShared.get(urlType: .imageToImageStyle,parameters: ["lang" : getLanguageCode()]) { [weak self] data, _ in
             guard let self = self else { return }
             if let result = kNetWorkResultSuccess(data: data) {
                 if let mResult = Mapper<TSGeneerateOnlineStyleResult>().map(JSON: result) {

+ 1 - 1
AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/TSPTPInputVC.swift

@@ -102,7 +102,7 @@ class TSPTPInputVC: TSBaseVC {
         let layout = UICollectionViewFlowLayout()
         layout.scrollDirection = .horizontal
         let w = (k_ScreenWidth - 32.0 - 30.0 - 2.0) / 4.0
-        layout.itemSize = CGSize(width: w, height: 110)
+        layout.itemSize = CGSize(width: w, height: 108.0)
         layout.minimumInteritemSpacing = 0.0
         layout.minimumLineSpacing = 10.0
         layout.sectionInset = UIEdgeInsets(top: 0, left: 16, bottom: 0, right: 16)

+ 3 - 3
AIEmoji/Common/View/TSPhotoPickerManager/TSPhotoPickerManager.swift

@@ -106,10 +106,10 @@ extension TSPhotoPickerManager: UIImagePickerControllerDelegate, UINavigationCon
     }
     
     func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
-        self.completionHandler?(nil,nil)
-        if completionSizeHandler == nil {
+//        self.completionHandler?(nil,nil)
+//        if completionSizeHandler == nil {
             picker.dismiss(animated: true, completion: nil)
-        }
+//        }
     }
 }