biliob/Web/html/ui/createConfig.html

106 lines
4.3 KiB
HTML
Raw Normal View History

2024-10-30 18:27:37 +08:00
<link rel="stylesheet" href="/layui/css/layui.css">
<body>
<input id="value" value="" type="hidden" />
<form class="layui-form layui-form-pane" action="" style="padding-left: 10px;padding-right: 10px;">
<div class="layui-form-item">
<label class="layui-form-label">直播房间地址</label>
<div class="layui-input-block">
<input type="text" name="url" autocomplete="off" placeholder="https://live.bilibili.com/xxxxx"
lay-verify="required" class="layui-input">
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label">录制弹幕</label>
<div class="layui-input-block">
<input type="checkbox" name="recordLive" lay-skin="switch" lay-filter="switchTest" title="启用|禁用">
</div>
</div>
<div class="layui-form-item" pane>
<label class="layui-form-label">录制视频</label>
<div class="layui-input-block">
<input type="checkbox" name="recordDanmu" lay-skin="switch" lay-filter="switchTest" title="启用|禁用">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">弹幕预定录制时间</label>
<div class="layui-input-inline">
<input type="text" name="recordDanmuDate" value="* * *" placeholder="* * *" lay-verify="required" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-text-em" onclick="timeTips(this)"><i
class="layui-icon layui-icon-help"></i> </div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">视频预定录制时间</label>
<div class="layui-input-inline">
<input type="text" name="recordLiveDate" value="* * *" placeholder="* * *" lay-verify="required" autocomplete="off" class="layui-input">
</div>
<div class="layui-form-mid layui-text-em" onclick="timeTips(this)"><i
class="layui-icon layui-icon-help"></i> </div>
</div>
<div class="layui-inline">
<label class="layui-form-label">录制绑定用户</label>
<div id="selects" class="layui-input-inline">
</div>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn" lay-submit lay-filter="submit-form">确认</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</form>
</body>
<script id="selectUser" type="text/html">
<select id="recordUid" name="recordUid" lay-verify="required" lay-search>
<option value="">直接选择或搜索选择</option>
{{# layui.each(d.data, function(index, item){ }}
<option value="{{= item.uid}}">[{{=item.uid}}]{{= item.uname}}</option>
{{# }); }}
</select>
</script>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/js/httpUtils.js"></script>
<script>
function timeTips(that) {
layer.tips('填写[分钟][小时][星期],空格分割,例如预定每周6晚上8点之后才开始录制则填写:* 8 6', that);
}
layui.use(['form', 'laytpl'], function () {
var form = layui.form;
var layer = layui.layer;
var laytpl = layui.laytpl
// 提交事件
form.on('submit(submit-form)', function (data) {
var field = data.field; // 获取表单字段值
// 显示填写结果,仅作演示用
// 此处可执行 Ajax 等操作
// …
addRoomConfig(field)
.then(json=>{
console.log(json)
})
return false; // 阻止默认 form 跳转
});
function close(){
var index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe 层的索引
parent.layer.close(index);
}
getBiliAllUser()
.then(data => {
var view = $("#selects").get(0);
laytpl($('#selectUser').get(0).innerHTML).render(data, function (html) {
view.innerHTML=html
form.render('select');
});
})
});
</script>