$(function () { /************删除某一条记录*********************************/ $('.page-content').on('click', '.product-list .row-del', function (e) { e.preventdefault(); var delurl = $(this).attr('del-url'); var gourl = $(this).attr('go-url'); layer.confirm(lang.delete_confirm, { btn: [lang.layui_confirm_btn_yes, lang.layui_confirm_btn_no], title: lang.layui_confirm_title }, function (index) { $.ajax({ url: delurl, type: 'post', datatype: 'text', success: function (result) { if (result == 'ok') { layer.msg(lang.delete_success, { time: 1000 }, function (index) { layer.close(index); layout.loadpage(gourl); }); } else { var _msg = result ? lang.delete_failed + ':' + result : lang.delete_failed; layer.msg(_msg); layer.close(index); } }, error: function (xhr) { layer.close(index); layer.alert(xhr.responsetext, { btn: [lang.layui_alert_btn], title: lang.layui_alert_title }, function (index) { layer.close(index); }); } }); }); }); /************删除多条记录*********************************/ $('.page-content').on('click', '.product-list .multi-row-del', function () { var ids = getcheckedids(); if (ids.length > 0) { var delurl = $(this).attr('del-url'); var gourl = $(this).attr('go-url'); layer.confirm(lang.delete_confirm, { btn: [lang.layui_confirm_btn_yes, lang.layui_confirm_btn_no], title: lang.layui_confirm_title }, function (index) { $.ajax({ url: delurl, type: 'post', data: ids, datatype: 'text', success: function (result) { if (result == 'ok') { layer.msg(lang.delete_success, { time: 1000 }, function (index) { layer.close(index); layout.loadpage(gourl); }); } else { layer.msg(lang.delete_failed); layer.close(index); } }, error: function (xhr) { layer.close(index); layer.alert(xhr.responsetext, { btn: [lang.layui_alert_btn], title: lang.layui_alert_title }, function (index) { layer.close(index); }); } }); }); } }); /************帮助中心*********************************/ $('.js-layout-help').on('click', function () { $(this).toggleclass('current'); var $dl = $(this).find('dl'); if ($dl.html()) return; var _help = $(this).attr('data-help'); $.ajax({ url: '/admin/console/help/' + $(this).attr('data-id'), type: 'get', datatype: "json", success: function (json) { var _html = ''; for (var i in json) { var _help_tag = _help; if (json[i].id == 93) _help_tag = 'help_detail'; _html += '