|
@@ -659,15 +659,19 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
|
|
|
self.saleBox.hidden = true;
|
|
|
self.saleIv.hidden = true;
|
|
|
-// if ([self isShowSale]) {
|
|
|
-// KMRecommondInfo *recoveryInfo = KMRecommondManager.manager.userRecoveryRecommond.recommondInfoArrM.firstObject;
|
|
|
-// NSImage *image = recoveryInfo.saleImage;
|
|
|
-// self.saleIv.image = image;
|
|
|
-// self.saleBox.hidden = false;
|
|
|
-// self.saleIv.hidden = false;
|
|
|
-// } else {
|
|
|
-// self.saleBox.hidden = true;
|
|
|
-// }
|
|
|
+ if ([self isShowSale]) {
|
|
|
+ KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.StoreUserRecovery.content.firstObject;
|
|
|
+ NSURL *url = [NSURL URLWithString:[KMAdvertisementModelTransition transitionImagePathWithImage:info.saleImage highlight:true]];
|
|
|
+ [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage * _Nonnull image) {
|
|
|
+ if (image != nil) {
|
|
|
+ self.saleIv.image = image;
|
|
|
+ self.saleBox.hidden = false;
|
|
|
+ self.saleIv.hidden = false;
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ } else {
|
|
|
+ self.saleBox.hidden = true;
|
|
|
+ }
|
|
|
|
|
|
if ([IAPProductsManager defaultManager].isAvailableAllFunction) {
|
|
|
self.value1PurchaseButton.enabled = NO;
|
|
@@ -1033,10 +1037,10 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
if (isSubscribed) {
|
|
|
return false;
|
|
|
}
|
|
|
-// KMRecommondInfo *recoveryInfo = KMRecommondManager.manager.userRecoveryRecommond.recommondInfoArrM.firstObject;
|
|
|
-// if (recoveryInfo.show == false) { // 活动结束
|
|
|
-// return false;
|
|
|
-// }
|
|
|
+ KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.StoreUserRecovery.content.firstObject;
|
|
|
+ if ([info.show boolValue] == false) { // 活动结束
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
@@ -1057,34 +1061,34 @@ static NSString *const KMPurchaseCompareCellIdentifier = @"KMPurchaseCompa
|
|
|
}
|
|
|
|
|
|
- (void)showDiscountToSaveWindow {
|
|
|
-// KMRecommondInfo *recoveryInfo = KMRecommondManager.manager.userRecoveryRecommond.recommondInfoArrM.firstObject;
|
|
|
-// NSImage *image = recoveryInfo.image;
|
|
|
-// if (image == nil) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
-// if ([KMDiscountToSaveWindowController needShow] == false) {
|
|
|
-// return;
|
|
|
-// }
|
|
|
-//
|
|
|
- KMDiscountToSaveWindowController *winC = [[KMDiscountToSaveWindowController alloc] initWithWindowNibName:@"KMDiscountToSaveWindowController"];
|
|
|
- self.discountToSaveWinC = winC;
|
|
|
- [self.window beginSheet:winC.window completionHandler:^(NSModalResponse returnCode) {
|
|
|
-
|
|
|
- }];
|
|
|
-//
|
|
|
-// winC.imgIv.image = image;
|
|
|
-//
|
|
|
+ if ([KMDiscountToSaveWindowController needShow] == false) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.StoreUserRecovery.content.firstObject;
|
|
|
+ NSURL *url = [NSURL URLWithString: [KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight: YES]];
|
|
|
+
|
|
|
__weak typeof(self) weakSelf = self;
|
|
|
- winC.itemClick = ^(NSInteger idx) {
|
|
|
- [weakSelf.window endSheet:weakSelf.discountToSaveWinC.window];
|
|
|
- weakSelf.discountToSaveWinC = nil;
|
|
|
- if (idx == 2) { // 订阅
|
|
|
-//// NSLog(@"buttonItemClicked_Subscribe");
|
|
|
+ [self addWaingView:self.window.contentView];
|
|
|
+ [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage *image) {
|
|
|
+ [weakSelf removeWaitingView:weakSelf.window.contentView];
|
|
|
+ if (image == nil) {
|
|
|
+ return;
|
|
|
}
|
|
|
- };
|
|
|
-//
|
|
|
-// [winC release];
|
|
|
+
|
|
|
+ KMDiscountToSaveWindowController *winC = [[KMDiscountToSaveWindowController alloc] initWithWindowNibName:@"KMDiscountToSaveWindowController"];
|
|
|
+ weakSelf.discountToSaveWinC = winC;
|
|
|
+ [weakSelf.window beginSheet:winC.window completionHandler:^(NSModalResponse returnCode) { }];
|
|
|
+
|
|
|
+ winC.imgIv.image = image;
|
|
|
+ winC.itemClick = ^(NSInteger idx) {
|
|
|
+ [weakSelf.window endSheet:weakSelf.discountToSaveWinC.window];
|
|
|
+ weakSelf.discountToSaveWinC = nil;
|
|
|
+ if (idx == 2) { // 订阅
|
|
|
+ //// NSLog(@"buttonItemClicked_Subscribe");
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
- (IBAction)buttonItemClicked_Restore:(id)sender {
|