main
kgdxpr 7 months ago
parent 458c9fec6e
commit 29da002650

@ -166,7 +166,7 @@
layer.open({
type: 2,
title: '设置',
area: ['560px', '260px'],
area: ['560px', '300px'],
shade: 0.1,
content: './set.html?id=' + obj.data.id
});

@ -5,20 +5,7 @@
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="../layui/css/layui.css" />
<style>
.weadmin-nav {
padding: 0 20px;
position: relative;
z-index: 99;
border-bottom: 1px solid #e5e5e5;
line-height: 39px;
height: 39px;
overflow: hidden;
}
.weadmin-body {
padding: 15px 20px;
}
<style>
.require-star {
position: absolute;
@ -31,7 +18,7 @@
}
.input-width {
width: 350px
width: 340px
}
.label-width {
@ -87,6 +74,13 @@
lay-verify="required|number|int" placeholder="请输入免费时长" class="layui-input input-width">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label label-width"><span class="require-star"></span>占位费上限金额(元)</label>
<div class="layui-form-item layui-inline">
<input type="text" id="money_limit" name="money_limit" autocomplete="off"
lay-verify="required|number" placeholder="请输入占位费上限金额" class="layui-input input-width">
</div>
</div>
</div>
@ -126,7 +120,6 @@
$("#one_hour_money").val(res.one_hour_money);
$("#free_duration").val(res.free_duration);
}
}
});
@ -168,12 +161,6 @@
}
});
</script>
</body>

@ -0,0 +1,171 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../layui/css/layui.css" />
<style>
.woo-tool-text-delimiter {
width: 1px;
height: 12px;
background: #EEEEEE;
display: inline-block;
margin: 0 6px 0 4px;
}
.woo-theme-color {
color: #1e9fff !important;
}
.woo-tool-span {
margin: 0 3px;
position: relative;
top: -1px;
cursor: pointer;
}
.layui-card-body .layui-form {
margin-top: 0 !important;
}
.layui-form-select {
width: 300px;
}
.layui-form-item .layui-input-inline {
float: left;
width: 300px;
margin-right: 10px;
}
</style>
</head>
<body class="layui-form">
<div class="layui-card-body">
<table id="data-table"></table>
<script type="text/html" id="stationCount">
{{# if(d.station_count > 0){ }}
<span style="color: #16b777;font-weight: bold;">{{= d.station_count }}</span>
{{# } else { }}
<span>{{= d.station_count }}</span>
{{# } }}
</script>
<script type="text/html" id="table-bar">
<span class="woo-tool-span woo-tool-text-span" lay-event="set"><a
class="woo-theme-color">设置</a></span>
<i class="woo-tool-text-delimiter"></i>
{{# if(d.station_count > 0){ }}
<span class="woo-tool-span woo-tool-text-span" lay-event="cancal"><a
class="woo-theme-color">取消</a></span>
{{# } else { }}
<span class="woo-tool-span woo-tool-text-span">
<a style="color: #d2d2d2;cursor: default;" >取消</a></span>
{{# } }}
</script>
</div>
<script src="../layui/layui.js"></script>
<script src="../../../lib/base64.js"></script>
<script>
layui.use(function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
tableRender();
function tableRender() {
table.render({
elem: '#data-table',
url: '/ZhuQue/label/pageLabel',
request: {
pageName: 'pageNum', // 页码的参数名称默认page
limitName: 'pageSize' // 每页数据条数的参数名默认limit
},
height: 'full-20',
page: {
limit: 20
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '标签名称', field: 'label_name', align: 'center' },
{ title: '已配置', templet: '#stationCount', align: 'center' },
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "12%" }
]],
skin: 'line',
defaultToolbar: []
});
}
form.on('submit(user-query)', function () {
tableRender();
// 阻止表单的默认提交行为
return false;
});
table.on('tool(data-table)', function (obj) {
if (obj.event === 'set') {
layer.open({
type: 2,
title: '设置',
area: ['720px', '500px'],
shade: 0.1,
content: './set.html?label_id=' + obj.data.label_id
});
} else {
layer.confirm('确定要取消吗?', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
$.ajax({
url: '/ZhuQue/label/saveStationListByLabelId',
data: {
"label_id": obj.data.label_id,
"station_ids": ""
},
type: 'post',
success: function (result) {
if (result.success) {
layer.msg("取消成功!", {
icon: 1,
time: 1300
}, function () {
tableRender();
});
} else {
layer.msg(result.message, {
icon: 2,
time: 2000
});
}
}
});
});
}
});
});
</script>
</body>
</html>

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="../layui/css/layui.css" />
<style>
.require-star {
position: absolute;
width: 3px;
height: 14px;
background-color: #ea4335;
top: 12px;
right: 8px;
border-radius: 1.5px;
}
.input-width {
width: 340px
}
.label-width {
width: 128px
}
.mainBox {
width: 100%;
position: absolute;
top: 0px;
left: 0px;
bottom: 50px;
overflow: auto;
}
.main-container {
margin: 15px;
}
.button-container {
position: absolute;
right: 15px;
}
.bottom {
width: 100%;
position: absolute;
bottom: 0px;
left: 0px;
height: 50px;
line-height: 50px;
background-color: #F8F8F8;
border-top: 1px solid #eee;
}
</style>
</head>
<body>
<form class="layui-form" action="">
<div class="main-container">
<div id="ID-transfer-demo-showSearch"></div>
</div>
<div class="bottom">
<div class="button-container">
<button type="button" class="layui-btn layui-btn-sm" lay-submit="" lay-filter="save">
<i class="layui-icon layui-icon-ok"></i>
提 交
</button>
</div>
</div>
</form>
<script src="../layui/layui.js"></script>
<script>
layui.use(function () {
var form = layui.form;
var $ = layui.jquery;
var laytpl = layui.laytpl;
var labelId = GetQueryString("label_id");
var selectedStation = [];
var transfer = layui.transfer;
$.ajax({
type: "GET",
async: false,
url: "/ZhuQue/label/getStationListByLabelId?label_id=" + labelId,
success: function (res) {
if (res.count > 0) {
selectedStation = res.data.map(item => item.station_id);
}
}
});
$.ajax({
type: "GET",
async: false,
url: "/ZhuQue/label/getStationList",
success: function (res) {
transfer.render({
elem: '#ID-transfer-demo-showSearch',
id: 'station',
data: res.data,
value: selectedStation,
width: 300,
title: ['未设置', '已设置'],
showSearch: true,
parseData: function (res) { // 解析成规定的 data 格式
return {
"value": res.statinon_id,
"title": res.station_name
};
}
});
}
});
form.on('submit(save)', function (data) {
var getData = transfer.getData('station');
var resIds = getData.map(item => item.value).join(',');
$.ajax({
type: "POST",
async: false,
url: "/ZhuQue/label/saveStationListByLabelId",
data: {
"label_id": labelId,
"station_ids": resIds
},
success: function (res) {
if (res.success) {
layer.msg("设置成功!", {
icon: 1,
time: 1300
}, function () {
parent.layer.close(parent.layer.getFrameIndex(window.name));
parent.layui.table.reload("data-table");
});
} else {
layer.msg(res.message, {
icon: 2,
time: 2000
});
}
}
});
return false;
});
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>
Loading…
Cancel
Save