微信小程序如何实现抖音上下滑动切换短视频的布局效果?
网友回复
有,这样的
wxml代码
<view class="video-contain"> <!-- 自定义头部 --> <cover-view class="nav-myself" style="height:{{navigationBarHeight+'px'}}"> <cover-view class="status-title" style="height:{{statusBarHeight+'px'}}"></cover-view> <cover-view class="title-content"> <cover-view class="back" bindtap="goback" ><cover-image src="http://repo.bfw.wiki/bfwrepo/icon/5ff8f2c747054.png"></cover-image></cover-view> </cover-view> </cover-view> <!-- 滑动遮罩 --> <cover-view class="touch-cover" bindtouchstart="touchStart" bindtouchend="touchEnd" bindtap='changeStatus'> </cover-view> <!-- 暂无数据 --> <view wx:if="{{!lists.length&&!isLoading}}" > <no-data type="common" txt="暂无数据"></no-data> </view> <swiper vertical="true" skip-hidden-item-layout="{{true}}" loop="{{true}}" current="{{swiperCurrent}}" circular="{{true}}"> <swiper-item wx:for="{{lists}}" wx:key="item" wx:if="{{lists.length>0}}"> <video src="{{item.url}}" objectFit="fill" autoplay controls="{{false}}" loop="{{true}}" id="video{{item.id}}" data-id="{{item.id}}" custom-cache="{{false}}"></video> </swiper-item> </swiper> <!-- 右侧工具 --> <cover-view class="tools" wx:if="{{lists.length}}"> <cover-image src="http://repo.bfw.wiki/bfwrepo/icon/5ff8f1528e5f1.png" class="home-icon right-icon" bindtap='goList'></cover-image> <button open-type="share" class="share-button"> <cover-image class="share-icon right-icon" src="http://repo.bfw.wiki/bfwrepo/image/5ff8ee1070a63.png"></cover-image> </button> </cover-view> <!-- 暂停按钮 --> <cover-image class="play-btn" wx:if="{{!playState}}" bindtap='changeStatus' src="http://repo.bfw.wiki/bfwrepo/image/5ff8ef3f20eea.png"></cover-image> <!-- 商品信息 --> <cover-view class="video-goods" bindtap='goDeatil' wx:if="{{lists.length>0}}"> <cover-image src="http://repo.bfw.wiki/bfwrepo/image/5e0e941197338.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90"></cover-image> <cover-view class="goods-right"> <cover-view class="title">秋季衣服</cover-view> <cover-view class="goods-price"> <cover-view class="price"> <cover-view style="color:rgb({{themeColor.mainColor}});font-size:36rpx">¥11.00 </cover-view> <cover-view class="market-price" style='width:100%'> <cover-view class="market-box"> ¥22.00<cover-view class="hidden-box">一</cover-view> <cover-view class="line"></cover-view> </cover-view> </cover-view> </cover-view> <cover-view class="goBuy" style='background:red;'>立即抢购</cover-view> </cover-view> </cover-view> </cover-view> <!-- 轮播购买记录 --> <view class="buy-info" > <swiper indicator-dots="{{false}}" autoplay="true" vertical circular style="height:270rpx"> <block> <swiper-item > <view class="item-li" > <image src="http://repo.bfw.wiki/bfwrepo/image/5fbedf8f5349c.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" ></image> <text>购买了2件</text> </view> </swiper-item> <swiper-item > <view class="item-li" > <image src="http://repo.bfw.wiki/bfwrepo/image/5fbedf8f5349c.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" ></image> <text>购买了5件</text> </view> </swiper-item> <swiper-item > <view class="item-li" > <image src="http://repo.bfw.wiki/bfwrepo/image/5fbedf8f5349c.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_100,h_100,/quality,q_90" ></image> <text>购买了3件</text> </view> </swiper-item> </block> </swiper> </view> </view>
json代码
{ "usingComponents": {}, "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#FFFFFF", "navigationBarTextStyle": "black", "navigationBarTitleText": "抖音", "navigationStyle": "custom" }
wxss代码
/* pages/Main/myVideo/index.wxss */ page{ width: 100%; height: 100%; } .video-contain{ width: 100%; height: 100%; } swiper{ height: 100%; width: 100%; } swiper video{ width: 100%; height: 100%; } .touch-cover{ width: 100%; height: 100%; positi...
点击查看剩余70%
webrtc进行p2p连接发送的文本音视频文件是否是加密的?
如何让一个可爱的三维动物通过three在浏览器中有表情动作的自然说话?
go与wails如何开发一个高性能的原生桌面应用?
python如何调用openai的api实现知识讲解类动画讲解视频的合成?
html如何直接调用openai的api实现海报可视化设计及文本描述生成可编辑海报?
f12前端调试如何找出按钮点击事件触发的那段代码进行调试?
abcjs如何将曲谱播放后导出mid和wav格式音频下载?
python如何将曲子文本生成音乐mp3或wav、mid文件
python中mp3、wav音乐如何转成mid格式?
js在HTML中如何将曲谱生成音乐在线播放并下载本地?