123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- {extend name="public/layout"/} {block name="title"}新建标签{/block} {block name="body"}
- <style>
- html,
- body {
- height: 80%;
- min-width: 500px;
- background-color: #fff;
- }
- .body {
- height: 100%;
- overflow-y: auto;
- background: #fff;
- }
- .huise333 {
- color: #333;
- }
- .layui-form-select {
- width: 50%;
- float: left;
- }
- .layui-form-label {
- width: 25%;
- }
- .layui-input-block {
- width: 70%;
- }
- .mjtext {
- width: 50%;
- height: 38px;
- }
- .pingfang {
- right: 11%;
- top: 32%;
- font-size: 14px;
- color: #999;
- }
- .text-detail {
- width: 100%;
- height: 100%;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- .mdl20 {
- margin-left: 0px;
- }
- .width56_ {
- width: 59%;
- }
- .layui-form-checkbox i {
- height: 30px;
- }
- .bodys {
- padding: 20px 0px 0px;
- }
- </style>
- <body>
- <div class="bodys">
- <form class="layui-form layui-form-box">
- <div class="layui-form-item mdt30 wpsr">
- <label class="layui-form-label"><i style="color:red;">*</i> 一级分类名称:</label>
- <div class="layui-input-block">
- <input type="text" id="title" name="title" required lay-verify="required" placeholder="请输入分类名称"
- autocomplete="off" class="layui-input mjtext">
- </div>
- </div>
- <div class="layui-form-item">
- <label class="layui-form-label">类型</label>
- <div class="layui-input-block">
- <input type="radio" name="is_case" lay-filter="type" value=0 title="图文" checked>
- <input type="radio" name="is_case" lay-filter="type" value=1 title="案例">
- </div>
- </div>
- <div class="width56_" style="display: none;">
- <button type="button" lay-submit class="layui-btn layui-btn-normal pdlr30"
- lay-filter="spellgroup-submit" id="spellgroup-submit">保存</button>
- </div>
- </form>
- </div>
- </body>
- {/block} {block name="js"}
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'upload'], function () {
- var $ = layui.$,
- layer = layui.layer,
- upload = layui.upload,
- form = layui.form;
- form.render();
- //添加保存
- form.on('submit(spellgroup-submit)', function (data) {
- var formData = new FormData(data.form);
- $.ajax({
- url: '{:url("smartScreen/saveCate")}?type='+'{$type}',
- type: 'post',
- data: formData,
- dataType: 'json',
- processData: false,
- contentType: false,
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, {
- anim: 0, time: 1000, icon: 6,
- }, function () {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index); //再执行关闭
- });
- } else {
- layer.msg(res.msg, { anim: 0, time: 1000, icon: 5 });
- }
- }
- });
- return false;
- });
- $('.cancel').click(function () {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- })
- form.on('radio(type)', function (data) {
- if (data.value == 1) {
- $('.vrStyle').removeClass('layui-hide');
- $('.articleStyle').addClass('layui-hide');
- } else {
- $('.vrStyle').addClass('layui-hide');
- $('.articleStyle').removeClass('layui-hide');
- }
- })
- })
- </script>
- {/block}
|