index.wxml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  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" bindtap="gotoDetails" data-coverImg="{{item.coverMiddle}}" data-title="{{item.intro}}" wx:for="{{guess}}" wx:key="{{index}}">
  45. <view class="hmly-like-img">
  46. <image class="hmly-like-item-icon" src="{{item.coverMiddle}}" mode="widthFix"></image>
  47. <view class="hmly-like-cover">
  48. <!-- text用来显示icon 暂无 -->
  49. <text class=""></text> 4.6亿
  50. </view>
  51. </view>
  52. <view class="hmly-like-text">{{item.intro}}</view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 有数据的时候显示 -->
  57. <block wx:if="{{showitem}}">
  58. <!-- 有声小说 -->
  59. <view class="hmly-content-list">
  60. <view class="hmly-bar-title">
  61. <view class="hmly-title-left">有声小说</view>
  62. <view class="hmly-title-right">查看全部<text class="icon-right"></text></view>
  63. </view>
  64. <block wx:for="{{xiaoshuocontent}}" wx:key="index">
  65. <view class="hmly-content" bindtap="gotoDetails" data-coverImg="{{item.albumCoverUrl290}}" 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}}" data-title="{{item.title}}">
  93. <view class="hmly-content-img">
  94. <image src="{{item.albumCoverUrl290}}" mode="widthFix"></image>
  95. </view>
  96. <view class="hmly-content-right">
  97. <view class="hmly-content-title">
  98. <view class="hmly-title-text">{{item.title}}</view>
  99. <view class="hmly-introduction">{{item.trackTitle}}</view>
  100. </view>
  101. <view class="hmly-count">
  102. <view class="hmly-play-count">
  103. <!-- <text class="icon-"></text> -->
  104. 126亿
  105. </view>
  106. <view class="hmly-ji-count">{{item.tracks}}集</view>
  107. </view>
  108. </view>
  109. </view>
  110. </block>
  111. </view>
  112. <!-- 脱口秀 -->
  113. <view class="hmly-content-list">
  114. <view class="hmly-bar-title">
  115. <view class="hmly-title-left">脱口秀</view>
  116. <view class="hmly-title-right">查看全部<text class="icon-right"></text></view>
  117. </view>
  118. <block wx:for="{{tuokocontent}}" wx:key="index">
  119. <view class="hmly-content" bindtap="gotoDetails" data-coverImg="{{item.albumCoverUrl290}}" data-title="{{item.title}}">
  120. <view class="hmly-content-img">
  121. <image src="{{item.albumCoverUrl290}}" mode="widthFix" lazy-load="false"></image>
  122. </view>
  123. <view class="hmly-content-right">
  124. <view class="hmly-content-title">
  125. <view class="hmly-title-text">{{item.title}}</view>
  126. <view class="hmly-introduction">{{item.trackTitle}}</view>
  127. </view>
  128. <view class="hmly-count">
  129. <view class="hmly-play-count">
  130. <!-- <view class="icon-"></view> -->
  131. 126亿
  132. </view>
  133. <view class="hmly-ji-count">{{item.tracks}}集</view>
  134. </view>
  135. </view>
  136. </view>
  137. </block>
  138. </view>
  139. </block>
  140. <block wx:else>
  141. <view class="hmly-data-notip">
  142. <view class="hmly-tip">
  143. 网络暂时走丢了,请稍后再试
  144. </view>
  145. </view>
  146. </block>