Переглянути джерело

[*] 充值返利活动气泡显隐逻辑补充

Steven 11 місяців тому
батько
коміт
c3a4b51f61

+ 13 - 2
MiMoLive/MiMoLive/Classes/Square/Controller/MOSquareListVC.m

@@ -98,6 +98,14 @@
     }
 }
 
+- (void)viewWillDisappear:(BOOL)animated {
+    [super viewWillDisappear:animated];
+    
+    if (!self.bubbleView.hidden) {
+        self.bubbleView.hidden = YES;
+    }
+}
+
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
@@ -178,6 +186,7 @@
 
 - (void)showBubble {
     if (_bubbleView.superview) {
+        self.bubbleView.hidden = NO;
         return;//防止重复弹出气泡
     }
     
@@ -196,7 +205,7 @@
     UIImage *originalImgae = [UIImage imageNamed:@"icon_recharge_bubble_bottom"];
     self.bubbleView.bgImg = [originalImgae stretchLeftAndRightWithContainerSize:CGSizeMake(bubbleW, bubbleH)];
     self.bubbleView.frame = CGRectMake(bubbleX, bubbleY, bubbleW, bubbleH);
-    [self.view.superview addSubview:self.bubbleView];
+    [self.view addSubview:self.bubbleView];
     
     if ([self checkNeedRepeatShowRechargeActivityBubble]) {
         [self.bubbleView showWithAnimationTime:0.5 repeat:YES];
@@ -569,7 +578,9 @@ static BOOL MOActivityManageViewTag = NO;
     }
     view.isFollow = isFollow;
     view.homeVC = self;
-    
+    view.updateBlock = ^{
+        [weakSelf loadRightTopActivityData];
+    };
     return view;
 }
 

+ 1 - 1
MiMoLive/MiMoLive/Classes/Square/View/MOSquareView/MOSquareBaseCollectionView.h

@@ -35,7 +35,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property (nonatomic, assign) BOOL isNeedWillRefresh;
 
-
+@property (nonatomic, copy) void(^updateBlock)(void);
 
 - (instancetype)initWithFrame:(CGRect)frame AndIsFollow:(BOOL)follow;
 

+ 4 - 0
MiMoLive/MiMoLive/Classes/Square/View/MOSquareView/MOSquareBaseCollectionView.m

@@ -809,6 +809,10 @@
         MJRefreshNormalHeader *header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
             __strong typeof(weakSelf) self = weakSelf;
             
+            if (weakSelf.updateBlock) {
+                weakSelf.updateBlock();
+            }
+            
             //获取banner数据
             self.next = @"";
             if(self.isFollow){

+ 2 - 2
MiMoLive/MiMoLive/Global/NetManager/MOHttpManager.m

@@ -5622,11 +5622,11 @@
 #pragma mark =========== 充值返利 ============
 - (void)getBadgeListDataWithParams:(id)params andBlock:(void (^)(id data, NSError *error))block {
     // 定义本接口缓存的有效时长:15分钟
-    const static NSTimeInterval kRequestThemeCacheDuration = 15 * 60;
+    const static NSTimeInterval kRequestBadgeCacheDuration = 15 * 60;
     if (kHttpManager.responseCacheDict[kNetPath_Code_BadgeList]) {
         MOApiResponseCacheModel *cacheModel = kHttpManager.responseCacheDict[kNetPath_Code_BadgeList];
         NSTimeInterval nowTime = [[NSDate date] timeIntervalSince1970];
-        if (nowTime < cacheModel.responseTime + kRequestThemeCacheDuration) {
+        if (nowTime < cacheModel.responseTime + kRequestBadgeCacheDuration) {
             // 读取缓存数据,主线程返回
             dispatch_async(dispatch_get_main_queue(), ^{
                 block(cacheModel.responseData, nil);