魔力全服福袋礼物开出记录

This commit is contained in:
fengshuo
2022-10-17 19:51:34 +08:00
parent 70d68f0d03
commit af7689e7db
12 changed files with 205 additions and 1 deletions

View File

@@ -939,6 +939,7 @@
E8A30BF328534B17003B4873 /* Api+FindNew.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF228534B17003B4873 /* Api+FindNew.m */; }; E8A30BF328534B17003B4873 /* Api+FindNew.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF228534B17003B4873 /* Api+FindNew.m */; };
E8A30BF628534B35003B4873 /* FindNewUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF528534B35003B4873 /* FindNewUserInfoModel.m */; }; E8A30BF628534B35003B4873 /* FindNewUserInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF528534B35003B4873 /* FindNewUserInfoModel.m */; };
E8A30BF928534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF828534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m */; }; E8A30BF928534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A30BF828534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m */; };
E8A3538528FD67320014A784 /* GiftLuckyBroadcastModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */; };
E8A6C28C27CF436300AC7442 /* XPHomeLikeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */; }; E8A6C28C27CF436300AC7442 /* XPHomeLikeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */; };
E8A6C28F27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28E27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m */; }; E8A6C28F27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C28E27CF43D600AC7442 /* XPHomeAttentionTableViewCell.m */; };
E8A6C29527CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29427CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m */; }; E8A6C29527CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E8A6C29427CF441200AC7442 /* XPHomeAttentionCollectionViewCell.m */; };
@@ -2911,6 +2912,8 @@
E8A30BF528534B35003B4873 /* FindNewUserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FindNewUserInfoModel.m; sourceTree = "<group>"; }; E8A30BF528534B35003B4873 /* FindNewUserInfoModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FindNewUserInfoModel.m; sourceTree = "<group>"; };
E8A30BF728534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewEmptyTableViewCell.h; sourceTree = "<group>"; }; E8A30BF728534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPSessionFindNewEmptyTableViewCell.h; sourceTree = "<group>"; };
E8A30BF828534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionFindNewEmptyTableViewCell.m; sourceTree = "<group>"; }; E8A30BF828534E48003B4873 /* XPSessionFindNewEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPSessionFindNewEmptyTableViewCell.m; sourceTree = "<group>"; };
E8A3538328FD67320014A784 /* GiftLuckyBroadcastModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GiftLuckyBroadcastModel.h; sourceTree = "<group>"; };
E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GiftLuckyBroadcastModel.m; sourceTree = "<group>"; };
E8A6C28A27CF436300AC7442 /* XPHomeLikeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLikeViewController.h; sourceTree = "<group>"; }; E8A6C28A27CF436300AC7442 /* XPHomeLikeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeLikeViewController.h; sourceTree = "<group>"; };
E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLikeViewController.m; sourceTree = "<group>"; }; E8A6C28B27CF436300AC7442 /* XPHomeLikeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeLikeViewController.m; sourceTree = "<group>"; };
E8A6C28D27CF43D600AC7442 /* XPHomeAttentionTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeAttentionTableViewCell.h; sourceTree = "<group>"; }; E8A6C28D27CF43D600AC7442 /* XPHomeAttentionTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeAttentionTableViewCell.h; sourceTree = "<group>"; };
@@ -6634,6 +6637,8 @@
9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */, 9B208A352779B50100F9E54A /* GiftNobleInfoModel.m */,
9B41D36C282649230048C588 /* XPWeekStarRankUserModel.h */, 9B41D36C282649230048C588 /* XPWeekStarRankUserModel.h */,
9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */, 9B41D36D282649230048C588 /* XPWeekStarRankUserModel.m */,
E8A3538328FD67320014A784 /* GiftLuckyBroadcastModel.h */,
E8A3538428FD67320014A784 /* GiftLuckyBroadcastModel.m */,
); );
path = Model; path = Model;
sourceTree = "<group>"; sourceTree = "<group>";
@@ -9131,6 +9136,7 @@
E899C68C275093B800E189E5 /* XPUserCardMicroItemModel.m in Sources */, E899C68C275093B800E189E5 /* XPUserCardMicroItemModel.m in Sources */,
9B6E8573281AB9B20041A321 /* XPRoomInsideRecommendCell.m in Sources */, 9B6E8573281AB9B20041A321 /* XPRoomInsideRecommendCell.m in Sources */,
E87A270027588445002DDC7A /* XPHomeListEmptyCollectionViewCell.m in Sources */, E87A270027588445002DDC7A /* XPHomeListEmptyCollectionViewCell.m in Sources */,
E8A3538528FD67320014A784 /* GiftLuckyBroadcastModel.m in Sources */,
E82325F5274E2E09003A3332 /* XPUserCardPresenter.m in Sources */, E82325F5274E2E09003A3332 /* XPUserCardPresenter.m in Sources */,
E80EC80B28ACD84000D133C5 /* QInputBarViewConfiguration.m in Sources */, E80EC80B28ACD84000D133C5 /* QInputBarViewConfiguration.m in Sources */,
E880B39E278BD49E00A83B0D /* XPAcrossRoomPKViewController.m in Sources */, E880B39E278BD49E00A83B0D /* XPAcrossRoomPKViewController.m in Sources */,

View File

@@ -68,6 +68,10 @@ NS_ASSUME_NONNULL_BEGIN
roomUid:(NSString *)roomUid roomUid:(NSString *)roomUid
msg:(NSString *)msg msg:(NSString *)msg
uid:(NSString *)uid; uid:(NSString *)uid;
/// 请求福袋全服礼物全服记录
/// @param complection 完成
+ (void)requestLuckGiftServerBagRecord:(HttpRequestHelperCompletion)complection;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -25,6 +25,13 @@
[self makeRequest:@"gift/listV4" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil]; [self makeRequest:@"gift/listV4" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, roomUid, nil];
} }
///
/// @param complection
+ (void)requestLuckGiftServerBagRecord:(HttpRequestHelperCompletion)complection {
[self makeRequest:@"gift/luckyBag/serviceMsg/record" method:HttpRequestHelperMethodGET completion:complection, __FUNCTION__, nil];
}
/// ///
/// @param complection /// @param complection
/// @param targetUids /// @param targetUids

View File

@@ -0,0 +1,27 @@
//
// GiftLuckyBroadcastModel.h
// xplan-ios
//
// Created by 冯硕 on 2022/10/17.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface GiftLuckyBroadcastModel : NSObject
///礼物名称
@property (nonatomic,strong) NSString *giftName;
///价格
@property (nonatomic, assign)double goldPrice;
///幸运礼物
@property (nonatomic,strong) NSString *luckyBagName;
///昵称
@property (nonatomic,strong) NSString *nick;
///房间标题
@property (nonatomic,strong) NSString *roomTitle;
///房间的uid
@property (nonatomic,strong) NSString *roomUid;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,14 @@
//
// GiftLuckyBroadcastModel.m
// xplan-ios
//
// Created by on 2022/10/17.
//
#import "GiftLuckyBroadcastModel.h"
@implementation GiftLuckyBroadcastModel
@end

View File

@@ -39,6 +39,10 @@ NS_ASSUME_NONNULL_BEGIN
roomSendType:(RoomSendGiftType)roomSendType roomSendType:(RoomSendGiftType)roomSendType
roomUid:(NSString *)roomUid roomUid:(NSString *)roomUid
msg:(NSString *)msg; msg:(NSString *)msg;
///全服福袋记录记录
- (void)luckyGiftBroadcastRecord;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -15,6 +15,7 @@
#import "WalletInfoModel.h" #import "WalletInfoModel.h"
#import "GiftReceiveInfoModel.h" #import "GiftReceiveInfoModel.h"
#import "UserInfoModel.h" #import "UserInfoModel.h"
#import "GiftLuckyBroadcastModel.h"
///P ///P
#import "XPGiftProtocol.h" #import "XPGiftProtocol.h"
@@ -133,4 +134,12 @@
}] targetUids:targetUids giftNum:giftNum sendType:giftSendTypeStr giftId:giftId giftSource:giftSourceStr giftType:giftTypeStr roomUid:roomUid msg:msg uid:uid]; }] targetUids:targetUids giftNum:giftNum sendType:giftSendTypeStr giftId:giftId giftSource:giftSourceStr giftType:giftTypeStr roomUid:roomUid msg:msg uid:uid];
} }
///
- (void)luckyGiftBroadcastRecord {
[Api requestLuckGiftServerBagRecord:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray * array = [GiftLuckyBroadcastModel modelsWithArray:data.data];
[[self getView] luckyGiftBroadcastRecordSuccess:array];
}]];
}
@end @end

View File

@@ -27,6 +27,9 @@ NS_ASSUME_NONNULL_BEGIN
///送礼物失败 ///送礼物失败
- (void)sendGiftFailWithCode:(NSInteger)code msg:(NSString *)msg; - (void)sendGiftFailWithCode:(NSInteger)code msg:(NSString *)msg;
///获取全服福袋礼物记录
- (void)luckyGiftBroadcastRecordSuccess:(NSArray *)records;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -20,6 +20,9 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) id<XPGiftLuckyGiftBroadcastViewDelegate> delegate; @property (nonatomic, weak) id<XPGiftLuckyGiftBroadcastViewDelegate> delegate;
@property (nonatomic,strong) NSArray *records;
@end @end
NS_ASSUME_NONNULL_END NS_ASSUME_NONNULL_END

View File

@@ -8,10 +8,80 @@
#import "XPGiftLuckyGiftBroadcastView.h" #import "XPGiftLuckyGiftBroadcastView.h"
///Third ///Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import <SDCycleScrollView.h>
#import <YYText.h>
///Tool ///Tool
#import "ThemeColor.h" #import "ThemeColor.h"
///Model
#import "GiftLuckyBroadcastModel.h"
@interface XPGiftLuckyGiftBroadcastView()
@interface XPGiftLuckyGiftBroadcastCell : UICollectionViewCell
@property (nonatomic,strong) YYLabel *titleLabel;
@property (nonatomic,strong) GiftLuckyBroadcastModel *giftInfo;
@end
@implementation XPGiftLuckyGiftBroadcastCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
[self.contentView addSubview:self.titleLabel];
}
- (void)initSubViewConstraints {
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
- (NSMutableAttributedString *)createTextAttribute:(NSString *)text color:(UIColor *)color {
if (text == nil || text.length <= 0) {
text = @"";
}
NSMutableAttributedString *attribute = [[NSMutableAttributedString alloc] initWithString:text attributes:nil];
attribute.yy_font = [UIFont systemFontOfSize:12];
attribute.yy_color = color;
return attribute;
}
#pragma mark - Getters And Setters
- (void)setGiftInfo:(GiftLuckyBroadcastModel *)giftInfo {
_giftInfo = giftInfo;
if (_giftInfo) {
NSMutableAttributedString * attribute = [[NSMutableAttributedString alloc] init];
[attribute appendAttributedString:[self createTextAttribute:@"恭喜 " color:[UIColor whiteColor]]];
NSString * nick = _giftInfo.nick;
if (nick.length > 6) {
nick = [nick substringToIndex:6];
}
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ " , nick] color:[ThemeColor colorWithHexString:@"#FFD436"]]];
[attribute appendAttributedString:[self createTextAttribute:@"开出幸运福袋获得 " color:[UIColor whiteColor]]];
[attribute appendAttributedString:[self createTextAttribute:[NSString stringWithFormat:@"%@ " , _giftInfo.luckyBagName] color:[ThemeColor colorWithHexString:@"#6FE3FF"]]];
self.titleLabel.attributedText = attribute;
}
}
- (YYLabel *)titleLabel {
if (!_titleLabel) {
_titleLabel = [[YYLabel alloc] init];
}
return _titleLabel;
}
@end
@interface XPGiftLuckyGiftBroadcastView()<SDCycleScrollViewDelegate>
/// ///
@property (nonatomic, strong) UIImageView *bgImageView; @property (nonatomic, strong) UIImageView *bgImageView;
@@ -19,6 +89,8 @@
@property (nonatomic, strong) UIImageView *playImageView; @property (nonatomic, strong) UIImageView *playImageView;
///icon ///icon
@property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UIImageView *iconImageView;
///
@property (nonatomic, strong) SDCycleScrollView *cycleScrollView;
@end @end
@@ -38,6 +110,7 @@
[self addSubview:self.bgImageView]; [self addSubview:self.bgImageView];
[self addSubview:self.iconImageView]; [self addSubview:self.iconImageView];
[self addSubview:self.playImageView]; [self addSubview:self.playImageView];
[self addSubview:self.cycleScrollView];
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
@@ -53,6 +126,12 @@
make.width.height.mas_equalTo(20); make.width.height.mas_equalTo(20);
}]; }];
[self.cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.iconImageView.mas_right);
make.right.mas_equalTo(self.playImageView.mas_left).offset(-5);
make.top.bottom.mas_equalTo(self.bgImageView);
}];
[self.playImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.playImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.right.bottom.mas_equalTo(self.bgImageView); make.top.right.bottom.mas_equalTo(self.bgImageView);
make.width.mas_equalTo(67); make.width.mas_equalTo(67);
@@ -65,6 +144,31 @@
[self.delegate xPGiftLuckyGiftBroadcastViewPlayDescClick]; [self.delegate xPGiftLuckyGiftBroadcastViewPlayDescClick];
} }
} }
#pragma mark - SDCycleScrollViewDelegate
- (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view {
return XPGiftLuckyGiftBroadcastCell.class;
}
- (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view {
XPGiftLuckyGiftBroadcastCell *myCell = (XPGiftLuckyGiftBroadcastCell *)cell;
GiftLuckyBroadcastModel * info = [self.records objectAtIndex:index];
myCell.giftInfo = info;
}
#pragma mark - Getters And Setters
- (void)setRecords:(NSArray *)records {
_records = records;
if (_records.count > 0) {
NSMutableArray * array = [NSMutableArray array];
for (GiftLuckyBroadcastModel * item in _records) {
[array addObject:item.giftName];
}
if (array.count > 0) {
self.cycleScrollView.imageURLStringsGroup = array;
[self.cycleScrollView autoScroll];
}
}
}
- (UIImageView *)bgImageView { - (UIImageView *)bgImageView {
if (!_bgImageView) { if (!_bgImageView) {
@@ -95,4 +199,16 @@
return _playImageView; return _playImageView;
} }
- (SDCycleScrollView *)cycleScrollView {
if (!_cycleScrollView) {
_cycleScrollView = [[SDCycleScrollView alloc] init];
_cycleScrollView.backgroundColor = [UIColor clearColor];
_cycleScrollView.layer.masksToBounds = YES;
_cycleScrollView.delegate = self;
_cycleScrollView.showPageControl = NO;
_cycleScrollView.autoScrollTimeInterval = 3.0;
}
return _cycleScrollView;
}
@end @end

View File

@@ -63,6 +63,7 @@
} }
- (void)initSubViewConstraints { - (void)initSubViewConstraints {
self.backgroundColor = [UIColor redColor];
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(0); make.top.mas_equalTo(0);
make.left.right.mas_equalTo(self).inset(10); make.left.right.mas_equalTo(self).inset(10);

View File

@@ -81,6 +81,8 @@
@property (nonatomic,strong) NSArray *graffitiPoint; @property (nonatomic,strong) NSArray *graffitiPoint;
/// ///
@property (nonatomic,assign) GiftSegmentType segmentType; @property (nonatomic,assign) GiftSegmentType segmentType;
///
@property (nonatomic,strong) NSArray *records;
@end @end
@implementation XPSendGiftView @implementation XPSendGiftView
@@ -147,6 +149,7 @@
[self.presenter getUserWallInfo]; [self.presenter getUserWallInfo];
[self.presenter getNormalGiftList:self.roomUid]; [self.presenter getNormalGiftList:self.roomUid];
[self.presenter getPackGiftList]; [self.presenter getPackGiftList];
[self.presenter luckyGiftBroadcastRecord];
} }
#pragma mark - Send Custom Message #pragma mark - Send Custom Message
@@ -635,6 +638,13 @@
[self showErrorToast:msg]; [self showErrorToast:msg];
} }
} }
- (void)luckyGiftBroadcastRecordSuccess:(NSArray *)records {
self.records = records;
self.luckyBroadcastView.records = records;
}
#pragma mark - Event Response #pragma mark - Event Response
- (void)disMissViewRecognizer:(UITapGestureRecognizer *)tap { - (void)disMissViewRecognizer:(UITapGestureRecognizer *)tap {
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];