红包bug修复
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
#import "XPRoomRedPacketPwdView.h"
|
||||
#import "XPMinePayPwdViewController.h"
|
||||
#import "RoomInfoModel.h"
|
||||
#import "XPIAPRechargeViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
|
||||
@interface PIRoomSendRedPacketItemVC ()<PIRedPacketChooseTypeViewDelegate,XPRoomRedPacketPwdViewDelegate>
|
||||
///host代理
|
||||
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
|
||||
@@ -42,6 +45,7 @@
|
||||
@property(nonatomic,assign) PIRedPacketChooseTypeViewType sendRedType;
|
||||
@property(nonatomic,strong) UserInfoModel *userInfo;
|
||||
@property(nonatomic,assign) BOOL pi_isHaveUser;
|
||||
|
||||
@end
|
||||
|
||||
@implementation PIRoomSendRedPacketItemVC
|
||||
@@ -51,6 +55,8 @@
|
||||
- (BOOL)isHiddenNavBar {
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate type:(PIRoomSendRedPacketItemVCType)type{
|
||||
self = [super init];
|
||||
if(self){
|
||||
@@ -225,13 +231,14 @@
|
||||
self.promptlyBtn.titleLabel.font = kFontRegular(16);
|
||||
}
|
||||
-(void)onReleaseButtonClick{
|
||||
//判断红包数量
|
||||
|
||||
//判断钻石数量
|
||||
NSInteger packetCount = [self.pi_priceView.redPacketNum integerValue];
|
||||
if (packetCount <= 0) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPRoomSendRedPacketViewController17")];
|
||||
return;
|
||||
}
|
||||
//判断钻石数量
|
||||
//判断红包数量
|
||||
NSInteger diamonCount = [self.pi_numView.redPacketNum integerValue];
|
||||
if (diamonCount <= 0) {
|
||||
[self showErrorToast:YMLocalizedString(@"XPRoomSendRedPacketViewController18")];
|
||||
@@ -241,6 +248,19 @@
|
||||
// [self showErrorToast:YMLocalizedString(@"XPRoomSendRedPacketViewController19")];
|
||||
// return;
|
||||
// }
|
||||
if(self.walletModel.diamonds.integerValue < packetCount){
|
||||
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
||||
config.message = YMLocalizedString(@"XPTreasureFairyViewController5");
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPTreasureFairyViewController6");
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
XPIAPRechargeViewController * rechargeVC = [[XPIAPRechargeViewController alloc] init];
|
||||
rechargeVC.type = @"4";
|
||||
[[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:rechargeVC animated:YES];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
return;
|
||||
}
|
||||
self.pi_isHaveUser = YES;
|
||||
if(self.userInfo == nil){
|
||||
[self.presenter getUserModel];
|
||||
@@ -248,7 +268,7 @@
|
||||
}
|
||||
if (self.userInfo.isBindPaymentPwd) {
|
||||
XPRoomRedPacketPwdView *pwdView = [[XPRoomRedPacketPwdView alloc] init];
|
||||
pwdView.diamonCount = @(packetCount * diamonCount).stringValue;
|
||||
pwdView.diamonCount = @(packetCount).stringValue;
|
||||
pwdView.delegate = self;
|
||||
[TTPopup popupView:pwdView style:TTPopupStyleAlert];
|
||||
} else {
|
||||
@@ -263,8 +283,14 @@
|
||||
NSString *roomUid = [NSString stringWithFormat:@"%ld", self.hostDelegate.getRoomInfo.uid];
|
||||
NSString *type = self.type == Room_Send_Red_Packet_Type_Lobby ? @"1" : @"2";
|
||||
NSArray *kindList = @[@"1",@"2",@"3",@"4"];
|
||||
NSString *kind = [kindList safeObjectAtIndex1:self.sendRedType];
|
||||
NSString *message = self.serverInputView.getContent.length ? self.serverInputView.getContent : YMLocalizedString(@"XPRoomSendRedPacketViewController4");
|
||||
NSString *kind = self.type == Room_Send_Red_Packet_Type_Lobby ? [kindList safeObjectAtIndex1:self.sendRedType] : @"0";
|
||||
NSString *message ;
|
||||
if(self.type == Room_Send_Red_Packet_Type_Lobby){
|
||||
message = self.scrollingView.pi_scrolling.length > 0 ? self.scrollingView.pi_scrolling : YMLocalizedString(@"XPRoomSendRedPacketViewController4");
|
||||
}else{
|
||||
message = self.serverInputView.getContent.length > 0 ? self.serverInputView.getContent : YMLocalizedString(@"XPRoomSendRedPacketViewController4");
|
||||
}
|
||||
|
||||
NSString *validityType = self.promptlyBtn.selected == YES ? @"0" : @"1";
|
||||
if(self.sendRedType != Red_Packet_Choose_type_Normal){
|
||||
validityType = @"1";
|
||||
|
Reference in New Issue
Block a user