1.1.1提审

This commit is contained in:
zjx 2025-07-18 18:25:40 +08:00
parent 97924c6c9f
commit 536482bd2d
4 changed files with 66 additions and 27 deletions

View File

@ -1918,7 +1918,7 @@
CODE_SIGN_ENTITLEMENTS = Veloria/Veloria.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 394VH538M8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Veloria/Source/Info.plist;
@ -1937,7 +1937,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.qjwl168.veloria.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@ -1961,7 +1961,7 @@
CODE_SIGN_ENTITLEMENTS = Veloria/Veloria.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = 394VH538M8;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = Veloria/Source/Info.plist;
@ -1980,7 +1980,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.1.0;
MARKETING_VERSION = 1.1.1;
PRODUCT_BUNDLE_IDENTIFIER = com.qjwl168.veloria.ios;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -227,7 +227,7 @@ class VPPlayerRechargeView: HWPanModalContentView {
@objc private func handleCloseButton() {
let payTemplateModel = self.discountPayTemplateModel
// let payTemplateModel = self.discountPayTemplateModel
self.dismiss(animated: true) {
// if let payTemplateModel = payTemplateModel, payTemplateModel.list_sub_vip?.isEmpty == false {
@ -243,8 +243,7 @@ class VPPlayerRechargeView: HWPanModalContentView {
}
override func longFormHeight() -> PanModalHeight {
// return PanModalHeightMake(.content, UIScreen.height * (4 / 5))
return PanModalHeightMake(.content, UIScreen.height - UIScreen.navBarHeight)
return PanModalHeightMake(.content, UIScreen.height - UIScreen.statusBarHeight)
}
override func showDragIndicator() -> Bool {

View File

@ -83,7 +83,6 @@ class VPIAPManager {
self.iapManager.start(productId: productId, orderId: self.orderCode ?? "", discount: discount)
// self.iapManager.showCodeRedemption()
}
}

View File

@ -10,7 +10,7 @@ import StoreKit
@objc protocol JXIAPManagerDelegate {
///
@objc optional func jx_iapPayGotProducts(productIds: [String])
@objc optional func jx_iapPayGotProducts(productIds: [SKProduct])
///
@objc optional func jx_iapPaySuccess(productId: String, receipt: String, transactionIdentifier: String?)
///
@ -34,28 +34,28 @@ import StoreKit
case cancelled
///
case noProduct
}
class JXIAPManager: NSObject {
enum OperationType {
case idle
case buy
case request
}
static let manager: JXIAPManager = JXIAPManager()
weak var delegate: JXIAPManagerDelegate?
///
private var operationType = OperationType.idle
private var payment: SKPayment?
private var product: SKProduct?
private var productId: String?
/*
let discount = SKPaymentDiscount(
identifier: offerIdentifier,// ID
keyIdentifier: keyIdentifier, //ID
nonce: UUID(), //
signature: signature, //
timestamp: timestamp //
)
*/
private var discount: SKPaymentDiscount?
private var orderId: String?
private var applicationUsername: String? {
@ -94,7 +94,39 @@ class JXIAPManager: NSObject {
SKPaymentQueue.default().presentCodeRedemptionSheet()
}
func requestProductList(productIdArr: [String]) {
guard self.operationType == .idle else { return }
self.operationType = .request
let set = Set(productIdArr)
let productsRequest = SKProductsRequest(productIdentifiers: set)
productsRequest.delegate = self
productsRequest.start()
}
// ///
// func buyProduct(product: SKProduct, orderId: String, discount: SKPaymentDiscount? = nil) {
// guard self.operationType == .idle else { return }
// self.operationType = .buy
//
// self.product = product
// self.orderId = orderId
//
// //
// let payment = SKMutablePayment(product: product)
// payment.applicationUsername = applicationUsername
// if let discount = discount {
// payment.paymentDiscount = discount
// }
//
// //
// SKPaymentQueue.default().add(payment)
// }
func start(productId: String, orderId: String, discount: SKPaymentDiscount? = nil) {
guard self.operationType == .idle else { return }
self.operationType = .buy
self.product = nil
self.productId = productId
self.orderId = orderId
@ -129,18 +161,25 @@ class JXIAPManager: NSObject {
//MARK: -------------- SKProductsRequestDelegate --------------
extension JXIAPManager: SKProductsRequestDelegate {
func productsRequest(_ request: SKProductsRequest, didReceive response: SKProductsResponse) {
guard let product = response.products.first else {
DispatchQueue.main.async {
if let productId = self.productId {
self.productId = nil
self.delegate?.jx_iapPayFailed?(productId: productId, code: .noProduct)
if self.operationType == .request {
self.delegate?.jx_iapPayGotProducts?(productIds: response.products)
self.operationType = .idle
} else if self.operationType == .buy {
guard let product = response.products.first else {
DispatchQueue.main.async {
if let productId = self.productId {
self.productId = nil
self.delegate?.jx_iapPayFailed?(productId: productId, code: .noProduct)
}
}
return
}
return
self.product = product
self.buyProduct()
}
self.product = product
self.buyProduct()
}
}
@ -196,12 +235,14 @@ extension JXIAPManager {
guard let productId = self.productId, productId == transaction.payment.productIdentifier else { return }
self.operationType = .idle
self.productId = nil
self.delegate?.jx_iapPaySuccess?(productId: productId, receipt: encodeStr, transactionIdentifier: transactionIdentifier)
}
private func failedTransaction(transaction: SKPaymentTransaction) {
self.operationType = .idle
let error = transaction.error as? SKError
guard let productId = self.productId else { return }
self.productId = nil