This commit is contained in:
2025-12-11 15:39:33 +08:00
parent 4fd0a52a36
commit be1d1ad70d
5 changed files with 36 additions and 11 deletions

View File

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 还原设计稿见需求截图左侧「Points\nMall」标题 + 右侧大金币装饰
/// 下方卡片显示积分与「Recharge」按钮。
/// Masonry 约束 + 懒加载,中文注释。
@class KBShopThemeDetailModel;
@interface KBShopHeadView : UIView
/// 点击充值回调
@@ -21,6 +23,9 @@ NS_ASSUME_NONNULL_BEGIN
/// 更新积分展示
- (void)updatePoints:(NSString *)points;
/// 根据主题详情更新头图(展示主题预览图等)
- (void)configureWithThemeDetail:(KBShopThemeDetailModel * _Nullable)detail;
@end
NS_ASSUME_NONNULL_END

View File

@@ -7,6 +7,8 @@
#import "KBShopHeadView.h"
#import "KBJfPay.h"
#import "UIImageView+KBWebImage.h"
#import "KBShopThemeDetailModel.h"
@interface KBShopHeadView ()
@@ -172,6 +174,16 @@
self.amountLabel.text = points;
}
- (void)configureWithThemeDetail:(KBShopThemeDetailModel * _Nullable)detail {
NSString *urlString = detail.themePreviewImageUrl;
UIImage *placeholder = [UIImage imageNamed:@"shop_headbigBg_icon"];
if (urlString.length > 0) {
[self.bigCoinView kb_setImageURL:urlString placeholder:placeholder];
} else {
self.bigCoinView.image = placeholder;
}
}
#pragma mark - Actions
- (void)onRechargeTappedAction {
// if (self.onRechargeTapped) { self.onRechargeTapped(); }

View File

@@ -92,10 +92,7 @@ typedef NS_ENUM(NSInteger, KBSkinDetailSection) {
switch (indexPath.section) {
case KBSkinDetailSectionHeader: {
KBSkinDetailHeaderCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:kHeaderCellId forIndexPath:indexPath];
NSString *title = self.detailModel.themeName.length ? self.detailModel.themeName : @"Dopamine";
NSString *download = self.detailModel.themeDownload.length ? self.detailModel.themeDownload : @"0";
NSString *right = [NSString stringWithFormat:@"%@: %@", KBLocalized(@"Download"), download];
[cell configWithTitle:title right:right];
[cell configWithDetail:self.detailModel];
return cell;
}
case KBSkinDetailSectionTags: {