福袋礼物面板优化
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#import <Masonry/Masonry.h>
|
||||
///Tool
|
||||
#import "XPMacro.h"
|
||||
#import "XPHtmlUrl.h"
|
||||
#import "ThemeColor+SendGift.h"
|
||||
///Model
|
||||
#import "GiftInfoModel.h"
|
||||
@@ -95,7 +96,13 @@
|
||||
|
||||
- (void)playRuleButtonAction:(UIButton *)sender {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPGiftInfoView:didClickPlayRule:)]) {
|
||||
[self.delegate xPGiftInfoView:self didClickPlayRule:self.lastSelectGift.giftExplainUrl];
|
||||
NSString * giftExplainUrl;
|
||||
if (self.segmentType == GiftSegmentType_Lucky) {
|
||||
giftExplainUrl = [NSString stringWithFormat:URLWithType(kLuckyGiftPlayRuleURL), [NSString stringWithFormat:@"%ld", self.lastSelectGift.giftId]];
|
||||
} else {
|
||||
giftExplainUrl = self.lastSelectGift.giftExplainUrl;
|
||||
}
|
||||
[self.delegate xPGiftInfoView:self didClickPlayRule:giftExplainUrl];
|
||||
}
|
||||
}
|
||||
- (void)didClickNobleSegmentAction:(UIButton *)sender {
|
||||
@@ -147,6 +154,10 @@
|
||||
make.height.mas_equalTo(30);
|
||||
}];
|
||||
|
||||
[self.playRuleButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(75);
|
||||
}];
|
||||
|
||||
[self.giftStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.segmentStackView.mas_bottom).offset(10);
|
||||
make.left.right.mas_equalTo(self);
|
||||
@@ -201,7 +212,7 @@
|
||||
} else {
|
||||
giftInfo.sourceType = GiftSourceType_Normal;
|
||||
}
|
||||
self.playRuleButton.hidden = giftInfo.giftExplainUrl.length <= 0;
|
||||
self.playRuleButton.hidden = self.segmentType == GiftSegmentType_Lucky ? NO : giftInfo.giftExplainUrl.length <= 0 ;
|
||||
giftInfo.isSelected = YES;
|
||||
}
|
||||
|
||||
@@ -441,7 +452,7 @@
|
||||
- (UIButton *)luckyGiftButton {
|
||||
if (!_luckyGiftButton) {
|
||||
_luckyGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_luckyGiftButton setTitle:@"幸运" forState:UIControlStateNormal];
|
||||
[_luckyGiftButton setTitle:@"幸运礼物" forState:UIControlStateNormal];
|
||||
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected];
|
||||
[_luckyGiftButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
||||
_luckyGiftButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
@@ -469,7 +480,7 @@
|
||||
- (UIButton *)weekStarButton {
|
||||
if (!_weekStarButton) {
|
||||
_weekStarButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_weekStarButton setTitle:@"周星" forState:UIControlStateNormal];
|
||||
[_weekStarButton setTitle:@"周星礼物" forState:UIControlStateNormal];
|
||||
[_weekStarButton setTitleColor:[ThemeColor giftSegmentSelectTitleColor] forState:UIControlStateSelected];
|
||||
[_weekStarButton setTitleColor:[ThemeColor giftSegmentNormalTitleColor] forState:UIControlStateNormal];
|
||||
_weekStarButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
||||
@@ -514,6 +525,7 @@
|
||||
_playRuleButton.titleLabel.font = [UIFont systemFontOfSize:13];
|
||||
[_playRuleButton setImage:[UIImage imageNamed:@"gift_info_rule"] forState:UIControlStateNormal];
|
||||
[_playRuleButton addTarget:self action:@selector(playRuleButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
[_playRuleButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 5, 0, 0)];
|
||||
_playRuleButton.hidden = YES;
|
||||
}
|
||||
return _playRuleButton;
|
||||
|
Reference in New Issue
Block a user