index.html 6.0 KB

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