index.wxml 5.4 KB

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