index.wxml 5.3 KB

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