fix: keep worldcup live cards above tabbar

This commit is contained in:
hajimi
2026-07-03 17:51:08 +08:00
parent 7c260b1f99
commit affb0a4002
2 changed files with 99 additions and 4 deletions
@@ -0,0 +1,48 @@
from pathlib import Path
ROOT = Path(__file__).resolve().parents[2]
PANEL = ROOT / "uniapp" / "src" / "packages_match" / "components" / "WorldCupPanel.vue"
def extract_style_block(source: str, selector: str) -> str:
start = source.find(selector)
if start < 0:
raise AssertionError(f"missing selector: {selector}")
brace = source.find("{", start)
if brace < 0:
raise AssertionError(f"missing style body for: {selector}")
depth = 0
for pos in range(brace, len(source)):
char = source[pos]
if char == "{":
depth += 1
elif char == "}":
depth -= 1
if depth == 0:
return source[brace + 1:pos]
raise AssertionError(f"unterminated style body for: {selector}")
def main() -> int:
panel = PANEL.read_text(encoding="utf-8")
scroll_style = extract_style_block(panel, ".worldcup-scroll")
required_tokens = [
"140rpx",
"constant(safe-area-inset-bottom)",
"env(safe-area-inset-bottom)",
]
for token in required_tokens:
if token not in scroll_style:
raise AssertionError(f"{PANEL} .worldcup-scroll bottom padding should reserve tabbar space: {token}")
print("worldcup live bottom padding static checks passed")
return 0
if __name__ == "__main__":
raise SystemExit(main())