fix: adapt shared page header to safe area
This commit is contained in:
@@ -74,9 +74,16 @@ const props = defineProps({
|
|||||||
root: { type: Boolean, default: false },
|
root: { type: Boolean, default: false },
|
||||||
unreadCount: { type: Number, default: 0 },
|
unreadCount: { type: Number, default: 0 },
|
||||||
fallbackUrl: { type: String, default: "/pages/genealogy/g01-my-genealogies" },
|
fallbackUrl: { type: String, default: "/pages/genealogy/g01-my-genealogies" },
|
||||||
|
customBack: { type: Boolean, default: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const emit = defineEmits(["brand", "notice", "action", "back"]);
|
||||||
|
|
||||||
const goBack = () => {
|
const goBack = () => {
|
||||||
|
if (props.customBack) {
|
||||||
|
emit("back");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const stack = getCurrentPages();
|
const stack = getCurrentPages();
|
||||||
if (stack.length > 1) {
|
if (stack.length > 1) {
|
||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
@@ -88,7 +95,7 @@ const goBack = () => {
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.page-header-slot {
|
.page-header-slot {
|
||||||
height: 104rpx;
|
height: calc(104rpx + var(--status-bar-height, 0px));
|
||||||
flex: none;
|
flex: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,8 +111,9 @@ const goBack = () => {
|
|||||||
z-index: 30;
|
z-index: 30;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 104rpx;
|
height: calc(104rpx + var(--status-bar-height, 0px));
|
||||||
padding: 0 24rpx;
|
padding: 0 24rpx;
|
||||||
|
padding-top: var(--status-bar-height, 0px);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background: $brand-red;
|
background: $brand-red;
|
||||||
color: #fff9ed;
|
color: #fff9ed;
|
||||||
|
|||||||
@@ -35,6 +35,10 @@ Assert-Match $header '(?s)\.header-logo,\s*\.header-notice-icon,\s*\.notice-dot\
|
|||||||
if ($header -match '(?s)\.notice-dot\s*\{[^}]*position\s*:') {
|
if ($header -match '(?s)\.notice-dot\s*\{[^}]*position\s*:') {
|
||||||
throw 'PageHeader notice dot must use grid alignment instead of positioning'
|
throw 'PageHeader notice dot must use grid alignment instead of positioning'
|
||||||
}
|
}
|
||||||
|
Assert-Match $header '(?s)\.page-header-slot\s*\{[^}]*height:\s*calc\(104rpx \+ var\(--status-bar-height, 0px\)\);' 'PageHeader secondary slot must reserve status bar plus 104rpx content height'
|
||||||
|
Assert-Match $header '(?s)\.page-header\s*\{[^}]*height:\s*calc\(104rpx \+ var\(--status-bar-height, 0px\)\);[^}]*padding-top:\s*var\(--status-bar-height, 0px\);' 'PageHeader secondary header must place its 104rpx content below the status bar'
|
||||||
|
Assert-Match $header '(?s)\.page-header-slot--root\s*\{[^}]*height:\s*calc\(124rpx \+ var\(--status-bar-height, 0px\)\);' 'PageHeader root slot height must remain unchanged'
|
||||||
|
Assert-Match $header '(?s)\.page-header--root\s*\{[^}]*height:\s*calc\(124rpx \+ var\(--status-bar-height, 0px\)\);' 'PageHeader root height must remain unchanged'
|
||||||
|
|
||||||
if ($card -match '(?im)(?<![-\w])position\s*:') {
|
if ($card -match '(?im)(?<![-\w])position\s*:') {
|
||||||
throw 'GenealogyCard must use grid instead of positioning'
|
throw 'GenealogyCard must use grid instead of positioning'
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ foreach ($pattern in @(
|
|||||||
if ($header -notmatch $pattern) { throw "PageHeader accessibility contract missing: $pattern" }
|
if ($header -notmatch $pattern) { throw "PageHeader accessibility contract missing: $pattern" }
|
||||||
}
|
}
|
||||||
if (-not $header.Contains('fallbackUrl')) { throw 'PageHeader must expose a deep-link fallback route' }
|
if (-not $header.Contains('fallbackUrl')) { throw 'PageHeader must expose a deep-link fallback route' }
|
||||||
|
foreach ($token in @(
|
||||||
|
'customBack: { type: Boolean, default: false }',
|
||||||
|
'const emit = defineEmits(["brand", "notice", "action", "back"]);',
|
||||||
|
'if (props.customBack) {',
|
||||||
|
'emit("back");',
|
||||||
|
'uni.navigateBack();',
|
||||||
|
'uni.reLaunch({ url: props.fallbackUrl });'
|
||||||
|
)) {
|
||||||
|
if (-not $header.Contains($token)) { throw "PageHeader back contract missing: $token" }
|
||||||
|
}
|
||||||
|
|
||||||
$dialog = Read-Utf8 'components/AppDialog.vue'
|
$dialog = Read-Utf8 'components/AppDialog.vue'
|
||||||
foreach ($token in @('role="dialog"', 'aria-modal="true"', 'tabindex="-1"', '@keydown.esc.stop="cancel"', 'max-height: calc(100vh - 80rpx)', 'overflow-y: auto')) {
|
foreach ($token in @('role="dialog"', 'aria-modal="true"', 'tabindex="-1"', '@keydown.esc.stop="cancel"', 'max-height: calc(100vh - 80rpx)', 'overflow-y: auto')) {
|
||||||
|
|||||||
Reference in New Issue
Block a user