This commit is contained in:
liyuhua
2023-10-23 16:03:13 +08:00
parent 7d6fb8e2ce
commit 2632666cc3
6 changed files with 92 additions and 41 deletions

View File

@@ -76,7 +76,9 @@
//String@"害~你好[微笑]", @"害~你好😊"
- (NSMutableAttributedString *)attributedStringByText:(NSString *)text font:(UIFont *)font {
if(text.length == 0){
return [[NSMutableAttributedString alloc] initWithString:@""];;
}
NSArray<NSTextCheckingResult *> *emojis = [self.regularExpression matchesInString:text options:NSMatchingWithTransparentBounds range:NSMakeRange(0, [text length])];
NSMutableAttributedString *intactAttributeString = [[NSMutableAttributedString alloc] initWithString:text];
@@ -175,7 +177,8 @@
}
- (NSArray *)emojiHantList{
if(!_emojiHantList){
_emojiHantList = @[@"[可愛]",
_emojiHantList = @[
@"[可愛]",
@"[大笑]",
@"[色]",
@"[噓]",

View File

@@ -32,8 +32,8 @@
[_engine enableAudio];
[_engine disableVideo];
[_engine enableAudioVolumeIndication:900 smooth:3 reportVad:YES];
[_engine setAudioProfile:AgoraAudioProfileMusicStandard];
[_engine setAudioScenario:AgoraAudioScenarioGameStreaming];
#ifdef DEBUG
[_engine setLogFilter:AgoraLogFilterInfo];
#else

View File

@@ -204,9 +204,9 @@
if(roomInfo.hasRoomAlbum == YES){
[array insertObject:roomPhotoAlbum atIndex:1];
}
if ([ClientConfig shareConfig].configInfo.redEnvelopeConfig.open && roomInfo.redEnvelopeOpen) {
// if ([ClientConfig shareConfig].configInfo.redEnvelopeConfig.open && roomInfo.redEnvelopeOpen) {
[array insertObject:redPacket atIndex:1];
}
// }
[[self getView] getMoreMenuDataSuccess:array];
}];
}

View File

@@ -7,6 +7,7 @@
#import "PIRoomEnterRedPacketView.h"
#import "CountDownHelper.h"
@interface PIRoomEnterRedPacketView ()<CountDownHelperDelegate>
@property(nonatomic,strong) UIImageView *bgImageView;
@property(nonatomic,strong) UIButton *robBtn;

View File

@@ -11,6 +11,8 @@
#import <JXPagingView/JXPagerListRefreshView.h>
#import <JXCategoryView/JXCategoryView.h>
#import "PIRoomSendRedPacketItemVC.h"
#import "XPRoomRedPacketPresenter.h"
#import "WalletInfoModel.h"
@interface PIRoomSendRedPacketVC ()<JXPagerViewDelegate,JXPagerMainTableViewGestureDelegate,JXCategoryViewDelegate,JXPagerMainTableViewGestureDelegate>
///host
@property (nonatomic,weak) id<RoomHostDelegate>hostDelegate;
@@ -20,15 +22,28 @@
@property (nonatomic, strong) JXCategoryTitleView *titleView;
///lineView
@property (nonatomic, strong) JXPagerView *contentView;
///
@property(nonatomic,strong) UIButton *pi_backBtn;
///
@property(nonatomic,strong) UIView *bgView;
///
@property(nonatomic,strong) UIImageView *topImageView;
///
@property(nonatomic,strong) UIButton *tipsBtn;
///
@property(nonatomic,strong) UIImageView *diamondNumView;
///
@property(nonatomic,strong) UILabel *diamondNumTextView;
///icom
@property(nonatomic,strong) UIImageView *diamondIconView;
//
@property(nonatomic,strong) UIImageView *addIconView;
@end
@implementation PIRoomSendRedPacketVC
- (XPRoomRedPacketPresenter *)createPresenter {
return [[XPRoomRedPacketPresenter alloc] init];
}
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate {
if (self = [super init]) {
self.hostDelegate = delegate;
@@ -38,6 +53,10 @@
- (BOOL)isHiddenNavBar {
return YES;
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.presenter getUserWalletInfo];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor clearColor];
@@ -52,8 +71,9 @@
[self.view addSubview:self.topImageView];
[self.view addSubview:self.tipsBtn];
[self.view addSubview:self.diamondNumView];
[self.diamondNumView addSubview:self.diamondIconView];
[self.diamondNumView addSubview:self.diamondNumTextView];
[self.diamondNumView addSubview:self.addIconView];
[self.view addSubview:self.contentView];
}
-(void)installConstraints{
@@ -70,21 +90,32 @@
make.height.mas_equalTo(kGetScaleWidth(243));
}];
[self.diamondNumView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bgView.mas_top).mas_offset(kGetScaleWidth(13));
make.trailing.mas_equalTo(-kGetScaleWidth(0));
make.width.mas_equalTo(kGetScaleWidth(81));
make.height.mas_equalTo(kGetScaleWidth(30));
}];
[self.tipsBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(24));
make.trailing.mas_equalTo(-kGetScaleWidth(12));
make.top.equalTo(self.topImageView.mas_top).mas_offset(kGetScaleWidth(71));
}];
[self.diamondNumTextView mas_makeConstraints:^(MASConstraintMaker *make) {
[self.diamondNumView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.bgView.mas_top).mas_offset(kGetScaleWidth(13));
make.trailing.mas_equalTo(-kGetScaleWidth(0));
make.width.mas_greaterThanOrEqualTo(kGetScaleWidth(10));
make.height.mas_equalTo(kGetScaleWidth(30));
}];
[self.diamondIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(20));
make.centerY.equalTo(self.diamondNumView);
make.leading.mas_equalTo(kGetScaleWidth(6));
make.trailing.mas_equalTo(-kGetScaleWidth(5));
}];
[self.addIconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.diamondNumView);
make.width.height.mas_equalTo(kGetScaleWidth(16));
make.trailing.mas_equalTo(-kGetScaleWidth(6));
}];
[self.diamondNumTextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.equalTo(self.diamondNumView);
make.leading.mas_equalTo(kGetScaleWidth(25));
make.trailing.mas_equalTo(-kGetScaleWidth(23));
}];
[self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -92,7 +123,10 @@
make.left.right.bottom.mas_equalTo(self.view);
}];
}
///
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo {
self.diamondNumTextView.text = balanceInfo.diamonds;
}
#pragma mark - JXCategoryViewDelegate
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
@@ -145,6 +179,21 @@
-(void)hiddenViewAction{
[self dismissViewControllerAnimated:YES completion:nil];
}
-(NSTextAttachment *)getDiamondNumAtt:(NSString *)image{
NSTextAttachment * diamondAttachment = [[NSTextAttachment alloc] init];
UIImage *diamondIconImage = [UIImage imageNamed:image];;
diamondAttachment.bounds = CGRectMake(0, roundf(kFontMedium(13).capHeight - diamondIconImage.size.height)/2.f, diamondIconImage.size.width, diamondIconImage.size.height);
diamondAttachment.image = diamondIconImage;
return diamondAttachment;
}
- (UIImage*)resizableImage:(UIImage *)image {
//
CGFloat top = (image.size.height - 1) / 2;
CGFloat left = (image.size.width - 1) / 2;
CGFloat right = (image.size.width - 1) / 2;
CGFloat bottom = (image.size.height - 1) / 2;
return [image resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:UIImageResizingModeStretch];
}
#pragma mark -
- (UIView *)bgView{
if(!_bgView){
@@ -179,33 +228,31 @@
- (UIImageView *)diamondNumView{
if(!_diamondNumView){
_diamondNumView = [UIImageView new];
_diamondNumView.image = kImage(@"pi_red_packet_top_diamond_bg");
_diamondNumView.image = [self resizableImage:kImage(@"pi_red_packet_top_diamond_bg")];
}
return _diamondNumView;
}
- (UILabel *)diamondNumTextView{
if(!_diamondNumTextView){
_diamondNumTextView = [UILabel new];
NSMutableAttributedString *numAtt = [[NSMutableAttributedString alloc]initWithString:@"9999" attributes:@{NSFontAttributeName:kFontMedium(13),NSForegroundColorAttributeName:[UIColor whiteColor]}];
NSTextAttachment * diamondAttachment = [[NSTextAttachment alloc] init];
UIImage *diamondIconImage = [UIImage imageNamed:@"pi_red_packet_top_diamond_icon"];;
diamondAttachment.bounds = CGRectMake(0, roundf(kFontMedium(13).capHeight - diamondIconImage.size.height)/2.f, diamondIconImage.size.width, diamondIconImage.size.height);
diamondAttachment.image = diamondIconImage;
NSAttributedString * diamondAtt = [NSMutableAttributedString attributedStringWithAttachment:(NSTextAttachment *)diamondAttachment];
[numAtt insertAttributedString:diamondAtt atIndex:0];
NSTextAttachment * addAttachment = [[NSTextAttachment alloc] init];
UIImage *addIconImage = [UIImage imageNamed:@"pi_red_packet_top_diamond_add"];;
addAttachment.bounds = CGRectMake(0, roundf(kFontMedium(13).capHeight - addIconImage.size.height)/2.f, addIconImage.size.width, addIconImage.size.height);
addAttachment.image = addIconImage;
NSAttributedString * addAtt = [NSMutableAttributedString attributedStringWithAttachment:(NSTextAttachment *)addAttachment];
[numAtt insertAttributedString:addAtt atIndex:numAtt.length];
_diamondNumTextView.attributedText = numAtt;
_diamondNumTextView = [UILabel labelInitWithText:@"0" font:kFontMedium(13) textColor:[UIColor whiteColor]];
_diamondNumTextView.textAlignment = NSTextAlignmentCenter;
}
return _diamondNumTextView;
}
- (UIImageView *)diamondIconView{
if(!_diamondIconView){
_diamondIconView = [UIImageView new];
_diamondIconView.image = kImage(@"pi_red_packet_top_diamond_icon");
}
return _diamondIconView;
}
-(UIImageView *)addIconView{
if(!_addIconView){
_addIconView = [UIImageView new];
_addIconView.image = kImage(@"pi_red_packet_top_diamond_add");
}
return _addIconView;
}
- (JXCategoryTitleView *)titleView {
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];

View File

@@ -172,12 +172,12 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
PIReceiveRedPacketSuccessView *view = [[PIReceiveRedPacketSuccessView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
[kWindow addSubview:view];
});
// dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
// PIReceiveRedPacketSuccessView *view = [[PIReceiveRedPacketSuccessView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
//
//
// [kWindow addSubview:view];
// });
}