|
@@ -231,6 +231,12 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
window?.standardWindowButton(.miniaturizeButton)?.isHidden = true
|
|
|
window?.delegate = self
|
|
|
|
|
|
+
|
|
|
+ /*
|
|
|
+ "then %@ for 6 months." = "then %@ for 6 months.";
|
|
|
+ "Because you were previously subscribed to PDF Reader Pro, we are now delivering a special offer to you. " = "Because you were previously subscribed to PDF Reader Pro, we are now delivering a special offer to you. ";
|
|
|
+ "Get Special Offer - Advanced 6 Mos" = "Get Special Offer - Advanced 6 Mos";
|
|
|
+ */
|
|
|
despBox.borderWidth = 0
|
|
|
despBox.cornerRadius = 4
|
|
|
despBox.contentView = despView_
|
|
@@ -244,8 +250,8 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
titleLabel.stringValue = NSLocalizedString("PDF Reader Pro", comment: "")
|
|
|
titleLabel.font = .SFProTextRegularFont(20)
|
|
|
|
|
|
- despView_.titleLabel.stringValue = NSLocalizedString("PDF Reader Pro Advanced - 6 Months Plan", comment: "")
|
|
|
- despView_.tipLabel.stringValue = NSLocalizedString("Because you were previously subscribed to PDF Reader Pro, we are now delivering a special offer to you.", comment: "")
|
|
|
+ despView_.titleLabel.stringValue = NSLocalizedString("PDF Reader Pro Advanced/n - 6 Months Plan", comment: "")
|
|
|
+ despView_.tipLabel.stringValue = NSLocalizedString("Because you were previously subscribed to PDF Reader Pro, we are now delivering a special offer to you. ", comment: "")
|
|
|
despView_.iconIv.image = NSImage(named: "KMImageNameWinBackDespIcon")
|
|
|
|
|
|
buttonView_.backgroundView.xRadius = 4
|
|
@@ -263,21 +269,25 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
if #available(macOS 15.0, *) {
|
|
|
var rootView = CPDFOfferSubscriptionStoreView()
|
|
|
rootView.eligibleOffersCallback = { offertIds in
|
|
|
+ KMPrint("你符合赢回的优惠卷:")
|
|
|
+ KMPrint(offertIds)
|
|
|
if offertIds.isEmpty == false {
|
|
|
if let data = offertIds.first, data.isEmpty == false {
|
|
|
if let data = self.offerId_, data.isEmpty == false {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- self._selectOffer(offerId: data)
|
|
|
-
|
|
|
if self.needShow() {
|
|
|
+ self._selectOffer(offerId: data)
|
|
|
+
|
|
|
self.showWindow(nil)
|
|
|
|
|
|
self._saveRecord()
|
|
|
|
|
|
self.window?.makeKeyAndOrderFront(nil)
|
|
|
} else {
|
|
|
+ KMPrint("Win Back:不需要显示")
|
|
|
+
|
|
|
self.window?.close()
|
|
|
}
|
|
|
}
|
|
@@ -289,10 +299,8 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
contentBox.addSubview(hostingView, positioned: .below, relativeTo: backgroundIv)
|
|
|
|
|
|
hostingView.isHidden = true
|
|
|
-
|
|
|
-
|
|
|
} else {
|
|
|
- // Fallback on earlier versions
|
|
|
+ self.window?.close()
|
|
|
}
|
|
|
|
|
|
// https://api.storekit.itunes.apple.com/inApps/v1/subscriptions/{transactionId}
|
|
@@ -390,7 +398,7 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
|
|
|
override func interfaceThemeDidChanged(_ appearance: NSAppearance.Name) {
|
|
|
super.interfaceThemeDidChanged(appearance)
|
|
|
-
|
|
|
+
|
|
|
KMMainThreadExecute {
|
|
|
if KMAppearance.isDarkMode() {
|
|
|
self.titleLabel.textColor = .white
|
|
@@ -406,9 +414,9 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
self.despBox.fillColor = NSColor.white.withAlphaComponent(0.15)
|
|
|
self.despView_.titleLabel.textColor = .white
|
|
|
|
|
|
- let despAttri = NSMutableAttributedString(string: NSLocalizedString("First 6 months ", comment: ""), attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor.white])
|
|
|
+ let despAttri = NSMutableAttributedString(string: NSLocalizedString("First 6 months", comment: "")+" ", attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor.white])
|
|
|
despAttri.append(.init(string: self.displayPriceString_, attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor(hex: "#227AFF")]))
|
|
|
- let string = String(format: NSLocalizedString(", then %@ for 6 months.", comment: ""), self.origialPrice_)
|
|
|
+ let string = ", " + String(format: NSLocalizedString("then %@ for 6 months.", comment: ""), self.origialPrice_)
|
|
|
despAttri.append(.init(string: string, attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor.white]))
|
|
|
self.despView_.subTitleLabel.attributedStringValue = despAttri
|
|
|
|
|
@@ -429,9 +437,9 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
self.despBox.fillColor = .white
|
|
|
self.despView_.titleLabel.textColor = NSColor(hex: "#0E1114")
|
|
|
|
|
|
- let despAttri = NSMutableAttributedString(string: NSLocalizedString("First 6 months ", comment: ""), attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor(hex: "#000150")])
|
|
|
+ let despAttri = NSMutableAttributedString(string: NSLocalizedString("First 6 months", comment: ""), attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor(hex: "#000150")])
|
|
|
despAttri.append(.init(string: self.displayPriceString_, attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor(hex: "#4982E6")]))
|
|
|
- let string = String(format: NSLocalizedString(", then %@ for 6 months.", comment: ""), self.origialPrice_)
|
|
|
+ let string = ", " + String(format: NSLocalizedString("then %@ for 6 months.", comment: ""), self.origialPrice_)
|
|
|
despAttri.append(.init(string: string, attributes: [.font : NSFont.SFProTextRegularFont(14), .foregroundColor : NSColor(hex: "#000150")]))
|
|
|
self.despView_.subTitleLabel.attributedStringValue = despAttri
|
|
|
|
|
@@ -568,7 +576,10 @@ class KMWinBackWindowController: KMBaseWindowController {
|
|
|
if lastShowTime > 0 {
|
|
|
let date = Date(timeIntervalSince1970: lastShowTime)
|
|
|
if date.isToday() {
|
|
|
+#if DEBUG
|
|
|
+#else
|
|
|
return false
|
|
|
+#endif
|
|
|
}
|
|
|
}
|
|
|
|