index.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <extend name="Public:base" />
  2. <block name="content">
  3. <div class="page-header">
  4. <a href="{:U('SuperSpike/add')}" class="btn btn-primary">添加超值大牌活动</a>
  5. </div>
  6. <div class="row">
  7. <div class="col-xs-12">
  8. <div class="table-responsive">
  9. <table class="table table-striped table-bordered table-hover">
  10. <thead>
  11. <tr>
  12. <th>ID</th>
  13. <th>活动名称</th>
  14. <th>线上活动商品数量</th>
  15. <th>待审核商品数量</th>
  16. <th>活动开始时间</th>
  17. <th>活动结束时间</th>
  18. <th>活动添加时间</th>
  19. <th>操作</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <volist name="list" id="data" empty="$empty">
  24. <tr>
  25. <td>{$data.id}</td>
  26. <td>{$data.name}</td>
  27. <td>
  28. <?php
  29. if($data['on_goods'] > 0)
  30. {
  31. ?>
  32. <b class="red">{$data.on_goods}</b>
  33. <?php }else{ ?>
  34. {$data.on_goods}
  35. <?php } ?>
  36. </td>
  37. <td>
  38. <?php
  39. if($data['wait_goods'] > 0)
  40. {
  41. ?>
  42. <b class="red">{$data.wait_goods}</b>
  43. <?php }else{ ?>
  44. {$data.wait_goods}
  45. <?php } ?>
  46. </td>
  47. <td>
  48. <?php echo date('Y-m-d H:i:s',$data['begin_time']); ?>
  49. </td>
  50. <td>
  51. <?php echo date('Y-m-d H:i:s',$data['end_time']); ?>
  52. </td>
  53. <td>
  54. <?php echo date('Y-m-d H:i:s',$data['add_time']); ?>
  55. </td>
  56. <td>
  57. <a class="btn btn-xs btn-info" href='{:U("SuperSpike/edit",array("id"=>$data["id"]))}'>
  58. <i class="icon-check bigger-120"></i>
  59. </a>
  60. <a class="btn btn-xs btn-info" href='{:U("SuperSpike/activity_goods",array("id"=>$data["id"]))}'>
  61. <i class="icon-check bigger-120"></i>
  62. 查看活动商品
  63. </a>
  64. <a class="btn btn-xs btn-info" href='{:U("SuperSpike/take_superspike",array("id"=>$data["id"]))}'>
  65. <i class="icon-check bigger-120"></i>
  66. 添加活动商品
  67. </a>
  68. </td>
  69. </tr>
  70. </volist>
  71. <tr>
  72. <td colspan="20" class="page">{$page}</td>
  73. </tr>
  74. </tbody>
  75. </table>
  76. </div>
  77. </div>
  78. </div>
  79. <link rel="stylesheet" href="__CSS__/dialog.css" />
  80. <div class="ks-ext-mask" style="position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 999; display:none"></div>
  81. <div id="dialog" class="dialog" style="z-index: 9999; display:none">
  82. <div class="ks-contentbox">
  83. <div class="title">
  84. <span>秒杀产品上线时间设置</span><a class="ks-ext-close" href="javascript:void(0)">X</a></div>
  85. <dl>
  86. <dt>开始时间</dt>
  87. <dd><input name="begin_time" id="begin_time" type="text" value="<?php echo date('Y-m-d H:i:s',time()); ?>" size="50" /></dd>
  88. <dt>结束时间</dt>
  89. <dd><input name="end_time" id="end_time" type="text" value="<?php echo date('Y-m-d H:i:s',time()+86400); ?>" size="50" /></dd>
  90. </dl>
  91. <div class="J_DefaultMessage"></div>
  92. <div class="bottom">
  93. <input type="hidden" id="sub_url" value="" />
  94. <a href="javascript:void(0);" class="J_SubmitPL ncsc-btn ncsc-btn-green">确认</a>
  95. </div>
  96. </div>
  97. </div>
  98. </block>
  99. <block name="javascript">
  100. <script src="__PUBLIC__/js/moment/moment.js"></script>
  101. <script src="__PUBLIC__/js/moment/locale/zh-cn.js"></script>
  102. <script src="__PUBLIC__/js/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js"></script>
  103. <link rel="stylesheet" href="__PUBLIC__/js/bootstrap-timepicker/css/bootstrap-timepicker.css" />
  104. <script>
  105. $(function(){
  106. $('#begin_time').datetimepicker({
  107. format: 'YYYY/MM/DD H:mm:ss',//use this option to display seconds
  108. icons: {
  109. time: 'btn btn-lg icon-time',
  110. date: 'btn btn-lg icon-calendar',
  111. up: 'fa icon-chevron-up',
  112. down: 'fa icon-chevron-down',
  113. previous: 'fa icon-chevron-left',
  114. next: 'fa icon-chevron-right',
  115. today: 'fa icon-arrows ',
  116. clear: 'fa icon-trash',
  117. close: 'fa icon-times'
  118. }
  119. }).next().on(ace.click_event, function(){
  120. $(this).prev().focus();
  121. });
  122. $('#end_time').datetimepicker({
  123. format: 'YYYY/MM/DD H:mm:ss',//use this option to display seconds
  124. icons: {
  125. time: 'btn btn-lg icon-time',
  126. date: 'btn btn-lg icon-calendar',
  127. up: 'fa icon-chevron-up',
  128. down: 'fa icon-chevron-down',
  129. previous: 'fa icon-chevron-left',
  130. next: 'fa icon-chevron-right',
  131. today: 'fa icon-arrows ',
  132. clear: 'fa icon-trash',
  133. close: 'fa icon-times'
  134. }
  135. }).next().on(ace.click_event, function(){
  136. $(this).prev().focus();
  137. });
  138. $('.J_SubmitPL').on('click',function(){
  139. var begin_time = $('#begin_time').val();
  140. var end_time = $('#end_time').val();
  141. var s_url = $('#sub_url').val();
  142. $.ajax({
  143. url:s_url,
  144. type:'post',
  145. data:{begin_time:begin_time,end_time:end_time},
  146. dataType:'json',
  147. success:function(result){
  148. if(result.code == 1) {
  149. alert('审核通过');
  150. location.href = location.href;
  151. return false;
  152. } else {
  153. alert(result.msg);
  154. }
  155. }
  156. })
  157. })
  158. $('.shenhe').click(function(){
  159. var s_url = $(this).attr('rel-url');
  160. $('#sub_url').val(s_url);
  161. $("#dialog").css({'position' : 'fixed','display' : 'block', 'z-index' : '9999'});
  162. })
  163. //关闭弹出层
  164. $('#dialog').on('click','.ks-ext-close',function(){
  165. $("#dialog").css('display','none');
  166. $('.ks-ext-mask').css('display','none');
  167. return false;
  168. });
  169. //关闭弹出层
  170. $('#dialog').on('click','.J_Cancel',function(){
  171. $("#dialog").css('display','none');
  172. $('.ks-ext-mask').css('display','none');
  173. return false;
  174. });
  175. })
  176. </script>
  177. </block>