hot.wxml 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template name="hot">
  2. <view class="messageSection" wx:if="{{hotData.unReadMessageNum > 0}}" bindtap="goToMessage">
  3. <image class="messageIcon" src="../../static/image/message_icon.png" />
  4. <text class="messageText">
  5. 您有
  6. <text class="red-text">{{hotData.unReadMessageNum}}</text>
  7. 条未读消息【立即查看】
  8. </text>
  9. </view>
  10. <view class="myCourseSection">
  11. <view class="title-regular">我的课程</view>
  12. <view class="myCoursePlaceHolder" wx:if="{{hotData.myCourse.length === 0}}" bindtap="goToBooks">
  13. <image src="../../static/image/add_class.png" />
  14. </view>
  15. <view class="book-box" wx:if="{{hotData.myCourse.length !== 0}}">
  16. <block wx:for="{{hotData.myCourse}}" wx:key="{{index}}">
  17. <view class="book-item" data-id="{{item.id}}" data-title="{{item.title}}" bindtap="goToBook">
  18. <image class="book-img" src="{{item.iconImg}}"></image>
  19. <view class="book-title">{{item.title}}</view>
  20. </view>
  21. </block>
  22. </view>
  23. </view>
  24. <view class="searchSection">
  25. <input bindinput="inputHandler" bindfocus="searchIconDisappear" bindblur="searchIconCome" bindconfirm="searchHandler" placeholder="{{hotData.hotSearch}}" placeholder-style="text-indent:20rpx" confirm-type="search"></input>
  26. <view>{{searchIcon}}</view>
  27. <view bindtap="searchHandler" class="searchBtn" wx:if="{{hotData.searchIcon}}">
  28. <!-- <icon type="search" size="14" /> -->
  29. <image src="../../static/image/search_new.png" alt="" />
  30. </view>
  31. <view class="allBooks" bindtap="goToBooks">全部课程</view>
  32. <!-- <form bindsubmit="submitTest" report-submit="{{true}}" class="allBooks">
  33. <button formType="submit">Reset</button>
  34. </form> -->
  35. </view>
  36. <view class="swiperSection">
  37. <view class="title-regular swiper-title">官方推荐</view>
  38. <swiper previous-margin="0" next-margin="243rpx" bindchange="swiperChange" current="{{hotData.swiperCurrent}}" circular="{{true}}" autoplay="{{hotData.autoplay}}" interval="{{hotData.interval}}" duration="{{hotData.duration}}" circular="{{hotData.circular}}">
  39. <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
  40. <swiper-item class="slide-item" bindtap="openClass" data-classId="{{item.classId}}" data-title="{{item.title}}">
  41. <image src="{{item.img}}" data-type="{{item.type}}" data-id="{{item.id}}" class="slide-image" />
  42. <view class="slide-summary">
  43. <text class="slide-title">{{item.title}}</text>
  44. <text class="slide-tip">{{item.summary}}</text>
  45. </view>
  46. </swiper-item>
  47. </block>
  48. </swiper>
  49. <view class="swiper-dots-wrapper">
  50. <block wx:for="{{hotData.recommend}}" wx:key="{{index}}">
  51. <view class="swiper-dots {{hotData.swiperCurrent === index ? 'dot-active' : ''}}">
  52. <text>{{index + 1}}</text>
  53. </view>
  54. </block>
  55. </view>
  56. </view>
  57. <view class="recommdSection">
  58. <view class="recommd-title">热门作品</view>
  59. <view class="hotWares">
  60. <view wx:for="{{hotData.hotWorks}}" wx:key="{{index}}" class="worksCard" bindtap="openWorks" data-readId="{{item.classId}}" data-title="{{item.title}}">
  61. <view class="topData">
  62. <view class="worksLeft" catchtap="goToUsers" data-uid="{{item.uid}}">
  63. <image class="authorAvatar" lazy-load="true" src="{{item.avatar}}" />
  64. <view class="profession" wx:if="{{item.profession}}">
  65. {{item.profession}}
  66. </view>
  67. <view class="worksInfo">
  68. <view class="authorName">{{item.nickName}}</view>
  69. <view class="time">{{item.time}}</view>
  70. </view>
  71. </view>
  72. <view class="numberInfo">
  73. <view class="wareCardPlays">
  74. <image class="wareCardPlaysImg" lazy-load="true" src="../../static/image/hotPlays.png" />
  75. <text>{{item.plays}}</text>
  76. </view>
  77. <view class="wareCardLikes">
  78. <image class="wareCardLikesImg" lazy-load="true" src="../../static/image/flower_small.png" />
  79. <text>{{item.likes}}</text>
  80. </view>
  81. </view>
  82. </view>
  83. <image class="wareCardImg" src="{{item.img}}" />
  84. <view class="titleSummary">
  85. <text class="wareCardTitle">{{item.title}}</text>
  86. <text class="wareCardTip">{{item.summary}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </template>