@@ -5,12 +5,12 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_panel_arrow@2x.png",
|
||||
"filename" : "gift_bag_icon@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_gift_panel_arrow@3x.png",
|
||||
"filename" : "gift_bag_icon@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@2x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 979 B |
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@3x.png
vendored
Normal file
BIN
YuMi/Assets.xcassets/main/gift_bag_icon.imageset/gift_bag_icon@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 214 B |
Binary file not shown.
Before Width: | Height: | Size: 293 B |
@@ -120,6 +120,9 @@ static CGFloat MiniHeight = 130.5;
|
||||
}
|
||||
|
||||
- (void)startInitUI {
|
||||
if (self.backgroundImageView.superview) {
|
||||
return;
|
||||
}
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
@@ -143,11 +146,6 @@ static CGFloat MiniHeight = 130.5;
|
||||
|
||||
#pragma mark - Private Method
|
||||
- (void)setupBackground {
|
||||
|
||||
if (self.backgroundImageView.superview) {
|
||||
return;
|
||||
}
|
||||
|
||||
[self addSubview:self.backgroundImageView];
|
||||
[self addSubview:self.backgroundImageView_small];
|
||||
|
||||
|
@@ -793,7 +793,7 @@
|
||||
if (!self.acrossPKPanelView.superview) {
|
||||
[self addSubview:self.acrossPKPanelView];
|
||||
[self.acrossPKPanelView startInitUI];
|
||||
self.acrossPKPanelView.center = self.center;
|
||||
self.acrossPKPanelView.center = self.center;
|
||||
}
|
||||
AcrossRoomPKPanelModel * acrossPKPanelInfo = [AcrossRoomPKPanelModel modelWithJSON:attachment.data];
|
||||
if (attachment.data[@"amicStatus"] != nil){
|
||||
|
@@ -20,8 +20,8 @@
|
||||
@property (nonatomic, strong) JXCategoryTitleView *titleView;
|
||||
///分页lineView
|
||||
@property (nonatomic, strong) JXCategoryListContainerView *pi_containerView;
|
||||
///背包总价值
|
||||
@property (nonatomic,strong) UILabel *totalValueLabel;
|
||||
/////背包总价值
|
||||
//@property (nonatomic,strong) UILabel *totalValueLabel;
|
||||
///背包礼物
|
||||
@property (nonatomic,strong) UIButton *packGiftButton;
|
||||
///背包礼物面板
|
||||
@@ -60,7 +60,7 @@
|
||||
[self addSubview:self.titleView];
|
||||
[self addSubview:self.pi_containerView];
|
||||
[self addSubview:self.packGiftButton];
|
||||
[self addSubview:self.totalValueLabel];
|
||||
// [self addSubview:self.totalValueLabel];
|
||||
[self addSubview:self.packGiftView];
|
||||
|
||||
}
|
||||
@@ -74,20 +74,25 @@
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.equalTo(self);
|
||||
make.height.mas_equalTo(44);
|
||||
// make.leading.equalTo(self).offset(8);
|
||||
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).offset(-16);
|
||||
make.height.mas_equalTo(34);
|
||||
make.width.mas_equalTo(kGetScaleWidth(200));
|
||||
|
||||
|
||||
}];
|
||||
[self.packGiftButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(-15);
|
||||
make.centerY.height.mas_equalTo(self.titleView);
|
||||
make.width.mas_equalTo(isMSRTL() ? 70:40);
|
||||
}];
|
||||
[self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
|
||||
make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
|
||||
make.centerY.mas_equalTo(self.packGiftButton);
|
||||
// make.top.mas_equalTo(2);
|
||||
make.centerY.mas_equalTo(self.titleView);
|
||||
// make.height.mas_equalTo(self.titleView);
|
||||
// make.width.mas_equalTo(isMSRTL() ? 70:40);
|
||||
make.size.mas_equalTo(CGSizeMake(20, 20));
|
||||
}];
|
||||
// [self.totalValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.trailing.mas_equalTo(self.packGiftButton.mas_leading).mas_offset(-3);
|
||||
// make.leading.equalTo(self.titleView.mas_trailing).mas_offset(5);
|
||||
// make.centerY.mas_equalTo(self.packGiftButton);
|
||||
// }];
|
||||
[self.pi_containerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.trailing.bottom.equalTo(self);
|
||||
make.top.equalTo(self.titleView.mas_bottom).mas_offset(kGetScaleWidth(0));
|
||||
@@ -125,7 +130,7 @@
|
||||
[self.titleView reloadData];
|
||||
self.pi_containerView.hidden = NO;
|
||||
self.packGiftView.hidden = YES;
|
||||
self.totalValueLabel.hidden = YES;
|
||||
// self.totalValueLabel.hidden = YES;
|
||||
XPGiftInfoView *vc = [self getListVC:index];
|
||||
self.segmentType = vc.segmentType;
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
||||
@@ -179,30 +184,30 @@
|
||||
[self.titleView reloadData];
|
||||
self.packGiftView.hidden = NO;
|
||||
self.pi_containerView.hidden = YES;
|
||||
self.totalValueLabel.hidden = NO;
|
||||
// self.totalValueLabel.hidden = NO;
|
||||
self.segmentType = GiftSegmentType_Pack;
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(pIGiftInfoSegmentedView:didClickSegment:)]){
|
||||
[self.delegate pIGiftInfoSegmentedView:self didClickSegment:self.segmentType];
|
||||
}
|
||||
}
|
||||
- (void)createPackTotalValueAttribute {
|
||||
__block NSInteger giftTotal = 0;
|
||||
[self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:GiftInfoModel.class]) {
|
||||
GiftInfoModel *gift = (GiftInfoModel *)obj;
|
||||
if(gift.giftId != self.freeModel.giftId.integerValue){
|
||||
giftTotal += gift.count * gift.goldPrice;
|
||||
}
|
||||
}
|
||||
}];
|
||||
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
|
||||
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
|
||||
NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
|
||||
attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
|
||||
attachImage.bounds = CGRectMake(0, 0, 9, 9);
|
||||
[str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
|
||||
self.totalValueLabel.attributedText = str;
|
||||
}
|
||||
//- (void)createPackTotalValueAttribute {
|
||||
// __block NSInteger giftTotal = 0;
|
||||
// [self.packOriginArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
// if ([obj isKindOfClass:GiftInfoModel.class]) {
|
||||
// GiftInfoModel *gift = (GiftInfoModel *)obj;
|
||||
// if(gift.giftId != self.freeModel.giftId.integerValue){
|
||||
// giftTotal += gift.count * gift.goldPrice;
|
||||
// }
|
||||
// }
|
||||
// }];
|
||||
// NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:YMLocalizedString(@"XPGiftInfoView0" ) attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:10],NSForegroundColorAttributeName:[DJDKMIMOMColor textThirdColor]}];
|
||||
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@",[self countFormatCoinStr:giftTotal]] attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12],NSForegroundColorAttributeName:[DJDKMIMOMColor appMainColor]}]];
|
||||
// NSTextAttachment *attachImage = [[NSTextAttachment alloc] init];
|
||||
// attachImage.image = [UIImage imageNamed:@"exchange_gold_icon"];
|
||||
// attachImage.bounds = CGRectMake(0, 0, 9, 9);
|
||||
// [str appendAttributedString:[[NSMutableAttributedString alloc] initWithAttributedString:[NSAttributedString attributedStringWithAttachment:attachImage]]];
|
||||
// self.totalValueLabel.attributedText = str;
|
||||
//}
|
||||
/**
|
||||
将数量格式化为字符串 万之后用xx.xxW显示并保留小数点2位,最多显示9999W+;
|
||||
@param number 数值
|
||||
@@ -255,7 +260,7 @@
|
||||
-(void)setPackOriginArray:(NSArray *)packOriginArray{
|
||||
_packOriginArray = packOriginArray;
|
||||
self.packGiftView.packOriginArray = packOriginArray;
|
||||
[self createPackTotalValueAttribute];
|
||||
// [self createPackTotalValueAttribute];
|
||||
}
|
||||
-(void)setFreeModel:(XPFreeGiftModel *)freeModel{
|
||||
_freeModel = freeModel;
|
||||
@@ -268,8 +273,12 @@
|
||||
-(void)setRoomType:(RoomType)roomType{
|
||||
_roomType = roomType;
|
||||
if(_roomType == RoomType_Anchor){
|
||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView3"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9"),YMLocalizedString(@"XPGiftInfoView8")];
|
||||
|
||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
|
||||
YMLocalizedString(@"XPGiftInfoView3"),
|
||||
YMLocalizedString(@"XPGiftInfoView4"),
|
||||
YMLocalizedString(@"XPGiftInfoView9"),
|
||||
YMLocalizedString(@"XPGiftInfoView8")];
|
||||
|
||||
self.titleView.titles = self.pi_titles;
|
||||
|
||||
[self.titleView reloadData];
|
||||
@@ -279,7 +288,9 @@
|
||||
_usingplaceType = usingplaceType;
|
||||
self.packGiftView.usingplaceType = _usingplaceType;
|
||||
if (_usingplaceType == SendGiftType_User) {
|
||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),YMLocalizedString(@"XPGiftInfoView4"),YMLocalizedString(@"XPGiftInfoView9")];
|
||||
self.pi_titles = @[YMLocalizedString(@"XPGiftInfoView2"),
|
||||
YMLocalizedString(@"XPGiftInfoView4"),
|
||||
YMLocalizedString(@"XPGiftInfoView9")];
|
||||
self.titleView.titles = self.pi_titles;
|
||||
[self.titleView reloadData];
|
||||
self.titleView.titleColor = [DJDKMIMOMColor secondTextColor];
|
||||
@@ -347,20 +358,21 @@
|
||||
}
|
||||
return _pi_containerView;
|
||||
}
|
||||
- (UILabel *)totalValueLabel {
|
||||
if (!_totalValueLabel) {
|
||||
_totalValueLabel = [[UILabel alloc] init];
|
||||
_totalValueLabel.hidden = YES;
|
||||
_totalValueLabel.textAlignment = NSTextAlignmentRight;
|
||||
}
|
||||
return _totalValueLabel;
|
||||
}
|
||||
//- (UILabel *)totalValueLabel {
|
||||
// if (!_totalValueLabel) {
|
||||
// _totalValueLabel = [[UILabel alloc] init];
|
||||
// _totalValueLabel.hidden = YES;
|
||||
// _totalValueLabel.textAlignment = NSTextAlignmentRight;
|
||||
// }
|
||||
// return _totalValueLabel;
|
||||
//}
|
||||
- (UIButton *)packGiftButton {
|
||||
if (!_packGiftButton) {
|
||||
_packGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
|
||||
[_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
||||
_packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||
// [_packGiftButton setTitle:YMLocalizedString(@"XPGiftInfoView5") forState:UIControlStateNormal];
|
||||
// [_packGiftButton setTitleColor:[DJDKMIMOMColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
||||
// _packGiftButton.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||
[_packGiftButton setBackgroundImage:[UIImage imageNamed:@"gift_bag_icon"] forState:UIControlStateNormal];
|
||||
_packGiftButton.tag = GiftSegmentType_Pack;
|
||||
[_packGiftButton addTarget:self action:@selector(didClickGiftSegmentAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
///分割线
|
||||
@property (nonatomic, strong) UIView *bottomDevideView;
|
||||
///箭头
|
||||
@property (nonatomic, strong) UIImageView *arrowImageView;
|
||||
//@property (nonatomic, strong) UIImageView *arrowImageView;
|
||||
|
||||
|
||||
///轮播图
|
||||
@@ -53,7 +53,7 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
// [self addSubview:self.devideView];
|
||||
// [self addSubview:self.interactButton];
|
||||
|
||||
[self addSubview:self.arrowImageView];
|
||||
// [self addSubview:self.arrowImageView];
|
||||
[self addSubview:self.pi_BannerView];
|
||||
[self addSubview:self.bottomDevideView];
|
||||
|
||||
@@ -69,11 +69,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.width.mas_equalTo(40);
|
||||
}];
|
||||
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
make.centerX.mas_equalTo(self.giftButton);
|
||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
}];
|
||||
// [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
// make.centerX.mas_equalTo(self.giftButton);
|
||||
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
// }];
|
||||
// [self.interactButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerY.mas_equalTo(self);
|
||||
// make.leading.mas_equalTo(self.devideView.mas_trailing).mas_offset(8);
|
||||
@@ -129,11 +129,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
sender.selected = YES;
|
||||
|
||||
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
make.centerX.mas_equalTo(self.giftButton);
|
||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
}];
|
||||
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
// make.centerX.mas_equalTo(self.giftButton);
|
||||
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)interactButtonAction:(UIButton *)sender {
|
||||
@@ -149,11 +149,11 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
sender.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightSemibold];
|
||||
self.giftButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
|
||||
[self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
make.centerX.mas_equalTo(self.giftButton);
|
||||
make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
}];
|
||||
// [self.arrowImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.bottom.mas_equalTo(self.bottomDevideView.mas_top);
|
||||
// make.centerX.mas_equalTo(self.giftButton);
|
||||
// make.size.mas_equalTo(CGSizeMake(9, 7));
|
||||
// }];
|
||||
}
|
||||
|
||||
#pragma mark - setter
|
||||
@@ -220,14 +220,14 @@ static NSString *kHideGiftViewInteractDot = @"kHideGiftViewInteractDot";//是否
|
||||
return _titleArray;
|
||||
}
|
||||
|
||||
- (UIImageView *)arrowImageView {
|
||||
if (!_arrowImageView) {
|
||||
UIImageView *imageView = [[UIImageView alloc] init];
|
||||
imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
|
||||
|
||||
_arrowImageView = imageView;
|
||||
}
|
||||
return _arrowImageView;
|
||||
}
|
||||
//- (UIImageView *)arrowImageView {
|
||||
// if (!_arrowImageView) {
|
||||
// UIImageView *imageView = [[UIImageView alloc] init];
|
||||
// imageView.image = [UIImage imageNamed:@"room_gift_panel_arrow"];
|
||||
//
|
||||
// _arrowImageView = imageView;
|
||||
// }
|
||||
// return _arrowImageView;
|
||||
//}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user