update 暂时关闭点击录制后刷新页面功能

This commit is contained in:
zlzw 2024-11-28 18:02:58 +08:00
parent 4474da490f
commit 52e4312a32

View File

@ -68,15 +68,15 @@
<p>开播时长:{{= item.liveTime}}</p> <p>开播时长:{{= item.liveTime}}</p>
直播录制状态: 直播录制状态:
{{# if(item.downloadVideo){ }} {{# if(item.downloadVideo){ }}
<span style="color: #16b777" onclick="clickVideo('{{= item.roomId}}',true)">录制中</span> <span style="color: #16b777" onclick="clickVideo('{{= item.roomId}}',true,this)">录制中</span>
{{# } else{ }} {{# } else{ }}
<span style="color: #FD482C" onclick="clickVideo('{{= item.roomId}}',false)">待机中</span> <span style="color: #FD482C" onclick="clickVideo('{{= item.roomId}}',false,this)">待机中</span>
{{# }; }}<br> {{# }; }}<br>
弹幕录制状态: 弹幕录制状态:
{{# if(item.danmu){ }} {{# if(item.danmu){ }}
<span style="color: #16b777" onclick="clickDanmu('{{= item.roomId}}',true)">录制中</span> <span style="color: #16b777" onclick="clickDanmu('{{= item.roomId}}',true,this)">录制中</span>
{{# } else{ }} {{# } else{ }}
<span style="color: #FD482C" onclick="clickDanmu('{{= item.roomId}}',false)">待机中</span> <span style="color: #FD482C" onclick="clickDanmu('{{= item.roomId}}',false,this)">待机中</span>
{{# }; }}<br> {{# }; }}<br>
</div> </div>
</div> </div>
@ -98,21 +98,21 @@
console.log(roomId) console.log(roomId)
window.open("https://live.bilibili.com/" + roomId, '_blank') window.open("https://live.bilibili.com/" + roomId, '_blank')
} }
function clickVideo(roomId, status) { function clickVideo(roomId, status,that) {
const title = "是否" + (status ? "停止" : "启动") + "录制视频?" const title = "是否" + (status ? "停止" : "启动") + "录制视频?"
layer.confirm(title, { icon: 3 }, function () { layer.confirm(title, { icon: 3 }, function () {
if (status) { if (status) {
stopLiveVideo(roomId) stopLiveVideo(roomId)
.then(data => { .then(data => {
layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () { layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () {
location.reload(); //location.reload();
}); });
}) })
} else { } else {
startLiveVideo(roomId) startLiveVideo(roomId)
.then(data => { .then(data => {
layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () { layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () {
location.reload(); //location.reload();
}); });
}) })
} }
@ -128,7 +128,7 @@
stopLiveDanmu(roomId) stopLiveDanmu(roomId)
.then(data => { .then(data => {
layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () { layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () {
location.reload(); // location.reload();
}); });
}) })
@ -136,7 +136,7 @@
startLiveDanmu(roomId) startLiveDanmu(roomId)
.then(data => { .then(data => {
layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () { layer.msg(data.message, { icon: (data.status == 100 ? 1 : 0) }, function () {
location.reload(); // location.reload();
}); });
}) })
} }