From aa90f73d69f37a0b79842453ed73d17f746253f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com>
Date: Wed, 30 Dec 2020 11:50:55 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]=E5=A2=9E=E5=8A=A0=E4=BA=86?=
=?UTF-8?q?=E7=9B=B4=E6=92=AD=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apis/index.js | 4 +-
apis/interfaces/live.js | 6 +--
components/swiperVideo/swiperVideo.js | 3 --
components/swiperVideo/swiperVideo.wxml | 4 +-
components/swiperVideo/swiperVideo.wxss | 3 +-
pages/shortVideo/index.js | 13 +++++
pages/shortVideo/index.wxml | 18 +++----
pages/shortVideo/index.wxss | 64 +++++++++++++++++++++++--
project.config.json | 5 +-
9 files changed, 96 insertions(+), 24 deletions(-)
diff --git a/apis/index.js b/apis/index.js
index f31dbbc..f4d4faa 100644
--- a/apis/index.js
+++ b/apis/index.js
@@ -15,6 +15,7 @@ import company from "./interfaces/company"
import companyModule from "./interfaces/home"
import ticket from "./interfaces/ticket"
import address from "./interfaces/address"
+import live from "./interfaces/live"
export default{
publics,
@@ -28,5 +29,6 @@ export default{
company,
companyModule,
ticket,
- address
+ address,
+ live
}
diff --git a/apis/interfaces/live.js b/apis/interfaces/live.js
index 9da3502..4b1d036 100644
--- a/apis/interfaces/live.js
+++ b/apis/interfaces/live.js
@@ -1,11 +1,11 @@
/*
- * 电子名片
+ * 直播
*/
import {req} from "../request"
-const card = data => req({url: "cardpersonal" , data: data}) //名片信息
+const rooms = () => req({url: "lives/rooms"}) //获取直播间列表
export default({
- card
+ rooms
})
diff --git a/components/swiperVideo/swiperVideo.js b/components/swiperVideo/swiperVideo.js
index 1b36a98..6e12469 100644
--- a/components/swiperVideo/swiperVideo.js
+++ b/components/swiperVideo/swiperVideo.js
@@ -43,9 +43,6 @@ Component({
methods: {
// 视频滚动了
changeVideo(e){
-
- console.log(e)
-
let videoLists = this.data.videoList,
current = e.detail.current,
currentId = this.data.playId,
diff --git a/components/swiperVideo/swiperVideo.wxml b/components/swiperVideo/swiperVideo.wxml
index fc7c1c3..bb9e0a0 100644
--- a/components/swiperVideo/swiperVideo.wxml
+++ b/components/swiperVideo/swiperVideo.wxml
@@ -2,6 +2,7 @@
-
+
diff --git a/components/swiperVideo/swiperVideo.wxss b/components/swiperVideo/swiperVideo.wxss
index 8b4285a..2da71f0 100644
--- a/components/swiperVideo/swiperVideo.wxss
+++ b/components/swiperVideo/swiperVideo.wxss
@@ -15,7 +15,8 @@
-webkit-overflow-scrolling:touch;
}
-.videoSwiperItem video{
+.videoSwiperItemVideo,
+.videoCover{
width: 100%;
height: 100%;
}
diff --git a/pages/shortVideo/index.js b/pages/shortVideo/index.js
index bf9fbbc..b2d465a 100644
--- a/pages/shortVideo/index.js
+++ b/pages/shortVideo/index.js
@@ -14,6 +14,7 @@ Page({
videoIndex : 0, //当前播放视频的下标
videoId : "", //当前播放的视频id
playState : true, //视频播放状态
+ rooms : [], //直播列表
},
/**
@@ -29,6 +30,18 @@ Page({
})
},
+ /**
+ * 获取直播间列表
+ */
+ onShow(){
+ wx.$api.live.rooms().then(res=>{
+ console.log(res.list)
+ this.setData({
+ rooms: res.list
+ })
+ })
+ },
+
/***
* 视频的播放状态
*/
diff --git a/pages/shortVideo/index.wxml b/pages/shortVideo/index.wxml
index dded866..32d0160 100644
--- a/pages/shortVideo/index.wxml
+++ b/pages/shortVideo/index.wxml
@@ -1,13 +1,5 @@
-
-进入直播间
-
-
-
- 改变全局id
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/pages/shortVideo/index.wxss b/pages/shortVideo/index.wxss
index 7133322..30ae81f 100644
--- a/pages/shortVideo/index.wxss
+++ b/pages/shortVideo/index.wxss
@@ -7,7 +7,7 @@
page{
- /* background: #0e0c1a; */
+ background: #0e0c1a;
}
.videoSwiper{
@@ -19,13 +19,69 @@
.videos-content{
position: relative;
height: 100vh;
- display: none;
+ box-sizing: border-box;
+ padding-bottom: calc(48px + env(safe-area-inset-bottom));
+}
+
+/* 直播信息 */
+.live-rooms{
+ position: absolute;
+ top: calc(180rpx + env(safe-area-inset-bottom));
+ left: 30rpx;
+}
+
+.live-rooms-cover{
+ width: 98rpx;
+ height: 98rpx;
+ border-radius: 50%;
+ vertical-align: top;
+}
+
+.live-rooms-nav{
+ position: relative;
+ display: inline-block;
+ width: 98rpx;
+ height: 98rpx;
+ margin-left: 30rpx;
+}
+
+.live-rooms-nav:first-child{
+ margin-left: 0;
+}
+
+.live-rooms-nav::before,
+.live-rooms-nav::after{
+ position: absolute;
+ content: "";
+}
+
+.live-rooms-nav::before{
+ width: 98rpx;
+ height: 98rpx;
+ border:solid 4rpx #FF8C37;
+ border-radius: 50%;
+ box-sizing: border-box;
+}
+
+.live-rooms-nav::after{
+ content: "直播中";
+ position: absolute;
+ bottom: 0;
+ left: 10rpx;
+ width: 78rpx;
+ background: #FF8C37;
+ color: white;
+ height: 32rpx;
+ line-height: 32rpx;
+ font-size: 20rpx;
+ text-align: center;
+ border-radius: 16rpx;
}
/* 视频信息 */
.video-info{
position: absolute;
- bottom: 50rpx;
+ bottom: calc(78px + env(safe-area-inset-bottom));
left: 30rpx;
width: calc(100% - 218rpx);
}
@@ -51,7 +107,7 @@
.video-tool{
position: absolute;
right: 30rpx;
- bottom: 50rpx;
+ bottom: calc(78px + env(safe-area-inset-bottom));
}
.video-tool-item{
diff --git a/project.config.json b/project.config.json
index 3e74c5d..dff0407 100644
--- a/project.config.json
+++ b/project.config.json
@@ -40,7 +40,7 @@
},
"compileType": "miniprogram",
"libVersion": "2.13.2",
- "appid": "wx49efb36db851933d",
+ "appid": "wxd931d03dfe955254",
"projectname": "%E8%A1%8C%E4%B8%9A%E7%89%88Saas",
"debugOptions": {
"hidedInDevtools": []
@@ -59,7 +59,8 @@
"list": []
},
"miniprogram": {
- "list": [{
+ "list": [
+ {
"name": "登录",
"pathName": "pages/login/login",
"query": "",