294 lines
9.7 KiB
HTML
294 lines
9.7 KiB
HTML
{extend name="public/base" /}
|
||
|
||
{block name="body"}
|
||
<div class="layui-fluid" id="component-tabs">
|
||
<div class="layui-row">
|
||
<div class="layui-col-md12">
|
||
<div class="layui-card">
|
||
<!--div class="layui-card-header">简洁风格</div-->
|
||
<div class="layui-card-body">
|
||
<div class="layui-tab layui-tab-brief" lay-filter="component-tabs-brief">
|
||
<ul class="layui-tab-title">
|
||
<li class="layui-this">邮件设置</li>
|
||
<li>积分设置</li>
|
||
<li>用户等级</li>
|
||
<li>商品管理</li>
|
||
<li>订单管理</li>
|
||
</ul>
|
||
<div class="layui-tab-content">
|
||
<div class="layui-tab-item layui-show">
|
||
<div class="layui-form" wid100 lay-filter="">
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">SMTP服务器</label>
|
||
<div class="layui-input-inline">
|
||
<input type="text" name="host" value="{$mailserver.host}" class="layui-input">
|
||
</div>
|
||
<div class="layui-form-mid layui-word-aux">如:smtp.163.com</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">SMTP端口号</label>
|
||
<div class="layui-input-inline" style="width: 80px;">
|
||
<input type="text" name="port" lay-verify="number" value="{$mailserver.port}" class="layui-input">
|
||
</div>
|
||
<div class="layui-form-mid layui-word-aux">一般为 25 或 465</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<label class="layui-form-label">发件人邮箱</label>
|
||
<div class="layui-input-inline">
|
||
<input type="text" name="mail" value="{$mailserver.mail}" lay-verify="email" 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="nickname" value="{$mailserver.nickname}" 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="password" name="password" value="{$mailserver.password}" autocomplete="off" class="layui-input">
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<div class="layui-input-block">
|
||
<button class="layui-btn" lay-submit lay-filter="set_system_email">确认保存</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-tab-item">
|
||
<div class="layui-tab-content" style="padding: 20px 0;">
|
||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">连续签到</label>
|
||
<div class="layui-input-inline" style="width: 90px;">
|
||
<select name="days">
|
||
<option value="1">1天</option>
|
||
<option value="2">2天</option>
|
||
<option value="3">3天</option>
|
||
<option value="5">5天</option>
|
||
<option value="7">7天</option>
|
||
<option value="10">10天</option>
|
||
<option value="20">20天</option>
|
||
<option value="100">100天</option>
|
||
<option value="365">365天</option>
|
||
</select>
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<input type="tel" name="score" lay-verify="required" placeholder="获得积分" autocomplete="off" class="layui-input">
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<input type="submit" class="layui-btn" lay-submit lay-filter="sign-rule-submit" id="sign-rule-submit" value="立即提交">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<table id="sign-rule" lay-filter="sign-rule"></table>
|
||
<script type="text/html" id="sign-rule-button">
|
||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||
</script>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
<div class="layui-tab-item">
|
||
<div class="layui-tab-content" style="padding: 20px 0;">
|
||
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
||
|
||
<div class="layui-form-item">
|
||
<div class="layui-inline">
|
||
<label class="layui-form-label">用户积分</label>
|
||
<div class="layui-input-inline" style="width: 120px;">
|
||
<select name="vip">
|
||
<option value="0">普通</option>
|
||
<option value="1">VIP1</option>
|
||
<option value="2">VIP2</option>
|
||
<option value="3">VIP3</option>
|
||
<option value="4">VIP4</option>
|
||
<option value="5">VIP5</option>
|
||
|
||
</select>
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<input type="tel" name="score" lay-verify="required" placeholder="积分区间" autocomplete="off" class="layui-input">
|
||
</div>
|
||
<div class="layui-input-inline">
|
||
<input type="submit" class="layui-btn" lay-submit lay-filter="vip-rule-submit" id="vip-rule-submit" value="立即提交">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-form-item">
|
||
<table id="vip-rule" lay-filter="vip-rule"></table>
|
||
<script type="text/html" id="vip-rule-button">
|
||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
||
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
||
</script>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="layui-tab-item">内容4</div>
|
||
<div class="layui-tab-item">内容5</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
{/block}
|
||
{block name="js"}
|
||
<script>
|
||
layui.config({
|
||
base: '/static/admin/' //静态资源所在路径
|
||
}).extend({
|
||
index: 'lib/index' //主入口模块
|
||
}).use(['index', 'set','table','form'], function(){
|
||
var $ = layui.$
|
||
,admin = layui.admin
|
||
,element = layui.element
|
||
,table = layui.table
|
||
,form = layui.form
|
||
,router = layui.router();
|
||
|
||
element.render();
|
||
|
||
element.on('tab(component-tabs-brief)', function(obj){
|
||
layer.msg(obj.index + ':' + this.innerHTML);
|
||
});
|
||
|
||
/* 触发事件 */
|
||
var active = {
|
||
tabAdd: function(){
|
||
/* 新增一个Tab项 */
|
||
element.tabAdd('demo', {
|
||
title: '新选项'+ (Math.random()*1000|0) /* 用于演示 */
|
||
,content: '内容'+ (Math.random()*1000|0)
|
||
,id: new Date().getTime() /* 实际使用一般是规定好的id,这里以时间戳模拟下 */
|
||
})
|
||
}
|
||
,tabDelete: function(othis){
|
||
/* 删除指定Tab项 */
|
||
element.tabDelete('demo', '22');
|
||
othis.addClass('layui-btn-disabled');
|
||
}
|
||
,tabChange: function(){
|
||
/* 切换到指定Tab项 */
|
||
element.tabChange('demo', '33');
|
||
}
|
||
};
|
||
|
||
$('#component-tabs .site-demo-active').on('click', function(){
|
||
var othis = $(this), type = othis.data('type');
|
||
active[type] ? active[type].call(this, othis) : '';
|
||
});
|
||
|
||
/* Hash地址的定位 */
|
||
var layid = router.hash.replace(/^#layid=/, '');
|
||
layid && element.tabChange('component-tabs-hash', layid);
|
||
|
||
element.on('tab(component-tabs-hash)', function(elem){
|
||
location.hash = '/'+ layui.router().path.join('/') + '#layid=' + $(this).attr('lay-id');
|
||
});
|
||
|
||
//添加签到规则
|
||
form.on('submit(sign-rule-submit)',function(data){
|
||
var field = data.field;
|
||
$.ajax({
|
||
type:"post",
|
||
url:"{:url('admin/Sign/add')}",
|
||
data:field,
|
||
daType:"json",
|
||
success:function (data){
|
||
if (data.code == 0) {
|
||
console.log(data);
|
||
layer.msg(data.msg,{
|
||
icon:6,
|
||
time:2000
|
||
}, function(){
|
||
location.reload();
|
||
});
|
||
} else {
|
||
layer.open({
|
||
tiele:'添加失败',
|
||
content:data.msg,
|
||
icon:5,
|
||
anim:6
|
||
});
|
||
}
|
||
}
|
||
});
|
||
return false;
|
||
});
|
||
|
||
|
||
//添加VIP规则
|
||
form.on('submit(vip-rule-submit)',function(data){
|
||
var field = data.field;
|
||
$.ajax({
|
||
type:"post",
|
||
url:"{:url('admin/Vip/add')}",
|
||
data:field,
|
||
daType:"json",
|
||
success:function (data){
|
||
if (data.code == 0) {
|
||
console.log(data);
|
||
layer.msg(data.msg,{
|
||
icon:6,
|
||
time:2000
|
||
}, function(){
|
||
location.reload();
|
||
});
|
||
} else {
|
||
layer.open({
|
||
tiele:'添加失败',
|
||
content:data.msg,
|
||
icon:5,
|
||
anim:6
|
||
});
|
||
}
|
||
}
|
||
});
|
||
return false;
|
||
});
|
||
|
||
//签到规则
|
||
table.render({
|
||
elem: '#sign-rule',
|
||
url: '/admin/Sign/signRule',
|
||
limit: 5,
|
||
cols:[[
|
||
{type: 'numbers', fixed: 'left'},
|
||
{field: 'days',title: '天数'},
|
||
{field: 'score',title: '积分',minWidth:100},
|
||
{field: 'ctime',title: '时间',minWidth:100},
|
||
{title: '操作', width: 150, align:'center', fixed: 'right', toolbar: '#sign-rule-button'}
|
||
|
||
]]
|
||
});
|
||
//Vip规则
|
||
table.render({
|
||
elem: '#vip-rule',
|
||
url: '/admin/Vip/vipRule',
|
||
limit: 5,
|
||
cols:[[
|
||
{type: 'numbers', fixed: 'left'},
|
||
{field: 'score',title: '积分'},
|
||
{field: 'vip',title: '等级',minWidth:100},
|
||
{field: 'ctime',title: '时间',minWidth:100},
|
||
{title: '操作', width: 150, align:'center', fixed: 'right', toolbar: '#vip-rule-button'}
|
||
|
||
]]
|
||
});
|
||
|
||
|
||
});
|
||
</script>
|
||
{/block}
|