diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/Contents.json similarity index 85% rename from YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/Contents.json index 8409f86f..bde95ce1 100644 --- a/YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/Contents.json @@ -1,7 +1,6 @@ { "images" : [ { - "filename" : "mine_dressUp_new_en.png", "idiom" : "universal", "scale" : "1x" }, @@ -10,6 +9,7 @@ "scale" : "2x" }, { + "filename" : "矩形 2941@3x-2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/矩形 2941@3x-2.png b/YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/矩形 2941@3x-2.png new file mode 100644 index 00000000..c1b14264 Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.30/mall_item_card_normal_bg.imageset/矩形 2941@3x-2.png differ diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/Contents.json b/YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/Contents.json similarity index 85% rename from YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/Contents.json rename to YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/Contents.json index 22dda616..afa6fd50 100644 --- a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/Contents.json +++ b/YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/Contents.json @@ -1,7 +1,6 @@ { "images" : [ { - "filename" : "mine_dressUp_new_ar.png", "idiom" : "universal", "scale" : "1x" }, @@ -10,6 +9,7 @@ "scale" : "2x" }, { + "filename" : "矩形 2941@3x.png", "idiom" : "universal", "scale" : "3x" } diff --git a/YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/矩形 2941@3x.png b/YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/矩形 2941@3x.png new file mode 100644 index 00000000..2fa8877c Binary files /dev/null and b/YuMi/Assets.xcassets/1.0.30/mall_item_card_selected_bg.imageset/矩形 2941@3x.png differ diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/Contents.json deleted file mode 100644 index 8f508484..00000000 --- a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressUp_exclusive_ar.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/mine_dressUp_exclusive_ar.png b/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/mine_dressUp_exclusive_ar.png deleted file mode 100644 index d0465fce..00000000 Binary files a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_exclusive_ar.imageset/mine_dressUp_exclusive_ar.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/Contents.json deleted file mode 100644 index c2b4fdb2..00000000 --- a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressUp_limit_ar.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/mine_dressUp_limit_ar.png b/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/mine_dressUp_limit_ar.png deleted file mode 100644 index 898ea1d1..00000000 Binary files a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_limit_ar.imageset/mine_dressUp_limit_ar.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/mine_dressUp_new_ar.png b/YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/mine_dressUp_new_ar.png deleted file mode 100644 index f7c6b3e1..00000000 Binary files a/YuMi/Assets.xcassets/Language/ar/mine_dressUp_new_ar.imageset/mine_dressUp_new_ar.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/Contents.json b/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/Contents.json deleted file mode 100644 index 113ebb6a..00000000 --- a/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressup_give_ar.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/mine_dressup_give_ar.png b/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/mine_dressup_give_ar.png deleted file mode 100644 index 39536593..00000000 Binary files a/YuMi/Assets.xcassets/Language/ar/mine_dressup_give_ar.imageset/mine_dressup_give_ar.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/Contents.json b/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/Contents.json deleted file mode 100644 index c0fe7c21..00000000 --- a/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressUp_exclusive_en.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/mine_dressUp_exclusive_en.png b/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/mine_dressUp_exclusive_en.png deleted file mode 100644 index e1ef47f5..00000000 Binary files a/YuMi/Assets.xcassets/Language/en/mine_dressUp_exclusive_en.imageset/mine_dressUp_exclusive_en.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/Contents.json b/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/Contents.json deleted file mode 100644 index 301d3b68..00000000 --- a/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressUp_limit_en.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/mine_dressUp_limit_en.png b/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/mine_dressUp_limit_en.png deleted file mode 100644 index 8ce8040a..00000000 Binary files a/YuMi/Assets.xcassets/Language/en/mine_dressUp_limit_en.imageset/mine_dressUp_limit_en.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/mine_dressUp_new_en.png b/YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/mine_dressUp_new_en.png deleted file mode 100644 index bb1c31af..00000000 Binary files a/YuMi/Assets.xcassets/Language/en/mine_dressUp_new_en.imageset/mine_dressUp_new_en.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/Contents.json b/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/Contents.json deleted file mode 100644 index 9e7ed991..00000000 --- a/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "filename" : "mine_dressup_give_en.png", - "idiom" : "universal", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/mine_dressup_give_en.png b/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/mine_dressup_give_en.png deleted file mode 100644 index 7c486f34..00000000 Binary files a/YuMi/Assets.xcassets/Language/en/mine_dressup_give_en.imageset/mine_dressup_give_en.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/Contents.json b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/Contents.json deleted file mode 100644 index d82ae82e..00000000 --- a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "mine_dressUp_exclusive@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "mine_dressUp_exclusive@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@2x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@2x.png deleted file mode 100644 index 9bf6decb..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@3x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@3x.png deleted file mode 100644 index 474c6130..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_exclusive.imageset/mine_dressUp_exclusive@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/Contents.json b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/Contents.json deleted file mode 100644 index 634583d6..00000000 --- a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "mine_dressUp_limit@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "mine_dressUp_limit@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@2x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@2x.png deleted file mode 100644 index f42e7833..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@3x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@3x.png deleted file mode 100644 index 794c0d01..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_limit.imageset/mine_dressUp_limit@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/Contents.json b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/Contents.json deleted file mode 100644 index cbe423c0..00000000 --- a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "mine_dressUp_new@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "mine_dressUp_new@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@2x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@2x.png deleted file mode 100644 index 8f0ddd3f..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@3x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@3x.png deleted file mode 100644 index 412343c5..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressUp_new.imageset/mine_dressUp_new@3x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/Contents.json b/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/Contents.json deleted file mode 100644 index d33867cc..00000000 --- a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/Contents.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "scale" : "1x" - }, - { - "filename" : "mine_dressup_give@2x.png", - "idiom" : "universal", - "scale" : "2x" - }, - { - "filename" : "mine_dressup_give@3x.png", - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@2x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@2x.png deleted file mode 100644 index e718ccca..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@2x.png and /dev/null differ diff --git a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@3x.png b/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@3x.png deleted file mode 100644 index 0641e5ef..00000000 Binary files a/YuMi/Assets.xcassets/jm/DressUp/mine_dressup_give.imageset/mine_dressup_give@3x.png and /dev/null differ diff --git a/YuMi/CustomUI/UIViewCorner/UIView+Corner.h b/YuMi/CustomUI/UIViewCorner/UIView+Corner.h index 25e563c8..1cbf4a7f 100644 --- a/YuMi/CustomUI/UIViewCorner/UIView+Corner.h +++ b/YuMi/CustomUI/UIViewCorner/UIView+Corner.h @@ -44,6 +44,8 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)setCornerRadius:(CGFloat)radius corners:(UIRectCorner)corners; +- (void)setCornerRadius:(CGFloat)radius cornerMask:(CACornerMask)cornerMask; + /** * 设置视图的指定圆角、圆角半径、边框宽度和边框颜色 * diff --git a/YuMi/CustomUI/UIViewCorner/UIView+Corner.m b/YuMi/CustomUI/UIViewCorner/UIView+Corner.m index 7c0c21d2..de019781 100644 --- a/YuMi/CustomUI/UIViewCorner/UIView+Corner.m +++ b/YuMi/CustomUI/UIViewCorner/UIView+Corner.m @@ -86,6 +86,12 @@ } } +- (void)setCornerRadius:(CGFloat)radius cornerMask:(CACornerMask)cornerMask { + self.layer.maskedCorners = cornerMask; + self.layer.cornerRadius = radius; + self.layer.masksToBounds = YES; +} + - (void)setCornerRadius:(CGFloat)radius corners:(CACornerMask)corners diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.h b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.h index 9ce6a425..781d467b 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.h +++ b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.h @@ -7,9 +7,11 @@ #import +#import "DressUpShopModel.h" + NS_ASSUME_NONNULL_BEGIN -typedef void (^FetchDataCompletion)(NSArray *data); +typedef void (^FetchDataCompletion)(NSArray * modelList); typedef void (^FetchDataForPage)(NSInteger pageIndex, FetchDataCompletion completion); diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m index 2ce783c0..a84371e7 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallCategoryListView.m @@ -9,18 +9,204 @@ @interface ShoppingMallItemCard : UICollectionViewCell +@property (nonatomic, strong) UIImageView *bgImageView; +@property (nonatomic, strong) UIView *itemBGView; +@property (nonatomic, strong) NetImageView *itemImageView; +@property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) DressUpShopModel *cellModel; +@property (nonatomic, strong) UIButton *playButton; +@property (nonatomic, strong) UILabel *pricePerDayLabel; +@property (nonatomic, strong) UILabel *description_1_label; +@property (nonatomic, strong) UILabel *description_2_label; +@property (nonatomic, strong) UILabel *statusLabel; + @end @implementation ShoppingMallItemCard - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { - // TODO: 补完内容 - // MARK: 逻辑比较复杂,需要新建文件处理 + self.backgroundColor = [UIColor clearColor]; + + [self.contentView addSubview:self.bgImageView]; + [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; + + [self.contentView addSubview:self.itemBGView]; + [self.itemBGView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.trailing.mas_equalTo(self.contentView).inset(15); + make.height.mas_equalTo(self.itemBGView.mas_width); + }]; + + [self.contentView addSubview:self.itemImageView]; + [self.itemImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.itemBGView); + make.width.height.mas_equalTo(self.itemBGView.mas_width).multipliedBy(0.7f); + }]; + + [self.contentView addSubview:self.playButton]; + [self.playButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.trailing.mas_equalTo(self.itemBGView).offset(-4); + make.size.mas_equalTo(CGSizeMake(26, 22)); + }]; + + [self.contentView addSubview:self.titleLabel]; + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.trailing.mas_equalTo(self.itemBGView); + make.top.mas_equalTo(self.itemBGView.mas_bottom).offset(5); + make.height.mas_equalTo(20); + }]; + + [self.contentView addSubview:self.pricePerDayLabel]; + [self.pricePerDayLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(6); + make.leading.mas_equalTo(self.itemBGView); + make.trailing.mas_equalTo(self.bgImageView); + }]; + + [self.contentView addSubview:self.description_1_label]; + [self.description_1_label mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.bgImageView).offset(1); + make.bottom.trailing.mas_equalTo(self.bgImageView).offset(-1); + make.height.mas_equalTo(30); + }]; + + [self.contentView addSubview:self.description_2_label]; + [self.description_2_label mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(self.bgImageView).offset(1); + make.bottom.trailing.mas_equalTo(self.bgImageView).offset(-1); + make.height.mas_equalTo(45); + }]; + + [self.contentView addSubview:self.statusLabel]; + [self.statusLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.leading.mas_equalTo(self.bgImageView).offset(1); + make.width.mas_greaterThanOrEqualTo(50); + make.height.mas_equalTo(22); + }]; } return self; } +- (void)setCellModel:(DressUpShopModel *)cellModel { + _cellModel = cellModel; + self.titleLabel.text = cellModel.name; + self.itemImageView.imageUrl = cellModel.pic; + self.pricePerDayLabel.attributedText = [cellModel pricePerDay]; + self.description_1_label.text = YMLocalizedString(@"1.0.30_text_1"); + self.description_2_label.text = YMLocalizedString(@"1.0.30_text_2"); + self.statusLabel.text = @"FFUFUFUFUFUFUFUFUUFUFUCKCKCKCKKCKCKCKCKCKCK";//YMLocalizedString(@"1.0.30_text_4"); +} + +- (void)handleTapPlay:(id)sender { + +} + +#pragma mark - +- (UIImageView *)bgImageView { + if (!_bgImageView) { + _bgImageView = [[UIImageView alloc] initWithImage:kImage(@"mall_item_card_normal_bg")]; + } + return _bgImageView; +} + +- (UIView *)itemBGView { + if (!_itemBGView) { + _itemBGView = [[UIView alloc] init]; + _itemBGView.backgroundColor = UIColorFromRGB(0x04184A); + [_itemBGView setCornerRadius:6]; + } + + return _itemBGView; +} + +- (NetImageView *)itemImageView { + if (!_itemImageView) { + _itemImageView = [[NetImageView alloc] init]; + _itemImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _itemImageView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [UILabel labelInitWithText:@"" + font:kFontMedium(14) + textColor:UIColorFromRGB(0xD9E7F7)]; + } + return _titleLabel; +} + +- (UIButton *)playButton { + if (!_playButton) { + _playButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_playButton setImage:kImage(@"mall_play_icon") forState:UIControlStateNormal]; + [_playButton addTarget:self + action:@selector(handleTapPlay:) + forControlEvents:UIControlEventTouchUpInside]; + } + return _playButton; +} + +- (UILabel *)pricePerDayLabel { + if (!_pricePerDayLabel) { + _pricePerDayLabel = [[UILabel alloc] init]; + } + return _pricePerDayLabel; +} + +- (UILabel *)description_1_label { + if (!_description_1_label) { + _description_1_label = [UILabel labelInitWithText:@"" + font:kFontRegular(12) + textColor:UIColorRGBAlpha(0xD9E7F7, 0.5)]; + _description_1_label.textAlignment = NSTextAlignmentCenter; + _description_1_label.backgroundColor = UIColorFromRGB(0x002840); + _description_1_label.numberOfLines = 0; + [_description_1_label setCornerRadius:11 + cornerMask:kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner]; + } + return _description_1_label; +} + +- (UILabel *)description_2_label { + if (!_description_2_label) { + _description_2_label = [UILabel labelInitWithText:@"" + font:kFontRegular(12) + textColor:UIColorRGBAlpha(0xD9E7F7, 0.5)]; + _description_2_label.textAlignment = NSTextAlignmentCenter; + _description_2_label.backgroundColor = UIColorFromRGB(0x002840); + _description_2_label.numberOfLines = 0; + [_description_2_label setCornerRadius:11 + cornerMask:kCALayerMinXMaxYCorner | kCALayerMaxXMaxYCorner]; + +#if DEBUG + _description_2_label.alpha = 0.3; +#endif + } + return _description_2_label; +} + +- (UILabel *)statusLabel { + if (!_statusLabel) { + // TODO: 需要单独处理 + _statusLabel = [UILabel labelInitWithText:@"" font:kFontMedium(12) textColor:UIColorFromRGB(0x51281B)]; + _statusLabel.textAlignment = NSTextAlignmentCenter; + + CAGradientLayer *gradientLayer = [CAGradientLayer layer]; + gradientLayer.colors = @[(__bridge id)UIColorFromRGB(0xE29030).CGColor, + (__bridge id)UIColorFromRGB(0xFCC074).CGColor]; + gradientLayer.startPoint = CGPointMake(0.0, 0.0); // 顶部中央 + gradientLayer.endPoint = CGPointMake(0.0, 1.0); // 底部中央 + gradientLayer.frame = CGRectMake(0, 0, 80, 22); // 设置渐变图层大小 + [_statusLabel.layer insertSublayer:gradientLayer atIndex:0]; + + [_statusLabel setCornerRadius:10 cornerMask:kCALayerMinXMinYCorner | kCALayerMaxXMaxYCorner]; + } + return _statusLabel; +} + @end @interface ShoppingMallCategoryCard : UIView @@ -111,7 +297,7 @@ @property (nonatomic, strong) UIScrollView *container2ScrollView; @property (nonatomic, strong) NSMutableArray *itemViews1; @property (nonatomic, strong) NSMutableArray *itemViews2; -@property (nonatomic, strong) NSMutableDictionary *dataCache; // 缓存每页数据 +@property (nonatomic, strong) NSMutableDictionary*> *dataCache; // 缓存每页数据 @property (nonatomic, strong) NSMutableSet *requestedPages; // 记录已经请求的数据页 @end @@ -190,9 +376,6 @@ // 添加 item view-2 到 container2ScrollView for (int i = 0; i < items.count; i++) { -// UIView *itemView2 = [[UIView alloc] initWithFrame:CGRectMake(i * screenWidth, 0, screenWidth, self.container2ScrollView.frame.size.height)]; -// itemView2.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1]; - UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init]; layout.itemSize = CGSizeMake((screenWidth-30) / 2 - 10, kGetScaleWidth(244)); layout.minimumInteritemSpacing = 10; @@ -206,6 +389,7 @@ collectionView.backgroundColor = [UIColor clearColor]; collectionView.tag = i; [collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"cell"]; + [collectionView registerClass:[ShoppingMallItemCard class] forCellWithReuseIdentifier:@"ShoppingMallItemCard"]; [self.container2ScrollView addSubview:collectionView]; [self.itemViews2 addObject:collectionView]; } @@ -231,10 +415,13 @@ // 使用外部提供的回调或代理来请求数据 if (self.fetchDataForPage) { + NSDictionary *itemDic = [self.items xpSafeObjectAtIndex:pageIndex]; + NSNumber *type = [itemDic allValues].firstObject; @kWeakify(self); - self.fetchDataForPage(pageIndex, ^(NSArray *data) { + self.fetchDataForPage(type.integerValue, ^(NSArray *data) { @kStrongify(self); if (self) { + // 更新数据到对应的 itemView-2 [self updateContainer2WithData:data atIndex:pageIndex]; self.dataCache[@(pageIndex)] = data; // 缓存数据 @@ -284,8 +471,11 @@ } - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { - UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; - cell.backgroundColor = [UIColor colorWithRed:arc4random()%255/255.0f green:arc4random()%255/255.0f blue:arc4random()%255/255.0f alpha:1]; // Placeholder color + ShoppingMallItemCard *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"ShoppingMallItemCard" + forIndexPath:indexPath]; + NSArray *data = self.dataCache[@(collectionView.tag)]; + cell.cellModel = [data xpSafeObjectAtIndex:indexPath.row]; + return cell; } diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.h b/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.h index 4a5f0ba5..5662bc54 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.h +++ b/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.h @@ -7,13 +7,14 @@ #import "BaseMvpPresenter.h" +#import "DressUpShopModel.h" NS_ASSUME_NONNULL_BEGIN @interface ShoppingMallDataPresent : BaseMvpPresenter /// 获取装扮商城列表 /// @param type 类型 0:铭牌,1:头饰,2:座驾,3:资料卡,4:聊天气泡 - (void)loadCategoryItems:(NSInteger)type - success:(void(^)(id obj))success + success:(void(^)(NSArray * array))success failure:(void(^)(NSError *error))failure; - (void)buyItem:(NSString *)itemID diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.m b/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.m index d9678a23..081004d4 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallDataPresent.m @@ -11,12 +11,13 @@ @implementation ShoppingMallDataPresent - (void)loadCategoryItems:(NSInteger)type - success:(nonnull void (^)(id _Nonnull))success + success:(nonnull void (^)(NSArray * array))success failure:(nonnull void (^)(NSError * _Nonnull))failure{ [Api requestDressUpShopList:[self createHttpCompletion:^(BaseModel * _Nonnull data) { if (success) { - success(data.data); + NSArray *array = [DressUpShopModel modelsWithArray:data.data]; + success(array); } } fail:^(NSInteger code, NSString * _Nullable msg) { if (failure) { diff --git a/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m b/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m index 8e1aaa02..15823fbe 100644 --- a/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m +++ b/YuMi/Modules/ShoppingMall/ShoppingMallViewController.m @@ -55,16 +55,14 @@ } - (void)fetchDataForPage:(NSInteger)pageIndex completion:(FetchDataCompletion)completion { - // 模拟异步数据请求,并在获取到数据后调用 completion - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ - NSMutableArray *data = [NSMutableArray array]; - for (int i = 0; i < 20; i++) { - [data addObject:@(i + arc4random()%100 * 20)]; - } + + [self.presenter loadCategoryItems:pageIndex success:^(NSArray * array) { if (completion) { - completion(data); + completion(array); } - }); + } failure:^(NSError * _Nonnull error) { +// TODO: 增加错误处理 + }]; } @end diff --git a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.h b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.h index 76b892cc..9dea2ac9 100644 --- a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.h +++ b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.h @@ -28,6 +28,27 @@ NS_ASSUME_NONNULL_BEGIN ///是否限时 0:限时,1:不限时 @property (nonatomic, assign) NSInteger dressLimitStatus; +//"装扮动效图片" +@property (nonatomic, copy) NSString *effect; + +// "折扣价格" +@property (nonatomic, assign) CGFloat discountPrice; + + +// "vip等级" +@property (nonatomic, assign) NSInteger vipLevel; + +// "vip等级对应的折扣百分比 * 100" +@property (nonatomic, assign) CGFloat discount; + +// "贵族限定,0-无限制,1,2,3,4..." +@property (nonatomic, assign) NSInteger vipLimit; + +// "获得方式,1-普通,2-活动" +@property (nonatomic, assign) NSInteger obtainWay; + +- (NSMutableAttributedString *)pricePerDay; + @end NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m index 2fe3a57b..5326c669 100644 --- a/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m +++ b/YuMi/Modules/YMMine/View/DressUp/Model/DressUpShopModel.m @@ -13,4 +13,38 @@ return @{@"dressUpId": @"id"}; } +- (NSMutableAttributedString *)pricePerDay { + // 创建一个 NSMutableAttributedString 来存放最终的结果 + NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init]; + + // 1. 添加金币图片 + NSTextAttachment *coinAttachment = [[NSTextAttachment alloc] init]; + coinAttachment.image = kImage(@"moli_money_icon"); // 替换为你的金币图片名称 + coinAttachment.bounds = CGRectMake(0, -2, 18, 18); // 设置图片大小和位置,偏移量适当调整 + NSAttributedString *coinString = [NSAttributedString attributedStringWithAttachment:coinAttachment]; + [attributedString appendAttributedString:coinString]; + + // 2. 添加空格 + NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@" "]; + [attributedString appendAttributedString:spaceString]; + + // 3. 添加 price 文本,字体加粗,颜色 #F8CE1F,字体大小 25 + NSDictionary *priceAttributes = @{ + NSFontAttributeName: kFontSemibold(15), + NSForegroundColorAttributeName: UIColorFromRGB(0xF8CE1F) + }; + NSAttributedString *priceString = [[NSAttributedString alloc] initWithString:@(self.dressPrice).stringValue attributes:priceAttributes]; + [attributedString appendAttributedString:priceString]; + + // 4. 添加 day 文本,字体常规,颜色 #F8CE1F,字体大小 12 + NSDictionary *dayAttributes = @{ + NSFontAttributeName: kFontRegular(12), + NSForegroundColorAttributeName: UIColorFromRGB(0xF8CE1F) + }; + NSAttributedString *dayString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"/%ldD", (long)self.dressDay] attributes:dayAttributes]; + [attributedString appendAttributedString:dayString]; + + return attributedString; +} + @end diff --git a/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m b/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m index de9471d4..4e121580 100644 --- a/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m +++ b/YuMi/Modules/YMNewHome/Presenter/XPHomeContainerPresenter.m @@ -62,9 +62,9 @@ return [RACSignal return:nil]; }]; - RACSignal *bannerSignal_2 = [banner_2 catch:^RACSignal *(NSError *error) { - return [RACSignal return:nil]; - }]; +// RACSignal *bannerSignal_2 = [banner_2 catch:^RACSignal *(NSError *error) { +// return [RACSignal return:nil]; +// }]; RACSignal *menuSignal = [menu catch:^RACSignal *(NSError *error) { return [RACSignal return:nil]; diff --git a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m index 2d69b05d..adaab3a4 100644 --- a/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m +++ b/YuMi/Modules/YMNewHome/View/XPHomePagingViewController.m @@ -166,10 +166,11 @@ #pragma mark - - (void)didTapMineButton { +#if DEBUG ShoppingMallViewController *vc = [[ShoppingMallViewController alloc] init]; [self.navigationController pushViewController:vc animated:YES]; return; - +#endif [self.pageContainer setViewControllers:@[self.viewControllers[1]] direction:UIPageViewControllerNavigationDirectionReverse diff --git a/YuMi/ar.lproj/Localizable.strings b/YuMi/ar.lproj/Localizable.strings index 3b9f9a7a..73144420 100644 --- a/YuMi/ar.lproj/Localizable.strings +++ b/YuMi/ar.lproj/Localizable.strings @@ -3999,3 +3999,8 @@ ineHeadView12" = "الحمل"; "1.0.18_28" = "كن في اي بي%@، يمكنك الحصول على %@ حصص كل يوم، والدردشة بشكل خاص مع المستخدمين مجانًا، جرب ذلك؟"; "1.0.18_29" = "لقد قمت بالدردشة مع 1000 شخص اليوم، يرجى المحاولة مرة أخرى غدًا."; "1.0.18_30" = "%@كن في اي بي"; + +"1.0.30_text_1" = "VIP Enjoy Discounts"; +"1.0.30_text_2" = "Only get by event, cannot buy"; +"1.0.30_text_3" = "Exclusive for VIP%@"; +"1.0.30_text_4" = "Limited"; diff --git a/YuMi/en.lproj/Localizable.strings b/YuMi/en.lproj/Localizable.strings index f6067810..69a97174 100644 --- a/YuMi/en.lproj/Localizable.strings +++ b/YuMi/en.lproj/Localizable.strings @@ -3792,3 +3792,8 @@ "1.0.18_28" = "Be %@, you can get %@ quotas every day, chat privately with users for free, try it?"; "1.0.18_29" = "You have chatted with 1,000 people today, please try again tomorrow."; "1.0.18_30" = "Be VIP%@"; + +"1.0.30_text_1" = "VIP Enjoy Discounts"; +"1.0.30_text_2" = "Only get by event, cannot buy"; +"1.0.30_text_3" = "Exclusive for VIP%@"; +"1.0.30_text_4" = "Limited"; diff --git a/YuMi/tr.lproj/Localizable.strings b/YuMi/tr.lproj/Localizable.strings index 2bd47b00..a6d08244 100644 --- a/YuMi/tr.lproj/Localizable.strings +++ b/YuMi/tr.lproj/Localizable.strings @@ -3578,3 +3578,8 @@ "1.0.18_28" = "%@ olun, her gün %@ kota alabilirsiniz, kullanıcılarla özel olarak ücretsiz sohbet edebilirsiniz, dener misiniz?"; "1.0.18_29" = "Bugün 1000 kişiyle sohbet ettiniz, lütfen yarın tekrar deneyin."; "1.0.18_30" = "VIP%@ olun"; + +"1.0.30_text_1" = "VIP Enjoy Discounts"; +"1.0.30_text_2" = "Only get by event, cannot buy"; +"1.0.30_text_3" = "Exclusive for VIP%@"; +"1.0.30_text_4" = "Limited"; diff --git a/YuMi/zh-Hant.lproj/Localizable.strings b/YuMi/zh-Hant.lproj/Localizable.strings index fd05d869..989e9169 100644 --- a/YuMi/zh-Hant.lproj/Localizable.strings +++ b/YuMi/zh-Hant.lproj/Localizable.strings @@ -3450,3 +3450,8 @@ "1.0.18_28" = "成為%@,每天可獲得%@個配額,免費與用戶私聊,試試看嗎?"; "1.0.18_29" = "你今天已經與1000人聊天,請明天再試。"; "1.0.18_30" = "成為VIP%@"; + +"1.0.30_text_1" = "VIP Enjoy Discounts"; +"1.0.30_text_2" = "Only get by event, cannot buy"; +"1.0.30_text_3" = "Exclusive for VIP%@"; +"1.0.30_text_4" = "Limited";