夺宝精灵接口对接
@@ -5184,28 +5184,28 @@
|
||||
23E9E9C42A837BE300B792F2 /* Model */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
23E9E9C52A837BE300B792F2 /* TreasureFairyConvertRecordModel.h */,
|
||||
23E9E9C62A837BE300B792F2 /* TreasureFairyInfoModel.h */,
|
||||
23E9E9C72A837BE300B792F2 /* TreasureFairyLimitModel.m */,
|
||||
23E9E9C82A837BE300B792F2 /* TreasureFailyKeyInfoModel.m */,
|
||||
23E9E9C92A837BE300B792F2 /* TreasureFailryMessageModel.h */,
|
||||
23E9E9CA2A837BE300B792F2 /* TreasureFairySendRecordModel.m */,
|
||||
23E9E9CB2A837BE300B792F2 /* TreasureFairyRewardModel.m */,
|
||||
23E9E9CC2A837BE300B792F2 /* TreasureFairyTrialsRecordModel.m */,
|
||||
23E9E9CD2A837BE300B792F2 /* TreasureFairyBallInfoModel.h */,
|
||||
23E9E9CE2A837BE300B792F2 /* TreasureFairyUserInfoModel.m */,
|
||||
23E9E9CF2A837BE300B792F2 /* TreasureFairyFragmentModel.h */,
|
||||
23E9E9D02A837BE300B792F2 /* TreasureFailyKeyInfoModel.h */,
|
||||
23E9E9D12A837BE300B792F2 /* TreasureFairyLimitModel.h */,
|
||||
23E9E9D22A837BE300B792F2 /* TreasureFairyInfoModel.m */,
|
||||
23E9E9D32A837BE300B792F2 /* TreasureFairyConvertRecordModel.m */,
|
||||
23E9E9D42A837BE300B792F2 /* TreasureFailryMessageModel.m */,
|
||||
23E9E9D02A837BE300B792F2 /* TreasureFailyKeyInfoModel.h */,
|
||||
23E9E9C82A837BE300B792F2 /* TreasureFailyKeyInfoModel.m */,
|
||||
23E9E9CD2A837BE300B792F2 /* TreasureFairyBallInfoModel.h */,
|
||||
23E9E9D52A837BE300B792F2 /* TreasureFairyBallInfoModel.m */,
|
||||
23E9E9D62A837BE300B792F2 /* TreasureFairyTrialsRecordModel.h */,
|
||||
23E9E9D72A837BE300B792F2 /* TreasureFairyRewardModel.h */,
|
||||
23E9E9D82A837BE300B792F2 /* TreasureFairySendRecordModel.h */,
|
||||
23E9E9C52A837BE300B792F2 /* TreasureFairyConvertRecordModel.h */,
|
||||
23E9E9D32A837BE300B792F2 /* TreasureFairyConvertRecordModel.m */,
|
||||
23E9E9CF2A837BE300B792F2 /* TreasureFairyFragmentModel.h */,
|
||||
23E9E9D92A837BE300B792F2 /* TreasureFairyFragmentModel.m */,
|
||||
23E9E9C62A837BE300B792F2 /* TreasureFairyInfoModel.h */,
|
||||
23E9E9D22A837BE300B792F2 /* TreasureFairyInfoModel.m */,
|
||||
23E9E9D12A837BE300B792F2 /* TreasureFairyLimitModel.h */,
|
||||
23E9E9C72A837BE300B792F2 /* TreasureFairyLimitModel.m */,
|
||||
23E9E9D72A837BE300B792F2 /* TreasureFairyRewardModel.h */,
|
||||
23E9E9CB2A837BE300B792F2 /* TreasureFairyRewardModel.m */,
|
||||
23E9E9D82A837BE300B792F2 /* TreasureFairySendRecordModel.h */,
|
||||
23E9E9CA2A837BE300B792F2 /* TreasureFairySendRecordModel.m */,
|
||||
23E9E9D62A837BE300B792F2 /* TreasureFairyTrialsRecordModel.h */,
|
||||
23E9E9CC2A837BE300B792F2 /* TreasureFairyTrialsRecordModel.m */,
|
||||
23E9E9DA2A837BE300B792F2 /* TreasureFairyUserInfoModel.h */,
|
||||
23E9E9CE2A837BE300B792F2 /* TreasureFairyUserInfoModel.m */,
|
||||
);
|
||||
path = Model;
|
||||
sourceTree = "<group>";
|
||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 5.1 KiB |
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 9.4 KiB |
22
YuMi/Assets.xcassets/jm/Fairy/room_treasure_fairy_trials_salvage_bg.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_treasure_fairy_trials_salvage_bg@2x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"filename" : "room_treasure_fairy_trials_salvage_bg@3x.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 100 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.6 KiB |
@@ -111,10 +111,12 @@
|
||||
_rankImageView.image = nil;
|
||||
if(_roomInfo.isHourTop1 == YES){
|
||||
_rankImageView.image = kImage(@"home_hour_no_1");
|
||||
}else{
|
||||
if(_roomInfo.isWeekTop1 == YES){
|
||||
_rankImageView.image = kImage(@"home_week_no_1");
|
||||
}
|
||||
}
|
||||
if(_roomInfo.isWeekTop1 == YES){
|
||||
_rankImageView.image = kImage(@"home_week_no_1");
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < 5; i++) {
|
||||
NetImageView *iconView = [self.bgImageView viewWithTag:100 + i];
|
||||
|
@@ -392,9 +392,15 @@ UIKIT_EXTERN NSString * const kShieldingNotification;
|
||||
///播放音乐
|
||||
-(void)xPNewHomePartyTableViewCell:(XPNewHomePartyTableViewCell *_Nullable)cell didPlayVoice:(HomePlayRoomModel *_Nonnull)roomModel didClickPlaySound:(BOOL)isPlay{
|
||||
if(isPlay == YES){
|
||||
if(self.cell != nil){
|
||||
[self.countDownHelper stopCountDown];
|
||||
[self.cell setPlaySoundStatus:NO];
|
||||
[[XPSkillCardPlayerManager shareInstance] stopMusic];
|
||||
self.cell = nil;
|
||||
}
|
||||
self.cell = cell;
|
||||
CGRect cellRect = [self.tableView rectForRowAtIndexPath:[self.tableView indexPathForCell:self.cell]];
|
||||
self.cellY = cellRect.origin.y;
|
||||
self.cellY = cellRect.origin.y + cellRect.size.height;
|
||||
NSString *fileName = [[roomModel.userVoice componentsSeparatedByString:@"/"] lastObject];
|
||||
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) safeObjectAtIndex1:0] stringByAppendingPathComponent:@"kMineSoundCard"];
|
||||
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
|
||||
|
@@ -102,7 +102,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 兑换-精灵
|
||||
/// - Parameter completion: 完成
|
||||
/// - Parameter itemId: id
|
||||
+ (void)treasureFailyConvert:(HttpRequestHelperCompletion)completion itemId:(NSString *)itemId roomUid:(NSString *)roomUid;
|
||||
+ (void)treasureFailyConvert:(HttpRequestHelperCompletion)completion itemId:(NSString *)itemId roomUid:(NSString *)roomUid propIdStr:(NSString *)propIdStr propNumStr:(NSString *)propNumStr;
|
||||
|
||||
/// 兑换-碎片兑换列表
|
||||
/// - Parameter completion: 完成
|
||||
@@ -123,6 +123,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// - num: 数量
|
||||
/// - uid: 用户id
|
||||
+(void)buyElfShard:(HttpRequestHelperCompletion)completion num:(NSString *)num uid:(NSString *)uid;
|
||||
/// 精灵分解
|
||||
/// - Parameter completion: 完成
|
||||
/// - Parameter salvageReq: 分解的精灵
|
||||
+ (void)treasureFailySalvageall:(HttpRequestHelperCompletion)completion salvageReq:(NSArray *)salvageReq;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -119,7 +119,14 @@
|
||||
[dic safeSetObject:compoundReqs forKey:@"expendList"];
|
||||
[HttpRequestHelper postSkillCard:@"act/seize-treasure/elf/compound" params:dic.toJSONString completion:completion];
|
||||
}
|
||||
|
||||
/// 精灵分解
|
||||
/// - Parameter completion: 完成
|
||||
/// - Parameter salvageReq: 分解的精灵
|
||||
+ (void)treasureFailySalvageall:(HttpRequestHelperCompletion)completion salvageReq:(NSArray *)salvageReq {
|
||||
NSMutableDictionary * dic = [NSMutableDictionary dictionary];
|
||||
[dic safeSetObject:salvageReq forKey:@"expendList"];
|
||||
[HttpRequestHelper postSkillCard:@"act/seize-treasure/elf/salvage" params:dic.toJSONString completion:completion];
|
||||
}
|
||||
/// 精灵试炼记录
|
||||
/// - Parameter completion: 完成
|
||||
/// - Parameter page: 页数
|
||||
@@ -139,7 +146,11 @@
|
||||
/// 兑换-精灵
|
||||
/// - Parameter completion: 完成
|
||||
/// - Parameter itemId: id
|
||||
+ (void)treasureFailyConvert:(HttpRequestHelperCompletion)completion itemId:(NSString *)itemId roomUid:(nonnull NSString *)roomUid {
|
||||
+ (void)treasureFailyConvert:(HttpRequestHelperCompletion)completion itemId:(NSString *)itemId roomUid:(nonnull NSString *)roomUid propIdStr:(NSString *)propIdStr propNumStr:(NSString *)propNumStr {
|
||||
if(propIdStr.length > 0){
|
||||
[self makeRequest:@"act/seize-treasure/convert" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, itemId, roomUid,propIdStr,propNumStr,nil];
|
||||
return;
|
||||
}
|
||||
[self makeRequest:@"act/seize-treasure/convert" method:HttpRequestHelperMethodPOST completion:completion,__FUNCTION__, itemId, roomUid,nil];
|
||||
}
|
||||
|
||||
|
@@ -45,6 +45,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
///赠送的人的uid
|
||||
@property (nonatomic,assign) NSInteger uid;
|
||||
|
||||
|
||||
@property(nonatomic,assign) BOOL isHigh;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -34,6 +34,20 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// 兑换类型
|
||||
@property (nonatomic, assign) NSInteger type;
|
||||
|
||||
@end
|
||||
@property(nonatomic,copy) NSArray *propItems;
|
||||
|
||||
@end
|
||||
@interface TreasureFairyFragmentItemModel : NSObject
|
||||
|
||||
|
||||
@property (nonatomic, copy) NSString *picUrl;
|
||||
|
||||
@property (nonatomic, copy) NSString *propId;
|
||||
|
||||
@property (nonatomic, copy) NSString *propName;
|
||||
|
||||
@property (nonatomic, copy) NSString *propNum;
|
||||
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -8,5 +8,13 @@
|
||||
#import "TreasureFairyFragmentModel.h"
|
||||
|
||||
@implementation TreasureFairyFragmentModel
|
||||
+ (NSDictionary *)objectClassInArray{
|
||||
return @{@"propItems":TreasureFairyFragmentItemModel.class};
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation TreasureFairyFragmentItemModel
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
@@ -24,7 +24,9 @@ typedef NS_ENUM(NSInteger, TreasureFairyPropType) {
|
||||
///精灵球
|
||||
TreasureFairyPropType_Ball = 2,
|
||||
///精灵
|
||||
TreasureFairyPropType_Fairy = 3
|
||||
TreasureFairyPropType_Fairy = 3,
|
||||
///分解获得碎片
|
||||
TreasureFairyPropType_Salvage = 4,
|
||||
};
|
||||
|
||||
@interface TreasureFairyInfoModel : NSObject
|
||||
|
@@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
@interface XPTreasureFairyNewSummonPriceView : UIView
|
||||
|
||||
@property(nonatomic,copy) NSString *imageIcon;
|
||||
@property(nonatomic,copy) NSString *text;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
@@ -80,10 +80,7 @@
|
||||
make.height.mas_equalTo(34);
|
||||
make.width.mas_equalTo(124);
|
||||
}];
|
||||
self.stackView.backgroundColor = [UIColor whiteColor];
|
||||
self.firstPieceView.backgroundColor = [UIColor redColor];
|
||||
self.secondPieceView.backgroundColor = [UIColor redColor];
|
||||
self.thirdPieceView.backgroundColor = [UIColor redColor];
|
||||
|
||||
[self.firstPieceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(40);
|
||||
make.height.mas_equalTo(34);
|
||||
@@ -137,6 +134,19 @@
|
||||
});
|
||||
}];
|
||||
// self.pieceCountLabel.text = [NSString stringWithFormat:@"%ld",fragmemtModel.expendNum];
|
||||
|
||||
NSArray *pieceViewList = @[_firstPieceView,_secondPieceView,_thirdPieceView];
|
||||
for (int i = 0 ; i < pieceViewList.count; i++) {
|
||||
XPTreasureFairyNewSummonPriceView *priceView = pieceViewList[i];
|
||||
if(i < _fragmemtModel.propItems.count){
|
||||
priceView.hidden = NO;
|
||||
TreasureFairyFragmentItemModel *itemModel = _fragmemtModel.propItems[i];
|
||||
priceView.imageIcon = itemModel.picUrl;
|
||||
priceView.text = [NSString stringWithFormat:@"%@x%@",itemModel.propName,itemModel.propNum];
|
||||
}else{
|
||||
priceView.hidden = YES;
|
||||
}
|
||||
}
|
||||
[self.exchangeButton setTitle:YMLocalizedString(@"XPTreasureFairyShopingExchangeCell1") forState:UIControlStateNormal];
|
||||
}
|
||||
|
||||
@@ -197,18 +207,24 @@
|
||||
- (XPTreasureFairyNewSummonPriceView *)firstPieceView{
|
||||
if(!_firstPieceView){
|
||||
_firstPieceView = [[XPTreasureFairyNewSummonPriceView alloc]initWithFrame:CGRectZero];
|
||||
_firstPieceView.hidden = YES;
|
||||
_firstPieceView.tag = 101;
|
||||
}
|
||||
return _firstPieceView;
|
||||
}
|
||||
- (XPTreasureFairyNewSummonPriceView *)secondPieceView{
|
||||
if(!_secondPieceView){
|
||||
_secondPieceView = [[XPTreasureFairyNewSummonPriceView alloc]initWithFrame:CGRectZero];
|
||||
_secondPieceView.hidden = YES;
|
||||
_secondPieceView.tag = 102;
|
||||
}
|
||||
return _secondPieceView;
|
||||
}
|
||||
- (XPTreasureFairyNewSummonPriceView *)thirdPieceView{
|
||||
if(!_thirdPieceView){
|
||||
_thirdPieceView = [[XPTreasureFairyNewSummonPriceView alloc]initWithFrame:CGRectZero];
|
||||
_thirdPieceView.hidden = YES;
|
||||
_thirdPieceView.tag = 103;
|
||||
}
|
||||
return _thirdPieceView;
|
||||
}
|
||||
@@ -262,6 +278,14 @@
|
||||
make.height.mas_equalTo(8);
|
||||
}];
|
||||
}
|
||||
-(void)setImageIcon:(NSString *)imageIcon{
|
||||
_imageIcon = imageIcon;
|
||||
_iconView.imageUrl = _imageIcon;
|
||||
}
|
||||
-(void)setText:(NSString *)text{
|
||||
_text = text;
|
||||
_priceView.text = _text;
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NetImageView *)iconView{
|
||||
if(!_iconView){
|
||||
@@ -274,6 +298,7 @@
|
||||
- (UILabel *)priceView{
|
||||
if(!_priceView){
|
||||
_priceView = [UILabel labelInitWithText:@"" font:[UIFont systemFontOfSize:8 weight:UIFontWeightRegular] textColor:[UIColor whiteColor]];
|
||||
_priceView.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
return _priceView;
|
||||
}
|
||||
|
@@ -63,7 +63,12 @@
|
||||
#pragma mark - Getters And Setters
|
||||
- (void)setPrizeInfo:(TreasureFairyInfoModel *)prizeInfo {
|
||||
_prizeInfo = prizeInfo;
|
||||
if (_prizeInfo) {
|
||||
if (_prizeInfo) {
|
||||
if(_prizeInfo.propType == TreasureFairyPropType_Salvage){
|
||||
self.giftImageView.image = kImage(@"room_treasure_fairy_buy_elf_icon");
|
||||
self.nameLabel.text =[NSString stringWithFormat:@"x%ld", _prizeInfo.rewardNum];
|
||||
return;
|
||||
}
|
||||
self.giftImageView.imageUrl = prizeInfo.rewardPicUrl;
|
||||
self.nameLabel.text =[NSString stringWithFormat:@"%@x%ld", _prizeInfo.rewardName, _prizeInfo.rewardNum];
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@end
|
||||
|
||||
@interface PITreasureFairyBuyElfShardInputNumView : UIView
|
||||
@property(nonatomic,copy) NSString *text;
|
||||
@property(nonatomic,weak) id<PITreasureFairyBuyElfShardInputNumViewDelegate>delegate;
|
||||
///精灵碎片数量
|
||||
@property(nonatomic,copy) NSString *shardNum;
|
||||
|
@@ -15,6 +15,7 @@
|
||||
@property(nonatomic,strong) UIView *bgView;
|
||||
///输入框
|
||||
@property(nonatomic,strong) UITextField *textFiled;
|
||||
@property(nonatomic,assign) NSInteger count;
|
||||
@end
|
||||
@implementation PITreasureFairyBuyElfShardInputNumView
|
||||
|
||||
@@ -27,8 +28,9 @@
|
||||
return self;
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.subtractBtn];
|
||||
[self addSubview:self.bgView];
|
||||
[self addSubview:self.subtractBtn];
|
||||
|
||||
[self addSubview:self.addBtn];
|
||||
|
||||
[self.bgView addSubview:self.textFiled];
|
||||
@@ -37,7 +39,7 @@
|
||||
[self.subtractBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.width.mas_equalTo(51);
|
||||
make.height.mas_equalTo(29);
|
||||
make.left.top.equalTo(self);
|
||||
make.leading.top.equalTo(self);
|
||||
}];
|
||||
[self.addBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.trailing.top.equalTo(self);
|
||||
@@ -49,8 +51,8 @@
|
||||
make.bottom.top.equalTo(self);
|
||||
}];
|
||||
[self.textFiled mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.leading.equalTo(self.subtractBtn.mas_trailing);
|
||||
make.trailing.equalTo(self.addBtn.mas_leading);
|
||||
make.leading.mas_equalTo(51);
|
||||
make.trailing.mas_equalTo(-51);
|
||||
make.bottom.top.equalTo(self);
|
||||
}];
|
||||
|
||||
@@ -96,14 +98,16 @@
|
||||
return res;
|
||||
}
|
||||
-(void)addBtnAction{
|
||||
NSInteger num = self.textFiled.text.integerValue + 10;
|
||||
NSInteger num = self.count + 10;
|
||||
self.count = num;
|
||||
self.textFiled.text = @(num).stringValue;
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(inputShardNum:)]){
|
||||
[self.delegate inputShardNum:self.textFiled.text];
|
||||
}
|
||||
}
|
||||
-(void)subtractAction{
|
||||
NSInteger num = self.textFiled.text.integerValue - 10;
|
||||
NSInteger num = self.count - 10;
|
||||
self.count = num;
|
||||
if(num <= 1){
|
||||
num = 1;
|
||||
}
|
||||
@@ -113,6 +117,9 @@
|
||||
}
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
- (NSString *)text{
|
||||
return self.textFiled.text;
|
||||
}
|
||||
- (UIView *)bgView{
|
||||
if(!_bgView){
|
||||
_bgView = [UIView new];
|
||||
|
@@ -33,7 +33,9 @@
|
||||
@property(nonatomic,assign) int type;
|
||||
@end
|
||||
@implementation PITreasureFairyBuyElfShardView
|
||||
|
||||
-(void)dealloc{
|
||||
[[NSNotificationCenter defaultCenter]removeObserver:self];
|
||||
}
|
||||
-(instancetype)initWithFrame:(CGRect)frame type:(int)type{
|
||||
self = [super initWithFrame:frame];
|
||||
if(self){
|
||||
@@ -44,10 +46,45 @@
|
||||
}else{
|
||||
[self installUIWithBuy];
|
||||
[self installConstraintsWithBuy];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHidden:) name:UIKeyboardWillHideNotification object:nil];
|
||||
}
|
||||
|
||||
}
|
||||
return self;
|
||||
}
|
||||
- (void)keyboardWillShow:(NSNotification *)notification {
|
||||
|
||||
CGRect keyboardRect = [[[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
|
||||
CGFloat time = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
|
||||
|
||||
CGFloat height = KScreenHeight - keyboardRect.size.height - 315;
|
||||
|
||||
[UIView animateWithDuration:time animations:^{
|
||||
CGRect rect = self.bgImageView.frame;
|
||||
rect.origin.y = height;
|
||||
self.bgImageView.frame = rect;
|
||||
CGRect titleRect = self.titleView.frame;
|
||||
titleRect.origin.y = height;
|
||||
self.titleView.frame = titleRect;
|
||||
|
||||
}];
|
||||
|
||||
}
|
||||
|
||||
//键盘隐藏
|
||||
- (void)keyboardWillHidden:(NSNotification *)notification {
|
||||
CGFloat time = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue];
|
||||
[UIView animateWithDuration:time animations:^{
|
||||
CGRect rect = self.bgImageView.frame;
|
||||
rect.origin.y = (KScreenHeight - 315)/2;
|
||||
self.bgImageView.frame = rect;
|
||||
CGRect titleRect = self.titleView.frame;
|
||||
titleRect.origin.y = (KScreenHeight - 315)/2;
|
||||
self.titleView.frame = titleRect;
|
||||
}];
|
||||
|
||||
|
||||
}
|
||||
-(void)installUI{
|
||||
[self addSubview:self.closeView];
|
||||
@@ -131,8 +168,8 @@
|
||||
make.edges.equalTo(self);
|
||||
}];
|
||||
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.height.mas_equalTo(258);
|
||||
make.width.mas_equalTo(315);
|
||||
make.height.mas_equalTo(315);
|
||||
make.width.mas_equalTo(258);
|
||||
make.center.equalTo(self);
|
||||
}];
|
||||
[self.titleView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
|
@@ -6,7 +6,7 @@
|
||||
//
|
||||
|
||||
#import "XPTreasureFairyBottomView.h"
|
||||
@interface XPTreasureFairyBottomView()
|
||||
@interface XPTreasureFairyBottomView()<UITextFieldDelegate>
|
||||
///背景图片
|
||||
@property(nonatomic,strong) UIImageView *bgImageView;
|
||||
///背景
|
||||
@@ -126,6 +126,38 @@
|
||||
-(void)textFieldDidChange:(UITextField *)textField{
|
||||
self.chooseNum = textField.text;
|
||||
}
|
||||
#pragma mark -UITextFieldDelegate
|
||||
- (void)textFieldDidChanged:(UITextField *)textField {
|
||||
if(textField.text.integerValue <= 1){
|
||||
textField.text = @"1";
|
||||
}
|
||||
self.chooseNum = textField.text;
|
||||
}
|
||||
- (void)textFieldDidEndEditing:(UITextField *)textField{
|
||||
if(textField.text.length <= 1){
|
||||
textField.text = @"1";
|
||||
}
|
||||
self.chooseNum = textField.text;
|
||||
}
|
||||
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
|
||||
return [self validateNumber:string];
|
||||
}
|
||||
|
||||
- (BOOL)validateNumber:(NSString*)number {
|
||||
BOOL res = YES;
|
||||
NSCharacterSet* tmpSet = [NSCharacterSet characterSetWithCharactersInString:@"0123456789"];
|
||||
int i = 0;
|
||||
while (i < number.length) {
|
||||
NSString * string = [number substringWithRange:NSMakeRange(i, 1)];
|
||||
NSRange range = [string rangeOfCharacterFromSet:tmpSet];
|
||||
if (range.length == 0) {
|
||||
res = NO;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
-(void)bugAction{
|
||||
if(self.self.chooseNum.length ==0){
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:YMLocalizedString(@"XPTreasureFairyBottomView2")];
|
||||
@@ -257,6 +289,7 @@
|
||||
_textField.textColor = UIColorFromRGB(0xF6F6F6);
|
||||
_textField.keyboardType = UIKeyboardTypeNumberPad;
|
||||
_textField.textAlignment = NSTextAlignmentCenter;
|
||||
_textField.delegate = self;
|
||||
_textField.backgroundColor = [UIColor clearColor];
|
||||
[_textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
|
||||
}
|
||||
|
@@ -188,7 +188,7 @@
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} itemId:[NSString stringWithFormat:@"%ld", fragmentModel.itemId] roomUid:self.roomUid];
|
||||
} itemId:[NSString stringWithFormat:@"%ld", fragmentModel.itemId] roomUid:self.roomUid propIdStr:@"" propNumStr:@""];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#import "XPTreasureFairyNewSummonCell.h"
|
||||
#import "Api+TreasureFairy.h"
|
||||
#import "TreasureFairyBallInfoModel.h"
|
||||
#import "XPTreasureFairyStoreResultSmallView.h"
|
||||
@interface XPTreasureFairyNewSummonView()<UICollectionViewDelegate, UICollectionViewDataSource,XPTreasureFairyNewSummonCellDelegate>
|
||||
///列表
|
||||
@property (nonatomic,strong) UICollectionView *collectionView;
|
||||
@@ -94,7 +95,7 @@
|
||||
|
||||
- (void)getFragmentExchangeList {
|
||||
// 兑换列表
|
||||
[Api treasureFailyFragmentExchangeList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
[Api treasureFailyConvertElfList:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
NSArray * fragmentList = [TreasureFairyFragmentModel modelsWithArray:data.data];
|
||||
[self.fragmentArray removeAllObjects];
|
||||
@@ -136,7 +137,58 @@
|
||||
}
|
||||
/// 兑换事件
|
||||
- (void)treasureFairyShopingExchangeAction:(TreasureFairyFragmentModel *)fragmentModel{
|
||||
|
||||
if (fragmentModel.itemId > 0) {
|
||||
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
||||
config.title = @"";
|
||||
NSString * untils;
|
||||
if ([fragmentModel.rewardType isEqualToString:@"gift"]) {
|
||||
untils = [NSString stringWithFormat:@"%@%@", fragmentModel.rewardShowValue, YMLocalizedString(@"XPTreasureFairyExchangeView0")];
|
||||
|
||||
} else {
|
||||
untils = [NSString stringWithFormat:@"%ld%@", fragmentModel.rewardNum, fragmentModel.rewardUnit];
|
||||
}
|
||||
config.title = YMLocalizedString(@"XPTreasureFairyExchangeView1");
|
||||
config.confirmButtonConfig.title = YMLocalizedString(@"XPTreasureFairyExchangeView2");
|
||||
config.message = [NSString stringWithFormat:YMLocalizedString(@"XPTreasureFairyExchangeView3"), fragmentModel.rewardName, untils];
|
||||
[TTPopup alertWithConfig:config confirmHandler:^{
|
||||
|
||||
NSString *propIdStr = @"";
|
||||
NSString *propNumStr = @"";
|
||||
for (TreasureFairyFragmentItemModel *itemModel in fragmentModel.propItems) {
|
||||
if(propIdStr.length == 0){
|
||||
propIdStr = itemModel.propId;
|
||||
}else{
|
||||
propIdStr = [NSString stringWithFormat:@"%@,%@",propIdStr,itemModel.propId];
|
||||
}
|
||||
if(propNumStr.length == 0){
|
||||
propNumStr = itemModel.propNum;
|
||||
}else{
|
||||
propNumStr = [NSString stringWithFormat:@"%@,%@",propNumStr,itemModel.propNum];
|
||||
}
|
||||
}
|
||||
if(propIdStr.length == 0)return;
|
||||
[Api treasureFailyConvert:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
if (code == 200) {
|
||||
[XNDJTDDLoadingTool showSuccessWithMessage:YMLocalizedString(@"XPTreasureFairyExchangeView4")];
|
||||
///刷新我的碎片
|
||||
[self getMyBallList];
|
||||
TreasureFairyInfoModel * info = [TreasureFairyInfoModel modelWithDictionary:data.data];
|
||||
XPTreasureFairyStoreResultSmallView * smallView = [[XPTreasureFairyStoreResultSmallView alloc] init];
|
||||
smallView.datasource = @[info];
|
||||
smallView.titleLabel.text = YMLocalizedString(@"XPTreasureFairySummonView0");
|
||||
[TTPopup popupView:smallView style:TTPopupStyleActionSheet];
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} itemId:[NSString stringWithFormat:@"%ld", fragmentModel.itemId] roomUid:self.roomUid propIdStr:propIdStr propNumStr:propNumStr];
|
||||
} cancelHandler:^{
|
||||
|
||||
}];
|
||||
}
|
||||
}
|
||||
#pragma mark - 懒加载
|
||||
|
||||
@@ -144,11 +196,9 @@
|
||||
if (!_collectionView) {
|
||||
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
|
||||
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
|
||||
CGFloat scale = 242.0/169.0;
|
||||
CGFloat space = 15.0;
|
||||
CGFloat itemWidth = (KScreenWidth - space*3)/2;
|
||||
CGFloat itemHeight = scale*itemWidth;
|
||||
// layout.itemSize = CGSizeMake(itemWidth, itemHeight);
|
||||
|
||||
CGFloat space = (KScreenWidth - 169.0 * 2)/3 - 1;
|
||||
|
||||
layout.itemSize = CGSizeMake(169.0, 242.0);
|
||||
layout.minimumInteritemSpacing = space;
|
||||
layout.minimumLineSpacing = space;
|
||||
|
@@ -33,7 +33,7 @@
|
||||
@property (nonatomic,strong) UIButton *exchangeButton;
|
||||
///记录
|
||||
@property (nonatomic,strong) UIButton *recordButton;
|
||||
///合成
|
||||
///召唤
|
||||
@property (nonatomic,strong) XPTreasureFairyNewSummonView *summonView;
|
||||
///兑换
|
||||
@property (nonatomic,strong) XPTreasureFairyExchangeView *exchangeView;
|
||||
|
@@ -107,7 +107,9 @@
|
||||
TreasureFairyInfoModel * info = [_datasource safeObjectAtIndex1:0];
|
||||
if (info.propType == TreasureFairyPropType_Piece) {
|
||||
self.titleLabel.text = YMLocalizedString(@"XPTreasureFairyStoreResultSmallView1");
|
||||
} else {
|
||||
}else if(info.propType == TreasureFairyPropType_Salvage){
|
||||
self.titleLabel.text = YMLocalizedString(@"XPTreasureFairyStoreResultSmallView5");
|
||||
}else {
|
||||
self.titleLabel.text = YMLocalizedString(@"XPTreasureFairyStoreResultSmallView2");
|
||||
}
|
||||
self.oneGiftView.prizeInfo = info;
|
||||
|
@@ -248,7 +248,7 @@
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} itemId:[NSString stringWithFormat:@"%ld", self.rewardInfo.itemId] roomUid:self.roomUid];
|
||||
} itemId:[NSString stringWithFormat:@"%ld", self.rewardInfo.itemId] roomUid:self.roomUid propIdStr:@"" propNumStr:@""];
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -61,9 +61,9 @@
|
||||
}];
|
||||
|
||||
[self.ballImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.backImageView).offset(4);
|
||||
make.left.right.mas_equalTo(self.backImageView).inset(10);
|
||||
make.bottom.mas_equalTo(self.bottomView.mas_top).offset(-3);
|
||||
make.top.mas_equalTo(self.backImageView).offset(1);
|
||||
make.left.right.mas_equalTo(self.backImageView).inset(6);
|
||||
make.bottom.mas_equalTo(self.bottomView.mas_top);
|
||||
}];
|
||||
|
||||
[self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
@@ -73,12 +73,14 @@
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.bottomView);
|
||||
make.bottom.mas_equalTo(self.bottomView.mas_centerY).offset(-0.5);
|
||||
make.height.mas_equalTo(11);
|
||||
make.bottom.mas_equalTo(self.bottomView.mas_bottom).offset(-16);
|
||||
}];
|
||||
|
||||
[self.countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.right.mas_equalTo(self.bottomView);
|
||||
make.top.mas_equalTo(self.bottomView.mas_centerY).offset(0.5);
|
||||
make.height.mas_equalTo(11);
|
||||
make.bottom.mas_equalTo(self.bottomView.mas_bottom).offset(-4);
|
||||
}];
|
||||
}
|
||||
#pragma mark - Getters And Setters
|
||||
@@ -131,7 +133,7 @@
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [[UILabel alloc] init];
|
||||
_nameLabel.font = [UIFont systemFontOfSize:11];
|
||||
_nameLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular];
|
||||
_nameLabel.textColor = [DJDKMIMOMColor colorWithHexString:@"#1F5764"];
|
||||
_nameLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
@@ -141,7 +143,7 @@
|
||||
- (UILabel *)countLabel {
|
||||
if (!_countLabel) {
|
||||
_countLabel = [[UILabel alloc] init];
|
||||
_countLabel.font = [UIFont systemFontOfSize:11];
|
||||
_countLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightRegular];
|
||||
_countLabel.textColor = [UIColor whiteColor];
|
||||
_countLabel.textAlignment = NSTextAlignmentCenter;
|
||||
}
|
||||
|
@@ -35,6 +35,16 @@
|
||||
@property (nonatomic,strong) VAPView *trialsView;
|
||||
///一个试炼
|
||||
@property (nonatomic,strong) NetImageView *oneBallView;
|
||||
///二个试炼
|
||||
@property (nonatomic,strong) NetImageView *twoBallView;
|
||||
///三个试炼
|
||||
@property (nonatomic,strong) NetImageView *threeBallView;
|
||||
///四个试炼
|
||||
@property (nonatomic,strong) NetImageView *fourBallView;
|
||||
///五个试炼
|
||||
@property (nonatomic,strong) NetImageView *fiveBallView;
|
||||
|
||||
|
||||
|
||||
///试炼
|
||||
@property (nonatomic,strong) UIButton *trialsButton;
|
||||
@@ -48,12 +58,19 @@
|
||||
@property (nonatomic,strong) UIImageView *ballBackView;
|
||||
///分解精灵提示
|
||||
@property(nonatomic,strong) UILabel *salvageTips;
|
||||
@property(nonatomic,strong) UIStackView *stackView;
|
||||
///第一个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *firstView;
|
||||
///第二个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *secondView;
|
||||
///第三个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *thirdView;
|
||||
///第四个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *fourthView;
|
||||
///第五个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *fifthView;
|
||||
///第六个
|
||||
@property (nonatomic,strong) XPTreasureFairyTrialsBallView *sixthView;
|
||||
///我的精灵球
|
||||
@property (nonatomic,strong) NSArray *viewList;
|
||||
///球的列表
|
||||
@@ -86,17 +103,22 @@
|
||||
[self addSubview:self.fastButton];
|
||||
[self addSubview:self.againButton];
|
||||
|
||||
|
||||
[self.ballBackView addSubview:self.firstView];
|
||||
[self.ballBackView addSubview:self.secondView];
|
||||
[self.ballBackView addSubview:self.thirdView];
|
||||
|
||||
[self.ballBackView addSubview:self.stackView];
|
||||
[self.stackView addArrangedSubview:self.firstView];
|
||||
[self.stackView addArrangedSubview:self.secondView];
|
||||
[self.stackView addArrangedSubview:self.thirdView];
|
||||
[self.stackView addArrangedSubview:self.fourthView];
|
||||
[self.stackView addArrangedSubview:self.fifthView];
|
||||
[self.stackView addArrangedSubview:self.sixthView];
|
||||
|
||||
[self.trialsBgImageView addSubview:self.oneBallView];
|
||||
|
||||
[self.trialsBgImageView addSubview:self.twoBallView];
|
||||
[self.trialsBgImageView addSubview:self.threeBallView];
|
||||
[self.trialsBgImageView addSubview:self.fourBallView];
|
||||
[self.trialsBgImageView addSubview:self.fiveBallView];
|
||||
[self.trialsBgImageView addSubview:self.salvageTips];
|
||||
self.viewList = @[self.firstView, self.secondView, self.thirdView];
|
||||
self.ballViewList = @[self.oneBallView];
|
||||
|
||||
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
@@ -114,12 +136,24 @@
|
||||
|
||||
[self.oneBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.centerX.equalTo(self.trialsBgImageView);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(149);
|
||||
make.leading.mas_equalTo(11);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(29);
|
||||
}];
|
||||
|
||||
|
||||
|
||||
[self.twoBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.leading.mas_equalTo(33);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(140);
|
||||
}];
|
||||
[self.fourBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.trailing.mas_equalTo(-11);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(29);
|
||||
}];
|
||||
[self.fiveBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.trailing.mas_equalTo(-25);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(140);
|
||||
}];
|
||||
[self.trialsButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(142, 40));
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
@@ -150,24 +184,31 @@
|
||||
make.height.mas_equalTo(KScreenWidth * (136.0 / 375.0));
|
||||
}];
|
||||
|
||||
CGFloat kPadding = (KScreenWidth - 66 *kScreenScale * 5 - 30) / 4.0;
|
||||
|
||||
|
||||
[self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.equalTo(self.ballBackView);
|
||||
make.top.mas_equalTo(self.ballBackView).offset(26 * kScreenScale);
|
||||
make.size.mas_equalTo(CGSizeMake(66 * kScreenScale, 78 * kScreenScale));
|
||||
}];
|
||||
|
||||
|
||||
[self.firstView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.secondView);
|
||||
make.right.equalTo(self.secondView.mas_left).mas_offset(-20);
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
|
||||
}];
|
||||
[self.thirdView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.centerY.mas_equalTo(self.firstView);
|
||||
make.left.mas_equalTo(self.secondView.mas_right).offset(20);
|
||||
[self.secondView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
}];
|
||||
|
||||
|
||||
[self.thirdView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
}];
|
||||
[self.fourthView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
|
||||
}];
|
||||
[self.fifthView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
}];
|
||||
|
||||
[self.sixthView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(57, 78));
|
||||
}];
|
||||
|
||||
[self.salvageTips mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.bottom.mas_offset(0);
|
||||
@@ -205,52 +246,21 @@
|
||||
}
|
||||
NSInteger compoundLevel = self.isHigh ? 2 : 1;
|
||||
sender.userInteractionEnabled = NO;
|
||||
if(self.isHigh == NO){
|
||||
[Api treasureFailySalvageall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
sender.userInteractionEnabled = YES;
|
||||
if (code == 200) {
|
||||
[self dealWithData:data];
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
} salvageReq:array];
|
||||
return;
|
||||
}
|
||||
[Api treasureFailyCompoundBall:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
||||
sender.userInteractionEnabled = YES;
|
||||
if (code == 200) {
|
||||
NSString * animtionName = @"https://image.hfighting.com/treasure_fairy_trials_middle.mp4";
|
||||
if (self.isHigh) {
|
||||
animtionName = @"https://image.hfighting.com/treasure_fairy_trials_high.mp4";
|
||||
}
|
||||
if (!self.trialsView.superview) {
|
||||
[self.trialsBgImageView insertSubview:self.trialsView atIndex:0];
|
||||
[self.trialsView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.trialsBgImageView);
|
||||
}];
|
||||
}
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:animtionName];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
|
||||
}else{
|
||||
[self.vapParser parseWithURL:filePath completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.9 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
///重置数据
|
||||
[self.ballList removeAllObjects];
|
||||
self.originBallList = nil;
|
||||
for (NetImageView * imageView in self.ballViewList) {
|
||||
imageView.image = nil;
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(treasureFairyTrialsSuccess)]) {
|
||||
[self.delegate treasureFairyTrialsSuccess];
|
||||
}
|
||||
TreasureFairyBallModel * model = [TreasureFairyBallModel modelWithDictionary:data.data];
|
||||
XPTreasureFairyStoreResultSmallView * smallView = [[XPTreasureFairyStoreResultSmallView alloc] init];
|
||||
smallView.isTrialsResult = YES;
|
||||
smallView.datasource = @[model];
|
||||
[TTPopup popupView:smallView style:TTPopupStyleActionSheet];
|
||||
});
|
||||
[self dealWithData:data];
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
@@ -261,7 +271,65 @@
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(void)dealWithData:(BaseModel * _Nullable)data{
|
||||
NSString * animtionName = @"https://image.hfighting.com/treasure_fairy_trials_middle.mp4";
|
||||
if (self.isHigh) {
|
||||
animtionName = @"https://image.hfighting.com/treasure_fairy_trials_high.mp4";
|
||||
}
|
||||
if (!self.trialsView.superview) {
|
||||
[self.trialsBgImageView insertSubview:self.trialsView atIndex:0];
|
||||
[self.trialsView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.edges.mas_equalTo(self.trialsBgImageView);
|
||||
}];
|
||||
}
|
||||
NSString *baseFileName = @"/GiftMp4";
|
||||
NSString *filePath = [[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:baseFileName] stringByAppendingPathComponent:animtionName];
|
||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||
if ([fileManager fileExistsAtPath:filePath]){
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:filePath repeatCount:1 delegate:self];
|
||||
|
||||
}else{
|
||||
[self.vapParser parseWithURL:filePath completionBlock:^(NSString * _Nullable videoUrl) {
|
||||
if (videoUrl.length) {
|
||||
[self.trialsView setMute:YES];
|
||||
[self.trialsView playHWDMP4:videoUrl repeatCount:1 delegate:self];
|
||||
}
|
||||
} failureBlock:^(NSError * _Nullable error) {
|
||||
|
||||
}];
|
||||
}
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.9 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
///重置数据
|
||||
[self.ballList removeAllObjects];
|
||||
self.originBallList = nil;
|
||||
for (NetImageView * imageView in self.ballViewList) {
|
||||
imageView.image = nil;
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(treasureFairyTrialsSuccess)]) {
|
||||
[self.delegate treasureFairyTrialsSuccess];
|
||||
}
|
||||
if(self.isHigh == YES){
|
||||
TreasureFairyBallModel * model = [TreasureFairyBallModel modelWithDictionary:data.data];
|
||||
XPTreasureFairyStoreResultSmallView * smallView = [[XPTreasureFairyStoreResultSmallView alloc] init];
|
||||
smallView.isTrialsResult = YES;
|
||||
smallView.datasource = @[model];
|
||||
[TTPopup popupView:smallView style:TTPopupStyleActionSheet];
|
||||
return;
|
||||
}
|
||||
TreasureFairyInfoModel * info = [TreasureFairyInfoModel new];
|
||||
info.propType = TreasureFairyPropType_Salvage;
|
||||
NSArray *list = data.data;
|
||||
if(list.count > 0){
|
||||
info.rewardNum = list.firstObject[@"pieceNum"] != nil ? [list.firstObject[@"pieceNum"] integerValue]:0;
|
||||
}
|
||||
|
||||
XPTreasureFairyStoreResultSmallView * smallView = [[XPTreasureFairyStoreResultSmallView alloc] init];
|
||||
smallView.datasource = @[info];
|
||||
[TTPopup popupView:smallView style:TTPopupStyleActionSheet];
|
||||
|
||||
});
|
||||
}
|
||||
- (void)fastButtonAction:(UIButton *)sender {
|
||||
[self.ballList removeAllObjects];
|
||||
self.originBallList = nil;
|
||||
@@ -327,6 +395,7 @@
|
||||
- (void)fairyBallRecoginzer:(UITapGestureRecognizer *)tap {
|
||||
XPTreasureFairyTrialsBallView * view = (XPTreasureFairyTrialsBallView *)tap.view;
|
||||
TreasureFairyBallModel * ballInfo = view.ballInfo;
|
||||
self.salvageTips.text = ballInfo.isHigh ? YMLocalizedString(@"XPTreasureFairyTrialsContentView9"):YMLocalizedString(@"XPTreasureFairyTrialsContentView7");
|
||||
NSInteger count = self.isHigh ? 5 : 1;
|
||||
if (self.ballList.count >= count) {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:self.isHigh ? YMLocalizedString(@"XPTreasureFairyTrialsContentView1") :YMLocalizedString(@"XPTreasureFairyTrialsContentView8")];
|
||||
@@ -354,7 +423,7 @@
|
||||
return;
|
||||
}
|
||||
NetImageView * ballView = (NetImageView *)tap.view;
|
||||
NSInteger index= ballView.tag - 1000;
|
||||
NSInteger index= self.hidden ? (ballView.tag - 1000) : 0;
|
||||
TreasureFairyBallModel * ballInfo = [self.originBallList safeObjectAtIndex1:index];
|
||||
ballView.image = nil;
|
||||
|
||||
@@ -440,6 +509,12 @@
|
||||
_isHigh = isHigh;
|
||||
self.backImageView.hidden = YES;
|
||||
if (_isHigh) {
|
||||
self.viewList = @[self.firstView, self.secondView, self.thirdView];
|
||||
self.fourthView.hidden = YES;
|
||||
self.fifthView.hidden = YES;
|
||||
self.sixthView.hidden = YES;
|
||||
self.ballViewList = @[self.oneBallView,self.twoBallView,self.threeBallView,self.fourBallView,self.fiveBallView];
|
||||
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_treasure_fairy_trials_high_bg"];
|
||||
|
||||
_trialsBgImageView.image = [UIImage imageNamed:@"room_treasure_fairy_trials_high_ball_bg"];
|
||||
@@ -450,8 +525,25 @@
|
||||
make.top.mas_equalTo(self.backImageView).offset(0 * kScreenScale);
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
|
||||
[self.threeBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.centerX.equalTo(self.trialsBgImageView);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(160);
|
||||
}];
|
||||
CGFloat width = self.stackView.spacing * 2 + 57 * 3;
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.ballBackView).offset(kGetScaleWidth(26));
|
||||
make.centerX.equalTo(self.backImageView);
|
||||
make.width.mas_equalTo(width);
|
||||
make.height.mas_equalTo(78);
|
||||
}];
|
||||
[self.trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_sure_bg"] forState:UIControlStateNormal];
|
||||
[self.trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_sure_bg"] forState:UIControlStateSelected];
|
||||
} else {
|
||||
[self.trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_salvage_bg"] forState:UIControlStateNormal];
|
||||
[self.trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_salvage_bg"] forState:UIControlStateSelected];
|
||||
self.viewList = @[self.firstView, self.secondView, self.thirdView,self.fourthView,self.fifthView,self.sixthView];
|
||||
self.ballViewList = @[self.threeBallView];
|
||||
self.backImageView.image = [UIImage imageNamed:@"room_treasure_fairy_trials_middle_bg"];
|
||||
_trialsBgImageView.image = [UIImage imageNamed:@"room_treasure_fairy_trials_middle_ball_bg"];
|
||||
self.tipsLabel.text = YMLocalizedString(@"XPTreasureFairyTrialsContentView4");
|
||||
@@ -460,6 +552,16 @@
|
||||
make.top.mas_equalTo(self.backImageView).offset(0 * kScreenScale);
|
||||
make.centerX.mas_equalTo(self.backImageView);
|
||||
}];
|
||||
[self.threeBallView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(60, 60));
|
||||
make.centerX.equalTo(self.trialsBgImageView);
|
||||
make.top.mas_equalTo(self.trialsBgImageView).offset(149);
|
||||
}];
|
||||
[self.stackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.ballBackView).offset(kGetScaleWidth(26));
|
||||
make.leading.trailing.equalTo(self.ballBackView).inset(8);
|
||||
make.height.mas_equalTo(78);
|
||||
}];
|
||||
self.salvageTips.hidden = NO;
|
||||
}
|
||||
}
|
||||
@@ -495,13 +597,59 @@
|
||||
}
|
||||
return _oneBallView;
|
||||
}
|
||||
|
||||
- (NetImageView *)twoBallView {
|
||||
if (!_twoBallView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
_twoBallView = [[NetImageView alloc] initWithConfig:config];
|
||||
_twoBallView.userInteractionEnabled = YES;
|
||||
_twoBallView.layer.masksToBounds = YES;
|
||||
_twoBallView.tag = 1001;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(trialsBallRecogizner:)];
|
||||
[_twoBallView addGestureRecognizer:tap];
|
||||
}
|
||||
return _twoBallView;
|
||||
}
|
||||
- (NetImageView *)threeBallView {
|
||||
if (!_threeBallView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
_threeBallView = [[NetImageView alloc] initWithConfig:config];
|
||||
_threeBallView.userInteractionEnabled = YES;
|
||||
_threeBallView.layer.masksToBounds = YES;
|
||||
_threeBallView.tag = 1002;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(trialsBallRecogizner:)];
|
||||
[_threeBallView addGestureRecognizer:tap];
|
||||
}
|
||||
return _threeBallView;
|
||||
}
|
||||
- (NetImageView *)fourBallView {
|
||||
if (!_fourBallView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
_fourBallView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fourBallView.userInteractionEnabled = YES;
|
||||
_fourBallView.layer.masksToBounds = YES;
|
||||
_fourBallView.tag = 1003;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(trialsBallRecogizner:)];
|
||||
[_fourBallView addGestureRecognizer:tap];
|
||||
}
|
||||
return _fourBallView;
|
||||
}
|
||||
- (NetImageView *)fiveBallView {
|
||||
if (!_fiveBallView) {
|
||||
NetImageConfig * config = [[NetImageConfig alloc]init];
|
||||
_fiveBallView = [[NetImageView alloc] initWithConfig:config];
|
||||
_fiveBallView.userInteractionEnabled = YES;
|
||||
_fiveBallView.layer.masksToBounds = YES;
|
||||
_fiveBallView.tag = 1004;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(trialsBallRecogizner:)];
|
||||
[_fiveBallView addGestureRecognizer:tap];
|
||||
}
|
||||
return _fiveBallView;
|
||||
}
|
||||
|
||||
- (UIButton *)trialsButton {
|
||||
if (!_trialsButton) {
|
||||
_trialsButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||
[_trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_sure_bg"] forState:UIControlStateNormal];
|
||||
[_trialsButton setImage:[UIImage imageNamed:@"room_treasure_fairy_trials_sure_bg"] forState:UIControlStateSelected];
|
||||
|
||||
[_trialsButton addTarget:self action:@selector(trialsButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
||||
}
|
||||
return _trialsButton;
|
||||
@@ -556,7 +704,6 @@
|
||||
- (XPTreasureFairyTrialsBallView *)firstView {
|
||||
if(!_firstView) {
|
||||
_firstView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
_firstView.tag = 1001;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_firstView addGestureRecognizer:tap];
|
||||
}
|
||||
@@ -566,7 +713,6 @@
|
||||
- (XPTreasureFairyTrialsBallView *)secondView {
|
||||
if(!_secondView) {
|
||||
_secondView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
_secondView.tag = 1002;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_secondView addGestureRecognizer:tap];
|
||||
}
|
||||
@@ -576,14 +722,36 @@
|
||||
- (XPTreasureFairyTrialsBallView *)thirdView {
|
||||
if(!_thirdView) {
|
||||
_thirdView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
_thirdView.tag = 1003;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_thirdView addGestureRecognizer:tap];
|
||||
}
|
||||
return _thirdView;
|
||||
}
|
||||
|
||||
|
||||
- (XPTreasureFairyTrialsBallView *)fourthView {
|
||||
if(!_fourthView) {
|
||||
_fourthView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_fourthView addGestureRecognizer:tap];
|
||||
}
|
||||
return _fourthView;
|
||||
}
|
||||
- (XPTreasureFairyTrialsBallView *)fifthView {
|
||||
if(!_fifthView) {
|
||||
_fifthView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_fifthView addGestureRecognizer:tap];
|
||||
}
|
||||
return _fifthView;
|
||||
}
|
||||
- (XPTreasureFairyTrialsBallView *)sixthView {
|
||||
if(!_sixthView) {
|
||||
_sixthView = [[XPTreasureFairyTrialsBallView alloc] init];
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(fairyBallRecoginzer:)];
|
||||
[_sixthView addGestureRecognizer:tap];
|
||||
}
|
||||
return _sixthView;
|
||||
}
|
||||
- (VAPView *)trialsView {
|
||||
if (!_trialsView) {
|
||||
_trialsView = [[VAPView alloc] initWithFrame:CGRectMake(0, 0, 342, 245)];
|
||||
@@ -612,4 +780,15 @@
|
||||
}
|
||||
return _salvageTips;
|
||||
}
|
||||
- (UIStackView *)stackView {
|
||||
if (!_stackView) {
|
||||
_stackView = [[UIStackView alloc] init];
|
||||
_stackView.axis = UILayoutConstraintAxisHorizontal;
|
||||
_stackView.distribution = UIStackViewDistributionFill;
|
||||
_stackView.alignment = UIStackViewAlignmentFill;
|
||||
CGFloat kPadding = (KScreenWidth - 57 * 6 - 16) / 5.0;
|
||||
_stackView.spacing = kPadding;
|
||||
}
|
||||
return _stackView;
|
||||
}
|
||||
@end
|
||||
|
@@ -63,8 +63,18 @@
|
||||
if (code == 200) {
|
||||
TreasureFairyBallInfoModel * info = [TreasureFairyBallInfoModel modelWithDictionary:data.data];
|
||||
self.ballInfo = info;
|
||||
self.middleView.datasource = info.lowElves;
|
||||
self.highView.datasource = info.middleElves;
|
||||
NSMutableArray *elvesList = [NSMutableArray array];
|
||||
if(info.lowElves != nil){
|
||||
[elvesList addObjectsFromArray:info.lowElves];
|
||||
}
|
||||
if(info.highElves != nil){
|
||||
for (TreasureFairyBallModel *model in info.highElves) {
|
||||
model.isHigh = YES;
|
||||
[elvesList addObject:model];
|
||||
}
|
||||
}
|
||||
self.middleView.datasource = elvesList;
|
||||
self.highView.datasource = info.lowElves;
|
||||
} else {
|
||||
[XNDJTDDLoadingTool showErrorWithMessage:msg];
|
||||
}
|
||||
|
@@ -410,7 +410,8 @@
|
||||
self.countButton.enabled = YES;
|
||||
}
|
||||
- (void)buyElfShardSuccessWithNum:(NSString *)num{
|
||||
NSInteger getNum = self.ticketLabel.text.integerValue + num.integerValue;
|
||||
NSInteger getNum = self.keyInfo.drawTicketNum + num.integerValue;
|
||||
self.keyInfo.drawTicketNum = getNum;
|
||||
NSString *text = [NSString getDealTenNumWithString:[NSString stringWithFormat:@"%ld", getNum]];
|
||||
self.ticketLabel.text = text;
|
||||
NSString *time = [NSDate getNowTimeTimestamp];
|
||||
@@ -642,6 +643,7 @@
|
||||
}
|
||||
#pragma mark - PITreasureFairyBuyElfShardViewDelegate
|
||||
- (void)buyElfShardWithType:(int)type num:(nonnull NSString *)num{
|
||||
[TTPopup dismiss];
|
||||
NSInteger needNum = num.integerValue * self.price.integerValue;
|
||||
if(self.diamonds.integerValue < needNum){
|
||||
TTAlertConfig * config = [[TTAlertConfig alloc] init];
|
||||
|
@@ -2784,6 +2784,8 @@
|
||||
"XPTreasureFairyStoreResultSmallView2"="获得精灵";
|
||||
"XPTreasureFairyStoreResultSmallView3"="获得精灵";
|
||||
"XPTreasureFairyStoreResultSmallView4"="关闭";
|
||||
"XPTreasureFairyStoreResultSmallView5"="获得精灵碎片";
|
||||
|
||||
////XPTreasureFairyStoreResultView
|
||||
"XPTreasureFairyStoreResultView0"="意外发现";
|
||||
"XPTreasureFairyStoreResultView1"="获得精灵";
|
||||
@@ -2813,6 +2815,7 @@
|
||||
"XPTreasureFairyTrialsContentView6"="重新投入";
|
||||
"XPTreasureFairyTrialsContentView7"="分解普通精灵将随机获得80-100个碎片";
|
||||
"XPTreasureFairyTrialsContentView8"="分解炉已满";
|
||||
"XPTreasureFairyTrialsContentView9"="分解普通精灵将随机获得400-500个碎片";
|
||||
///XPTreasureFairyTrialsRecordView
|
||||
"XPTreasureFairyTrialsRecordView0"="试炼时间";
|
||||
"XPTreasureFairyTrialsRecordView1"="类型";
|
||||
|
@@ -2784,6 +2784,8 @@
|
||||
"XPTreasureFairyStoreResultSmallView2"="獲得精靈";
|
||||
"XPTreasureFairyStoreResultSmallView3"="獲得精靈";
|
||||
"XPTreasureFairyStoreResultSmallView4"="關閉";
|
||||
"XPTreasureFairyStoreResultSmallView5"="獲得精靈碎片";
|
||||
|
||||
////XPTreasureFairyStoreResultView
|
||||
"XPTreasureFairyStoreResultView0"="意外發現";
|
||||
"XPTreasureFairyStoreResultView1"="獲得精靈";
|
||||
@@ -2813,6 +2815,7 @@
|
||||
"XPTreasureFairyTrialsContentView6"="重新投入";
|
||||
"XPTreasureFairyTrialsContentView7"="分解普通精靈將隨機獲得80-100個碎片";
|
||||
"XPTreasureFairyTrialsContentView8"="分解爐已滿";
|
||||
"XPTreasureFairyTrialsContentView9"="分解普通精靈將隨機獲得400-500個碎片";
|
||||
///XPTreasureFairyTrialsRecordView
|
||||
"XPTreasureFairyTrialsRecordView0"="試煉時間";
|
||||
"XPTreasureFairyTrialsRecordView1"="類型";
|
||||
|