You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
293 lines
12 KiB
293 lines
12 KiB
<?php /*a:3:{s:56:"E:\waibao\ahbcqz\server\app\shop\view\freight\index.html";i:1679478874;s:50:"E:\waibao\ahbcqz\server\app\shop\view\layout1.html";i:1679478874;s:56:"E:\waibao\ahbcqz\server\app\shop\view\freight\lists.html";i:1679478874;}*/ ?>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title><?php echo url(); ?></title>
|
|
<meta name="renderer" content="webkit">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
<link rel="stylesheet" href="/static/lib/layui/css/layui.css?v=<?php echo htmlentities($front_version); ?>">
|
|
<link rel="stylesheet" href="/static/admin/css/app.css">
|
|
<link rel="stylesheet" href="/static/admin/css/like.css">
|
|
<script src="/static/lib/layui/layui.js?v=<?php echo htmlentities($front_version); ?>"></script>
|
|
<script src="/static/admin/js/app.js"></script>
|
|
</head>
|
|
<body >
|
|
<?php echo $js_code; ?>
|
|
<script src="/static/admin/js/jquery.min.js"></script>
|
|
<script src="/static/admin/js/function.js"></script>
|
|
|
|
|
|
|
|
<div class="wrapper">
|
|
<div class="layui-card">
|
|
<div class="layui-card-body">
|
|
<div class="layui-collapse like-layui-collapse" lay-accordion="" style="border:1px dashed #c4c4c4">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title like-layui-colla-title" style="background-color: #fff">操作提示</h2>
|
|
<div class="layui-colla-content layui-show">
|
|
<p>*设置快递配送的运费模板。</p>
|
|
<p>*需要开启快递发货的配送方式,运费模板才能生效。</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-tab layui-tab-card" lay-filter="tab-all">
|
|
<ul class="layui-tab-title">
|
|
<li data-type='freight' class="layui-this">运费模板</li>
|
|
</ul>
|
|
<div class="layui-tab-content">
|
|
|
|
<!--运费模板列表-->
|
|
<div class="layui-tab-item layui-show ">
|
|
<div class="layui-fluid">
|
|
<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-block">
|
|
<input type="text" name="name" id="name" autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-inline">
|
|
<label class="layui-form-label">计费方式</label>
|
|
<div class="layui-input-block">
|
|
<select name="charge_way" id="charge_way">
|
|
<option value="">全部</option>
|
|
<?php foreach($charge_way_lists as $k => $val): ?>
|
|
<option value="<?php echo htmlentities($k); ?>"><?php echo htmlentities($val); ?></option>
|
|
<?php endforeach; ?>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="layui-inline">
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-freight <?php echo htmlentities($view_theme_color); ?>" lay-submit lay-filter="freight-search">
|
|
查询
|
|
</button>
|
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-express layui-btn-primary " lay-submit
|
|
lay-filter="freight-clear-search">重置
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div style="padding-bottom: 10px;">
|
|
<button class="layui-btn layuiadmin-btn-freight <?php echo htmlentities($view_theme_color); ?> layui-btn-sm" data-type="add">添加运费模板</button>
|
|
</div>
|
|
|
|
<table id="freight-lists" lay-filter="freight-lists"></table>
|
|
|
|
<script type="text/html" id="freight-operation">
|
|
<a class="layui-btn layui-btn-warm <?php echo htmlentities($view_theme_color); ?> layui-btn-sm" lay-event="edit-freight">编辑</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del-freight">删除</a>
|
|
</script>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
|
layui.config({
|
|
version:"<?php echo htmlentities($front_version); ?>",
|
|
base: '/static/lib/'
|
|
}).extend({
|
|
likeedit: 'likeedit/likeedit'
|
|
}).use(['table', 'form', 'element', 'likeedit'], function() {
|
|
var form = layui.form
|
|
,$ = layui.$
|
|
,table = layui.table
|
|
, element = layui.element
|
|
, likeedit = layui.likeedit;
|
|
|
|
//图片放大
|
|
$(document).on('click', '.image-show', function () {
|
|
var src = $(this).attr('src');
|
|
like.showImg(src,600);
|
|
});
|
|
|
|
|
|
getLists('freight');
|
|
|
|
//切换列表
|
|
element.on('tab(tab-all)', function (data) {
|
|
form.render('select');
|
|
var type = $(this).attr('data-type');
|
|
getLists(type);
|
|
});
|
|
|
|
|
|
form.on('submit(freight-search)', function (data) {
|
|
var field = data.field;
|
|
//执行重载
|
|
table.reload('freight-lists', {
|
|
where: field
|
|
});
|
|
});
|
|
|
|
form.on('submit(freight-clear-search)', function () {
|
|
$('#name').val('');
|
|
$('#charge_way').val('');
|
|
form.render('select');
|
|
//刷新列表
|
|
table.reload('freight-lists', {
|
|
where: []
|
|
});
|
|
});
|
|
|
|
function getLists(type) {
|
|
if (type == 'freight') {
|
|
|
|
like.tableLists('#freight-lists', '<?php echo url("freight/lists"); ?>', [
|
|
{field: 'name',width:100, title: '模板名称'}
|
|
,{field: 'charge_way_text', width:120,title: '计费方式'}
|
|
,{field: 'remark', title: '备注'}
|
|
,{field: 'create_time', title: '创建时间'}
|
|
,{fixed: 'right', title: '操作',width:160, align: 'center', fixed: 'right', toolbar: '#freight-operation'}
|
|
]);
|
|
}
|
|
}
|
|
|
|
|
|
//新增运费模板
|
|
var active = {
|
|
add: function(){
|
|
layer.open({
|
|
type: 2
|
|
,title: '添加运费模板'
|
|
,content: '<?php echo url("freight/add"); ?>'
|
|
,area: ['90%','90%']
|
|
,btn: ['确定', '取消']
|
|
,yes: function(index, layero){
|
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
|
,submitID = 'add-freight-submit'
|
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
|
//监听提交
|
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
|
var field = data.field;
|
|
like.ajax({
|
|
url:'<?php echo url("freight/add"); ?>',
|
|
data:field,
|
|
type:"post",
|
|
success:function(res)
|
|
{
|
|
if(res.code == 1)
|
|
{
|
|
layui.layer.msg(res.msg, {
|
|
offset: '15px'
|
|
, icon: 1
|
|
, time: 1000
|
|
});
|
|
layer.close(index); //关闭弹层
|
|
table.reload('freight-lists'); //数据刷新
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
submit.trigger('click');
|
|
}
|
|
});
|
|
}
|
|
};
|
|
$('.layui-btn.layuiadmin-btn-freight').on('click', function(){
|
|
var type = $(this).data('type');
|
|
active[type] ? active[type].call(this) : '';
|
|
});
|
|
|
|
//运费模板监听工具条
|
|
table.on('tool(freight-lists)', function (obj) {
|
|
var id = obj.data.id;
|
|
//详情
|
|
if(obj.event === 'detail-freight'){
|
|
layer.open({
|
|
type: 2
|
|
,title: '详情'
|
|
,content: '<?php echo url("freight/detail"); ?>?id='+id
|
|
,area: ['90%', '90%']
|
|
,yes: function(index, layero){
|
|
table.reload('freight-lists'); //再执行关闭
|
|
}
|
|
})
|
|
}
|
|
|
|
//编辑
|
|
if(obj.event === 'edit-freight'){
|
|
layer.open({
|
|
type: 2
|
|
,title: '编辑'
|
|
,btn: ['确定', '取消']
|
|
,content: '<?php echo url("freight/edit"); ?>?id='+id
|
|
,area: ['90%', '90%']
|
|
,yes: function(index, layero){
|
|
var iframeWindow = window['layui-layer-iframe'+ index]
|
|
,submitID = 'edit-freight-submit'
|
|
,submit = layero.find('iframe').contents().find('#'+ submitID);
|
|
//监听提交
|
|
iframeWindow.layui.form.on('submit('+ submitID +')', function(data){
|
|
var field = data.field;
|
|
like.ajax({
|
|
url:'<?php echo url("freight/edit"); ?>',
|
|
data:field,
|
|
type:"post",
|
|
success:function(res)
|
|
{
|
|
if(res.code == 1)
|
|
{
|
|
layui.layer.msg(res.msg, {
|
|
offset: '15px'
|
|
, icon: 1
|
|
, time: 1000
|
|
});
|
|
layer.close(index); //关闭弹层
|
|
table.reload('freight-lists'); //数据刷新
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
submit.trigger('click');
|
|
}
|
|
})
|
|
}
|
|
|
|
//删除运费模板
|
|
if(obj.event === 'del-freight'){
|
|
layer.confirm('删除后运费模板将消失,确认删除运费模板吗?', {
|
|
btn: ['确认','取消'] //按钮
|
|
}, function(){
|
|
like.ajax({
|
|
url: '<?php echo url("freight/del"); ?>'
|
|
, data: {'id': id}
|
|
, type: 'post'
|
|
, success: function (res) {
|
|
if (res.code == 1) {
|
|
layui.layer.msg(res.msg, {
|
|
offset: '15px'
|
|
, icon: 1
|
|
, time: 1000
|
|
},function () {
|
|
table.reload('freight-lists');
|
|
});
|
|
}
|
|
},
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|