function iniupload() { var myDropzone = new Dropzone("#file_upload_filepath", { url: "/plugins/uploader/3fe5cc4023af44b4.php", previewsContainer: false, maxFiles: 500, init: function () { this.on("success", function (file, response) { var models = eval("(" + response + ")"); if (models['state'] == "SUCCESS") { $("#filepath").val(models['url']); $("#filepaths").val(models['original'] + " 附件已上传成功 !"); layer.closeAll('loading'); } else { layer.msg(models['state'], { icon: 1, time: 800 }, function () { layer.closeAll('loading'); }); } }) this.on("sending", function (file, response) { layer.load(2); }) } }) } $(function () { $(".nav li").hover(function () { $(this).addClass("cur") }, function () { $(this).removeClass("cur") }) txt = $(document).attr("title"); if (txt.indexOf("关于我们") >= 0) { setnav(1) } if (txt.indexOf("新闻中心") >= 0) { setnav(2) } if (txt.indexOf("主营业务") >= 0) { setnav(3) } if (txt.indexOf("人才招聘") >= 0) { setnav(4) } if (txt.indexOf("招标公告") >= 0) { setnav(5) } $(".nav li").hover(function () { $(this).find(".la").show(); }, function () { $(this).find(".la").hide(); }) $(document).on("click", ".submit", function () { $(this).addClass("disabled"); $(this).attr({ "disabled": "disabled" }); _frmid = $(this).attr("frmid"); _action = $(this).attr("action"); _btn = $(this) _click = 0 layer.confirm('确定要提交表单?', { btn: ['确定', '取消'] }, function () { _click = _click + 1; if (_click > 1) { return; } layer.load(2); $.ajax({ type: "POST", url: _action, data: $('#' + _frmid).serialize(), datatype: "html", success: function (data) { var models = eval("(" + data + ")"); layer.msg(models['msg'], { icon: 1, time: 800 }, function () { layer.closeAll('loading'); if (models['status'] == "ok") { if (models['url'] !== "") { window.location.href = models['url']; } else { location.reload(); } } else { if (models['code'] !== "") { $("#" + models['code']).focus(); } if (models['url'] !== "") { window.location.href = models['url']; } _btn.removeAttr("disabled") _btn.removeClass("disabled") } }); } }); }, function () { layer.msg("当前操作已经取消"); _btn.removeAttr("disabled") _btn.removeClass("disabled") }); return false }) $(".get").click(function () { _action = $(this).attr("action"); _click = 0 layer.confirm('确定要执行此项操作?', { btn: ['确定', '取消'] }, function () { _click = _click + 1; if (_click > 1) { return; } layer.closeAll(); layer.load(2); $.get(_action, function (data) { var models = eval("(" + data + ")"); layer.msg(models['msg'], { icon: 1, time: 1000 }, function () { location.reload(); }); }); }, function () { layer.msg("当前操作已经取消"); }); }) $('#k').bind('keyup', function (event) { if (event.keyCode == "13") { chkkey(); } }); $(".mainbusiness .item").height($(".mainbusiness .item").width() * 1.5); $(".submitget").click(function () { $(this).addClass("disabled"); $(this).attr({ "disabled": "disabled" }); layer.load(2); _id = $(this).attr("id"); _layer_title = $(this).attr("layer_title"); if (_layer_title == null) { _layer_title = "详情"; } _action = $(this).attr("action"); $.ajax({ type: "POST", url: _action, data: { id: _id }, datatype: "html", success: function (data) { layer.closeAll('loading'); setTimeout(function () { layer.open({ title: _layer_title, type: 1, skin: 'itemcontent layui-layer-rim', //加上边框 content: data, success: function (layero, index) { setTimeout(function () { iniupload(); }, 200) } }); }, 500) } }) }) }); function setnav(dom) { $(".nav li").removeClass("curr") $(".nav li").eq(dom).addClass("curr"); } function chkkey() { _k = $("#k").val(); if (_k == "") { layer.msg('请输入关键词 !') return false; } else { window.location.href = '/article/search-51.html?k=' + _k; return false } } $(document).on("click", ".codeimgjquery", function () { $(this).attr("src", "../inc/verification/verification.php?_rdn=" + new Date().getTime()) }) $(function () { if ($(window).width() < 600) { $(".content img").css({ "max-width": "100%" }) $(".content img").css({ "width": "" }) $(".content img").css({ "height": "" }) $(".content img").attr("width", "") $(".content img").attr("height", "") $(".content table").css({ "max-width": "100%" }) $(".content table").css({ "width": "" }) $(".content table").css({ "height": "" }) } })