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

@@ -9,6 +9,7 @@
<body>
<div id="header"></div>
不想做了,鸽
</body>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>

View File

@@ -89,6 +89,9 @@
]],
done: function () {
done();
if (getParam('type') === 'createRoom') {
createRoom('')
}
},
error: function (res, msg) {
console.log(res, msg)

View File

@@ -23,7 +23,8 @@
</script>
<script type="text/html" id="toolDemo">
<div class="layui-clear-space">
<a class="layui-btn layui-btn-xs" lay-event="edit">删除</a>
<a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
<a class="layui-btn layui-btn-xs" lay-event="input">导入关注</a>
</div>
</script>
<script>
@@ -39,8 +40,12 @@
});
}
function refreshCookie(data) {
console.log(data)
function refresh(data) {
refreshCookie(data)
.then(data => {
console.log(data)
layer.msg(data.message)
})
}
function createRoom() {
login()
@@ -54,9 +59,10 @@
shadeClose: false, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化
anim: 1, // 0-6 的动画形式,-1 不开启
content: '<div style="padding: 32px;text-align: center;" id="qrdiv">登陆后刷新</div>',
content: '<div style="padding: 32px;text-align: center;" id="qrdiv"><span id="loginTip">登陆后刷新</span></div>',
success: function (layero, index, that) {
new QRCode(document.getElementById("qrdiv"), data.data.qrcode);
reloadLogin(document.getElementById("loginTip"))
}
});
} else if (data.status === 301) {
@@ -67,6 +73,17 @@
})
}
function reloadLogin(tips) {
setTimeout(() => {
login()
.then(data => {
tips.innerHTML = data.message;
if (data.code !== 302) {
reloadLogin(tips)
}
})
}, 1000);
}
</script>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
@@ -105,20 +122,56 @@
{ field: 'uid', title: 'UID', width: 150, sort: true, fixed: 'left', templet: '<div><a href="https://space.bilibili.com/{{= d.uid}}" target="_blank">{{= d.uid}}</a>' },
{ field: 'uname', title: '用户名', width: 150, fixed: 'left' },
{ field: 'face', title: '头像', width: 80, templet: '<div><image src="" onerror="showImage(\'{{= d.face }}\',this);" style="width: 30px;height: 30px;"></div>' },
{ field: 'status', title: '状态', width: 150, templet: '<div> {{= d.status}} <button class="layui-btn layui-btn-xs" onclick="refreshCookie(\'{{= d.uid }}\')">刷新cookie</button>' },
{ field: 'status', title: '状态', width: 150, templet: '<div> {{= d.status}} <button class="layui-btn layui-btn-xs" onclick="refresh(\'{{= d.uid }}\')">刷新cookie</button>' },
{ field: 'sql_time', title: '添加时间', width: 190 },
{ fixed: "right", title: "操作", width: 80, align: "center", toolbar: "#toolDemo" }
{ fixed: "right", title: "操作", width: 180, align: "center", toolbar: "#toolDemo" }
]],
done: function () {
onDone();
},
error: function (res, msg) {
console.log(res, msg)
}
});
function onDone() {
table.on('tool(roomTable)', function (obj) {
var id = obj.config.id;
var data = obj.data;
var checkStatus = table.checkStatus(id);
var othis = lay(this);
switch (obj.event) {
case 'input':
onClickInput(data.uid)
break;
};
});
}
function onClickInput(uid) {
layer.open({
type: 2, // page 层类型
area: ['650px', '400px'],
title: '选择主播',
shade: 0.6, // 遮罩透明度
shadeClose: false, // 点击遮罩区域,关闭弹层
maxmin: true, // 允许全屏最小化
anim: 1, // 0-6 的动画形式,-1 不开启
// btn: ['确定', '取消'],
content: '/html/ui/userFollow.html?uid=' + uid,
yes: function (index, layero) {
var iframeWin = window[layero.find('iframe')[0]['name']];
var anchorRoomId = iframeWin.$('#anchorRoomId')[0].value;
if (!hasString(anchorRoomId)) {
layer.msg("请选择")
return
}
let url = new URL(window.location.href);
url.searchParams.set('roomId', anchorRoomId);
window.location.href = url.toString();
}
});
}
});

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, // 允许全屏最小化