index.html 7.0 KB

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