92 lines
3.7 KiB
Objective-C
92 lines
3.7 KiB
Objective-C
//
|
|
// QXRoomViewController+Bar.m
|
|
// QXLive
|
|
//
|
|
// Created by 启星 on 2026/1/7.
|
|
//
|
|
|
|
#import "QXRoomViewController+Bar.h"
|
|
#import "QXRechargeViewcController.h"
|
|
#import "QXMineNetwork.h"
|
|
@implementation QXRoomViewController (Bar)
|
|
|
|
-(void)createCoinView{
|
|
self.coinView = [[UIView alloc] init];
|
|
self.coinView.backgroundColor = RGB16A(0x000000, 0.4);
|
|
[self.view addSubview:self.coinView];
|
|
[self.coinView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.bottom.equalTo(self.bottomView.mas_top).offset(-20);
|
|
make.right.mas_equalTo(-5);
|
|
make.width.mas_equalTo(100);
|
|
make.height.mas_equalTo(50);
|
|
}];
|
|
[self.coinView addRoundedCornersWithRadius:5];
|
|
|
|
self.coinImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"wallet_corn"]];
|
|
[self.coinView addSubview:self.coinImageView];
|
|
[self.coinImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.mas_equalTo(5);
|
|
make.height.width.mas_equalTo(25);
|
|
make.centerY.equalTo(self.coinView);
|
|
}];
|
|
|
|
|
|
self.coinLabel = [[UILabel alloc] init];
|
|
self.coinLabel.textColor = RGB16(0xffffff);
|
|
self.coinLabel.text = @"0";
|
|
self.coinLabel.textAlignment = NSTextAlignmentCenter;
|
|
self.coinLabel.font = [UIFont systemFontOfSize:10];
|
|
[self.coinView addSubview:self.coinLabel];
|
|
[self.coinLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.equalTo(self.coinImageView.mas_right).offset(2);
|
|
make.right.equalTo(self.coinView.mas_right).offset(-5);
|
|
make.top.equalTo(self.coinView).offset(10);
|
|
}];
|
|
|
|
self.rechargeBtn = [[UIButton alloc] init];
|
|
[self.rechargeBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
|
|
[self.rechargeBtn setTitle:@"充值" forState:(UIControlStateNormal)];
|
|
self.rechargeBtn.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
[self.coinView addSubview:self.rechargeBtn];
|
|
[self.rechargeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.left.equalTo(self.coinLabel);
|
|
make.right.equalTo(self.coinView).offset(-5);
|
|
make.bottom.equalTo(self.coinView).offset(-5);
|
|
make.height.mas_equalTo(20);
|
|
}];
|
|
|
|
UIButton *button = [[UIButton alloc] init];
|
|
[button addTarget:self action:@selector(rechargeAction) forControlEvents:(UIControlEventTouchUpInside)];;
|
|
[self.coinView addSubview:button];
|
|
[button mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
make.edges.equalTo(self.coinView);
|
|
}];
|
|
MJWeakSelf
|
|
[QXMineNetwork getWalletInfoSuccessBlock:^(NSString * _Nonnull coin, NSString * _Nonnull earnings, NSString * _Nonnull title, NSString * _Nonnull url) {
|
|
weakSelf.coinLabel.text = coin;
|
|
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
|
|
|
}];
|
|
}
|
|
|
|
-(void)rechargeAction{
|
|
QXRechargeViewcController *vc = [[QXRechargeViewcController alloc] init];
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
}
|
|
|
|
-(void)barRoomSeductionEffectWithModel:(QXRoomChatListModel*)model{
|
|
[self.seatContentView barRoomSeductionEffectWithModel:model];
|
|
}
|
|
-(void)barRoomJoinCabinRoomWithRoomId:(NSString *)room_id user_id:(NSString *)user_id meet_user_id:(NSString *)meet_user_id{
|
|
[self.seatContentView barRoomJoinCabinRoomWithRoomId:room_id user_id:user_id meet_user_id:meet_user_id];
|
|
}
|
|
-(void)barRoomHugPitWithUserId:(NSString *)userId pit_number:(nonnull NSString *)pit_number{
|
|
if ([userId isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
|
|
[self.seatContentView barRoomUpseatActionWithPitNumber:pit_number];
|
|
}
|
|
}
|
|
-(void)barRoomSetCustomGiftWithUserId:(NSString *)userId had_custom_gift:(BOOL)had_custom_gift{
|
|
[self.seatContentView barRoomSetCustomGiftWithUserId:userId had_custom_gift:had_custom_gift];
|
|
}
|
|
@end
|