feat: 完成礼物连击功能
@@ -5,11 +5,11 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "luck_gift_flag@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "椭圆 5@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 32 KiB |
BIN
YuMi/Assets.xcassets/1.0.15/luck_gift_flag.imageset/椭圆 5@3x.png
vendored
Normal file
After Width: | Height: | Size: 28 KiB |
21
YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "容器 8156@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/1.0.15/luck_gift_flag_ball.imageset/容器 8156@3x.png
vendored
Normal file
After Width: | Height: | Size: 14 KiB |
@@ -9,7 +9,7 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "luck_gift_gold@3x.png",
|
||||
"filename" : "组 4.jpg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 48 KiB |
BIN
YuMi/Assets.xcassets/1.0.15/luck_gift_gold.imageset/组 4.jpg@3x.png
vendored
Normal file
After Width: | Height: | Size: 242 KiB |
@@ -9,7 +9,7 @@
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "luck_gift_pruple@3x.png",
|
||||
"filename" : "组 4.jpg@3x-2.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 49 KiB |
BIN
YuMi/Assets.xcassets/1.0.15/luck_gift_pruple.imageset/组 4.jpg@3x-2.png
vendored
Normal file
After Width: | Height: | Size: 246 KiB |
@@ -5,12 +5,11 @@
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_mine_coin_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "ms_mine_coin_bg@3x.png",
|
||||
"filename" : "组-11@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
|
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 54 KiB |
BIN
YuMi/Assets.xcassets/jm/IncomeRecord/ms_mine_coin_bg.imageset/组-11@2x.png
vendored
Normal file
After Width: | Height: | Size: 89 KiB |
@@ -656,14 +656,17 @@ typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralPublicScreen) {
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeSuperGift) {
|
||||
///所有房间
|
||||
Custom_Message_Sub_Super_Gift = 1061,
|
||||
|
||||
// 送礼者显示中奖内容
|
||||
Custom_Message_Sub_Super_Gift_Winning_Coins = 1062,
|
||||
// 全服显示中奖内容
|
||||
Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room = 1063,
|
||||
};
|
||||
///通用飘屏
|
||||
//CustomMessageType_General_Floating_Screen = 105,
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTypeGeneralFloatingScreen) {
|
||||
///所有房间
|
||||
Custom_Message_Sub_General_Floating_Screen_One_Room = 1071,//单房间
|
||||
Custom_Message_Sub_General_Floating_Screen_All_Room = 1072,///全部房间
|
||||
Custom_Message_Sub_General_Floating_Screen_All_Room = 1072,//全部房间
|
||||
};
|
||||
///聊天大厅上头条
|
||||
//CustomMessageType_Chat_Hall_Headlinesn = 108,
|
||||
|
@@ -103,7 +103,7 @@
|
||||
///获取VIP信息
|
||||
- (void)getNobleInfo {
|
||||
@kWeakify(self);
|
||||
[Api nobleCenterLevelList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api vipCenterLevelList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
@kStrongify(self);
|
||||
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
|
||||
[[self getView] getNobleCenterInfoSuccess:model ];
|
||||
|
@@ -153,10 +153,10 @@
|
||||
_detailModel = detailModel;
|
||||
_userNameView.text = _detailModel.nick;
|
||||
_userImageView.imageUrl = _detailModel.avatar;
|
||||
_exchangeNumView.text = [NSString getDealNumwithstring:_detailModel.giftGolds];
|
||||
_diamondsNumView.text = [NSString getDealNumwithstring:_detailModel.giftDiamonds];
|
||||
_convertedView.text = [NSString stringWithFormat:YMLocalizedString(@"XPIncomeRecordGoldDetailsCell0"),[NSString getDealNumwithstring:_detailModel.exchangeGolds]];
|
||||
_settlementNumView.text = [NSString getDealNumwithstring:_detailModel.remainGolds];
|
||||
_exchangeNumView.text = [NSString getDealNumWithString:_detailModel.giftGolds];
|
||||
_diamondsNumView.text = [NSString getDealNumWithString:_detailModel.giftDiamonds];
|
||||
_convertedView.text = [NSString stringWithFormat:YMLocalizedString(@"XPIncomeRecordGoldDetailsCell0"),[NSString getDealNumWithString:_detailModel.exchangeGolds]];
|
||||
_settlementNumView.text = [NSString getDealNumWithString:_detailModel.remainGolds];
|
||||
}
|
||||
#pragma mark -懒加载
|
||||
- (NetImageView *)userImageView{
|
||||
|
@@ -162,10 +162,10 @@
|
||||
}
|
||||
-(void)setDetailModel:(XPIncomeRecordGoldDetailsModel *)detailModel{
|
||||
_detailModel = detailModel;
|
||||
_baseNumView.number = [NSString getDealNumwithstring:_detailModel.totalRemainGolds];
|
||||
_guildNumView.number = [NSString getDealNumwithstring:_detailModel.totalEarnGolds];
|
||||
_numberGoldView.number = [NSString getDealNumwithstring:_detailModel.totalGiftGolds];
|
||||
_numberExchangeView.number = [NSString getDealNumwithstring:_detailModel.totalExchangeGolds];
|
||||
_baseNumView.number = [NSString getDealNumWithString:_detailModel.totalRemainGolds];
|
||||
_guildNumView.number = [NSString getDealNumWithString:_detailModel.totalEarnGolds];
|
||||
_numberGoldView.number = [NSString getDealNumWithString:_detailModel.totalGiftGolds];
|
||||
_numberExchangeView.number = [NSString getDealNumWithString:_detailModel.totalExchangeGolds];
|
||||
}
|
||||
-(void)resetArrow{
|
||||
self.diamondView.upBtn.selected = YES;
|
||||
|
@@ -160,11 +160,11 @@
|
||||
if (_userInfo) {
|
||||
self.avatarImageView.imageUrl = _userInfo.hallAvatar;
|
||||
self.idLabel.text = _userInfo.hallName;
|
||||
self.roomIncomeCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumwithstring:_userInfo.roomIncome]];
|
||||
self.normalGiftcoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumwithstring:_userInfo.normalGiftIncome]];
|
||||
self.packGiftCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumwithstring:_userInfo.bagIncome]];
|
||||
self.sendGiftCountCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumwithstring:_userInfo.giftUv]];
|
||||
self.NewUserGiftCountCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumwithstring:_userInfo.userSendGiftNum]];
|
||||
self.roomIncomeCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumWithString:_userInfo.roomIncome]];
|
||||
self.normalGiftcoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumWithString:_userInfo.normalGiftIncome]];
|
||||
self.packGiftCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumWithString:_userInfo.bagIncome]];
|
||||
self.sendGiftCountCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumWithString:_userInfo.giftUv]];
|
||||
self.NewUserGiftCountCoinLabel.text = [NSString stringWithFormat:@"+%@", [NSString getDealNumWithString:_userInfo.userSendGiftNum]];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -191,9 +191,9 @@
|
||||
|
||||
}
|
||||
-(NSMutableAttributedString *)getTotalAttWtihNum:(NSString *)total{
|
||||
NSString *getTotal = [NSString stringWithFormat:YMLocalizedString(@"XPIncomeRecordGoldDetailsView1"),[NSString getDealNumwithstring:total]];
|
||||
NSString *getTotal = [NSString stringWithFormat:YMLocalizedString(@"XPIncomeRecordGoldDetailsView1"),[NSString getDealNumWithString:total]];
|
||||
NSMutableAttributedString *totalAtt = [[NSMutableAttributedString alloc]initWithString:getTotal attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium],NSForegroundColorAttributeName:[DJDKMIMOMColor inputTextColor]}];
|
||||
[totalAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xDE9F0C)} range:[getTotal rangeOfString:[NSString getDealNumwithstring:total]]];
|
||||
[totalAtt addAttributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0xDE9F0C)} range:[getTotal rangeOfString:[NSString getDealNumWithString:total]]];
|
||||
return totalAtt;
|
||||
}
|
||||
#pragma mark - XPIncomeRecordGoldDetailsCellDelegate
|
||||
|
@@ -133,7 +133,7 @@
|
||||
_bgImageView = [UIImageView new];
|
||||
_bgImageView.userInteractionEnabled = YES;
|
||||
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_bgImageView.image = self.type == IncomeRecord_Gold ? [UIImage imageNamed:@"income_record_gold_bg"]:[UIImage imageNamed:@"income_record_diamond_bg"];
|
||||
_bgImageView.image = self.type == IncomeRecord_Gold ? [[UIImage imageNamed:@"income_record_gold_bg"] ms_SetImageForRTL]:[[UIImage imageNamed:@"income_record_diamond_bg"] ms_SetImageForRTL];
|
||||
}
|
||||
return _bgImageView;
|
||||
}
|
||||
|
@@ -13,7 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/// VIP中心等级列表
|
||||
/// @param completion 完成
|
||||
+ (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion;
|
||||
//+ (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion;
|
||||
+ (void)vipCenterLevelList:(HttpRequestHelperCompletion)completion;
|
||||
///领取返利钻石
|
||||
+ (void)getNobleCenterDiamond:(HttpRequestHelperCompletion)completion returnProfitRecordId:(NSString *)returnProfitRecordId;
|
||||
///获取开通VIP产品列表
|
||||
|
@@ -11,9 +11,16 @@
|
||||
|
||||
/// VIP中心等级列表
|
||||
/// @param completion 完成
|
||||
+ (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion {
|
||||
//+ (void)nobleCenterLevelList:(HttpRequestHelperCompletion)completion {
|
||||
// [self makeRequest:@"vip/getVipPageInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
//}
|
||||
// vip/v2/getVipPageInfo
|
||||
+ (void)vipCenterLevelList:(HttpRequestHelperCompletion)completion {
|
||||
[self makeRequest:@"vip/getVipPageInfo" method:HttpRequestHelperMethodGET completion:completion, __FUNCTION__, nil];
|
||||
}
|
||||
|
||||
//vip/v2/getVipPageInfo
|
||||
|
||||
///领取返利钻石
|
||||
+ (void)getNobleCenterDiamond:(HttpRequestHelperCompletion)completion returnProfitRecordId:(NSString *)returnProfitRecordId{
|
||||
[self makeRequest:@"vip/returnProfit/receive" method:HttpRequestHelperMethodPOST completion:completion, __FUNCTION__, returnProfitRecordId,nil];
|
||||
|
@@ -25,7 +25,7 @@
|
||||
|
||||
/// 获取VIP中心数据
|
||||
- (void)getNobleCenterInfo {
|
||||
[Api nobleCenterLevelList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
[Api vipCenterLevelList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
|
||||
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
|
||||
[[self getView] getNobleCenterInfoSuccess:model];
|
||||
}]];
|
||||
|
@@ -843,7 +843,7 @@
|
||||
|
||||
- (void)loadVIPCenterInfo {
|
||||
@kWeakify(self);
|
||||
[Api nobleCenterLevelList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[Api vipCenterLevelList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200) {
|
||||
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
|
||||
|
@@ -84,7 +84,7 @@
|
||||
- (UIImageView *)balanceBgVeiw{
|
||||
if(!_balanceBgVeiw){
|
||||
_balanceBgVeiw = [UIImageView new];
|
||||
_balanceBgVeiw.image = kImage(@"ms_mine_coin_bg");
|
||||
_balanceBgVeiw.image = [kImage(@"ms_mine_coin_bg") ms_SetImageForRTL];
|
||||
}
|
||||
return _balanceBgVeiw;
|
||||
}
|
||||
|
@@ -663,7 +663,7 @@ UIKIT_EXTERN NSString *kRequestTicket;
|
||||
- (void)getNobleCenterInfoSuccess:(NobleCenterModel *)model {
|
||||
self.headView.nobleInfo = model;
|
||||
@kWeakify(self);
|
||||
[Api nobleCenterLevelList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[Api vipCenterLevelList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
@kStrongify(self);
|
||||
if (code == 200){
|
||||
NobleCenterModel *model = [NobleCenterModel modelWithDictionary:data.data];
|
||||
|
@@ -179,8 +179,6 @@
|
||||
/// 获取普通的礼物
|
||||
/// @param roomUid 房主的uid 获取房间专属礼物
|
||||
- (void)getNormalGiftList:(NSString *)roomUid {
|
||||
|
||||
|
||||
[[XPGiftStorage shareStorage] updateRoomUID:roomUid];
|
||||
|
||||
[Api requestAllTagsAndNormalGifts:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
|
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// LuckyGiftWinningBannerView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@class AttachmentModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LuckyGiftWinningBannerView : UIView
|
||||
|
||||
@property (nonatomic, copy) void(^didTapBanner)(NSInteger roomID);
|
||||
|
||||
+ (void)display:(UIView *)superView
|
||||
inRoomUid:(NSInteger)roomUid
|
||||
with:(AttachmentModel *)attachment
|
||||
complete:(void(^)(void))complete
|
||||
exitCurrentRoom:(void(^)(void))exit;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,266 @@
|
||||
//
|
||||
// LuckyGiftWinningBannerView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/10.
|
||||
//
|
||||
|
||||
#import "LuckyGiftWinningBannerView.h"
|
||||
|
||||
#import "AttachmentModel.h"
|
||||
#import "i18nGiftNameMap.h"
|
||||
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
|
||||
@interface LuckyGiftWinningBannerViewModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, copy) NSString *times;
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
@property (nonatomic, copy) NSString *coins;
|
||||
@property (nonatomic, copy) NSDictionary *giftNameMap;
|
||||
@property (nonatomic, copy) NSString *roomUid;
|
||||
|
||||
- (NSString *)giftName;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation LuckyGiftWinningBannerViewModel
|
||||
|
||||
+ (NSDictionary *)replacedKeyFromPropertyName {
|
||||
return @{
|
||||
@"avatar":@"sender.avatar"
|
||||
};
|
||||
}
|
||||
|
||||
- (NSString *)giftName {
|
||||
if ([self.giftNameMap.allKeys containsObject:@"ar"] && isMSRTL()) {
|
||||
return self.giftNameMap[@"ar"];
|
||||
} else if ([self.giftNameMap.allKeys containsObject:@"zh"] && isMSZH()) {
|
||||
return self.giftNameMap[@"zh"];
|
||||
} else {
|
||||
return self.giftNameMap[@"en"];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface LuckyGiftWinningBannerView ()
|
||||
|
||||
@property (nonatomic, strong) LuckyGiftWinningBannerViewModel *model;
|
||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||
@property (nonatomic, strong) UIImageView *ballImageView;
|
||||
@property (nonatomic, strong) NetImageView *avatarImage;
|
||||
@property (nonatomic, strong) UILabel *giftNameLabel;
|
||||
@property (nonatomic, strong) UILabel *timesLabel;
|
||||
@property (nonatomic, strong) UILabel *coinsLabel;
|
||||
|
||||
@property (nonatomic, assign) NSInteger currentRoomUid;
|
||||
|
||||
@property (nonatomic, copy) void(^completeDisplay)(void);
|
||||
@property (nonatomic, copy) void(^exitCurrentRoom)(void);
|
||||
|
||||
@end
|
||||
|
||||
@implementation LuckyGiftWinningBannerView
|
||||
|
||||
+ (void)display:(UIView *)superView
|
||||
inRoomUid:(NSInteger)roomUid
|
||||
with:(AttachmentModel *)attachment
|
||||
complete:(void(^)(void))complete
|
||||
exitCurrentRoom:(void(^)(void))exit {
|
||||
|
||||
LuckyGiftWinningBannerViewModel *model = [LuckyGiftWinningBannerViewModel modelWithDictionary:attachment.data];
|
||||
|
||||
CGFloat width = kGetScaleWidth(346.5);
|
||||
CGFloat height = kGetScaleWidth(82.5);
|
||||
LuckyGiftWinningBannerView *bannerView = [[LuckyGiftWinningBannerView alloc] initWithFrame:CGRectMake(KScreenWidth, 80, width, height)];
|
||||
bannerView.model = model;
|
||||
bannerView.completeDisplay = complete;
|
||||
bannerView.exitCurrentRoom = exit;
|
||||
bannerView.currentRoomUid = roomUid;
|
||||
[superView addSubview:bannerView];
|
||||
|
||||
@kWeakify(bannerView);
|
||||
[UIView animateWithDuration:0.25 animations:^{
|
||||
bannerView.center = CGPointMake(superView.center.x, height/2 + 80);
|
||||
} completion:^(BOOL finished) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
|
||||
bannerView.frame = CGRectMake(-KScreenWidth, 80, width, height);
|
||||
} completion:^(BOOL finished) {
|
||||
@kStrongify(bannerView);
|
||||
[bannerView removeFromSuperview];
|
||||
if (bannerView.completeDisplay) {
|
||||
bannerView.completeDisplay();
|
||||
}
|
||||
}];
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setModel:(LuckyGiftWinningBannerViewModel *)model {
|
||||
_model = model;
|
||||
self.avatarImage.imageUrl = model.avatar;
|
||||
self.giftNameLabel.text = [model giftName];
|
||||
self.timesLabel.text = model.times;
|
||||
self.coinsLabel.text = [NSString formatNumberToKOrM:model.coins];
|
||||
}
|
||||
|
||||
- (instancetype)initWithFrame:(CGRect)frame {
|
||||
if (self = [super initWithFrame:frame]) {
|
||||
[self setupUI];
|
||||
UIButton *b = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[self addSubview:b];
|
||||
[b mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
[b addTarget:self action:@selector(handelTap) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)handelTap {
|
||||
if (self.model.roomUid.integerValue == self.currentRoomUid) {
|
||||
return;
|
||||
}
|
||||
|
||||
@kWeakify(self);
|
||||
[TTPopup alertWithMessage:YMLocalizedString(@"Combo_10") confirmHandler:^{
|
||||
@kStrongify(self);
|
||||
if (self.exitCurrentRoom) {
|
||||
self.exitCurrentRoom();
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[XPRoomViewController openRoom:self.model.roomUid
|
||||
viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
});
|
||||
} cancelHandler:^{}];
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
[self addSubview:self.backgroundImageView];
|
||||
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self addSubview:self.ballImageView];
|
||||
[self.ballImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.bottom.top.mas_equalTo(self);
|
||||
make.width.mas_equalTo(self.ballImageView.mas_height);
|
||||
}];
|
||||
|
||||
[self addSubview:self.avatarImage];
|
||||
[self.avatarImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.mas_equalTo(kGetScaleWidth(8));
|
||||
make.top.mas_equalTo(kGetScaleWidth(24));
|
||||
make.width.height.mas_equalTo(kGetScaleWidth(43));
|
||||
}];
|
||||
|
||||
UILabel *titleLabel_1 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_0") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
|
||||
[self addSubview:titleLabel_1];
|
||||
[titleLabel_1 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.avatarImage).offset(2);
|
||||
make.leading.mas_equalTo(self.avatarImage.mas_trailing).offset(10);
|
||||
}];
|
||||
|
||||
[self addSubview:self.giftNameLabel];
|
||||
[self.giftNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(titleLabel_1);
|
||||
make.leading.mas_equalTo(titleLabel_1.mas_trailing).offset(3);
|
||||
}];
|
||||
|
||||
UILabel *titleLabel_2 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
|
||||
[self addSubview:titleLabel_2];
|
||||
[titleLabel_2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_equalTo(self.avatarImage.mas_bottom).offset(-2);
|
||||
make.leading.mas_equalTo(self.avatarImage.mas_trailing).offset(10);
|
||||
}];
|
||||
|
||||
[self addSubview:self.timesLabel];
|
||||
[self.timesLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(titleLabel_2);
|
||||
make.leading.mas_equalTo(titleLabel_2.mas_trailing).offset(3);
|
||||
}];
|
||||
|
||||
UILabel *titleLabel_3 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_9") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
|
||||
[self addSubview:titleLabel_3];
|
||||
[titleLabel_3 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.timesLabel);
|
||||
make.leading.mas_equalTo(self.timesLabel.mas_trailing).offset(3);
|
||||
}];
|
||||
|
||||
[self addSubview:self.coinsLabel];
|
||||
[self.coinsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
// make.centerX.mas_equalTo(self.ballImageView);
|
||||
make.top.mas_equalTo(self).offset(25);
|
||||
make.height.mas_equalTo(28);
|
||||
make.width.mas_equalTo(self.ballImageView);
|
||||
}];
|
||||
|
||||
UILabel *titleLabel_4 = [UILabel labelInitWithText:YMLocalizedString(@"Combo_5") font:kFontSemibold(14) textColor:[UIColor whiteColor]];
|
||||
[self addSubview:titleLabel_4];
|
||||
[titleLabel_4 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.coinsLabel);
|
||||
make.top.mas_equalTo(self.coinsLabel.mas_bottom);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (UIImageView *)backgroundImageView {
|
||||
if (!_backgroundImageView) {
|
||||
_backgroundImageView = [[UIImageView alloc] initWithImage:[kImage(@"luck_gift_flag") ms_SetImageForRTL]];
|
||||
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _backgroundImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)ballImageView {
|
||||
if (!_ballImageView) {
|
||||
_ballImageView = [[UIImageView alloc] initWithImage:kImage(@"luck_gift_flag_ball")];
|
||||
_ballImageView.contentMode = UIViewContentModeScaleAspectFill;
|
||||
}
|
||||
return _ballImageView;
|
||||
}
|
||||
|
||||
- (NetImageView *)avatarImage {
|
||||
if (!_avatarImage) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
||||
config.imageType = ImageTypeCornerAvatar;
|
||||
_avatarImage = [[NetImageView alloc] initWithConfig:config];
|
||||
_avatarImage.backgroundColor = [UIColor clearColor];
|
||||
_avatarImage.contentMode = UIViewContentModeScaleAspectFill;
|
||||
_avatarImage.layer.cornerRadius = kGetScaleWidth(43/2);
|
||||
_avatarImage.layer.masksToBounds = YES;
|
||||
_avatarImage.clipsToBounds = YES;
|
||||
}
|
||||
return _avatarImage;
|
||||
}
|
||||
|
||||
- (UILabel *)giftNameLabel {
|
||||
if (!_giftNameLabel) {
|
||||
_giftNameLabel = [UILabel labelInitWithText:@"Gift" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
}
|
||||
return _giftNameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)coinsLabel {
|
||||
if (!_coinsLabel) {
|
||||
_coinsLabel = [UILabel labelInitWithText:@"14K" font:kFontSemibold(20) textColor:UIColorFromRGB(0xffe375)];
|
||||
_coinsLabel.adjustsFontSizeToFitWidth = YES;
|
||||
_coinsLabel.minimumScaleFactor = 0.5;
|
||||
_coinsLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _coinsLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)timesLabel {
|
||||
if (!_timesLabel) {
|
||||
_timesLabel = [UILabel labelInitWithText:@"913" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
}
|
||||
return _timesLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// LuckyGiftWinningFlagView.h
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/10.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
@class AttachmentModel;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface LuckyGiftWinningFlagView : UIView
|
||||
|
||||
+ (void)display:(UIView *)superView
|
||||
with:(AttachmentModel *)attachment
|
||||
roomID:(NSInteger)roomID
|
||||
uID:(NSString *)UID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@@ -0,0 +1,196 @@
|
||||
//
|
||||
// LuckyGiftWinningFlagView.m
|
||||
// YuMi
|
||||
//
|
||||
// Created by P on 2024/9/10.
|
||||
//
|
||||
|
||||
#import "LuckyGiftWinningFlagView.h"
|
||||
#import "AttachmentModel.h"
|
||||
|
||||
@interface LuckyGiftWinningFlagViewModel : PIBaseModel
|
||||
|
||||
@property (nonatomic, assign) NSInteger uid;
|
||||
@property (nonatomic, assign) NSInteger level;
|
||||
@property (nonatomic, assign) NSInteger roomId;
|
||||
|
||||
@property (nonatomic, copy) NSString *times;
|
||||
@property (nonatomic, copy) NSString *coins;
|
||||
@property (nonatomic, copy) NSString *roomUid;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation LuckyGiftWinningFlagViewModel
|
||||
|
||||
@end
|
||||
|
||||
@interface LuckyGiftWinningFlagView ()
|
||||
|
||||
@property (nonatomic, strong) LuckyGiftWinningFlagViewModel *model;
|
||||
|
||||
@property (nonatomic, strong) UILabel *winLabel;
|
||||
@property (nonatomic, strong) UILabel *winPriceLabel;
|
||||
@property (nonatomic, strong) UILabel *winTimesLabel;
|
||||
|
||||
@property (nonatomic, strong) UIImageView *coinIcon;
|
||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation LuckyGiftWinningFlagView
|
||||
|
||||
+ (void)display:(UIView *)superView
|
||||
with:(AttachmentModel *)attachment
|
||||
roomID:(NSInteger)roomID
|
||||
uID:(NSString *)UID
|
||||
{
|
||||
LuckyGiftWinningFlagViewModel *model = [LuckyGiftWinningFlagViewModel modelWithDictionary:attachment.data];
|
||||
if (model.roomId != roomID || model.uid != UID.integerValue) {
|
||||
return;
|
||||
}
|
||||
|
||||
LuckyGiftWinningFlagView *winningFlagView = [[LuckyGiftWinningFlagView alloc] init];
|
||||
winningFlagView.model = model;
|
||||
winningFlagView.alpha = 0;
|
||||
winningFlagView.frame = CGRectMake(0, 0, kGetScaleWidth(162), kGetScaleWidth(162));
|
||||
winningFlagView.center = CGPointMake(superView.center.x, kGetScaleWidth(163) + kGetScaleWidth(162)/2);
|
||||
winningFlagView.transform = CGAffineTransformMakeScale(0.1, 0.1);
|
||||
[superView addSubview:winningFlagView];
|
||||
|
||||
// 使用弹簧动画执行放大动画,alpha从0变为1,带有弹性效果
|
||||
[UIView animateWithDuration:0.8
|
||||
delay:0
|
||||
usingSpringWithDamping:0.3 // 弹性系数,数值越小弹性越强
|
||||
initialSpringVelocity:0.5 // 初始速度
|
||||
options:UIViewAnimationOptionCurveEaseInOut
|
||||
animations:^{
|
||||
winningFlagView.alpha = 1.0;
|
||||
winningFlagView.transform = CGAffineTransformMakeScale(1.0, 1.0); // 还原为正常大小
|
||||
} completion:^(BOOL finished) {
|
||||
// 动画完成后,等待2秒再执行反向动画
|
||||
[UIView animateWithDuration:0.5
|
||||
delay:2.0 // 延迟2秒执行反向动画
|
||||
options:UIViewAnimationOptionCurveEaseInOut
|
||||
animations:^{
|
||||
winningFlagView.alpha = 0.0;
|
||||
winningFlagView.transform = CGAffineTransformMakeScale(0.1, 0.1); // 缩小回原始大小
|
||||
} completion:^(BOOL finished) {
|
||||
// 动画完成后移除 view
|
||||
[winningFlagView removeFromSuperview];
|
||||
}];
|
||||
}];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
self = [super init];
|
||||
if (self) {
|
||||
[self setupUI];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setupUI {
|
||||
[self addSubview:self.backgroundImageView];
|
||||
[self.backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self addSubview:self.winLabel];
|
||||
[self.winLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self);
|
||||
make.top.mas_equalTo(kGetScaleWidth(40));
|
||||
}];
|
||||
|
||||
UIStackView *stackView = [[UIStackView alloc] init];
|
||||
stackView.spacing = 6;
|
||||
[self addSubview:stackView];
|
||||
[stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.backgroundImageView);
|
||||
make.top.mas_equalTo(self.winLabel.mas_bottom).offset(11);
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
|
||||
[stackView addArrangedSubview:self.coinIcon];
|
||||
[stackView addArrangedSubview:self.winPriceLabel];
|
||||
|
||||
[self.coinIcon mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(21, 21));
|
||||
}];
|
||||
|
||||
[self.winPriceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(35);
|
||||
}];
|
||||
|
||||
UIStackView *stackView_2 = [[UIStackView alloc] init];
|
||||
stackView_2.spacing = 4;
|
||||
[self addSubview:stackView_2];
|
||||
[stackView_2 mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.backgroundImageView);
|
||||
make.top.mas_equalTo(stackView.mas_bottom).offset(11);
|
||||
make.height.mas_equalTo(17);
|
||||
}];
|
||||
|
||||
UILabel *titleLeft = [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") font:kFontRegular(12) textColor:[UIColor whiteColor]];
|
||||
UILabel *titleRight = [UILabel labelInitWithText:YMLocalizedString(@"Combo_9") font:kFontRegular(12) textColor:[UIColor whiteColor]];
|
||||
|
||||
[stackView_2 addArrangedSubview:titleLeft];
|
||||
[stackView_2 addArrangedSubview:self.winTimesLabel];
|
||||
[stackView_2 addArrangedSubview:titleRight];
|
||||
}
|
||||
|
||||
- (void)setModel:(LuckyGiftWinningFlagViewModel *)model {
|
||||
_model = model;
|
||||
self.winPriceLabel.text = model.coins;
|
||||
self.winTimesLabel.text = model.times;
|
||||
self.backgroundImageView.image = model.level == 1 ? kImage(@"luck_gift_gold") : kImage(@"luck_gift_pruple");
|
||||
}
|
||||
|
||||
- (void)display {
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
- (UIImageView *)coinIcon {
|
||||
if (!_coinIcon) {
|
||||
_coinIcon = [[UIImageView alloc] initWithImage:kImage(@"moli_money_icon")];
|
||||
_coinIcon.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _coinIcon;
|
||||
}
|
||||
|
||||
- (UIImageView *)backgroundImageView {
|
||||
if (!_backgroundImageView) {
|
||||
_backgroundImageView = [[UIImageView alloc] initWithImage:kImage(@"luck_gift_gold")];
|
||||
_backgroundImageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||
}
|
||||
return _backgroundImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)winLabel {
|
||||
if (!_winLabel) {
|
||||
_winLabel = [UILabel labelInitWithText:YMLocalizedString(@"Combo_4") font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
_winLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _winLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)winPriceLabel {
|
||||
if (!_winPriceLabel) {
|
||||
_winPriceLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(26) textColor:UIColorFromRGB(0xffe375)];
|
||||
_winPriceLabel.minimumScaleFactor = 0.5f;
|
||||
}
|
||||
return _winPriceLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)winTimesLabel {
|
||||
if (!_winTimesLabel) {
|
||||
_winTimesLabel = [UILabel labelInitWithText:@"" font:kFontSemibold(14) textColor:UIColorFromRGB(0xffe375)];
|
||||
}
|
||||
return _winTimesLabel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
@@ -20,7 +20,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property (nonatomic,assign) BOOL isSvga;
|
||||
@property (nonatomic,strong) PIUniversalBannerModel *model;
|
||||
|
||||
|
||||
@property (nonatomic,weak) id<PIUniversalBannerViewDelegate> delegate;
|
||||
|
||||
@end
|
||||
|
@@ -14,6 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPRoomAnimationView : XPRoomAnimationHitView <RoomGuestDelegate>
|
||||
-(void)resumeTimer;
|
||||
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
|
||||
|
||||
- (void)receiveLuckGiftWinning:( AttachmentModel * _Nullable )attachment;
|
||||
- (void)receiveLuckGiftBanner:(AttachmentModel *)attachment ;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -65,9 +65,11 @@
|
||||
#import "PIRoomGiftBroadcastWindow.h"
|
||||
#import "PIUniversalBannerModel.h"
|
||||
#import "PIUniversalBannerView.h"
|
||||
#import "GiftComboFlagView.h"
|
||||
|
||||
#import "GiftComboManager.h"
|
||||
#import "LuckyGiftWinningFlagView.h"
|
||||
|
||||
#import "LuckyGiftWinningBannerView.h"
|
||||
|
||||
@interface XPRoomAnimationView ()<SVGAPlayerDelegate,NIMBroadcastManagerDelegate, XPRoomGiftBroadcastViewDelegate, HWDMP4PlayDelegate, XPRoomLuckyBigPrizeViewDelegate, XPRoomGraffitiGiftAnimationViewDelegate, XPRoomStarKitchenBannerViewDelegate,PAGViewListener,XPRoomAnchorRankBannerViewDelegate,PIRoomGiftBroadcastWindowDelegate,PIUniversalBannerViewDelegate>
|
||||
///展示的不同层级
|
||||
@@ -156,6 +158,9 @@
|
||||
|
||||
@property (nonatomic, copy) NSString *GiftDynamicEffectListPath;
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *roomLuckWinningBannerModels;
|
||||
@property (nonatomic, assign) BOOL isDisplayLuckWinningBanner;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPRoomAnimationView
|
||||
@@ -185,6 +190,7 @@
|
||||
[self initSubViews];
|
||||
[self initSubViewConstraints];
|
||||
|
||||
_roomLuckWinningBannerModels = [NSMutableArray array];
|
||||
_GiftDynamicEffectListPath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"GiftDynamicEffectList"];
|
||||
|
||||
}
|
||||
@@ -355,6 +361,12 @@
|
||||
[self receiveCommonH5Banner:attachment];
|
||||
}else if (attachment.first == CustomMessageType_General_Floating_Screen && attachment.second == Custom_Message_Sub_General_Floating_Screen_One_Room){
|
||||
[self receiveRoomGeneralFloatingScreen:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Super_Gift &&
|
||||
attachment.second == Custom_Message_Sub_Super_Gift_Winning_Coins) {
|
||||
[self receiveLuckGiftWinning:attachment];
|
||||
} else if (attachment.first == CustomMessageType_Super_Gift &&
|
||||
attachment.second == Custom_Message_Sub_Super_Gift_Winning_Coins_ALL_Room) {
|
||||
[self receiveLuckGiftBanner:attachment];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,23 +388,69 @@
|
||||
[self userEnterRoom:content ext:extModel];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 收到送礼者中奖飘屏
|
||||
- (void)receiveLuckGiftWinning:(AttachmentModel *)attachment {
|
||||
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
|
||||
[LuckyGiftWinningFlagView display:self
|
||||
with:attachment
|
||||
roomID:roomInfo.roomId
|
||||
uID:[AccountInfoStorage instance].getUid];
|
||||
}
|
||||
|
||||
- (void)receiveLuckGiftBanner:(AttachmentModel *)attachment {
|
||||
[self.roomLuckWinningBannerModels addObject:attachment];
|
||||
if (!self.isDisplayLuckWinningBanner) {
|
||||
[self processNextLuckWinningAttachment];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)processNextLuckWinningAttachment {
|
||||
// 检查队列是否有元素
|
||||
if (self.roomLuckWinningBannerModels.count == 0) {
|
||||
// 如果队列为空,停止处理
|
||||
self.isDisplayLuckWinningBanner = NO;
|
||||
return;
|
||||
}
|
||||
|
||||
// 从队列中取出第一个元素并移出队列
|
||||
AttachmentModel *nextAttachment = [self.roomLuckWinningBannerModels firstObject];
|
||||
[self.roomLuckWinningBannerModels removeObjectAtIndex:0];
|
||||
|
||||
// 设置为正在显示的状态
|
||||
self.isDisplayLuckWinningBanner = YES;
|
||||
RoomInfoModel *roomInfo = self.delegate.getRoomInfo;
|
||||
// 执行 display 方法
|
||||
@kWeakify(self);
|
||||
[LuckyGiftWinningBannerView display:self inRoomUid:roomInfo.uid with:nextAttachment complete:^{
|
||||
@kStrongify(self);
|
||||
// Display 完成后,继续处理下一个
|
||||
[self processNextLuckWinningAttachment];
|
||||
} exitCurrentRoom:^{
|
||||
@kStrongify(self);
|
||||
[self.delegate exitRoom];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 收到通用飘屏
|
||||
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attacment{
|
||||
-(void)receiveRoomGeneralFloatingScreen:(AttachmentModel *)attachment{
|
||||
PIBaseAnimationViewModel *roomGraffiti = [PIBaseAnimationViewModel new];
|
||||
roomGraffiti.data = attacment.data;
|
||||
roomGraffiti.data = attachment.data;
|
||||
roomGraffiti.type = GiftBannerType_General_Floating_Screen;
|
||||
roomGraffiti.first = attacment.first;
|
||||
roomGraffiti.second = attacment.second;
|
||||
roomGraffiti.first = attachment.first;
|
||||
roomGraffiti.second = attachment.second;
|
||||
if(self.animationListB.count == 0 && self.isPlayOfB == NO){
|
||||
[self createGeneralFloatingScreenAnimation:roomGraffiti];
|
||||
}
|
||||
[self.animationListB addObject:roomGraffiti];
|
||||
}
|
||||
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attacment{
|
||||
- (void)createGeneralFloatingScreenAnimation:(PIBaseAnimationViewModel *)attachment{
|
||||
self.isPlayOfB = YES;
|
||||
CGFloat top = self.isPlayOfA == YES ? (self.broadCastHieght + statusbarHeight) : (kNavigationHeight + 15);
|
||||
|
||||
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attacment.data];
|
||||
PIUniversalBannerModel *model = [PIUniversalBannerModel modelWithDictionary:attachment.data];
|
||||
BOOL isSvga = [model.resourceType.uppercaseString isEqualToString:@"SVGA"];
|
||||
__block PIUniversalBannerView *bannerView;
|
||||
@kWeakify(self);
|
||||
@@ -1532,7 +1590,11 @@
|
||||
if ([[GiftComboManager sharedManager] isGiftCombing] &&
|
||||
[uid isEqualToString:[AccountInfoStorage instance].getUid] &&
|
||||
isEnd == false) {
|
||||
point = CGPointMake([UIScreen mainScreen].bounds.size.width - 60, [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - 60);
|
||||
if (isMSRTL()) {
|
||||
point = CGPointMake(kGetScaleWidth(80), [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - kGetScaleWidth(110));
|
||||
} else {
|
||||
point = CGPointMake(kGetScaleWidth([UIScreen mainScreen].bounds.size.width - kGetScaleWidth(110)), [UIScreen mainScreen].bounds.size.height - kSafeAreaTopHeight - kGetScaleWidth(110));
|
||||
}
|
||||
}
|
||||
|
||||
return point;
|
||||
|
@@ -44,7 +44,6 @@
|
||||
- (void)initSubViewConstraints {
|
||||
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.bottom.trailing.leading.equalTo(self);
|
||||
|
||||
}];
|
||||
|
||||
[self.titleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -114,8 +113,6 @@ BOOL isNumeric(NSString *string) {
|
||||
return _bgView;
|
||||
}
|
||||
|
||||
|
||||
|
||||
- (UIImageView *)iconImageView {
|
||||
if (_iconImageView == nil) {
|
||||
_iconImageView = [[UIImageView alloc] init];
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#import "GiftInfoModel.h"
|
||||
#import "GiftComboView.h"
|
||||
|
||||
@class GiftReceiveInfoModel, UserInfoModel, GiftReceiveInfoModel;
|
||||
@class GiftReceiveInfoModel, UserInfoModel, GiftReceiveInfoModel, XPGiftCountModel;
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
ComboAction_ShowPanel,
|
||||
@@ -42,12 +42,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)saveSendGiftNum:(NSString *)numString;
|
||||
- (void)saveUserInfo:(UserInfoModel *)userInfo;
|
||||
- (void)saveSessionID:(NSString *)sessionID;
|
||||
- (void)saveGiftCountModel:(XPGiftCountModel *)model;
|
||||
|
||||
- (void)resetCombo;
|
||||
- (void)sendGift;
|
||||
- (void)forceRemove;
|
||||
|
||||
// 第一个 combo 由 send gift view 发起,需要手动 combo + 1
|
||||
- (NSInteger)loadComboCountFromSendGiftView;
|
||||
- (NSInteger)loadComboCount;
|
||||
- (NSInteger)loadTotalGiftNum;
|
||||
- (BOOL)isGiftCombing;
|
||||
|
||||
- (void)receiveGiftInfoForDisplayComboFlags:(GiftReceiveInfoModel *)receiveInfo
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
||||
#import "UserInfoModel.h"
|
||||
#import "AttachmentModel.h"
|
||||
#import "XPGiftCountModel.h"
|
||||
#import "GiftReceiveInfoModel.h"
|
||||
#import "XPMessageRemoteExtModel.h"
|
||||
|
||||
@@ -37,6 +38,7 @@
|
||||
@property (nonatomic, copy) NSString *giftNumPerTimes;
|
||||
@property (nonatomic, strong) UserInfoModel *sendGiftUserInfo;
|
||||
@property (nonatomic, copy) NSString *sessionID;
|
||||
@property (nonatomic, strong) XPGiftCountModel *countModel;
|
||||
|
||||
@property (nonatomic, assign) NSInteger combo;
|
||||
@property (nonatomic, assign) bool isCombing;
|
||||
@@ -114,10 +116,20 @@
|
||||
self.isCombing = NO;
|
||||
}
|
||||
|
||||
- (NSInteger)loadComboCountFromSendGiftView {
|
||||
NSInteger temp = self.combo;
|
||||
self.combo += 1;
|
||||
return temp;
|
||||
}
|
||||
|
||||
- (NSInteger)loadComboCount {
|
||||
return self.combo;
|
||||
}
|
||||
|
||||
- (NSInteger)loadTotalGiftNum {
|
||||
return self.combo * self.countModel.giftNumber.integerValue * self.sendGiftToUIDs.count;
|
||||
}
|
||||
|
||||
- (BOOL)isGiftCombing {
|
||||
return self.isCombing;
|
||||
}
|
||||
@@ -155,8 +167,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
[self allCurrentFlagMoveDown];
|
||||
|
||||
if (self.activeViews.count >= 2) {
|
||||
GiftComboFlagView *oldestView = [self.activeViews firstObject];
|
||||
[self animateRemoveView:oldestView];
|
||||
@@ -173,22 +183,23 @@
|
||||
[flagView setTimerEnd:^{
|
||||
@kStrongify(self);
|
||||
@kStrongify(flagView);
|
||||
if ([self.activeViews containsObject:flagView]) {
|
||||
[self.activeViews removeObject:flagView];
|
||||
}
|
||||
[self animateRemoveView:flagView];
|
||||
}];
|
||||
[flagView updateReceiveInfoModel:receiveInfo animationType:0];
|
||||
|
||||
[self.activeViews addObject:flagView];
|
||||
[self allCurrentFlagMoveDown];
|
||||
|
||||
[self.containerView addSubview:flagView];
|
||||
[self.activeViews addObject:flagView];
|
||||
|
||||
[self animateView:flagView positionY:positionY];
|
||||
}
|
||||
|
||||
- (void)allCurrentFlagMoveDown {
|
||||
[self.activeViews enumerateObjectsUsingBlock:^(GiftComboFlagView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
CGFloat positionY = kGetScaleWidth(380);
|
||||
[self.activeViews enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(GiftComboFlagView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
CGRect rect = obj.frame;
|
||||
rect.origin.y += 50;
|
||||
rect.origin.y = positionY + idx * 50;
|
||||
obj.frame = rect;
|
||||
}];
|
||||
}
|
||||
@@ -208,6 +219,8 @@
|
||||
} else {
|
||||
flagView.frame = CGRectMake(20, positionY, kGetScaleWidth(300), 50);
|
||||
}
|
||||
} completion:^(BOOL finished) {
|
||||
[self allCurrentFlagMoveDown];
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -223,6 +236,9 @@
|
||||
- (BOOL)updateExistingViewWithModel:(GiftReceiveInfoModel *)model {
|
||||
NSInteger index = 0;
|
||||
for (GiftComboFlagView *existingFlag in self.activeViews) {
|
||||
if (existingFlag.superview == nil) {
|
||||
continue;
|
||||
}
|
||||
if ([existingFlag.receiveInfo isEqual:model]) {
|
||||
[self updateComboFlag:existingFlag with:model];
|
||||
return YES;
|
||||
@@ -333,6 +349,10 @@
|
||||
_sessionID = sessionID;
|
||||
}
|
||||
|
||||
- (void)saveGiftCountModel:(XPGiftCountModel *)model {
|
||||
_countModel = model;
|
||||
}
|
||||
|
||||
#pragma mark - XPGiftPresenter
|
||||
|
||||
- (void)sendGift {
|
||||
@@ -367,7 +387,8 @@
|
||||
}
|
||||
|
||||
- (void)handleSendGiftSuccess:(BaseModel *)response {
|
||||
self.combo = self.combo + 1;
|
||||
// NSInteger sendCombo = [self loadTotalGiftNum];
|
||||
|
||||
if (self.actionCallback) {
|
||||
self.actionCallback(ComboAction_Combo_Count_Update);
|
||||
}
|
||||
@@ -415,6 +436,8 @@
|
||||
[attachment.data setObject:@(self.combo) forKey:@"comboCount"];
|
||||
[self sendCustomMessage:attachment];
|
||||
}
|
||||
|
||||
self.combo += 1;
|
||||
}
|
||||
|
||||
- (void)sendCustomMessage:(AttachmentModel *)attachment {
|
||||
|
@@ -58,7 +58,7 @@
|
||||
if (roomUid.length > 0) {
|
||||
self.currentRoomUid = roomUid;
|
||||
NSArray *giftLists = [self.roomGiftCache objectForKey:roomUid];
|
||||
if (giftLists.count >= 0) {
|
||||
if (giftLists.count > 0) {
|
||||
return giftLists;
|
||||
} else {
|
||||
giftLists = [self.roomGiftCache objectForKey:[self defaultKey]];
|
||||
@@ -73,7 +73,7 @@
|
||||
if (roomUid.length > 0) {
|
||||
self.currentRoomUid = roomUid;
|
||||
NSArray *tagsList = [self.roomGiftPanelTagsCache objectForKey:roomUid];
|
||||
if (tagsList.count >= 0) {
|
||||
if (tagsList.count > 0) {
|
||||
return tagsList;
|
||||
} else {
|
||||
return [self.roomGiftPanelTagsCache objectForKey:[self defaultKey]];
|
||||
|
@@ -20,7 +20,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// - Parameters:
|
||||
/// - model: 接收到的礼物数据
|
||||
/// - type: 飘屏动画类型:0-不做动画;1-数字抖动
|
||||
- (void)updateReceiveInfoModel:(GiftReceiveInfoModel *)model animationType:(NSInteger)type;
|
||||
- (void)updateReceiveInfoModel:(GiftReceiveInfoModel *)model
|
||||
animationType:(NSInteger)type;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -11,8 +11,6 @@
|
||||
|
||||
@interface GiftComboFlagView()
|
||||
|
||||
|
||||
|
||||
@property (nonatomic, strong) UIImageView *backgroundImageView;
|
||||
@property (nonatomic, strong) NetImageView *giftGiverAvatar;
|
||||
@property (nonatomic, strong) NetImageView *giftIcon;
|
||||
@@ -73,18 +71,20 @@
|
||||
self.giftGiverNameLabel.text = model.nick;
|
||||
|
||||
if (model.isBatch) {
|
||||
self.giftReceiverNameLabel.text = @"All mic";
|
||||
self.giftReceiverNameLabel.text = YMLocalizedString(@"Combo_1");
|
||||
} else {
|
||||
if (model.targetUids.count == 1) {
|
||||
self.giftReceiverNameLabel.text = model.targetNick;
|
||||
} else if (model.targetUids.count > 1) {
|
||||
self.giftReceiverNameLabel.text = [NSString stringWithFormat:@"%ld guys", model.targetUids.count];
|
||||
self.giftReceiverNameLabel.text = YMLocalizedString(@"Combo_2");
|
||||
} else {
|
||||
self.giftReceiverNameLabel.text = model.targetNick;
|
||||
}
|
||||
}
|
||||
|
||||
NSString *countStr = [NSString stringWithFormat:@"x%ld", (long)model.comboCount * model.receiveUserCount];
|
||||
NSInteger total = model.comboCount * model.giftNum * model.receiveUserCount;
|
||||
|
||||
NSString *countStr = [NSString stringWithFormat:@"x%ld", (long)total];
|
||||
NSShadow *shadow = [[NSShadow alloc] init];
|
||||
shadow.shadowBlurRadius = 3;
|
||||
shadow.shadowColor = [UIColor colorWithRed:255/255.0 green:153./255.0 blue:0/255.0 alpha:1];
|
||||
@@ -95,7 +95,7 @@
|
||||
NSShadowAttributeName: shadow}];
|
||||
self.giftCountLabel.attributedText = string;
|
||||
if (type == 1) {
|
||||
CGFloat scale = 1.1 + (0.1 * model.comboCount * model.receiveUserCount);
|
||||
CGFloat scale = 1.1 + (0.01 * total);
|
||||
scale = MIN(3.0, scale);
|
||||
|
||||
self.giftCountLabel.transform = CGAffineTransformIdentity;
|
||||
@@ -152,7 +152,7 @@
|
||||
[self addSubview:self.giftCountLabel];
|
||||
[self.giftCountLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self.backgroundImageView);
|
||||
make.leading.mas_equalTo(self.giftIcon.mas_trailing).offset(22);
|
||||
make.leading.mas_equalTo(self.giftIcon.mas_trailing).offset(kGetScaleWidth(22));
|
||||
}];
|
||||
}
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
- (UILabel *)actionTitleLabel {
|
||||
if (!_actionTitleLabel) {
|
||||
_actionTitleLabel = [UILabel labelInitWithText:@"Send" font:kFontSemibold(10) textColor:UIColorFromRGB(0xFFffff)];
|
||||
_actionTitleLabel = [UILabel labelInitWithText:YMLocalizedString(@"Combo_0") font:kFontSemibold(10) textColor:UIColorFromRGB(0xFFffff)];
|
||||
}
|
||||
return _actionTitleLabel;
|
||||
}
|
||||
|
@@ -137,9 +137,21 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
@kWeakify(self);
|
||||
[[GiftComboManager sharedManager] registerActions:^(ComboActionType type) {
|
||||
@kStrongify(self);
|
||||
if (!self) {
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case ComboAction_ShowPanel: {
|
||||
self.contentView.hidden = YES;
|
||||
if (self->_superGiftView) {
|
||||
self.superGiftView.hidden = YES;
|
||||
}
|
||||
if (self->_constellationBanner) {
|
||||
self.constellationBanner.hidden = YES;
|
||||
}
|
||||
if (self->_luckyBroadcastView) {
|
||||
self.luckyBroadcastView.hidden = YES;
|
||||
}
|
||||
[self.view addSubview:self.comboView];
|
||||
[self.comboView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.view);
|
||||
@@ -149,6 +161,15 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
break;
|
||||
case ComboAction_RemovePanel:{
|
||||
self.contentView.hidden = NO;
|
||||
if (self->_superGiftView) {
|
||||
self.superGiftView.hidden = NO;
|
||||
}
|
||||
if (self->_constellationBanner) {
|
||||
self.constellationBanner.hidden = NO;
|
||||
}
|
||||
if (self->_luckyBroadcastView) {
|
||||
self.luckyBroadcastView.hidden = NO;
|
||||
}
|
||||
[self.comboView removeFromSuperview];
|
||||
self.comboView = nil;
|
||||
}
|
||||
@@ -221,23 +242,12 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
[self.presenter getUserInfo:[AccountInfoStorage instance].getUid];
|
||||
[self.presenter getUserWallInfo];
|
||||
|
||||
@kWeakify(self);
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.25 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
@kStrongify(self);
|
||||
if (self) {
|
||||
[self.presenter luckyGiftBroadcastRecord];
|
||||
}
|
||||
});
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{
|
||||
@kStrongify(self);
|
||||
if (self) {
|
||||
if (self.didLoadPackGiftList) {
|
||||
return;
|
||||
}
|
||||
self.didLoadPackGiftList = YES;
|
||||
[self.presenter getPackGiftList];
|
||||
}
|
||||
});
|
||||
[self.presenter luckyGiftBroadcastRecord];
|
||||
if (self.didLoadPackGiftList) {
|
||||
return;
|
||||
}
|
||||
self.didLoadPackGiftList = YES;
|
||||
[self.presenter getPackGiftList];
|
||||
}
|
||||
|
||||
#pragma mark - Send Custom Message
|
||||
@@ -372,7 +382,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
NIMMessage *message = [[NIMMessage alloc]init];
|
||||
NIMCustomObject *object = [[NIMCustomObject alloc] init];
|
||||
|
||||
[attachment.data setObject:@([[GiftComboManager sharedManager] loadComboCount]) forKey:@"comboCount"];
|
||||
[attachment.data setObject:@([[GiftComboManager sharedManager] loadComboCountFromSendGiftView]) forKey:@"comboCount"];
|
||||
|
||||
object.attachment = attachment;
|
||||
message.messageObject = object;
|
||||
@@ -468,6 +478,7 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
[[GiftComboManager sharedManager] saveRoomUID:self.roomUid];
|
||||
[[GiftComboManager sharedManager] saveUserInfo:self.delegate.getUserInfo];
|
||||
[[GiftComboManager sharedManager] saveSessionID:sessionID];
|
||||
[[GiftComboManager sharedManager] saveGiftCountModel:giftCount];
|
||||
}
|
||||
|
||||
#pragma mark - XPGiftBarViewDelegate
|
||||
@@ -873,10 +884,6 @@ UIKIT_EXTERN NSString * kShowFirstRechargeView;
|
||||
|
||||
///送礼物失败
|
||||
- (void)sendGiftFailWithCode:(NSInteger)code msg:(NSString *)msg {
|
||||
#if DEBUG
|
||||
[[GiftComboManager sharedManager] resetCombo];
|
||||
// [self sendCustomMessage:nil oringinDic:nil];
|
||||
#endif
|
||||
self.giftBarView.sendButtonIsEnable = YES;
|
||||
if (code == 31005) {// 余额不足
|
||||
[self showNotSufficientFundsWithToast:msg];
|
||||
|
@@ -246,7 +246,7 @@
|
||||
}];
|
||||
///用户信息的子view
|
||||
[self.backImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.leading.right.mas_equalTo(self.userInfoView);
|
||||
make.top.leading.trailing.mas_equalTo(self.userInfoView);
|
||||
make.height.mas_equalTo(110);
|
||||
}];
|
||||
|
||||
|
@@ -298,6 +298,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
[self preLoadGifts];
|
||||
|
||||
[self exitOldRoom];
|
||||
|
||||
[self initSubViews];
|
||||
@@ -316,8 +318,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
|
||||
[self startCheckOnlineCountTimer];
|
||||
|
||||
[self preLoadGifts];
|
||||
|
||||
[CountDownHelper shareHelper].delegate = self;
|
||||
[XPSkillCardPlayerManager shareInstance].isInRoom = YES;
|
||||
}
|
||||
@@ -2411,12 +2411,7 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出
|
||||
}
|
||||
|
||||
#pragma mark - XPFirstRechargeViewDelegate
|
||||
-(void)rechargeHandle{
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
-(void)rechargeHandle{}
|
||||
-(void)contactCustomerService{
|
||||
TTAlertConfig *config = [[TTAlertConfig alloc]init];
|
||||
config.title = YMLocalizedString(@"XPIAPRechargeViewController7");
|
||||
|
@@ -21,10 +21,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (BOOL)versionCompareOldStr:(NSString *)first andNewStr: (NSString *)second;
|
||||
|
||||
///数字转化为万
|
||||
+ (NSString *)getDealNumwithstring:(NSString *)string;
|
||||
+ (NSString *)getDealNumWithString:(NSString *)string;
|
||||
///数字转化为十万
|
||||
+(NSString *)getDealTenNumWithString:(NSString *)string;
|
||||
|
||||
+ (NSString *)formatNumberToKOrM:(NSString *)string;
|
||||
|
||||
///时间戳转化为需要显示的内容
|
||||
+ (NSString *)stringWithTimeStamp:(NSString *)timeStamp;
|
||||
///通过生日获取星座
|
||||
|
@@ -55,7 +55,7 @@
|
||||
return [NSString stringWithFormat:@"%@k", strResult];
|
||||
}
|
||||
///数字转化为万
|
||||
+ (NSString *)getDealNumwithstring:(NSString *)string{
|
||||
+ (NSString *)getDealNumWithString:(NSString *)string{
|
||||
if (string.floatValue < 10000) {
|
||||
return [NSString stringWithFormat:@"%@", string];
|
||||
}
|
||||
@@ -69,6 +69,51 @@
|
||||
return [NSString stringWithFormat:YMLocalizedString(@"NSString_Utils4"), strResult];
|
||||
}
|
||||
|
||||
+ (NSString *)formatNumberToKOrM:(NSString *)string {
|
||||
// 定义数值单位
|
||||
NSDecimalNumber *thousand = [NSDecimalNumber decimalNumberWithString:@"1000"];
|
||||
NSDecimalNumber *nine = [NSDecimalNumber decimalNumberWithString:@"9999"];
|
||||
NSDecimalNumber *million = [NSDecimalNumber decimalNumberWithString:@"1000000"];
|
||||
NSDecimalNumber *billion = [NSDecimalNumber decimalNumberWithString:@"1000000"];
|
||||
|
||||
// 创建 NSDecimalNumber 对象
|
||||
NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:string];
|
||||
|
||||
// 判断数值范围并处理
|
||||
if ([number compare:nine] == NSOrderedAscending) {
|
||||
// 小于 10000,直接返回原始值
|
||||
return [NSString stringWithFormat:@"%@", string];
|
||||
} else if ([number compare:nine] != NSOrderedAscending && [number compare:million] == NSOrderedAscending) {
|
||||
// 10000 到 9999999,用K表示
|
||||
NSDecimalNumber *result = [number decimalNumberByDividingBy:thousand];
|
||||
return [self formatResult:result withUnit:@"K"];//[NSString stringWithFormat:@"%.1fK", result.doubleValue];
|
||||
} else if ([number compare:million] != NSOrderedAscending && [number compare:billion] == NSOrderedAscending) {
|
||||
// 超过 1000000,用M表示
|
||||
NSDecimalNumber *result = [number decimalNumberByDividingBy:million];
|
||||
return [self formatResult:result withUnit:@"M"];//[NSString stringWithFormat:@"%.1fM", result.doubleValue];
|
||||
} else {
|
||||
NSDecimalNumber *result = [number decimalNumberByDividingBy:billion];
|
||||
return [self formatResult:result withUnit:@"M"];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString *)formatResult:(NSDecimalNumber *)result withUnit:(NSString *)unit {
|
||||
// 将 NSDecimalNumber 转为浮点数
|
||||
CGFloat floatValue = result.floatValue;
|
||||
|
||||
// 格式化字符串,保留两位小数
|
||||
NSString *formattedString = [NSString stringWithFormat:@"%.2f", floatValue];
|
||||
|
||||
// 移除多余的 .00 或 .0
|
||||
if ([formattedString hasSuffix:@".00"]) {
|
||||
formattedString = [formattedString substringToIndex:formattedString.length - 3]; // 移除 ".00"
|
||||
} else if ([formattedString hasSuffix:@".0"]) {
|
||||
formattedString = [formattedString substringToIndex:formattedString.length - 2]; // 移除 ".0"
|
||||
}
|
||||
|
||||
return [NSString stringWithFormat:@"%@%@", formattedString, unit];
|
||||
}
|
||||
|
||||
+ (NSString *)stringWithTimeStamp:(NSString *)timeStamp {
|
||||
// 转为秒为单位
|
||||
NSTimeInterval second = timeStamp.longLongValue / 1000;
|
||||
|
@@ -3896,3 +3896,15 @@ ineHeadView12" = "الحمل";
|
||||
"VipCenter_5" = "لم يتم الحصول على VIP%ld";
|
||||
"VipCenter_6" = "مستحق على: %@";
|
||||
"VipCenter_7" = "VIP%ld فقط من خلال النشاط";
|
||||
|
||||
"Combo_0" = "إرسال";
|
||||
"Combo_1" = "جميع الميكروفونات";
|
||||
"Combo_2" = "متعدد اللاعبين";
|
||||
"Combo_3" = "%@ إرسال ";
|
||||
"Combo_4" = "اربح ";
|
||||
"Combo_5" = "ذهب";
|
||||
"Combo_6" = "تهانينا!";
|
||||
"Combo_7" = "أرسل";
|
||||
"Combo_8" = "، وربح عملات معدنية";
|
||||
"Combo_9" = "مرة";
|
||||
"Combo_10" = "هل أنت متأكد أنك تريد الذهاب إلى هذه الغرفة؟";
|
||||
|
@@ -3692,3 +3692,15 @@
|
||||
"VipCenter_5" = "Not obtained VIP%ld";
|
||||
"VipCenter_6" = "Due on: %@";
|
||||
"VipCenter_7" = "VIP%ld is only through activity";
|
||||
|
||||
"Combo_0" = "Send";
|
||||
"Combo_1" = "All mic";
|
||||
"Combo_2" = "Multiplayer";
|
||||
"Combo_3" = "Send %@";
|
||||
"Combo_4" = "Win";
|
||||
"Combo_5" = "Coins";
|
||||
"Combo_6" = "Congratulations!";
|
||||
"Combo_7" = "sent";
|
||||
"Combo_8" = "win coins";
|
||||
"Combo_9" = "times";
|
||||
"Combo_10" = "Are you sure you want to go to this room?";
|
||||
|
@@ -3356,3 +3356,15 @@
|
||||
"VipCenter_5" = "未取得 VIP%ld";
|
||||
"VipCenter_6" = "到期日: %@";
|
||||
"VipCenter_7" = "VIP%ld 僅透過活動獲得";
|
||||
|
||||
"Combo_0" = "送";
|
||||
"Combo_1" = "所有麥";
|
||||
"Combo_2" = "多人";
|
||||
"Combo_3" = "送 %@";
|
||||
"Combo_4" = "贏";
|
||||
"Combo_5" = "金幣";
|
||||
"Combo_6" = "恭喜!";
|
||||
"Combo_7" = "送";
|
||||
"Combo_8" = "贏得金幣";
|
||||
"Combo_9" = "倍";
|
||||
"Combo_10" = "你確定要去這個房間嗎?";
|
||||
|
@@ -3348,3 +3348,16 @@
|
||||
"VipCenter_5" = "未取得 VIP%ld";
|
||||
"VipCenter_6" = "到期日: %@";
|
||||
"VipCenter_7" = "VIP%ld 僅透過活動獲得";
|
||||
|
||||
"Combo_0" = "送";
|
||||
"Combo_1" = "所有麥";
|
||||
"Combo_2" = "多人";
|
||||
"Combo_3" = "送 %@";
|
||||
"Combo_4" = "贏";
|
||||
"Combo_5" = "金幣";
|
||||
"Combo_6" = "恭喜!";
|
||||
"Combo_7" = "送";
|
||||
"Combo_8" = "贏得金幣";
|
||||
"Combo_9" = "倍";
|
||||
"Combo_10" = "你確定要去這個房間嗎?";
|
||||
|
||||
|