TaoLer/app/admin/view/user/vip/edit.html

115 lines
4.7 KiB
HTML
Raw Normal View History

2023-03-16 22:40:15 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>修改页面</title>
<link rel="stylesheet" href="/static/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
<div class="mainBox">
<div class="main-container">
<div class="layui-form-item layui-hide">
<input type="text" name="id" class="layui-input" value="{$vip.id}">
</div>
<div class="layui-form-item">
2024-04-01 10:17:53 +08:00
<label class="layui-form-label">会员等级</label>
2023-03-16 22:40:15 +08:00
<div class="layui-input-inline" >
<select name="vip">
{volist name="level" id="vo"}
2024-04-01 10:17:53 +08:00
<option {if condition="$vip.vip eq $vo"} selected {/if} value="{$vo}">{if condition="$vo eq 0"}普通{else /}L{$vo}{/if}</option>
2023-03-16 22:40:15 +08:00
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">积分区间</label>
<div class="layui-input-inline">
<input type="text" name="score" lay-verify="required" placeholder="积分区间:0-99" autocomplete="off" class="layui-input" value="{$vip.score}">
</div>
</div>
<div class="layui-form-item">
2024-04-01 10:17:53 +08:00
<label class="layui-form-label">认证昵称</label>
2023-03-16 22:40:15 +08:00
<div class="layui-input-inline">
<input type="text" name="nick" lay-verify="required" placeholder="等级昵称" autocomplete="off" class="layui-input" value="{$vip.nick}">
</div>
</div>
<div class="layui-form-item">
2024-04-01 10:17:53 +08:00
<label class="layui-form-label">免费发帖/日</label>
2023-03-16 22:40:15 +08:00
<div class="layui-input-inline">
2024-04-01 10:17:53 +08:00
<input type="text" name="postnum" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.postnum}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">免费刷新/日</label>
<div class="layui-input-inline">
<input type="text" name="refreshnum" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.refreshnum}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">发贴扣积分</label>
<div class="layui-input-inline">
<input type="text" name="postpoint" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.postpoint}">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">刷贴扣积分</label>
<div class="layui-input-inline">
<input type="text" name="refreshpoint" lay-verify="number" placeholder="10" autocomplete="off" class="layui-input" value="{$vip.refreshpoint}">
2023-03-16 22:40:15 +08:00
</div>
</div>
</div>
</div>
<div class="bottom">
<div class="button-container">
<button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit=""
lay-filter="user-save">
<i class="layui-icon layui-icon-ok"></i>
提交
</button>
<button type="reset" class="pear-btn pear-btn-sm">
<i class="layui-icon layui-icon-refresh"></i>
重置
</button>
</div>
</div>
</form>
<script src="/static/component/layui/layui.js"></script>
<script src="/static/component/pear/pear.js"></script>
<script>
layui.use(['form', 'jquery'], function() {
let form = layui.form;
let $ = layui.jquery;
form.on('submit(user-save)', function(data) {
$.ajax({
url: "{:url('user.vip/edit')}",
data: JSON.stringify(data.field),
dataType: 'json',
contentType: 'application/json',
type: 'post',
success: function(result) {
if (result.code === 0) {
layer.msg(result.msg, {
icon: 1,
time: 1000
}, function() {
2024-04-01 10:17:53 +08:00
parent.layer.close(parent.layer.getFrameIndex(window.name)); //关闭当前页
parent.layui.table.reload("vip-rule");
2023-03-16 22:40:15 +08:00
});
} else {
layer.msg(result.msg, {
icon: 2,
time: 1000
});
}
}
})
return false;
});
})
</script>
</body>
</html>