perf: 优化首页效果
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="home-page">
|
<view class="home-page">
|
||||||
<!-- Pull-to-refresh wrapper -->
|
<!-- ① Brand Banner — fixed background layer -->
|
||||||
|
<view class="banner-fixed">
|
||||||
|
<BrandBanner :studio-info="studioStore.studioInfo" />
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- Pull-to-refresh wrapper — scrollable foreground -->
|
||||||
<scroll-view
|
<scroll-view
|
||||||
class="page-scroll"
|
class="page-scroll"
|
||||||
scroll-y
|
scroll-y
|
||||||
@@ -11,15 +16,19 @@
|
|||||||
@refresherrefresh="handleRefresh"
|
@refresherrefresh="handleRefresh"
|
||||||
@refresherrestore="refreshing = false"
|
@refresherrestore="refreshing = false"
|
||||||
>
|
>
|
||||||
<!-- ① Brand Banner (hero with bg image + centered logo) -->
|
<!-- Transparent spacer to reveal Banner behind -->
|
||||||
<BrandBanner :studio-info="studioStore.studioInfo" />
|
<view class="banner-spacer" />
|
||||||
|
|
||||||
|
<!-- Floating card with rounded top corners -->
|
||||||
|
<view class="floating-card">
|
||||||
|
<!-- Drag indicator -->
|
||||||
|
<view class="card-handle">
|
||||||
|
<view class="card-handle-bar" />
|
||||||
|
</view>
|
||||||
|
|
||||||
<!-- ② Studio Info (photo strip + address/phone) -->
|
<!-- ② Studio Info (photo strip + address/phone) -->
|
||||||
<StudioInfo :studio-info="studioStore.studioInfo" />
|
<StudioInfo :studio-info="studioStore.studioInfo" />
|
||||||
|
|
||||||
<!-- Divider -->
|
|
||||||
<view class="section-divider" />
|
|
||||||
|
|
||||||
<!-- ③ Quick Entry (login / trial / book / renew) -->
|
<!-- ③ Quick Entry (login / trial / book / renew) -->
|
||||||
<QuickEntry @scroll-to-card-shop="scrollToCardShop" />
|
<QuickEntry @scroll-to-card-shop="scrollToCardShop" />
|
||||||
|
|
||||||
@@ -33,12 +42,13 @@
|
|||||||
|
|
||||||
<!-- Bottom padding for tab bar -->
|
<!-- Bottom padding for tab bar -->
|
||||||
<view class="bottom-padding" />
|
<view class="bottom-padding" />
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
import { onShow, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
||||||
|
|
||||||
import BrandBanner from '../../components/BrandBanner.vue'
|
import BrandBanner from '../../components/BrandBanner.vue'
|
||||||
@@ -121,20 +131,55 @@ function scrollToCardShop() {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.home-page {
|
.home-page {
|
||||||
display: flex;
|
position: relative;
|
||||||
flex-direction: column;
|
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background: #FAF8F5;
|
background: #FAF8F5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-scroll {
|
/* Banner fixed behind everything */
|
||||||
flex: 1;
|
.banner-fixed {
|
||||||
overflow-y: auto;
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.section-divider {
|
/* Scroll layer sits above banner */
|
||||||
height: 16rpx;
|
.page-scroll {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
flex: 1;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Transparent spacer lets banner peek through */
|
||||||
|
.banner-spacer {
|
||||||
|
height: 420rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Floating card that overlaps the banner */
|
||||||
|
.floating-card {
|
||||||
|
position: relative;
|
||||||
background: #FAF8F5;
|
background: #FAF8F5;
|
||||||
|
border-radius: 32rpx 32rpx 0 0;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding-top: 12rpx;
|
||||||
|
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Small drag indicator at top of card */
|
||||||
|
.card-handle {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 16rpx 0 8rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-handle-bar {
|
||||||
|
width: 64rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
border-radius: 4rpx;
|
||||||
|
background: rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-padding {
|
.bottom-padding {
|
||||||
|
|||||||
Reference in New Issue
Block a user