Steven 2 年之前
父節點
當前提交
0bf5a28e93
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

+ 12 - 0
KulexiuForStudent/KulexiuForStudent/Module/Home/Controller/HomeViewController.m

@@ -582,6 +582,9 @@
             if (suspensionArray.count) {
                 self.buttonModel = [[HomeMessageModel alloc] initWithDictionary:[suspensionArray firstObject]];
             }
+            else {
+                self.buttonModel = nil;
+            }
         }
         else {
             [self MBPShow:MESSAGEKEY];
@@ -860,6 +863,15 @@
     if (self.buttonModel) {
         [self showFloatingWindow];
     }
+    else {
+        [self removeFloatWindow];
+    }
+}
+
+- (void)removeFloatWindow {
+    if ([self.view.subviews containsObject:self.suspendButton]) {
+        [self.suspendButton removeFromSuperview];
+    }
 }
 
 // 显示悬浮窗