交友房初步完成
This commit is contained in:
@@ -18,6 +18,8 @@ typedef NS_ENUM(NSInteger) {
|
||||
QXSendGiftViewTypeRoom ,
|
||||
/// 拍卖
|
||||
QXSendGiftViewTypeAuction ,
|
||||
/// 交友房
|
||||
QXSendGiftViewTypeFriend ,
|
||||
}QXSendGiftViewType;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@@ -41,10 +43,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)NSString* dynamicId;
|
||||
/// 拍卖id
|
||||
@property (nonatomic,strong)NSString* auctionId;
|
||||
/// 交友房助力id
|
||||
@property (nonatomic,strong)NSString* heartId;
|
||||
|
||||
@property (nonatomic,copy)void(^sendSuccessBlock)(NSString*dynamicId);
|
||||
|
||||
@property (nonatomic,copy)void(^roomSendSuccessBlock)(BOOL isAuction, QXGiftModel*giftModel,NSString*userId, NSString*auctionId);
|
||||
@property (nonatomic,copy)void(^roomSendSuccessBlock)(QXSendGiftViewType sendType, QXGiftModel*giftModel,NSString*userId, NSString*optionId);
|
||||
-(void)reloadData;
|
||||
|
||||
-(void)showInView:(UIView *)view;
|
||||
@@ -107,9 +111,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,strong)UIButton *sendBtn;
|
||||
|
||||
@property (nonatomic,strong)QXGiftModel *giftModel;
|
||||
@property (nonatomic,assign)BOOL isAuction;
|
||||
@property (nonatomic,assign)QXSendGiftViewType sendType;
|
||||
@property (nonatomic,strong)NSString *userId;
|
||||
@property (nonatomic,strong)NSString *auctionId;
|
||||
@property (nonatomic,strong)NSString *heartId;
|
||||
@property (nonatomic,strong)NSString *roomId;
|
||||
|
||||
@property (nonatomic,strong)CABasicAnimation *animation;
|
||||
|
||||
@@ -100,7 +100,8 @@
|
||||
}
|
||||
break;
|
||||
case QXSendGiftViewTypeRoom:
|
||||
case QXSendGiftViewTypeAuction:{
|
||||
case QXSendGiftViewTypeAuction:
|
||||
case QXSendGiftViewTypeFriend:{
|
||||
if (_userListView) {
|
||||
[_userListView removeFromSuperview];
|
||||
_userListView = nil;
|
||||
@@ -295,28 +296,44 @@
|
||||
showToast(@"请选择送礼对象");
|
||||
return;
|
||||
}
|
||||
self.heartId = @"";
|
||||
self.auctionId = @"";
|
||||
/// 2为背包
|
||||
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
|
||||
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf hide];
|
||||
if (weakSelf.roomSendSuccessBlock) {
|
||||
weakSelf.roomSendSuccessBlock(NO,weakSelf.giftModel,userId,@"");
|
||||
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,@"");
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else if (self.type == QXSendGiftViewTypeAuction) {
|
||||
self.heartId = @"";
|
||||
/// 2为背包
|
||||
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
|
||||
[QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:[QXGlobal shareGlobal].loginModel.user_id gift_id:self.giftModel.gift_id num:self.giftCount type:type successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf hide];
|
||||
if (weakSelf.roomSendSuccessBlock) {
|
||||
weakSelf.roomSendSuccessBlock(YES,weakSelf.giftModel,[QXGlobal shareGlobal].loginModel.user_id,weakSelf.auctionId);
|
||||
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,[QXGlobal shareGlobal].loginModel.user_id,weakSelf.auctionId);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg);
|
||||
}];
|
||||
}else if (self.type == QXSendGiftViewTypeFriend) {
|
||||
self.auctionId = @"";
|
||||
/// 2为背包
|
||||
NSString *userId = [self.pitUserListView.selectedArray componentsJoinedByString:@","];
|
||||
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:self.giftCount to_uid:userId heart_id:self.heartId type:type pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
[weakSelf hide];
|
||||
if (weakSelf.roomSendSuccessBlock) {
|
||||
weakSelf.roomSendSuccessBlock(self.type,weakSelf.giftModel,userId,weakSelf.heartId);
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else{
|
||||
/// 2为背包
|
||||
NSString *type = self.categoryView.selectedIndex==0?@"2":@"1";
|
||||
@@ -996,20 +1013,31 @@
|
||||
_animation = nil;
|
||||
[self.circleLayer addAnimation:self.animation forKey:@"circleAnimation"];
|
||||
[[QXGlobal shareGlobal] vibrationFeedback];
|
||||
if (self.isAuction) {
|
||||
[QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:self.userId gift_id:self.giftModel.gift_id num:@"1" type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}else{
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:@"1" to_uid:self.userId type:@"1" pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
}
|
||||
|
||||
switch (self.sendType) {
|
||||
case QXSendGiftViewTypeRoom:
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:@"1" to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
break;
|
||||
case QXSendGiftViewTypeAuction:
|
||||
[QXMineNetwork roomAuctionJoinWithAuctionId:self.auctionId user_id:self.userId gift_id:self.giftModel.gift_id num:@"1" type:@"1" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
break;
|
||||
case QXSendGiftViewTypeFriend:
|
||||
[QXMineNetwork roomSendGiftWithRoomId:self.roomId gift_id:self.giftModel.gift_id gift_num:@"1" to_uid:self.userId heart_id:self.heartId type:@"1" pit_number:@"" successBlock:^(NSDictionary * _Nonnull dict) {
|
||||
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
showToast(msg)
|
||||
}];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
-(CABasicAnimation *)animation{
|
||||
if (!_animation) {
|
||||
|
||||
Reference in New Issue
Block a user