index.wxml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <!-- 搜索框 -->
  2. <search></search>
  3. <!-- 轮播图 -->
  4. <view class="hmly-swiper-container">
  5. <swiper class="hmly-swiper" autoplay="true" circular="true"
  6. interval="3000" easing-function="easeOutCubic"
  7. current="{{swiperCurren}}"
  8. bindchange="swiperChange">
  9. <!-- 轮播图图片 -->
  10. <swiper-item class="hmly-swiper-item" wx:for="{{imgList}}" wx:key="index">
  11. <!-- 加上widthFix可以使图片自适应 -->
  12. <image src="{{item}}"></image>
  13. </swiper-item>
  14. </swiper>
  15. <!-- 为了和喜马拉雅一致,自己需定制轮播图dots -->
  16. <view class="hmly-dots">
  17. <block wx:for="{{imgList.length}}" wx:key="index">
  18. <view class="hmly-dots-item{{index == swiperCurrent ? ' hmly-dot-active' : ''}}"></view>
  19. </block>
  20. </view>
  21. </view>
  22. <!-- 宫格导航 -->
  23. <view class="hmly-nav">
  24. <block>
  25. <view class="hmly-nav-item" bindtap="{{item.events}}" wx:for="{{navList}}" wx:key="index">
  26. <!--
  27. 因为没有合适的图,所以全部使用的一样的
  28. 并且因为界面都是一致的就是内容不同,这里为了简单,使用的都是统一界面
  29. 解决办法:你可以通过页面传参的方式来进行区分
  30. -->
  31. <image class="hmly-nav-icon" src="{{item.icon}}" mode="widthFix" lazy-load="false"></image>
  32. <text class="hmly-nav-text">{{item.text}}</text>
  33. </view>
  34. </block>
  35. </view>
  36. <!-- 猜你喜欢 -->
  37. <view class="hmly-like">
  38. <view class="hmly-bar-title">
  39. <view class="hmly-title-left">猜你喜欢</view>
  40. <view class="hmly-title-right">查看全部 <text class="icon-right"></text> </view>
  41. </view>
  42. <!-- 这没有使用数据绑定,因为是练手而且数据比较少 -->
  43. <view class="hmly-like-item-box">
  44. <view class="hmly-like-item"
  45. bindtap="gotoDetails"
  46. data-coverImg="{{item.coverMiddle}}"
  47. data-title="{{item.intro}}"
  48. wx:for="{{guess}}"
  49. wx:key="{{index}}"
  50. >
  51. <view class="hmly-like-img">
  52. <image class="hmly-like-item-icon" src="{{item.coverMiddle}}" mode="widthFix"></image>
  53. <view class="hmly-like-cover">
  54. <!-- text用来显示icon 暂无 -->
  55. <text class=""></text> 4.6亿
  56. </view>
  57. </view>
  58. <view class="hmly-like-text">{{item.intro}}</view>
  59. </view>
  60. </view>
  61. </view>
  62. <!-- 有数据的时候显示 -->
  63. <block wx:if="{{showitem}}">
  64. <!-- 有声小说 -->
  65. <view class="hmly-content-list">
  66. <view class="hmly-bar-title">
  67. <view class="hmly-title-left">有声小说</view>
  68. <view class="hmly-title-right">查看全部<text class="icon-right"></text></view>
  69. </view>
  70. <block wx:for="{{xiaoshuocontent}}" wx:key="index">
  71. <view class="hmly-content" bindtap="gotoDetails" data-coverImg="{{item.albumCoverUrl290}}" data-title="{{item.title}}">
  72. <view class="hmly-content-img">
  73. <image src="{{item.albumCoverUrl290}}" mode="widthFix"></image>
  74. </view>
  75. <view class="hmly-content-right">
  76. <view class="hmly-content-title">
  77. <view class="hmly-title-text">{{item.title}}</view>
  78. <view class="hmly-introduction">{{item.trackTitle}}</view>
  79. </view>
  80. <view class="hmly-count">
  81. <view class="hmly-play-count">
  82. <!-- <text class="icon-"></text> -->
  83. 126亿
  84. </view>
  85. <view class="hmly-ji-count">{{item.tracks}}集</view>
  86. </view>
  87. </view>
  88. </view>
  89. </block>
  90. </view>
  91. <!-- 相声评书 -->
  92. <view class="hmly-content-list">
  93. <view class="hmly-bar-title">
  94. <view class="hmly-title-left">相声评书</view>
  95. <view class="hmly-title-right">查看全部<text class="icon-right"></text></view>
  96. </view>
  97. <block wx:for="{{xiangshengcontent}}" wx:key="index">
  98. <view class="hmly-content" bindtap="gotoDetails" data-coverImg="{{item.albumCoverUrl290}}" data-title="{{item.title}}">
  99. <view class="hmly-content-img">
  100. <image src="{{item.albumCoverUrl290}}" mode="widthFix"></image>
  101. </view>
  102. <view class="hmly-content-right">
  103. <view class="hmly-content-title">
  104. <view class="hmly-title-text">{{item.title}}</view>
  105. <view class="hmly-introduction">{{item.trackTitle}}</view>
  106. </view>
  107. <view class="hmly-count">
  108. <view class="hmly-play-count">
  109. <!-- <text class="icon-"></text> -->
  110. 126亿
  111. </view>
  112. <view class="hmly-ji-count">{{item.tracks}}集</view>
  113. </view>
  114. </view>
  115. </view>
  116. </block>
  117. </view>
  118. <!-- 脱口秀 -->
  119. <view class="hmly-content-list">
  120. <view class="hmly-bar-title">
  121. <view class="hmly-title-left">脱口秀</view>
  122. <view class="hmly-title-right">查看全部<text class="icon-right"></text></view>
  123. </view>
  124. <block wx:for="{{tuokocontent}}" wx:key="index">
  125. <view class="hmly-content" bindtap="gotoDetails" data-coverImg="{{item.albumCoverUrl290}}" data-title="{{item.title}}">
  126. <view class="hmly-content-img">
  127. <image src="{{item.albumCoverUrl290}}" mode="widthFix" lazy-load="false"></image>
  128. </view>
  129. <view class="hmly-content-right">
  130. <view class="hmly-content-title">
  131. <view class="hmly-title-text">{{item.title}}</view>
  132. <view class="hmly-introduction">{{item.trackTitle}}</view>
  133. </view>
  134. <view class="hmly-count">
  135. <view class="hmly-play-count">
  136. <!-- <view class="icon-"></view> -->
  137. 126亿
  138. </view>
  139. <view class="hmly-ji-count">{{item.tracks}}集</view>
  140. </view>
  141. </view>
  142. </view>
  143. </block>
  144. </view>
  145. </block>
  146. <block wx:else>
  147. <view class="hmly-data-notip">
  148. <view class="hmly-tip">
  149. 网络暂时走丢了,请稍后再试
  150. </view>
  151. </view>
  152. </block>