add 新增了批量订阅 add

This commit is contained in:
2024-11-21 18:29:19 +08:00
parent b15d1c917f
commit 35b014c585
39 changed files with 1871 additions and 280 deletions

View File

@@ -46,8 +46,14 @@
&nbsp; <div id="slider" lay-options="{value: 100,input:true}"></div>
<span>弹幕透明度</span>
</div>
</div>
<div class="layui-row">
<div class="layui-col-xs2">&nbsp;</div>
<div class="layui-col-xs7">
<canvas id="giftChart" height="200"></canvas>
</div>
</div>
<div style="margin-bottom: 10vh;"></div>
</body>
<script id="menulist" type="text/html">
<ul class="layui-tab-title">
@@ -106,7 +112,7 @@
<script src="/js/hls.js"></script>
<script src="/js/fly-barrage.iife.js"></script>
<script src="/js/lodash.min.js"></script>
<script src="/js/Chart.min.js"></script>
<script>
headerModel = 2;
@@ -221,9 +227,49 @@
playVideo(data.data)
}, 300)
})
});
initChart(roomId, options.id)
});
function initChart(roomId, videoId) {
getVideoGiftInfo(roomId, videoId)
.then(data => {
if (data.status != 100) {
return
}
var lables = [];
var values = [];
data.data.guardInfo.forEach(item => {
lables.push(item.gift_name+"\n"+item.total_price/100+"¥")
values.push(item.total_num)
});
data.data.giftInfo.forEach(item => {
lables.push(item.gift_name+"\n"+item.total_price/100+"¥")
values.push(item.total_gift_num)
});
new Chart($('#giftChart').get(0), {
type: 'bar',
data: {
labels: lables,
datasets: [{
label: '礼物(总额:'+data.data.price/100+"¥)",
data: values,
borderWidth: 1
}
]
},
options: {
scales: {
y: {
beginAtZero: true
}
}
}
});
})
}
function initMenu(data) {
var view = $("#menuView").get(0);
laytpl($('#menulist').get(0).innerHTML).render(data, function (html) {
@@ -244,7 +290,7 @@
layer.open({
type: 2, // page 层类型
area: ['320px', '400px'],
title: '打开B站客户端扫码登陆',
title: '选择主播',
shade: 0.6, // 遮罩透明度
shadeClose: false, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化