- 新增微信小程序胶囊区域避让布局逻辑 - 统一首页导航与标题对齐规则 - 更新多处演示提示文案为正式表述 - 调整个人中心账户状态显示 - 优化产品页分享按钮条件渲染
37 lines
1.8 KiB
Plaintext
37 lines
1.8 KiB
Plaintext
<template>
|
|
<view class="header-wrap">
|
|
<view class="status-bar" :style="statusStyle(0)"></view>
|
|
<view class="app-header">
|
|
<view class="header-side" @click="handleBack"><AppIcon v-if="back" name="chevron-right" :size="48" class="back-icon" /></view>
|
|
<view class="header-title-area" :style="navigationTitleStyle()"><text class="header-title">{{ title }}</text></view>
|
|
<view class="header-side header-right"><slot></slot></view>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup lang="uts">
|
|
import { usePageLayout } from '@/services/layout.uts'
|
|
const { statusStyle, navigationTitleStyle } = usePageLayout()
|
|
import AppIcon from '@/components/AppIcon.uvue'
|
|
const props = defineProps({ title: { type: String, default: '' }, back: { type: Boolean, default: true }, customBack: { type: Boolean, default: false } })
|
|
const emit = defineEmits(['back'])
|
|
const handleBack = () => {
|
|
if (!props.back) return
|
|
if (props.customBack) { emit('back'); return }
|
|
const pages = getCurrentPages()
|
|
if (pages.length > 1) uni.navigateBack({ delta: 1 })
|
|
else uni.reLaunch({ url: '/pages/home/home' })
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.header-wrap { background-color: #ffffff; }
|
|
.status-bar { }
|
|
.app-header { height: 96rpx; padding: 0 24rpx; flex-direction: row; align-items: center; justify-content: space-between; border-bottom: 1rpx solid #edf1f7; position: relative; }
|
|
.header-side { width: 88rpx; height: 96rpx; align-items: flex-start; justify-content: center; flex-shrink: 0; }
|
|
.header-right { align-items: flex-end; }
|
|
.back-icon { transform: rotate(180deg); margin-top: 0; }
|
|
.header-title-area { position: absolute; left: 112rpx; right: 112rpx; top: 0; bottom: 0; align-items: center; justify-content: center; }
|
|
.header-title { text-align: center; font-size: 34rpx; font-weight: 700; color: #111d35; }
|
|
</style>
|