feat(web-admin): add mp webview sheet and list chrome styles.

Provide shared Bottom Sheet and filter/speed-dial/fab tokens for the transport plan mobile redesign.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
wuzilongandCursor committed 2026-09-15 09:27:11 +08:00
1 parent 3795fa2b5a
commit 8c69a01e16
2 files changed
+284

No files matched your search

@@ -0,0 +1,132 @@
<template>
<Teleport to="body">
<div v-show="modelValue" class="mp-sheet-mask" @click="close" />
<div
v-show="modelValue"
class="mp-sheet"
:class="{ 'mp-sheet--half': half }"
role="dialog"
aria-modal="true"
>
<div class="mp-sheet-handle" />
<div class="mp-sheet-head">
<h3>{{ title }}</h3>
<button class="mp-sheet-close" type="button" @click="close">关闭</button>
</div>
<div v-if="searchable" class="mp-sheet-search">
<input
v-model="keyword"
class="mp-sheet-search-input"
type="search"
:placeholder="searchPlaceholder"
autocomplete="off"
/>
</div>
<div class="mp-sheet-body">
<slot :keyword="keyword" />
</div>
<div v-if="$slots.footer" class="mp-sheet-foot">
<slot name="footer" />
</div>
</div>
</Teleport>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
const props = withDefaults(
defineProps<{
modelValue: boolean
title?: string
searchable?: boolean
searchPlaceholder?: string
half?: boolean
}>(),
{
title: '',
searchable: false,
searchPlaceholder: '搜索',
half: false
}
)
const emit = defineEmits<{ 'update:modelValue': [boolean] }>()
const keyword = ref('')
watch(
() => props.modelValue,
(open) => {
if (open) keyword.value = ''
}
)
function close() {
emit('update:modelValue', false)
}
</script>
<style scoped lang="scss">
.mp-sheet-mask {
position: fixed;
inset: 0;
z-index: 2000;
background: rgba(0, 0, 0, 0.4);
backdrop-filter: none;
}
.mp-sheet {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 2001;
max-height: 78vh;
display: flex;
flex-direction: column;
background: #fff;
border-radius: 16px 16px 0 0;
padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mp-sheet--half { max-height: 50vh; }
.mp-sheet-handle {
width: 36px;
height: 4px;
margin: 8px auto 0;
border-radius: 999px;
background: #dcebe4;
}
.mp-sheet-head {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 16px;
}
.mp-sheet-head h3 { margin: 0; font-size: 16px; }
.mp-sheet-close {
border: none;
background: none;
color: #0a9f6d;
font-size: 14px;
cursor: pointer;
}
.mp-sheet-search { padding: 0 16px 8px; }
.mp-sheet-search-input {
width: 100%;
height: 36px;
padding: 0 12px;
border: 1px solid #dcebe4;
border-radius: 8px;
font-size: 14px;
}
.mp-sheet-body {
flex: 1;
overflow: auto;
padding: 0 8px 12px;
-webkit-overflow-scrolling: touch;
}
.mp-sheet-foot {
display: flex;
gap: 8px;
padding: 10px 16px;
border-top: 1px solid #dcebe4;
}
</style>