147 lines
6.6 KiB
Plaintext
147 lines
6.6 KiB
Plaintext
<view class="home-page-root">
|
|
<navigation-bar title="{{navTitle}}" showBack="{{false}}" isTabPage="{{true}}" color="#2d2430" background="#fff7f8"></navigation-bar>
|
|
|
|
<view class="home-scroll">
|
|
<view class="page-shell home-page {{keyboardVisible ? 'keyboard-active' : ''}}">
|
|
<view class="page-content">
|
|
<view class="page-hero home-hero">
|
|
<text class="hero-kicker">{{isLoggedIn ? greeting : 'YUMI NAIL 小程序'}}</text>
|
|
<text class="hero-title">{{displayName}}</text>
|
|
<text class="hero-desc">先选喜欢的作品。</text>
|
|
|
|
<view class="hero-action-row">
|
|
<view class="hero-action primary" bindtap="handleProfileTap">{{isLoggedIn ? '进入个人中心' : '立即登录'}}</view>
|
|
<view class="hero-action secondary" bindtap="handleSeeAllPopular">看看热门作品</view>
|
|
</view>
|
|
|
|
<view id="home-search-anchor" class="search-box">
|
|
<input
|
|
class="search-input"
|
|
placeholder="搜索作品、风格或门店"
|
|
placeholder-class="field-placeholder"
|
|
value="{{searchKeyword}}"
|
|
bindinput="handleSearchInput"
|
|
bindconfirm="handleSearchConfirm"
|
|
bindfocus="handleSearchFocus"
|
|
bindblur="handleSearchBlur"
|
|
data-keyboard-anchor="home-search-anchor"
|
|
adjust-position="false"
|
|
cursor-spacing="{{keyboardCursorSpacing}}"
|
|
confirm-type="search"
|
|
/>
|
|
<view class="search-btn" bindtap="handleSearchConfirm">搜索</view>
|
|
</view>
|
|
|
|
<view class="summary-strip">
|
|
<view class="summary-metric">
|
|
<text class="summary-label">门店橱窗</text>
|
|
<text class="summary-value">{{bannerImages.length ? bannerImages.length : 0}} 家</text>
|
|
<text class="summary-note">看环境</text>
|
|
</view>
|
|
<view class="summary-metric">
|
|
<text class="summary-label">精选作品</text>
|
|
<text class="summary-value">{{featuredItems.length ? featuredItems.length : 0}} 款</text>
|
|
<text class="summary-note">找灵感</text>
|
|
</view>
|
|
<view class="summary-metric">
|
|
<text class="summary-label">热门推荐</text>
|
|
<text class="summary-value">{{popularItems.length ? popularItems.length : 0}} 条</text>
|
|
<text class="summary-note">热门款</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{!isLoggedIn}}" class="guest-tip">
|
|
登录后可同步收藏和预约记录。
|
|
</view>
|
|
</view>
|
|
|
|
<view class="section-block">
|
|
<view class="section-head">
|
|
<view class="section-copy">
|
|
<text class="section-kicker">门店氛围</text>
|
|
<text class="section-title">先看看线下环境</text>
|
|
<text class="section-subtitle">看店铺环境</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view wx:if="{{bannerImages.length}}" class="banner-box page-card">
|
|
<swiper class="banner-swiper" indicator-dots autoplay circular interval="3200">
|
|
<swiper-item wx:for="{{bannerImages}}" wx:key="id">
|
|
<view class="banner-item" data-shop-id="{{item.shopId}}" bindtap="handleBannerTap">
|
|
<image class="banner-image" src="{{item.imageUrl}}" mode="aspectFill" lazy-load="{{true}}"></image>
|
|
<view class="banner-mask">
|
|
<view class="banner-badge">门店实拍</view>
|
|
<view class="banner-title">{{item.shopName}}</view>
|
|
<view class="banner-desc">{{item.businessHours}}</view>
|
|
</view>
|
|
</view>
|
|
</swiper-item>
|
|
</swiper>
|
|
</view>
|
|
|
|
<view wx:else class="page-card empty-card">
|
|
<text class="empty-title">门店内容正在补充中</text>
|
|
<text class="empty-desc">先看看作品。</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="section-block">
|
|
<view class="section-head">
|
|
<view class="section-copy">
|
|
<text class="section-kicker">快速入门</text>
|
|
<text class="section-title">精选作品</text>
|
|
<text class="section-subtitle">先看热门款</text>
|
|
</view>
|
|
<view class="section-link" bindtap="handleSeeAllFeatured">查看全部</view>
|
|
</view>
|
|
|
|
<view wx:if="{{featuredItems.length}}" class="featured-panel">
|
|
<scroll-view class="featured-scroll" scroll-x enable-flex>
|
|
<view class="featured-list">
|
|
<view wx:for="{{featuredItems}}" wx:key="id" class="featured-card">
|
|
<product-card item="{{item}}" bindselect="handleProductSelect"></product-card>
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
|
|
<view wx:else class="page-card empty-card">
|
|
<text class="empty-title">精选作品正在整理中</text>
|
|
<text class="empty-desc">稍后再来看看。</text>
|
|
</view>
|
|
</view>
|
|
|
|
<view class="section-block">
|
|
<view class="section-head">
|
|
<view class="section-copy">
|
|
<text class="section-kicker">热门预约</text>
|
|
<text class="section-title">最近大家都在看</text>
|
|
<text class="section-subtitle">热门款式</text>
|
|
</view>
|
|
<view class="section-link" bindtap="handleSeeAllPopular">查看全部</view>
|
|
</view>
|
|
|
|
<view wx:if="{{popularItems.length}}" class="popular-grid">
|
|
<view wx:for="{{popularItems}}" wx:key="id" class="popular-card">
|
|
<product-card item="{{item}}" show-stats="{{true}}" bindselect="handleProductSelect"></product-card>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{popularItems.length && (loadingMore || !hasMore)}}" class="section-load-state">
|
|
<text class="section-load-text">{{loadingMore ? '正在加载更多热门作品...' : '已经到底了'}}</text>
|
|
</view>
|
|
|
|
<view wx:elif="{{loading}}" class="page-card empty-card">
|
|
<text class="empty-title">正在加载首页内容</text>
|
|
</view>
|
|
|
|
<view wx:else class="page-card empty-card">
|
|
<text class="empty-title">还没有热门作品</text>
|
|
<text class="empty-desc">稍后再来看看。</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view wx:if="{{keyboardVisible}}" class="keyboard-light-spacer" style="height: {{keyboardInsetRpx}}rpx;"></view>
|
|
</view>
|
|
</view>
|
|
</view>
|