No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ajax_content_total.htm 5.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  8. <!-- Apple devices fullscreen -->
  9. <meta name="apple-mobile-web-app-capable" content="yes">
  10. <!-- Apple devices fullscreen -->
  11. <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  12. <link href="__SKIN__/css/main.css?v={$version}" rel="stylesheet" type="text/css">
  13. <link href="__SKIN__/font/css/font-awesome.min.css" rel="stylesheet" />
  14. <link href="__SKIN__/css/index.css?v={$version}" rel="stylesheet" type="text/css">
  15. <!--[if IE 7]>
  16. <link rel="stylesheet" href="__SKIN__/font/css/font-awesome-ie7.min.css">
  17. <![endif]-->
  18. <link href="__SKIN__/css/diy_style.css?v={$version}" rel="stylesheet" type="text/css" />
  19. {include file="public/theme_css" /}
  20. <script type="text/javascript">
  21. var eyou_basefile = "{$Request.baseFile}";
  22. var module_name = "{$Think.const.MODULE_NAME}";
  23. var __root_dir__ = "__ROOT_DIR__";
  24. var __lang__ = "{$admin_lang}";
  25. var __main_lang__ = "{$main_lang}";
  26. </script>
  27. {load href="__STATIC__/common/js/jquery.min.js" /}
  28. <script type="text/javascript" src="__SKIN__/js/jquery-ui/jquery-ui.min.js"></script>
  29. <script type="text/javascript" src="__PUBLIC__/plugins/layer-v3.1.0/layer.js"></script>
  30. <script src="__SKIN__/js/global.js?v={$version}"></script>
  31. </head>
  32. <body style="background-color:#F4F4F4;padding:6px; overflow: auto;min-width:auto;">
  33. <form id="post_form">
  34. <div class="navboxs sort-list">
  35. {volist name='$totalList' id='vo'}
  36. <div>
  37. <label style="cursor: pointer;">
  38. <span><input type="checkbox" name="checkedids[]" value="{$vo.id}" {if condition="$vo.checked"}checked{/if} /></span>{$vo.title}
  39. <input type="hidden" name="ids[]" value="{$vo.id}" />
  40. </label>
  41. </div>
  42. {/volist}
  43. </div>
  44. <div class="navboxs_bt" onclick="check_confirm();">确认提交</div>
  45. </form>
  46. <script type="text/javascript">
  47. $(function () {
  48. $('input[name*=checkedids]').click(function(){
  49. if ($(this).is(':checked') && 9 < $('input[name*=checkedids]:checked').length) {
  50. $(this).attr('checked', false);
  51. showErrorMsg('最多只勾选9个!');
  52. }
  53. });
  54. /** 拖动排序相关 js*/
  55. $( ".sort-list" ).sortable({
  56. start: function( event, ui) {
  57. }
  58. ,stop: function( event, ui ) {
  59. }
  60. });
  61. $( ".sort-list" ).disableSelection();
  62. });
  63. var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  64. // 表单提交
  65. function check_confirm(){
  66. if (9 < $('input[name*=checkedids]:checked').length) {
  67. showErrorMsg('最多只勾选9个!');
  68. return false;
  69. }
  70. if (0 < $('input[name*=checkedids]:checked').length) {
  71. submit_form();
  72. } else {
  73. layer.confirm('没有勾选项,内容统计模块将被隐藏,不再显示。', {
  74. shade: layer_shade,
  75. area: ['380px', '180px'],
  76. move: false,
  77. title: '提示',
  78. btnAlign:'r',
  79. closeBtn: 3,
  80. btn: ['确定', '取消'] ,//按钮
  81. success: function () {
  82. $(".layui-layer-content").css('text-align', 'left');
  83. }
  84. }, function(){
  85. submit_form();
  86. }, function(index){
  87. layer.close(index);
  88. }
  89. );
  90. }
  91. return false;
  92. }
  93. function submit_form()
  94. {
  95. layer_loading('正在处理');
  96. $.ajax({
  97. url: "{:url('Index/ajax_content_total', ['_ajax'=>1])}",
  98. type: 'POST',
  99. dataType: 'JSON',
  100. data: $('#post_form').serialize(),
  101. success: function(res){
  102. layer.closeAll();
  103. if (res.code == 1) {
  104. var _parent = parent;
  105. _parent.layer.close(parentObj);
  106. _parent.layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
  107. _parent.gourl(res.url);
  108. });
  109. } else {
  110. showErrorMsg(res.msg);
  111. }
  112. },
  113. error: function(e){
  114. layer.closeAll();
  115. layer.alert(e.responseText, {icon:5, time:1500});
  116. }
  117. });
  118. }
  119. </script>
  120. {include file="public/footer" /}