book-min/miniprogram/pages/bookshelf/list.wxml

43 lines
1.4 KiB
Plaintext

<view class="bookshelf">
<!-- 分类选择 -->
<view class="categories">
<view class="category-item {{currentCategory === item ? 'active' : ''}}"
wx:for="{{categories}}"
wx:key="*this"
data-category="{{item}}"
bindtap="switchCategory">
{{item}}
</view>
</view>
<!-- 书籍列表 -->
<view class="book-list">
<view class="book-item"
wx:for="{{books}}"
wx:key="id"
bindtap="openReader"
data-id="{{item.id}}"
data-book-url="{{item.bookUrl}}">
<image class="book-cover" src="{{item.coverUrl}}" mode="aspectFill"/>
<view class="book-info">
<text class="book-title">{{item.title}}</text>
<text class="book-author">{{item.author}}</text>
<text class="book-desc">{{item.description}}</text>
<view class="book-meta">
<text class="book-category">{{item.category}}</text>
<!-- <text class="book-date">出版时间:{{item.publishDate}}</text> -->
</view>
</view>
</view>
</view>
<!-- 加载状态 -->
<view class="loading" wx:if="{{loading}}">加载中...</view>
<view class="no-more" wx:if="{{books.length >= total && total > 0}}">没有更多了</view>
<view class="empty" wx:if="{{books.length === 0 && !loading}}">暂无书籍</view>
<!-- 添加按钮 -->
<view class="add-btn" bindtap="goToAddBook">
<text class="add-icon">+</text>
</view>
</view>