67 行
2.4 KiB
HTML
可执行文件
67 行
2.4 KiB
HTML
可执行文件
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<!--[1.9.4]-->
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css"/>
|
|
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/jquery/js/jquery.min.js"></script>
|
|
</head>
|
|
<body>
|
|
|
|
<form class="layui-form" action="" method="" lay-filter="example">
|
|
<div class="layui-form-item" style="margin-top: 20px;">
|
|
<label class="layui-form-label" style="width: 100px;">预警时间:</label>
|
|
<div class="layui-input-inline" style="display: flex;align-items: center">
|
|
<input type="text" name="warning" id="warning" lay-verify="warning" autocomplete="off" class="layui-input"
|
|
value="{$warning}">
|
|
<span style="color: black;padding-left: 10px">天</span>
|
|
</div>
|
|
</div>
|
|
<div style="padding-left: 130px;color: #999">设置商品过期预警时间(默认一天)</div>
|
|
<div class="layui-form-item">
|
|
<div class="layui-input-block" style="margin-left: 130px;margin-top: 20px">
|
|
<input type="button" id="_button" class="layui-btn" value="立即提交" lay-filter="formDemoPane">
|
|
</div>
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
layui.use(['form'], function () {
|
|
var form = layui.form
|
|
|
|
//监听提交
|
|
form.on('submit(demo)', function (data) {
|
|
layer.msg(JSON.stringify(data.field));
|
|
return false;
|
|
});
|
|
$('#_button').click(function () {
|
|
var warning = $('#warning').val();
|
|
if (warning < 1) {
|
|
warning = 1;
|
|
}
|
|
var storeid = {$storeid};
|
|
$.ajax({
|
|
url: "{:U('Past/create_warning')}",
|
|
type: "POST",
|
|
data: {warning: warning, storeid: storeid},
|
|
success: function (res) {
|
|
// console.log(res);
|
|
if (res.status == 1) {
|
|
layer.msg(res.msg, {icon: 1, time: 2000}, function () {
|
|
parent.layer.closeAll();
|
|
})
|
|
} else {
|
|
layer.msg(res.msg, {icon: 2, time: 2000}, function () {
|
|
parent.layer.closeAll();
|
|
})
|
|
}
|
|
}
|
|
})
|
|
});
|
|
});
|
|
</script>
|
|
|
|
</body>
|
|
</html> |