index.html 6.2 KB

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