diff --git a/Fableon.xcodeproj/project.pbxproj b/Fableon.xcodeproj/project.pbxproj index f17a976..98b5df3 100644 --- a/Fableon.xcodeproj/project.pbxproj +++ b/Fableon.xcodeproj/project.pbxproj @@ -2734,7 +2734,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 6XALB8RSYF; "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64; GENERATE_INFOPLIST_FILE = YES; @@ -2755,7 +2755,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.5; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = com.hn.qinjiu.fableon; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; @@ -2777,7 +2777,7 @@ CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Fableon/Fableon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 2; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = 6XALB8RSYF; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = Fableon/Source/Info.plist; @@ -2797,7 +2797,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0.5; + MARKETING_VERSION = 1.0.6; PRODUCT_BUNDLE_IDENTIFIER = com.hn.qinjiu.fableon; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; diff --git a/Fableon/Object/Base/Request/FAAPI/FAStoreAPI.swift b/Fableon/Object/Base/Request/FAAPI/FAStoreAPI.swift index 95d3683..f448207 100644 --- a/Fableon/Object/Base/Request/FAAPI/FAStoreAPI.swift +++ b/Fableon/Object/Base/Request/FAAPI/FAStoreAPI.swift @@ -200,12 +200,16 @@ class FAStoreAPI: NSObject { ///挽留支付项 static func requestPayRetainInfo(completer: ((_ model: FAPayDateModel?) -> Void)?) { + let parameters = [ + "purchases_token" : JXIAPManager.manager.getAppStoreReceipt() ?? "", + "discount" : "1", + ] FANetworkManager.manager.request(FABaseURL + "/payRetrieveSettings", - method: .get, - parameters: nil, - isLoding: true, - isToast: true, + method: .post, + parameters: parameters, + isLoding: false, + isToast: false, ) { (response: FANetworkManager.Response) in if (response.data?.list_coins?.count ?? 0) > 0 { completer?(response.data) diff --git a/Fableon/Object/Class/Store/M/FAPayDateModel.swift b/Fableon/Object/Class/Store/M/FAPayDateModel.swift index b16b18d..af0c438 100644 --- a/Fableon/Object/Class/Store/M/FAPayDateModel.swift +++ b/Fableon/Object/Class/Store/M/FAPayDateModel.swift @@ -96,6 +96,9 @@ class FAPayItem: NSObject, SmartCodable { @SmartIgnored var product: SKProduct? + + + ///首冲优惠数据 var introductionaryOffer: SKProductDiscount? { return product?.introductoryPrice @@ -106,6 +109,16 @@ class FAPayItem: NSObject, SmartCodable { return product?.discounts } + var discount_price: String? { + var price: String? = nil + if self.discount_type == 1, let introductoryPrice = self.introductionaryOffer { + price = introductoryPrice.price.stringValue + } else if self.discount_type == 2, let discount = self.promotionalOffers?.first { + price = discount.price.stringValue + } + return price + } + static func mappingForKey() -> [SmartKeyTransformer]? { return [ diff --git a/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift b/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift index 6d3809d..39239eb 100644 --- a/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift +++ b/Fableon/Object/Libs/Alert/FAPayRetainAlert.swift @@ -468,7 +468,12 @@ final class FAPayRetainPackCell: UICollectionViewCell { coinLabel.text = "\(item.coins ?? 0)" bonusLabel.text = "+\((item.ext_info?.max_total_coins_pop ?? 0) - (item.ext_info?.max_total_coins ?? 0)) " + "fableon_free_coins".localized - priceLabel.text = "\(item.currency ?? "")\(item.price ?? "")" + + var price = item.price + if let discountPrice = item.discount_price { + price = discountPrice + } + priceLabel.text = "\(item.currency ?? "")\(price ?? "")" } private func setupView() { diff --git a/Fableon/Object/Libs/FAIap/FAPayDataRequest.swift b/Fableon/Object/Libs/FAIap/FAPayDataRequest.swift index c832d6b..dac1dde 100644 --- a/Fableon/Object/Libs/FAIap/FAPayDataRequest.swift +++ b/Fableon/Object/Libs/FAIap/FAPayDataRequest.swift @@ -108,7 +108,6 @@ class FAPayDataRequest: NSObject { func requestPayRetainInfo(completer: ((_ model: FAPayDateModel?) -> Void)?) { self.payRetainBlock = completer self.isLoding = true - self.isToast = true FAHUD.show() FAStoreAPI.requestPayRetainInfo { [weak self] model in