123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221 |
- <extend name="Public:base" />
- <block name="content">
- <div class="page-header">
- <a href="{:U('Spike/add')}" class="btn btn-primary">添加限时秒杀活动</a>
- </div>
- <div class="row">
- <div class="col-xs-12">
- <div class="table-responsive">
- <table class="table table-striped table-bordered table-hover">
- <thead>
- <tr>
- <th>ID</th>
- <th>活动名称</th>
- <th>线上活动商品数量</th>
- <th>待审核商品数量</th>
- <th>活动开始时间</th>
- <th>活动结束时间</th>
- <th>活动添加时间</th>
- <th>推荐到首页</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- <volist name="list" id="data" empty="$empty">
- <tr>
- <td>{$data.id}</td>
- <td>{$data.name}</td>
- <td>
-
- <?php
- if($data['on_goods'] > 0)
- {
- ?>
- <b class="red">{$data.on_goods}</b>
- <?php }else{ ?>
- {$data.on_goods}
- <?php } ?>
- </td>
- <td>
- <?php
- if($data['wait_goods'] > 0)
- {
- ?>
- <b class="red">{$data.wait_goods}</b>
- <?php }else{ ?>
- {$data.wait_goods}
- <?php } ?>
- </td>
- <td>
- <?php echo date('Y-m-d H:i:s',$data['begin_time']); ?>
- </td>
- <td>
- <?php echo date('Y-m-d H:i:s',$data['end_time']); ?>
- </td>
- <td>
- <?php echo date('Y-m-d H:i:s',$data['add_time']); ?>
- </td>
-
- <td>
- <label class="inline">
- <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">
- <span class="lbl middle"></span>
- </label>
-
- </td>
- <td>
- <a class="btn btn-xs btn-info" href='{:U("Spike/edit",array("id"=>$data["id"]))}'>
- <i class="icon-check bigger-120"></i>
- </a>
- <a class="btn btn-xs btn-info" href='{:U("Spike/activity_goods",array("id"=>$data["id"]))}'>
- <i class="icon-check bigger-120"></i>
- 查看活动商品
- </a>
- <a class="btn btn-xs btn-info" href='{:U("Spike/take_spike",array("id"=>$data["id"]))}'>
- <i class="icon-check bigger-120"></i>
- 添加活动商品
- </a>
- </td>
- </tr>
- </volist>
-
- <tr>
- <td colspan="20" class="page">{$page}</td>
- </tr>
- </tbody>
-
- </table>
- </div>
- </div>
- </div>
- <link rel="stylesheet" href="__CSS__/dialog.css" />
- <div class="ks-ext-mask" style="position: fixed; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 999; display:none"></div>
- <div id="dialog" class="dialog" style="z-index: 9999; display:none">
- <div class="ks-contentbox">
- <div class="title">
- <span>秒杀产品上线时间设置</span><a class="ks-ext-close" href="javascript:void(0)">X</a></div>
-
- <dl>
- <dt>开始时间</dt>
- <dd><input name="begin_time" id="begin_time" type="text" value="<?php echo date('Y-m-d H:i:s',time()); ?>" size="50" /></dd>
- <dt>结束时间</dt>
- <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>
- </dl>
-
- <div class="J_DefaultMessage"></div>
- <div class="bottom">
- <input type="hidden" id="sub_url" value="" />
- <a href="javascript:void(0);" class="J_SubmitPL ncsc-btn ncsc-btn-green">确认</a>
- </div>
-
- </div>
- </div>
-
- </block>
- <block name="javascript">
- <script src="__PUBLIC__/js/moment/moment.js"></script>
- <script src="__PUBLIC__/js/moment/locale/zh-cn.js"></script>
- <script src="__PUBLIC__/js/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js"></script>
- <link rel="stylesheet" href="__PUBLIC__/js/bootstrap-timepicker/css/bootstrap-timepicker.css" />
- <script>
- $(function(){
- $('#begin_time').datetimepicker({
- format: 'YYYY/MM/DD H:mm:ss',//use this option to display seconds
- icons: {
- time: 'btn btn-lg icon-time',
- date: 'btn btn-lg icon-calendar',
- up: 'fa icon-chevron-up',
- down: 'fa icon-chevron-down',
- previous: 'fa icon-chevron-left',
- next: 'fa icon-chevron-right',
- today: 'fa icon-arrows ',
- clear: 'fa icon-trash',
- close: 'fa icon-times'
- }
- }).next().on(ace.click_event, function(){
- $(this).prev().focus();
- });
-
- $('#end_time').datetimepicker({
- format: 'YYYY/MM/DD H:mm:ss',//use this option to display seconds
- icons: {
- time: 'btn btn-lg icon-time',
- date: 'btn btn-lg icon-calendar',
- up: 'fa icon-chevron-up',
- down: 'fa icon-chevron-down',
- previous: 'fa icon-chevron-left',
- next: 'fa icon-chevron-right',
- today: 'fa icon-arrows ',
- clear: 'fa icon-trash',
- close: 'fa icon-times'
- }
- }).next().on(ace.click_event, function(){
- $(this).prev().focus();
- });
-
- $('.J_SubmitPL').on('click',function(){
- var begin_time = $('#begin_time').val();
- var end_time = $('#end_time').val();
-
- var s_url = $('#sub_url').val();
- $.ajax({
- url:s_url,
- type:'post',
- data:{begin_time:begin_time,end_time:end_time},
- dataType:'json',
- success:function(result){
- if(result.code == 1) {
- alert('审核通过');
- location.href = location.href;
- return false;
- } else {
- alert(result.msg);
- }
- }
-
- })
- })
-
- $('.qiyongstatus').on('click', function(){
- var gid = $(this).attr('gid');
- $.ajax({
- url:"{:U('Spike/toggle_statues_show')}",
- type:'post',
- data:{gid:gid},
- dataType:'json',
- success:function(res){
- //code
- }
- })
- });
-
- $('.shenhe').click(function(){
- var s_url = $(this).attr('rel-url');
- $('#sub_url').val(s_url);
- $("#dialog").css({'position' : 'fixed','display' : 'block', 'z-index' : '9999'});
- })
-
- //关闭弹出层
- $('#dialog').on('click','.ks-ext-close',function(){
- $("#dialog").css('display','none');
- $('.ks-ext-mask').css('display','none');
- return false;
- });
- //关闭弹出层
- $('#dialog').on('click','.J_Cancel',function(){
- $("#dialog").css('display','none');
- $('.ks-ext-mask').css('display','none');
- return false;
- });
-
-
-
- })
- </script>
- </block>
|