178 lines
5.3 KiB
HTML
178 lines
5.3 KiB
HTML
{extend name="common/base"/}
|
|
{block name="style"}
|
|
<style type="text/css">
|
|
.editormd-code-toolbar select {
|
|
display: inline-block
|
|
}
|
|
|
|
.editormd li {
|
|
list-style: inherit;
|
|
}
|
|
|
|
.layui-td-gray {
|
|
width: 110px;
|
|
}
|
|
|
|
.addrhelper-ok-btn {
|
|
display: none;
|
|
}
|
|
</style>
|
|
{/block}
|
|
<!-- 主体 -->
|
|
{block name="body"}
|
|
<form class="layui-form p-4">
|
|
<h3 class="pb-3">添加</h3>
|
|
<table class="layui-table layui-table-form">
|
|
|
|
|
|
<tr>
|
|
<td class="layui-td-gray">参数模板名称<font>*</font></td>
|
|
<td colspan="4">
|
|
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入品牌名称"
|
|
autocomplete="off" placeholder="请输入品牌名称" class="layui-input">
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
|
|
<td class="layui-td-gray">排序</td>
|
|
<td>
|
|
<input type="text" name="sort" value="0" placeholder="请输入数字,越小越靠前" autocomplete="off"
|
|
class="layui-input">
|
|
</td>
|
|
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>
|
|
<table class="layui-table layui-table-form">
|
|
|
|
<tr>
|
|
<th>参数名称</th>
|
|
<th>参数值</th>
|
|
<th>排序</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
<tr>
|
|
<td >
|
|
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入参数名称"
|
|
autocomplete="off" placeholder="请输入参数名称" class="layui-input">
|
|
</td>
|
|
<td >
|
|
<input type="text" name="brand_name" lay-verify="required" lay-reqText="请输入参数值"
|
|
autocomplete="off" placeholder="请输入参数值" class="layui-input">
|
|
</td>
|
|
<td>
|
|
<input type="number" name="sort" lay-verify="required"
|
|
autocomplete="off" class="layui-input">
|
|
</td>
|
|
<td>
|
|
删除
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="4">
|
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="add_paramter">添加参数</button>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
|
|
</tr>
|
|
</table>
|
|
<div class="pt-3">
|
|
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
|
|
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
|
</div>
|
|
|
|
</form>
|
|
{/block}
|
|
<!-- /主体 -->
|
|
|
|
<!-- 脚本 -->
|
|
{block name="script"}
|
|
<script src="/static/assets/js/jquery.min.js"></script>
|
|
<script src="/static/assets/js/addrHelper.js"></script>
|
|
<script src="/static/assets/js/xm-select.js"></script>
|
|
|
|
<script>
|
|
const editorType = '{$editor}';
|
|
var moduleInit = ['tool', 'tagpicker', 'tinymce'];
|
|
|
|
function gouguInit() {
|
|
var form = layui.form, tool = layui.tool, laydate = layui.laydate;
|
|
var editor = layui.tinymce;
|
|
var edit = editor.render({
|
|
selector: "#container_content",
|
|
height: 500
|
|
});
|
|
|
|
//上传缩略图
|
|
var upload_thumb = layui.upload.render({
|
|
elem: '#upload_btn_thumb',
|
|
url: '/admin/api/upload',
|
|
done: function (res) {
|
|
//如果上传失败
|
|
if (res.code == 1) {
|
|
return layer.msg('上传失败');
|
|
}
|
|
//上传成功
|
|
$('#upload_box_thumb input').attr('value', res.data.filepath);
|
|
$('#upload_box_thumb img').attr('src', res.data.filepath);
|
|
}
|
|
});
|
|
|
|
|
|
//监听提交
|
|
form.on('submit(webform)', function (data) {
|
|
let callback = function (e) {
|
|
layer.msg(e.msg);
|
|
if (e.code == 0) {
|
|
setTimeout(function () {
|
|
parent.location.reload();
|
|
}, 1000);
|
|
}
|
|
}
|
|
tool.post('/admin/product.band/add', data.field, callback);
|
|
return false;
|
|
});
|
|
|
|
|
|
form.on('select(storeBrandCategory)', function (data) {
|
|
street(data.value);
|
|
});
|
|
|
|
var group_access = "{:session('gougu_admin')['group_access']}";
|
|
|
|
function street (id) {
|
|
if(id == null || id == '')
|
|
{
|
|
return false;
|
|
}
|
|
|
|
var demo1 = xmSelect.render({
|
|
name: 'brand_category_id',
|
|
el: '#demo1',
|
|
prop: {
|
|
name: 'cate_name',
|
|
value: 'store_brand_category_id',
|
|
},
|
|
data: [],
|
|
radio: true,
|
|
initValue: [],
|
|
disabled: group_access == 2 || group_access==4 ? true : false,
|
|
|
|
});
|
|
|
|
$.get('/admin/product.brandClassify/street?pcode=' + id, function (result) {
|
|
|
|
demo1.update({
|
|
data: result
|
|
});
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
</script>
|
|
{/block}
|
|
<!-- /脚本 --> |