Commit c3ebe44f by 李嘉林

直播暂停功能

parent 9c5c33c3
<template>
<!-- 直播暂停 -->
<div class="pauseShow">
<p class="tit">主播暂时离开</p>
</div>
</template>
<script type="text/ecmascript-6">
export default {
name: "",
data() {
return {};
},
components: {},
computed: {},
created() {},
mounted() {},
methods: {}
};
</script>
<style lang="scss" scoped>
.pauseShow {
position: absolute;
width: 70vw;
top: 40%;
left: 15vw;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.tit {
font-size: 30px;
font-weight: bold;
color: #fff;
}
}
</style>
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
></livedIsMsg> ></livedIsMsg>
<!-- 带货商品层 --> <!-- 带货商品层 -->
<livedExplainingCommodities <livedExplainingCommodities
v-if="info.liveBroadcastState==1&&list" v-if="(info.liveBroadcastState==1||info.liveBroadcastState==3)&&list"
:updateGoods="updateGoods" :updateGoods="updateGoods"
:goodsList="list" :goodsList="list"
></livedExplainingCommodities> ></livedExplainingCommodities>
...@@ -175,10 +175,10 @@ export default { ...@@ -175,10 +175,10 @@ export default {
addLike(val) { addLike(val) {
this.imgAni = true; this.imgAni = true;
if (val == 1) { if (val == 1) {
if (this.info.liveBroadcastState < 1) { // if (this.info.liveBroadcastState < 1) {
this.notAgainLive(); // this.notAgainLive();
return; // return;
} // }
this.likeNum++; this.likeNum++;
let query = { let query = {
liveBroadcastId: this.liveId, liveBroadcastId: this.liveId,
......
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
</div> </div>
<!-- 未开始展示 --> <!-- 未开始展示 -->
<notStarted v-if="liveNoticeInfo.liveBroadcastState==0" :info="liveNoticeInfo"></notStarted> <notStarted v-if="liveNoticeInfo.liveBroadcastState==0" :info="liveNoticeInfo"></notStarted>
<!-- 直播暂停展示 -->
<isPauseShow v-if="liveNoticeInfo.liveBroadcastState==3" :info="liveNoticeInfo"></isPauseShow>
<!-- 结束展示 --> <!-- 结束展示 -->
<livedIsEnded <livedIsEnded
v-if="liveNoticeInfo.liveBroadcastState==2" v-if="liveNoticeInfo.liveBroadcastState==2"
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
></livedIsEnded> ></livedIsEnded>
<!-- 控件层 --> <!-- 控件层 -->
<livedControls <livedControls
v-if="liveNoticeInfo&&liveNoticeInfo.liveBroadcastState<2" v-if="liveNoticeInfo&&liveNoticeInfo.liveBroadcastState!=2"
:info="liveNoticeInfo" :info="liveNoticeInfo"
:entryNoticeText="entryNoticeText" :entryNoticeText="entryNoticeText"
:guestBookList="guestBookList" :guestBookList="guestBookList"
...@@ -73,11 +75,17 @@ ...@@ -73,11 +75,17 @@
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import { serialize, getQueryVariable, DFSImg,getNavbarInfo } from "@/utils/index"; import {
serialize,
getQueryVariable,
DFSImg,
getNavbarInfo
} from "@/utils/index";
import live from "@/api/live"; import live from "@/api/live";
import notStarted from "@/components/livedModel/notStarted"; import notStarted from "@/components/livedModel/notStarted";
import livedControls from "@/components/livedModel/livedControls"; import livedControls from "@/components/livedModel/livedControls";
import livedIsEnded from "@/components/livedModel/livedIsEnded"; import livedIsEnded from "@/components/livedModel/livedIsEnded";
import isPauseShow from "@/components/livedModel/isPauseShow";
import spokesman from "@/api/spokesman"; import spokesman from "@/api/spokesman";
import shop from "@/api/shop"; import shop from "@/api/shop";
export default { export default {
...@@ -110,21 +118,22 @@ export default { ...@@ -110,21 +118,22 @@ export default {
userId: "", userId: "",
hasInvitationStatus: 0, // 邀请资格:0-不能够邀请下级,1-能够邀请下级 hasInvitationStatus: 0, // 邀请资格:0-不能够邀请下级,1-能够邀请下级
spokesmanObj: {}, //分销员信息 spokesmanObj: {}, //分销员信息
navTop:0, navTop: 0,
navHeight:0, navHeight: 0
}; };
}, },
components: { components: {
notStarted, notStarted,
livedControls, livedControls,
livedIsEnded livedIsEnded,
isPauseShow
}, },
computed: {}, computed: {},
onLoad(options) { onLoad(options) {
getNavbarInfo(res=>{ getNavbarInfo(res => {
console.log(res,'--------------------125') console.log(res, "--------------------125");
this.navTop=res.navTop this.navTop = res.navTop;
this.navHeight=res.navHeight this.navHeight = res.navHeight;
}); });
wx.getNetworkType({ wx.getNetworkType({
success: function(res) { success: function(res) {
...@@ -149,12 +158,12 @@ export default { ...@@ -149,12 +158,12 @@ export default {
this.backPath = this.params.fromPagePath || "/"; this.backPath = this.params.fromPagePath || "/";
this.shopLogo = DFSImg(this.params.shopLogo, 40, 40); this.shopLogo = DFSImg(this.params.shopLogo, 40, 40);
// 是否有分销员信息 // 是否有分销员信息
if(this.params.spokesmanGroupId){ if (this.params.spokesmanGroupId) {
this.$store.commit("setSpokesman", { this.$store.commit("setSpokesman", {
spokesmanGroupId: this.params.spokesmanGroupId, spokesmanGroupId: this.params.spokesmanGroupId,
spokesmanShopId: this.params.spokesmanShopId, spokesmanShopId: this.params.spokesmanShopId,
spokesmanRelId: this.params.spokesmanRelId spokesmanRelId: this.params.spokesmanRelId
}) });
} }
this.init(); this.init();
this.infoTiming = setInterval(() => { this.infoTiming = setInterval(() => {
...@@ -169,10 +178,10 @@ export default { ...@@ -169,10 +178,10 @@ export default {
onShareAppMessage(options) { onShareAppMessage(options) {
let _this = this; let _this = this;
if(this.hasInvitationStatus==1){ if (this.hasInvitationStatus == 1) {
Object.assign(this.params,this.params,this.spokesmanObj); Object.assign(this.params, this.params, this.spokesmanObj);
} }
console.log(this.params,'--------------161') console.log(this.params, "--------------161");
let shareObj = { let shareObj = {
title: this.liveNoticeInfo.title, title: this.liveNoticeInfo.title,
path: `/pages/lived/main?params=${JSON.stringify(this.params)}`, path: `/pages/lived/main?params=${JSON.stringify(this.params)}`,
...@@ -207,11 +216,11 @@ export default { ...@@ -207,11 +216,11 @@ export default {
this.firstComing = true; this.firstComing = true;
if (this.infoTiming) { if (this.infoTiming) {
clearInterval(this.infoTiming); clearInterval(this.infoTiming);
this.infoTiming=null; this.infoTiming = null;
} }
if (this.goodTiming) { if (this.goodTiming) {
clearInterval(this.goodTiming); clearInterval(this.goodTiming);
this.goodTiming=null; this.goodTiming = null;
} }
}, },
mounted() {}, mounted() {},
...@@ -235,7 +244,7 @@ export default { ...@@ -235,7 +244,7 @@ export default {
} }
if (this.liveNoticeInfo.liveBroadcastState != 2 && !this.goodTiming) { if (this.liveNoticeInfo.liveBroadcastState != 2 && !this.goodTiming) {
this.goodTiming = setInterval(() => { this.goodTiming = setInterval(() => {
console.log("--------获取商品接口") console.log("--------获取商品接口");
this.getGoodsList(); this.getGoodsList();
}, 5000); }, 5000);
} else if ( } else if (
...@@ -365,6 +374,16 @@ export default { ...@@ -365,6 +374,16 @@ export default {
this.firstComing = false; this.firstComing = false;
this.init(); this.init();
} }
} else if (
this.liveNoticeInfo.liveBroadcastState == 1 &&
resData.liveState == "PAUSE_LIVE"
) {
this.liveNoticeInfo.liveBroadcastState = 3
} else if (
this.liveNoticeInfo.liveBroadcastState == 3 &&
resData.liveState == "IN_LIVE"
) {
this.liveNoticeInfo.liveBroadcastState = 1
} }
this.guestBookList = resData.guestBookList; //评论列表 this.guestBookList = resData.guestBookList; //评论列表
this.likeInfo = resData.likeInfo; //点赞信息 this.likeInfo = resData.likeInfo; //点赞信息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment