index.wxml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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="delete" data-id="{{item.id}}">
  114. <image class="delete_image" src="../../static/index/delete.png" />
  115. <text class="delete_text" >删除</text>
  116. </view>
  117. <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  118. <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
  119. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
  120. <text class="hide_text" >{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}" >
  125. <image class="place_img" src="{{item.coverImg}}" />
  126. <image class="play_btn" src="../../static/image/play-btn.png" />
  127. <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
  128. <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
  129. </view>
  130. </view>
  131. <video
  132. wx:if="{{item.videoShow}}"
  133. id="video_{{index}}"
  134. class="video_item"
  135. loop="{{loop}}"
  136. show-center-play-btn="{{!item.ifCheck ? true : false}}"
  137. controls="{{!item.ifCheck ? true : false}}"
  138. src="{{item.url ? item.url : '' }}"
  139. autoplay="{{true}}"
  140. object-fit="contain"
  141. data-index="{{index}}"
  142. data-id="{{item.id}}"
  143. bindplay="onPlayList"
  144. bindended="onEndedList"
  145. binderror="onError"
  146. >
  147. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  148. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  149. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  150. <!-- bindplay="onPlay"
  151. bindpause="onPause"
  152. bindended="onEnded"
  153. binderror="onError"
  154. bindtimeupdate="onTimeUpdate"
  155. bindwaiting="onWaiting"
  156. bindprogress="onProgress"
  157. bindloadedmetadata="onLoadedMetaData" -->
  158. </video>
  159. <view class="video_title">
  160. <text>
  161. {{item.title}}
  162. </text>
  163. </view>
  164. <view class="foot_box" wx:if="{{!item.ifCheck}}">
  165. <view class="foot_left">
  166. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  167. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  168. <text>收藏</text>
  169. </view>
  170. <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-grade="{{item.grade}}" data-type="{{item.type}}">
  171. <image class="share_btn_icon" src="../../static/index/share.png" />
  172. <text>分享</text>
  173. </view>
  174. </view>
  175. <view class="foot_right">
  176. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  177. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  178. <text>{{item.likes}}</text>
  179. </view>
  180. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  181. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  182. <text>{{item.commentAmount || 0}}</text>
  183. </view>
  184. </view>
  185. </view>
  186. <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
  187. <view class="reading_btn">
  188. <image src="../../static/index/microphone.png" />
  189. <text>我要配音</text>
  190. </view>
  191. </view>
  192. </view>
  193. </view>
  194. <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" shareId="{{id}}" />