123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- {extend name="common/base"/}
- <!-- 主体 -->
- {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>
- <select name="pid" lay-verify="required" lay-reqText="请选择父级分类">
- <option value="0">作为顶级分类</option>
- {volist name=":set_recursion(get_goods_cate())" id="v"}
- <option value="{$v.id}" {eq name="pid" value="$v.id" }selected="" {/eq}>{$v.title}</option>
- {/volist}
- </select>
- </td>
- <td class="layui-td-gray">排序</td>
- <td>
- <input type="text" name="sort" placeholder="请输入排序,数字" value="0" autocomplete="off" class="layui-input">
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray">分类名称<font>*</font>
- </td>
- <td>
- <input type="text" name="title" lay-verify="required" autocomplete="off" placeholder="请输入分类名称" value="" class="layui-input">
- </td>
- <td class="layui-td-gray">关键词</td>
- <td>
- <input type="text" name="keywords" placeholder="请输入关键词,用“,”隔开,可空" autocomplete="off" class="layui-input" value="">
- </td>
- </tr>
- <tr>
- <td class="layui-td-gray">描述</td>
- <td colspan="3"><textarea name="desc" placeholder="请输入描述,可空" class="layui-textarea"></textarea></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>
- var moduleInit = ['tool'];
- function gouguInit() {
- var form = layui.form, tool = layui.tool;
- //监听提交
- 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/goods_cate/add", data.field, callback);
- return false;
- });
- }
- </script>
- {/block}
- <!-- /脚本 -->
|