index.wxml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <view class="swiper_container">
  2. <swiper wx:if="{{isSwiper}}" class="video-swiper" circular="{{circular}}" easing-function="{{easingFunction}}" vertical current="0" duration="{{duration}}" next-margin="{{nextMargin}}" bindanimationfinish="animationfinish">
  3. <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
  4. <swiper-item class="swiper_item" wx:for="{{curQueue}}" data-id="{{item.id}}" wx:key="id">
  5. <view class="head_box">
  6. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  7. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  8. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  9. <image class="avatar_fans" src="../../static/index/add_follow.png" />
  10. <view class="user_right">
  11. <view class="nickname">{{item.nickName}}</view>
  12. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  13. </view>
  14. </view>
  15. <view wx:if="{{!item.showMyBtn}}" class="time">
  16. <text>发布时间:{{item.time}}</text>
  17. </view>
  18. <view wx:if="{{item.showMyBtn}}" class="my_btn">
  19. <view catchtap="delete" data-id="{{item.id}}">
  20. <image src="../../static/index/delete.png" />
  21. <text>删除</text>
  22. </view>
  23. <view catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  24. <image src="{{item.status==='NORMAL'? '../../static/index/show_icon.png': '../../static/index/hide_icon.png'}}" />
  25. <text>{{item.status==='NORMAL'? '隐藏': '展示'}}</text>
  26. </view>
  27. </view>
  28. </view>
  29. <video id="video_{{index}}" class="video_item" loop="{{loop}}" enable-play-gesture enable-progress-gesture show-center-play-btn="{{false}}" controls="{{true}}" src="{{item.url}}" object-fit="contain" data-index="{{index}}" data-id="{{item.id}}" bindplay="onPlay" bindended="onEnded">
  30. <!-- bindplay="onPlay"
  31. bindpause="onPause"
  32. bindended="onEnded"
  33. binderror="onError"
  34. bindtimeupdate="onTimeUpdate"
  35. bindwaiting="onWaiting"
  36. bindprogress="onProgress"
  37. bindloadedmetadata="onLoadedMetaData" -->
  38. </video>
  39. <view class="video_title">
  40. <text>{{item.title}}</text>
  41. </view>
  42. <view class="foot_box">
  43. <view class="foot_left">
  44. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  45. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  46. <text>收藏</text>
  47. </view>
  48. <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}}" ata-activity="{{item.activity}}">
  49. <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
  50. <text>分享</text>
  51. </view>
  52. </view>
  53. <view class="foot_right">
  54. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  55. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  56. <text>{{item.likes}}</text>
  57. </view>
  58. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  59. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  60. <text>{{item.commentAmount}}</text>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
  65. <view class="reading_btn">
  66. <image src="../../static/index/microphone.png" />
  67. <text>我要配音</text>
  68. </view>
  69. </view>
  70. </swiper-item>
  71. </swiper>
  72. <!-- // 非swiper -->
  73. <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{sonVideoList}}" data-id="{{item.id}}" wx:key="id">
  74. <view class="head_box">
  75. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  76. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  77. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  78. <image class="avatar_fans" wx:if="{{!item.isFans}}" src="../../static/index/add_follow.png" />
  79. <view class="user_right">
  80. <view class="nickname">{{item.nickName}}</view>
  81. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  82. </view>
  83. </view>
  84. <!-- <view wx:if="{{!item.showMyBtn}}" class="time">
  85. <text>发布时间:{{item.time}}</text>
  86. </view> -->
  87. <view wx:if="{{!item.showMyBtn}}" class="time">
  88. <text>发布时间:{{item.time}}</text>
  89. </view>
  90. <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
  91. <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
  92. <image class="download_image" src="../../static/index/down.png" />
  93. <text class="delete_text">下载</text>
  94. </view>
  95. <view class="delete" catchtap="delete" data-id="{{item.id}}">
  96. <image class="delete_image" src="../../static/index/delete.png" />
  97. <text class="delete_text">删除</text>
  98. </view>
  99. <view class="hide" catchtap="hide" wx:if="{{!item.activity}}" data-status="{{item.status}}" data-id="{{item.id}}">
  100. <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
  101. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
  102. <text class="hide_text">{{item.status==='NORMAL'? '公开': '私密'}}</text>
  103. </view>
  104. </view>
  105. <!-- <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
  106. <view class="delete" catchtap="delete" data-id="{{item.id}}">
  107. <image class="delete_image" src="../../static/index/delete.png" />
  108. <text class="delete_text">删除</text>
  109. </view>
  110. <view class="hide" catchtap="hide" data-status="{{item.status}}" data-id="{{item.id}}">
  111. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
  112. <text class="hide_text">{{item.status==='NORMAL'? '公开': '仅自己可见'}}</text>
  113. </view>
  114. </view> -->
  115. </view>
  116. <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}">
  117. <image class="place_img" src="{{item.coverImg}}" />
  118. <image class="play_btn" src="../../static/image/play-btn.png" />
  119. <image class="activity_tigs" wx:if="{{item.activity}}" src="http://reader-wx.ai160.com/images/reader/activity/activity1.png" />
  120. <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
  121. <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
  122. </view>
  123. </view>
  124. <video wx:if="{{item.videoShow}}" id="video_{{index}}" class="video_item" loop="{{loop}}" show-center-play-btn="{{!item.ifCheck ? true : false}}" controls="{{!item.ifCheck ? true : false}}" src="{{item.url ? item.url : '' }}" autoplay="{{true}}" object-fit="contain" data-index="{{index}}" data-id="{{item.id}}" bindplay="onPlayList" bindended="onEndedList" binderror="onError">
  125. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  126. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  127. <!-- show-center-play-btn="{{!item.ifCheck ? true : false}}" -->
  128. <!-- bindplay="onPlay"
  129. bindpause="onPause"
  130. bindended="onEnded"
  131. binderror="onError"
  132. bindtimeupdate="onTimeUpdate"
  133. bindwaiting="onWaiting"
  134. bindprogress="onProgress"
  135. bindloadedmetadata="onLoadedMetaData" -->
  136. </video>
  137. <view class="video_title">
  138. <text>{{item.title}}</text>
  139. </view>
  140. <view class="foot_box" wx:if="{{!item.ifCheck}}">
  141. <view class="foot_left">
  142. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  143. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  144. <text>{{item.favoritesAmount === 0 ? '收藏' : item.favoritesAmount}}</text>
  145. </view>
  146. <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}}" data-activity="{{item.activity}}">
  147. <image class="share_btn_icon" src="../../static/index/share.png" />
  148. <text>{{item.shareAmount === 0 ? '分享' : item.shareAmount}}</text>
  149. </view>
  150. <!-- <button class="video_btn share_btn" open-type="share" 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}}">
  151. <image class="share_btn_icon" src="../../static/index/share.png"></image>
  152. <text>分享</text>
  153. </button> -->
  154. </view>
  155. <view class="foot_right">
  156. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  157. <view class="animation-flower {{addComeOut === index ? 'add-one-come-out' : ''}}">
  158. <image class="animation-flower-icon" src="{{item.activity ? '../../static/activity/popularity1.png' : '../../static/image/flower_small.png'}}" />
  159. <text>+1</text>
  160. </view>
  161. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  162. <text>{{item.likes === 0 ? '点赞' : item.likes}}</text>
  163. </view>
  164. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}" data-index="{{index}}">
  165. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  166. <text>{{item.commentAmount === 0 ?'评论' : item.commentAmount}}</text>
  167. </view>
  168. </view>
  169. </view>
  170. <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
  171. <view class="reading_btn">
  172. <image src="../../static/index/microphone.png" />
  173. <text>我要配音</text>
  174. </view>
  175. </view>
  176. </view>
  177. <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">
  178. <text class="no_work_text">已经到底啦!</text>
  179. </view>
  180. </view>
  181. <flowerBox id="flower-toast" flowerNum="{{flowerNum}}" />
  182. <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" bindaddShareAmount="addShareAmount" shareId="{{id}}" />