2020-01-01 13:17:19 +08:00
|
|
|
{extend name="public/base" /}
|
|
|
|
|
|
|
|
{block name="body"}
|
|
|
|
|
2021-06-10 13:39:51 +08:00
|
|
|
<div class="layui-form" lay-filter="layuiadmin-form-slider" id="layuiadmin-form-slider" style="padding: 20px 20px 0 0;">
|
2020-01-01 13:17:19 +08:00
|
|
|
|
2022-08-02 20:39:46 +08:00
|
|
|
<div class="layui-form-item">
|
2020-01-01 13:17:19 +08:00
|
|
|
<label class="layui-form-label">位置</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<select name="slid_type" lay-verify="required">
|
2022-08-02 20:39:46 +08:00
|
|
|
<option value="">链接投放位置</option>
|
|
|
|
<option value="1">1首页幻灯 - 1126x410</option>
|
|
|
|
<option value="2">2首页图片</option>
|
2021-07-22 10:43:48 +08:00
|
|
|
<option value="3">3分类图片</option>
|
|
|
|
<option value="4">4详情图片</option>
|
2022-08-02 20:39:46 +08:00
|
|
|
<option value="5">5首页赞助</option>
|
2021-07-22 10:43:48 +08:00
|
|
|
<option value="6">6分类赞助</option>
|
|
|
|
<option value="7">7详情赞助</option>
|
2022-08-02 20:39:46 +08:00
|
|
|
<option value="8">8温馨通道</option>
|
2021-07-22 10:43:48 +08:00
|
|
|
<option value="9">9友情链接</option>
|
2022-08-02 20:39:46 +08:00
|
|
|
<option value="10">10头部菜单</option>
|
|
|
|
<option value="11">11页脚链接</option>
|
|
|
|
</select>
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
|
|
<label class="layui-form-label">名称</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input type="text" name="slid_name" lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
2021-07-22 10:43:48 +08:00
|
|
|
<label class="layui-form-label">图片</label>
|
2020-01-01 13:17:19 +08:00
|
|
|
<div class="layui-input-inline">
|
2021-07-22 10:43:48 +08:00
|
|
|
<input type="text" name="slid_img" lay-verify="" placeholder="位置1-4需上传;位10贴icon图" autocomplete="off" class="layui-input" >
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
2021-07-22 10:43:48 +08:00
|
|
|
<button style="float: left;" type="button" class="layui-btn" id="layuiadmin-upload-slid-img">选图</button>
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
2021-07-22 10:43:48 +08:00
|
|
|
<div class="layui-form-item">
|
|
|
|
<label class="layui-form-label">背景</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input type="text" name="slid_color" lay-verify="" placeholder="选位置5,6,7请选背景色" autocomplete="off" class="layui-input" id="color-select">
|
|
|
|
</div>
|
|
|
|
<div class="layui-inline" style="left: -11px;">
|
|
|
|
<div id="coloer-form"></div>
|
|
|
|
</div>
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
2021-07-22 10:43:48 +08:00
|
|
|
<div class="layui-form-item">
|
|
|
|
<label class="layui-form-label">链接</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input type="text" name="slid_href" lay-verify="required" placeholder="输入完整连接*必填" autocomplete="off" class="layui-input">
|
|
|
|
</div>
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
2021-07-22 10:43:48 +08:00
|
|
|
<div class="layui-form-item">
|
|
|
|
<label class="layui-form-label">开始</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input type="text" name="slid_start" id="start-time" lay-verify="required" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="layui-form-item">
|
|
|
|
<label class="layui-form-label">结束</label>
|
|
|
|
<div class="layui-input-inline">
|
|
|
|
<input type="text" name="slid_over" id="over-time" lay-verify="required" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
|
|
|
</div>
|
2020-01-01 13:17:19 +08:00
|
|
|
</div>
|
|
|
|
<div class="layui-form-item layui-hide">
|
|
|
|
<input type="button" lay-submit lay-filter="LAY-slider-submit" id="LAY-slider-submit" value="确认">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{/block}
|
|
|
|
{block name="js"}
|
|
|
|
<script>
|
|
|
|
layui.config({
|
|
|
|
base: '/static/admin/' //静态资源所在路径
|
|
|
|
}).extend({
|
|
|
|
index: 'lib/index' //主入口模块
|
2021-07-07 17:40:43 +08:00
|
|
|
}).use(['index', 'form', 'upload','laydate','colorpicker', 'imgcom'], function(){
|
2020-01-01 13:17:19 +08:00
|
|
|
var $ = layui.$
|
|
|
|
,form = layui.form
|
|
|
|
,laydate = layui.laydate
|
2021-07-07 17:40:43 +08:00
|
|
|
,upload = layui.upload
|
|
|
|
,imgcom = layui.imgcom;
|
2021-06-10 13:39:51 +08:00
|
|
|
var colorpicker = layui.colorpicker;
|
2020-01-01 13:17:19 +08:00
|
|
|
|
2021-06-10 13:39:51 +08:00
|
|
|
//颜色表单赋值
|
|
|
|
colorpicker.render({
|
|
|
|
elem: '#coloer-form'
|
|
|
|
,color: '#1c97f5'
|
|
|
|
,done: function(color){
|
|
|
|
$('#color-select').val(color);
|
|
|
|
}
|
|
|
|
});
|
2020-01-01 13:17:19 +08:00
|
|
|
|
|
|
|
//开始时间
|
|
|
|
laydate.render({
|
|
|
|
elem: '#start-time'
|
|
|
|
,btns: ['clear', 'now']
|
|
|
|
,trigger: 'click'
|
|
|
|
});
|
|
|
|
|
|
|
|
//结束时间
|
|
|
|
laydate.render({
|
|
|
|
elem: '#over-time'
|
|
|
|
,btns: ['clear', 'now']
|
|
|
|
,trigger: 'click'
|
|
|
|
});
|
2021-07-15 19:10:33 +08:00
|
|
|
//上传图片
|
2020-01-01 13:17:19 +08:00
|
|
|
upload.render({
|
|
|
|
elem: '#layuiadmin-upload-slid-img'
|
|
|
|
,url: 'uploadImg'
|
2021-07-15 19:10:33 +08:00
|
|
|
,data:{type:'image'}
|
2020-01-01 13:17:19 +08:00
|
|
|
,accept: 'images'
|
|
|
|
,acceptMime: 'image/*'
|
2021-07-07 17:40:43 +08:00
|
|
|
,auto: false
|
|
|
|
,choose: function (obj) { //选择文件后的回调
|
|
|
|
imgcom.uploads(obj);
|
|
|
|
}
|
2020-01-01 13:17:19 +08:00
|
|
|
,done: function(res){
|
|
|
|
//console.log(res)
|
|
|
|
$(this.item).prev("div").children("input").val(res.src)
|
|
|
|
if(res.code == 0){
|
|
|
|
layer.msg(res.msg,{
|
|
|
|
icon:6,
|
|
|
|
tiye:2000
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
layer.open({
|
|
|
|
title:"上传失败",
|
|
|
|
content:res.msg,
|
|
|
|
icon:5,
|
|
|
|
anim:6
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
{/block}
|