index.wxml 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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="id">
  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. <image class="avatar_fans" src="../../static/index/add_follow.png" />
  19. <view class="user_right">
  20. <view class="nickname">{{item.nickName}}</view>
  21. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  22. </view>
  23. </view>
  24. <view wx:if="{{!item.showMyBtn}}" class="time">
  25. <text>发布时间:{{item.time}}</text>
  26. </view>
  27. <view wx:if="{{item.showMyBtn}}" class="my_btn">
  28. <view catchtap="delete" data-id="{{item.id}}">
  29. <image src="../../static/index/delete.png" />
  30. <text >删除</text>
  31. </view>
  32. <view catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  33. <image src="{{item.status==='NORMAL'? '../../static/index/show_icon.png': '../../static/index/hide_icon.png'}}" />
  34. <text >{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
  35. </view>
  36. </view>
  37. </view>
  38. <video
  39. id="video_{{index}}"
  40. class="video_item"
  41. loop="{{loop}}"
  42. enable-play-gesture
  43. enable-progress-gesture
  44. show-center-play-btn="{{false}}"
  45. controls="{{true}}"
  46. src="{{item.url}}"
  47. object-fit="contain"
  48. data-index="{{index}}"
  49. data-id="{{item.id}}"
  50. bindplay="onPlay"
  51. bindended="onEnded"
  52. >
  53. <!-- bindplay="onPlay"
  54. bindpause="onPause"
  55. bindended="onEnded"
  56. binderror="onError"
  57. bindtimeupdate="onTimeUpdate"
  58. bindwaiting="onWaiting"
  59. bindprogress="onProgress"
  60. bindloadedmetadata="onLoadedMetaData" -->
  61. </video>
  62. <view class="video_title">
  63. <text>
  64. {{item.title}}
  65. </text>
  66. </view>
  67. <view class="foot_box">
  68. <view class="foot_left">
  69. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  70. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  71. <text>收藏</text>
  72. </view>
  73. <view class="video_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}}">
  74. <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
  75. <text>分享</text>
  76. </view>
  77. </view>
  78. <view class="foot_right">
  79. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  80. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  81. <text>{{item.likes}}</text>
  82. </view>
  83. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  84. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  85. <text>{{item.commentAmount}}</text>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
  90. <view class="reading_btn">
  91. <image src="../../static/index/microphone.png" />
  92. <text>我要配音</text>
  93. </view>
  94. </view>
  95. </swiper-item>
  96. </swiper>
  97. <!-- // 非swiper -->
  98. <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{videoList}}" data-id="{{item.id}}" wx:key="id">
  99. <view class="head_box">
  100. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  101. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  102. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  103. <image class="avatar_fans" wx:if="{{!item.isFans}}" src="../../static/index/add_follow.png" />
  104. <view class="user_right">
  105. <view class="nickname">{{item.nickName}}</view>
  106. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  107. </view>
  108. </view>
  109. <view wx:if="{{!item.showMyBtn}}" class="time">
  110. <text>发布时间:{{item.time}}</text>
  111. </view>
  112. <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
  113. <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
  114. <image class="download_image" src="../../static/index/down.png" />
  115. <text class="delete_text" >下载</text>
  116. </view>
  117. <view class="delete" catchtap="delete" data-id="{{item.id}}">
  118. <image class="delete_image" src="../../static/index/delete.png" />
  119. <text class="delete_text" >删除</text>
  120. </view>
  121. <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  122. <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
  123. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
  124. <text class="hide_text" >{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
  125. </view>
  126. </view>
  127. </view>
  128. <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}" >
  129. <image class="place_img" src="{{item.coverImg}}" />
  130. <image class="play_btn" src="../../static/image/play-btn.png" />
  131. <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
  132. <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
  133. </view>
  134. </view>
  135. <video
  136. wx:if="{{item.videoShow}}"
  137. id="video_{{index}}"
  138. class="video_item"
  139. loop="{{loop}}"
  140. show-center-play-btn="{{!item.ifCheck ? true : false}}"
  141. controls="{{!item.ifCheck ? true : false}}"
  142. src="{{item.url ? item.url : '' }}"
  143. autoplay="{{true}}"
  144. object-fit="contain"
  145. data-index="{{index}}"
  146. data-id="{{item.id}}"
  147. bindplay="onPlayList"
  148. bindended="onEndedList"
  149. binderror="onError"
  150. >
  151. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  152. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  153. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  154. <!-- bindplay="onPlay"
  155. bindpause="onPause"
  156. bindended="onEnded"
  157. binderror="onError"
  158. bindtimeupdate="onTimeUpdate"
  159. bindwaiting="onWaiting"
  160. bindprogress="onProgress"
  161. bindloadedmetadata="onLoadedMetaData" -->
  162. </video>
  163. <view class="video_title">
  164. <text>
  165. {{item.title}}
  166. </text>
  167. </view>
  168. <view class="foot_box" wx:if="{{!item.ifCheck}}">
  169. <view class="foot_left">
  170. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  171. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  172. <text>收藏</text>
  173. </view>
  174. <view class="video_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-shareimg="{{item.shareImg}}" data-grade="{{item.grade}}" data-type="{{item.type}}">
  175. <image class="share_btn_icon" src="../../static/index/share.png" />
  176. <text>分享</text>
  177. </view>
  178. </view>
  179. <view class="foot_right">
  180. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  181. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  182. <text>{{item.likes}}</text>
  183. </view>
  184. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  185. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  186. <text>{{item.commentAmount || 0}}</text>
  187. </view>
  188. </view>
  189. </view>
  190. <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
  191. <view class="reading_btn">
  192. <image src="../../static/index/microphone.png" />
  193. <text>我要配音</text>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />