bookshelf.wxml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!--pages/bookshelf/bookshelf.wxml-->
  2. <view class="container">
  3. <!-- 顶部标签页 -->
  4. <view class="tabs">
  5. <view class="tab {{activeTab === 'history' ? 'active' : ''}}" bindtap="switchTab" data-tab="history">
  6. 阅读记录
  7. </view>
  8. <!-- <view class="tab {{activeTab === 'edit' ? 'active' : ''}}" bindtap="switchTab" data-tab="edit">
  9. 编辑书架
  10. </view> -->
  11. </view>
  12. <!-- 书籍列表 -->
  13. <scroll-view scroll-y class="book-list" bindscrolltolower="loadMore">
  14. <view class="book-grid">
  15. <view class="book-item" wx:for="{{bookList}}" wx:key="id" bindtap="goToBookDetail" data-book="{{item}}">
  16. <view class="book-cover-wrap">
  17. <image class="book-cover" src="{{item.novelCover}}" mode="aspectFill"/>
  18. <text class="read-status" wx:if="{{activeTab === 'history'}}">读过</text>
  19. </view>
  20. <text class="book-title">{{item.novelTitle}}</text>
  21. <text class="latest-chapter" wx:if="{{item.novelChapterTitle}}">{{item.novelChapterTitle}}</text>
  22. </view>
  23. </view>
  24. <!-- 加载状态 -->
  25. <view class="loading" wx:if="{{loading}}">
  26. <text>加载中...</text>
  27. </view>
  28. <!-- 没有更多 -->
  29. <view class="no-more" wx:if="{{!loading && bookList.length > 0}}">
  30. <text>没有更多了</text>
  31. </view>
  32. <!-- 空状态 -->
  33. <view class="empty" wx:if="{{!loading && bookList.length === 0}}">
  34. <text wx:if="{{activeTab === 'history'}}">暂无阅读记录</text>
  35. <text wx:else>暂无收藏书籍</text>
  36. </view>
  37. </scroll-view>
  38. </view>