暂时提交
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface QXRedBagSendView : UIView
|
||||
@property (nonatomic,strong)NSString *room_id;
|
||||
-(void)showInView:(UIView*)view;
|
||||
-(void)hide;
|
||||
@end
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#import "QXRedBagSendView.h"
|
||||
#import <WebKit/WebKit.h>
|
||||
#import "QXMineNetwork.h"
|
||||
@interface QXRedBagSendView()<UITextFieldDelegate>
|
||||
@property (nonatomic,strong)UIView *bgView;
|
||||
@property (nonatomic,strong)UIImageView *bgImageView;
|
||||
@@ -36,7 +37,8 @@
|
||||
@property (nonatomic,strong)NSString *redBagContentType;
|
||||
/// 红包倒计时
|
||||
@property (nonatomic,strong)NSString *redBagTime;
|
||||
|
||||
/// 条件 0 无 1 收藏房间 2 仅麦上用户 多条件时用,隔开
|
||||
@property (nonatomic,strong)NSString *conditions;
|
||||
|
||||
|
||||
@property (nonatomic,strong)UIView* nextContentView;
|
||||
@@ -82,9 +84,14 @@
|
||||
}
|
||||
|
||||
-(void)initSubviews{
|
||||
/// 默认普通红包
|
||||
self.redBagType = @"1";
|
||||
/// 默认金币红包
|
||||
self.redBagContentType = @"1";
|
||||
/// 默认立刻
|
||||
self.redBagTime = @"0";
|
||||
/// 无限制条件
|
||||
self.conditions = @"0";
|
||||
self.timeArray = @[@0,@1,@2,@5,@10];
|
||||
|
||||
self.bgView = [[UIView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-345)/2, (SCREEN_HEIGHT-454)/2, 345, 454)];
|
||||
@@ -680,6 +687,12 @@
|
||||
|
||||
#pragma mark - action
|
||||
-(void)nextAction{
|
||||
if (self.redBagType.intValue == 2) {
|
||||
if (![self.pwdTextField.text isExist]) {
|
||||
showToast(@"请输入口令");
|
||||
return;
|
||||
}
|
||||
}
|
||||
self.currentPage = 1;
|
||||
if (self.redBagContentType.intValue == 1) {
|
||||
self.moneyUnitLabel.text = @"金币";
|
||||
@@ -703,7 +716,32 @@
|
||||
}];
|
||||
}
|
||||
-(void)commitAction{
|
||||
|
||||
if (![self.moneyTextField.text isExist]) {
|
||||
showToast(@"请输入红包金额");
|
||||
return;
|
||||
}
|
||||
if (![self.countTextField.text isExist]) {
|
||||
showToast(@"请输入红包数量");
|
||||
return;
|
||||
}
|
||||
if (self.countTextField.text.longLongValue > self.moneyTextField.text.longLongValue) {
|
||||
showToast(@"红包数量不能大于红包金额");
|
||||
return;
|
||||
}
|
||||
self.conditions = @"1";
|
||||
[QXMineNetwork createRedpacketWithType:self.redBagType
|
||||
password:self.pwdTextField.text
|
||||
coin_type:self.redBagContentType
|
||||
total_amount:self.moneyTextField.text
|
||||
total_count:self.countTextField.text
|
||||
conditions:self.conditions
|
||||
countdown:self.redBagTime
|
||||
room_id:self.room_id
|
||||
successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
-(void)helpAction{
|
||||
@@ -761,6 +799,7 @@
|
||||
make.top.equalTo(self.firstTopView.mas_bottom).offset(12);
|
||||
}];
|
||||
self.redBagType = @"1";
|
||||
self.pwdTextField.text = @"";
|
||||
}else{
|
||||
self.pwdRedBagBtn.selected = YES;
|
||||
self.normalRedBagBtn.selected = NO;
|
||||
@@ -799,12 +838,14 @@
|
||||
self.noDrawAuthBtn.selected = YES;
|
||||
self.collectDrawAuthBtn.selected = NO;
|
||||
self.upSeatDrawAuthBtn.selected = NO;
|
||||
self.conditions = @"0";
|
||||
}else if (sender == self.collectDrawAuthBtn) {
|
||||
self.collectDrawAuthBtn.selected = !self.collectDrawAuthBtn.selected;
|
||||
if (self.upSeatDrawAuthBtn.selected || self.collectDrawAuthBtn.selected) {
|
||||
self.noDrawAuthBtn.selected = NO;
|
||||
}else{
|
||||
self.noDrawAuthBtn.selected = YES;
|
||||
self.conditions = @"0";
|
||||
}
|
||||
}else if (sender == self.upSeatDrawAuthBtn) {
|
||||
self.noDrawAuthBtn.selected = NO;
|
||||
@@ -813,6 +854,7 @@
|
||||
self.noDrawAuthBtn.selected = NO;
|
||||
}else{
|
||||
self.noDrawAuthBtn.selected = YES;
|
||||
self.conditions = @"0";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user