feat:作业纸
This commit is contained in:
@@ -59,63 +59,76 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<swiper
|
||||
class="home-hero-swiper"
|
||||
previous-margin="80rpx"
|
||||
next-margin="80rpx"
|
||||
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
|
||||
class="home-hero-card-wrap {{heroSwiperCurrent === index ? 'home-hero-card-wrap--active' : ''}}">
|
||||
<view
|
||||
wx:if="{{loading || featuredItems.length > 0}}"
|
||||
class="home-hero-gallery">
|
||||
<!-- 按发布时仅裁页眉后的画幅展示,标题悬浮,不额外占用卡片高度。 -->
|
||||
<swiper
|
||||
class="home-hero-swiper"
|
||||
previous-margin="156rpx"
|
||||
next-margin="156rpx"
|
||||
current="{{heroSwiperCurrent}}"
|
||||
circular="{{featuredItems.length > 1 && !loading}}"
|
||||
autoplay="{{featuredItems.length > 1 && !loading}}"
|
||||
interval="{{5200}}"
|
||||
duration="{{500}}"
|
||||
easing-function="easeInOutCubic"
|
||||
bindchange="onHeroSwiperChange">
|
||||
<swiper-item
|
||||
wx:for="{{featuredItems}}"
|
||||
wx:key="id"
|
||||
class="home-hero-swiper-item">
|
||||
<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.badge}}"
|
||||
class="home-hero-card__badge"
|
||||
>{{item.badge}}</text
|
||||
>
|
||||
</view>
|
||||
<view class="home-hero-card__body">
|
||||
<view class="home-hero-card__title-row">
|
||||
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="aspectFit" />
|
||||
<view
|
||||
wx:if="{{!item.skeleton && !item.previewImg}}"
|
||||
class="home-hero-card__fallback">
|
||||
<text class="home-hero-card__icon"
|
||||
>{{item.icon}}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<view class="home-hero-card__title-overlay">
|
||||
<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>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view
|
||||
wx:if="{{!loading && featuredItems.length > 1}}"
|
||||
class="home-hero-pagination">
|
||||
<view class="home-hero-pagination__dots">
|
||||
<view
|
||||
wx:for="{{featuredItems}}"
|
||||
wx:key="id"
|
||||
class="home-hero-pagination__target"
|
||||
data-index="{{index}}"
|
||||
bindtap="onTapHeroDot"
|
||||
aria-role="button"
|
||||
aria-label="{{'查看第' + (index + 1) + '张练习纸'}}">
|
||||
<view
|
||||
class="home-hero-pagination__dot {{heroSwiperCurrent === index ? 'home-hero-pagination__dot--active' : ''}}" />
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<text class="home-hero-pagination__count"
|
||||
>{{heroSwiperCurrent + 1}} / {{featuredItems.length}}</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="home-section-panel">
|
||||
<view class="home-section-head">
|
||||
|
||||
Reference in New Issue
Block a user