fix:修复临时rss没定义标题和季度导致无法搜刮的问题

This commit is contained in:
2022-07-16 21:06:04 +08:00
parent ffb9c8f161
commit 760720a96c
3 changed files with 41 additions and 18 deletions

View File

@@ -208,20 +208,43 @@
}
})
function addTmpRss(def) {
layer.prompt({
formType: 0,
value: '',
title: '请输入RSS地址'
}, function(value, index, elem){
$.post('/anim/rss/add.do',{
title: value,
bid:-1
},function (json) {
console.log(json)
layer.msg(json.msg)
layer.close(index);
})
});
let option = '';
for (let i = 0; i < 20; i++) {
if (i === 1) {
option += '<option selected>' + i + '</option>'
} else {
option += '<option>' + i + '</option>'
}
}
let html = '<form class="layui-form">标题:<div class="layui-form-item"><input type="text" id="anim_rss_title" required lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">URL:<textarea class="layui-textarea" id="rss_value""></textarea> 季度:<select lay-search lay-verify="required" id="rss_select">' + option + '</select> </div></form>'
layer.open({
type: 0,
area: ['500px', '600px'],
title: '请输入RSS地址',
content: html,
success: function () {
layui.use(['form'], function () {
layui.form.render('select');
})
},
cancel :function (index){
layer.close(index)
},
yes: function (index, elem) {
let url = $('#rss_value')[0].value
let title = $('#anim_rss_title')[0].value+ '/Season ' + $('#rss_select')[0].value
$.post("/anim/rss/add.do", {
title: url
, titleKey: title
, bid: -1
}, function (json) {
layer.msg(json.msg)
layer.close(index)
})
}
})
}
layui.use(['layer', 'form', 'element', 'table', 'util'], function () {
let layer = layui.layer