Compare commits

...

4 Commits

Author SHA1 Message Date
启星
3ba569dfa3 提交 2025-10-13 15:06:59 +08:00
启星
d1be1ab3a7 Merge branch 'master' into dev 2025-10-13 14:32:43 +08:00
启星
de1d090b93 暂时提交 2025-10-13 14:16:49 +08:00
启星
0879779fb3 提交 2025-10-12 16:20:30 +08:00
39 changed files with 349 additions and 65 deletions

View File

@@ -787,7 +787,7 @@
"$(inherited)",
"$(SDKROOT)/usr/lib/swift",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -853,7 +853,7 @@
"$(inherited)",
"$(SDKROOT)/usr/lib/swift",
);
MARKETING_VERSION = 1.0.8;
MARKETING_VERSION = 1.0.7;
PRODUCT_BUNDLE_IDENTIFIER = com.xscm.midi;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";

View File

@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)didClickSendWithText:(NSString*)text model:(QXDynamicCommentListModel*)model;
-(void)didResignFirstResponder;
@end
@interface QXDynamicCommentInputView : UIView

View File

@@ -98,6 +98,11 @@
[textField resignFirstResponder];
return YES;
}
-(void)textFieldDidEndEditing:(UITextField *)textField{
if (self.delegate && [self.delegate respondsToSelector:@selector(didResignFirstResponder)]) {
[self.delegate didResignFirstResponder];
}
}
-(void)setModel:(QXDynamicCommentListModel *)model{
_model = model;
}

View File

@@ -133,7 +133,7 @@
// make.width.height.mas_equalTo(ScaleWidth(57));
// }];
[self getBanner];
// [self getRechargePermission];
[self getRechargePermission];
self.appStoreView.hidden = YES;
[self.view addSubview:self.appStoreView];
@@ -233,7 +233,7 @@
}];
};
self.nPeopleRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money) {
self.nPeopleRechargeView.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
@@ -241,6 +241,7 @@
model.money = money;
recharge.selectedModel = model;
recharge.isPop = YES;
recharge.gift_bag_id = gift_bag_id;
recharge.isOnlyDisplayPayType = YES;
[recharge showInView:KEYWINDOW];
}];
@@ -260,9 +261,17 @@
}];
};
view.getActionBlock = ^{
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = money;
recharge.selectedModel = model;
recharge.isPop = YES;
recharge.gift_bag_id = gift_bag_id;
recharge.isOnlyDisplayPayType = YES;
[recharge showInView:KEYWINDOW];
}];
};
@@ -285,9 +294,17 @@
}];
};
view.getActionBlock = ^{
view.rechargeActionBlock = ^(NSString * _Nonnull money, NSString * _Nonnull gift_bag_id) {
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
QXLOG(@"页面关闭");
QXRechargeView *recharge = [[QXRechargeView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
QXRechargeListModel *model = [[QXRechargeListModel alloc] init];
model.money = money;
recharge.selectedModel = model;
recharge.isPop = YES;
recharge.gift_bag_id = gift_bag_id;
recharge.isOnlyDisplayPayType = YES;
[recharge showInView:KEYWINDOW];
}];
};

View File

@@ -0,0 +1,16 @@
//
// QXRoomViewController+RedPacket.h
// QXLive
//
// Created by 启星 on 2025/10/13.
//
#import "QXRoomViewController.h"
#import "QXRedPacketManager.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomViewController (RedPacket)<QXRedPacketManagerDelegate>
-(void)initRedpacketManager;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,35 @@
//
// QXRoomViewController+RedPacket.m
// QXLive
//
// Created by on 2025/10/13.
//
#import "QXRoomViewController+RedPacket.h"
#import "QXMineNetwork.h"
@implementation QXRoomViewController (RedPacket)
-(void)recievedRedPacket:(QXRedPacketModel *)model{
[[QXRedPacketManager sharedManager] addRedPacket:model];
}
-(void)initRedpacketManager{
[QXRedPacketManager sharedManager].delegate = self;
}
-(void)getRedBagList{
// [QXMineNetwork ];
}
#pragma mark - QXRedPacketManagerDelegate
///
-(void)QXRedPacketManager:(QXRedPacketManager *)manager didAddRedPacket:(QXRedPacketModel *)redPacket{
}
///
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didRemoveRedPacket:(NSString *)packetId {
}
///
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didUpdateRedPacket:(QXRedPacketModel *)redPacket {
}
@end

View File

@@ -34,6 +34,7 @@
#import "QXRedBagTagView.h"
#import "QXRedBagDrawView.h"
#import "QXRedBagListView.h"
#import "QXRoomViewController+RedPacket.h"
@interface QXRoomViewController ()<
QXRoomBottomViewDelegate,
@@ -92,7 +93,7 @@ QXRoomUserInfoViewDelegate
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initRedpacketManager];
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
@@ -211,7 +212,7 @@ QXRoomUserInfoViewDelegate
}
[self.view addSubview:self.hourRankIconView];
// [self.view addSubview:self.redBagTagView];
[self.view addSubview:self.redBagTagView];
[self setupEffectView];
// [self.view addSubview:self.headlineView];

View File

@@ -15,6 +15,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *name;
/// 礼包名称
@property (nonatomic,strong)NSString *bag_name;
/// 礼包名称
@property (nonatomic,strong)NSString *gift_bag_id;
/// 1 可以充值 0 不可充值
@property (nonatomic,strong)NSString *status;
@property (nonatomic,strong)NSString *title1;
@@ -47,5 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *time;
/// 礼物列表
@property (nonatomic,strong)NSArray <QXGiftModel*>*gift_list;
/// 礼包id
@property (nonatomic,strong)NSString *gift_bag_id;
@end
NS_ASSUME_NONNULL_END

View File

@@ -10,7 +10,8 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXRedPacketModel : NSObject
@property (nonatomic, copy) NSString *packetId; // 红包唯一ID
@property (nonatomic, strong) NSString *redpacket_id; // 红包唯一ID
@property (nonatomic, strong) NSString* total_amount;
@property (nonatomic, assign) NSInteger type; // 红包类型
@property (nonatomic, assign) long long end_time; // 倒计时时间(秒)
@property (nonatomic, assign) CGFloat amount; // 红包金额
@@ -24,4 +25,5 @@ NS_ASSUME_NONNULL_BEGIN
- (BOOL)canOpenNow;
@end
NS_ASSUME_NONNULL_END

View File

@@ -364,14 +364,15 @@
[[QXGlobal shareGlobal] finishTask];
[[QXRoomMessageManager shared] sendChatMessage:text messageType:(QXRoomMessageTypeText) needInsertMessage:YES];
self.commentView.textField.text = @"";
[self.vc.view endEditing:YES];
if (self.redpacketModel == nil) {
[self.vc.view endEditing:YES];
return;
}
if (self.delegate && [self.delegate respondsToSelector:@selector(didSendMessage:redpacketModel:)]) {
[self.delegate didSendMessage:text redpacketModel:self.redpacketModel];
}
self.redpacketModel = nil;
[self.vc.view endEditing:YES];
}
- (void)keyboardWillHide:(NSNotification *)notification {
@@ -395,7 +396,9 @@
self.commentView.y = keyboardFrame.origin.y-TabbarContentHeight;
}];
}
-(void)didResignFirstResponder{
self.redpacketModel = nil;
}
-(QXDynamicCommentInputView *)commentView{
if (!_commentView) {
_commentView = [[QXDynamicCommentInputView alloc] initWithFrame:CGRectMake(0, SCREEN_HEIGHT, SCREEN_WIDTH, TabbarContentHeight)];

View File

@@ -10,6 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXRedBagSendView : UIView
@property (nonatomic,strong)NSString *room_id;
-(void)showInView:(UIView*)view;
-(void)hide;
@end

View File

@@ -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";
}
}
}

View File

@@ -178,19 +178,13 @@
///
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
}else{
// toolsArr = @[self.roomSubsidy,self.roomMessage,self.roomOrderMic,self.roomBgMusic,self.roomBgImage];
///
toolsArr = @[self.roomMessage,self.roomOrderMic,self.roomBgImage];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
}
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
@@ -200,8 +194,7 @@
//
roomTypeArr = @[];
toolsArr = @[];
// moreArr = @[self.redBag,self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.redBag,self.roomVoiceSet,self.roomEffects,self.drifPop,self.roomReport];
self.titles = @[QXText(@"更多操作")];
}
break;
@@ -223,9 +216,7 @@
toolsArr = @[self.roomCompere,self.roomMessage,self.roomOrderMic,self.roomBgImage];
}
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
}
@@ -249,9 +240,7 @@
}
// roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeBoy,self.roomTypeGirl,self.roomTypeFriend];
roomTypeArr = @[self.roomTypeSing,self.roomTypeAuction,self.roomTypeFunny,self.roomTypeFriend];
// moreArr = @[self.roomLeave,self.roomShare,self.roomVoiceSet,self.roomSetting,self.roomWelcome,self.roomEffects,self.roomReport];
// moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
moreArr = @[self.redBag,self.roomVoiceSet,self.roomSetting,self.roomEffects,self.drifPop,self.roomReport];
self.titles = @[QXText(@"房间类型"),QXText(@"常用工具"),QXText(@"更多操作")];
}
break;

View File

@@ -56,7 +56,6 @@
[self.agoraKit getCurrentMonotonicTimeInMs];
[self.agoraKit setAudioProfile:AgoraAudioProfileMusicHighQualityStereo];
[self.agoraKit setAudioScenario:AgoraAudioScenarioChorus];
[self setChannelProfile];
self.agoraKit.delegate = self;
[self.agoraKit setParameters:@"{\"che.audio.custom_payload_type\":73}"];
@@ -368,6 +367,9 @@
if (self.delegate && [self.delegate respondsToSelector:@selector(rtcEngineVideoFirstLoadWithUid:size:)]) {
[self.delegate rtcEngineVideoFirstLoadWithUid:uid size:size];
}
}
-(void)rtcEngine:(AgoraRtcEngineKit *)engine videoSizeChangedOfSourceType:(AgoraVideoSourceType)sourceType uid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation{
}
-(void)rtcEngine:(AgoraRtcEngineKit *)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state reason:(AgoraVideoRemoteReason)reason elapsed:(NSInteger)elapsed{
NSLog(@"uid=%ld---直播远端视频状态发生变化status=%ld",uid,state);
@@ -742,6 +744,7 @@
videoParams.dimensions = [self screenShareVideoDimension];
videoParams.frameRate = AgoraVideoFrameRateFps15;
videoParams.bitrate = AgoraVideoBitrateStandard;
// _screenParams.videoParams = videoParams;
}
return _screenParams;
}

View File

@@ -16,20 +16,20 @@
@end
@interface QXRedPacketManager : NSObject
@property (nonatomic, strong, readonly) NSMutableDictionary<NSString *, QXRedPacketModel *> *redPackets;
@property (nonatomic, weak) id<QXRedPacketManagerDelegate> delegate;
+ (instancetype)sharedManager;
// 添加红包
/// 添加红包
- (void)addRedPacket:(QXRedPacketModel *)redPacket;
// 移除红包
/// 移除红包
- (void)removeRedPacket:(NSString *)packetId;
// 获取所有红包
/// 获取所有红包
- (NSArray<QXRedPacketModel *> *)allRedPackets;
// 根据位置获取红包
/// 根据位置获取红包
- (QXRedPacketModel *)redPacketAtPosition:(NSInteger)position;
// 检查并更新红包状态
/// 检查并更新红包状态
- (void)checkAndUpdateRedPackets;
@end

View File

@@ -33,9 +33,9 @@
}
- (void)addRedPacket:(QXRedPacketModel *)redPacket {
if (!redPacket.packetId) return;
if (!redPacket.redpacket_id) return;
self.redPackets[redPacket.packetId] = redPacket;
self.redPackets[redPacket.redpacket_id] = redPacket;
if ([self.delegate respondsToSelector:@selector(QXRedPacketManager:didAddRedPacket:)]) {
[self.delegate respondsToSelector:@selector(QXRedPacketManager:didAddRedPacket:)];

View File

@@ -9,6 +9,7 @@
#import "QXRoomChatListView.h"
#import "QXRoomModel.h"
#import "QXRoomFriendRelationModel.h"
#import "QXRedPacketModel.h"
typedef NS_ENUM(NSInteger) {
/// 清空消息
@@ -124,6 +125,9 @@ typedef NS_ENUM(NSInteger) {
QXRoomMessageTypeRoomUserOnlineStatus = 1058,
/// 清除个人魅力
QXRoomMessageTypeRoomClearUserCharm = 1059,
/// 发红包
QXRoomMessageTypeSendRedpacket = 1060,
}QXRoomMessageType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXRoomMessageManagerDelegate <NSObject>
@@ -253,6 +257,9 @@ NS_ASSUME_NONNULL_BEGIN
-(void)meetActivityGiftInfoIsUpdate:(QXRoomChatListModel*)giftInfo;
/// 清除个人魅力
-(void)roomClearUserCharmWithUserId:(NSString*)userId;
/// 发红包
-(void)recievedRedPacket:(QXRedPacketModel*)model;
/// 房间用户在线状态发生变化
//-(void)roomUserOnlineStatusDidChanged:(BOOL)isOnline userId:(NSString*)userId;
@end

View File

@@ -616,6 +616,13 @@
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:parm];
}
break;
case QXRoomMessageTypeSendRedpacket:{
QXRedPacketModel *model = [QXRedPacketModel yy_modelWithJSON:msg.Text];
if (self.delegate && [self.delegate respondsToSelector:@selector(recievedRedPacket:)]) {
[self.delegate recievedRedPacket:model];
}
}
break;
default:
break;
}

View File

@@ -843,6 +843,7 @@ NS_ASSUME_NONNULL_BEGIN
coin:(NSString*)coin
type:(NSString*)type
userId:(NSString*)userId
typeId:(NSString*)typeId
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@@ -1075,6 +1076,33 @@ NS_ASSUME_NONNULL_BEGIN
+(void)roomHourRankWithPage:(NSInteger)page
successBlock:(void (^)(QXRoomHourRankModel* model))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
发红包
type 红包类型1-普通红包2-口令红包
password 口令
coin_type 币种1- 金币2- 钻石
total_amount 总金额
total_count 红包个数
conditions 条件值(逗号分隔)
countdown 倒计时单位S)
room_id 房间ID
*/
+(void)createRedpacketWithType:(NSString*)type
password:(NSString*)password
coin_type:(NSString*)coin_type
total_amount:(NSString*)total_amount
total_count:(NSString*)total_count
conditions:(NSString*)conditions
countdown:(NSString*)countdown
room_id:(NSString*)room_id
successBlock:(void (^)(NSDictionary* dict))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
+(void)drawRedpacketWithRedpacketId:(NSString*)redpacketId;
@end

View File

@@ -1627,12 +1627,13 @@
}];
}
+(void)rechargePayWithMoney:(NSString *)money coin:(NSString *)coin type:(NSString *)type userId:(NSString*)userId successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
+(void)rechargePayWithMoney:(NSString *)money coin:(NSString *)coin type:(NSString *)type userId:(NSString*)userId typeId:(NSString*)typeId successBlock:(void (^)(NSDictionary * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"coin":coin?coin:@"",
@"money":money?money:@"",
@"type":type?type:@"",
@"user_id":userId?userId:@""
@"user_id":userId?userId:@"",
@"type_id":typeId?typeId:@""
};
[[QXRequset shareInstance] postWithUrl:QXRechargePay parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
@@ -2108,5 +2109,32 @@
}];
}
+(void)createRedpacketWithType:(NSString *)type
password:(NSString *)password
coin_type:(NSString *)coin_type
total_amount:(NSString *)total_amount
total_count:(NSString *)total_count
conditions:(NSString *)conditions
countdown:(NSString *)countdown
room_id:(NSString *)room_id
successBlock:(void (^)(NSDictionary * _Nonnull))successBlock
failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@"type":type?type:@"",
@"password":password?password:@"",
@"coin_type":coin_type?coin_type:@"",
@"total_amount":total_amount?total_amount:@"",
@"total_count":total_count?total_count:@"",
@"conditions":conditions?conditions:@"",
@"countdown":countdown?countdown:@"",
@"room_id":room_id?room_id:@"",
};
[[QXRequset shareInstance] postWithUrl:QXRoomCreateRedpacket parameters:parameters needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject[@"data"]);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -13,6 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)BOOL isPop;
@property (nonatomic,assign)BOOL isOnlyDisplayPayType;
@property (nonatomic,strong)QXRechargeListModel *selectedModel;
@property (nonatomic,strong)NSString *gift_bag_id;
-(void)showInView:(UIView *)view;
@end

View File

@@ -266,7 +266,7 @@
}
@weakify(self)
[QXMineNetwork rechargePayWithMoney:self.selectedModel.money coin:self.selectedModel.coins type:self.selectedPayTypeModel.type userId:QXGlobal.shareGlobal.loginModel.user_id successBlock:^(NSDictionary * _Nonnull dict) {
[QXMineNetwork rechargePayWithMoney:self.selectedModel.money coin:self.selectedModel.coins type:self.selectedPayTypeModel.type userId:QXGlobal.shareGlobal.loginModel.user_id typeId:self.gift_bag_id successBlock:^(NSDictionary * _Nonnull dict) {
@strongify(self)
if (self.selectedPayTypeModel.type.intValue == 2) {
NSDictionary *resultDict = dict[@"data"];

View File

@@ -5,7 +5,7 @@
"scale" : "1x"
},
{
"filename" : "天降好礼@2x.png",
"filename" : "首充礼包@2x.png",
"idiom" : "universal",
"scale" : "2x"
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "one_mouth_money@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "one_mouth_money@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

@@ -454,4 +454,12 @@ static NSString * QXWalletBindDetail = @"api/Bind/bind_detail";
/// 小时榜
static NSString * QXRoomHourRank = @"api/RoomHourRanking/room_hour_ranking";
/// 创建红包
static NSString * QXRoomCreateRedpacket = @"api/Redpacket/create";
/// 抢红包
static NSString * QXRoomDrawRedpacket = @"api/Redpacket/grab";
/// 房间内红包列表
static NSString * QXRoomRedpacketList = @"api/Redpacket/roomRedPackets";
/// 红包详情
static NSString * QXRoomRedpacketDetail = @"api/Redpacket/detail";
#endif /* Api_h */

View File

@@ -23,7 +23,7 @@
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>wxfc7bf7ca8c71840d</string>
<string>wxef1289d8a89b41d4</string>
</array>
</dict>
</array>

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXFirstRechargeView : UIView
@property (nonatomic,copy)void(^closeActionBlock)(void);
@property (nonatomic,copy)void(^getActionBlock)(void);
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
@property (nonatomic,copy)void(^refreshBlcock)(void);
@end

View File

@@ -149,8 +149,8 @@
//
-(void)getAction{
if (self.getActionBlock) {
self.getActionBlock();
if (self.rechargeActionBlock) {
self.rechargeActionBlock(self.model.money,self.model.gift_bag_id);
}
}
-(void)closeAction{

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXNewPeoplePopView : UIView
@property (nonatomic,copy)void(^closeActionBlock)(void);
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money);
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
@property (nonatomic,copy)void(^refreshBlcock)(void);
@property (nonatomic,strong)NSArray *giftArray;
-(void)reloadData;

View File

@@ -19,6 +19,7 @@
@property (nonatomic,strong)UIButton *firstBtn;
@property (nonatomic,strong)UIButton *secondBtn;
@property (nonatomic,strong)UIButton *thirdBtn;
@property (nonatomic,strong)UIButton *oneMouthBtn;
@property (nonatomic,strong)UIButton *selectedBtn;
@property (nonatomic,strong)UIView *giftBgView;
@@ -29,7 +30,9 @@
@property (nonatomic,strong)QXNiceGiftRechargeModel *md1;
@property (nonatomic,strong)QXNiceGiftRechargeModel *md2;
@property (nonatomic,strong)QXNiceGiftRechargeModel *md3;
@property (nonatomic,strong)QXNiceGiftRechargeModel *md4;
@property (nonatomic,strong)QXNiceGiftRechargeModel *smd;
@end
@implementation QXNewPeoplePopView
@@ -71,9 +74,11 @@
self.firstBtn.hidden = YES;
UIImage *firstNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
UIImage *firstSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
UIImage *firstDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
[self.firstBtn setBackgroundImage:firstNorImage forState:(UIControlStateNormal)];
[self.firstBtn setBackgroundImage:firstSelImage forState:(UIControlStateSelected)];
self.firstBtn.selected = YES;
[self.firstBtn setBackgroundImage:firstDisImage forState:(UIControlStateDisabled)];
// self.firstBtn.selected = YES;
// [self.firstBtn setTitle:@"9元" forState:(UIControlStateNormal)];
[self.firstBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.firstBtn addRoundedCornersWithRadius:ScaleWidth(13)];
@@ -92,8 +97,10 @@
self.secondBtn.hidden = YES;
UIImage *secondNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
UIImage *secondSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
UIImage *secondDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
[self.secondBtn setBackgroundImage:secondNorImage forState:(UIControlStateNormal)];
[self.secondBtn setBackgroundImage:secondSelImage forState:(UIControlStateSelected)];
[self.secondBtn setBackgroundImage:secondDisImage forState:(UIControlStateDisabled)];
// [self.secondBtn setTitle:@"30元" forState:(UIControlStateNormal)];
[self.secondBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.secondBtn addRoundedCornersWithRadius:ScaleWidth(13)];
@@ -104,7 +111,7 @@
make.left.equalTo(self.firstBtn.mas_right).offset(12);
make.top.equalTo(self.firstBtn);
make.height.mas_equalTo(ScaleWidth(26));
make.width.mas_equalTo(ScaleWidth(42));
make.width.mas_equalTo(ScaleWidth(50));
}];
@@ -112,8 +119,10 @@
self.thirdBtn.hidden = YES;
UIImage *thirdNorImage = [UIImage imageWithColor:RGB16(0xFFFFFF)];
UIImage *thirdSelImage = [UIImage imageWithColor:RGB16(0xF4DF39)];
UIImage *thirdDisImage = [UIImage imageWithColor:RGB16(0xE9E9E9)];
[self.thirdBtn setBackgroundImage:thirdNorImage forState:(UIControlStateNormal)];
[self.thirdBtn setBackgroundImage:thirdSelImage forState:(UIControlStateSelected)];
[self.thirdBtn setBackgroundImage:thirdDisImage forState:(UIControlStateSelected)];
// [self.thirdBtn setTitle:@"60元" forState:(UIControlStateNormal)];
[self.thirdBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateNormal)];
[self.thirdBtn addRoundedCornersWithRadius:ScaleWidth(13)];
@@ -124,9 +133,28 @@
make.left.equalTo(self.secondBtn.mas_right).offset(12);
make.top.equalTo(self.firstBtn);
make.height.mas_equalTo(ScaleWidth(26));
make.width.mas_equalTo(ScaleWidth(42));
make.width.mas_equalTo(ScaleWidth(50));
}];
self.oneMouthBtn = [[UIButton alloc] init];
self.oneMouthBtn.hidden = YES;
UIImage *one_mouth_norImage = [UIImage imageNamed:@"one_mouth_money"];
UIImage *one_mouth_selImage = [UIImage imageNamed:@"one_mouth_money"];
[self.oneMouthBtn setBackgroundImage:one_mouth_norImage forState:(UIControlStateNormal)];
[self.oneMouthBtn setBackgroundImage:one_mouth_selImage forState:(UIControlStateSelected)];
[self.oneMouthBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateNormal)];
[self.oneMouthBtn addRoundedCornersWithRadius:ScaleWidth(13)];
self.oneMouthBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.oneMouthBtn addTarget:self action:@selector(rechargeSelectedAction:) forControlEvents:(UIControlEventTouchUpInside)];
[self addSubview:self.oneMouthBtn];
[self.oneMouthBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.bgImageView.mas_right).offset(-27);
make.centerY.equalTo(self.firstBtn);
make.height.mas_equalTo(ScaleWidth(24));
make.width.mas_equalTo(ScaleWidth(66));
}];
self.giftBgView = [[UIView alloc] init];
self.giftBgView.backgroundColor = [UIColor whiteColor];
[self.giftBgView addRoundedCornersWithRadius:13];
@@ -204,30 +232,55 @@
}
-(void)getFirstRechargeGiftList{
MJWeakSelf
[QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray<QXFirstRechargeModel *> * _Nonnull list) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
[QXHomePageNetwork getNewUserGiftListSuccessBlock:^(NSArray<QXNiceGiftRechargeModel *> * _Nonnull list) {
for (int i = 0; i<list.count; i++) {
if (i == 0) {
weakSelf.md1 = list[i];
weakSelf.firstBtn.hidden = NO;
[weakSelf.firstBtn setTitle:weakSelf.md1.name forState:(UIControlStateNormal)];
if (weakSelf.md1.status.intValue == 1) {
weakSelf.firstBtn.enabled = YES;
weakSelf.firstBtn.selected = YES;
weakSelf.selectedBtn = weakSelf.firstBtn;
}else{
weakSelf.firstBtn.enabled = NO;
}
continue;
}
if (i == 1) {
weakSelf.md2 = list[i];
weakSelf.secondBtn.hidden = NO;
[weakSelf.secondBtn setTitle:weakSelf.md2.name forState:(UIControlStateNormal)];
if (weakSelf.md2.status.intValue == 1) {
weakSelf.secondBtn.enabled = YES;
if (!weakSelf.selectedBtn.selected) {
weakSelf.secondBtn.selected = YES;
weakSelf.selectedBtn = weakSelf.secondBtn;
}
}else{
weakSelf.secondBtn.enabled = NO;
}
continue;
}
if (i == 2) {
weakSelf.md3 = list[i];
weakSelf.thirdBtn.hidden = NO;
[weakSelf.thirdBtn setTitle:weakSelf.md3.name forState:(UIControlStateNormal)];
if (weakSelf.md3.status.intValue == 1) {
weakSelf.thirdBtn.enabled = YES;
if (!weakSelf.selectedBtn.selected) {
weakSelf.thirdBtn.selected = YES;
weakSelf.selectedBtn = weakSelf.thirdBtn;
}
}else{
weakSelf.thirdBtn.enabled = NO;
}
continue;
}
if (i == 3) {
weakSelf.md4 = list[i];
[weakSelf.oneMouthBtn setTitle:weakSelf.md4.name forState:(UIControlStateNormal)];
weakSelf.oneMouthBtn.hidden = NO;
continue;
}
}
@@ -285,6 +338,9 @@
}else if (sender == self.thirdBtn){
self.giftArray = self.md3.gift_list;
md = self.md3;
}else if (sender == self.oneMouthBtn){
self.giftArray = self.md4.gift_list;
md = self.md4;
}
self.smd = md;
if (md == nil) {
@@ -308,7 +364,7 @@
}
-(void)rechargeAction{
if (self.rechargeActionBlock) {
self.rechargeActionBlock(self.smd.money);
self.rechargeActionBlock(self.smd.money,self.smd.gift_bag_id);
}
}
-(void)closeAction{

View File

@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXNiceGiftPopView : UIView
@property (nonatomic,copy)void(^closeActionBlock)(void);
@property (nonatomic,copy)void(^getActionBlock)(void);
@property (nonatomic,copy)void(^rechargeActionBlock)(NSString*money,NSString*gift_bag_id);
@property (nonatomic,copy)void(^refreshBlcock)(void);
@end

View File

@@ -54,7 +54,9 @@
[self.timeDownbgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bgImageView).offset(ScaleWidth(117));
make.left.equalTo(self.bgImageView).offset(9);
make.size.mas_equalTo(CGSizeMake(ScaleWidth(179), ScaleWidth(20)));
make.right.equalTo(self.bgImageView).offset(-9);
make.width.mas_equalTo(ScaleWidth(20));
}];
self.timeDownLabel = [[UILabel alloc] init];
@@ -172,7 +174,7 @@
MJWeakSelf
[QXHomePageNetwork getSkyDropGiftListSuccessBlock:^(QXNiceGiftRechargeModel * _Nonnull model) {
weakSelf.model = model;
weakSelf.timeDownLabel.text = model.effective_time;
weakSelf.timeDownLabel.text = [NSString stringWithFormat:@"结束时间:%@",model.effective_time];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:model.counter];
[attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.money]];
[attr yy_setColor:QXConfig.themeColor range:[model.counter rangeOfString:model.diamond]];
@@ -191,15 +193,15 @@
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
QXGiftCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"QXGiftCell" forIndexPath:indexPath];
cell.cellType = QXGiftCellTypeNiceGift;
cell.roomGiftModel = self.model.gift_list[indexPath.row];
cell.niceGiftModel = self.model.gift_list[indexPath.row];
return cell;
}
//
-(void)getAction{
if (self.getActionBlock) {
self.getActionBlock();
if (self.rechargeActionBlock) {
self.rechargeActionBlock(self.model.money,self.model.gift_bag_id);
}
}
-(void)closeAction{

View File

@@ -368,6 +368,7 @@
hud.bezelView.color = [UIColor blackColor];
hud.label.textColor = [UIColor whiteColor];
hud.label.text = text;
hud.label.numberOfLines = 0;
[hud hideAnimated:YES afterDelay:1];
}
+(void)showMessage:(NSString *)text view:(UIView *)view{
@@ -378,6 +379,7 @@
hud.bezelView.color = [UIColor blackColor];
hud.label.textColor = [UIColor whiteColor];
hud.label.text = text;
hud.label.numberOfLines = 0;
[hud hideAnimated:YES afterDelay:1];
}
+(void)showLoadingInView:(UIView*)view{