3
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user