index.wxml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <view>
  2. <!-- 搜索框 -->
  3. <search></search>
  4. <!-- 轮播图 -->
  5. <view class="hmly-swiper-container">
  6. <swiper
  7. class="hmly-swiper"
  8. autoplay="true"
  9. circular="true"
  10. interval="3000"
  11. easing-function="easeOutCubic"
  12. current="{{swiperCurren}}"
  13. bindchange="swiperChange"
  14. >
  15. <!-- 轮播图图片 -->
  16. <swiper-item class="hmly-swiper-item" wx:for="{{imgList}}" wx:key="index">
  17. <!-- 加上widthFix可以使图片自适应 -->
  18. <image src="{{item}}"></image>
  19. </swiper-item>
  20. </swiper>
  21. <!-- 为了和喜马拉雅一致,自己需定制轮播图dots -->
  22. <view class="hmly-dots">
  23. <block wx:for="{{imgList.length}}" wx:key="index">
  24. <view class="hmly-dots-item{{index == swiperCurrent ? ' hmly-dot-active' : ''}}"></view>
  25. </block>
  26. </view>
  27. </view>
  28. <!-- 宫格导航 -->
  29. <view class="hmly-nav">
  30. <block>
  31. <view class="hmly-nav-item" bindtap="{{item.events}}" wx:for="{{navList}}" wx:key="index">
  32. <!--
  33. 因为没有合适的图,所以全部使用的一样的
  34. 并且因为界面都是一致的就是内容不同,这里为了简单,使用的都是统一界面
  35. 解决办法:你可以通过页面传参的方式来进行区分
  36. -->
  37. <image class="hmly-nav-icon" src="{{item.icon}}" mode="widthFix" lazy-load="false"></image>
  38. <text class="hmly-nav-text">{{item.text}}</text>
  39. </view>
  40. </block>
  41. </view>
  42. <!-- 猜你喜欢 -->
  43. <view class="hmly-like">
  44. <view class="hmly-bar-title">
  45. <view class="hmly-title-left">猜你喜欢</view>
  46. <view class="hmly-title-right">查看全部 <text class="icon-right"></text> </view>
  47. </view>
  48. <!-- 这没有使用数据绑定,因为是练手而且数据比较少 -->
  49. <view class="hmly-like-item-box">
  50. <view
  51. class="hmly-like-item"
  52. bindtap="gotoDetails"
  53. data-coverImg="{{item.coverMiddle}}"
  54. data-title="{{item.intro}}"
  55. wx:for="{{guess}}"
  56. wx:key="index"
  57. >
  58. <view class="hmly-like-img">
  59. <image class="hmly-like-item-icon" src="{{item.coverMiddle}}" mode="widthFix"></image>
  60. <view class="hmly-like-cover">
  61. <!-- text用来显示icon 暂无 -->
  62. <text class=""></text> 4.6亿
  63. </view>
  64. </view>
  65. <view class="hmly-like-text">{{item.intro}}</view>
  66. </view>
  67. </view>
  68. </view>
  69. <!-- 有数据的时候显示 -->
  70. <block wx:if="{{showitem}}">
  71. <!-- 有声小说 -->
  72. <showItem title="有声小说" showList="{{xiaoshuocontent}}"></showItem>
  73. <!-- 相声评书 -->
  74. <showItem title="相声评书" showList="{{xiangshengcontent}}"></showItem>
  75. <!-- 脱口秀 -->
  76. <showItem title="脱口秀" showList="{{tuokocontent}}"></showItem>
  77. </block>
  78. <block wx:else>
  79. <view class="hmly-data-notip">
  80. <view class="hmly-tip">
  81. 网络暂时走丢了,请稍后再试
  82. </view>
  83. </view>
  84. </block>
  85. </view>