index.wxml 5.3 KB

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