index.wxml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <!--index.wxml-->
  2. <view class="container">
  3. <!-- 登录加载提示 -->
  4. <view class="loading-mask" wx:if="{{isLoggingIn}}">
  5. <view class="loading-content">
  6. <view class="loading-icon"></view>
  7. <text>登录中...</text>
  8. </view>
  9. </view>
  10. <!-- 头部区域 -->
  11. <!-- <view class="header">
  12. <view class="avatar">
  13. <image src="/assets/images/avatar-placeholder.png" mode="aspectFill"></image>
  14. </view>
  15. </view> -->
  16. <view class="main-wrapper" wx:if="{{!isLoggingIn}}">
  17. <!-- 性别切换和搜索区域 -->
  18. <view class="tab-search">
  19. <gender-tabs gender="{{gender}}" bind:switch="switchGender"/>
  20. <view class="search-box" bindtap="goToSearch">
  21. <icon type="search" size="22" color="#999"></icon>
  22. <input placeholder="请输入书名/口令搜索" disabled="true" placeholder-class="placeholder"/>
  23. <view class="search-placeholder"></view>
  24. </view>
  25. </view>
  26. <!-- 主Banner区域 -->
  27. <view wx:if="{{bannerList.length > 0}}" class="main-banner">
  28. <swiper
  29. autoplay="{{autoplay}}"
  30. interval="{{interval}}"
  31. duration="{{duration}}"
  32. circular="true"
  33. class="banner-swiper">
  34. <swiper-item wx:for="{{bannerList}}" wx:key="id">
  35. <image src="{{item.cover}}" mode="aspectFill" bindtap="goToBookDetail" data-book-id="{{item.id}}"
  36. data-wx-book-id="{{item.wxBookId}}"
  37. data-chapter-id="{{item.chapterId}}"/>
  38. </swiper-item>
  39. </swiper>
  40. </view>
  41. <!-- 功能区 -->
  42. <view class="feature-section">
  43. <view class="feature-item" bindtap="goToFeature" data-feature="recent">
  44. <image src="/assets/images/icons/icon-recent.png" mode="aspectFit"></image>
  45. <text>最近阅读</text>
  46. </view>
  47. <view class="feature-item" bindtap="goToFeature" data-feature="user">
  48. <image src="/assets/images/icons/icon-user.png" mode="aspectFit"></image>
  49. <text>个人中心</text>
  50. </view>
  51. <view class="feature-item" bindtap="goToFeature" data-feature="category">
  52. <image src="/assets/images/icons/icon-category.png" mode="aspectFit"></image>
  53. <text>热门分类</text>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 主编推荐 -->
  58. <view class="recommend-section">
  59. <view class="section-header">
  60. <text class="title">{{cardNovels[0].name}}</text>
  61. <navigator url="/pages/book/list?type=editor&id={{cardNovels[0].settingId}}&name={{cardNovels[0].name}}" class="more">更多 ></navigator>
  62. </view>
  63. <view class="recommend-main">
  64. <view class="recommend-large" wx:if="{{recommendBooks[0]}}" bindtap="goToBookDetail"
  65. data-book-id="{{recommendBooks[0].id}}"
  66. data-wx-book-id="{{recommendBooks[0].wxBookId}}"
  67. data-chapter-id="{{recommendBooks[0].chapterId}}">
  68. <image src="{{recommendBooks[0].cover}}" mode="aspectFill"></image>
  69. <view class="book-info">
  70. <view class="book-title">{{recommendBooks[0].title}}</view>
  71. <view class="book-desc">{{recommendBooks[0].desc}}</view>
  72. <view class="book-stats">{{recommendBooks[0].stats}}</view>
  73. </view>
  74. </view>
  75. </view>
  76. <view class="recommend-books">
  77. <view class="book-item"
  78. wx:for="{{bookList}}"
  79. wx:key="id"
  80. bindtap="goToBookDetail"
  81. data-book-id="{{item.id}}"
  82. data-wx-book-id="{{item.wxBookId}}"
  83. data-chapter-id="{{item.chapterId}}">
  84. <image src="{{item.cover}}" mode="aspectFill"></image>
  85. <text>{{item.title}}</text>
  86. </view>
  87. </view>
  88. </view>
  89. <!-- 全网热推 -->
  90. <view class="hot-section">
  91. <view class="section-header">
  92. <text class="title">{{cardNovels[1].name}}</text>
  93. <navigator url="/pages/book/list?type=editor&id={{cardNovels[1].settingId}}&name={{cardNovels[1].name}}" class="more">更多 ></navigator>
  94. </view>
  95. <view class="hot-books">
  96. <view class="hot-book-item"
  97. wx:for="{{hotBooks}}"
  98. wx:key="id"
  99. bindtap="goToBookDetail"
  100. data-book-id="{{item.id}}"
  101. data-wx-book-id="{{item.wxBookId}}"
  102. data-chapter-id="{{item.chapterId}}">
  103. <image src="{{item.cover}}" mode="aspectFill"></image>
  104. <view class="hot-book-info">
  105. <view class="hot-book-title">{{item.title}}</view>
  106. <view class="hot-book-desc">{{item.desc}}</view>
  107. <view class="hot-book-stats">{{item.stats}}</view>
  108. </view>
  109. </view>
  110. </view>
  111. </view>
  112. <!-- 强力推荐 -->
  113. <view class="strong-recommend" wx:if="{{strongBooks.length>0}}">
  114. <view class="section-header">
  115. <text class="title">{{cardNovels[2].name}}</text>
  116. <navigator url="/pages/book/list?type=editor&id={{cardNovels[2].settingId}}&name={{cardNovels[2].name}}" class="more">更多 ></navigator>
  117. </view>
  118. <view class="strong-books">
  119. <view class="strong-book-item"
  120. wx:for="{{strongBooks}}"
  121. wx:key="id"
  122. bindtap="goToBookDetail"
  123. data-book-id="{{item.id}}"
  124. data-wx-book-id="{{item.wxBookId}}"
  125. data-chapter-id="{{item.chapterId}}">
  126. <image src="{{item.cover}}" mode="aspectFill"></image>
  127. <text>{{item.title}}</text>
  128. </view>
  129. </view>
  130. </view>
  131. <!-- 最近阅读悬浮按钮 -->
  132. <view class="recent-book-float"
  133. wx:if="{{showRecentBook && recentBook}}"
  134. bindtap="toggleRecentBook"
  135. animation="{{recentBookAnimation}}">
  136. <image src="{{recentBook.novelCover}}" mode="aspectFill"></image>
  137. <view class="recent-book-label">继续阅读</view>
  138. </view>
  139. </view>