From 940ca58a953b5ec567f38ce6a41c072bd38f1726 Mon Sep 17 00:00:00 2001 From: liyuhua <15626451870@163.com> Date: Wed, 18 Oct 2023 16:54:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BA=A2=E5=8C=85UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 18 +++ .../SendRedPacket/Cell/PIInputRedPacketView.h | 18 +++ .../SendRedPacket/Cell/PIInputRedPacketView.m | 134 ++++++++++++++++++ .../Cell/PIRedPacketChooseTypeCell.h | 16 +++ .../Cell/PIRedPacketChooseTypeCell.m | 53 +++++++ .../Cell/PIRedPacketChooseTypeView.h | 16 +++ .../Cell/PIRedPacketChooseTypeView.m | 31 ++++ 7 files changed, 286 insertions(+) create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.h create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.m create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.h create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.m create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.h create mode 100644 YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 5ce3517a..2b453a36 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -300,6 +300,9 @@ 23D321D22ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D12ADD0EBC006B259C /* PIRoomPhotoAlbumItemPresenter.m */; }; 23D321D52ADD0F05006B259C /* Api+PhotoAlbum.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D42ADD0F05006B259C /* Api+PhotoAlbum.m */; }; 23D321D92ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */; }; + 23D321DC2ADFBFF6006B259C /* PIInputRedPacketView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321DB2ADFBFF6006B259C /* PIInputRedPacketView.m */; }; + 23D321DF2ADFCEB2006B259C /* PIRedPacketChooseTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321DE2ADFCEB2006B259C /* PIRedPacketChooseTypeView.m */; }; + 23D321E22ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23D321E12ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m */; }; 23D8DEF22AC5633300644637 /* PIIAPRegulate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */; }; 23E45C052AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */; }; 23E9E9972A80C3A100B792F2 /* XPMineGuildPersonalBillRecordVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E9E9942A80C39F00B792F2 /* XPMineGuildPersonalBillRecordVC.m */; }; @@ -2019,6 +2022,12 @@ 23D321D62ADD0F2C006B259C /* PIRoomPhotoAlbumItemProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemProtocol.h; sourceTree = ""; }; 23D321D72ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRoomPhotoAlbumItemModel.h; sourceTree = ""; }; 23D321D82ADD1B46006B259C /* PIRoomPhotoAlbumItemModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRoomPhotoAlbumItemModel.m; sourceTree = ""; }; + 23D321DA2ADFBFF6006B259C /* PIInputRedPacketView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIInputRedPacketView.h; sourceTree = ""; }; + 23D321DB2ADFBFF6006B259C /* PIInputRedPacketView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIInputRedPacketView.m; sourceTree = ""; }; + 23D321DD2ADFCEB2006B259C /* PIRedPacketChooseTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRedPacketChooseTypeView.h; sourceTree = ""; }; + 23D321DE2ADFCEB2006B259C /* PIRedPacketChooseTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRedPacketChooseTypeView.m; sourceTree = ""; }; + 23D321E02ADFD0FB006B259C /* PIRedPacketChooseTypeCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PIRedPacketChooseTypeCell.h; sourceTree = ""; }; + 23D321E12ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PIRedPacketChooseTypeCell.m; sourceTree = ""; }; 23D8DEF12AC5633300644637 /* PIIAPRegulate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PIIAPRegulate.swift; sourceTree = ""; }; 23E45C032AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SessionDiscoverNewTableViewCell.h; sourceTree = ""; }; 23E45C042AC2B0A200D88BCA /* SessionDiscoverNewTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SessionDiscoverNewTableViewCell.m; sourceTree = ""; }; @@ -5808,6 +5817,12 @@ children = ( 9B42869A28C1FD3D009034D2 /* XPOpenRedPacketCell.h */, 9B42869B28C1FD3D009034D2 /* XPOpenRedPacketCell.m */, + 23D321DA2ADFBFF6006B259C /* PIInputRedPacketView.h */, + 23D321DB2ADFBFF6006B259C /* PIInputRedPacketView.m */, + 23D321DD2ADFCEB2006B259C /* PIRedPacketChooseTypeView.h */, + 23D321DE2ADFCEB2006B259C /* PIRedPacketChooseTypeView.m */, + 23D321E02ADFD0FB006B259C /* PIRedPacketChooseTypeCell.h */, + 23D321E12ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m */, ); path = Cell; sourceTree = ""; @@ -10522,6 +10537,7 @@ 9BD2ECD2288F833B00F5CD9A /* XPMineFootPrintModel.m in Sources */, E824546626F5FF6000BE8163 /* XPMineResetPayPasswordProtocol.h in Sources */, E89DA66427005932008483C1 /* XPIAPHelper.m in Sources */, + 23D321E22ADFD0FB006B259C /* PIRedPacketChooseTypeCell.m in Sources */, E824545E26F5EF2200BE8163 /* XPMineVerifIdentityProtocol.h in Sources */, E824545326F5CEAD00BE8163 /* XPMineModifPayProtocol.h in Sources */, E84BF7D7277C6E2100EF8877 /* XPRoomRoleViewController.m in Sources */, @@ -10846,6 +10862,7 @@ E85E7B062A4EB0D200B6D00A /* XPGuildSearchPresenter.m in Sources */, E8788945273A55C200BF1D57 /* XPGiftInfoView.m in Sources */, 9BF5192628801D4700B6BE92 /* XPAcrossRoomPKCountDownView.m in Sources */, + 23D321DC2ADFBFF6006B259C /* PIInputRedPacketView.m in Sources */, 23E9E99E2A80C7AF00B792F2 /* XPMineGuildPersonalBillRecordItemView.m in Sources */, E87DF4F52A42CC49009C1185 /* HomeMenuInfoModel.m in Sources */, 9BD63FAB277EE885006EB744 /* Api+RoomRadio.m in Sources */, @@ -11518,6 +11535,7 @@ 142721AF29A75F6F00C7C423 /* SJXCSMIPHelper.m in Sources */, E87E62742A3F5907002F68C9 /* XPHomeBannerTableViewCell.m in Sources */, E88C72A3282917590047FB2B /* XPRoomMusicVoiceSettingView.m in Sources */, + 23D321DF2ADFCEB2006B259C /* PIRedPacketChooseTypeView.m in Sources */, E81AF32827F1EE69003B9E43 /* XPRoomPKPanelUserView.m in Sources */, E84150BF27747BD300A7F548 /* Api+FirstRecharge.m in Sources */, E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */, diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.h b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.h new file mode 100644 index 00000000..708ddbd3 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.h @@ -0,0 +1,18 @@ +// +// PIInputRedPacketView.h +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIInputRedPacketView : UIView +@property(nonatomic,copy) NSString *pi_title; +@property(nonatomic,assign) BOOL isHiddenIcon; +@property(nonatomic,strong) NSString *unitTitle; +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.m b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.m new file mode 100644 index 00000000..6c11a0a6 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIInputRedPacketView.m @@ -0,0 +1,134 @@ +// +// PIInputRedPacketView.m +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import "PIInputRedPacketView.h" +@interface PIInputRedPacketView() +///容器 +@property(nonatomic,strong) UIStackView *pi_stackView; +///红包图标 +@property(nonatomic,strong) UIImageView *pi_iconView; +///标题 +@property(nonatomic,strong) UILabel *pi_titleView; +///数量 +@property(nonatomic,strong) UITextField *pi_textField; +///分割线 +@property(nonatomic,strong) UIView *pi_lineView; +///单位 +@property(nonatomic,strong) UILabel *pi_unitView; +@end +@implementation PIInputRedPacketView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + [self setCornerWithLeftTopCorner:kGetScaleWidth(8) rightTopCorner:kGetScaleWidth(8) bottomLeftCorner:kGetScaleWidth(8) bottomRightCorner:kGetScaleWidth(8) size:CGSizeMake(kGetScaleWidth(327), kGetScaleWidth(48))]; + self.backgroundColor = UIColorFromRGB(0xF8F8FA); + [self addSubview:self.pi_stackView]; + [self addSubview:self.pi_textField]; + [self addSubview:self.pi_lineView]; + [self addSubview:self.pi_unitView]; + + [self.pi_stackView addArrangedSubview:self.pi_iconView]; + [self.pi_stackView addArrangedSubview:self.pi_titleView]; +} +-(void)installConstraints{ + [self.pi_stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.leading.mas_equalTo(kGetScaleWidth(12)); + make.height.mas_equalTo(kGetScaleWidth(24)); + make.centerY.equalTo(self); + make.width.mas_equalTo(kGetScaleWidth(94)); + }]; + [self.pi_iconView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.height.mas_equalTo(kGetScaleWidth(24)); + }]; + [self.pi_titleView mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(kGetScaleWidth(66)); + make.height.mas_equalTo(kGetScaleWidth(22)); + }]; + [self.pi_unitView mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-kGetScaleWidth(16)); + make.centerY.equalTo(self); + }]; + [self.pi_lineView mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-kGetScaleWidth(46)); + make.height.mas_equalTo(kGetScaleWidth(26)); + make.width.mas_equalTo(kGetScaleWidth(1)); + make.centerY.equalTo(self); + + }]; + [self.pi_textField mas_makeConstraints:^(MASConstraintMaker *make) { + make.trailing.mas_equalTo(-kGetScaleWidth(59)); + make.height.mas_equalTo(kGetScaleWidth(22)); + make.leading.equalTo(self.pi_stackView.mas_trailing).mas_offset(kGetScaleWidth(10)); + make.centerY.equalTo(self); + }]; +} +- (void)setPi_title:(NSString *)pi_title{ + _pi_title = pi_title; + _pi_titleView.text = _pi_title; +} +- (void)setIsHiddenIcon:(BOOL)isHiddenIcon{ + _isHiddenIcon = isHiddenIcon; + _pi_iconView.hidden = _isHiddenIcon; +} +-(void)setUnitTitle:(NSString *)unitTitle{ + _unitTitle = unitTitle; + _pi_unitView = _unitTitle; +} +#pragma mark - 懒加载 +- (UIStackView *)pi_stackView { + if (!_pi_stackView) { + _pi_stackView = [[UIStackView alloc] init]; + _pi_stackView.distribution = UIStackViewDistributionFillEqually; + _pi_stackView.alignment = UIStackViewAlignmentCenter; + _pi_stackView.spacing = kGetScaleWidth(4); + } + return _pi_stackView; +} +- (UIImageView *)pi_iconView{ + if(!_pi_iconView){ + _pi_iconView = [UIImageView new]; + } + return _pi_iconView; +} +- (UILabel *)pi_titleView{ + if(!_pi_titleView){ + _pi_titleView = [UILabel labelInitWithText:@"" font:kFontRegular(16) textColor:UIColorFromRGB(0x322F4D)]; + } + return _pi_titleView; +} +- (UITextField *)pi_textField{ + if(!_pi_textField){ + _pi_textField = [[UITextField alloc]init]; + _pi_textField.placeholder = @"0"; + _pi_textField.textColor = UIColorFromRGB(0x322F4D); + _pi_textField.font = kFontMedium(16); + _pi_textField.keyboardType = UIKeyboardTypeNumberPad; + _pi_textField.textAlignment = NSTextAlignmentRight; + } + return _pi_textField; +} +- (UIView *)pi_lineView{ + if(!_pi_lineView){ + _pi_lineView = [UIView new]; + _pi_lineView.backgroundColor = UIColorFromRGB(0xEBEEF5); + } + return _pi_lineView; +} +- (UILabel *)pi_unitView{ + if(!_pi_unitView){ + _pi_unitView = [UILabel labelInitWithText:@"" font:kFontRegular(16) textColor:UIColorFromRGB(0x767585)]; + } + return _pi_unitView; +} +@end diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.h b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.h new file mode 100644 index 00000000..91bcfdcc --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.h @@ -0,0 +1,16 @@ +// +// PIRedPacketChooseTypeCell.h +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIRedPacketChooseTypeCell : UICollectionViewCell + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.m b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.m new file mode 100644 index 00000000..296fe762 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeCell.m @@ -0,0 +1,53 @@ +// +// PIRedPacketChooseTypeCell.m +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import "PIRedPacketChooseTypeCell.h" +@interface PIRedPacketChooseTypeCell() +@property(nonatomic,strong) UILabel *pi_titleView; +@property(nonatomic,strong) UILabel *pi_subView; +@end +@implementation PIRedPacketChooseTypeCell +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + [self.contentView setCornerWithLeftTopCorner:kGetScaleWidth(8) rightTopCorner:kGetScaleWidth(8) bottomLeftCorner:kGetScaleWidth(8) bottomRightCorner:kGetScaleWidth(8) size:CGSizeMake(kGetScaleWidth(94), kGetScaleWidth(62))]; + self.contentView.backgroundColor = UIColorFromRGB(0xF8F8FA); + [self.contentView addSubview:self.pi_titleView]; + [self.contentView addSubview:self.pi_subView]; +} +-(void)installConstraints{ + [self.pi_titleView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(15)); + make.height.mas_equalTo(kGetScaleWidth(17)); + make.centerX.equalTo(self.contentView); + }]; + [self.pi_subView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(kGetScaleWidth(31)); + make.height.mas_equalTo(kGetScaleWidth(14)); + make.centerX.equalTo(self.contentView); + }]; +} +#pragma mark - 懒加载 +- (UILabel *)pi_titleView{ + if(!_pi_titleView){ + _pi_titleView = [UILabel labelInitWithText:@"" font:kFontRegular(12) textColor:UIColorFromRGB(0x767585)]; + } + return _pi_titleView; +} +- (UILabel *)pi_subView{ + if(!_pi_subView){ + _pi_subView = [UILabel labelInitWithText:@"" font:kFontRegular(10) textColor:UIColorFromRGB(0x94959C)]; + } + return _pi_subView; +} +@end diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.h b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.h new file mode 100644 index 00000000..49b30c30 --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.h @@ -0,0 +1,16 @@ +// +// PIRedPacketChooseTypeView.h +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface PIRedPacketChooseTypeView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.m b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.m new file mode 100644 index 00000000..d831d30d --- /dev/null +++ b/YuMi/Modules/YMRoom/View/SendRedPacket/Cell/PIRedPacketChooseTypeView.m @@ -0,0 +1,31 @@ +// +// PIRedPacketChooseTypeView.m +// YuMi +// +// Created by duoban on 2023/10/18. +// + +#import "PIRedPacketChooseTypeView.h" +@interface PIRedPacketChooseTypeView() +@property(nonatomic,strong) UILabel *pi_titleView; +@property(nonatomic,strong) UICollectionView *collectionView; +@end +@implementation PIRedPacketChooseTypeView + +-(instancetype)initWithFrame:(CGRect)frame{ + self = [super initWithFrame:frame]; + if(self){ + [self installUI]; + [self installConstraints]; + } + return self; +} +-(void)installUI{ + +} +-(void)installConstraints{ + +} +#pragma mark - 懒加载 + +@end