hot.wxml 4.6 KB

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