add 新增了批量订阅 add
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user