index.wxml 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <view class="swiper_container">
  2. <swiper
  3. wx:if="{{isSwiper}}"
  4. class="video-swiper"
  5. circular="{{circular}}"
  6. easing-function="{{easingFunction}}"
  7. vertical
  8. current="0"
  9. duration="{{duration}}"
  10. next-margin="{{nextMargin}}"
  11. bindanimationfinish="animationfinish">
  12. <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
  13. <swiper-item class="swiper_item" wx:for="{{curQueue}}" data-id="{{item.id}}" wx:key="*this">
  14. <view class="head_box">
  15. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  16. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  17. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  18. <view class="user_right">
  19. <view class="nickname">{{item.nickName}}</view>
  20. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  21. </view>
  22. </view>
  23. <view wx:if="{{!item.showMyBtn}}" class="time">
  24. <text>发布时间:{{item.time}}</text>
  25. </view>
  26. <view wx:if="{{item.showMyBtn}}" class="my_btn">
  27. <view catchtap="delete" data-id="{{item.id}}">
  28. <image src="../../static/index/delete.png" />
  29. <text >删除</text>
  30. </view>
  31. <view catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  32. <image src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" />
  33. <text >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
  34. </view>
  35. </view>
  36. </view>
  37. <video
  38. id="video_{{index}}"
  39. class="video_item"
  40. loop="{{loop}}"
  41. enable-play-gesture
  42. enable-progress-gesture
  43. show-center-play-btn="{{false}}"
  44. controls="{{true}}"
  45. src="{{item.url}}"
  46. object-fit="contain"
  47. data-index="{{index}}"
  48. data-id="{{item.id}}"
  49. bindplay="onPlay"
  50. bindended="onEnded"
  51. >
  52. <!-- bindplay="onPlay"
  53. bindpause="onPause"
  54. bindended="onEnded"
  55. binderror="onError"
  56. bindtimeupdate="onTimeUpdate"
  57. bindwaiting="onWaiting"
  58. bindprogress="onProgress"
  59. bindloadedmetadata="onLoadedMetaData" -->
  60. </video>
  61. <view class="video_title">
  62. <text>
  63. {{item.title}}
  64. </text>
  65. </view>
  66. <view class="foot_box">
  67. <view class="foot_left">
  68. <view class="btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  69. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  70. <text>收藏</text>
  71. </view>
  72. <view class="btn share_btn" bindtap="openShare" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-author="{{item.nickName}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-type="{{item.type}}">
  73. <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
  74. <text>分享</text>
  75. </view>
  76. </view>
  77. <view class="foot_right">
  78. <view class="btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  79. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  80. <text>{{item.likes}}</text>
  81. </view>
  82. <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  83. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  84. <text>{{item.commentAmount}}</text>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
  89. <view class="reading_btn">
  90. <image src="../../static/index/microphone.png" />
  91. <text>我要配音</text>
  92. </view>
  93. </view>
  94. </swiper-item>
  95. </swiper>
  96. <!-- // 非swiper -->
  97. <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{videoList}}" data-id="{{item.id}}" wx:key="*this">
  98. <view class="head_box">
  99. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  100. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  101. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  102. <view class="user_right">
  103. <view class="nickname">{{item.nickName}}</view>
  104. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  105. </view>
  106. </view>
  107. <view wx:if="{{!item.showMyBtn}}" class="time">
  108. <text>发布时间:{{item.time}}</text>
  109. </view>
  110. <view wx:if="{{item.showMyBtn}}" class="my_btn">
  111. <view class="delete" catchtap="delete" data-id="{{item.id}}">
  112. <image class="delete_image" src="../../static/index/delete.png" />
  113. <text class="delete_text" >删除</text>
  114. </view>
  115. <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  116. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" />
  117. <text class="hide_text" >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
  118. </view>
  119. </view>
  120. </view>
  121. <video
  122. id="video_{{index}}"
  123. class="video_item"
  124. loop="{{loop}}"
  125. enable-play-gesture
  126. enable-progress-gesture
  127. show-center-play-btn="{{false}}"
  128. controls="{{true}}"
  129. src="{{item.url}}"
  130. object-fit="contain"
  131. data-index="{{index}}"
  132. bindplay="onPlayList"
  133. bindended="onEndedList"
  134. >
  135. <!-- bindplay="onPlay"
  136. bindpause="onPause"
  137. bindended="onEnded"
  138. binderror="onError"
  139. bindtimeupdate="onTimeUpdate"
  140. bindwaiting="onWaiting"
  141. bindprogress="onProgress"
  142. bindloadedmetadata="onLoadedMetaData" -->
  143. </video>
  144. <view class="video_title">
  145. <text>
  146. {{item.title}}
  147. </text>
  148. </view>
  149. <view class="foot_box">
  150. <view class="foot_left">
  151. <view class="btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  152. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  153. <text>收藏</text>
  154. </view>
  155. <view class="btn share_btn" bindtap="openShare" data-author="{{item.nickName}}" data-index="{{index}}" data-id="{{item.id}}" data-avatar="{{item.avatar}}" data-uid="{{item.uid}}" data-img="{{item.img}}" data-title="{{item.title}}" data-type="{{item.type}}">
  156. <image class="share_btn_icon" src="../../static/index/share.png" />
  157. <text>分享</text>
  158. </view>
  159. </view>
  160. <view class="foot_right">
  161. <view class="btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  162. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  163. <text>{{item.likes}}</text>
  164. </view>
  165. <view class="btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  166. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  167. <text>{{item.commentAmount}}</text>
  168. </view>
  169. </view>
  170. </view>
  171. <view class="btn_wrapper" wx:if="{{!item.noReading}}" catchtap="goToReading" data-id="{{item.classId}}">
  172. <view class="reading_btn">
  173. <image src="../../static/index/microphone.png" />
  174. <text>我要配音</text>
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />