208 lines
8.7 KiB
HTML
208 lines
8.7 KiB
HTML
{layout name="layout1" /}
|
|
|
|
<div class="wrapper">
|
|
<div class="layui-card">
|
|
<!-- 操作提示 -->
|
|
<div class="layui-card-body">
|
|
<div class="layui-collapse" style="border:1px dashed #c4c4c4">
|
|
<div class="layui-colla-item">
|
|
<h2 class="layui-colla-title like-layui-colla-title">操作提示</h2>
|
|
<div class="layui-colla-content layui-show">
|
|
<p>*百亿补贴商品列表。</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 搜索区域 -->
|
|
<div class="layui-card-body layui-form">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<label for="merconat" class="layui-form-label" style="width: 100px;">商户联系人:</label>
|
|
<div class="layui-input-inline">
|
|
<input type="text" id="merconat" name="merconat" autocomplete="off" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<a class="layui-btn layui-btn-sm layui-btn-normal" lay-submit lay-filter="search">搜索</a>
|
|
<a class="layui-btn layui-btn-sm layui-btn-primary" lay-submit lay-filter="clear-search">重置</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 主体区域 -->
|
|
<div class="layui-card-body">
|
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-sm layEvent" lay-event="add">
|
|
新增商品
|
|
</button>
|
|
|
|
<table id="like-table-lists" lay-filter="like-table-lists"></table>
|
|
<script type="text/html" id="businesslicense-operation">
|
|
{{# if(d.businessLicense){ }}
|
|
<img src="{{d.businessLicense}}" alt="营业执照" style="width: 200px;height: 200px;object-fit: contain;"
|
|
class="image-show">
|
|
{{# } }}
|
|
</script>
|
|
|
|
<script type="text/html" id="idcard-operation">
|
|
{{# if(d.idCard){ }}
|
|
<img src="{{d.idCard}}" alt="手持身份证" style="width: 200px;height: 200px;object-fit: contain;"
|
|
class="image-show">
|
|
{{# } }}
|
|
</script>
|
|
|
|
<script type="text/html" id="storeState-operation">
|
|
{{# if(d.store_state == 0){ }}
|
|
待审核
|
|
{{# } else if(d.store_state == 1) { }}
|
|
审核通过
|
|
{{# } else if(d.store_state == 2) { }}
|
|
审核失败
|
|
{{# } }}
|
|
</script>
|
|
|
|
<script type="text/html" id="localstore-operation">
|
|
<a class="layui-btn layui-btn-normal layui-btn-sm" lay-event="edit">编辑</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-sm" lay-event="del">删除</a>
|
|
</script>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
layui.use(["table", "form"], function () {
|
|
var table = layui.table;
|
|
var form = layui.form;
|
|
like.tableLists("#like-table-lists", "{:url()}", [
|
|
{field: "lstore_id", width: 60, title: "ID"}
|
|
, {
|
|
field: "businessLicense",
|
|
width: 120,
|
|
align: "center",
|
|
title: "营业执照",
|
|
toolbar: '#businesslicense-operation'
|
|
}
|
|
, {field: "crftNo1", width: 120, align: "center", title: "社会信用代码"}
|
|
, {field: "idCard", width: 120, align: "center", title: "手持身份证", toolbar: '#idcard-operation'}
|
|
, {field: "name", width: 120, align: "center", title: "商户联系人"}
|
|
, {field: "empowerPhone", width: 120, align: "center", title: "联系电话"}
|
|
, {field: "address", width: 300, align: "center", title: "地理位置"}
|
|
, {field: "store_state", width: 150, align: "center", title: "审核状态", toolbar: '#storeState-operation'}
|
|
, {fixed: 'right', title: '操作', width: 280, align: 'center', toolbar: '#localstore-operation'}
|
|
]);
|
|
|
|
//图片放大
|
|
$(document).on('click', '.image-show', function () {
|
|
var src = $(this).attr('src');
|
|
like.showImg(src, 600);
|
|
});
|
|
|
|
var active = {
|
|
add: function () {
|
|
layer.open({
|
|
type: 2
|
|
, title: "新增商品"
|
|
, content: "{:url('billions.Goods/add')}"
|
|
, area: ['90%', '90%']
|
|
, btn: ["确定", "取消"]
|
|
, yes: function (index, layero) {
|
|
var iframeWindow = window["layui-layer-iframe" + index];
|
|
var submit = layero.find("iframe").contents().find("#addSubmit");
|
|
iframeWindow.layui.form.on("submit(addSubmit)", function (data) {
|
|
like.ajax({
|
|
url: "{:url('shop.Category/add')}",
|
|
data: data.field,
|
|
type: "POST",
|
|
success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: {cur: 1}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
submit.trigger("click");
|
|
}
|
|
});
|
|
},
|
|
edit: function (obj) {
|
|
layer.open({
|
|
type: 2
|
|
, title: "编辑本地生活"
|
|
, content: "{:url('shop.LocalStore/edit')}?id=" + obj.data.lstore_id
|
|
, area: ['90%', '90%']
|
|
, btn: ["确定", "取消"]
|
|
, yes: function (index, layero) {
|
|
var iframeWindow = window["layui-layer-iframe" + index];
|
|
var submit = layero.find("iframe").contents().find("#addSubmit");
|
|
iframeWindow.layui.form.on("submit(addSubmit)", function (data) {
|
|
data.field['id'] = obj.data.id;
|
|
like.ajax({
|
|
url: "{:url('shop.Category/edit')}",
|
|
data: data.field,
|
|
type: "POST",
|
|
success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: {cur: 1}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
submit.trigger("click");
|
|
}
|
|
});
|
|
},
|
|
del: function (obj) {
|
|
layer.confirm("确定删除主营类目:" + obj.data.name, function (index) {
|
|
like.ajax({
|
|
url: "{:url('shop.Category/del')}",
|
|
data: {id: obj.data.id},
|
|
type: "POST",
|
|
success: function (res) {
|
|
if (res.code === 1) {
|
|
layui.layer.msg(res.msg);
|
|
layer.close(index);
|
|
obj.del();
|
|
}
|
|
}
|
|
});
|
|
layer.close(index);
|
|
})
|
|
}
|
|
};
|
|
like.eventClick(active);
|
|
|
|
|
|
form.on("submit(search)", function (data) {
|
|
console.log(data.field);
|
|
table.reload("like-table-lists", {
|
|
where: data.field,
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
form.on("submit(clear-search)", function () {
|
|
$("#merconat").val("");
|
|
form.render("select");
|
|
table.reload("like-table-lists", {
|
|
where: {},
|
|
page: {
|
|
curr: 1
|
|
}
|
|
});
|
|
});
|
|
|
|
})
|
|
</script> |