This commit is contained in:
2025-12-11 16:59:14 +08:00
parent 526ac1a7df
commit f338a54e41
2 changed files with 16 additions and 14 deletions

View File

@@ -45,8 +45,12 @@ static NSString * const kKBSkinThemeStoreKey = @"KBSkinThemeCurrent";
_accentColor = [coder decodeObjectOfClass:UIColor.class forKey:@"accentColor"] ?: [UIColor colorWithRed:0.77 green:0.93 blue:0.82 alpha:1.0];
_backgroundImageData = [coder decodeObjectOfClass:NSData.class forKey:@"backgroundImageData"];
//
_hiddenKeyTextIdentifiers = [coder decodeObjectOfClass:NSArray.class forKey:@"hiddenKeyTextIdentifiers"];
_keyIconMap = [coder decodeObjectOfClass:NSDictionary.class forKey:@"keyIconMap"];
// iOS 17 validateAllowedClass
NSSet *arrayClasses = [NSSet setWithObjects:NSArray.class, NSString.class, nil];
_hiddenKeyTextIdentifiers = [coder decodeObjectOfClasses:arrayClasses forKey:@"hiddenKeyTextIdentifiers"];
NSSet *dictClasses = [NSSet setWithObjects:NSDictionary.class, NSString.class, NSNumber.class, nil];
_keyIconMap = [coder decodeObjectOfClasses:dictClasses forKey:@"keyIconMap"];
}
return self;
}

View File

@@ -36,7 +36,7 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
@property (nonatomic, copy) NSArray<NSDictionary *> *gridData; //
@property (nonatomic, strong) KBShopVM *shopVM;
@property (nonatomic, strong, nullable) KBShopThemeDetailModel *detailModel;
@property (nonatomic, assign) BOOL isProcessingAction;
//@property (nonatomic, assign) BOOL isProcessingAction;
@end
@implementation KBSkinDetailVC
@@ -212,7 +212,7 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
#pragma mark - Actions
- (void)handleDownloadAction {
if (self.isProcessingAction) { return; }
// if (self.isProcessingAction) { return; }
if (self.themeId.length == 0) {
[KBHUD showInfo:KBLocalized(@"主题信息缺失")];
return;
@@ -229,13 +229,13 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
}
- (void)purchaseCurrentTheme {
if (self.isProcessingAction) { return; }
self.isProcessingAction = YES;
// if (self.isProcessingAction) { return; }
// self.isProcessingAction = YES;
[KBHUD show];
__weak typeof(self) weakSelf = self;
[self.shopVM purchaseThemeWithId:self.themeId completion:^(BOOL success, NSError * _Nullable error) {
dispatch_async(dispatch_get_main_queue(), ^{
weakSelf.isProcessingAction = NO;
// weakSelf.isProcessingAction = NO;
[KBHUD dismiss];
if (error || !success) {
NSString *msg = error.localizedDescription ?: KBLocalized(@"购买失败");
@@ -250,8 +250,8 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
}
- (void)requestDownload {
if (self.isProcessingAction) { return; }
self.isProcessingAction = YES;
// if (self.isProcessingAction) { return; }
// self.isProcessingAction = YES;
[KBHUD show];
NSMutableDictionary *skin = [NSMutableDictionary dictionary];
if (!skin[@"id"] && self.detailModel.themeId) {
@@ -260,11 +260,9 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
if (!skin[@"name"] && self.detailModel.themeName) {
skin[@"name"] = self.detailModel.themeName;
}
if (!skin[@"themeDownloadUrl"]) {
[KBHUD showInfo:KBLocalized(@"缺少下载地址")];
return;
}
skin[@"themeDownloadUrl"] = self.detailModel.themeDownloadUrl;
skin[@"zip_url"] = self.detailModel.themeDownloadUrl ? self.detailModel.themeDownloadUrl : @"";
[[KBSkinService shared] applySkinWithJSON:skin
fromViewController:self