iap button for aboutView

This commit is contained in:
True Zhuanjia
2026-06-22 00:56:28 +08:00
parent 9c43e39ffb
commit 7d7b909c66
3 changed files with 67 additions and 16 deletions
+40 -9
View File
@@ -90,16 +90,47 @@ public struct AboutView: View {
Link(LocalizationHelper.localizedString(forKey: "joinCommunity"), destination: URL(string: LocalizationHelper.localizedString(forKey: "communityLink"))!)
}
// OK 按钮
Button(LocalizationHelper.localizedString(forKey: "OK")) {
aboutVC.dismiss(animated:true)
HStack(spacing: 15) {
if #available(iOS 15.0, *) {
if GenericUtils.isIPad() {
Button(LocalizationHelper.localizedString(forKey: "I'm an artist")) {
IAPManager.checkPurchaseInfo(.PencilProPack) { info in
if !info.valid {
IAPManager.inAppPurchaseAction(viewController: self.aboutVC, product: .PencilProPack)
}
else {
AlertControllerUtil.showAlert(
in: self.aboutVC,
title: "",
message: LocalizationHelper.localizedString(forKey:"Drawing Toolkit already purchased"),
withCancel: false,
buttonTitle: LocalizationHelper.localizedString(forKey: "OK"),
countdown: 0)
}
}
}
.padding()
.background(Color.blue.opacity(1))
.foregroundColor(.white)
.frame(height: 46)
.cornerRadius(12)
.padding(.top, 10)
}
}
// OK 按钮
Button(LocalizationHelper.localizedString(forKey: "OK")) {
aboutVC.dismiss(animated:true)
}
.padding()
.background(Color.blue)
.foregroundColor(.white)
.frame(height: 46)
.cornerRadius(12)
.padding(.top, 10)
}
.padding()
.background(Color.blue)
.foregroundColor(.white)
.frame(height: 46)
.cornerRadius(12)
.padding(.top, 10)
} else {
HStack(spacing: 20) {
Button(LocalizationHelper.localizedString(forKey: "Join us")) {
+27 -4
View File
@@ -6612,19 +6612,19 @@
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "绘画"
"value" : "绘画进阶套件"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "繪畫"
"value" : "繪畫進階套件"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "繪畫"
"value" : "繪畫進階套件"
}
}
}
@@ -6721,7 +6721,7 @@
},
"zh-HK" : {
"stringUnit" : {
"state" : "needs_review",
"state" : "translated",
"value" : "一塊啥都不幹的擋板區域"
}
}
@@ -9085,6 +9085,29 @@
}
}
},
"I'm an artist" : {
"extractionState" : "manual",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "我是画手"
}
},
"zh-Hant" : {
"stringUnit" : {
"state" : "translated",
"value" : "我是畫手"
}
},
"zh-HK" : {
"stringUnit" : {
"state" : "translated",
"value" : "我是畫手"
}
}
}
},
"Import" : {
"extractionState" : "manual",
"localizations" : {
-3
View File
@@ -368,9 +368,6 @@ import StoreKit
@objc static public func inAppPurchaseAction(viewController: UIViewController, product: AddOnProduct){
let alert = UIAlertController(title: product.productName(),
message: LocalizationHelper.localizedString(forKey: "No purchase found", product.productName()),
preferredStyle: .alert)