Files
aurora-admin/frameworks/BottomSheet.html
T

45 lines
1.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Aurora Admin · BottomSheet(普通 H5)</title>
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css" />
<link rel="stylesheet" href="BottomSheet.css" />
<style>body{margin:0;padding:24px;background:#F5F7FA;}</style>
</head>
<body>
<button id="open">打开底部面板</button>
<div class="aa-sheet-mask" id="mask"></div>
<div class="aa-sheet" id="sheet">
<div class="aa-sheet-handle" id="handle"></div>
<div class="aa-sheet-header">筛选订单</div>
<div class="aa-sheet-body">
在这里放置筛选条件、操作列表等内容。面板可从底部滑动出现,点击遮罩或向下拖动可关闭。
</div>
<div class="aa-sheet-footer">
<button class="aa-sheet-btn" id="cancel">取消</button>
<button class="aa-sheet-btn primary" id="apply">应用</button>
</div>
</div>
<script>
var mask = document.getElementById('mask');
var sheet = document.getElementById('sheet');
function open() { mask.classList.add('is-open'); sheet.classList.add('is-open'); }
function close() { mask.classList.remove('is-open'); sheet.classList.remove('is-open'); }
document.getElementById('open').onclick = open;
mask.onclick = close;
document.getElementById('cancel').onclick = close;
document.getElementById('apply').onclick = close;
var startY = 0;
sheet.addEventListener('pointerdown', function (e) { startY = e.clientY; });
sheet.addEventListener('pointerup', function (e) {
if (startY - e.clientY < -80) close();
});
</script>
</body>
</html>