2020-03-29 19:57:18 +08:00
|
|
|
{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-body">
|
2020-04-02 23:41:48 +08:00
|
|
|
|
|
|
|
<div class="layui-tab layui-tab-brief" lay-filter="server-tabs-brief">
|
2020-03-29 19:57:18 +08:00
|
|
|
<ul class="layui-tab-title">
|
2020-04-02 23:41:48 +08:00
|
|
|
<li class="layui-this" lay-id="score">积分设置</li>
|
2020-03-30 21:11:12 +08:00
|
|
|
<li lay-id="vip">用户等级</li>
|
2020-03-29 19:57:18 +08:00
|
|
|
</ul>
|
|
|
|
<div class="layui-tab-content">
|
2020-04-02 23:41:48 +08:00
|
|
|
<div class="layui-tab-item layui-show">
|
2020-03-29 19:57:18 +08:00
|
|
|
<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>
|
2020-04-02 23:41:48 +08:00
|
|
|
<div class="layui-input-inline">
|
2020-03-29 19:57:18 +08:00
|
|
|
<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">
|
2020-04-02 23:41:48 +08:00
|
|
|
{if condition="checkRuleButton('admin/Sign/add')"}
|
2020-03-29 19:57:18 +08:00
|
|
|
<input type="submit" class="layui-btn" lay-submit lay-filter="sign-rule-submit" id="sign-rule-submit" value="立即提交">
|
2020-04-02 23:41:48 +08:00
|
|
|
{else /}<input type="submit" class="layui-btn layui-btn-disabled" value="立即提交">{/if}
|
2020-03-29 19:57:18 +08:00
|
|
|
</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">
|
2020-04-02 23:41:48 +08:00
|
|
|
{if condition="checkRuleButton('admin/Sin/edit')"}
|
2021-07-22 13:04:54 +08:00
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></a>
|
|
|
|
{else /}<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-edit"></i></a>{/if}
|
2020-04-02 23:41:48 +08:00
|
|
|
{if condition="checkRuleButton('admin/Sign/delete')"}
|
2021-07-22 13:04:54 +08:00
|
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i></a>
|
|
|
|
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-delete"></i></a>{/if}
|
2020-03-29 19:57:18 +08:00
|
|
|
</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">
|
2020-03-30 21:11:12 +08:00
|
|
|
<input type="tel" name="score" lay-verify="required" placeholder="积分区间:0-99" autocomplete="off" class="layui-input">
|
2020-03-29 19:57:18 +08:00
|
|
|
</div>
|
|
|
|
<div class="layui-input-inline">
|
2020-04-02 23:41:48 +08:00
|
|
|
{if condition="checkRuleButton('admin/Vip/add')"}
|
2020-03-29 19:57:18 +08:00
|
|
|
<input type="submit" class="layui-btn" lay-submit lay-filter="vip-rule-submit" id="vip-rule-submit" value="立即提交">
|
2020-04-02 23:41:48 +08:00
|
|
|
{else /}<input type="submit" class="layui-btn layui-btn-disabled" value="立即提交">{/if}
|
2020-03-29 19:57:18 +08:00
|
|
|
</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">
|
2020-04-02 23:41:48 +08:00
|
|
|
{if condition="checkRuleButton('admin/Vip/vipEdit')"}
|
2020-03-29 19:57:18 +08:00
|
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
|
2020-04-02 23:41:48 +08:00
|
|
|
{else /}<a class="layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-edit"></i>编辑</a>{/if}
|
|
|
|
{if condition="checkRuleButton('admin/Vip/delete')"}
|
2020-03-29 19:57:18 +08:00
|
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
|
2020-04-02 23:41:48 +08:00
|
|
|
{else /}<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled"><i class="layui-icon layui-icon-delete"></i>删除</a>{/if}
|
2020-03-29 19:57:18 +08:00
|
|
|
</script>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-02 23:41:48 +08:00
|
|
|
|
2020-03-29 19:57:18 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-02 23:41:48 +08:00
|
|
|
</div>
|
2020-03-29 19:57:18 +08:00
|
|
|
|
|
|
|
{/block}
|
|
|
|
{block name="js"}
|
|
|
|
<script>
|
2020-04-28 18:44:40 +08:00
|
|
|
var signSignRule ="{:url('Sign/signRule')}";
|
|
|
|
var signDelete ="{:url('Sign/delete')}";
|
|
|
|
var signSignEdit ="{:url('Sign/signEdit')}";
|
|
|
|
var vipRule ="{:url('Vip/vipRule')}";
|
|
|
|
var vipDelete ="{:url('Vip/delete')}";
|
|
|
|
var vipEdit ="{:url('Vip/vipEdit')}";
|
2020-03-29 19:57:18 +08:00
|
|
|
layui.config({
|
|
|
|
base: '/static/admin/' //静态资源所在路径
|
|
|
|
}).extend({
|
|
|
|
index: 'lib/index' //主入口模块
|
2020-04-02 23:41:48 +08:00
|
|
|
}).use(['index', 'element','table', 'webset', 'form'], function(){
|
2020-03-29 19:57:18 +08:00
|
|
|
var $ = layui.$
|
|
|
|
,element = layui.element
|
|
|
|
,table = layui.table
|
2020-04-02 23:41:48 +08:00
|
|
|
,form = layui.form;
|
2020-03-29 19:57:18 +08:00
|
|
|
|
|
|
|
//添加签到规则
|
|
|
|
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) {
|
|
|
|
layer.msg(data.msg,{
|
|
|
|
icon:6,
|
|
|
|
time:2000
|
|
|
|
}, function(){
|
2020-03-30 21:11:12 +08:00
|
|
|
table.reload('sign-rule'); //数据刷新
|
2020-03-29 19:57:18 +08:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
layer.open({
|
2021-03-01 12:17:56 +08:00
|
|
|
title:'添加失败',
|
2020-03-29 19:57:18 +08:00
|
|
|
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) {
|
|
|
|
layer.msg(data.msg,{
|
|
|
|
icon:6,
|
|
|
|
time:2000
|
|
|
|
}, function(){
|
2020-03-30 21:11:12 +08:00
|
|
|
table.reload('vip-rule'); //数据刷新
|
2020-03-29 19:57:18 +08:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
layer.open({
|
2021-03-01 12:17:56 +08:00
|
|
|
title:'添加失败',
|
2020-03-29 19:57:18 +08:00
|
|
|
content:data.msg,
|
|
|
|
icon:5,
|
|
|
|
anim:6
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return false;
|
|
|
|
});
|
2020-04-02 23:41:48 +08:00
|
|
|
|
2020-03-29 19:57:18 +08:00
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{/block}
|