216 lines
11 KiB
Plaintext
216 lines
11 KiB
Plaintext
<view class="fav-page">
|
|
<nav-bar title="我的收藏" />
|
|
|
|
<scroll-view
|
|
class="fav-scroll"
|
|
style="height: {{favScrollHeight}}px;"
|
|
scroll-y
|
|
enhanced
|
|
show-scrollbar="{{false}}">
|
|
<view class="fav-body">
|
|
<view class="fav-seg">
|
|
<view
|
|
class="fav-seg__pill {{activeTab === 'favorites' ? 'fav-seg__pill--active' : ''}}"
|
|
data-tab="favorites"
|
|
bindtap="onTabSwitch">
|
|
<text class="fav-seg__text">收藏的题型</text>
|
|
</view>
|
|
<view
|
|
class="fav-seg__pill {{activeTab === 'downloads' ? 'fav-seg__pill--active' : ''}}"
|
|
data-tab="downloads"
|
|
bindtap="onTabSwitch">
|
|
<text class="fav-seg__text">下载历史</text>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- 收藏的题型 -->
|
|
<block wx:if="{{activeTab === 'favorites'}}">
|
|
<view wx:if="{{favLoading}}" class="fav-loading">
|
|
<text
|
|
class="toy-icon toy-icon-loading fav-loading__icon"
|
|
aria-hidden="true"></text>
|
|
</view>
|
|
<view wx:elif="{{favoriteList.length === 0}}" class="fav-empty">
|
|
<toy-icon
|
|
name="mood-empty"
|
|
size="100rpx"
|
|
color="#b3ac9f"
|
|
class="fav-empty__icon" />
|
|
<text class="fav-empty__msg">还没找到收藏呢</text>
|
|
<text class="fav-empty__sub">去发现好玩的练习纸吧~</text>
|
|
<button class="fav-cta__btn" bindtap="onDiscoverTap">
|
|
去发现页看看
|
|
</button>
|
|
</view>
|
|
<view wx:elif="{{favoriteList.length > 0}}" class="fav-list">
|
|
<block wx:for="{{favoriteList}}" wx:key="id">
|
|
<view
|
|
class="fav-card fav-card--row"
|
|
data-path="{{item.path}}"
|
|
bindtap="onCardTap">
|
|
<image
|
|
class="fav-card__thumb"
|
|
src="{{item.thumb}}"
|
|
mode="aspectFill" />
|
|
<view class="fav-card__main">
|
|
<text class="fav-card__title"
|
|
>{{item.title}}</text
|
|
>
|
|
<view class="fav-card__meta">
|
|
<text class="fav-card__meta-text"
|
|
>{{item.metaLine}}</text
|
|
>
|
|
<view
|
|
class="fav-card__stars"
|
|
aria-label="{{item.stars}} 星">
|
|
<van-icon
|
|
wx:if="{{item.stars >= 1}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
<van-icon
|
|
wx:if="{{item.stars >= 2}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
<van-icon
|
|
wx:if="{{item.stars >= 3}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
</view>
|
|
</view>
|
|
<text class="fav-card__badge"
|
|
>{{item.timeBadge}}</text
|
|
>
|
|
</view>
|
|
<view
|
|
class="fav-card__heart"
|
|
data-id="{{item.id}}"
|
|
catchtap="onRemoveFavorite"
|
|
aria-role="button"
|
|
aria-label="取消收藏">
|
|
<van-icon
|
|
name="like"
|
|
size="40rpx"
|
|
color="#b02500" />
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
<view wx:if="{{favoriteList.length > 0}}" class="fav-cta">
|
|
<text class="fav-cta__hint">发现更多有趣的内容?</text>
|
|
<button class="fav-cta__btn" bindtap="onDiscoverTap">
|
|
去发现页看看
|
|
</button>
|
|
</view>
|
|
</block>
|
|
|
|
<!-- 下载历史 -->
|
|
<block wx:if="{{activeTab === 'downloads'}}">
|
|
<view wx:if="{{dlLoading}}" class="fav-loading">
|
|
<text
|
|
class="toy-icon toy-icon-loading fav-loading__icon"
|
|
aria-hidden="true"></text>
|
|
</view>
|
|
<view
|
|
wx:elif="{{downloadSections.length === 0}}"
|
|
class="fav-empty">
|
|
<toy-icon
|
|
name="mood-empty"
|
|
size="100rpx"
|
|
color="#b3ac9f"
|
|
class="fav-empty__icon" />
|
|
<text class="fav-empty__msg">暂无下载记录</text>
|
|
<text class="fav-empty__sub">去发现好玩的练习纸吧~</text>
|
|
<button class="fav-cta__btn" bindtap="onDiscoverTap">
|
|
去发现页看看
|
|
</button>
|
|
</view>
|
|
<view wx:elif="{{downloadSections.length > 0}}" class="fav-dl">
|
|
<block
|
|
wx:for="{{downloadSections}}"
|
|
wx:for-item="section"
|
|
wx:key="key">
|
|
<text class="fav-dl__section-label"
|
|
>{{section.label}}</text
|
|
>
|
|
<view class="fav-dl__items">
|
|
<view
|
|
wx:for="{{section.items}}"
|
|
wx:for-item="row"
|
|
wx:key="id"
|
|
class="fav-dl-row {{row.placeholder === 'draw' ? 'fav-dl-row--muted' : ''}}"
|
|
data-path="{{row.path}}"
|
|
bindtap="onCardTap">
|
|
<view
|
|
wx:if="{{row.placeholder === 'draw'}}"
|
|
class="fav-dl-row__thumb fav-dl-row__thumb--ph">
|
|
<van-icon
|
|
name="brush-o"
|
|
size="56rpx"
|
|
color="#6d5720" />
|
|
</view>
|
|
<image
|
|
wx:else
|
|
class="fav-dl-row__thumb"
|
|
src="{{row.thumb}}"
|
|
mode="aspectFill" />
|
|
<view class="fav-dl-row__main">
|
|
<text class="fav-dl-row__title"
|
|
>{{row.title}}</text
|
|
>
|
|
<view class="fav-card__meta">
|
|
<text class="fav-card__meta-text"
|
|
>{{row.metaLine}}</text
|
|
>
|
|
<view
|
|
class="fav-card__stars"
|
|
aria-label="{{row.stars}} 星">
|
|
<van-icon
|
|
wx:if="{{row.stars >= 1}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
<van-icon
|
|
wx:if="{{row.stars >= 2}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
<van-icon
|
|
wx:if="{{row.stars >= 3}}"
|
|
name="star"
|
|
size="22rpx"
|
|
color="#d4a900" />
|
|
</view>
|
|
</view>
|
|
<view class="fav-dl-row__meta">
|
|
<van-icon
|
|
name="clock"
|
|
size="26rpx"
|
|
color="#605b50" />
|
|
<text class="fav-dl-row__time"
|
|
>{{row.time}}</text
|
|
>
|
|
<view class="fav-dl-row__dot" />
|
|
<text
|
|
class="fav-dl-row__status {{row.statusHighlight ? 'fav-dl-row__status--hi' : ''}}"
|
|
>{{row.status}}</text
|
|
>
|
|
</view>
|
|
</view>
|
|
<view class="fav-dl-row__more">
|
|
<toy-icon
|
|
name="arrow-right"
|
|
size="36rpx"
|
|
color="#2b2b2b" />
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</block>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|