新增直播轮播组件

This commit is contained in:
唐明明
2020-11-30 17:38:19 +08:00
parent 4b8baab1e5
commit f267036d9b
17 changed files with 102 additions and 66 deletions

View File

@@ -1,17 +0,0 @@
// pages/index/index.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad (options) {
}
})

View File

@@ -1,5 +0,0 @@
{
"usingComponents": {
}
}

View File

@@ -1,2 +0,0 @@
<!--pages/index/index.wxml-->
<text>pages/index/index.wxml</text>

View File

@@ -1 +0,0 @@
/* pages/index/index.wxss */

22
pages/videos/videos.js Normal file
View File

@@ -0,0 +1,22 @@
Page({
/**
* 页面的初始数据
*/
data: {
videoList: [] //获取短视频列表
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$api.video.videos().then(res=>{
console.log(res)
this.setData({
videoList: res
})
})
}
})

6
pages/videos/videos.json Normal file
View File

@@ -0,0 +1,6 @@
{
"usingComponents": {
"mp-video-swiper": "/components/videoSwiper/videoSwiper"
}
}

6
pages/videos/videos.wxml Normal file
View File

@@ -0,0 +1,6 @@
<mp-video-swiper
video-list="{{videoList}}"
class="videoSwiper"
>
</mp-video-swiper>

6
pages/videos/videos.wxss Normal file
View File

@@ -0,0 +1,6 @@
.videoSwiper{
width: 100%;
height: 100vh;
position: relative;
}