feat: 完成首页修改

This commit is contained in:
R524809
2026-04-30 18:02:11 +08:00
parent 44182d011d
commit 50394154f7
3 changed files with 89 additions and 54 deletions
+57 -42
View File
@@ -2,7 +2,7 @@
<nav-bar title="" />
<view class="home-body">
<view class="home-search-wrap">
<!-- <view class="home-search-wrap">
<view class="home-search">
<van-icon
name="search"
@@ -13,7 +13,7 @@
>{{searchPlaceholder}}</text
>
</view>
</view>
</view> -->
<view class="home-tabs-wrap">
<category-tabs
@@ -22,50 +22,63 @@
bind:change="onTabChange" />
</view>
<scroll-view class="home-track-scroll" scroll-x enable-flex>
<view class="home-hero-row">
<swiper
class="home-hero-swiper"
previous-margin="100rpx"
next-margin="100rpx"
circular="{{featuredItems.length > 1 && !loading}}"
autoplay="{{!loading}}"
interval="{{4000}}"
duration="{{600}}"
easing-function="easeInOutCubic"
bindchange="onHeroSwiperChange">
<swiper-item
wx:for="{{featuredItems}}"
wx:key="id"
class="home-hero-swiper-item">
<view
wx:for="{{featuredItems}}"
wx:key="id"
class="home-hero-card {{item.skeleton ? 'home-hero-card--skeleton' : ''}}"
data-title="{{item.title}}"
data-path="{{item.path}}"
bindtap="{{item.skeleton ? '' : 'onTapFeatured'}}">
<view class="home-hero-card__top">
<image
wx:if="{{!item.skeleton && item.previewImg}}"
class="home-hero-card__cover"
src="{{item.previewImg}}"
mode="aspectFill" />
<text
wx:if="{{!item.skeleton && !item.previewImg}}"
class="home-hero-card__icon"
>{{item.icon}}</text
>
<text
wx:if="{{item.badge}}"
class="home-hero-card__badge"
>{{item.badge}}</text
>
</view>
<view class="home-hero-card__body">
<view class="home-hero-card__title-row">
<text class="home-hero-card__title"
>{{item.title}}</text
class="home-hero-card-wrap {{heroSwiperCurrent === index ? 'home-hero-card-wrap--active' : ''}}">
<view
class="home-hero-card {{item.skeleton ? 'home-hero-card--skeleton' : ''}}"
data-title="{{item.title}}"
data-path="{{item.path}}"
bindtap="{{item.skeleton ? '' : 'onTapFeatured'}}">
<view class="home-hero-card__top">
<image
wx:if="{{!item.skeleton && item.previewImg}}"
class="home-hero-card__cover"
src="{{item.previewImg}}"
mode="aspectFill" />
<text
wx:if="{{!item.skeleton && !item.previewImg}}"
class="home-hero-card__icon"
>{{item.icon}}</text
>
<text
wx:if="{{!item.skeleton}}"
class="home-hero-card__meta"
>{{item.ageBand}} · {{item.difficulty}}</text
wx:if="{{item.badge}}"
class="home-hero-card__badge"
>{{item.badge}}</text
>
</view>
<view class="home-hero-card__body">
<view class="home-hero-card__title-row">
<text class="home-hero-card__title"
>{{item.title}}</text
>
<text
wx:if="{{!item.skeleton}}"
class="home-hero-card__meta"
>{{item.ageBand}}·{{item.difficulty}}</text
>
</view>
<text class="home-hero-card__sub"
>{{item.subtitle}}</text
>
</view>
<text class="home-hero-card__sub"
>{{item.subtitle}}</text
>
</view>
</view>
</view>
</scroll-view>
</swiper-item>
</swiper>
<view class="home-section-panel">
<view class="home-section-head">
@@ -141,9 +154,11 @@
</view>
<view
wx:if="{{!item.skeleton}}"
class="home-hot-card__action"
>
<toy-icon name="arrow-right" size="36rpx" color="#2b2b2b" />
class="home-hot-card__action">
<toy-icon
name="arrow-right"
size="36rpx"
color="#2b2b2b" />
</view>
</view>
</view>