form.on(‘submit(formAddCooperation)’, function (data) {
                cooperation += 1;
                let html = `<div class=”layui-card” style=”padding-top:1rem;”>
                            <fieldset class=”layui-elem-field layui-field-title”>
                                <legend>合作集团[`+cooperation+`]</legend>
                            </fieldset>
                            <div class=”layui-card-body”>
                                <div class=”layui-form-item”>
                                    <label class=”layui-form-label”><span style=”color: red;”>*</span>标题</label>
                                    <div class=”layui-input-block”>
                                        <input type=”text” name=”cooperation[`+cooperation+`][‘title’]” placeholder=”请输入”
                                            autocomplete=”off” class=”layui-input”>
                                    </div>
                                </div>

                                <div class=”layui-form-item”>
                                    <label class=”layui-form-label”><span style=”color: red;”>*</span>概要</label>
                                    <div class=”layui-input-block”>
                                        <input type=”text” name=”cooperation[`+cooperation+`][‘subtitle’]” placeholder=”请输入”
                                            autocomplete=”off” class=”layui-input”>
                                    </div>
                                </div>

                                <div class=”layui-form-item”>
                                    <label class=”layui-form-label”><span style=”color: red;”>*</span>跳转</label>
                                    <div class=”layui-input-block”>
                                        <input type=”text” name=”cooperation[`+cooperation+`][‘href’]” placeholder=”请输入”
                                            autocomplete=”off” class=”layui-input”>
                                    </div>
                                </div>

                                <div class=”layui-form-item”>
                                    <label class=”layui-form-label”><span style=”color: red;”>*</span>图片</label>
                                    <div class=”layui-input-block”>
                                        <div id=”upfilecooperation`+cooperation+`”>
                                            <div id=”buttoncooperation`+cooperation+`”>
                                                <i class=”layui-icon”>&#xe67c;</i>上传图片
                                            </div>
                                            <div id=”imgboxcooperation`+cooperation+`” style=”text-align:left;display: none;”>
                                                <img style=”width: 300px;height: 300px;” id=”imgcooperation`+cooperation+`” />
                                                <input autocomplete=”off” type=”hidden” name=”cooperation[`+cooperation+`][‘img’]”
                                                    id=”imginputcooperation`+cooperation+`” />
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>`;
                let strEvalProduct = `$(‘#cooperation’).append(html);
                    upload.render({
                        elem: ‘#upfilecooperation`+cooperation+`’
                        , url: ‘{:url(“imgUploadCon”)}’
                        , done: function (res) {
                            //上传完毕回调
                            $(‘#imgcooperation`+cooperation+`’).attr(‘src’, res.msg);
                            $(‘#imginputcooperation`+cooperation+`’).val(res.msg);
                            $(‘#buttoncooperation`+cooperation+`’).hide();
                            $(‘#imgboxcooperation`+cooperation+`’).show();
                        }
                        , error: function () {
                            //请求异常回调
                            layer.msg(‘上传失败!’, { icon: 2 })
                        }
                    });`;
                eval(strEvalProduct);
                return false;
            });
            //删除
            $(“#product”).on(“click”,’.del’,function(e){
                $(e.currentTarget).parent().remove()
            })
说点什么
支持Markdown语法
好耶,沙发还空着ヾ(≧▽≦*)o
Loading...