优化内购交易重试机制,增加交易重试次数记录,完善后台任务处理,更新相关API接口,调整UI组件约束,修复部分UI问题,更新本地化字符串。版本号更新至20.20.63。

This commit is contained in:
edwinQQQ
2025-05-21 18:59:32 +08:00
parent b688962559
commit 298a7e80c4
22 changed files with 291 additions and 75 deletions

View File

@@ -295,11 +295,12 @@ static const CGFloat kSectionSpacing = 20.0;
TZImagePickerController *imagePickerVc = [[TZImagePickerController alloc] initWithMaxImagesCount:1 delegate:self];
imagePickerVc.allowCrop = YES;
// eventBannerImageView
CGFloat viewWidth = self.view.frame.size.width - (kHorizontalPadding * 2 - 2);
CGFloat viewHeight = kGetScaleWidth(118);
CGFloat cropWidth = MIN(viewWidth, KScreenWidth);
CGFloat cropHeight = (viewHeight / viewWidth) * cropWidth;
// 690:236
CGFloat aspectRatio = 690.0 / 236.0; // 2.92:1
//
CGFloat cropWidth = MIN(self.view.frame.size.width - (kHorizontalPadding * 2 - 2), KScreenWidth);
CGFloat cropHeight = cropWidth / aspectRatio;
//
imagePickerVc.cropRect = CGRectMake((KScreenWidth-cropWidth)/2, (KScreenHeight - cropHeight) / 2, cropWidth, cropHeight);
@@ -392,6 +393,21 @@ static const CGFloat kSectionSpacing = 20.0;
notifyFans:notifyFans];
}];
} cancelHandler:^{ }];
} else {
@kWeakify(self);
[self uploadCover:bannerImage
finish:^(NSString *path) {
@kStrongify(self);
[self.presenter createEventWithTitle:title
image:path
uploadToHome:uploadToHomepage
startTime:startTime
duration:self.durationMinutes
content:content
gold:uploadToHomepage ? self.configModel.goldNum : 0
roomUid:self.selectRoomModel.roomUid
notifyFans:notifyFans];
}];
}
}
@@ -508,8 +524,9 @@ static const CGFloat kSectionSpacing = 20.0;
UIImage *selectedImage = info[UIImagePickerControllerOriginalImage];
if (selectedImage) {
// iOS 14
CGFloat aspectRatio = 690.0 / 236.0; // 2.92:1
CGFloat viewWidth = self.view.frame.size.width - (kHorizontalPadding * 2 - 2);
CGFloat viewHeight = kGetScaleWidth(118);
CGFloat viewHeight = viewWidth / aspectRatio;
CGSize cropSize = CGSizeMake(viewWidth, viewHeight);
UIImage *croppedImage = [selectedImage cutImage:cropSize];
@@ -587,7 +604,9 @@ static const CGFloat kSectionSpacing = 20.0;
[self.eventBannerImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.eventBannerLabel.mas_bottom).offset(kVerticalPadding);
make.leading.trailing.equalTo(self.contentView).inset(kHorizontalPadding-1);
make.height.mas_equalTo(kGetScaleWidth(118)); // Adjust height as needed
// 690:236
make.height.equalTo(self.eventBannerImageView.mas_width).multipliedBy(236.0/690.0);
}];
[self.eventBannerCamearImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.trailing.equalTo(self.eventBannerImageView);