微信小程序仿抖音,微视上下滑动整屏切换视频带关注,收藏

废话不多说直接附代码

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>关闭
  • 4
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值