任务完成提示调整
This commit is contained in:
@@ -78,6 +78,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageType) {
|
||||
CustomMessageType_Anchor_FansTeam = 90,
|
||||
///牌照房小时榜
|
||||
CustomMessageType_Licnese_Hour_Rank = 91,
|
||||
///任务完成通知
|
||||
CustomMessageType_Task_Complete = 92,
|
||||
};
|
||||
|
||||
|
||||
@@ -331,6 +333,8 @@ typedef NS_ENUM(NSUInteger, CustomMessageSubRoomPlayDating){
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageSubFirstRecharge) {
|
||||
/// 首充完成
|
||||
Custom_Message_Sub_Room_First_Recharge_Reward= 761,
|
||||
/// 新用户专享优惠充值完成
|
||||
Custom_Message_Sub_New_User_Recharge_Reward = 762,
|
||||
};
|
||||
|
||||
/// 访客记录
|
||||
@@ -415,6 +419,12 @@ typedef NS_ENUM(NSUInteger, CustomMessageLicneseHourRank) {
|
||||
Custom_Message_Sub_Licnese_Hour_Rank = 911,
|
||||
};
|
||||
|
||||
///first = CustomMessageType_Task_Complete
|
||||
typedef NS_ENUM(NSUInteger, CustomMessageTaskComplete) {
|
||||
///任务完成通知
|
||||
Custom_Message_Sub_TaskComplete = 921,
|
||||
};
|
||||
|
||||
@interface AttachmentModel : NSObject<NIMCustomAttachment>
|
||||
@property (nonatomic,assign) int first;
|
||||
@property (nonatomic,assign) int second;
|
||||
|
@@ -76,7 +76,6 @@
|
||||
#import "XPRoomHalfMessageView.h"
|
||||
#import "XPAcrossRoomPKCountDownView.h"
|
||||
#import "XPNewUserRoomGiftView.h"
|
||||
#import "XPTaskCompleteTipView.h"
|
||||
///个播PK
|
||||
#import "XPAnchorFansTeamEntranceView.h"
|
||||
#import "XPAnchorFansTeamViewController.h"
|
||||
@@ -134,8 +133,6 @@
|
||||
@property (nonatomic,assign) BOOL isLoadGreet;
|
||||
///获取新用户礼物倒计时3s
|
||||
@property (nonatomic, strong) dispatch_source_t userGiftTimer;
|
||||
///任务完成提示
|
||||
@property (nonatomic, strong) XPTaskCompleteTipView *taskTipView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1605,31 +1602,6 @@
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 活动任务完成提示
|
||||
- (void)handleActivityTaskTip:(AttachmentModel *)attachment {
|
||||
if (!self.taskTipView.superview) {
|
||||
[self addSubview:self.taskTipView];
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jumpToTask:)];
|
||||
[self.taskTipView addGestureRecognizer:tap];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (self.taskTipView.superview) {
|
||||
[self.taskTipView removeFromSuperview];
|
||||
}
|
||||
self.taskTipView = nil;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)jumpToTask:(UITapGestureRecognizer *)ges {
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = self.taskTipView.url;
|
||||
[self.delegate.getCurrentNav pushViewController:webVC animated:YES];
|
||||
if (self.taskTipView.superview) {
|
||||
[self.taskTipView removeFromSuperview];
|
||||
}
|
||||
self.taskTipView = nil;
|
||||
}
|
||||
|
||||
#pragma mark - Getters And Setters
|
||||
- (XPRoomRankEntranceView *)contributeEnterView {
|
||||
if (!_contributeEnterView) {
|
||||
@@ -1796,11 +1768,4 @@
|
||||
return _acrossPKCountView;
|
||||
}
|
||||
|
||||
- (XPTaskCompleteTipView *)taskTipView {
|
||||
if (!_taskTipView) {
|
||||
_taskTipView = [[XPTaskCompleteTipView alloc] initWithFrame:CGRectMake(0, KScreenHeight - kSafeAreaBottomHeight-60, KScreenWidth, 20)];
|
||||
}
|
||||
return _taskTipView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPTaskCompleteTipView : UIView
|
||||
|
||||
@property (nonatomic, copy) NSString *desc;
|
||||
|
||||
@property (nonatomic, copy) NSString *url;
|
||||
|
||||
@end
|
||||
|
@@ -34,10 +34,6 @@
|
||||
return self;
|
||||
}
|
||||
|
||||
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)initSubViews {
|
||||
[self addSubview:self.mainView];
|
||||
[self addSubview:self.nickLabel];
|
||||
@@ -60,6 +56,16 @@
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)setDesc:(NSString *)desc {
|
||||
_desc = desc;
|
||||
if (desc.length) {
|
||||
self.nickLabel.text = desc;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setUrl:(NSString *)url {
|
||||
_url = url;
|
||||
}
|
||||
|
||||
#pragma mark - getter
|
||||
- (UIView *)mainView {
|
||||
@@ -69,6 +75,7 @@
|
||||
_mainView.layer.masksToBounds = YES;
|
||||
_mainView.layer.borderWidth = 0.5;
|
||||
_mainView.layer.borderColor = UIColorFromRGB(0xFFBC51).CGColor;
|
||||
_mainView.backgroundColor = UIColorFromRGB(0x7A4B00);
|
||||
}
|
||||
return _mainView;
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#import "NewUserGreetModel.h"
|
||||
#import "FindNewGreetMessageModel.h"
|
||||
#import "XPTabAnchorCardModel.h"
|
||||
#import "FirstRechargeModel.h"
|
||||
///VC
|
||||
#import "TabbarViewController.h"
|
||||
#import "BaseViewController.h"
|
||||
@@ -55,6 +56,9 @@
|
||||
#import "XPHomeLivesViewController.h"
|
||||
#import "XPNewUserRechargeViewController.h"
|
||||
#import "XPAnchorCardView.h"
|
||||
#import "XPNewUserRechargeSucessView.h"
|
||||
#import "XPTaskCompleteTipView.h"
|
||||
#import "XPWebViewController.h"
|
||||
///Present
|
||||
#import "MainPresenter.h"
|
||||
#import "MainProtocol.h"
|
||||
@@ -83,6 +87,8 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
@property (nonatomic, assign) BOOL secondLaunchShowAnchorCard;
|
||||
///主播卡片
|
||||
@property (nonatomic, strong) XPAnchorCardView *anchorCardView;
|
||||
///任务完成提示
|
||||
@property (nonatomic, strong) XPTaskCompleteTipView *taskTipView;
|
||||
|
||||
@end
|
||||
|
||||
@@ -475,6 +481,18 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
if ([model isKindOfClass:XPMineVisitorUnReadModel.class]) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:kVisitorUnReadCountNotificationKey object:model];
|
||||
}
|
||||
} else if ([dic[@"first"] intValue] == CustomMessageType_First_Recharge_Reward && [dic[@"second"] intValue] == Custom_Message_Sub_New_User_Recharge_Reward) { // 新用户充值优惠成功
|
||||
if ([dic isKindOfClass:[NSDictionary class]]) {
|
||||
FirstRechargeModel *model = [FirstRechargeModel modelWithDictionary:dic[@"data"]];
|
||||
XPNewUserRechargeSucessView * firstRechargeView= [[XPNewUserRechargeSucessView alloc] init];
|
||||
firstRechargeView.rechargeInfo = model;
|
||||
[TTPopup popupView:firstRechargeView style:TTPopupStyleAlert];
|
||||
}
|
||||
} else if ([dic[@"first"] intValue] == CustomMessageType_Task_Complete && [dic[@"second"] intValue] == Custom_Message_Sub_TaskComplete) {///任务完成提醒
|
||||
if ([dic isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *dict = dic[@"data"];
|
||||
[self handleActivityTaskTip:dict[@"taskCompleteMsg"] url:dic[@"taskUrl"]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,6 +539,33 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - 活动任务完成提示
|
||||
- (void)handleActivityTaskTip:(NSString *)msg url:(NSString *)url {
|
||||
if (!self.taskTipView.superview && url.length) {
|
||||
[self.view addSubview:self.taskTipView];
|
||||
self.taskTipView.desc = msg;
|
||||
self.taskTipView.url = url;
|
||||
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(jumpToTask:)];
|
||||
[self.taskTipView addGestureRecognizer:tap];
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
if (self.taskTipView.superview) {
|
||||
[self.taskTipView removeFromSuperview];
|
||||
}
|
||||
self.taskTipView = nil;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (void)jumpToTask:(UITapGestureRecognizer *)ges {
|
||||
XPWebViewController * webVC =[[XPWebViewController alloc] init];
|
||||
webVC.url = self.taskTipView.url;
|
||||
[self.selectedViewController.navigationController pushViewController:webVC animated:YES];
|
||||
if (self.taskTipView.superview) {
|
||||
[self.taskTipView removeFromSuperview];
|
||||
}
|
||||
self.taskTipView = nil;
|
||||
}
|
||||
|
||||
#pragma mark - XPAnchorCardViewDelegate
|
||||
- (void)xPAnchorCardViewEnterRoom:(NSString *)roomUid {
|
||||
if (roomUid) {
|
||||
@@ -571,4 +616,11 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
|
||||
return _anchorCardView;
|
||||
}
|
||||
|
||||
- (XPTaskCompleteTipView *)taskTipView {
|
||||
if (!_taskTipView) {
|
||||
_taskTipView = [[XPTaskCompleteTipView alloc] initWithFrame:CGRectMake(0, KScreenHeight - kSafeAreaBottomHeight-60-20, KScreenWidth, 20)];
|
||||
}
|
||||
return _taskTipView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user