修改了礼物面板送礼物按钮的效果
This commit is contained in:
@@ -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
|
||||
|
@@ -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];
|
||||
|
@@ -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) {//贵族等级未达到礼物等级
|
||||
|
Reference in New Issue
Block a user