Ver Fonte

开发:商品购买去掉月费会员

100Years há 2 semanas atrás
pai
commit
555152cc5e

+ 2 - 0
AIEmoji/Business/TSPTPGeneratorVC/TSPTPInputVC/View/TSPTPSelectStyleView.swift

@@ -84,6 +84,8 @@
 //        return oldBounds.width != newBounds.width
 //    }
 //}
+
+
 class TSPTPSelectStyleView: TSBaseView {
     var cellH: CGFloat = 108.0
     lazy var viewH: CGFloat = cellH*2+4.0

+ 11 - 6
AIEmoji/Business/TSPurchaseMembershipVC/TSPurchaseVC.swift

@@ -74,9 +74,10 @@ class TSPurchaseVC: TSBaseVC {
     }()
     
     lazy var hostVc: UIHostingController<PurchaseView> = {
-        if PurchaseManager.default.vipType == .none {
-            viewModel.selectedType = .month
-        }
+        //增加月付费
+//        if PurchaseManager.default.vipType == .none {
+//            viewModel.selectedType = .month
+//        }
         
         let vc = UIHostingController(rootView: PurchaseView(viewModel: viewModel))
         vc.view.backgroundColor = .clear
@@ -349,8 +350,12 @@ struct PurchaseView :View {
                 
                 if vipType == .none {
                     ZStack(alignment: .topTrailing) {
-                        PurchaseItemView(title: "One Month".localized, type: .month, selectedType: $viewModel.selectedType).onTapGesture {
-                            viewModel.selectedType = .month
+//                    //增加月付费
+//                        PurchaseItemView(title: "One Month".localized, type: .month, selectedType: $viewModel.selectedType).onTapGesture {
+//                            viewModel.selectedType = .month
+                    PurchaseItemView(title: "One Year".localized, type: .year, selectedType: $viewModel.selectedType).onTapGesture {
+                        viewModel.selectedType = .year
+
                             viewModel.buyPublisher.send(true)
                         }
                         TSVipRecView(save: vipType.saveString)
@@ -451,7 +456,7 @@ struct PurchaseItemView: View {
                     
                     HStack {
                         Text(PurchaseManager.default.price(for: type) ?? "--").font(.font(size: 18,weight: .medium)).foregroundColor(UIColor.mainText.color)
-                        if type == .month {
+                        if type == .year { //.month {//增加月付费
                             Text(" (≈\(PurchaseManager.default.averageWeekly(for:type) ?? "--")/\("Per week".localized))").font(.font(size: 12,weight: .medium)).foregroundColor(UIColor.mainText.withAlphaComponent(0.6).color)
                         }
                     }

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

@@ -11,7 +11,7 @@ struct SettingPurchaseTopView: View {
     var body: some View {
 
         let topW = k_ScreenWidth-32
-        let topH = 134.0    //kGetScaleHeight(originalSize: CGSize(width: 343, height: 130), width: topW)
+        let topH = 134.0 
         let updateText = vipType == .none ? "Upgrade to PRO".localized : "Upgrade Yearly Pro".localized
         let timeString = "Due Date:".localized + " \(PurchaseManager.default.expiredDateString)"
         let timeText = vipType == .none ? "Limited Time Discount".localized : timeString

+ 3 - 17
AIEmoji/Common/Purchase/TSPurchaseManager.swift

@@ -34,7 +34,7 @@ public enum PremiumPeriod: String, CaseIterable {
     var saveString: String {
         switch self {
         case .none:
-            return "40%"
+            return "80%"//"40%" 增加月付费
         default:
             return "80%"
         }
@@ -123,7 +123,7 @@ public class PurchaseManager: NSObject {
     // 商品信息
     public lazy var purchaseProducts: [PurchaseProduct] = {
         [
-            PurchaseProduct(productId: "101", period: .month),
+//            PurchaseProduct(productId: "101", period: .month),//增加月付费
             PurchaseProduct(productId: "102", period: .year),
             PurchaseProduct(productId: "103", period: .week)
         ]
@@ -215,7 +215,7 @@ public class PurchaseManager: NSObject {
 
     public var vipType: PremiumPeriod {
 #if DEBUG
-        return PremiumPeriod.month
+        return PremiumPeriod.none
 #endif
         guard isVip, let type = vipInformation["type"] as? String else {
             return .none
@@ -625,20 +625,6 @@ extension PurchaseManager {
         }
         return false
     }
-//    func findLatestSubscription(_ receipts: [[String: Any]]?) -> [String: Any]? {
-//        guard let receiptInfo = receipts , !receiptInfo.isEmpty else {
-//            return nil
-//        }
-//        
-//        // 使用 max(by:) 找出 expires_date_ms 最大的对象
-//        let latestSubscription = receiptInfo.max { (first, second) -> Bool in
-//            let firstExpiry = Int(first["expires_date_ms"] as? String ?? "0") ?? 0
-//            let secondExpiry = Int(second["expires_date_ms"] as? String ?? "0") ?? 0
-//            return firstExpiry < secondExpiry
-//        }
-//        
-//        return latestSubscription
-//    }
 
     // 终生会员过期时间:100年
     var lifetimeExpireTime: String {

+ 1 - 1
AIEmoji/Res/photo_to_photo_style.json

@@ -270,7 +270,7 @@
     },
     {
         "imageName": "ptp_style_SailorMoon",
-        "imageText": "Sailor",
+        "imageText": "Sailor Moon",
         "prompt":"Please create image in sailor moon style",
         "specialStyle":0,
         "isVip": true,

+ 1 - 1
AIEmoji/de.lproj/Localizable.strings

@@ -421,4 +421,4 @@
 "Monet" = "Monet";
 "Muscle" = "Muskel";
 "Bikini" = "Bikini";
-"Sailor" = "Sailor Moon";
+"Sailor Moon" = "Sailor Moon";

+ 1 - 1
AIEmoji/en.lproj/Localizable.strings

@@ -418,4 +418,4 @@
 "Monet" = "Monet";
 "Muscle" = "Muscle";
 "Bikini" = "Bikini";
-"Sailor" = "Sailor";
+"Sailor Moon" = "Sailor";

+ 1 - 1
AIEmoji/es.lproj/Localizable.strings

@@ -418,4 +418,4 @@
 "Monet" = "Monet";
 "Muscle" = "Músculo";
 "Bikini" = "Bikini";
-"Sailor" = "Marinero Luna";
+"Sailor Moon" = "Marinero Luna";

+ 1 - 1
AIEmoji/ja.lproj/Localizable.strings

@@ -417,4 +417,4 @@
 "Monet" = "モネ";
 "Muscle" = "筋";
 "Bikini" = "ビキニ";
-"Sailor" = "セーラームーン";
+"Sailor Moon" = "セーラームーン";

+ 1 - 1
AIEmoji/ko.lproj/Localizable.strings

@@ -423,4 +423,4 @@
 "Monet" = "모네";
 "Muscle" = "근";
 "Bikini" = "비키니";
-"Sailor" = "세일러문";
+"Sailor Moon" = "세일러문";

+ 1 - 1
AIEmoji/pt-BR.lproj/Localizable.strings

@@ -417,4 +417,4 @@
 "Monet" = "Monet";
 "Muscle" = "Músculo";
 "Bikini" = "Bikini";
-"Sailor" = "Sailor Moon";
+"Sailor Moon" = "Sailor Moon";

+ 1 - 1
AIEmoji/zh-Hans.lproj/Localizable.strings

@@ -419,4 +419,4 @@
 "Monet" = "莫奈";
 "Muscle" = "肌肉";
 "Bikini" = "比基尼";
-"Sailor" = "美少女战士";
+"Sailor Moon" = "美少女战士";

+ 1 - 1
AIEmoji/zh-Hant.lproj/Localizable.strings

@@ -409,4 +409,4 @@
 "Monet" = "莫內";
 "Muscle" = "肌肉";
 "Bikini" = "比基尼";
-"Sailor" = "美少女戰士";
+"Sailor Moon" = "美少女戰士";