feat(P4): precompute移植+app.js sources双向回填+回归1003/1003+验收体积/文件/data.json
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<!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: var(--au-color-page-bg);}</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>
|
||||
@@ -0,0 +1,21 @@
|
||||
import React, { useRef } from 'react';
|
||||
import './BottomSheet.css';
|
||||
|
||||
export default function BottomSheet({ visible = false, title = '', onClose, children, footer }) {
|
||||
const startY = useRef(0);
|
||||
return (
|
||||
<>
|
||||
<div className={'aa-sheet-mask' + (visible ? ' is-open' : '')} onClick={onClose} />
|
||||
<div
|
||||
className={'aa-sheet' + (visible ? ' is-open' : '')}
|
||||
onPointerDown={e => { startY.current = e.clientY; }}
|
||||
onPointerUp={e => { if (startY.current - e.clientY < -80) onClose && onClose(); }}
|
||||
>
|
||||
<div className="aa-sheet-handle" />
|
||||
{title ? <div className="aa-sheet-header">{title}</div> : null}
|
||||
<div className="aa-sheet-body">{children}</div>
|
||||
{footer ? <div className="aa-sheet-footer">{footer}</div> : null}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<template>
|
||||
<div class="aa-sheet-mask" :class="{ 'is-open': visible }" @click="$emit('close')"></div>
|
||||
<div class="aa-sheet" :class="{ 'is-open': visible }"
|
||||
@pointerdown="onDown" @pointerup="onUp">
|
||||
<div class="aa-sheet-handle"></div>
|
||||
<div class="aa-sheet-header" v-if="title">{{ title }}</div>
|
||||
<div class="aa-sheet-body"><slot>默认内容</slot></div>
|
||||
<div class="aa-sheet-footer" v-if="$slots.footer"><slot name="footer"></slot></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'AaBottomSheet',
|
||||
props: { visible: { type: Boolean, default: false }, title: { type: String, default: '' } },
|
||||
data: function () { return { startY: 0 }; },
|
||||
methods: {
|
||||
onDown: function (e) { this.startY = e.clientY; },
|
||||
onUp: function (e) { if (this.startY - e.clientY < -80) this.$emit('close'); }
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style src="./BottomSheet.css"></style>
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<div class="aa-sheet-mask" :class="{ 'is-open': visible }" @click="emit('close')"></div>
|
||||
<div class="aa-sheet" :class="{ 'is-open': visible }"
|
||||
@pointerdown="onDown" @pointerup="onUp">
|
||||
<div class="aa-sheet-handle"></div>
|
||||
<div class="aa-sheet-header" v-if="title">{{ title }}</div>
|
||||
<div class="aa-sheet-body"><slot>默认内容</slot></div>
|
||||
<div class="aa-sheet-footer" v-if="$slots.footer"><slot name="footer" /></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
const props = defineProps({ visible: { type: Boolean, default: false }, title: { type: String, default: '' } });
|
||||
const emit = defineEmits(['close']);
|
||||
const startY = ref(0);
|
||||
function onDown(e) { startY.value = e.clientY; }
|
||||
function onUp(e) { if (startY.value - e.clientY < -80) emit('close'); }
|
||||
</script>
|
||||
|
||||
<style src="./BottomSheet.css"></style>
|
||||
Reference in New Issue
Block a user