修改了礼物面板送礼物按钮的效果

This commit is contained in:
fengshuo
2022-03-23 19:27:30 +08:00
parent 1f3ba5bac3
commit 926e1aa66b
4 changed files with 23 additions and 20 deletions

View File

@@ -30,6 +30,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong) WalletInfoModel *walletInfoModel;
///是否展示首充
@property (nonatomic,assign) BOOL isShowFirstRecharge;
///是否可用
@property (nonatomic,assign) BOOL sendButtonIsEnable;
@end
NS_ASSUME_NONNULL_END

View File

@@ -267,6 +267,13 @@
return NO;
}
#pragma mark - Getters And Setters
- (void)setSendButtonIsEnable:(BOOL)sendButtonIsEnable {
_sendButtonIsEnable = sendButtonIsEnable;
[UIView animateWithDuration:0.3 animations:^{
self.sendGiftButton.enabled = self.sendButtonIsEnable;
}];
}
- (void)setIsShowFirstRecharge:(BOOL)isShowFirstRecharge {
self.firstRechargeButton.hidden = !isShowFirstRecharge;
}
@@ -374,9 +381,12 @@
if (!_sendGiftButton) {
_sendGiftButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_sendGiftButton setTitle:@"赠送" forState:UIControlStateNormal];
[_sendGiftButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
[_sendGiftButton setTitleColor:[ThemeColor confirmButtonTextColor] forState:UIControlStateNormal];
[_sendGiftButton setTitle:@"赠送中..." forState:UIControlStateDisabled];
[_sendGiftButton setTitleColor:[ThemeColor disableButtonTextColor] forState:UIControlStateDisabled];
[_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
_sendGiftButton.titleLabel.font = [UIFont systemFontOfSize:13];
[_sendGiftButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor disableButtonColor], [ThemeColor disableButtonColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateDisabled];
_sendGiftButton.titleLabel.font = [UIFont systemFontOfSize:12];
_sendGiftButton.layer.masksToBounds = YES;
_sendGiftButton.layer.cornerRadius = 15;
[_sendGiftButton addTarget:self action:@selector(sendButtonAction:) forControlEvents:UIControlEventTouchUpInside];

View File

@@ -296,6 +296,7 @@
if (roomSendType == -1) {
return;
}
self.giftBarView.sendButtonIsEnable = NO;
///
[self.giftPresenter sendGift:uidString giftNum:giftNumber sendType:sendType giftId:giftId giftSource:sourceType giftType:giftInfo.giftType roomSendType:roomSendType roomUid:self.roomUid msg:@""];
} else {
@@ -371,6 +372,7 @@
}
- (void)sendGiftSuccess:(GiftReceiveInfoModel *)receiveInfo originDic:(NSDictionary *)originDic uidCount:(NSInteger)uidCount{
self.giftBarView.sendButtonIsEnable = YES;
if (receiveInfo.sourceType == GiftSourceType_Pack) {
///
[self.giftInfoView updatePackSource:receiveInfo numberUser:uidCount];
@@ -382,6 +384,7 @@
///
- (void)sendGiftFailWithCode:(NSInteger)code msg:(NSString *)msg {
self.giftBarView.sendButtonIsEnable = YES;
if (code == 31005) {//
[self showNotSufficientFundsWithToast:msg];
} else if (code == 8535) {//