hot.wxml 5.2 KB

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