index.wxml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. </video>
  31. <view class="foot_box">
  32. <view class="foot_left">
  33. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  34. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  35. <text>收藏</text>
  36. </view>
  37. <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}}">
  38. <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
  39. <text>分享</text>
  40. </view>
  41. </view>
  42. <view class="foot_right">
  43. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  44. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  45. <text>{{item.likes}}</text>
  46. </view>
  47. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}">
  48. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  49. <text>{{item.commentAmount}}</text>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="btn_wrapper" catchtap="goToReading" data-id="{{item.classId}}">
  54. <view class="reading_btn">
  55. <image src="../../static/index/microphone.png" />
  56. <text>我要配音</text>
  57. </view>
  58. </view>
  59. </swiper-item>
  60. </swiper>
  61. <!-- // 非swiper -->
  62. <view wx:if="{{!isSwiper}}" class="swiper_item no_swiper" wx:for="{{sonVideoList}}" data-id="{{item.id}}" wx:key="id">
  63. <view class="head_box">
  64. <image class="tag_icon" wx:if="{{item.hasTag}}" src="{{item.tagUrl}}" />
  65. <view class="user_box" catchtap="{{ifHeadTap ? 'headTap' : null}}" data-uid="{{item.uid}}">
  66. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  67. <image class="avatar_fans" wx:if="{{!item.isFans}}" src="../../static/index/add_follow.png" />
  68. <view class="user_right">
  69. <view class="nickname">{{item.nickName}}</view>
  70. <image class="efun_tag" src="../../static/index/efun_tag.png" wx:if="{{item.isEfun}}"></image>
  71. </view>
  72. </view>
  73. <view wx:if="{{!item.showMyBtn && item.type != 'EXAMPLE'}}" class="time">
  74. <text>发布时间:{{item.time}}</text>
  75. </view>
  76. <view wx:if="{{item.showMyBtn && !item.ifCheck}}" class="my_btn">
  77. <view class="delete" catchtap="download" data-url="{{item.markPath ? item.markPath : '' }}" data-id="{{item.id}}">
  78. <image class="download_image" src="../../static/index/down.png" />
  79. <text class="delete_text">下载</text>
  80. </view>
  81. <view class="delete" catchtap="delete" data-id="{{item.id}}">
  82. <image class="delete_image" src="../../static/index/delete.png" />
  83. <text class="delete_text">删除</text>
  84. </view>
  85. <view class="hide" catchtap="hide" wx:if="{{!item.activity}}" data-status="{{item.status}}" data-id="{{item.id}}">
  86. <!-- <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/hide_icon.png': '../../static/index/show_icon.png'}}" /> -->
  87. <image class="hide_image" src="{{item.status==='NORMAL'? '../../static/index/unlock.png': '../../static/index/lock.png'}}" />
  88. <text class="hide_text">{{item.status==='NORMAL'? '公开': '私密'}}</text>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="video_place" wx:if="{{!item.videoShow}}" catchtap="{{item.ifCheck ? null : 'showVideo'}}" data-index="{{index}}">
  93. <image class="place_img" src="{{item.coverImg}}" />
  94. <image class="play_btn" src="../../static/image/play-btn.png" />
  95. <image class="activity_tigs" wx:if="{{item.activity && item.type != 'EXAMPLE'}}" src="http://reader-wx.ai160.com/images/reader/activity/activity1.png" />
  96. <view class="video_item_dialog" wx:if="{{item.ifCheck}}">
  97. <image class="video_item_dialog_img" src="../../static/index/checking.png" mode="aspectFit|aspectFill|widthFix" />
  98. </view>
  99. </view>
  100. <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">
  101. </video>
  102. <view class="foot_box" wx:if="{{!item.ifCheck}}">
  103. <view class="foot_left">
  104. <view class="video_btn collect_btn" catchtap="collectTap" data-index="{{index}}" data-id="{{item.id}}" data-type="{{item.type}}">
  105. <image class="collect_btn_icon" src="{{item.isFavorite ? '../../static/index/star_colored.png' : '../../static/index/star.png'}}" />
  106. <text>{{item.favoritesAmount === 0 ? '收藏' : item.favoritesAmount}}</text>
  107. </view>
  108. <button class="resetBtn video_btn share_btn" open-type="share" data-info='{{item}}'>
  109. <image class="share_btn_icon" src="../../static/index/share.png" />
  110. <text>{{item.shareAmount === 0 ? '分享' : item.shareAmount}}</text>
  111. </button>
  112. <!-- <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}}">
  113. <image class="share_btn_icon" src="../../static/index/share.png" />
  114. <text>{{item.shareAmount === 0 ? '分享' : item.shareAmount}}</text>
  115. </view> -->
  116. </view>
  117. <view class="foot_right">
  118. <view class="video_btn flower_btn" catchtap="{{item.isLike ? null : 'likeTap'}}" data-index="{{index}}" data-id="{{item.id}}" data-islike="{{item.isLike}}">
  119. <!-- <view class="animation-flower {{addComeOut === index ? 'add-one-come-out' : ''}}">
  120. <image class="animation-flower-icon" src="{{item.activity ? '../../static/activity/popularity1.png' : '../../static/image/flower_small.png'}}" />
  121. <text>+1</text>
  122. </view> -->
  123. <image class="flower_btn_icon" src="{{item.isLike ? '../../static/index/heart_colored.png' : '../../static/index/heart.png'}}" />
  124. <text>{{item.likes === 0 ? '点赞' : item.likes}}</text>
  125. </view>
  126. <view class="video_btn comment_btn" catchtap="openComment" data-id="{{item.id}}" data-index="{{index}}">
  127. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  128. <text>{{item.commentAmount === 0 ?'评论' : item.commentAmount}}</text>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="btn_wrapper" wx:if="{{!item.noReading && !item.ifCheck}}" catchtap="goToReading" data-id="{{item.classId}}">
  133. <view class="reading_btn">
  134. <image src="../../static/index/microphone.png" />
  135. <text>我要配音</text>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="no_work" wx:if="{{!isSwiper && noMoreWork}}">
  140. <text class="no_work_text">已经到底啦!</text>
  141. </view>
  142. </view>
  143. <!-- <flowerBox id="flower-toast" flowerNum="{{flowerNum}}" /> -->
  144. <shareDialog id="share-dialog" shareType='works' bindShareDialogClose="shareDialogClose" bindaddShareAmount="addShareAmount" shareId="{{id}}" />