废话不多说直接附代码
wxml
<!--index.wxml-->
<view class="videoBox">
<view class="video {
{touch==true? 'transfrom' : '' }}" style="transform:translateY(-{
{current*100}}%);" bindtouchstart='touchstart' bindtouchmove='touchmove' bindtouchend='touchend' bindtouchcancel='touchcancel'>
<view wx:for="{
{videoList}}" class='videoitem' wx:key="{
{item}}">
<video src="http://{
{item.videoUrl}}" id="videoplayer" bindtimeupdate="videoUpdate" bindtap='videoTap' wx:if="{
{current==index}}" object-fit="contain" loop='{
{true}}' autoplay='{
{true}}' custom-cache="{
{true}}" controls='{
{false}}' show-progress="{
{true}}" show-fullscreen-btn="{
{false}}" show-play-btn="{
{false}}"
show-center-play-btn="{
{false}}" enable-progress-gesture="{
{false}}" vslide-gesture-in-fullscreen="{
{false}}" poster="{
{item.videoImageUrl}}">
</video>
<!-- <image src="http://{
{item.videoImageUrl}}" class="preImage" mode='aspectFit' lazy-load="{
{true}}" wx:else></image> -->
<!-- 右侧区域 -->
<view class='btnBox {
{switchTo?"show":"hide"}}'>
<view class='btnTx' bindtap='{
{isFollow==0?"follow":""}}'>
<image class='TX' src='{
{item.headUrl}}'></image>
<image class='followAdd {
{isFollow==0?"show":"hide"}}' src='../../img/followAdd.png'></image>
</view>
<view class='btnCollect' bindtap='btnCollect'>
<image src='../../img/{
{isCollect==1?"collect_H":"collect_B"}}.png'></image>
<text>收藏</text>
</view>
<button class='btnShare' open-type='share'>
<image src='../../img/share.png'></image>
<text>分享</text>
</button>
<view class='btnTelPhone {
{oneself?"hide":"show"}}' bindtap='btnTelPhone'>
<image src='../../img/telPhone.png'></image>
<text>电话</text>
</view>
<view class='btnShut {
{oneself?"show":"hide"}}' bindtap='btnShut'>
<image src='../../img/shut.png'></image>
<text>关闭