function topcc() { $(".submenu").hide(); var tt = $(window).scrollTop(); if (tt < 100) { if(window.location.href=="/investor/service.html"){ return; } $("#top").removeClass('active'); } else { $("#top").addClass('active'); } } $(function() { $(window).scroll(function(){topcc()}); $(document).on('click', '.winsubmit', function() { $(this).addClass("disabled"); $(this).attr({ "disabled": "disabled" }); _frmid = $(this).attr("frmid"); _action = $(this).attr("action"); _return = $(this).attr("return"); _btn = $(this) _click = 0 var index1 = layer.confirm('你确定要执行此操作吗?', { btn: ['确定', '取消'] }, function() { _click = _click + 1; if (_click > 1) { return; } layer.close(index1) var index2 = layer.load(2); $.ajax({ type: "POST", url: _action, data: $('#' + _frmid).serialize(), datatype: "html", success: function(data) { var models = eval("(" + data + ")"); iconnum = 1; if (models['status'] !== "ok") { iconnum = 2; } layer.msg(models['msg'], { icon: iconnum, time: 800 }, function() { layer.close(index2); if (models['callback'] !== "") { eval(models['callback']); return; } if (models['status'] == "ok") { if (_return !== "" && _return !== undefined) { window.location.href = _return; return; } else 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 }) $(document).on('click', '.submit', function() { $(this).addClass("disabled"); $(this).attr({ "disabled": "disabled" }); _frmid = $(this).attr("frmid"); _action = $(this).attr("action"); _return = $(this).attr("return"); _btn = $(this) _click = 0 layer.confirm('你确定要执行此操作吗?', { btn: ['确定', '取消'] }, function() { _click = _click + 1; if (_click > 1) { return; } layer.closeAll(); layer.load(2); $.ajax({ type: "POST", url: _action, data: $('#' + _frmid).serialize(), datatype: "html", success: function(data) { var models = eval("(" + data + ")"); iconnum = 1; if (models['status'] !== "ok") { iconnum = 2; } layer.msg(models['msg'], { icon: iconnum, time: 800 }, function() { layer.closeAll(); if (models['callback'] !== "") { eval(models['callback']); return; } if (models['status'] == "ok") { if (_return !== "" && _return !== undefined) { window.location.href = _return; return; } else 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 }) $(document).on('click', '.get', function() { _action = $(this).attr("action"); _return = $(this).attr("return"); _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 + ")"); iconnum = 1; if (models['status'] !== "ok") { iconnum = 2; } layer.msg(models['msg'], { icon: iconnum, time:1000 }, function(){ if (models['callback'] !== "") { eval(models['callback']); } if (_return !== "" && _return !== undefined) { window.location.href = _return; } else if (models['url'] !== "") { window.location.href = models['url']; } else { location.reload(); } }); }); }, function() { layer.msg("当前操作已经取消"); }); }) }); function setnav(dom) { $(".nav li").removeClass("curr") $(".nav li").eq(dom).addClass("curr"); }