index.wxml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <view class="container">
  2. <swiper
  3. class="video-swiper"
  4. circular="{{circular}}"
  5. next-margin="{{nextMargin}}"
  6. easing-function="{{easingFunction}}"
  7. vertical
  8. current="1"
  9. duration="{{duration}}"
  10. bindanimationfinish="animationfinish">
  11. <!-- curQueue 循环会导致video重新插入,objectFit 不可变更 -->
  12. <swiper-item class="swiper_item" wx:for="{{curQueue}}" wx:key="*this">
  13. <view class="head_box">
  14. <view class="user_box">
  15. <image class="avatar" lazy-load="true" src="{{item.avatar}}" />
  16. <view class="user_right">
  17. <view class="nickname">{{item.nickName}}</view>
  18. <view class="time">
  19. <text>发布时间:</text>
  20. <text>{{item.time}}</text>
  21. </view>
  22. </view>
  23. </view>
  24. <view class="more_btn">
  25. <view class="more_item"></view>
  26. <view class="more_item"></view>
  27. <view class="more_item"></view>
  28. </view>
  29. </view>
  30. <video
  31. id="video_{{index}}"
  32. class="video_item"
  33. loop="{{loop}}"
  34. enable-play-gesture
  35. enable-progress-gesture
  36. show-center-play-btn="{{false}}"
  37. controls="{{true}}"
  38. src="{{item.url}}"
  39. data-id="{{item.id}}"
  40. object-fit="contain"
  41. data-index="{{index}}"
  42. bindplay="onPlay"
  43. bindpause="onPause"
  44. bindended="onEnded"
  45. binderror="onError"
  46. bindtimeupdate="onTimeUpdate"
  47. bindwaiting="onWaiting"
  48. bindprogress="onProgress"
  49. bindloadedmetadata="onLoadedMetaData"
  50. >
  51. </video>
  52. <view class="video_title">
  53. <text>
  54. {{item.title}}
  55. </text>
  56. </view>
  57. <view class="foot_box">
  58. <view class="foot_left">
  59. <view class="btn collect_btn">
  60. <image class="collect_btn_icon" src="../../static/index/star.png" lazy-load="true" />
  61. <text>收藏</text>
  62. </view>
  63. <view class="btn share_btn">
  64. <image class="share_btn_icon" src="../../static/index/share.png" lazy-load="true" />
  65. <text>分享</text>
  66. </view>
  67. </view>
  68. <view class="foot_right">
  69. <view class="btn flower_btn">
  70. <image class="flower_btn_icon" src="../../static/index/flower.png" lazy-load="true" />
  71. <text>{{item.likes}}</text>
  72. </view>
  73. <view class="btn comment_btn">
  74. <image class="comment_btn_icon" src="../../static/index/comment.png" lazy-load="true" />
  75. <text>{{item.likes}}</text>
  76. </view>
  77. </view>
  78. </view>
  79. <view class="btn_wrapper">
  80. <view class="reading_btn">
  81. <image src="../../static/index/star.png" />
  82. <text>我要配音</text>
  83. </view>
  84. </view>
  85. </swiper-item>
  86. </swiper>
  87. </view>